From c4d3dbc470ed20d02955c05beabd4b4410b91e0f Mon Sep 17 00:00:00 2001 From: Azure SDK Bot Date: Thu, 10 Oct 2019 15:49:18 +0800 Subject: [PATCH] Generated from b90b1c367459cd32fc49a26daf13ff8f46ad79fa (#7760) chore: jsonfmt frontdoor --- .../frontdoor/front_door_management_client.py | 943 ++++++++++++++++++ .../azure/mgmt/frontdoor/models/__init__.py | 96 +- .../azure/mgmt/frontdoor/models/endpoint.py | 32 + .../mgmt/frontdoor/models/endpoint_py3.py | 32 + .../azure/mgmt/frontdoor/models/experiment.py | 82 ++ .../mgmt/frontdoor/models/experiment_paged.py | 27 + .../mgmt/frontdoor/models/experiment_py3.py | 82 ++ .../models/experiment_update_model.py | 38 + .../models/experiment_update_model_py3.py | 38 + .../front_door_management_client_enums.py | 65 +- .../mgmt/frontdoor/models/latency_metric.py | 84 ++ .../frontdoor/models/latency_metric_py3.py | 84 ++ .../frontdoor/models/latency_scorecard.py | 94 ++ .../frontdoor/models/latency_scorecard_py3.py | 94 ++ .../models/preconfigured_endpoint.py | 65 ++ .../models/preconfigured_endpoint_paged.py | 27 + .../models/preconfigured_endpoint_py3.py | 65 ++ .../azure/mgmt/frontdoor/models/profile.py | 64 ++ .../mgmt/frontdoor/models/profile_paged.py | 27 + .../mgmt/frontdoor/models/profile_py3.py | 64 ++ .../frontdoor/models/profile_update_model.py | 33 + .../models/profile_update_model_py3.py | 33 + .../azure/mgmt/frontdoor/models/timeseries.py | 82 ++ .../frontdoor/models/timeseries_data_point.py | 32 + .../models/timeseries_data_point_py3.py | 32 + .../mgmt/frontdoor/models/timeseries_py3.py | 82 ++ .../mgmt/frontdoor/operations/__init__.py | 6 + .../operations/experiments_operations.py | 108 ++ .../preconfigured_endpoints_operations.py | 108 ++ .../operations/profiles_operations.py | 168 ++++ 30 files changed, 2757 insertions(+), 30 deletions(-) create mode 100644 sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/endpoint.py create mode 100644 sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/endpoint_py3.py create mode 100644 sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/experiment.py create mode 100644 sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/experiment_paged.py create mode 100644 sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/experiment_py3.py create mode 100644 sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/experiment_update_model.py create mode 100644 sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/experiment_update_model_py3.py create mode 100644 sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/latency_metric.py create mode 100644 sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/latency_metric_py3.py create mode 100644 sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/latency_scorecard.py create mode 100644 sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/latency_scorecard_py3.py create mode 100644 sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/preconfigured_endpoint.py create mode 100644 sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/preconfigured_endpoint_paged.py create mode 100644 sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/preconfigured_endpoint_py3.py create mode 100644 sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/profile.py create mode 100644 sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/profile_paged.py create mode 100644 sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/profile_py3.py create mode 100644 sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/profile_update_model.py create mode 100644 sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/profile_update_model_py3.py create mode 100644 sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/timeseries.py create mode 100644 sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/timeseries_data_point.py create mode 100644 sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/timeseries_data_point_py3.py create mode 100644 sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/timeseries_py3.py create mode 100644 sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/experiments_operations.py create mode 100644 sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/preconfigured_endpoints_operations.py create mode 100644 sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/profiles_operations.py diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/front_door_management_client.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/front_door_management_client.py index 5134686e57f..54712b72424 100644 --- a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/front_door_management_client.py +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/front_door_management_client.py @@ -18,6 +18,9 @@ from msrest.polling import LROPoller, NoPolling from msrestazure.polling.arm_polling import ARMPolling import uuid +from .operations.profiles_operations import ProfilesOperations +from .operations.preconfigured_endpoints_operations import PreconfiguredEndpointsOperations +from .operations.experiments_operations import ExperimentsOperations from .operations.front_doors_operations import FrontDoorsOperations from .operations.frontend_endpoints_operations import FrontendEndpointsOperations from .operations.endpoints_operations import EndpointsOperations @@ -66,6 +69,12 @@ class FrontDoorManagementClient(SDKClient): :ivar config: Configuration for client. :vartype config: FrontDoorManagementClientConfiguration + :ivar profiles: Profiles operations + :vartype profiles: azure.mgmt.frontdoor.operations.ProfilesOperations + :ivar preconfigured_endpoints: PreconfiguredEndpoints operations + :vartype preconfigured_endpoints: azure.mgmt.frontdoor.operations.PreconfiguredEndpointsOperations + :ivar experiments: Experiments operations + :vartype experiments: azure.mgmt.frontdoor.operations.ExperimentsOperations :ivar front_doors: FrontDoors operations :vartype front_doors: azure.mgmt.frontdoor.operations.FrontDoorsOperations :ivar frontend_endpoints: FrontendEndpoints operations @@ -97,6 +106,12 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) + self.profiles = ProfilesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.preconfigured_endpoints = PreconfiguredEndpointsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.experiments = ExperimentsOperations( + self._client, self.config, self._serialize, self._deserialize) self.front_doors = FrontDoorsOperations( self._client, self.config, self._serialize, self._deserialize) self.frontend_endpoints = FrontendEndpointsOperations( @@ -108,6 +123,934 @@ def __init__( self.managed_rule_sets = ManagedRuleSetsOperations( self._client, self.config, self._serialize, self._deserialize) + def get_network_experiment_profiles_by_profile_name( + self, resource_group_name, profile_name, custom_headers=None, raw=False, **operation_config): + """Gets an NetworkExperiment Profile by ProfileName. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param profile_name: The Profile identifier associated with the Tenant + and Partner + :type profile_name: 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: Profile or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.frontdoor.models.Profile or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + api_version = "2019-11-01" + + # Construct URL + url = self.get_network_experiment_profiles_by_profile_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', max_length=80, min_length=1, pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str', pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$') + } + 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['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Profile', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_network_experiment_profiles_by_profile_name.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/NetworkExperimentProfiles/{profileName}'} + + + def _create_or_update_network_experiment_profiles_initial( + self, profile_name, resource_group_name, parameters, custom_headers=None, raw=False, **operation_config): + api_version = "2019-11-01" + + # Construct URL + url = self.create_or_update_network_experiment_profiles.metadata['url'] + path_format_arguments = { + 'profileName': self._serialize.url("profile_name", profile_name, 'str', pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$'), + '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=80, min_length=1, pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$') + } + 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['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if 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, 'Profile') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201, 202]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Profile', response) + if response.status_code == 201: + deserialized = self._deserialize('Profile', response) + if response.status_code == 202: + deserialized = self._deserialize('Profile', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update_network_experiment_profiles( + self, profile_name, resource_group_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates an NetworkExperiment Profile. + + :param profile_name: The Profile identifier associated with the Tenant + and Partner + :type profile_name: str + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param parameters: An Network Experiment Profile + :type parameters: ~azure.mgmt.frontdoor.models.Profile + :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 Profile or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.frontdoor.models.Profile] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.frontdoor.models.Profile]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._create_or_update_network_experiment_profiles_initial( + profile_name=profile_name, + resource_group_name=resource_group_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Profile', 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_network_experiment_profiles.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/NetworkExperimentProfiles/{profileName}'} + + + def _update_network_experiment_profiles_by_profiles_name_initial( + self, resource_group_name, profile_name, enabled_state=None, tags=None, custom_headers=None, raw=False, **operation_config): + parameters = models.ProfileUpdateModel(enabled_state=enabled_state, tags=tags) + + api_version = "2019-11-01" + + # Construct URL + url = self.update_network_experiment_profiles_by_profiles_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', max_length=80, min_length=1, pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str', pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$') + } + 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['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if 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, 'ProfileUpdateModel') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Profile', response) + if response.status_code == 202: + deserialized = self._deserialize('Profile', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update_network_experiment_profiles_by_profiles_name( + self, resource_group_name, profile_name, enabled_state=None, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates an NetworkExperimentProfiles by NetworkExperimentProfile name. + + Updates an NetworkExperimentProfiles. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param profile_name: The Profile identifier associated with the Tenant + and Partner + :type profile_name: str + :param enabled_state: The enabled state of the Profile. Possible + values include: 'Enabled', 'Disabled' + :type enabled_state: str or ~azure.mgmt.frontdoor.models.State + :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 Profile or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.frontdoor.models.Profile] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.frontdoor.models.Profile]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._update_network_experiment_profiles_by_profiles_name_initial( + resource_group_name=resource_group_name, + profile_name=profile_name, + enabled_state=enabled_state, + tags=tags, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Profile', 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_network_experiment_profiles_by_profiles_name.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/NetworkExperimentProfiles/{profileName}'} + + + def _delete_network_experiment_profiles_initial( + self, resource_group_name, profile_name, custom_headers=None, raw=False, **operation_config): + api_version = "2019-11-01" + + # Construct URL + url = self.delete_network_experiment_profiles.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=80, min_length=1, pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str', pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$') + } + 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 = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if 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, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete_network_experiment_profiles( + self, resource_group_name, profile_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes an NetworkExperiment Profile by ProfileName. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param profile_name: The Profile identifier associated with the Tenant + and Partner + :type profile_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:`ErrorResponseException` + """ + raw_result = self._delete_network_experiment_profiles_initial( + resource_group_name=resource_group_name, + profile_name=profile_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_network_experiment_profiles.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/NetworkExperimentProfiles/{profileName}'} + + def get_experiments_by_experiment_name( + self, resource_group_name, profile_name, experiment_name, custom_headers=None, raw=False, **operation_config): + """Gets an Experiment by ExperimentName. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param profile_name: The Profile identifier associated with the Tenant + and Partner + :type profile_name: str + :param experiment_name: The Experiment identifier associated with the + Experiment + :type experiment_name: 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: Experiment or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.frontdoor.models.Experiment or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + api_version = "2019-11-01" + + # Construct URL + url = self.get_experiments_by_experiment_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', max_length=80, min_length=1, pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str', pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$'), + 'experimentName': self._serialize.url("experiment_name", experiment_name, 'str', pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$') + } + 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['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Experiment', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_experiments_by_experiment_name.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/NetworkExperimentProfiles/{profileName}/Experiments/{experimentName}'} + + + def _create_or_update_experiments_initial( + self, resource_group_name, profile_name, experiment_name, parameters, custom_headers=None, raw=False, **operation_config): + api_version = "2019-11-01" + + # Construct URL + url = self.create_or_update_experiments.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=80, min_length=1, pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str', pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$'), + 'experimentName': self._serialize.url("experiment_name", experiment_name, 'str', pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$') + } + 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['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if 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, 'Experiment') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201, 202]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Experiment', response) + if response.status_code == 201: + deserialized = self._deserialize('Experiment', response) + if response.status_code == 202: + deserialized = self._deserialize('Experiment', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update_experiments( + self, resource_group_name, profile_name, experiment_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates or updates an Experiment. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param profile_name: The Profile identifier associated with the Tenant + and Partner + :type profile_name: str + :param experiment_name: The Experiment identifier associated with the + Experiment + :type experiment_name: str + :param parameters: The Experiment resource + :type parameters: ~azure.mgmt.frontdoor.models.Experiment + :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 Experiment or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.frontdoor.models.Experiment] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.frontdoor.models.Experiment]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._create_or_update_experiments_initial( + resource_group_name=resource_group_name, + profile_name=profile_name, + experiment_name=experiment_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Experiment', 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_experiments.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/NetworkExperimentProfiles/{profileName}/Experiments/{experimentName}'} + + + def _update_experiments_by_experiment_name_initial( + self, resource_group_name, profile_name, experiment_name, parameters, custom_headers=None, raw=False, **operation_config): + api_version = "2019-11-01" + + # Construct URL + url = self.update_experiments_by_experiment_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', max_length=80, min_length=1, pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str', pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$'), + 'experimentName': self._serialize.url("experiment_name", experiment_name, 'str', pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$') + } + 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['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if 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, 'ExperimentUpdateModel') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Experiment', response) + if response.status_code == 202: + deserialized = self._deserialize('Experiment', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update_experiments_by_experiment_name( + self, resource_group_name, profile_name, experiment_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates an Experiment by Experiment id. + + Updates an Experiment. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param profile_name: The Profile identifier associated with the Tenant + and Partner + :type profile_name: str + :param experiment_name: The Experiment identifier associated with the + Experiment + :type experiment_name: str + :param parameters: The Experiment Update Model + :type parameters: ~azure.mgmt.frontdoor.models.ExperimentUpdateModel + :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 Experiment or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.frontdoor.models.Experiment] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.frontdoor.models.Experiment]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._update_experiments_by_experiment_name_initial( + resource_group_name=resource_group_name, + profile_name=profile_name, + experiment_name=experiment_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Experiment', 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_experiments_by_experiment_name.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/NetworkExperimentProfiles/{profileName}/Experiments/{experimentName}'} + + + def _delete_experiments_initial( + self, resource_group_name, profile_name, experiment_name, custom_headers=None, raw=False, **operation_config): + api_version = "2019-11-01" + + # Construct URL + url = self.delete_experiments.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=80, min_length=1, pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str', pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$'), + 'experimentName': self._serialize.url("experiment_name", experiment_name, 'str', pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$') + } + 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 = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if 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, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete_experiments( + self, resource_group_name, profile_name, experiment_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes an Experiment. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param profile_name: The Profile identifier associated with the Tenant + and Partner + :type profile_name: str + :param experiment_name: The Experiment identifier associated with the + Experiment + :type experiment_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:`ErrorResponseException` + """ + raw_result = self._delete_experiments_initial( + resource_group_name=resource_group_name, + profile_name=profile_name, + experiment_name=experiment_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_experiments.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/NetworkExperimentProfiles/{profileName}/Experiments/{experimentName}'} + + def get_latency_scorecards( + self, resource_group_name, profile_name, experiment_name, aggregation_interval, end_date_time_utc=None, country=None, custom_headers=None, raw=False, **operation_config): + """Gets a Latency Scorecard for a given Experiment. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param profile_name: The Profile identifier associated with the Tenant + and Partner + :type profile_name: str + :param experiment_name: The Experiment identifier associated with the + Experiment + :type experiment_name: str + :param aggregation_interval: The aggregation interval of the Latency + Scorecard. Possible values include: 'Daily', 'Weekly', 'Monthly' + :type aggregation_interval: str or + ~azure.mgmt.frontdoor.models.LatencyScorecardAggregationInterval + :param end_date_time_utc: The end DateTime of the Latency Scorecard in + UTC + :type end_date_time_utc: str + :param country: The country associated with the Latency Scorecard. + Values are country ISO codes as specified here- + https://www.iso.org/iso-3166-country-codes.html + :type country: 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: LatencyScorecard or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.frontdoor.models.LatencyScorecard or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + api_version = "2019-11-01" + + # Construct URL + url = self.get_latency_scorecards.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=80, min_length=1, pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str', pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$'), + 'experimentName': self._serialize.url("experiment_name", experiment_name, 'str', pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$') + } + 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 end_date_time_utc is not None: + query_parameters['endDateTimeUTC'] = self._serialize.query("end_date_time_utc", end_date_time_utc, 'str') + if country is not None: + query_parameters['country'] = self._serialize.query("country", country, 'str') + query_parameters['aggregationInterval'] = self._serialize.query("aggregation_interval", aggregation_interval, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('LatencyScorecard', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_latency_scorecards.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/NetworkExperimentProfiles/{profileName}/Experiments/{experimentName}/LatencyScorecard'} + + def get_timeseries( + self, resource_group_name, profile_name, experiment_name, start_date_time_utc, end_date_time_utc, aggregation_interval, timeseries_type, endpoint=None, country=None, custom_headers=None, raw=False, **operation_config): + """Gets a Timeseries for a given Experiment. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param profile_name: The Profile identifier associated with the Tenant + and Partner + :type profile_name: str + :param experiment_name: The Experiment identifier associated with the + Experiment + :type experiment_name: str + :param start_date_time_utc: The start DateTime of the Timeseries in + UTC + :type start_date_time_utc: datetime + :param end_date_time_utc: The end DateTime of the Timeseries in UTC + :type end_date_time_utc: datetime + :param aggregation_interval: The aggregation interval of the + Timeseries. Possible values include: 'Hourly', 'Daily' + :type aggregation_interval: str or + ~azure.mgmt.frontdoor.models.TimeseriesAggregationInterval + :param timeseries_type: The type of Timeseries. Possible values + include: 'MeasurementCounts', 'LatencyP50', 'LatencyP75', 'LatencyP95' + :type timeseries_type: str or + ~azure.mgmt.frontdoor.models.TimeseriesType + :param endpoint: The specific endpoint + :type endpoint: str + :param country: The country associated with the Timeseries. Values are + country ISO codes as specified here- + https://www.iso.org/iso-3166-country-codes.html + :type country: 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: Timeseries or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.frontdoor.models.Timeseries or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + api_version = "2019-11-01" + + # Construct URL + url = self.get_timeseries.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=80, min_length=1, pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str', pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$'), + 'experimentName': self._serialize.url("experiment_name", experiment_name, 'str', pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$') + } + 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') + query_parameters['startDateTimeUTC'] = self._serialize.query("start_date_time_utc", start_date_time_utc, 'iso-8601') + query_parameters['endDateTimeUTC'] = self._serialize.query("end_date_time_utc", end_date_time_utc, 'iso-8601') + query_parameters['aggregationInterval'] = self._serialize.query("aggregation_interval", aggregation_interval, 'str') + query_parameters['timeseriesType'] = self._serialize.query("timeseries_type", timeseries_type, 'str') + if endpoint is not None: + query_parameters['endpoint'] = self._serialize.query("endpoint", endpoint, 'str') + if country is not None: + query_parameters['country'] = self._serialize.query("country", country, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Timeseries', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_timeseries.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/NetworkExperimentProfiles/{profileName}/Experiments/{experimentName}/Timeseries'} + def check_front_door_name_availability( self, name, type, custom_headers=None, raw=False, **operation_config): """Check the availability of a Front Door resource name. diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/__init__.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/__init__.py index d58a46f8807..5a636ab3080 100644 --- a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/__init__.py +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/__init__.py @@ -10,6 +10,23 @@ # -------------------------------------------------------------------------- try: + from .error_details_py3 import ErrorDetails + from .error_py3 import Error + from .azure_async_operation_result_py3 import AzureAsyncOperationResult + from .resource_py3 import Resource + from .sub_resource_py3 import SubResource + from .tags_object_py3 import TagsObject + from .profile_py3 import Profile + from .endpoint_py3 import Endpoint + from .profile_update_model_py3 import ProfileUpdateModel + from .experiment_update_model_py3 import ExperimentUpdateModel + from .experiment_py3 import Experiment + from .latency_metric_py3 import LatencyMetric + from .latency_scorecard_py3 import LatencyScorecard + from .timeseries_data_point_py3 import TimeseriesDataPoint + from .timeseries_py3 import Timeseries + from .preconfigured_endpoint_py3 import PreconfiguredEndpoint + from .error_response_py3 import ErrorResponse, ErrorResponseException from .front_door_py3 import FrontDoor from .routing_rule_py3 import RoutingRule from .load_balancing_settings_model_py3 import LoadBalancingSettingsModel @@ -22,7 +39,6 @@ from .front_door_update_parameters_py3 import FrontDoorUpdateParameters from .purge_parameters_py3 import PurgeParameters from .routing_rule_list_result_py3 import RoutingRuleListResult - from .sub_resource_py3 import SubResource from .route_configuration_py3 import RouteConfiguration from .routing_rule_update_parameters_py3 import RoutingRuleUpdateParameters from .cache_configuration_py3 import CacheConfiguration @@ -39,14 +55,8 @@ from .frontend_endpoint_update_parameters_py3 import FrontendEndpointUpdateParameters from .validate_custom_domain_input_py3 import ValidateCustomDomainInput from .validate_custom_domain_output_py3 import ValidateCustomDomainOutput - from .error_response_py3 import ErrorResponse, ErrorResponseException from .check_name_availability_input_py3 import CheckNameAvailabilityInput from .check_name_availability_output_py3 import CheckNameAvailabilityOutput - from .resource_py3 import Resource - from .error_details_py3 import ErrorDetails - from .error_py3 import Error - from .azure_async_operation_result_py3 import AzureAsyncOperationResult - from .tags_object_py3 import TagsObject from .policy_settings_py3 import PolicySettings from .match_condition_py3 import MatchCondition from .custom_rule_py3 import CustomRule @@ -62,6 +72,23 @@ from .managed_rule_group_definition_py3 import ManagedRuleGroupDefinition from .managed_rule_set_definition_py3 import ManagedRuleSetDefinition except (SyntaxError, ImportError): + from .error_details import ErrorDetails + from .error import Error + from .azure_async_operation_result import AzureAsyncOperationResult + from .resource import Resource + from .sub_resource import SubResource + from .tags_object import TagsObject + from .profile import Profile + from .endpoint import Endpoint + from .profile_update_model import ProfileUpdateModel + from .experiment_update_model import ExperimentUpdateModel + from .experiment import Experiment + from .latency_metric import LatencyMetric + from .latency_scorecard import LatencyScorecard + from .timeseries_data_point import TimeseriesDataPoint + from .timeseries import Timeseries + from .preconfigured_endpoint import PreconfiguredEndpoint + from .error_response import ErrorResponse, ErrorResponseException from .front_door import FrontDoor from .routing_rule import RoutingRule from .load_balancing_settings_model import LoadBalancingSettingsModel @@ -74,7 +101,6 @@ from .front_door_update_parameters import FrontDoorUpdateParameters from .purge_parameters import PurgeParameters from .routing_rule_list_result import RoutingRuleListResult - from .sub_resource import SubResource from .route_configuration import RouteConfiguration from .routing_rule_update_parameters import RoutingRuleUpdateParameters from .cache_configuration import CacheConfiguration @@ -91,14 +117,8 @@ from .frontend_endpoint_update_parameters import FrontendEndpointUpdateParameters from .validate_custom_domain_input import ValidateCustomDomainInput from .validate_custom_domain_output import ValidateCustomDomainOutput - from .error_response import ErrorResponse, ErrorResponseException from .check_name_availability_input import CheckNameAvailabilityInput from .check_name_availability_output import CheckNameAvailabilityOutput - from .resource import Resource - from .error_details import ErrorDetails - from .error import Error - from .azure_async_operation_result import AzureAsyncOperationResult - from .tags_object import TagsObject from .policy_settings import PolicySettings from .match_condition import MatchCondition from .custom_rule import CustomRule @@ -113,11 +133,20 @@ from .managed_rule_definition import ManagedRuleDefinition from .managed_rule_group_definition import ManagedRuleGroupDefinition from .managed_rule_set_definition import ManagedRuleSetDefinition +from .profile_paged import ProfilePaged +from .preconfigured_endpoint_paged import PreconfiguredEndpointPaged +from .experiment_paged import ExperimentPaged from .front_door_paged import FrontDoorPaged from .frontend_endpoint_paged import FrontendEndpointPaged from .web_application_firewall_policy_paged import WebApplicationFirewallPolicyPaged from .managed_rule_set_definition_paged import ManagedRuleSetDefinitionPaged from .front_door_management_client_enums import ( + NetworkOperationStatus, + NetworkExperimentResourceState, + State, + AggregationInterval, + TimeseriesType, + EndpointType, FrontDoorResourceState, CustomHttpsProvisioningState, CustomHttpsProvisioningSubstate, @@ -139,7 +168,6 @@ SessionAffinityEnabledState, ResourceType, Availability, - NetworkOperationStatus, PolicyEnabledState, PolicyMode, CustomRuleEnabledState, @@ -152,9 +180,28 @@ ManagedRuleExclusionSelectorMatchOperator, ManagedRuleEnabledState, PolicyResourceState, + LatencyScorecardAggregationInterval, + TimeseriesAggregationInterval, ) __all__ = [ + 'ErrorDetails', + 'Error', + 'AzureAsyncOperationResult', + 'Resource', + 'SubResource', + 'TagsObject', + 'Profile', + 'Endpoint', + 'ProfileUpdateModel', + 'ExperimentUpdateModel', + 'Experiment', + 'LatencyMetric', + 'LatencyScorecard', + 'TimeseriesDataPoint', + 'Timeseries', + 'PreconfiguredEndpoint', + 'ErrorResponse', 'ErrorResponseException', 'FrontDoor', 'RoutingRule', 'LoadBalancingSettingsModel', @@ -167,7 +214,6 @@ 'FrontDoorUpdateParameters', 'PurgeParameters', 'RoutingRuleListResult', - 'SubResource', 'RouteConfiguration', 'RoutingRuleUpdateParameters', 'CacheConfiguration', @@ -184,14 +230,8 @@ 'FrontendEndpointUpdateParameters', 'ValidateCustomDomainInput', 'ValidateCustomDomainOutput', - 'ErrorResponse', 'ErrorResponseException', 'CheckNameAvailabilityInput', 'CheckNameAvailabilityOutput', - 'Resource', - 'ErrorDetails', - 'Error', - 'AzureAsyncOperationResult', - 'TagsObject', 'PolicySettings', 'MatchCondition', 'CustomRule', @@ -206,10 +246,19 @@ 'ManagedRuleDefinition', 'ManagedRuleGroupDefinition', 'ManagedRuleSetDefinition', + 'ProfilePaged', + 'PreconfiguredEndpointPaged', + 'ExperimentPaged', 'FrontDoorPaged', 'FrontendEndpointPaged', 'WebApplicationFirewallPolicyPaged', 'ManagedRuleSetDefinitionPaged', + 'NetworkOperationStatus', + 'NetworkExperimentResourceState', + 'State', + 'AggregationInterval', + 'TimeseriesType', + 'EndpointType', 'FrontDoorResourceState', 'CustomHttpsProvisioningState', 'CustomHttpsProvisioningSubstate', @@ -231,7 +280,6 @@ 'SessionAffinityEnabledState', 'ResourceType', 'Availability', - 'NetworkOperationStatus', 'PolicyEnabledState', 'PolicyMode', 'CustomRuleEnabledState', @@ -244,4 +292,6 @@ 'ManagedRuleExclusionSelectorMatchOperator', 'ManagedRuleEnabledState', 'PolicyResourceState', + 'LatencyScorecardAggregationInterval', + 'TimeseriesAggregationInterval', ] diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/endpoint.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/endpoint.py new file mode 100644 index 00000000000..5f26f0bcd81 --- /dev/null +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/endpoint.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 Endpoint(Model): + """Defines the endpoint properties. + + :param name: The name of the endpoint + :type name: str + :param endpoint: The endpoint URL + :type endpoint: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'endpoint': {'key': 'endpoint', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Endpoint, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.endpoint = kwargs.get('endpoint', None) diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/endpoint_py3.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/endpoint_py3.py new file mode 100644 index 00000000000..a1989c1b152 --- /dev/null +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/endpoint_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 Endpoint(Model): + """Defines the endpoint properties. + + :param name: The name of the endpoint + :type name: str + :param endpoint: The endpoint URL + :type endpoint: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'endpoint': {'key': 'endpoint', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, endpoint: str=None, **kwargs) -> None: + super(Endpoint, self).__init__(**kwargs) + self.name = name + self.endpoint = endpoint diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/experiment.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/experiment.py new file mode 100644 index 00000000000..112283b026b --- /dev/null +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/experiment.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 .resource import Resource + + +class Experiment(Resource): + """Defines the properties of an Experiment. + + 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 location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param description: The description of the details or intents of the + Experiment + :type description: str + :param endpoint_a: The endpoint A of an experiment + :type endpoint_a: ~azure.mgmt.frontdoor.models.Endpoint + :param endpoint_b: The endpoint B of an experiment + :type endpoint_b: ~azure.mgmt.frontdoor.models.Endpoint + :param enabled_state: The state of the Experiment. Possible values + include: 'Enabled', 'Disabled' + :type enabled_state: str or ~azure.mgmt.frontdoor.models.State + :param resource_state: Resource status. Possible values include: + 'Creating', 'Enabling', 'Enabled', 'Disabling', 'Disabled', 'Deleting' + :type resource_state: str or + ~azure.mgmt.frontdoor.models.NetworkExperimentResourceState + :ivar status: The description of Experiment status from the server side + :vartype status: str + :ivar script_file_uri: The uri to the Script used in the Experiment + :vartype script_file_uri: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'status': {'readonly': True}, + 'script_file_uri': {'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}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'endpoint_a': {'key': 'properties.endpointA', 'type': 'Endpoint'}, + 'endpoint_b': {'key': 'properties.endpointB', 'type': 'Endpoint'}, + 'enabled_state': {'key': 'properties.enabledState', 'type': 'str'}, + 'resource_state': {'key': 'properties.resourceState', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'script_file_uri': {'key': 'properties.scriptFileUri', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Experiment, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.endpoint_a = kwargs.get('endpoint_a', None) + self.endpoint_b = kwargs.get('endpoint_b', None) + self.enabled_state = kwargs.get('enabled_state', None) + self.resource_state = kwargs.get('resource_state', None) + self.status = None + self.script_file_uri = None diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/experiment_paged.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/experiment_paged.py new file mode 100644 index 00000000000..e746258816c --- /dev/null +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/experiment_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 ExperimentPaged(Paged): + """ + A paging container for iterating over a list of :class:`Experiment ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Experiment]'} + } + + def __init__(self, *args, **kwargs): + + super(ExperimentPaged, self).__init__(*args, **kwargs) diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/experiment_py3.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/experiment_py3.py new file mode 100644 index 00000000000..426c2311823 --- /dev/null +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/experiment_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 .resource_py3 import Resource + + +class Experiment(Resource): + """Defines the properties of an Experiment. + + 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 location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param description: The description of the details or intents of the + Experiment + :type description: str + :param endpoint_a: The endpoint A of an experiment + :type endpoint_a: ~azure.mgmt.frontdoor.models.Endpoint + :param endpoint_b: The endpoint B of an experiment + :type endpoint_b: ~azure.mgmt.frontdoor.models.Endpoint + :param enabled_state: The state of the Experiment. Possible values + include: 'Enabled', 'Disabled' + :type enabled_state: str or ~azure.mgmt.frontdoor.models.State + :param resource_state: Resource status. Possible values include: + 'Creating', 'Enabling', 'Enabled', 'Disabling', 'Disabled', 'Deleting' + :type resource_state: str or + ~azure.mgmt.frontdoor.models.NetworkExperimentResourceState + :ivar status: The description of Experiment status from the server side + :vartype status: str + :ivar script_file_uri: The uri to the Script used in the Experiment + :vartype script_file_uri: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'status': {'readonly': True}, + 'script_file_uri': {'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}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'endpoint_a': {'key': 'properties.endpointA', 'type': 'Endpoint'}, + 'endpoint_b': {'key': 'properties.endpointB', 'type': 'Endpoint'}, + 'enabled_state': {'key': 'properties.enabledState', 'type': 'str'}, + 'resource_state': {'key': 'properties.resourceState', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'script_file_uri': {'key': 'properties.scriptFileUri', 'type': 'str'}, + } + + def __init__(self, *, location: str=None, tags=None, description: str=None, endpoint_a=None, endpoint_b=None, enabled_state=None, resource_state=None, **kwargs) -> None: + super(Experiment, self).__init__(location=location, tags=tags, **kwargs) + self.description = description + self.endpoint_a = endpoint_a + self.endpoint_b = endpoint_b + self.enabled_state = enabled_state + self.resource_state = resource_state + self.status = None + self.script_file_uri = None diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/experiment_update_model.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/experiment_update_model.py new file mode 100644 index 00000000000..eff4cb4fb13 --- /dev/null +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/experiment_update_model.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 ExperimentUpdateModel(Model): + """Defines modifiable attributes of an Experiment. + + :param tags: Resource tags. + :type tags: dict[str, str] + :param description: The description of the intent or details of the + Experiment + :type description: str + :param enabled_state: The state of the Experiment. Possible values + include: 'Enabled', 'Disabled' + :type enabled_state: str or ~azure.mgmt.frontdoor.models.State + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'enabled_state': {'key': 'properties.enabledState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ExperimentUpdateModel, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.description = kwargs.get('description', None) + self.enabled_state = kwargs.get('enabled_state', None) diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/experiment_update_model_py3.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/experiment_update_model_py3.py new file mode 100644 index 00000000000..7d1ca0b4e34 --- /dev/null +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/experiment_update_model_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 ExperimentUpdateModel(Model): + """Defines modifiable attributes of an Experiment. + + :param tags: Resource tags. + :type tags: dict[str, str] + :param description: The description of the intent or details of the + Experiment + :type description: str + :param enabled_state: The state of the Experiment. Possible values + include: 'Enabled', 'Disabled' + :type enabled_state: str or ~azure.mgmt.frontdoor.models.State + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'enabled_state': {'key': 'properties.enabledState', 'type': 'str'}, + } + + def __init__(self, *, tags=None, description: str=None, enabled_state=None, **kwargs) -> None: + super(ExperimentUpdateModel, self).__init__(**kwargs) + self.tags = tags + self.description = description + self.enabled_state = enabled_state diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/front_door_management_client_enums.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/front_door_management_client_enums.py index f896f57c562..3b6f0ce5093 100644 --- a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/front_door_management_client_enums.py +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/front_door_management_client_enums.py @@ -12,6 +12,51 @@ from enum import Enum +class NetworkOperationStatus(str, Enum): + + in_progress = "InProgress" + succeeded = "Succeeded" + failed = "Failed" + + +class NetworkExperimentResourceState(str, Enum): + + creating = "Creating" + enabling = "Enabling" + enabled = "Enabled" + disabling = "Disabling" + disabled = "Disabled" + deleting = "Deleting" + + +class State(str, Enum): + + enabled = "Enabled" + disabled = "Disabled" + + +class AggregationInterval(str, Enum): + + hourly = "Hourly" + daily = "Daily" + + +class TimeseriesType(str, Enum): + + measurement_counts = "MeasurementCounts" + latency_p50 = "LatencyP50" + latency_p75 = "LatencyP75" + latency_p95 = "LatencyP95" + + +class EndpointType(str, Enum): + + afd = "AFD" + azure_region = "AzureRegion" + cdn = "CDN" + atm = "ATM" + + class FrontDoorResourceState(str, Enum): creating = "Creating" @@ -156,13 +201,6 @@ class Availability(str, Enum): unavailable = "Unavailable" -class NetworkOperationStatus(str, Enum): - - in_progress = "InProgress" - succeeded = "Succeeded" - failed = "Failed" - - class PolicyEnabledState(str, Enum): disabled = "Disabled" @@ -265,3 +303,16 @@ class PolicyResourceState(str, Enum): disabling = "Disabling" disabled = "Disabled" deleting = "Deleting" + + +class LatencyScorecardAggregationInterval(str, Enum): + + daily = "Daily" + weekly = "Weekly" + monthly = "Monthly" + + +class TimeseriesAggregationInterval(str, Enum): + + hourly = "Hourly" + daily = "Daily" diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/latency_metric.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/latency_metric.py new file mode 100644 index 00000000000..76f7b7dd8df --- /dev/null +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/latency_metric.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.serialization import Model + + +class LatencyMetric(Model): + """Defines the properties of a latency metric used in the latency scorecard. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The name of the Latency Metric + :vartype name: str + :ivar end_date_time_utc: The end time of the Latency Scorecard in UTC + :vartype end_date_time_utc: str + :ivar a_value: The metric value of the A endpoint + :vartype a_value: float + :ivar b_value: The metric value of the B endpoint + :vartype b_value: float + :ivar delta: The difference in value between endpoint A and B + :vartype delta: float + :ivar delta_percent: The percent difference between endpoint A and B + :vartype delta_percent: float + :ivar a_clower95_ci: The lower end of the 95% confidence interval for + endpoint A + :vartype a_clower95_ci: float + :ivar a_hupper95_ci: The upper end of the 95% confidence interval for + endpoint A + :vartype a_hupper95_ci: float + :ivar b_clower95_ci: The lower end of the 95% confidence interval for + endpoint B + :vartype b_clower95_ci: float + :ivar b_upper95_ci: The upper end of the 95% confidence interval for + endpoint B + :vartype b_upper95_ci: float + """ + + _validation = { + 'name': {'readonly': True}, + 'end_date_time_utc': {'readonly': True}, + 'a_value': {'readonly': True}, + 'b_value': {'readonly': True}, + 'delta': {'readonly': True}, + 'delta_percent': {'readonly': True}, + 'a_clower95_ci': {'readonly': True}, + 'a_hupper95_ci': {'readonly': True}, + 'b_clower95_ci': {'readonly': True}, + 'b_upper95_ci': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'end_date_time_utc': {'key': 'endDateTimeUTC', 'type': 'str'}, + 'a_value': {'key': 'aValue', 'type': 'float'}, + 'b_value': {'key': 'bValue', 'type': 'float'}, + 'delta': {'key': 'delta', 'type': 'float'}, + 'delta_percent': {'key': 'deltaPercent', 'type': 'float'}, + 'a_clower95_ci': {'key': 'aCLower95CI', 'type': 'float'}, + 'a_hupper95_ci': {'key': 'aHUpper95CI', 'type': 'float'}, + 'b_clower95_ci': {'key': 'bCLower95CI', 'type': 'float'}, + 'b_upper95_ci': {'key': 'bUpper95CI', 'type': 'float'}, + } + + def __init__(self, **kwargs): + super(LatencyMetric, self).__init__(**kwargs) + self.name = None + self.end_date_time_utc = None + self.a_value = None + self.b_value = None + self.delta = None + self.delta_percent = None + self.a_clower95_ci = None + self.a_hupper95_ci = None + self.b_clower95_ci = None + self.b_upper95_ci = None diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/latency_metric_py3.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/latency_metric_py3.py new file mode 100644 index 00000000000..af9054007dc --- /dev/null +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/latency_metric_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 msrest.serialization import Model + + +class LatencyMetric(Model): + """Defines the properties of a latency metric used in the latency scorecard. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The name of the Latency Metric + :vartype name: str + :ivar end_date_time_utc: The end time of the Latency Scorecard in UTC + :vartype end_date_time_utc: str + :ivar a_value: The metric value of the A endpoint + :vartype a_value: float + :ivar b_value: The metric value of the B endpoint + :vartype b_value: float + :ivar delta: The difference in value between endpoint A and B + :vartype delta: float + :ivar delta_percent: The percent difference between endpoint A and B + :vartype delta_percent: float + :ivar a_clower95_ci: The lower end of the 95% confidence interval for + endpoint A + :vartype a_clower95_ci: float + :ivar a_hupper95_ci: The upper end of the 95% confidence interval for + endpoint A + :vartype a_hupper95_ci: float + :ivar b_clower95_ci: The lower end of the 95% confidence interval for + endpoint B + :vartype b_clower95_ci: float + :ivar b_upper95_ci: The upper end of the 95% confidence interval for + endpoint B + :vartype b_upper95_ci: float + """ + + _validation = { + 'name': {'readonly': True}, + 'end_date_time_utc': {'readonly': True}, + 'a_value': {'readonly': True}, + 'b_value': {'readonly': True}, + 'delta': {'readonly': True}, + 'delta_percent': {'readonly': True}, + 'a_clower95_ci': {'readonly': True}, + 'a_hupper95_ci': {'readonly': True}, + 'b_clower95_ci': {'readonly': True}, + 'b_upper95_ci': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'end_date_time_utc': {'key': 'endDateTimeUTC', 'type': 'str'}, + 'a_value': {'key': 'aValue', 'type': 'float'}, + 'b_value': {'key': 'bValue', 'type': 'float'}, + 'delta': {'key': 'delta', 'type': 'float'}, + 'delta_percent': {'key': 'deltaPercent', 'type': 'float'}, + 'a_clower95_ci': {'key': 'aCLower95CI', 'type': 'float'}, + 'a_hupper95_ci': {'key': 'aHUpper95CI', 'type': 'float'}, + 'b_clower95_ci': {'key': 'bCLower95CI', 'type': 'float'}, + 'b_upper95_ci': {'key': 'bUpper95CI', 'type': 'float'}, + } + + def __init__(self, **kwargs) -> None: + super(LatencyMetric, self).__init__(**kwargs) + self.name = None + self.end_date_time_utc = None + self.a_value = None + self.b_value = None + self.delta = None + self.delta_percent = None + self.a_clower95_ci = None + self.a_hupper95_ci = None + self.b_clower95_ci = None + self.b_upper95_ci = None diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/latency_scorecard.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/latency_scorecard.py new file mode 100644 index 00000000000..80f34332dd2 --- /dev/null +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/latency_scorecard.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 .resource import Resource + + +class LatencyScorecard(Resource): + """Defines the LatencyScorecard. + + 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 location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :ivar latency_scorecard_id: The unique identifier of the Latency Scorecard + :vartype latency_scorecard_id: str + :ivar latency_scorecard_name: The name of the Latency Scorecard + :vartype latency_scorecard_name: str + :ivar description: The description of the Latency Scorecard + :vartype description: str + :ivar endpoint_a: The A endpoint in the scorecard + :vartype endpoint_a: str + :ivar endpoint_b: The B endpoint in the scorecard + :vartype endpoint_b: str + :ivar start_date_time_utc: The start time of the Latency Scorecard in UTC + :vartype start_date_time_utc: datetime + :ivar end_date_time_utc: The end time of the Latency Scorecard in UTC + :vartype end_date_time_utc: datetime + :ivar country: The country associated with the Latency Scorecard. Values + are country ISO codes as specified here- + https://www.iso.org/iso-3166-country-codes.html + :vartype country: str + :param latency_metrics: The latency metrics of the Latency Scorecard + :type latency_metrics: list[~azure.mgmt.frontdoor.models.LatencyMetric] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'latency_scorecard_id': {'readonly': True}, + 'latency_scorecard_name': {'readonly': True}, + 'description': {'readonly': True}, + 'endpoint_a': {'readonly': True}, + 'endpoint_b': {'readonly': True}, + 'start_date_time_utc': {'readonly': True}, + 'end_date_time_utc': {'readonly': True}, + 'country': {'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}'}, + 'latency_scorecard_id': {'key': 'properties.id', 'type': 'str'}, + 'latency_scorecard_name': {'key': 'properties.name', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'endpoint_a': {'key': 'properties.endpointA', 'type': 'str'}, + 'endpoint_b': {'key': 'properties.endpointB', 'type': 'str'}, + 'start_date_time_utc': {'key': 'properties.startDateTimeUTC', 'type': 'iso-8601'}, + 'end_date_time_utc': {'key': 'properties.endDateTimeUTC', 'type': 'iso-8601'}, + 'country': {'key': 'properties.country', 'type': 'str'}, + 'latency_metrics': {'key': 'properties.latencyMetrics', 'type': '[LatencyMetric]'}, + } + + def __init__(self, **kwargs): + super(LatencyScorecard, self).__init__(**kwargs) + self.latency_scorecard_id = None + self.latency_scorecard_name = None + self.description = None + self.endpoint_a = None + self.endpoint_b = None + self.start_date_time_utc = None + self.end_date_time_utc = None + self.country = None + self.latency_metrics = kwargs.get('latency_metrics', None) diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/latency_scorecard_py3.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/latency_scorecard_py3.py new file mode 100644 index 00000000000..5497af9c427 --- /dev/null +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/latency_scorecard_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 .resource_py3 import Resource + + +class LatencyScorecard(Resource): + """Defines the LatencyScorecard. + + 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 location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :ivar latency_scorecard_id: The unique identifier of the Latency Scorecard + :vartype latency_scorecard_id: str + :ivar latency_scorecard_name: The name of the Latency Scorecard + :vartype latency_scorecard_name: str + :ivar description: The description of the Latency Scorecard + :vartype description: str + :ivar endpoint_a: The A endpoint in the scorecard + :vartype endpoint_a: str + :ivar endpoint_b: The B endpoint in the scorecard + :vartype endpoint_b: str + :ivar start_date_time_utc: The start time of the Latency Scorecard in UTC + :vartype start_date_time_utc: datetime + :ivar end_date_time_utc: The end time of the Latency Scorecard in UTC + :vartype end_date_time_utc: datetime + :ivar country: The country associated with the Latency Scorecard. Values + are country ISO codes as specified here- + https://www.iso.org/iso-3166-country-codes.html + :vartype country: str + :param latency_metrics: The latency metrics of the Latency Scorecard + :type latency_metrics: list[~azure.mgmt.frontdoor.models.LatencyMetric] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'latency_scorecard_id': {'readonly': True}, + 'latency_scorecard_name': {'readonly': True}, + 'description': {'readonly': True}, + 'endpoint_a': {'readonly': True}, + 'endpoint_b': {'readonly': True}, + 'start_date_time_utc': {'readonly': True}, + 'end_date_time_utc': {'readonly': True}, + 'country': {'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}'}, + 'latency_scorecard_id': {'key': 'properties.id', 'type': 'str'}, + 'latency_scorecard_name': {'key': 'properties.name', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'endpoint_a': {'key': 'properties.endpointA', 'type': 'str'}, + 'endpoint_b': {'key': 'properties.endpointB', 'type': 'str'}, + 'start_date_time_utc': {'key': 'properties.startDateTimeUTC', 'type': 'iso-8601'}, + 'end_date_time_utc': {'key': 'properties.endDateTimeUTC', 'type': 'iso-8601'}, + 'country': {'key': 'properties.country', 'type': 'str'}, + 'latency_metrics': {'key': 'properties.latencyMetrics', 'type': '[LatencyMetric]'}, + } + + def __init__(self, *, location: str=None, tags=None, latency_metrics=None, **kwargs) -> None: + super(LatencyScorecard, self).__init__(location=location, tags=tags, **kwargs) + self.latency_scorecard_id = None + self.latency_scorecard_name = None + self.description = None + self.endpoint_a = None + self.endpoint_b = None + self.start_date_time_utc = None + self.end_date_time_utc = None + self.country = None + self.latency_metrics = latency_metrics diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/preconfigured_endpoint.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/preconfigured_endpoint.py new file mode 100644 index 00000000000..ea318fa60fa --- /dev/null +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/preconfigured_endpoint.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 PreconfiguredEndpoint(Resource): + """Defines the properties of a preconfigured endpoint. + + 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 location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param description: The description of the endpoint + :type description: str + :param endpoint: The endpoint that is preconfigured + :type endpoint: str + :param endpoint_type: The type of endpoint. Possible values include: + 'AFD', 'AzureRegion', 'CDN', 'ATM' + :type endpoint_type: str or ~azure.mgmt.frontdoor.models.EndpointType + :param backend: The preconfigured endpoint backend + :type backend: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'endpoint': {'key': 'properties.endpoint', 'type': 'str'}, + 'endpoint_type': {'key': 'properties.endpointType', 'type': 'str'}, + 'backend': {'key': 'properties.backend', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PreconfiguredEndpoint, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.endpoint = kwargs.get('endpoint', None) + self.endpoint_type = kwargs.get('endpoint_type', None) + self.backend = kwargs.get('backend', None) diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/preconfigured_endpoint_paged.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/preconfigured_endpoint_paged.py new file mode 100644 index 00000000000..98eb0184a39 --- /dev/null +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/preconfigured_endpoint_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 PreconfiguredEndpointPaged(Paged): + """ + A paging container for iterating over a list of :class:`PreconfiguredEndpoint ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[PreconfiguredEndpoint]'} + } + + def __init__(self, *args, **kwargs): + + super(PreconfiguredEndpointPaged, self).__init__(*args, **kwargs) diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/preconfigured_endpoint_py3.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/preconfigured_endpoint_py3.py new file mode 100644 index 00000000000..9c281b05d16 --- /dev/null +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/preconfigured_endpoint_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_py3 import Resource + + +class PreconfiguredEndpoint(Resource): + """Defines the properties of a preconfigured endpoint. + + 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 location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param description: The description of the endpoint + :type description: str + :param endpoint: The endpoint that is preconfigured + :type endpoint: str + :param endpoint_type: The type of endpoint. Possible values include: + 'AFD', 'AzureRegion', 'CDN', 'ATM' + :type endpoint_type: str or ~azure.mgmt.frontdoor.models.EndpointType + :param backend: The preconfigured endpoint backend + :type backend: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'endpoint': {'key': 'properties.endpoint', 'type': 'str'}, + 'endpoint_type': {'key': 'properties.endpointType', 'type': 'str'}, + 'backend': {'key': 'properties.backend', 'type': 'str'}, + } + + def __init__(self, *, location: str=None, tags=None, description: str=None, endpoint: str=None, endpoint_type=None, backend: str=None, **kwargs) -> None: + super(PreconfiguredEndpoint, self).__init__(location=location, tags=tags, **kwargs) + self.description = description + self.endpoint = endpoint + self.endpoint_type = endpoint_type + self.backend = backend diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/profile.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/profile.py new file mode 100644 index 00000000000..7664ddebf8b --- /dev/null +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/profile.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 .resource import Resource + + +class Profile(Resource): + """Defines an Network Experiment Profile and lists of Experiments. + + 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 location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param resource_state: Resource status. Possible values include: + 'Creating', 'Enabling', 'Enabled', 'Disabling', 'Disabled', 'Deleting' + :type resource_state: str or + ~azure.mgmt.frontdoor.models.NetworkExperimentResourceState + :param enabled_state: The state of the Experiment. Possible values + include: 'Enabled', 'Disabled' + :type enabled_state: str or ~azure.mgmt.frontdoor.models.State + :param etag: Gets a unique read-only string that changes whenever the + resource is updated. + :type etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'resource_state': {'key': 'properties.resourceState', 'type': 'str'}, + 'enabled_state': {'key': 'properties.enabledState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Profile, self).__init__(**kwargs) + self.resource_state = kwargs.get('resource_state', None) + self.enabled_state = kwargs.get('enabled_state', None) + self.etag = kwargs.get('etag', None) diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/profile_paged.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/profile_paged.py new file mode 100644 index 00000000000..4c537e0b000 --- /dev/null +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/profile_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 ProfilePaged(Paged): + """ + A paging container for iterating over a list of :class:`Profile ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Profile]'} + } + + def __init__(self, *args, **kwargs): + + super(ProfilePaged, self).__init__(*args, **kwargs) diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/profile_py3.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/profile_py3.py new file mode 100644 index 00000000000..9c753075250 --- /dev/null +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/profile_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 .resource_py3 import Resource + + +class Profile(Resource): + """Defines an Network Experiment Profile and lists of Experiments. + + 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 location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param resource_state: Resource status. Possible values include: + 'Creating', 'Enabling', 'Enabled', 'Disabling', 'Disabled', 'Deleting' + :type resource_state: str or + ~azure.mgmt.frontdoor.models.NetworkExperimentResourceState + :param enabled_state: The state of the Experiment. Possible values + include: 'Enabled', 'Disabled' + :type enabled_state: str or ~azure.mgmt.frontdoor.models.State + :param etag: Gets a unique read-only string that changes whenever the + resource is updated. + :type etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'resource_state': {'key': 'properties.resourceState', 'type': 'str'}, + 'enabled_state': {'key': 'properties.enabledState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, location: str=None, tags=None, resource_state=None, enabled_state=None, etag: str=None, **kwargs) -> None: + super(Profile, self).__init__(location=location, tags=tags, **kwargs) + self.resource_state = resource_state + self.enabled_state = enabled_state + self.etag = etag diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/profile_update_model.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/profile_update_model.py new file mode 100644 index 00000000000..3e17d6d6a51 --- /dev/null +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/profile_update_model.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 ProfileUpdateModel(Model): + """Defines modifiable attributes of a Profile. + + :param enabled_state: The enabled state of the Profile. Possible values + include: 'Enabled', 'Disabled' + :type enabled_state: str or ~azure.mgmt.frontdoor.models.State + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'enabled_state': {'key': 'properties.enabledState', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(ProfileUpdateModel, self).__init__(**kwargs) + self.enabled_state = kwargs.get('enabled_state', None) + self.tags = kwargs.get('tags', None) diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/profile_update_model_py3.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/profile_update_model_py3.py new file mode 100644 index 00000000000..28f4cc9956a --- /dev/null +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/profile_update_model_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 ProfileUpdateModel(Model): + """Defines modifiable attributes of a Profile. + + :param enabled_state: The enabled state of the Profile. Possible values + include: 'Enabled', 'Disabled' + :type enabled_state: str or ~azure.mgmt.frontdoor.models.State + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'enabled_state': {'key': 'properties.enabledState', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, enabled_state=None, tags=None, **kwargs) -> None: + super(ProfileUpdateModel, self).__init__(**kwargs) + self.enabled_state = enabled_state + self.tags = tags diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/timeseries.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/timeseries.py new file mode 100644 index 00000000000..4a31d49c72e --- /dev/null +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/timeseries.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 .resource import Resource + + +class Timeseries(Resource): + """Defines the Timeseries. + + 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 location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param endpoint: The endpoint associated with the Timeseries data point + :type endpoint: str + :param start_date_time_utc: The start DateTime of the Timeseries in UTC + :type start_date_time_utc: str + :param end_date_time_utc: The end DateTime of the Timeseries in UTC + :type end_date_time_utc: str + :param aggregation_interval: The aggregation interval of the Timeseries. + Possible values include: 'Hourly', 'Daily' + :type aggregation_interval: str or + ~azure.mgmt.frontdoor.models.AggregationInterval + :param timeseries_type: The type of Timeseries. Possible values include: + 'MeasurementCounts', 'LatencyP50', 'LatencyP75', 'LatencyP95' + :type timeseries_type: str or ~azure.mgmt.frontdoor.models.TimeseriesType + :param country: The country associated with the Timeseries. Values are + country ISO codes as specified here- + https://www.iso.org/iso-3166-country-codes.html + :type country: str + :param timeseries_data: The set of data points for the timeseries + :type timeseries_data: + list[~azure.mgmt.frontdoor.models.TimeseriesDataPoint] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'endpoint': {'key': 'properties.endpoint', 'type': 'str'}, + 'start_date_time_utc': {'key': 'properties.startDateTimeUTC', 'type': 'str'}, + 'end_date_time_utc': {'key': 'properties.endDateTimeUTC', 'type': 'str'}, + 'aggregation_interval': {'key': 'properties.aggregationInterval', 'type': 'str'}, + 'timeseries_type': {'key': 'properties.timeseriesType', 'type': 'str'}, + 'country': {'key': 'properties.country', 'type': 'str'}, + 'timeseries_data': {'key': 'properties.timeseriesData', 'type': '[TimeseriesDataPoint]'}, + } + + def __init__(self, **kwargs): + super(Timeseries, self).__init__(**kwargs) + self.endpoint = kwargs.get('endpoint', None) + self.start_date_time_utc = kwargs.get('start_date_time_utc', None) + self.end_date_time_utc = kwargs.get('end_date_time_utc', None) + self.aggregation_interval = kwargs.get('aggregation_interval', None) + self.timeseries_type = kwargs.get('timeseries_type', None) + self.country = kwargs.get('country', None) + self.timeseries_data = kwargs.get('timeseries_data', None) diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/timeseries_data_point.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/timeseries_data_point.py new file mode 100644 index 00000000000..5d69e3bd620 --- /dev/null +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/timeseries_data_point.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 TimeseriesDataPoint(Model): + """Defines a timeseries datapoint used in a timeseries. + + :param date_time_utc: The DateTime of the Timeseries data point in UTC + :type date_time_utc: str + :param value: The Value of the Timeseries data point + :type value: float + """ + + _attribute_map = { + 'date_time_utc': {'key': 'dateTimeUTC', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'float'}, + } + + def __init__(self, **kwargs): + super(TimeseriesDataPoint, self).__init__(**kwargs) + self.date_time_utc = kwargs.get('date_time_utc', None) + self.value = kwargs.get('value', None) diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/timeseries_data_point_py3.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/timeseries_data_point_py3.py new file mode 100644 index 00000000000..a4b2a347c51 --- /dev/null +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/timeseries_data_point_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 TimeseriesDataPoint(Model): + """Defines a timeseries datapoint used in a timeseries. + + :param date_time_utc: The DateTime of the Timeseries data point in UTC + :type date_time_utc: str + :param value: The Value of the Timeseries data point + :type value: float + """ + + _attribute_map = { + 'date_time_utc': {'key': 'dateTimeUTC', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'float'}, + } + + def __init__(self, *, date_time_utc: str=None, value: float=None, **kwargs) -> None: + super(TimeseriesDataPoint, self).__init__(**kwargs) + self.date_time_utc = date_time_utc + self.value = value diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/timeseries_py3.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/timeseries_py3.py new file mode 100644 index 00000000000..0bf2f85ff8d --- /dev/null +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/timeseries_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 .resource_py3 import Resource + + +class Timeseries(Resource): + """Defines the Timeseries. + + 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 location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param endpoint: The endpoint associated with the Timeseries data point + :type endpoint: str + :param start_date_time_utc: The start DateTime of the Timeseries in UTC + :type start_date_time_utc: str + :param end_date_time_utc: The end DateTime of the Timeseries in UTC + :type end_date_time_utc: str + :param aggregation_interval: The aggregation interval of the Timeseries. + Possible values include: 'Hourly', 'Daily' + :type aggregation_interval: str or + ~azure.mgmt.frontdoor.models.AggregationInterval + :param timeseries_type: The type of Timeseries. Possible values include: + 'MeasurementCounts', 'LatencyP50', 'LatencyP75', 'LatencyP95' + :type timeseries_type: str or ~azure.mgmt.frontdoor.models.TimeseriesType + :param country: The country associated with the Timeseries. Values are + country ISO codes as specified here- + https://www.iso.org/iso-3166-country-codes.html + :type country: str + :param timeseries_data: The set of data points for the timeseries + :type timeseries_data: + list[~azure.mgmt.frontdoor.models.TimeseriesDataPoint] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'endpoint': {'key': 'properties.endpoint', 'type': 'str'}, + 'start_date_time_utc': {'key': 'properties.startDateTimeUTC', 'type': 'str'}, + 'end_date_time_utc': {'key': 'properties.endDateTimeUTC', 'type': 'str'}, + 'aggregation_interval': {'key': 'properties.aggregationInterval', 'type': 'str'}, + 'timeseries_type': {'key': 'properties.timeseriesType', 'type': 'str'}, + 'country': {'key': 'properties.country', 'type': 'str'}, + 'timeseries_data': {'key': 'properties.timeseriesData', 'type': '[TimeseriesDataPoint]'}, + } + + def __init__(self, *, location: str=None, tags=None, endpoint: str=None, start_date_time_utc: str=None, end_date_time_utc: str=None, aggregation_interval=None, timeseries_type=None, country: str=None, timeseries_data=None, **kwargs) -> None: + super(Timeseries, self).__init__(location=location, tags=tags, **kwargs) + self.endpoint = endpoint + self.start_date_time_utc = start_date_time_utc + self.end_date_time_utc = end_date_time_utc + self.aggregation_interval = aggregation_interval + self.timeseries_type = timeseries_type + self.country = country + self.timeseries_data = timeseries_data diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/__init__.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/__init__.py index 29cd448203e..0a9a04ace9b 100644 --- a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/__init__.py +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/__init__.py @@ -9,6 +9,9 @@ # regenerated. # -------------------------------------------------------------------------- +from .profiles_operations import ProfilesOperations +from .preconfigured_endpoints_operations import PreconfiguredEndpointsOperations +from .experiments_operations import ExperimentsOperations from .front_doors_operations import FrontDoorsOperations from .frontend_endpoints_operations import FrontendEndpointsOperations from .endpoints_operations import EndpointsOperations @@ -16,6 +19,9 @@ from .managed_rule_sets_operations import ManagedRuleSetsOperations __all__ = [ + 'ProfilesOperations', + 'PreconfiguredEndpointsOperations', + 'ExperimentsOperations', 'FrontDoorsOperations', 'FrontendEndpointsOperations', 'EndpointsOperations', diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/experiments_operations.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/experiments_operations.py new file mode 100644 index 00000000000..17024bbd567 --- /dev/null +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/experiments_operations.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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ExperimentsOperations(object): + """ExperimentsOperations 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: "2019-11-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-11-01" + + self.config = config + + def list_by_profile( + self, resource_group_name, profile_name, custom_headers=None, raw=False, **operation_config): + """Gets a list of Experiments. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param profile_name: The Profile identifier associated with the Tenant + and Partner + :type profile_name: 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 Experiment + :rtype: + ~azure.mgmt.frontdoor.models.ExperimentPaged[~azure.mgmt.frontdoor.models.Experiment] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_profile.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=80, min_length=1, pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str', pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$') + } + 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['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.ExperimentPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ExperimentPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/NetworkExperimentProfiles/{profileName}/Experiments'} diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/preconfigured_endpoints_operations.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/preconfigured_endpoints_operations.py new file mode 100644 index 00000000000..7f4f5da9ad3 --- /dev/null +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/preconfigured_endpoints_operations.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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class PreconfiguredEndpointsOperations(object): + """PreconfiguredEndpointsOperations 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: "2019-11-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-11-01" + + self.config = config + + def list( + self, resource_group_name, profile_name, custom_headers=None, raw=False, **operation_config): + """Gets a list of Preconfigured Endpoints. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param profile_name: The Profile identifier associated with the Tenant + and Partner + :type profile_name: 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 PreconfiguredEndpoint + :rtype: + ~azure.mgmt.frontdoor.models.PreconfiguredEndpointPaged[~azure.mgmt.frontdoor.models.PreconfiguredEndpoint] + :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'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=80, min_length=1, pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str', pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$') + } + 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['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.PreconfiguredEndpointPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.PreconfiguredEndpointPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/NetworkExperimentProfiles/{profileName}/PreconfiguredEndpoints'} diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/profiles_operations.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/profiles_operations.py new file mode 100644 index 00000000000..33cfc36239c --- /dev/null +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/profiles_operations.py @@ -0,0 +1,168 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# 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 ProfilesOperations(object): + """ProfilesOperations 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: "2019-11-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-11-01" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Gets a list of Network Experiment Profiles under 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 Profile + :rtype: + ~azure.mgmt.frontdoor.models.ProfilePaged[~azure.mgmt.frontdoor.models.Profile] + :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['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.ProfilePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ProfilePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/NetworkExperimentProfiles'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Gets a list of Network Experiment Profiles within a resource group + under a subscription. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :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 Profile + :rtype: + ~azure.mgmt.frontdoor.models.ProfilePaged[~azure.mgmt.frontdoor.models.Profile] + :raises: + :class:`ErrorResponseException` + """ + 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 = { + '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=80, min_length=1, pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$') + } + 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['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.ProfilePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ProfilePaged(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/NetworkExperimentProfiles'}