diff --git a/azure-mgmt-trafficmanager/azure/mgmt/trafficmanager/models/__init__.py b/azure-mgmt-trafficmanager/azure/mgmt/trafficmanager/models/__init__.py index c41ba9dd7f2c..7e200618859b 100644 --- a/azure-mgmt-trafficmanager/azure/mgmt/trafficmanager/models/__init__.py +++ b/azure-mgmt-trafficmanager/azure/mgmt/trafficmanager/models/__init__.py @@ -21,6 +21,11 @@ from .resource import Resource from .tracked_resource import TrackedResource from .proxy_resource import ProxyResource +from .traffic_manager_user_metrics_key_model import TrafficManagerUserMetricsKeyModel +from .heat_map_endpoint import HeatMapEndpoint +from .query_experience import QueryExperience +from .traffic_flow import TrafficFlow +from .heat_map_model import HeatMapModel from .profile_paged import ProfilePaged from .traffic_manager_management_client_enums import ( EndpointStatus, @@ -44,6 +49,11 @@ 'Resource', 'TrackedResource', 'ProxyResource', + 'TrafficManagerUserMetricsKeyModel', + 'HeatMapEndpoint', + 'QueryExperience', + 'TrafficFlow', + 'HeatMapModel', 'ProfilePaged', 'EndpointStatus', 'EndpointMonitorStatus', diff --git a/azure-mgmt-trafficmanager/azure/mgmt/trafficmanager/models/heat_map_endpoint.py b/azure-mgmt-trafficmanager/azure/mgmt/trafficmanager/models/heat_map_endpoint.py new file mode 100644 index 000000000000..7971fca25c4f --- /dev/null +++ b/azure-mgmt-trafficmanager/azure/mgmt/trafficmanager/models/heat_map_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 HeatMapEndpoint(Model): + """Class which is a sparse representation of a Traffic Manager endpoint. + + :param resource_id: The ARM Resource ID of this Traffic Manager endpoint. + :type resource_id: str + :param endpoint_id: A number uniquely identifying this endpoint in query + experiences. + :type endpoint_id: int + """ + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'endpoint_id': {'key': 'endpointId', 'type': 'int'}, + } + + def __init__(self, resource_id=None, endpoint_id=None): + self.resource_id = resource_id + self.endpoint_id = endpoint_id diff --git a/azure-mgmt-trafficmanager/azure/mgmt/trafficmanager/models/heat_map_model.py b/azure-mgmt-trafficmanager/azure/mgmt/trafficmanager/models/heat_map_model.py new file mode 100644 index 000000000000..c4e7577cbc0b --- /dev/null +++ b/azure-mgmt-trafficmanager/azure/mgmt/trafficmanager/models/heat_map_model.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 .proxy_resource import ProxyResource + + +class HeatMapModel(ProxyResource): + """Class representing a Traffic Manager HeatMap. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Network/trafficmanagerProfiles. + :vartype type: str + :param start_time: The beginning of the time window for this HeatMap, + inclusive. + :type start_time: datetime + :param end_time: The ending of the time window for this HeatMap, + exclusive. + :type end_time: datetime + :param endpoints: The endpoints used in this HeatMap calculation. + :type endpoints: list of :class:`HeatMapEndpoint + ` + :param traffic_flows: The traffic flows produced in this HeatMap + calculation. + :type traffic_flows: list of :class:`TrafficFlow + ` + """ + + _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'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'endpoints': {'key': 'properties.endpoints', 'type': '[HeatMapEndpoint]'}, + 'traffic_flows': {'key': 'properties.trafficFlows', 'type': '[TrafficFlow]'}, + } + + def __init__(self, start_time=None, end_time=None, endpoints=None, traffic_flows=None): + super(HeatMapModel, self).__init__() + self.start_time = start_time + self.end_time = end_time + self.endpoints = endpoints + self.traffic_flows = traffic_flows diff --git a/azure-mgmt-trafficmanager/azure/mgmt/trafficmanager/models/profile_paged.py b/azure-mgmt-trafficmanager/azure/mgmt/trafficmanager/models/profile_paged.py index 3d62cd910cd0..04652ccd9400 100644 --- a/azure-mgmt-trafficmanager/azure/mgmt/trafficmanager/models/profile_paged.py +++ b/azure-mgmt-trafficmanager/azure/mgmt/trafficmanager/models/profile_paged.py @@ -14,7 +14,7 @@ class ProfilePaged(Paged): """ - A paging container for iterating over a list of Profile object + A paging container for iterating over a list of :class:`Profile ` object """ _attribute_map = { diff --git a/azure-mgmt-trafficmanager/azure/mgmt/trafficmanager/models/query_experience.py b/azure-mgmt-trafficmanager/azure/mgmt/trafficmanager/models/query_experience.py new file mode 100644 index 000000000000..722f655fbbf3 --- /dev/null +++ b/azure-mgmt-trafficmanager/azure/mgmt/trafficmanager/models/query_experience.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class QueryExperience(Model): + """Class representing a Traffic Manager HeatMap query experience properties. + + :param endpoint_id: The id of the endpoint from the 'endpoints' array + which these queries were routed to. + :type endpoint_id: int + :param query_count: The number of queries originating from this location. + :type query_count: int + :param latency: The latency experienced by queries originating from this + location. + :type latency: float + """ + + _validation = { + 'endpoint_id': {'required': True}, + 'query_count': {'required': True}, + } + + _attribute_map = { + 'endpoint_id': {'key': 'endpointId', 'type': 'int'}, + 'query_count': {'key': 'queryCount', 'type': 'int'}, + 'latency': {'key': 'latency', 'type': 'float'}, + } + + def __init__(self, endpoint_id, query_count, latency=None): + self.endpoint_id = endpoint_id + self.query_count = query_count + self.latency = latency diff --git a/azure-mgmt-trafficmanager/azure/mgmt/trafficmanager/models/traffic_flow.py b/azure-mgmt-trafficmanager/azure/mgmt/trafficmanager/models/traffic_flow.py new file mode 100644 index 000000000000..78bc6935f830 --- /dev/null +++ b/azure-mgmt-trafficmanager/azure/mgmt/trafficmanager/models/traffic_flow.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TrafficFlow(Model): + """Class representing a Traffic Manager HeatMap traffic flow properties. + + :param source_ip: The IP address that this query experience originated + from. + :type source_ip: str + :param latitude: The approximate latitude that these queries originated + from. + :type latitude: float + :param longitude: The approximate longitude that these queries originated + from. + :type longitude: float + :param query_experiences: The query experiences produced in this HeatMap + calculation. + :type query_experiences: list of :class:`QueryExperience + ` + """ + + _attribute_map = { + 'source_ip': {'key': 'sourceIp', 'type': 'str'}, + 'latitude': {'key': 'latitude', 'type': 'float'}, + 'longitude': {'key': 'longitude', 'type': 'float'}, + 'query_experiences': {'key': 'queryExperiences', 'type': '[QueryExperience]'}, + } + + def __init__(self, source_ip=None, latitude=None, longitude=None, query_experiences=None): + self.source_ip = source_ip + self.latitude = latitude + self.longitude = longitude + self.query_experiences = query_experiences diff --git a/azure-mgmt-trafficmanager/azure/mgmt/trafficmanager/models/traffic_manager_user_metrics_key_model.py b/azure-mgmt-trafficmanager/azure/mgmt/trafficmanager/models/traffic_manager_user_metrics_key_model.py new file mode 100644 index 000000000000..ab92df3a9874 --- /dev/null +++ b/azure-mgmt-trafficmanager/azure/mgmt/trafficmanager/models/traffic_manager_user_metrics_key_model.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .proxy_resource import ProxyResource + + +class TrafficManagerUserMetricsKeyModel(ProxyResource): + """Class representing a Traffic Manager Real User Metrics key response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Network/trafficmanagerProfiles. + :vartype type: str + :param key: The key returned by the Realtime User Metrics operation. + :type key: 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'}, + 'key': {'key': 'properties.key', 'type': 'str'}, + } + + def __init__(self, key=None): + super(TrafficManagerUserMetricsKeyModel, self).__init__() + self.key = key diff --git a/azure-mgmt-trafficmanager/azure/mgmt/trafficmanager/operations/__init__.py b/azure-mgmt-trafficmanager/azure/mgmt/trafficmanager/operations/__init__.py index 415f816221f4..d81d2cc5a9ec 100644 --- a/azure-mgmt-trafficmanager/azure/mgmt/trafficmanager/operations/__init__.py +++ b/azure-mgmt-trafficmanager/azure/mgmt/trafficmanager/operations/__init__.py @@ -12,9 +12,13 @@ from .endpoints_operations import EndpointsOperations from .profiles_operations import ProfilesOperations from .geographic_hierarchies_operations import GeographicHierarchiesOperations +from .heat_map_operations import HeatMapOperations +from .traffic_manager_user_metrics_keys_operations import TrafficManagerUserMetricsKeysOperations __all__ = [ 'EndpointsOperations', 'ProfilesOperations', 'GeographicHierarchiesOperations', + 'HeatMapOperations', + 'TrafficManagerUserMetricsKeysOperations', ] diff --git a/azure-mgmt-trafficmanager/azure/mgmt/trafficmanager/operations/endpoints_operations.py b/azure-mgmt-trafficmanager/azure/mgmt/trafficmanager/operations/endpoints_operations.py index b115a7edf4b5..3e0493b8a359 100644 --- a/azure-mgmt-trafficmanager/azure/mgmt/trafficmanager/operations/endpoints_operations.py +++ b/azure-mgmt-trafficmanager/azure/mgmt/trafficmanager/operations/endpoints_operations.py @@ -9,9 +9,9 @@ # regenerated. # -------------------------------------------------------------------------- +import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -import uuid from .. import models @@ -59,9 +59,11 @@ def update( deserialized response :param operation_config: :ref:`Operation configuration overrides`. + :return: :class:`Endpoint ` + or :class:`ClientRawResponse` if + raw=true :rtype: :class:`Endpoint ` - :rtype: :class:`ClientRawResponse` - if raw=true + or :class:`ClientRawResponse` :raises: :class:`CloudError` """ # Construct URL @@ -131,9 +133,11 @@ def get( deserialized response :param operation_config: :ref:`Operation configuration overrides`. + :return: :class:`Endpoint ` + or :class:`ClientRawResponse` if + raw=true :rtype: :class:`Endpoint ` - :rtype: :class:`ClientRawResponse` - if raw=true + or :class:`ClientRawResponse` :raises: :class:`CloudError` """ # Construct URL @@ -205,9 +209,11 @@ def create_or_update( deserialized response :param operation_config: :ref:`Operation configuration overrides`. + :return: :class:`Endpoint ` + or :class:`ClientRawResponse` if + raw=true :rtype: :class:`Endpoint ` - :rtype: :class:`ClientRawResponse` - if raw=true + or :class:`ClientRawResponse` :raises: :class:`CloudError` """ # Construct URL @@ -281,10 +287,13 @@ def delete( deserialized response :param operation_config: :ref:`Operation configuration overrides`. + :return: :class:`DeleteOperationResult + ` or + :class:`ClientRawResponse` if + raw=true :rtype: :class:`DeleteOperationResult - ` - :rtype: :class:`ClientRawResponse` - if raw=true + ` or + :class:`ClientRawResponse` :raises: :class:`CloudError` """ # Construct URL diff --git a/azure-mgmt-trafficmanager/azure/mgmt/trafficmanager/operations/geographic_hierarchies_operations.py b/azure-mgmt-trafficmanager/azure/mgmt/trafficmanager/operations/geographic_hierarchies_operations.py index a08339703e51..eef3c9b71da2 100644 --- a/azure-mgmt-trafficmanager/azure/mgmt/trafficmanager/operations/geographic_hierarchies_operations.py +++ b/azure-mgmt-trafficmanager/azure/mgmt/trafficmanager/operations/geographic_hierarchies_operations.py @@ -9,9 +9,9 @@ # regenerated. # -------------------------------------------------------------------------- +import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -import uuid from .. import models @@ -45,10 +45,13 @@ def get_default( deserialized response :param operation_config: :ref:`Operation configuration overrides`. + :return: :class:`TrafficManagerGeographicHierarchy + ` + or :class:`ClientRawResponse` if + raw=true :rtype: :class:`TrafficManagerGeographicHierarchy ` - :rtype: :class:`ClientRawResponse` - if raw=true + or :class:`ClientRawResponse` :raises: :class:`CloudError` """ # Construct URL diff --git a/azure-mgmt-trafficmanager/azure/mgmt/trafficmanager/operations/heat_map_operations.py b/azure-mgmt-trafficmanager/azure/mgmt/trafficmanager/operations/heat_map_operations.py new file mode 100644 index 000000000000..29dcbf8f69a8 --- /dev/null +++ b/azure-mgmt-trafficmanager/azure/mgmt/trafficmanager/operations/heat_map_operations.py @@ -0,0 +1,115 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class HeatMapOperations(object): + """HeatMapOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An objec model deserializer. + :ivar heat_map_type: The type of HeatMap for the Traffic Manager profile. Constant value: "default". + :ivar api_version: Client Api Version. Constant value: "2017-09-01-preview". + """ + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.heat_map_type = "default" + self.api_version = "2017-09-01-preview" + + self.config = config + + def get( + self, resource_group_name, profile_name, top_left=None, bot_right=None, custom_headers=None, raw=False, **operation_config): + """Gets latest heatmap for Traffic Manager profile. + + :param resource_group_name: The name of the resource group containing + the Traffic Manager endpoint. + :type resource_group_name: str + :param profile_name: The name of the Traffic Manager profile. + :type profile_name: str + :param top_left: The top left latitude,longitude pair of the + rectangular viewport to query for. + :type top_left: list of float + :param bot_right: The bottom right latitude,longitude pair of the + rectangular viewport to query for. + :type bot_right: list of float + :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: :class:`HeatMapModel + ` or + :class:`ClientRawResponse` if + raw=true + :rtype: :class:`HeatMapModel + ` or + :class:`ClientRawResponse` + :raises: :class:`CloudError` + """ + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}/heatMaps/{heatMapType}' + 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'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'heatMapType': self._serialize.url("self.heat_map_type", self.heat_map_type, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if top_left is not None: + query_parameters['topLeft'] = self._serialize.query("top_left", top_left, '[float]', div=',', max_items=2, min_items=2) + if bot_right is not None: + query_parameters['botRight'] = self._serialize.query("bot_right", bot_right, '[float]', div=',', max_items=2, min_items=2) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('HeatMapModel', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized diff --git a/azure-mgmt-trafficmanager/azure/mgmt/trafficmanager/operations/profiles_operations.py b/azure-mgmt-trafficmanager/azure/mgmt/trafficmanager/operations/profiles_operations.py index eceeab07fe19..2578aef635a7 100644 --- a/azure-mgmt-trafficmanager/azure/mgmt/trafficmanager/operations/profiles_operations.py +++ b/azure-mgmt-trafficmanager/azure/mgmt/trafficmanager/operations/profiles_operations.py @@ -9,9 +9,9 @@ # regenerated. # -------------------------------------------------------------------------- +import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -import uuid from .. import models @@ -48,10 +48,13 @@ def check_traffic_manager_relative_dns_name_availability( deserialized response :param operation_config: :ref:`Operation configuration overrides`. + :return: :class:`TrafficManagerNameAvailability + ` or + :class:`ClientRawResponse` if + raw=true :rtype: :class:`TrafficManagerNameAvailability - ` - :rtype: :class:`ClientRawResponse` - if raw=true + ` or + :class:`ClientRawResponse` :raises: :class:`CloudError` """ parameters = models.CheckTrafficManagerRelativeDnsNameAvailabilityParameters(name=name, type=type) @@ -109,6 +112,8 @@ def list_by_resource_group( deserialized response :param operation_config: :ref:`Operation configuration overrides`. + :return: An iterator like instance of :class:`Profile + ` :rtype: :class:`ProfilePaged ` :raises: :class:`CloudError` @@ -173,6 +178,8 @@ def list_by_subscription( deserialized response :param operation_config: :ref:`Operation configuration overrides`. + :return: An iterator like instance of :class:`Profile + ` :rtype: :class:`ProfilePaged ` :raises: :class:`CloudError` @@ -241,9 +248,11 @@ def get( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :rtype: :class:`Profile ` - :rtype: :class:`ClientRawResponse` - if raw=true + :return: :class:`Profile ` + or :class:`ClientRawResponse` if + raw=true + :rtype: :class:`Profile ` or + :class:`ClientRawResponse` :raises: :class:`CloudError` """ # Construct URL @@ -307,9 +316,11 @@ def create_or_update( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :rtype: :class:`Profile ` - :rtype: :class:`ClientRawResponse` - if raw=true + :return: :class:`Profile ` + or :class:`ClientRawResponse` if + raw=true + :rtype: :class:`Profile ` or + :class:`ClientRawResponse` :raises: :class:`CloudError` """ # Construct URL @@ -376,10 +387,13 @@ def delete( deserialized response :param operation_config: :ref:`Operation configuration overrides`. + :return: :class:`DeleteOperationResult + ` or + :class:`ClientRawResponse` if + raw=true :rtype: :class:`DeleteOperationResult - ` - :rtype: :class:`ClientRawResponse` - if raw=true + ` or + :class:`ClientRawResponse` :raises: :class:`CloudError` """ # Construct URL @@ -443,9 +457,11 @@ def update( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :rtype: :class:`Profile ` - :rtype: :class:`ClientRawResponse` - if raw=true + :return: :class:`Profile ` + or :class:`ClientRawResponse` if + raw=true + :rtype: :class:`Profile ` or + :class:`ClientRawResponse` :raises: :class:`CloudError` """ # Construct URL diff --git a/azure-mgmt-trafficmanager/azure/mgmt/trafficmanager/operations/traffic_manager_user_metrics_keys_operations.py b/azure-mgmt-trafficmanager/azure/mgmt/trafficmanager/operations/traffic_manager_user_metrics_keys_operations.py new file mode 100644 index 000000000000..ee09bf7e751f --- /dev/null +++ b/azure-mgmt-trafficmanager/azure/mgmt/trafficmanager/operations/traffic_manager_user_metrics_keys_operations.py @@ -0,0 +1,216 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class TrafficManagerUserMetricsKeysOperations(object): + """TrafficManagerUserMetricsKeysOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An objec model deserializer. + :ivar api_version: Client Api Version. Constant value: "2017-09-01-preview". + """ + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-09-01-preview" + + self.config = config + + def get_default( + self, custom_headers=None, raw=False, **operation_config): + """Get the subscription-level key used for Realtime User Metrics + collection. + + :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: :class:`TrafficManagerUserMetricsKeyModel + ` + or :class:`ClientRawResponse` if + raw=true + :rtype: :class:`TrafficManagerUserMetricsKeyModel + ` + or :class:`ClientRawResponse` + :raises: :class:`CloudError` + """ + # Construct URL + url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/trafficManagerUserMetricsKeys/default' + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('TrafficManagerUserMetricsKeyModel', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, custom_headers=None, raw=False, **operation_config): + """Create or update a subscription-level key used for Realtime User + Metrics collection. + + :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: :class:`TrafficManagerUserMetricsKeyModel + ` + or :class:`ClientRawResponse` if + raw=true + :rtype: :class:`TrafficManagerUserMetricsKeyModel + ` + or :class:`ClientRawResponse` + :raises: :class:`CloudError` + """ + # Construct URL + url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/trafficManagerUserMetricsKeys/default' + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 201: + deserialized = self._deserialize('TrafficManagerUserMetricsKeyModel', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def delete( + self, custom_headers=None, raw=False, **operation_config): + """Delete a subscription-level key used for Realtime User Metrics + collection. + + :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: :class:`DeleteOperationResult + ` or + :class:`ClientRawResponse` if + raw=true + :rtype: :class:`DeleteOperationResult + ` or + :class:`ClientRawResponse` + :raises: :class:`CloudError` + """ + # Construct URL + url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/trafficManagerUserMetricsKeys/default' + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('DeleteOperationResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized diff --git a/azure-mgmt-trafficmanager/azure/mgmt/trafficmanager/traffic_manager_management_client.py b/azure-mgmt-trafficmanager/azure/mgmt/trafficmanager/traffic_manager_management_client.py index 4fc420ca3bdf..3cc126f1acf6 100644 --- a/azure-mgmt-trafficmanager/azure/mgmt/trafficmanager/traffic_manager_management_client.py +++ b/azure-mgmt-trafficmanager/azure/mgmt/trafficmanager/traffic_manager_management_client.py @@ -16,6 +16,8 @@ from .operations.endpoints_operations import EndpointsOperations from .operations.profiles_operations import ProfilesOperations from .operations.geographic_hierarchies_operations import GeographicHierarchiesOperations +from .operations.heat_map_operations import HeatMapOperations +from .operations.traffic_manager_user_metrics_keys_operations import TrafficManagerUserMetricsKeysOperations from . import models @@ -67,6 +69,10 @@ class TrafficManagerManagementClient(object): :vartype profiles: azure.mgmt.trafficmanager.operations.ProfilesOperations :ivar geographic_hierarchies: GeographicHierarchies operations :vartype geographic_hierarchies: azure.mgmt.trafficmanager.operations.GeographicHierarchiesOperations + :ivar heat_map: HeatMap operations + :vartype heat_map: azure.mgmt.trafficmanager.operations.HeatMapOperations + :ivar traffic_manager_user_metrics_keys: TrafficManagerUserMetricsKeys operations + :vartype traffic_manager_user_metrics_keys: azure.mgmt.trafficmanager.operations.TrafficManagerUserMetricsKeysOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -85,7 +91,6 @@ def __init__( self._client = ServiceClient(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '2017-05-01' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) @@ -95,3 +100,7 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.geographic_hierarchies = GeographicHierarchiesOperations( self._client, self.config, self._serialize, self._deserialize) + self.heat_map = HeatMapOperations( + self._client, self.config, self._serialize, self._deserialize) + self.traffic_manager_user_metrics_keys = TrafficManagerUserMetricsKeysOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/azure-mgmt-trafficmanager/build.json b/azure-mgmt-trafficmanager/build.json index f1f715d8363e..0890d6c20147 100644 --- a/azure-mgmt-trafficmanager/build.json +++ b/azure-mgmt-trafficmanager/build.json @@ -1 +1,183 @@ -{"autorest": "1.1.0", "date": "2017-06-30T18:58:00Z", "version": ""} \ No newline at end of file +{ + "autorest": [ + { + "resolvedInfo": null, + "packageMetadata": { + "name": "@microsoft.azure/autorest-core", + "version": "2.0.4147", + "engines": { + "node": ">=7.10.0" + }, + "dependencies": {}, + "optionalDependencies": {}, + "devDependencies": { + "@microsoft.azure/async-io": "~1.0.21", + "@microsoft.azure/extension": "~1.1.5", + "@types/commonmark": "^0.27.0", + "@types/jsonpath": "^0.1.29", + "@types/node": "^8.0.28", + "@types/pify": "0.0.28", + "@types/source-map": "^0.5.0", + "@types/yargs": "^8.0.2", + "commonmark": "^0.27.0", + "file-url": "^2.0.2", + "get-uri": "^2.0.0", + "jsonpath": "^0.2.11", + "linq-es2015": "^2.4.25", + "mocha": "3.4.2", + "mocha-typescript": "1.1.5", + "pify": "^3.0.0", + "safe-eval": "^0.3.0", + "shx": "^0.2.2", + "source-map": "^0.5.6", + "source-map-support": "^0.4.15", + "strip-bom": "^3.0.0", + "typescript": "2.4.1", + "untildify": "^3.0.2", + "urijs": "^1.18.10", + "vscode-jsonrpc": "^3.3.1", + "yaml-ast-parser": "https://github.com/olydis/yaml-ast-parser/releases/download/0.0.34/yaml-ast-parser-0.0.34.tgz", + "yargs": "^8.0.2" + }, + "bundleDependencies": false, + "peerDependencies": {}, + "deprecated": false, + "_resolved": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4147/node_modules/@microsoft.azure/autorest-core", + "_shasum": "cfad16a831757f2f55e53bf56669d126cd36113a", + "_shrinkwrap": null, + "bin": null, + "_id": "@microsoft.azure/autorest-core@2.0.4147", + "_from": "file:/root/.autorest/@microsoft.azure_autorest-core@2.0.4147/node_modules/@microsoft.azure/autorest-core", + "_requested": { + "type": "directory", + "where": "/git-restapi", + "raw": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4147/node_modules/@microsoft.azure/autorest-core", + "rawSpec": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4147/node_modules/@microsoft.azure/autorest-core", + "saveSpec": "file:/root/.autorest/@microsoft.azure_autorest-core@2.0.4147/node_modules/@microsoft.azure/autorest-core", + "fetchSpec": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4147/node_modules/@microsoft.azure/autorest-core" + }, + "_spec": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4147/node_modules/@microsoft.azure/autorest-core", + "_where": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4147/node_modules/@microsoft.azure/autorest-core" + }, + "extensionManager": { + "installationPath": "/root/.autorest", + "dotnetPath": "/root/.dotnet" + }, + "installationPath": "/root/.autorest" + }, + { + "resolvedInfo": null, + "packageMetadata": { + "name": "@microsoft.azure/autorest.modeler", + "version": "2.0.18", + "dependencies": { + "dotnet-2.0.0": "^1.1.0" + }, + "optionalDependencies": {}, + "devDependencies": { + "coffee-script": "^1.11.1", + "dotnet-sdk-2.0.0": "^1.1.1", + "gulp": "^3.9.1", + "gulp-filter": "^5.0.0", + "gulp-line-ending-corrector": "^1.0.1", + "iced-coffee-script": "^108.0.11", + "marked": "^0.3.6", + "marked-terminal": "^2.0.0", + "moment": "^2.17.1", + "run-sequence": "*", + "shx": "^0.2.2", + "through2-parallel": "^0.1.3", + "yargs": "^8.0.2", + "yarn": "^1.0.2" + }, + "bundleDependencies": false, + "peerDependencies": {}, + "deprecated": false, + "_resolved": "/root/.autorest/@microsoft.azure_autorest.modeler@2.0.18/node_modules/@microsoft.azure/autorest.modeler", + "_shasum": "b8e853f83b99b2a37ad534cb8463da5de4b11418", + "_shrinkwrap": null, + "bin": null, + "_id": "@microsoft.azure/autorest.modeler@2.0.18", + "_from": "file:/root/.autorest/@microsoft.azure_autorest.modeler@2.0.18/node_modules/@microsoft.azure/autorest.modeler", + "_requested": { + "type": "directory", + "where": "/git-restapi", + "raw": "/root/.autorest/@microsoft.azure_autorest.modeler@2.0.18/node_modules/@microsoft.azure/autorest.modeler", + "rawSpec": "/root/.autorest/@microsoft.azure_autorest.modeler@2.0.18/node_modules/@microsoft.azure/autorest.modeler", + "saveSpec": "file:/root/.autorest/@microsoft.azure_autorest.modeler@2.0.18/node_modules/@microsoft.azure/autorest.modeler", + "fetchSpec": "/root/.autorest/@microsoft.azure_autorest.modeler@2.0.18/node_modules/@microsoft.azure/autorest.modeler" + }, + "_spec": "/root/.autorest/@microsoft.azure_autorest.modeler@2.0.18/node_modules/@microsoft.azure/autorest.modeler", + "_where": "/root/.autorest/@microsoft.azure_autorest.modeler@2.0.18/node_modules/@microsoft.azure/autorest.modeler" + }, + "extensionManager": { + "installationPath": "/root/.autorest", + "dotnetPath": "/root/.dotnet" + }, + "installationPath": "/root/.autorest" + }, + { + "resolvedInfo": null, + "packageMetadata": { + "name": "@microsoft.azure/autorest.python", + "version": "2.0.13", + "dependencies": { + "dotnet-2.0.0": "^1.1.0" + }, + "optionalDependencies": {}, + "devDependencies": { + "@microsoft.azure/autorest.testserver": "^1.9.0", + "autorest": "^2.0.0", + "coffee-script": "^1.11.1", + "dotnet-sdk-2.0.0": "^1.1.1", + "gulp": "^3.9.1", + "gulp-filter": "^5.0.0", + "gulp-line-ending-corrector": "^1.0.1", + "iced-coffee-script": "^108.0.11", + "marked": "^0.3.6", + "marked-terminal": "^2.0.0", + "moment": "^2.17.1", + "run-sequence": "*", + "shx": "^0.2.2", + "through2-parallel": "^0.1.3", + "yargs": "^8.0.2", + "yarn": "^1.0.2" + }, + "bundleDependencies": false, + "peerDependencies": {}, + "deprecated": false, + "_resolved": "/root/.autorest/@microsoft.azure_autorest.python@2.0.13/node_modules/@microsoft.azure/autorest.python", + "_shasum": "ddbbf3e3f1f90ae4132b687cfa8450425ab4ffcd", + "_shrinkwrap": null, + "bin": null, + "_id": "@microsoft.azure/autorest.python@2.0.13", + "_from": "file:/root/.autorest/@microsoft.azure_autorest.python@2.0.13/node_modules/@microsoft.azure/autorest.python", + "_requested": { + "type": "directory", + "where": "/git-restapi", + "raw": "/root/.autorest/@microsoft.azure_autorest.python@2.0.13/node_modules/@microsoft.azure/autorest.python", + "rawSpec": "/root/.autorest/@microsoft.azure_autorest.python@2.0.13/node_modules/@microsoft.azure/autorest.python", + "saveSpec": "file:/root/.autorest/@microsoft.azure_autorest.python@2.0.13/node_modules/@microsoft.azure/autorest.python", + "fetchSpec": "/root/.autorest/@microsoft.azure_autorest.python@2.0.13/node_modules/@microsoft.azure/autorest.python" + }, + "_spec": "/root/.autorest/@microsoft.azure_autorest.python@2.0.13/node_modules/@microsoft.azure/autorest.python", + "_where": "/root/.autorest/@microsoft.azure_autorest.python@2.0.13/node_modules/@microsoft.azure/autorest.python" + }, + "extensionManager": { + "installationPath": "/root/.autorest", + "dotnetPath": "/root/.dotnet" + }, + "installationPath": "/root/.autorest" + } + ], + "autorest_bootstrap": { + "dependencies": { + "autorest": { + "version": "2.0.4147", + "from": "autorest@latest", + "resolved": "https://registry.npmjs.org/autorest/-/autorest-2.0.4147.tgz" + } + } + }, + "date": "2017-10-05T23:05:35Z" +} \ No newline at end of file