diff --git a/azure-mgmt-adhybridhealthservice/README.rst b/azure-mgmt-adhybridhealthservice/README.rst index 45de4e6b43dd..d0429ebc7565 100644 --- a/azure-mgmt-adhybridhealthservice/README.rst +++ b/azure-mgmt-adhybridhealthservice/README.rst @@ -14,25 +14,6 @@ For the older Azure Service Management (ASM) libraries, see For a more complete set of Azure libraries, see the `azure `__ bundle package. -Compatibility -============= - -**IMPORTANT**: If you have an earlier version of the azure package -(version < 1.0), you should uninstall it before installing this package. - -You can check the version using pip: - -.. code:: shell - - pip freeze - -If you see azure==0.11.0 (or any version below 1.0), uninstall it first: - -.. code:: shell - - pip uninstall azure - - Usage ===== diff --git a/azure-mgmt-adhybridhealthservice/azure/mgmt/adhybridhealthservice/models/__init__.py b/azure-mgmt-adhybridhealthservice/azure/mgmt/adhybridhealthservice/models/__init__.py index 1c1d06898c38..b3b472de9ce0 100644 --- a/azure-mgmt-adhybridhealthservice/azure/mgmt/adhybridhealthservice/models/__init__.py +++ b/azure-mgmt-adhybridhealthservice/azure/mgmt/adhybridhealthservice/models/__init__.py @@ -67,6 +67,7 @@ from .replication_summary_py3 import ReplicationSummary from .replication_status_py3 import ReplicationStatus from .result_py3 import Result + from .risky_ip_blob_uri_py3 import RiskyIPBlobUri from .run_profiles_py3 import RunProfiles from .service_configuration_py3 import ServiceConfiguration from .service_properties_py3 import ServiceProperties @@ -133,6 +134,7 @@ from .replication_summary import ReplicationSummary from .replication_status import ReplicationStatus from .result import Result + from .risky_ip_blob_uri import RiskyIPBlobUri from .run_profiles import RunProfiles from .service_configuration import ServiceConfiguration from .service_properties import ServiceProperties @@ -156,6 +158,7 @@ from .export_status_paged import ExportStatusPaged from .alert_feedback_paged import AlertFeedbackPaged from .error_report_users_entry_paged import ErrorReportUsersEntryPaged +from .risky_ip_blob_uri_paged import RiskyIPBlobUriPaged from .connector_paged import ConnectorPaged from .global_configuration_paged import GlobalConfigurationPaged from .ad_hybrid_health_service_enums import ( @@ -230,6 +233,7 @@ 'ReplicationSummary', 'ReplicationStatus', 'Result', + 'RiskyIPBlobUri', 'RunProfiles', 'ServiceConfiguration', 'ServiceProperties', @@ -253,6 +257,7 @@ 'ExportStatusPaged', 'AlertFeedbackPaged', 'ErrorReportUsersEntryPaged', + 'RiskyIPBlobUriPaged', 'ConnectorPaged', 'GlobalConfigurationPaged', 'MonitoringLevel', diff --git a/azure-mgmt-adhybridhealthservice/azure/mgmt/adhybridhealthservice/models/risky_ip_blob_uri.py b/azure-mgmt-adhybridhealthservice/azure/mgmt/adhybridhealthservice/models/risky_ip_blob_uri.py new file mode 100644 index 000000000000..76037f9af534 --- /dev/null +++ b/azure-mgmt-adhybridhealthservice/azure/mgmt/adhybridhealthservice/models/risky_ip_blob_uri.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class RiskyIPBlobUri(Model): + """The blob uri pointing to Risky IP Report. + + :param tenant_id: The tenant id for whom the report belongs to. + :type tenant_id: str + :param service_id: The service id for whom the report belongs to. + :type service_id: str + :param result_sas_uri: The blob uri for the report. + :type result_sas_uri: str + :param blob_create_date_time: Time at which the the new Risky IP report + was requested. + :type blob_create_date_time: datetime + :param job_completion_time: Time at which the blob creation job for the + new Risky IP report was completed. + :type job_completion_time: datetime + :param status: Status of the Risky IP report generation. + :type status: str + """ + + _attribute_map = { + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'service_id': {'key': 'serviceId', 'type': 'str'}, + 'result_sas_uri': {'key': 'resultSasUri', 'type': 'str'}, + 'blob_create_date_time': {'key': 'blobCreateDateTime', 'type': 'iso-8601'}, + 'job_completion_time': {'key': 'jobCompletionTime', 'type': 'iso-8601'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RiskyIPBlobUri, self).__init__(**kwargs) + self.tenant_id = kwargs.get('tenant_id', None) + self.service_id = kwargs.get('service_id', None) + self.result_sas_uri = kwargs.get('result_sas_uri', None) + self.blob_create_date_time = kwargs.get('blob_create_date_time', None) + self.job_completion_time = kwargs.get('job_completion_time', None) + self.status = kwargs.get('status', None) diff --git a/azure-mgmt-adhybridhealthservice/azure/mgmt/adhybridhealthservice/models/risky_ip_blob_uri_paged.py b/azure-mgmt-adhybridhealthservice/azure/mgmt/adhybridhealthservice/models/risky_ip_blob_uri_paged.py new file mode 100644 index 000000000000..839c5372cb6f --- /dev/null +++ b/azure-mgmt-adhybridhealthservice/azure/mgmt/adhybridhealthservice/models/risky_ip_blob_uri_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 RiskyIPBlobUriPaged(Paged): + """ + A paging container for iterating over a list of :class:`RiskyIPBlobUri ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[RiskyIPBlobUri]'} + } + + def __init__(self, *args, **kwargs): + + super(RiskyIPBlobUriPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-adhybridhealthservice/azure/mgmt/adhybridhealthservice/models/risky_ip_blob_uri_py3.py b/azure-mgmt-adhybridhealthservice/azure/mgmt/adhybridhealthservice/models/risky_ip_blob_uri_py3.py new file mode 100644 index 000000000000..d00ca152d038 --- /dev/null +++ b/azure-mgmt-adhybridhealthservice/azure/mgmt/adhybridhealthservice/models/risky_ip_blob_uri_py3.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class RiskyIPBlobUri(Model): + """The blob uri pointing to Risky IP Report. + + :param tenant_id: The tenant id for whom the report belongs to. + :type tenant_id: str + :param service_id: The service id for whom the report belongs to. + :type service_id: str + :param result_sas_uri: The blob uri for the report. + :type result_sas_uri: str + :param blob_create_date_time: Time at which the the new Risky IP report + was requested. + :type blob_create_date_time: datetime + :param job_completion_time: Time at which the blob creation job for the + new Risky IP report was completed. + :type job_completion_time: datetime + :param status: Status of the Risky IP report generation. + :type status: str + """ + + _attribute_map = { + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'service_id': {'key': 'serviceId', 'type': 'str'}, + 'result_sas_uri': {'key': 'resultSasUri', 'type': 'str'}, + 'blob_create_date_time': {'key': 'blobCreateDateTime', 'type': 'iso-8601'}, + 'job_completion_time': {'key': 'jobCompletionTime', 'type': 'iso-8601'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, *, tenant_id: str=None, service_id: str=None, result_sas_uri: str=None, blob_create_date_time=None, job_completion_time=None, status: str=None, **kwargs) -> None: + super(RiskyIPBlobUri, self).__init__(**kwargs) + self.tenant_id = tenant_id + self.service_id = service_id + self.result_sas_uri = result_sas_uri + self.blob_create_date_time = blob_create_date_time + self.job_completion_time = job_completion_time + self.status = status diff --git a/azure-mgmt-adhybridhealthservice/azure/mgmt/adhybridhealthservice/operations/services_operations.py b/azure-mgmt-adhybridhealthservice/azure/mgmt/adhybridhealthservice/operations/services_operations.py index d1afdea4f643..265cc5074d1b 100644 --- a/azure-mgmt-adhybridhealthservice/azure/mgmt/adhybridhealthservice/operations/services_operations.py +++ b/azure-mgmt-adhybridhealthservice/azure/mgmt/adhybridhealthservice/operations/services_operations.py @@ -1540,3 +1540,136 @@ def get_tenant_whitelisting( return deserialized get_tenant_whitelisting.metadata = {'url': '/providers/Microsoft.ADHybridHealthService/services/{serviceName}/TenantWhitelisting/{featureName}'} + + def list_all_risky_ip_download_report( + self, service_name, custom_headers=None, raw=False, **operation_config): + """Gets all Risky IP report URIs for the last 7 days. + + :param service_name: The name of the service. + :type service_name: 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 RiskyIPBlobUri + :rtype: + ~azure.mgmt.adhybridhealthservice.models.RiskyIPBlobUriPaged[~azure.mgmt.adhybridhealthservice.models.RiskyIPBlobUri] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_all_risky_ip_download_report.metadata['url'] + path_format_arguments = { + 'serviceName': self._serialize.url("service_name", service_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.RiskyIPBlobUriPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.RiskyIPBlobUriPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_all_risky_ip_download_report.metadata = {'url': '/providers/Microsoft.ADHybridHealthService/services/{serviceName}/reports/riskyIp/blobUris'} + + def list_current_risky_ip_download_report( + self, service_name, custom_headers=None, raw=False, **operation_config): + """Initiate the generation of a new Risky IP report. Returns the URI for + the new one. + + :param service_name: The name of the service. + :type service_name: 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 RiskyIPBlobUri + :rtype: + ~azure.mgmt.adhybridhealthservice.models.RiskyIPBlobUriPaged[~azure.mgmt.adhybridhealthservice.models.RiskyIPBlobUri] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_current_risky_ip_download_report.metadata['url'] + path_format_arguments = { + 'serviceName': self._serialize.url("service_name", service_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['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.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.RiskyIPBlobUriPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.RiskyIPBlobUriPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_current_risky_ip_download_report.metadata = {'url': '/providers/Microsoft.ADHybridHealthService/services/{serviceName}/reports/riskyIp/generateBlobUri'}