diff --git a/sdk/core/azure-core/CHANGELOG.md b/sdk/core/azure-core/CHANGELOG.md index 89b76c945ebb..5fd84d19d465 100644 --- a/sdk/core/azure-core/CHANGELOG.md +++ b/sdk/core/azure-core/CHANGELOG.md @@ -1,7 +1,7 @@ # Release History -## 1.6.0 (Unreleased) +## 1.6.0 (2020-06-03) ### Bug fixes @@ -13,7 +13,7 @@ - Added support for changesets as part of multipart message support #10485 - Add AsyncLROPoller in azure.core.polling #10801 - Add get_continuation_token/from_continuation_token/polling_method methods in pollers (sync and async) #10801 -- HttpResponse objects are now pickable #10801 +- HttpResponse and PipelineContext objects are now pickable #10801 ## 1.5.0 (2020-05-04) diff --git a/sdk/core/azure-core/azure/core/pipeline/__init__.py b/sdk/core/azure-core/azure/core/pipeline/__init__.py index cec8606569ae..baeea6db1c7a 100644 --- a/sdk/core/azure-core/azure/core/pipeline/__init__.py +++ b/sdk/core/azure-core/azure/core/pipeline/__init__.py @@ -63,6 +63,9 @@ class PipelineContext(dict): :param transport: The HTTP transport type. :param kwargs: Developer-defined keyword arguments. """ + _PICKLE_CONTEXT = { + 'deserialized_data' + } def __init__(self, transport, **kwargs): # pylint: disable=super-init-not-called self.transport = transport @@ -75,6 +78,21 @@ def __getstate__(self): del state['transport'] return state + def __reduce__(self): + reduced = super(PipelineContext, self).__reduce__() + saved_context = {} + for key, value in self.items(): + if key in self._PICKLE_CONTEXT: + saved_context[key] = value + # 1 is for from __reduce__ spec of pickle (generic args for recreation) + # 2 is how dict is implementing __reduce__ (dict specific) + # tuple are read-only, we use a list in the meantime + reduced = list(reduced) + dict_reduced_result = list(reduced[1]) + dict_reduced_result[2] = saved_context + reduced[1] = tuple(dict_reduced_result) + return tuple(reduced) + def __setstate__(self, state): self.__dict__.update(state) # Re-create the unpickable entries diff --git a/sdk/core/azure-core/tests/test_universal_pipeline.py b/sdk/core/azure-core/tests/test_universal_pipeline.py index 51f735c2da09..40223f06965f 100644 --- a/sdk/core/azure-core/tests/test_universal_pipeline.py +++ b/sdk/core/azure-core/tests/test_universal_pipeline.py @@ -25,6 +25,7 @@ # #-------------------------------------------------------------------------- import logging +import pickle try: from unittest import mock except ImportError: @@ -56,6 +57,37 @@ HTTPPolicy, ) +def test_pipeline_context(): + kwargs={ + 'stream':True, + 'cont_token':"bla" + } + context = PipelineContext('transport', **kwargs) + context['foo'] = 'bar' + context['xyz'] = '123' + context['deserialized_data'] = 'marvelous' + + assert context['foo'] == 'bar' + assert context.options == kwargs + + with pytest.raises(TypeError): + context.clear() + + with pytest.raises(TypeError): + context.update({}) + + assert context.pop('foo') == 'bar' + assert 'foo' not in context + + serialized = pickle.dumps(context) + + revived_context = pickle.loads(serialized) + assert revived_context.options == kwargs + assert revived_context.transport is None + assert 'deserialized_data' in revived_context + assert len(revived_context) == 1 + + def test_request_history(): class Non_deep_copiable(object): def __deepcopy__(self, memodict={}): diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/CHANGELOG.md b/sdk/formrecognizer/azure-ai-formrecognizer/CHANGELOG.md index a740919023f1..75231f1a7538 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/CHANGELOG.md +++ b/sdk/formrecognizer/azure-ai-formrecognizer/CHANGELOG.md @@ -4,24 +4,36 @@ **Breaking Changes** -- `training_files` parameter of `begin_train_model` is renamed to `training_files_url` -- `use_labels` parameter of `begin_train_model` is renamed to `use_training_labels` +- All asynchronous long running operation methods now return an instance of an `AsyncLROPoller` from `azure-core` +- All asynchronous long running operation methods are renamed with the `begin_` prefix to indicate that an `AsyncLROPoller` is returned: + - `train_model` is renamed to `begin_training` + - `recognize_receipts` is renamed to `begin_recognize_receipts` + - `recognize_receipts_from_url` is renamed to `begin_recognize_receipts_from_url` + - `recognize_content` is renamed to `begin_recognize_content` + - `recognize_content_from_url` is renamed to `begin_recognize_content_from_url` + - `recognize_custom_forms` is renamed to `begin_recognize_custom_forms` + - `recognize_custom_forms_from_url` is renamed to `begin_recognize_custom_forms_from_url` +- Sync method `begin_train_model` renamed to `begin_training` +- `training_files` parameter of `begin_training` is renamed to `training_files_url` +- `use_labels` parameter of `begin_training` is renamed to `use_training_labels` - `list_model_infos` method has been renamed to `list_custom_models` - Removed `get_form_training_client` from `FormRecognizerClient` - Added `get_form_recognizer_client` to `FormTrainingClient` -- A `HttpResponseError` is now raised if a model with `status=="invalid"` is returned from the `begin_train_model()` or `train_model()` methods +- A `HttpResponseError` is now raised if a model with `status=="invalid"` is returned from the `begin_training` methods - `PageRange` is renamed to `FormPageRange` - `first_page` and `last_page` renamed to `first_page_number` and `last_page_number`, respectively on `FormPageRange` -- `FormField` does not have a page_number. -- `begin_recognize_receipts` APIs now return `RecognizedReceipt` instead of `USReceipt` -- `USReceiptType` is renamed to `ReceiptType` -- `use_training_labels` is now a required positional param in the `begin_training` APIs. -- `stream` and `url` parameters found on methods for `FormRecognizerClient` have been renamed to `form` and `form_url`, respectively. -- For recognize receipt methods, parameters have been renamed to `receipt` and `receipt_url`. +- `FormField` does not have a page_number +- `use_training_labels` is now a required positional param in the `begin_training` APIs +- `stream` and `url` parameters found on methods for `FormRecognizerClient` have been renamed to `form` and `form_url`, respectively +- For `begin_recognize_receipt` methods, parameters have been renamed to `receipt` and `receipt_url` - `created_on` and `last_modified` are renamed to `requested_on` and `completed_on` in the -`CustomFormModel` and `CustomFormModelInfo` models. +`CustomFormModel` and `CustomFormModelInfo` models - `models` property of `CustomFormModel` is renamed to `submodels` - `CustomFormSubModel` is renamed to `CustomFormSubmodel` +- `begin_recognize_receipts` APIs now return `RecognizedReceipt` instead of `USReceipt` +- Removed `USReceipt`. To see how to deal with the return value of `begin_recognize_receipts`, see the recognize receipt samples in the [samples directory](https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/formrecognizer/azure-ai-formrecognizer/samples) for details. +- Removed `USReceiptItem`. To see how to access the individual items on a receipt, see the recognize receipt samples in the [samples directory](https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/formrecognizer/azure-ai-formrecognizer/samples) for details. +- Removed `USReceiptType` and the `receipt_type` property from `RecognizedReceipt`. See the recognize receipt samples in the [samples directory](https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/formrecognizer/azure-ai-formrecognizer/samples) for details. **New features** @@ -29,6 +41,11 @@ - Authentication using `azure-identity` credentials now supported - see the [Azure Identity documentation](https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/identity/azure-identity/README.md) for more information - `page_number` attribute has been added to `FormTable` +- All long running operation methods now accept the keyword argument `continuation_token` to restart the poller from a saved state + +**Dependency updates** + +- Adopted [azure-core](https://pypi.org/project/azure-core/) version 1.6.0 or greater ## 1.0.0b2 (2020-05-06) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/README.md b/sdk/formrecognizer/azure-ai-formrecognizer/README.md index 485804eb597b..3a3e08b33004 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/README.md +++ b/sdk/formrecognizer/azure-ai-formrecognizer/README.md @@ -140,10 +140,10 @@ Long-running operations are operations which consist of an initial request sent followed by polling the service at intervals to determine whether the operation has completed or failed, and if it has succeeded, to get the result. -Methods that train models or recognize values from forms are modeled as long-running operations. The client exposes -a `begin_` method that returns an `LROPoller`. Callers should wait for the operation to complete by -calling `result()` on the operation returned from the `begin_` method. Sample code snippets are provided -to illustrate using long-running operations [below](#examples "Examples"). +Methods that train models, recognize values from forms, or copy models are modeled as long-running operations. +The client exposes a `begin_` method that returns an `LROPoller` or `AsyncLROPoller`. Callers should wait +for the operation to complete by calling `result()` on the operation returned from the `begin_` method. +Sample code snippets are provided to illustrate using long-running operations [below](#examples "Examples"). ## Examples @@ -210,7 +210,7 @@ for cell in table.cells: ``` ### Recognize Receipts -Recognize data from USA sales receipts using a prebuilt model. +Recognize data from USA sales receipts using a prebuilt model. [Here][service_recognize_receipt] are the fields the service returns for a recognized receipt. ```python from azure.ai.formrecognizer import FormRecognizerClient @@ -227,21 +227,16 @@ with open("", "rb") as fd: poller = form_recognizer_client.begin_recognize_receipts(receipt) result = poller.result() -r = result[0] -print("Receipt contained the following values with confidences: ") -print("Receipt Type: {} has confidence: {}".format(r.receipt_type.type, r.receipt_type.confidence)) -print("Merchant Name: {} has confidence: {}".format(r.merchant_name.value, r.merchant_name.confidence)) -print("Transaction Date: {} has confidence: {}".format(r.transaction_date.value, r.transaction_date.confidence)) -print("Receipt items:") -for item in r.receipt_items: - print("...Item Name: {} has confidence: {}".format(item.name.value, item.name.confidence)) - print("...Item Quantity: {} has confidence: {}".format(item.quantity.value, item.quantity.confidence)) - print("...Individual Item Price: {} has confidence: {}".format(item.price.value, item.price.confidence)) - print("...Total Item Price: {} has confidence: {}".format(item.total_price.value, item.total_price.confidence)) -print("Subtotal: {} has confidence: {}".format(r.subtotal.value, r.subtotal.confidence)) -print("Tax: {} has confidence: {}".format(r.tax.value, r.tax.confidence)) -print("Tip: {} has confidence: {}".format(r.tip.value, r.tip.confidence)) -print("Total: {} has confidence: {}".format(r.total.value, r.total.confidence)) +for receipt in result: + for name, field in receipt.fields.items(): + if name == "Items": + print("Receipt Items:") + for idx, items in enumerate(field.value): + print("...Item #{}".format(idx)) + for item_name, item in items.value.items(): + print("......{}: {} has confidence {}".format(item_name, item.value, item.confidence)) + else: + print("{}: {} has confidence {}".format(name, field.value, field.confidence)) ``` ### Train a model @@ -259,7 +254,7 @@ credential = AzureKeyCredential("") form_training_client = FormTrainingClient(endpoint, credential) container_sas_url = "xxx" # training documents uploaded to blob storage -poller = form_training_client.begin_train_model(container_sas_url) +poller = form_training_client.begin_training(container_sas_url) model = poller.result() # Custom model information @@ -439,6 +434,7 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [cognitive_authentication_aad]: https://docs.microsoft.com/azure/cognitive-services/authentication#authenticate-with-azure-active-directory [azure_identity_credentials]: ../../identity/azure-identity#credentials [default_azure_credential]: ../../identity/azure-identity#defaultazurecredential +[service_recognize_receipt]: https://westus2.dev.cognitive.microsoft.com/docs/services/form-recognizer-api-v2-preview/operations/GetAnalyzeReceiptResult [cla]: https://cla.microsoft.com [code_of_conduct]: https://opensource.microsoft.com/codeofconduct/ diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/__init__.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/__init__.py index f65b9e8e92af..dd86f0f42e41 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/__init__.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/__init__.py @@ -14,9 +14,6 @@ TrainingStatus, CustomFormModelStatus, FormContentType, - USReceipt, - ReceiptType, - USReceiptItem, FormTable, FormTableCell, TrainingDocumentInfo, @@ -45,9 +42,6 @@ 'CustomFormModelStatus', 'FormContentType', 'FormContent', - 'USReceipt', - 'ReceiptType', - 'USReceiptItem', 'FormTable', 'FormTableCell', 'TrainingDocumentInfo', diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_form_recognizer_client.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_form_recognizer_client.py index d3d2173442aa..b5349668390e 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_form_recognizer_client.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_form_recognizer_client.py @@ -10,6 +10,7 @@ Any, IO, Union, + List, TYPE_CHECKING ) from azure.core.tracing.decorator import distributed_trace @@ -17,7 +18,7 @@ from azure.core.polling.base_polling import LROBasePolling from ._generated._form_recognizer_client import FormRecognizerClient as FormRecognizer from ._response_handlers import ( - prepare_us_receipt, + prepare_receipt, prepare_content_result, prepare_form_result ) @@ -27,6 +28,7 @@ from ._polling import AnalyzePolling if TYPE_CHECKING: from azure.core.credentials import AzureKeyCredential, TokenCredential + from ._models import RecognizedReceipt, FormPage, RecognizedForm class FormRecognizerClient(object): @@ -66,7 +68,7 @@ def __init__(self, endpoint, credential, **kwargs): authentication_policy = get_authentication_policy(credential) self._client = FormRecognizer( endpoint=endpoint, - credential=credential, + credential=credential, # type: ignore sdk_moniker=USER_AGENT, authentication_policy=authentication_policy, **kwargs @@ -74,11 +76,11 @@ def __init__(self, endpoint, credential, **kwargs): def _receipt_callback(self, raw_response, _, headers): # pylint: disable=unused-argument analyze_result = self._client._deserialize(AnalyzeOperationResult, raw_response) - return prepare_us_receipt(analyze_result) + return prepare_receipt(analyze_result) @distributed_trace def begin_recognize_receipts(self, receipt, **kwargs): - # type: (Union[bytes, IO[bytes]], Any) -> LROPoller + # type: (Union[bytes, IO[bytes]], Any) -> LROPoller[List[RecognizedReceipt]] """Extract field text and semantic values from a given US sales receipt. The input document must be of one of the supported content types - 'application/pdf', 'image/jpeg', 'image/png' or 'image/tiff'. @@ -93,6 +95,7 @@ def begin_recognize_receipts(self, receipt, **kwargs): see :class:`~azure.ai.formrecognizer.FormContentType`. :keyword int polling_interval: Waiting time between two polls for LRO operations if no Retry-After header is present. Defaults to 5 seconds. + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :return: An instance of an LROPoller. Call `result()` on the poller object to return a list[:class:`~azure.ai.formrecognizer.RecognizedReceipt`]. :rtype: ~azure.core.polling.LROPoller[list[~azure.ai.formrecognizer.RecognizedReceipt]] @@ -109,6 +112,7 @@ def begin_recognize_receipts(self, receipt, **kwargs): """ polling_interval = kwargs.pop("polling_interval", POLLING_INTERVAL) + continuation_token = kwargs.pop("continuation_token", None) content_type = kwargs.pop("content_type", None) if content_type == "application/json": raise TypeError("Call begin_recognize_receipts_from_url() to analyze a receipt from a url.") @@ -125,12 +129,13 @@ def begin_recognize_receipts(self, receipt, **kwargs): cls=kwargs.pop("cls", self._receipt_callback), polling=LROBasePolling(timeout=polling_interval, **kwargs), error_map=error_map, + continuation_token=continuation_token, **kwargs ) @distributed_trace def begin_recognize_receipts_from_url(self, receipt_url, **kwargs): - # type: (str, Any) -> LROPoller + # type: (str, Any) -> LROPoller[List[RecognizedReceipt]] """Extract field text and semantic values from a given US sales receipt. The input document must be the location (Url) of the receipt to be analyzed. @@ -141,6 +146,7 @@ def begin_recognize_receipts_from_url(self, receipt_url, **kwargs): Whether or not to include text elements such as lines and words in addition to form fields. :keyword int polling_interval: Waiting time between two polls for LRO operations if no Retry-After header is present. Defaults to 5 seconds. + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :return: An instance of an LROPoller. Call `result()` on the poller object to return a list[:class:`~azure.ai.formrecognizer.RecognizedReceipt`]. :rtype: ~azure.core.polling.LROPoller[list[~azure.ai.formrecognizer.RecognizedReceipt]] @@ -157,6 +163,7 @@ def begin_recognize_receipts_from_url(self, receipt_url, **kwargs): """ polling_interval = kwargs.pop("polling_interval", POLLING_INTERVAL) + continuation_token = kwargs.pop("continuation_token", None) include_text_content = kwargs.pop("include_text_content", False) return self._client.begin_analyze_receipt_async( @@ -165,6 +172,7 @@ def begin_recognize_receipts_from_url(self, receipt_url, **kwargs): cls=kwargs.pop("cls", self._receipt_callback), polling=LROBasePolling(timeout=polling_interval, **kwargs), error_map=error_map, + continuation_token=continuation_token, **kwargs ) @@ -174,7 +182,7 @@ def _content_callback(self, raw_response, _, headers): # pylint: disable=unused @distributed_trace def begin_recognize_content(self, form, **kwargs): - # type: (Union[bytes, IO[bytes]], Any) -> LROPoller + # type: (Union[bytes, IO[bytes]], Any) -> LROPoller[List[FormPage]] """Extract text and content/layout information from a given document. The input document must be of one of the supported content types - 'application/pdf', 'image/jpeg', 'image/png' or 'image/tiff'. @@ -186,6 +194,7 @@ def begin_recognize_content(self, form, **kwargs): see :class:`~azure.ai.formrecognizer.FormContentType`. :keyword int polling_interval: Waiting time between two polls for LRO operations if no Retry-After header is present. Defaults to 5 seconds. + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :return: An instance of an LROPoller. Call `result()` on the poller object to return a list[:class:`~azure.ai.formrecognizer.FormPage`]. :rtype: ~azure.core.polling.LROPoller[list[~azure.ai.formrecognizer.FormPage]] @@ -202,6 +211,7 @@ def begin_recognize_content(self, form, **kwargs): """ polling_interval = kwargs.pop("polling_interval", POLLING_INTERVAL) + continuation_token = kwargs.pop("continuation_token", None) content_type = kwargs.pop("content_type", None) if content_type == "application/json": raise TypeError("Call begin_recognize_content_from_url() to analyze a document from a url.") @@ -215,12 +225,13 @@ def begin_recognize_content(self, form, **kwargs): cls=kwargs.pop("cls", self._content_callback), polling=LROBasePolling(timeout=polling_interval, **kwargs), error_map=error_map, + continuation_token=continuation_token, **kwargs ) @distributed_trace def begin_recognize_content_from_url(self, form_url, **kwargs): - # type: (str, Any) -> LROPoller + # type: (str, Any) -> LROPoller[List[FormPage]] """Extract text and layout information from a given document. The input document must be the location (Url) of the document to be analyzed. @@ -228,6 +239,7 @@ def begin_recognize_content_from_url(self, form_url, **kwargs): of one of the supported formats: JPEG, PNG, PDF and TIFF. :keyword int polling_interval: Waiting time between two polls for LRO operations if no Retry-After header is present. Defaults to 5 seconds. + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :return: An instance of an LROPoller. Call `result()` on the poller object to return a list[:class:`~azure.ai.formrecognizer.FormPage`]. :rtype: ~azure.core.polling.LROPoller[list[~azure.ai.formrecognizer.FormPage]] @@ -235,18 +247,20 @@ def begin_recognize_content_from_url(self, form_url, **kwargs): """ polling_interval = kwargs.pop("polling_interval", POLLING_INTERVAL) + continuation_token = kwargs.pop("continuation_token", None) return self._client.begin_analyze_layout_async( file_stream={"source": form_url}, cls=kwargs.pop("cls", self._content_callback), polling=LROBasePolling(timeout=polling_interval, **kwargs), error_map=error_map, + continuation_token=continuation_token, **kwargs ) @distributed_trace def begin_recognize_custom_forms(self, model_id, form, **kwargs): - # type: (str, Union[bytes, IO[bytes]], Any) -> LROPoller + # type: (str, Union[bytes, IO[bytes]], Any) -> LROPoller[List[RecognizedForm]] """Analyze a custom form with a model trained with or without labels. The form to analyze should be of the same type as the forms that were used to train the model. The input document must be of one of the supported content types - 'application/pdf', @@ -262,6 +276,7 @@ def begin_recognize_custom_forms(self, model_id, form, **kwargs): see :class:`~azure.ai.formrecognizer.FormContentType`. :keyword int polling_interval: Waiting time between two polls for LRO operations if no Retry-After header is present. Defaults to 5 seconds. + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :return: An instance of an LROPoller. Call `result()` on the poller object to return a list[:class:`~azure.ai.formrecognizer.RecognizedForm`]. :rtype: ~azure.core.polling.LROPoller[list[~azure.ai.formrecognizer.RecognizedForm] @@ -282,6 +297,7 @@ def begin_recognize_custom_forms(self, model_id, form, **kwargs): cls = kwargs.pop("cls", None) polling_interval = kwargs.pop("polling_interval", POLLING_INTERVAL) + continuation_token = kwargs.pop("continuation_token", None) content_type = kwargs.pop("content_type", None) if content_type == "application/json": raise TypeError("Call begin_recognize_custom_forms_from_url() to analyze a document from a url.") @@ -303,12 +319,13 @@ def analyze_callback(raw_response, _, headers): # pylint: disable=unused-argume cls=deserialization_callback, polling=LROBasePolling(timeout=polling_interval, lro_algorithms=[AnalyzePolling()], **kwargs), error_map=error_map, + continuation_token=continuation_token, **kwargs ) @distributed_trace def begin_recognize_custom_forms_from_url(self, model_id, form_url, **kwargs): - # type: (str, str, Any) -> LROPoller + # type: (str, str, Any) -> LROPoller[List[RecognizedForm]] """Analyze a custom form with a model trained with or without labels. The form to analyze should be of the same type as the forms that were used to train the model. The input document must be the location (Url) of the document to be analyzed. @@ -320,6 +337,7 @@ def begin_recognize_custom_forms_from_url(self, model_id, form_url, **kwargs): Whether or not to include text elements such as lines and words in addition to form fields. :keyword int polling_interval: Waiting time between two polls for LRO operations if no Retry-After header is present. Defaults to 5 seconds. + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :return: An instance of an LROPoller. Call `result()` on the poller object to return a list[:class:`~azure.ai.formrecognizer.RecognizedForm`]. :rtype: ~azure.core.polling.LROPoller[list[~azure.ai.formrecognizer.RecognizedForm] @@ -331,6 +349,7 @@ def begin_recognize_custom_forms_from_url(self, model_id, form_url, **kwargs): cls = kwargs.pop("cls", None) polling_interval = kwargs.pop("polling_interval", POLLING_INTERVAL) + continuation_token = kwargs.pop("continuation_token", None) include_text_content = kwargs.pop("include_text_content", False) def analyze_callback(raw_response, _, headers): # pylint: disable=unused-argument @@ -345,6 +364,7 @@ def analyze_callback(raw_response, _, headers): # pylint: disable=unused-argume cls=deserialization_callback, polling=LROBasePolling(timeout=polling_interval, lro_algorithms=[AnalyzePolling()], **kwargs), error_map=error_map, + continuation_token=continuation_token, **kwargs ) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_form_training_client.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_form_training_client.py index b79480d379d2..530b256da206 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_form_training_client.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_form_training_client.py @@ -80,15 +80,15 @@ def __init__(self, endpoint, credential, **kwargs): authentication_policy = get_authentication_policy(credential) self._client = FormRecognizer( endpoint=self._endpoint, - credential=self._credential, + credential=self._credential, # type: ignore sdk_moniker=USER_AGENT, authentication_policy=authentication_policy, **kwargs ) @distributed_trace - def begin_train_model(self, training_files_url, use_training_labels, **kwargs): - # type: (str, bool, Any) -> LROPoller + def begin_training(self, training_files_url, use_training_labels, **kwargs): + # type: (str, bool, Any) -> LROPoller[CustomFormModel] """Create and train a custom model. The request must include a `training_files_url` parameter that is an externally accessible Azure storage blob container Uri (preferably a Shared Access Signature Uri). Models are trained using documents that are of the following content type - 'application/pdf', @@ -105,6 +105,7 @@ def begin_train_model(self, training_files_url, use_training_labels, **kwargs): Use with `prefix` to filter for only certain sub folders. Not supported if training with labels. :keyword int polling_interval: Waiting time between two polls for LRO operations if no Retry-After header is present. Defaults to 5 seconds. + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :return: An instance of an LROPoller. Call `result()` on the poller object to return a :class:`~azure.ai.formrecognizer.CustomFormModel`. :rtype: ~azure.core.polling.LROPoller[~azure.ai.formrecognizer.CustomFormModel] @@ -122,8 +123,23 @@ def begin_train_model(self, training_files_url, use_training_labels, **kwargs): :caption: Training a model with your custom forms. """ + def callback(raw_response): + model = self._client._deserialize(Model, raw_response) + return CustomFormModel._from_generated(model) + cls = kwargs.pop("cls", None) + continuation_token = kwargs.pop("continuation_token", None) polling_interval = kwargs.pop("polling_interval", POLLING_INTERVAL) + deserialization_callback = cls if cls else callback + + if continuation_token: + return LROPoller.from_continuation_token( + polling_method=LROBasePolling(timeout=polling_interval, lro_algorithms=[TrainingPolling()], **kwargs), + continuation_token=continuation_token, + client=self._client._client, + deserialization_callback=deserialization_callback + ) + response = self._client.train_custom_model_async( # type: ignore train_request=TrainRequest( source=training_files_url, @@ -138,11 +154,6 @@ def begin_train_model(self, training_files_url, use_training_labels, **kwargs): **kwargs ) # type: PipelineResponseType - def callback(raw_response): - model = self._client._deserialize(Model, raw_response) - return CustomFormModel._from_generated(model) - - deserialization_callback = cls if cls else callback return LROPoller( self._client._client, response, @@ -297,7 +308,7 @@ def begin_copy_model( target, # type: Dict **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[CustomFormModelInfo] """Copy a custom model stored in this resource (the source) to the user specified target Form Recognizer resource. This should be called with the source Form Recognizer resource (with the model that is intended to be copied). The `target` parameter should be supplied from the @@ -309,6 +320,7 @@ def begin_copy_model( :func:`~get_copy_authorization()`. :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :return: An instance of an LROPoller. Call `result()` on the poller object to return a :class:`~azure.ai.formrecognizer.CustomFormModelInfo`. :rtype: ~azure.core.polling.LROPoller[~azure.ai.formrecognizer.CustomFormModelInfo] @@ -328,6 +340,7 @@ def begin_copy_model( raise ValueError("model_id cannot be None or empty.") polling_interval = kwargs.pop("polling_interval", POLLING_INTERVAL) + continuation_token = kwargs.pop("continuation_token", None) def _copy_callback(raw_response, _, headers): # pylint: disable=unused-argument copy_result = self._client._deserialize(CopyOperationResult, raw_response) @@ -347,6 +360,7 @@ def _copy_callback(raw_response, _, headers): # pylint: disable=unused-argument cls=kwargs.pop("cls", _copy_callback), polling=LROBasePolling(timeout=polling_interval, lro_algorithms=[CopyPolling()], **kwargs), error_map=error_map, + continuation_token=continuation_token, **kwargs ) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/_form_recognizer_client.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/_form_recognizer_client.py index ad4fc9939ad0..ebfee04f90f6 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/_form_recognizer_client.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/_form_recognizer_client.py @@ -13,6 +13,8 @@ # pylint: disable=unused-import,ungrouped-imports from typing import Any + from azure.core.credentials import TokenCredential + from ._configuration import FormRecognizerClientConfiguration from .operations import FormRecognizerClientOperationsMixin from . import models diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/_version.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/_version.py index 4b19902c2480..9aa774407087 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/_version.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/_version.py @@ -4,4 +4,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "1.0.0b2" +VERSION = "1.0.0b3" diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/aio/_configuration_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/aio/_configuration_async.py index 5a4c7f8cb2eb..3faa127ff1c9 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/aio/_configuration_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/aio/_configuration_async.py @@ -13,7 +13,7 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials import TokenCredential + from azure.core.credentials_async import AsyncTokenCredential class FormRecognizerClientConfiguration(Configuration): diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/aio/_form_recognizer_client_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/aio/_form_recognizer_client_async.py index c084748c0821..eee9966f59a4 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/aio/_form_recognizer_client_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/aio/_form_recognizer_client_async.py @@ -4,11 +4,15 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any +from typing import Any, TYPE_CHECKING from azure.core import AsyncPipelineClient from msrest import Deserializer, Serializer +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + from ._configuration_async import FormRecognizerClientConfiguration from .operations_async import FormRecognizerClientOperationsMixin from .. import models diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/aio/operations_async/_form_recognizer_client_operations_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/aio/operations_async/_form_recognizer_client_operations_async.py index 64ce71c09954..0746043cba4a 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/aio/operations_async/_form_recognizer_client_operations_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/aio/operations_async/_form_recognizer_client_operations_async.py @@ -3,14 +3,14 @@ # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.0.6282, generator: {generator}) # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import Any, AsyncIterable, Callable, Dict, Generic, IO, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.core.polling import AsyncNoPolling, AsyncPollingMethod, async_poller +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod from azure.core.polling.async_base_polling import AsyncLROBasePolling from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -28,14 +28,22 @@ async def train_custom_model_async( train_request: "models.TrainRequest", **kwargs ) -> None: - """Create and train a custom model. The request must include a source parameter that is either an externally accessible Azure storage blob container Uri (preferably a Shared Access Signature Uri) or valid path to a data folder in a locally mounted drive. When local paths are specified, they must follow the Linux/Unix path format and be an absolute path rooted to the input mount configuration setting value e.g., if '{Mounts:Input}' configuration setting value is '/input' then a valid source path would be '/input/contosodataset'. All data to be trained is expected to be under the source folder or sub folders under it. Models are trained using documents that are of the following content type - 'application/pdf', 'image/jpeg', 'image/png', 'image/tiff'. Other type of content is ignored. - - Train Custom Model. + """Train Custom Model. + + Create and train a custom model. The request must include a source parameter that is either an + externally accessible Azure storage blob container Uri (preferably a Shared Access Signature + Uri) or valid path to a data folder in a locally mounted drive. When local paths are specified, + they must follow the Linux/Unix path format and be an absolute path rooted to the input mount + configuration setting value e.g., if '{Mounts:Input}' configuration setting value is '/input' + then a valid source path would be '/input/contosodataset'. All data to be trained is expected + to be under the source folder or sub folders under it. Models are trained using documents that + are of the following content type - 'application/pdf', 'image/jpeg', 'image/png', 'image/tiff'. + Other type of content is ignored. :param train_request: Training request parameters. :type train_request: ~azure.ai.formrecognizer.models.TrainRequest :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) + :return: None, or the result of cls(response) :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ @@ -76,7 +84,7 @@ async def train_custom_model_async( response_headers['Location']=self._deserialize('str', response.headers.get('Location')) if cls: - return cls(pipeline_response, None, response_headers) + return cls(pipeline_response, None, response_headers) train_custom_model_async.metadata = {'url': '/custom/models'} # type: ignore @@ -87,16 +95,16 @@ async def get_custom_model( include_keys: Optional[bool] = False, **kwargs ) -> "models.Model": - """Get detailed information about a custom model. + """Get Custom Model. - Get Custom Model. + Get detailed information about a custom model. :param model_id: Model identifier. :type model_id: str :param include_keys: Include list of extracted keys in model information. :type include_keys: bool :keyword callable cls: A custom type or function that will be passed the direct response - :return: Model or the result of cls(response) + :return: Model, or the result of cls(response) :rtype: ~azure.ai.formrecognizer.models.Model :raises: ~azure.core.exceptions.HttpResponseError """ @@ -134,7 +142,7 @@ async def get_custom_model( deserialized = self._deserialize('Model', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized get_custom_model.metadata = {'url': '/custom/models/{modelId}'} # type: ignore @@ -145,14 +153,15 @@ async def delete_custom_model( model_id: str, **kwargs ) -> None: - """Mark model for deletion. Model artifacts will be permanently removed within a predetermined period. + """Delete Custom Model. - Delete Custom Model. + Mark model for deletion. Model artifacts will be permanently removed within a predetermined + period. :param model_id: Model identifier. :type model_id: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) + :return: None, or the result of cls(response) :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ @@ -185,7 +194,7 @@ async def delete_custom_model( raise HttpResponseError(response=response, model=error) if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) delete_custom_model.metadata = {'url': '/custom/models/{modelId}'} # type: ignore @@ -193,7 +202,7 @@ async def _analyze_with_custom_model_initial( self, model_id: str, include_text_details: Optional[bool] = False, - file_stream: Optional[Union[str, "models.SourcePath"]] = None, + file_stream: Optional[Union[IO, "models.SourcePath"]] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -220,9 +229,9 @@ async def _analyze_with_custom_model_initial( # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] - if header_parameters['Content-Type'] in ['application/pdf', 'image/jpeg', 'image/png', 'image/tiff']: + if header_parameters['Content-Type'].split(";")[0] in ['application/pdf', 'image/jpeg', 'image/png', 'image/tiff']: body_content_kwargs['stream_content'] = file_stream - elif header_parameters['Content-Type'] in ['application/json']: + elif header_parameters['Content-Type'].split(";")[0] in ['application/json']: if file_stream is not None: body_content = self._serialize.body(file_stream, 'SourcePath') else: @@ -230,7 +239,8 @@ async def _analyze_with_custom_model_initial( body_content_kwargs['content'] = body_content else: raise ValueError( - "Content type {} is not valid for this operation".format(header_parameters['Content-Type']) + "The content_type '{}' is not one of the allowed values: " + "['application/pdf', 'image/jpeg', 'image/png', 'image/tiff', 'application/json']".format(header_parameters['Content-Type']) ) request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) @@ -246,21 +256,24 @@ async def _analyze_with_custom_model_initial( response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) if cls: - return cls(pipeline_response, None, response_headers) + return cls(pipeline_response, None, response_headers) _analyze_with_custom_model_initial.metadata = {'url': '/custom/models/{modelId}/analyze'} # type: ignore @distributed_trace_async - async def analyze_with_custom_model( + async def begin_analyze_with_custom_model( self, model_id: str, include_text_details: Optional[bool] = False, - file_stream: Optional[Union[str, "models.SourcePath"]] = None, + file_stream: Optional[Union[IO, "models.SourcePath"]] = None, **kwargs ) -> None: - """Extract key-value pairs, tables, and semantic values from a given document. The input document must be of one of the supported content types - 'application/pdf', 'image/jpeg', 'image/png' or 'image/tiff'. Alternatively, use 'application/json' type to specify the location (Uri or local path) of the document to be analyzed. + """Analyze Form. - Analyze Form. + Extract key-value pairs, tables, and semantic values from a given document. The input document + must be of one of the supported content types - 'application/pdf', 'image/jpeg', 'image/png' or + 'image/tiff'. Alternatively, use 'application/json' type to specify the location (Uri or local + path) of the document to be analyzed. :param model_id: Model identifier. :type model_id: str @@ -269,11 +282,12 @@ async def analyze_with_custom_model( :param file_stream: .json, .pdf, .jpg, .png or .tiff type file stream. :type file_stream: ~azure.ai.formrecognizer.models.SourcePath :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None + :return: None, or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ @@ -283,13 +297,18 @@ async def analyze_with_custom_model( 'polling_interval', self._config.polling_interval ) - raw_result = await self._analyze_with_custom_model_initial( - model_id=model_id, - include_text_details=include_text_details, - file_stream=file_stream, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._analyze_with_custom_model_initial( + model_id=model_id, + include_text_details=include_text_details, + file_stream=file_stream, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: @@ -298,8 +317,16 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncLROBasePolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - analyze_with_custom_model.metadata = {'url': '/custom/models/{modelId}/analyze'} # type: ignore + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_analyze_with_custom_model.metadata = {'url': '/custom/models/{modelId}/analyze'} # type: ignore @distributed_trace_async async def get_analyze_form_result( @@ -308,16 +335,16 @@ async def get_analyze_form_result( result_id: str, **kwargs ) -> "models.AnalyzeOperationResult": - """Obtain current status and the result of the analyze form operation. + """Get Analyze Form Result. - Get Analyze Form Result. + Obtain current status and the result of the analyze form operation. :param model_id: Model identifier. :type model_id: str :param result_id: Analyze operation result identifier. :type result_id: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: AnalyzeOperationResult or the result of cls(response) + :return: AnalyzeOperationResult, or the result of cls(response) :rtype: ~azure.ai.formrecognizer.models.AnalyzeOperationResult :raises: ~azure.core.exceptions.HttpResponseError """ @@ -354,7 +381,7 @@ async def get_analyze_form_result( deserialized = self._deserialize('AnalyzeOperationResult', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized get_analyze_form_result.metadata = {'url': '/custom/models/{modelId}/analyzeResults/{resultId}'} # type: ignore @@ -403,31 +430,33 @@ async def _copy_custom_model_initial( response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) if cls: - return cls(pipeline_response, None, response_headers) + return cls(pipeline_response, None, response_headers) _copy_custom_model_initial.metadata = {'url': '/custom/models/{modelId}/copy'} # type: ignore @distributed_trace_async - async def copy_custom_model( + async def begin_copy_custom_model( self, model_id: str, copy_request: "models.CopyRequest", **kwargs ) -> None: - """Copy custom model stored in this resource (the source) to user specified target Form Recognizer resource. + """Copy Custom Model. - Copy Custom Model. + Copy custom model stored in this resource (the source) to user specified target Form Recognizer + resource. :param model_id: Model identifier. :type model_id: str :param copy_request: Copy request parameters. :type copy_request: ~azure.ai.formrecognizer.models.CopyRequest :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None + :return: None, or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ @@ -437,12 +466,17 @@ async def copy_custom_model( 'polling_interval', self._config.polling_interval ) - raw_result = await self._copy_custom_model_initial( - model_id=model_id, - copy_request=copy_request, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._copy_custom_model_initial( + model_id=model_id, + copy_request=copy_request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: @@ -451,8 +485,16 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncLROBasePolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - copy_custom_model.metadata = {'url': '/custom/models/{modelId}/copy'} # type: ignore + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_copy_custom_model.metadata = {'url': '/custom/models/{modelId}/copy'} # type: ignore @distributed_trace_async async def get_custom_model_copy_result( @@ -461,16 +503,16 @@ async def get_custom_model_copy_result( result_id: str, **kwargs ) -> "models.CopyOperationResult": - """Obtain current status and the result of a custom model copy operation. + """Get Custom Model Copy Result. - Get Custom Model Copy Result. + Obtain current status and the result of a custom model copy operation. :param model_id: Model identifier. :type model_id: str :param result_id: Copy operation result identifier. :type result_id: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: CopyOperationResult or the result of cls(response) + :return: CopyOperationResult, or the result of cls(response) :rtype: ~azure.ai.formrecognizer.models.CopyOperationResult :raises: ~azure.core.exceptions.HttpResponseError """ @@ -507,7 +549,7 @@ async def get_custom_model_copy_result( deserialized = self._deserialize('CopyOperationResult', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized get_custom_model_copy_result.metadata = {'url': '/custom/models/{modelId}/copyResults/{resultId}'} # type: ignore @@ -517,12 +559,12 @@ async def generate_model_copy_authorization( self, **kwargs ) -> "models.CopyAuthorizationResult": - """Generate authorization to copy a model into the target Form Recognizer resource. + """Generate Copy Authorization. - Generate Copy Authorization. + Generate authorization to copy a model into the target Form Recognizer resource. :keyword callable cls: A custom type or function that will be passed the direct response - :return: CopyAuthorizationResult or the result of cls(response) + :return: CopyAuthorizationResult, or the result of cls(response) :rtype: ~azure.ai.formrecognizer.models.CopyAuthorizationResult :raises: ~azure.core.exceptions.HttpResponseError """ @@ -559,7 +601,7 @@ async def generate_model_copy_authorization( deserialized = self._deserialize('CopyAuthorizationResult', pipeline_response) if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) return deserialized generate_model_copy_authorization.metadata = {'url': '/custom/models/copyAuthorization'} # type: ignore @@ -567,7 +609,7 @@ async def generate_model_copy_authorization( async def _analyze_receipt_async_initial( self, include_text_details: Optional[bool] = False, - file_stream: Optional[Union[str, "models.SourcePath"]] = None, + file_stream: Optional[Union[IO, "models.SourcePath"]] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -593,9 +635,9 @@ async def _analyze_receipt_async_initial( # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] - if header_parameters['Content-Type'] in ['application/pdf', 'image/jpeg', 'image/png', 'image/tiff']: + if header_parameters['Content-Type'].split(";")[0] in ['application/pdf', 'image/jpeg', 'image/png', 'image/tiff']: body_content_kwargs['stream_content'] = file_stream - elif header_parameters['Content-Type'] in ['application/json']: + elif header_parameters['Content-Type'].split(";")[0] in ['application/json']: if file_stream is not None: body_content = self._serialize.body(file_stream, 'SourcePath') else: @@ -603,7 +645,8 @@ async def _analyze_receipt_async_initial( body_content_kwargs['content'] = body_content else: raise ValueError( - "Content type {} is not valid for this operation".format(header_parameters['Content-Type']) + "The content_type '{}' is not one of the allowed values: " + "['application/pdf', 'image/jpeg', 'image/png', 'image/tiff', 'application/json']".format(header_parameters['Content-Type']) ) request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) @@ -619,31 +662,35 @@ async def _analyze_receipt_async_initial( response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) if cls: - return cls(pipeline_response, None, response_headers) + return cls(pipeline_response, None, response_headers) _analyze_receipt_async_initial.metadata = {'url': '/prebuilt/receipt/analyze'} # type: ignore @distributed_trace_async - async def analyze_receipt_async( + async def begin_analyze_receipt_async( self, include_text_details: Optional[bool] = False, - file_stream: Optional[Union[str, "models.SourcePath"]] = None, + file_stream: Optional[Union[IO, "models.SourcePath"]] = None, **kwargs ) -> None: - """Extract field text and semantic values from a given receipt document. The input document must be of one of the supported content types - 'application/pdf', 'image/jpeg', 'image/png' or 'image/tiff'. Alternatively, use 'application/json' type to specify the location (Uri or local path) of the document to be analyzed. + """Analyze Receipt. - Analyze Receipt. + Extract field text and semantic values from a given receipt document. The input document must + be of one of the supported content types - 'application/pdf', 'image/jpeg', 'image/png' or + 'image/tiff'. Alternatively, use 'application/json' type to specify the location (Uri or local + path) of the document to be analyzed. :param include_text_details: Include text lines and element references in the result. :type include_text_details: bool :param file_stream: .json, .pdf, .jpg, .png or .tiff type file stream. :type file_stream: ~azure.ai.formrecognizer.models.SourcePath :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None + :return: None, or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ @@ -653,12 +700,17 @@ async def analyze_receipt_async( 'polling_interval', self._config.polling_interval ) - raw_result = await self._analyze_receipt_async_initial( - include_text_details=include_text_details, - file_stream=file_stream, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._analyze_receipt_async_initial( + include_text_details=include_text_details, + file_stream=file_stream, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: @@ -667,8 +719,16 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncLROBasePolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - analyze_receipt_async.metadata = {'url': '/prebuilt/receipt/analyze'} # type: ignore + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_analyze_receipt_async.metadata = {'url': '/prebuilt/receipt/analyze'} # type: ignore @distributed_trace_async async def get_analyze_receipt_result( @@ -676,14 +736,14 @@ async def get_analyze_receipt_result( result_id: str, **kwargs ) -> "models.AnalyzeOperationResult": - """Track the progress and obtain the result of the analyze receipt operation. + """Get Analyze Receipt Result. - Get Analyze Receipt Result. + Track the progress and obtain the result of the analyze receipt operation. :param result_id: Analyze operation result identifier. :type result_id: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: AnalyzeOperationResult or the result of cls(response) + :return: AnalyzeOperationResult, or the result of cls(response) :rtype: ~azure.ai.formrecognizer.models.AnalyzeOperationResult :raises: ~azure.core.exceptions.HttpResponseError """ @@ -719,14 +779,14 @@ async def get_analyze_receipt_result( deserialized = self._deserialize('AnalyzeOperationResult', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized get_analyze_receipt_result.metadata = {'url': '/prebuilt/receipt/analyzeResults/{resultId}'} # type: ignore async def _analyze_layout_async_initial( self, - file_stream: Optional[Union[str, "models.SourcePath"]] = None, + file_stream: Optional[Union[IO, "models.SourcePath"]] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -750,9 +810,9 @@ async def _analyze_layout_async_initial( # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] - if header_parameters['Content-Type'] in ['application/pdf', 'image/jpeg', 'image/png', 'image/tiff']: + if header_parameters['Content-Type'].split(";")[0] in ['application/pdf', 'image/jpeg', 'image/png', 'image/tiff']: body_content_kwargs['stream_content'] = file_stream - elif header_parameters['Content-Type'] in ['application/json']: + elif header_parameters['Content-Type'].split(";")[0] in ['application/json']: if file_stream is not None: body_content = self._serialize.body(file_stream, 'SourcePath') else: @@ -760,7 +820,8 @@ async def _analyze_layout_async_initial( body_content_kwargs['content'] = body_content else: raise ValueError( - "Content type {} is not valid for this operation".format(header_parameters['Content-Type']) + "The content_type '{}' is not one of the allowed values: " + "['application/pdf', 'image/jpeg', 'image/png', 'image/tiff', 'application/json']".format(header_parameters['Content-Type']) ) request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) @@ -776,28 +837,32 @@ async def _analyze_layout_async_initial( response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) if cls: - return cls(pipeline_response, None, response_headers) + return cls(pipeline_response, None, response_headers) _analyze_layout_async_initial.metadata = {'url': '/layout/analyze'} # type: ignore @distributed_trace_async - async def analyze_layout_async( + async def begin_analyze_layout_async( self, - file_stream: Optional[Union[str, "models.SourcePath"]] = None, + file_stream: Optional[Union[IO, "models.SourcePath"]] = None, **kwargs ) -> None: - """Extract text and layout information from a given document. The input document must be of one of the supported content types - 'application/pdf', 'image/jpeg', 'image/png' or 'image/tiff'. Alternatively, use 'application/json' type to specify the location (Uri or local path) of the document to be analyzed. + """Analyze Layout. - Analyze Layout. + Extract text and layout information from a given document. The input document must be of one of + the supported content types - 'application/pdf', 'image/jpeg', 'image/png' or 'image/tiff'. + Alternatively, use 'application/json' type to specify the location (Uri or local path) of the + document to be analyzed. :param file_stream: .json, .pdf, .jpg, .png or .tiff type file stream. :type file_stream: ~azure.ai.formrecognizer.models.SourcePath :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None + :return: None, or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ @@ -807,11 +872,16 @@ async def analyze_layout_async( 'polling_interval', self._config.polling_interval ) - raw_result = await self._analyze_layout_async_initial( - file_stream=file_stream, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._analyze_layout_async_initial( + file_stream=file_stream, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: @@ -820,8 +890,16 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncLROBasePolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - analyze_layout_async.metadata = {'url': '/layout/analyze'} # type: ignore + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_analyze_layout_async.metadata = {'url': '/layout/analyze'} # type: ignore @distributed_trace_async async def get_analyze_layout_result( @@ -829,14 +907,14 @@ async def get_analyze_layout_result( result_id: str, **kwargs ) -> "models.AnalyzeOperationResult": - """Track the progress and obtain the result of the analyze layout operation. + """Get Analyze Layout Result. - Get Analyze Layout Result. + Track the progress and obtain the result of the analyze layout operation. :param result_id: Analyze operation result identifier. :type result_id: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: AnalyzeOperationResult or the result of cls(response) + :return: AnalyzeOperationResult, or the result of cls(response) :rtype: ~azure.ai.formrecognizer.models.AnalyzeOperationResult :raises: ~azure.core.exceptions.HttpResponseError """ @@ -872,7 +950,7 @@ async def get_analyze_layout_result( deserialized = self._deserialize('AnalyzeOperationResult', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized get_analyze_layout_result.metadata = {'url': '/layout/analyzeResults/{resultId}'} # type: ignore @@ -882,12 +960,12 @@ def list_custom_models( self, **kwargs ) -> AsyncIterable["models.Models"]: - """Get information about all custom models. + """List Custom Models. - List Custom Models. + Get information about all custom models. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of Models or the result of cls(response) + :return: An iterator like instance of either Models or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.formrecognizer.models.Models] :raises: ~azure.core.exceptions.HttpResponseError """ @@ -953,12 +1031,12 @@ async def get_custom_models( self, **kwargs ) -> "models.Models": - """Get information about all custom models. + """Get Custom Models. - Get Custom Models. + Get information about all custom models. :keyword callable cls: A custom type or function that will be passed the direct response - :return: Models or the result of cls(response) + :return: Models, or the result of cls(response) :rtype: ~azure.ai.formrecognizer.models.Models :raises: ~azure.core.exceptions.HttpResponseError """ @@ -995,7 +1073,7 @@ async def get_custom_models( deserialized = self._deserialize('Models', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized get_custom_models.metadata = {'url': '/custom/models'} # type: ignore diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/operations/_form_recognizer_client_operations.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/operations/_form_recognizer_client_operations.py index 6a93c83008f9..3bc85d224944 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/operations/_form_recognizer_client_operations.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_generated/operations/_form_recognizer_client_operations.py @@ -18,7 +18,7 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Generic, IO, Iterable, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -32,14 +32,22 @@ def train_custom_model_async( **kwargs # type: Any ): # type: (...) -> None - """Create and train a custom model. The request must include a source parameter that is either an externally accessible Azure storage blob container Uri (preferably a Shared Access Signature Uri) or valid path to a data folder in a locally mounted drive. When local paths are specified, they must follow the Linux/Unix path format and be an absolute path rooted to the input mount configuration setting value e.g., if '{Mounts:Input}' configuration setting value is '/input' then a valid source path would be '/input/contosodataset'. All data to be trained is expected to be under the source folder or sub folders under it. Models are trained using documents that are of the following content type - 'application/pdf', 'image/jpeg', 'image/png', 'image/tiff'. Other type of content is ignored. - - Train Custom Model. + """Train Custom Model. + + Create and train a custom model. The request must include a source parameter that is either an + externally accessible Azure storage blob container Uri (preferably a Shared Access Signature + Uri) or valid path to a data folder in a locally mounted drive. When local paths are specified, + they must follow the Linux/Unix path format and be an absolute path rooted to the input mount + configuration setting value e.g., if '{Mounts:Input}' configuration setting value is '/input' + then a valid source path would be '/input/contosodataset'. All data to be trained is expected + to be under the source folder or sub folders under it. Models are trained using documents that + are of the following content type - 'application/pdf', 'image/jpeg', 'image/png', 'image/tiff'. + Other type of content is ignored. :param train_request: Training request parameters. :type train_request: ~azure.ai.formrecognizer.models.TrainRequest :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) + :return: None, or the result of cls(response) :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ @@ -80,7 +88,7 @@ def train_custom_model_async( response_headers['Location']=self._deserialize('str', response.headers.get('Location')) if cls: - return cls(pipeline_response, None, response_headers) + return cls(pipeline_response, None, response_headers) train_custom_model_async.metadata = {'url': '/custom/models'} # type: ignore @@ -92,16 +100,16 @@ def get_custom_model( **kwargs # type: Any ): # type: (...) -> "models.Model" - """Get detailed information about a custom model. + """Get Custom Model. - Get Custom Model. + Get detailed information about a custom model. :param model_id: Model identifier. :type model_id: str :param include_keys: Include list of extracted keys in model information. :type include_keys: bool :keyword callable cls: A custom type or function that will be passed the direct response - :return: Model or the result of cls(response) + :return: Model, or the result of cls(response) :rtype: ~azure.ai.formrecognizer.models.Model :raises: ~azure.core.exceptions.HttpResponseError """ @@ -139,7 +147,7 @@ def get_custom_model( deserialized = self._deserialize('Model', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized get_custom_model.metadata = {'url': '/custom/models/{modelId}'} # type: ignore @@ -151,14 +159,15 @@ def delete_custom_model( **kwargs # type: Any ): # type: (...) -> None - """Mark model for deletion. Model artifacts will be permanently removed within a predetermined period. + """Delete Custom Model. - Delete Custom Model. + Mark model for deletion. Model artifacts will be permanently removed within a predetermined + period. :param model_id: Model identifier. :type model_id: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) + :return: None, or the result of cls(response) :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ @@ -191,7 +200,7 @@ def delete_custom_model( raise HttpResponseError(response=response, model=error) if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) delete_custom_model.metadata = {'url': '/custom/models/{modelId}'} # type: ignore @@ -199,7 +208,7 @@ def _analyze_with_custom_model_initial( self, model_id, # type: str include_text_details=False, # type: Optional[bool] - file_stream=None, # type: Optional[Union[str, "models.SourcePath"]] + file_stream=None, # type: Optional[Union[IO, "models.SourcePath"]] **kwargs # type: Any ): # type: (...) -> None @@ -227,9 +236,9 @@ def _analyze_with_custom_model_initial( # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] - if header_parameters['Content-Type'] in ['application/pdf', 'image/jpeg', 'image/png', 'image/tiff']: + if header_parameters['Content-Type'].split(";")[0] in ['application/pdf', 'image/jpeg', 'image/png', 'image/tiff']: body_content_kwargs['stream_content'] = file_stream - elif header_parameters['Content-Type'] in ['application/json']: + elif header_parameters['Content-Type'].split(";")[0] in ['application/json']: if file_stream is not None: body_content = self._serialize.body(file_stream, 'SourcePath') else: @@ -237,7 +246,8 @@ def _analyze_with_custom_model_initial( body_content_kwargs['content'] = body_content else: raise ValueError( - "Content type {} is not valid for this operation".format(header_parameters['Content-Type']) + "The content_type '{}' is not one of the allowed values: " + "['application/pdf', 'image/jpeg', 'image/png', 'image/tiff', 'application/json']".format(header_parameters['Content-Type']) ) request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) @@ -253,7 +263,7 @@ def _analyze_with_custom_model_initial( response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) if cls: - return cls(pipeline_response, None, response_headers) + return cls(pipeline_response, None, response_headers) _analyze_with_custom_model_initial.metadata = {'url': '/custom/models/{modelId}/analyze'} # type: ignore @@ -262,13 +272,16 @@ def begin_analyze_with_custom_model( self, model_id, # type: str include_text_details=False, # type: Optional[bool] - file_stream=None, # type: Optional[Union[str, "models.SourcePath"]] + file_stream=None, # type: Optional[Union[IO, "models.SourcePath"]] **kwargs # type: Any ): # type: (...) -> LROPoller - """Extract key-value pairs, tables, and semantic values from a given document. The input document must be of one of the supported content types - 'application/pdf', 'image/jpeg', 'image/png' or 'image/tiff'. Alternatively, use 'application/json' type to specify the location (Uri or local path) of the document to be analyzed. + """Analyze Form. - Analyze Form. + Extract key-value pairs, tables, and semantic values from a given document. The input document + must be of one of the supported content types - 'application/pdf', 'image/jpeg', 'image/png' or + 'image/tiff'. Alternatively, use 'application/json' type to specify the location (Uri or local + path) of the document to be analyzed. :param model_id: Model identifier. :type model_id: str @@ -277,11 +290,12 @@ def begin_analyze_with_custom_model( :param file_stream: .json, .pdf, .jpg, .png or .tiff type file stream. :type file_stream: ~azure.ai.formrecognizer.models.SourcePath :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns None + :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -291,13 +305,18 @@ def begin_analyze_with_custom_model( 'polling_interval', self._config.polling_interval ) - raw_result = self._analyze_with_custom_model_initial( - model_id=model_id, - include_text_details=include_text_details, - file_stream=file_stream, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._analyze_with_custom_model_initial( + model_id=model_id, + include_text_details=include_text_details, + file_stream=file_stream, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: @@ -306,7 +325,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = LROBasePolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_analyze_with_custom_model.metadata = {'url': '/custom/models/{modelId}/analyze'} # type: ignore @distributed_trace @@ -317,16 +344,16 @@ def get_analyze_form_result( **kwargs # type: Any ): # type: (...) -> "models.AnalyzeOperationResult" - """Obtain current status and the result of the analyze form operation. + """Get Analyze Form Result. - Get Analyze Form Result. + Obtain current status and the result of the analyze form operation. :param model_id: Model identifier. :type model_id: str :param result_id: Analyze operation result identifier. :type result_id: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: AnalyzeOperationResult or the result of cls(response) + :return: AnalyzeOperationResult, or the result of cls(response) :rtype: ~azure.ai.formrecognizer.models.AnalyzeOperationResult :raises: ~azure.core.exceptions.HttpResponseError """ @@ -363,7 +390,7 @@ def get_analyze_form_result( deserialized = self._deserialize('AnalyzeOperationResult', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized get_analyze_form_result.metadata = {'url': '/custom/models/{modelId}/analyzeResults/{resultId}'} # type: ignore @@ -413,7 +440,7 @@ def _copy_custom_model_initial( response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) if cls: - return cls(pipeline_response, None, response_headers) + return cls(pipeline_response, None, response_headers) _copy_custom_model_initial.metadata = {'url': '/custom/models/{modelId}/copy'} # type: ignore @@ -425,20 +452,22 @@ def begin_copy_custom_model( **kwargs # type: Any ): # type: (...) -> LROPoller - """Copy custom model stored in this resource (the source) to user specified target Form Recognizer resource. + """Copy Custom Model. - Copy Custom Model. + Copy custom model stored in this resource (the source) to user specified target Form Recognizer + resource. :param model_id: Model identifier. :type model_id: str :param copy_request: Copy request parameters. :type copy_request: ~azure.ai.formrecognizer.models.CopyRequest :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns None + :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -448,12 +477,17 @@ def begin_copy_custom_model( 'polling_interval', self._config.polling_interval ) - raw_result = self._copy_custom_model_initial( - model_id=model_id, - copy_request=copy_request, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._copy_custom_model_initial( + model_id=model_id, + copy_request=copy_request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: @@ -462,7 +496,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = LROBasePolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_copy_custom_model.metadata = {'url': '/custom/models/{modelId}/copy'} # type: ignore @distributed_trace @@ -473,16 +515,16 @@ def get_custom_model_copy_result( **kwargs # type: Any ): # type: (...) -> "models.CopyOperationResult" - """Obtain current status and the result of a custom model copy operation. + """Get Custom Model Copy Result. - Get Custom Model Copy Result. + Obtain current status and the result of a custom model copy operation. :param model_id: Model identifier. :type model_id: str :param result_id: Copy operation result identifier. :type result_id: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: CopyOperationResult or the result of cls(response) + :return: CopyOperationResult, or the result of cls(response) :rtype: ~azure.ai.formrecognizer.models.CopyOperationResult :raises: ~azure.core.exceptions.HttpResponseError """ @@ -519,7 +561,7 @@ def get_custom_model_copy_result( deserialized = self._deserialize('CopyOperationResult', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized get_custom_model_copy_result.metadata = {'url': '/custom/models/{modelId}/copyResults/{resultId}'} # type: ignore @@ -530,12 +572,12 @@ def generate_model_copy_authorization( **kwargs # type: Any ): # type: (...) -> "models.CopyAuthorizationResult" - """Generate authorization to copy a model into the target Form Recognizer resource. + """Generate Copy Authorization. - Generate Copy Authorization. + Generate authorization to copy a model into the target Form Recognizer resource. :keyword callable cls: A custom type or function that will be passed the direct response - :return: CopyAuthorizationResult or the result of cls(response) + :return: CopyAuthorizationResult, or the result of cls(response) :rtype: ~azure.ai.formrecognizer.models.CopyAuthorizationResult :raises: ~azure.core.exceptions.HttpResponseError """ @@ -572,7 +614,7 @@ def generate_model_copy_authorization( deserialized = self._deserialize('CopyAuthorizationResult', pipeline_response) if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) return deserialized generate_model_copy_authorization.metadata = {'url': '/custom/models/copyAuthorization'} # type: ignore @@ -580,7 +622,7 @@ def generate_model_copy_authorization( def _analyze_receipt_async_initial( self, include_text_details=False, # type: Optional[bool] - file_stream=None, # type: Optional[Union[str, "models.SourcePath"]] + file_stream=None, # type: Optional[Union[IO, "models.SourcePath"]] **kwargs # type: Any ): # type: (...) -> None @@ -607,9 +649,9 @@ def _analyze_receipt_async_initial( # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] - if header_parameters['Content-Type'] in ['application/pdf', 'image/jpeg', 'image/png', 'image/tiff']: + if header_parameters['Content-Type'].split(";")[0] in ['application/pdf', 'image/jpeg', 'image/png', 'image/tiff']: body_content_kwargs['stream_content'] = file_stream - elif header_parameters['Content-Type'] in ['application/json']: + elif header_parameters['Content-Type'].split(";")[0] in ['application/json']: if file_stream is not None: body_content = self._serialize.body(file_stream, 'SourcePath') else: @@ -617,7 +659,8 @@ def _analyze_receipt_async_initial( body_content_kwargs['content'] = body_content else: raise ValueError( - "Content type {} is not valid for this operation".format(header_parameters['Content-Type']) + "The content_type '{}' is not one of the allowed values: " + "['application/pdf', 'image/jpeg', 'image/png', 'image/tiff', 'application/json']".format(header_parameters['Content-Type']) ) request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) @@ -633,7 +676,7 @@ def _analyze_receipt_async_initial( response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) if cls: - return cls(pipeline_response, None, response_headers) + return cls(pipeline_response, None, response_headers) _analyze_receipt_async_initial.metadata = {'url': '/prebuilt/receipt/analyze'} # type: ignore @@ -641,24 +684,28 @@ def _analyze_receipt_async_initial( def begin_analyze_receipt_async( self, include_text_details=False, # type: Optional[bool] - file_stream=None, # type: Optional[Union[str, "models.SourcePath"]] + file_stream=None, # type: Optional[Union[IO, "models.SourcePath"]] **kwargs # type: Any ): # type: (...) -> LROPoller - """Extract field text and semantic values from a given receipt document. The input document must be of one of the supported content types - 'application/pdf', 'image/jpeg', 'image/png' or 'image/tiff'. Alternatively, use 'application/json' type to specify the location (Uri or local path) of the document to be analyzed. + """Analyze Receipt. - Analyze Receipt. + Extract field text and semantic values from a given receipt document. The input document must + be of one of the supported content types - 'application/pdf', 'image/jpeg', 'image/png' or + 'image/tiff'. Alternatively, use 'application/json' type to specify the location (Uri or local + path) of the document to be analyzed. :param include_text_details: Include text lines and element references in the result. :type include_text_details: bool :param file_stream: .json, .pdf, .jpg, .png or .tiff type file stream. :type file_stream: ~azure.ai.formrecognizer.models.SourcePath :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns None + :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -668,12 +715,17 @@ def begin_analyze_receipt_async( 'polling_interval', self._config.polling_interval ) - raw_result = self._analyze_receipt_async_initial( - include_text_details=include_text_details, - file_stream=file_stream, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._analyze_receipt_async_initial( + include_text_details=include_text_details, + file_stream=file_stream, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: @@ -682,7 +734,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = LROBasePolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_analyze_receipt_async.metadata = {'url': '/prebuilt/receipt/analyze'} # type: ignore @distributed_trace @@ -692,14 +752,14 @@ def get_analyze_receipt_result( **kwargs # type: Any ): # type: (...) -> "models.AnalyzeOperationResult" - """Track the progress and obtain the result of the analyze receipt operation. + """Get Analyze Receipt Result. - Get Analyze Receipt Result. + Track the progress and obtain the result of the analyze receipt operation. :param result_id: Analyze operation result identifier. :type result_id: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: AnalyzeOperationResult or the result of cls(response) + :return: AnalyzeOperationResult, or the result of cls(response) :rtype: ~azure.ai.formrecognizer.models.AnalyzeOperationResult :raises: ~azure.core.exceptions.HttpResponseError """ @@ -735,14 +795,14 @@ def get_analyze_receipt_result( deserialized = self._deserialize('AnalyzeOperationResult', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized get_analyze_receipt_result.metadata = {'url': '/prebuilt/receipt/analyzeResults/{resultId}'} # type: ignore def _analyze_layout_async_initial( self, - file_stream=None, # type: Optional[Union[str, "models.SourcePath"]] + file_stream=None, # type: Optional[Union[IO, "models.SourcePath"]] **kwargs # type: Any ): # type: (...) -> None @@ -767,9 +827,9 @@ def _analyze_layout_async_initial( # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] - if header_parameters['Content-Type'] in ['application/pdf', 'image/jpeg', 'image/png', 'image/tiff']: + if header_parameters['Content-Type'].split(";")[0] in ['application/pdf', 'image/jpeg', 'image/png', 'image/tiff']: body_content_kwargs['stream_content'] = file_stream - elif header_parameters['Content-Type'] in ['application/json']: + elif header_parameters['Content-Type'].split(";")[0] in ['application/json']: if file_stream is not None: body_content = self._serialize.body(file_stream, 'SourcePath') else: @@ -777,7 +837,8 @@ def _analyze_layout_async_initial( body_content_kwargs['content'] = body_content else: raise ValueError( - "Content type {} is not valid for this operation".format(header_parameters['Content-Type']) + "The content_type '{}' is not one of the allowed values: " + "['application/pdf', 'image/jpeg', 'image/png', 'image/tiff', 'application/json']".format(header_parameters['Content-Type']) ) request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) @@ -793,29 +854,33 @@ def _analyze_layout_async_initial( response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) if cls: - return cls(pipeline_response, None, response_headers) + return cls(pipeline_response, None, response_headers) _analyze_layout_async_initial.metadata = {'url': '/layout/analyze'} # type: ignore @distributed_trace def begin_analyze_layout_async( self, - file_stream=None, # type: Optional[Union[str, "models.SourcePath"]] + file_stream=None, # type: Optional[Union[IO, "models.SourcePath"]] **kwargs # type: Any ): # type: (...) -> LROPoller - """Extract text and layout information from a given document. The input document must be of one of the supported content types - 'application/pdf', 'image/jpeg', 'image/png' or 'image/tiff'. Alternatively, use 'application/json' type to specify the location (Uri or local path) of the document to be analyzed. + """Analyze Layout. - Analyze Layout. + Extract text and layout information from a given document. The input document must be of one of + the supported content types - 'application/pdf', 'image/jpeg', 'image/png' or 'image/tiff'. + Alternatively, use 'application/json' type to specify the location (Uri or local path) of the + document to be analyzed. :param file_stream: .json, .pdf, .jpg, .png or .tiff type file stream. :type file_stream: ~azure.ai.formrecognizer.models.SourcePath :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns None + :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -825,11 +890,16 @@ def begin_analyze_layout_async( 'polling_interval', self._config.polling_interval ) - raw_result = self._analyze_layout_async_initial( - file_stream=file_stream, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._analyze_layout_async_initial( + file_stream=file_stream, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: @@ -838,7 +908,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = LROBasePolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_analyze_layout_async.metadata = {'url': '/layout/analyze'} # type: ignore @distributed_trace @@ -848,14 +926,14 @@ def get_analyze_layout_result( **kwargs # type: Any ): # type: (...) -> "models.AnalyzeOperationResult" - """Track the progress and obtain the result of the analyze layout operation. + """Get Analyze Layout Result. - Get Analyze Layout Result. + Track the progress and obtain the result of the analyze layout operation. :param result_id: Analyze operation result identifier. :type result_id: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: AnalyzeOperationResult or the result of cls(response) + :return: AnalyzeOperationResult, or the result of cls(response) :rtype: ~azure.ai.formrecognizer.models.AnalyzeOperationResult :raises: ~azure.core.exceptions.HttpResponseError """ @@ -891,7 +969,7 @@ def get_analyze_layout_result( deserialized = self._deserialize('AnalyzeOperationResult', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized get_analyze_layout_result.metadata = {'url': '/layout/analyzeResults/{resultId}'} # type: ignore @@ -902,12 +980,12 @@ def list_custom_models( **kwargs # type: Any ): # type: (...) -> Iterable["models.Models"] - """Get information about all custom models. + """List Custom Models. - List Custom Models. + Get information about all custom models. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of Models or the result of cls(response) + :return: An iterator like instance of either Models or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.ai.formrecognizer.models.Models] :raises: ~azure.core.exceptions.HttpResponseError """ @@ -974,12 +1052,12 @@ def get_custom_models( **kwargs # type: Any ): # type: (...) -> "models.Models" - """Get information about all custom models. + """Get Custom Models. - Get Custom Models. + Get information about all custom models. :keyword callable cls: A custom type or function that will be passed the direct response - :return: Models or the result of cls(response) + :return: Models, or the result of cls(response) :rtype: ~azure.ai.formrecognizer.models.Models :raises: ~azure.core.exceptions.HttpResponseError """ @@ -1016,7 +1094,7 @@ def get_custom_models( deserialized = self._deserialize('Models', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized get_custom_models.metadata = {'url': '/custom/models'} # type: ignore diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py index cf61dd1038f4..b15c7d89866b 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py @@ -195,82 +195,13 @@ class RecognizedReceipt(RecognizedForm): :ivar list[~azure.ai.formrecognizer.FormPage] pages: A list of pages recognized from the input document. Contains lines, words, tables and page metadata. - :ivar ~azure.ai.formrecognizer.ReceiptType receipt_type: - The reciept type and confidence. - :ivar str receipt_locale: Defaults to "en-US". """ - def __init__(self, **kwargs): - super(RecognizedReceipt, self).__init__(**kwargs) - self.receipt_type = kwargs.get("receipt_type", None) - self.receipt_locale = kwargs.get("receipt_locale", "en-US") def __repr__(self): - return "RecognizedReceipt(form_type={}, fields={}, page_range={}, pages={}, " \ - "receipt_type={}, receipt_locale={})".format( - self.form_type, repr(self.fields), repr(self.page_range), repr(self.pages), - repr(self.receipt_type), self.receipt_locale + return "RecognizedReceipt(form_type={}, fields={}, page_range={}, pages={})".format( + self.form_type, repr(self.fields), repr(self.page_range), repr(self.pages) )[:1024] -class USReceipt(RecognizedReceipt): # pylint: disable=too-many-instance-attributes - """Extracted fields found on the US sales receipt. Provides - attributes for accessing common fields present in US sales receipts. - - :ivar ~azure.ai.formrecognizer.FormField merchant_address: - The address of the merchant. - :ivar ~azure.ai.formrecognizer.FormField merchant_name: - The name of the merchant. - :ivar ~azure.ai.formrecognizer.FormField merchant_phone_number: - The phone number associated with the merchant. - :ivar list[~azure.ai.formrecognizer.USReceiptItem] receipt_items: - The purchased items found on the receipt. - :ivar ~azure.ai.formrecognizer.FormField subtotal: - The subtotal found on the receipt - :ivar ~azure.ai.formrecognizer.FormField tax: - The tax value found on the receipt. - :ivar ~azure.ai.formrecognizer.FormField tip: - The tip value found on the receipt. - :ivar ~azure.ai.formrecognizer.FormField total: - The total amount found on the receipt. - :ivar ~azure.ai.formrecognizer.FormField transaction_date: - The transaction date of the sale. - :ivar ~azure.ai.formrecognizer.FormField transaction_time: - The transaction time of the sale. - :ivar fields: - A dictionary of the fields found on the receipt. - :vartype fields: dict[str, ~azure.ai.formrecognizer.FormField] - :ivar ~azure.ai.formrecognizer.FormPageRange page_range: - The first and last page number of the input receipt. - :ivar list[~azure.ai.formrecognizer.FormPage] pages: - Contains page metadata such as page width, length, text angle, unit. - If `include_text_content=True` is passed, contains a list - of extracted text lines for each page in the input document. - :ivar str form_type: The type of form. - """ - - def __init__(self, **kwargs): - super(USReceipt, self).__init__(**kwargs) - self.merchant_address = kwargs.get("merchant_address", None) - self.merchant_name = kwargs.get("merchant_name", None) - self.merchant_phone_number = kwargs.get("merchant_phone_number", None) - self.receipt_items = kwargs.get("receipt_items", None) - self.subtotal = kwargs.get("subtotal", None) - self.tax = kwargs.get("tax", None) - self.tip = kwargs.get("tip", None) - self.total = kwargs.get("total", None) - self.transaction_date = kwargs.get("transaction_date", None) - self.transaction_time = kwargs.get("transaction_time", None) - - def __repr__(self): - return "USReceipt(merchant_address={}, merchant_name={}, merchant_phone_number={}, " \ - "receipt_type={}, receipt_items={}, subtotal={}, tax={}, tip={}, total={}, "\ - "transaction_date={}, transaction_time={}, fields={}, page_range={}, pages={}, " \ - "form_type={}, receipt_locale={})".format( - repr(self.merchant_address), repr(self.merchant_name), repr(self.merchant_phone_number), - repr(self.receipt_type), repr(self.receipt_items), repr(self.subtotal), repr(self.tax), - repr(self.tip), repr(self.total), repr(self.transaction_date), repr(self.transaction_time), - repr(self.fields), repr(self.page_range), repr(self.pages), self.form_type, self.receipt_locale - )[:1024] - class FormField(object): """Represents a field recognized in an input form. @@ -513,69 +444,6 @@ def __repr__(self): )[:1024] -class ReceiptType(object): - """The type of the analyzed US receipt and the confidence - value of that type. - - :ivar str type: The type of the receipt. For example, "Itemized", - "CreditCard", "Gas", "Parking", "Gas", "Other". - :ivar float confidence: - Measures the degree of certainty of the recognition result. Value is between [0.0, 1.0]. - """ - - def __init__(self, **kwargs): - self.type = kwargs.get("type", None) - self.confidence = kwargs.get("confidence", None) - - @classmethod - def _from_generated(cls, item): - return cls( - type=item.value_string, - confidence=adjust_confidence(item.confidence)) if item else None - - def __repr__(self): - return "ReceiptType(type={}, confidence={})".format(self.type, self.confidence)[:1024] - - -class USReceiptItem(object): - """A receipt item on a US sales receipt. - Contains the item name, quantity, price, and total price. - - :ivar ~azure.ai.formrecognizer.FormField name: - The name of the item. - :ivar ~azure.ai.formrecognizer.FormField quantity: - The quantity associated with this item. - :ivar ~azure.ai.formrecognizer.FormField price: - The price of a single unit of this item. - :ivar ~azure.ai.formrecognizer.FormField total_price: - The total price of this item, taking the quantity into account. - """ - - def __init__(self, **kwargs): - self.name = kwargs.get("name", None) - self.quantity = kwargs.get("quantity", None) - self.price = kwargs.get("price", None) - self.total_price = kwargs.get("total_price", None) - - @classmethod - def _from_generated(cls, items, read_result): - try: - receipt_item = items.value_array - return [cls( - name=FormField._from_generated("Name", item.value_object.get("Name"), read_result), - quantity=FormField._from_generated("Quantity", item.value_object.get("Quantity"), read_result), - price=FormField._from_generated("Price", item.value_object.get("Price"), read_result), - total_price=FormField._from_generated("TotalPrice", item.value_object.get("TotalPrice"), read_result), - ) for item in receipt_item] - except AttributeError: - return [] - - def __repr__(self): - return "USReceiptItem(name={}, quantity={}, price={}, total_price={})".format( - repr(self.name), repr(self.quantity), repr(self.price), repr(self.total_price) - )[:1024] - - class FormTable(object): """Information about the extracted table contained on a page. diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_response_handlers.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_response_handlers.py index 08d8fa9d9461..90fe97582902 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_response_handlers.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_response_handlers.py @@ -7,20 +7,18 @@ # pylint: disable=protected-access from ._models import ( - USReceipt, - ReceiptType, FormField, - USReceiptItem, FormPage, FormLine, FormTable, FormTableCell, FormPageRange, - RecognizedForm + RecognizedForm, + RecognizedReceipt ) -def prepare_us_receipt(response): +def prepare_receipt(response): receipts = [] read_result = response.analyze_result.read_results document_result = response.analyze_result.document_results @@ -28,43 +26,14 @@ def prepare_us_receipt(response): for page in document_result: if page.fields is None: - receipt = USReceipt( + receipt = RecognizedReceipt( page_range=FormPageRange(first_page_number=page.page_range[0], last_page_number=page.page_range[1]), pages=form_page[page.page_range[0]-1:page.page_range[1]], form_type=page.doc_type, ) receipts.append(receipt) continue - receipt = USReceipt( - merchant_address=FormField._from_generated( - "MerchantAddress", page.fields.get("MerchantAddress"), read_result - ), - merchant_name=FormField._from_generated( - "MerchantName", page.fields.get("MerchantName"), read_result - ), - merchant_phone_number=FormField._from_generated( - "MerchantPhoneNumber", - page.fields.get("MerchantPhoneNumber"), - read_result, - ), - receipt_type=ReceiptType._from_generated(page.fields.get("ReceiptType")), - receipt_items=USReceiptItem._from_generated( - page.fields.get("Items"), read_result - ), - subtotal=FormField._from_generated( - "Subtotal", page.fields.get("Subtotal"), read_result - ), - tax=FormField._from_generated("Tax", page.fields.get("Tax"), read_result), - tip=FormField._from_generated("Tip", page.fields.get("Tip"), read_result), - total=FormField._from_generated( - "Total", page.fields.get("Total"), read_result - ), - transaction_date=FormField._from_generated( - "TransactionDate", page.fields.get("TransactionDate"), read_result - ), - transaction_time=FormField._from_generated( - "TransactionTime", page.fields.get("TransactionTime"), read_result - ), + receipt = RecognizedReceipt( page_range=FormPageRange( first_page_number=page.page_range[0], last_page_number=page.page_range[1] ), @@ -73,7 +42,7 @@ def prepare_us_receipt(response): fields={ key: FormField._from_generated(key, value, read_result) for key, value in page.fields.items() - }, + } ) receipts.append(receipt) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/aio/_form_recognizer_client_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/aio/_form_recognizer_client_async.py index 8e0a4dd81d56..3e26bd518e27 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/aio/_form_recognizer_client_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/aio/_form_recognizer_client_async.py @@ -8,16 +8,17 @@ from typing import ( Any, - List, IO, Union, + List, TYPE_CHECKING, ) from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.polling import AsyncLROPoller from azure.core.polling.async_base_polling import AsyncLROBasePolling from .._generated.aio._form_recognizer_client_async import FormRecognizerClient as FormRecognizer from .._response_handlers import ( - prepare_us_receipt, + prepare_receipt, prepare_content_result, prepare_form_result ) @@ -25,14 +26,10 @@ from .._helpers import get_content_type, get_authentication_policy, error_map, POLLING_INTERVAL from .._user_agent import USER_AGENT from .._polling import AnalyzePolling +from .._models import RecognizedReceipt, FormPage, RecognizedForm if TYPE_CHECKING: from azure.core.credentials import AzureKeyCredential from azure.core.credentials_async import AsyncTokenCredential - from .._models import ( - RecognizedReceipt, - FormPage, - RecognizedForm - ) class FormRecognizerClient(object): @@ -76,7 +73,7 @@ def __init__( authentication_policy = get_authentication_policy(credential) self._client = FormRecognizer( endpoint=endpoint, - credential=credential, + credential=credential, # type: ignore sdk_moniker=USER_AGENT, authentication_policy=authentication_policy, **kwargs @@ -84,14 +81,14 @@ def __init__( def _receipt_callback(self, raw_response, _, headers): # pylint: disable=unused-argument analyze_result = self._client._deserialize(AnalyzeOperationResult, raw_response) - return prepare_us_receipt(analyze_result) + return prepare_receipt(analyze_result) @distributed_trace_async - async def recognize_receipts( + async def begin_recognize_receipts( self, receipt: Union[bytes, IO[bytes]], **kwargs: Any - ) -> List["RecognizedReceipt"]: + ) -> AsyncLROPoller[List[RecognizedReceipt]]: """Extract field text and semantic values from a given US sales receipt. The input document must be of one of the supported content types - 'application/pdf', 'image/jpeg', 'image/png' or 'image/tiff'. @@ -106,8 +103,10 @@ async def recognize_receipts( see :class:`~azure.ai.formrecognizer.FormContentType`. :keyword int polling_interval: Waiting time between two polls for LRO operations if no Retry-After header is present. Defaults to 5 seconds. - :return: A list of RecognizedReceipt. - :rtype: list[~azure.ai.formrecognizer.RecognizedReceipt] + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :return: An instance of an AsyncLROPoller. Call `result()` on the poller + object to return a list[:class:`~azure.ai.formrecognizer.RecognizedReceipt`]. + :rtype: ~azure.core.polling.AsyncLROPoller[list[~azure.ai.formrecognizer.RecognizedReceipt]] :raises ~azure.core.exceptions.HttpResponseError: .. admonition:: Example: @@ -121,6 +120,7 @@ async def recognize_receipts( """ polling_interval = kwargs.pop("polling_interval", POLLING_INTERVAL) + continuation_token = kwargs.pop("continuation_token", None) content_type = kwargs.pop("content_type", None) if content_type == "application/json": raise TypeError("Call begin_recognize_receipts_from_url() to analyze a receipt from a url.") @@ -130,22 +130,26 @@ async def recognize_receipts( if content_type is None: content_type = get_content_type(receipt) - return await self._client.analyze_receipt_async( # type: ignore + return await self._client.begin_analyze_receipt_async( # type: ignore file_stream=receipt, content_type=content_type, include_text_details=include_text_content, cls=kwargs.pop("cls", self._receipt_callback), - polling=AsyncLROBasePolling(timeout=polling_interval, **kwargs), + polling=AsyncLROBasePolling( + timeout=polling_interval, + **kwargs + ), error_map=error_map, + continuation_token=continuation_token, **kwargs ) @distributed_trace_async - async def recognize_receipts_from_url( + async def begin_recognize_receipts_from_url( self, receipt_url: str, **kwargs: Any - ) -> List["RecognizedReceipt"]: + ) -> AsyncLROPoller[List[RecognizedReceipt]]: """Extract field text and semantic values from a given US sales receipt. The input document must be the location (Url) of the receipt to be analyzed. @@ -156,8 +160,10 @@ async def recognize_receipts_from_url( Whether or not to include text elements such as lines and words in addition to form fields. :keyword int polling_interval: Waiting time between two polls for LRO operations if no Retry-After header is present. Defaults to 5 seconds. - :return: A list of RecognizedReceipt. - :rtype: list[~azure.ai.formrecognizer.RecognizedReceipt] + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :return: An instance of an AsyncLROPoller. Call `result()` on the poller + object to return a list[:class:`~azure.ai.formrecognizer.RecognizedReceipt`]. + :rtype: ~azure.core.polling.AsyncLROPoller[list[~azure.ai.formrecognizer.RecognizedReceipt]] :raises ~azure.core.exceptions.HttpResponseError: .. admonition:: Example: @@ -171,14 +177,19 @@ async def recognize_receipts_from_url( """ polling_interval = kwargs.pop("polling_interval", POLLING_INTERVAL) + continuation_token = kwargs.pop("continuation_token", None) include_text_content = kwargs.pop("include_text_content", False) - return await self._client.analyze_receipt_async( # type: ignore + return await self._client.begin_analyze_receipt_async( # type: ignore file_stream={"source": receipt_url}, include_text_details=include_text_content, cls=kwargs.pop("cls", self._receipt_callback), - polling=AsyncLROBasePolling(timeout=polling_interval, **kwargs), + polling=AsyncLROBasePolling( + timeout=polling_interval, + **kwargs + ), error_map=error_map, + continuation_token=continuation_token, **kwargs ) @@ -187,7 +198,11 @@ def _content_callback(self, raw_response, _, headers): # pylint: disable=unused return prepare_content_result(analyze_result) @distributed_trace_async - async def recognize_content(self, form: Union[bytes, IO[bytes]], **kwargs: Any) -> List["FormPage"]: + async def begin_recognize_content( + self, + form: Union[bytes, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[List[FormPage]]: """Extract text and content/layout information from a given document. The input document must be of one of the supported content types - 'application/pdf', 'image/jpeg', 'image/png' or 'image/tiff'. @@ -199,8 +214,10 @@ async def recognize_content(self, form: Union[bytes, IO[bytes]], **kwargs: Any) see :class:`~azure.ai.formrecognizer.FormContentType`. :keyword int polling_interval: Waiting time between two polls for LRO operations if no Retry-After header is present. Defaults to 5 seconds. - :return: A list of FormPage. - :rtype: list[~azure.ai.formrecognizer.FormPage] + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :return: An instance of an AsyncLROPoller. Call `result()` on the poller + object to return a list[:class:`~azure.ai.formrecognizer.FormPage`]. + :rtype: ~azure.core.polling.AsyncLROPoller[list[~azure.ai.formrecognizer.FormPage]] :raises ~azure.core.exceptions.HttpResponseError: .. admonition:: Example: @@ -214,6 +231,7 @@ async def recognize_content(self, form: Union[bytes, IO[bytes]], **kwargs: Any) """ polling_interval = kwargs.pop("polling_interval", POLLING_INTERVAL) + continuation_token = kwargs.pop("continuation_token", None) content_type = kwargs.pop("content_type", None) if content_type == "application/json": raise TypeError("Call begin_recognize_content_from_url() to analyze a document from a url.") @@ -221,17 +239,21 @@ async def recognize_content(self, form: Union[bytes, IO[bytes]], **kwargs: Any) if content_type is None: content_type = get_content_type(form) - return await self._client.analyze_layout_async( # type: ignore + return await self._client.begin_analyze_layout_async( # type: ignore file_stream=form, content_type=content_type, cls=kwargs.pop("cls", self._content_callback), - polling=AsyncLROBasePolling(timeout=polling_interval, **kwargs), + polling=AsyncLROBasePolling( + timeout=polling_interval, + **kwargs + ), error_map=error_map, + continuation_token=continuation_token, **kwargs ) @distributed_trace_async - async def recognize_content_from_url(self, form_url: str, **kwargs: Any) -> List["FormPage"]: + async def begin_recognize_content_from_url(self, form_url: str, **kwargs: Any) -> AsyncLROPoller[List[FormPage]]: """Extract text and layout information from a given document. The input document must be the location (Url) of the document to be analyzed. @@ -239,27 +261,34 @@ async def recognize_content_from_url(self, form_url: str, **kwargs: Any) -> List of one of the supported formats: JPEG, PNG, PDF and TIFF. :keyword int polling_interval: Waiting time between two polls for LRO operations if no Retry-After header is present. Defaults to 5 seconds. - :return: A list of FormPage. - :rtype: list[~azure.ai.formrecognizer.FormPage] + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :return: An instance of an AsyncLROPoller. Call `result()` on the poller + object to return a list[:class:`~azure.ai.formrecognizer.FormPage`]. + :rtype: ~azure.core.polling.AsyncLROPoller[list[~azure.ai.formrecognizer.FormPage]] :raises ~azure.core.exceptions.HttpResponseError: """ polling_interval = kwargs.pop("polling_interval", POLLING_INTERVAL) - return await self._client.analyze_layout_async( # type: ignore + continuation_token = kwargs.pop("continuation_token", None) + return await self._client.begin_analyze_layout_async( # type: ignore file_stream={"source": form_url}, cls=kwargs.pop("cls", self._content_callback), - polling=AsyncLROBasePolling(timeout=polling_interval, **kwargs), + polling=AsyncLROBasePolling( + timeout=polling_interval, + **kwargs + ), error_map=error_map, + continuation_token=continuation_token, **kwargs ) @distributed_trace_async - async def recognize_custom_forms( + async def begin_recognize_custom_forms( self, model_id: str, form: Union[bytes, IO[bytes]], **kwargs: Any - ) -> List["RecognizedForm"]: + ) -> AsyncLROPoller[List[RecognizedForm]]: """Analyze a custom form with a model trained with or without labels. The form to analyze should be of the same type as the forms that were used to train the model. The input document must be of one of the supported content types - 'application/pdf', @@ -275,8 +304,10 @@ async def recognize_custom_forms( see :class:`~azure.ai.formrecognizer.FormContentType`. :keyword int polling_interval: Waiting time between two polls for LRO operations if no Retry-After header is present. Defaults to 5 seconds. - :return: A list of RecognizedForm. - :rtype: list[~azure.ai.formrecognizer.RecognizedForm] + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :return: An instance of an AsyncLROPoller. Call `result()` on the poller + object to return a list[:class:`~azure.ai.formrecognizer.RecognizedForm`]. + :rtype: ~azure.core.polling.AsyncLROPoller[list[~azure.ai.formrecognizer.RecognizedForm] :raises ~azure.core.exceptions.HttpResponseError: .. admonition:: Example: @@ -294,6 +325,7 @@ async def recognize_custom_forms( cls = kwargs.pop("cls", None) polling_interval = kwargs.pop("polling_interval", POLLING_INTERVAL) + continuation_token = kwargs.pop("continuation_token", None) content_type = kwargs.pop("content_type", None) if content_type == "application/json": raise TypeError("Call begin_recognize_custom_forms_from_url() to analyze a document from a url.") @@ -308,24 +340,29 @@ def analyze_callback(raw_response, _, headers): # pylint: disable=unused-argume return prepare_form_result(analyze_result, model_id) deserialization_callback = cls if cls else analyze_callback - return await self._client.analyze_with_custom_model( # type: ignore + return await self._client.begin_analyze_with_custom_model( # type: ignore file_stream=form, model_id=model_id, include_text_details=include_text_content, content_type=content_type, cls=deserialization_callback, - polling=AsyncLROBasePolling(timeout=polling_interval, lro_algorithms=[AnalyzePolling()], **kwargs), + polling=AsyncLROBasePolling( + timeout=polling_interval, + lro_algorithms=[AnalyzePolling()], + **kwargs + ), error_map=error_map, + continuation_token=continuation_token, **kwargs ) @distributed_trace_async - async def recognize_custom_forms_from_url( + async def begin_recognize_custom_forms_from_url( self, model_id: str, form_url: str, **kwargs: Any - ) -> List["RecognizedForm"]: + ) -> AsyncLROPoller[List[RecognizedForm]]: """Analyze a custom form with a model trained with or without labels. The form to analyze should be of the same type as the forms that were used to train the model. The input document must be the location (Url) of the document to be analyzed. @@ -337,8 +374,10 @@ async def recognize_custom_forms_from_url( Whether or not to include text elements such as lines and words in addition to form fields. :keyword int polling_interval: Waiting time between two polls for LRO operations if no Retry-After header is present. Defaults to 5 seconds. - :return: A list of RecognizedForm. - :rtype: list[~azure.ai.formrecognizer.RecognizedForm] + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :return: An instance of an AsyncLROPoller. Call `result()` on the poller + object to return a list[:class:`~azure.ai.formrecognizer.RecognizedForm`]. + :rtype: ~azure.core.polling.AsyncLROPoller[list[~azure.ai.formrecognizer.RecognizedForm] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -347,6 +386,7 @@ async def recognize_custom_forms_from_url( cls = kwargs.pop("cls", None) polling_interval = kwargs.pop("polling_interval", POLLING_INTERVAL) + continuation_token = kwargs.pop("continuation_token", None) include_text_content = kwargs.pop("include_text_content", False) def analyze_callback(raw_response, _, headers): # pylint: disable=unused-argument @@ -354,13 +394,18 @@ def analyze_callback(raw_response, _, headers): # pylint: disable=unused-argume return prepare_form_result(analyze_result, model_id) deserialization_callback = cls if cls else analyze_callback - return await self._client.analyze_with_custom_model( # type: ignore + return await self._client.begin_analyze_with_custom_model( # type: ignore file_stream={"source": form_url}, model_id=model_id, include_text_details=include_text_content, cls=deserialization_callback, - polling=AsyncLROBasePolling(timeout=polling_interval, lro_algorithms=[AnalyzePolling()], **kwargs), + polling=AsyncLROBasePolling( + timeout=polling_interval, + lro_algorithms=[AnalyzePolling()], + **kwargs + ), error_map=error_map, + continuation_token=continuation_token, **kwargs ) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/aio/_form_training_client_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/aio/_form_training_client_async.py index 70611586bf83..70e288d5e7b8 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/aio/_form_training_client_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/aio/_form_training_client_async.py @@ -14,7 +14,7 @@ Union, TYPE_CHECKING, ) -from azure.core.polling import async_poller +from azure.core.polling import AsyncLROPoller from azure.core.polling.async_base_polling import AsyncLROBasePolling from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -85,19 +85,19 @@ def __init__( authentication_policy = get_authentication_policy(credential) self._client = FormRecognizer( endpoint=self._endpoint, - credential=self._credential, + credential=self._credential, # type: ignore sdk_moniker=USER_AGENT, authentication_policy=authentication_policy, **kwargs ) @distributed_trace_async - async def train_model( + async def begin_training( self, training_files_url: str, use_training_labels: bool, **kwargs: Any - ) -> CustomFormModel: + ) -> AsyncLROPoller[CustomFormModel]: """Create and train a custom model. The request must include a `training_files_url` parameter that is an externally accessible Azure storage blob container Uri (preferably a Shared Access Signature Uri). Models are trained using documents that are of the following content type - 'application/pdf', @@ -114,8 +114,10 @@ async def train_model( Use with `prefix` to filter for only certain sub folders. Not supported if training with labels. :keyword int polling_interval: Waiting time between two polls for LRO operations if no Retry-After header is present. Defaults to 5 seconds. - :return: CustomFormModel - :rtype: ~azure.ai.formrecognizer.CustomFormModel + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :return: An instance of an AsyncLROPoller. Call `result()` on the poller + object to return a :class:`~azure.ai.formrecognizer.CustomFormModel`. + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.ai.formrecognizer.CustomFormModel] :raises ~azure.core.exceptions.HttpResponseError: Note that if the training fails, the exception is raised, but a model with an "invalid" status is still created. You can delete this model by calling :func:`~delete_model()` @@ -130,8 +132,27 @@ async def train_model( :caption: Training a model with your custom forms. """ + def callback(raw_response): + model = self._client._deserialize(Model, raw_response) + return CustomFormModel._from_generated(model) + cls = kwargs.pop("cls", None) + continuation_token = kwargs.pop("continuation_token", None) polling_interval = kwargs.pop("polling_interval", POLLING_INTERVAL) + deserialization_callback = cls if cls else callback + + if continuation_token: + return AsyncLROPoller.from_continuation_token( + polling_method=AsyncLROBasePolling( # type: ignore + timeout=polling_interval, + lro_algorithms=[TrainingPolling()], + **kwargs + ), + continuation_token=continuation_token, + client=self._client._client, + deserialization_callback=deserialization_callback + ) + response = await self._client.train_custom_model_async( train_request=TrainRequest( source=training_files_url, @@ -146,16 +167,15 @@ async def train_model( **kwargs ) - def callback(raw_response): - model = self._client._deserialize(Model, raw_response) - return CustomFormModel._from_generated(model) - - deserialization_callback = cls if cls else callback - return await async_poller( + return AsyncLROPoller( self._client._client, response, deserialization_callback, - AsyncLROBasePolling(timeout=polling_interval, lro_algorithms=[TrainingPolling()], **kwargs) + AsyncLROBasePolling( # type: ignore + timeout=polling_interval, + lro_algorithms=[TrainingPolling()], + **kwargs + ) ) @distributed_trace_async @@ -272,7 +292,7 @@ async def get_copy_authorization( ) -> Dict[str, Union[str, int]]: """Generate authorization for copying a custom model into the target Form Recognizer resource. This should be called by the target resource (where the model will be copied to) - and the output can be passed as the `target` parameter into :func:`~copy_model()`. + and the output can be passed as the `target` parameter into :func:`~begin_copy_model()`. :param str resource_id: Azure Resource Id of the target Form Recognizer resource where the model will be copied to. @@ -304,12 +324,12 @@ async def get_copy_authorization( return target @distributed_trace_async - async def copy_model( + async def begin_copy_model( self, model_id: str, target: dict, **kwargs: Any - ) -> CustomFormModelInfo: + ) -> AsyncLROPoller[CustomFormModelInfo]: """Copy a custom model stored in this resource (the source) to the user specified target Form Recognizer resource. This should be called with the source Form Recognizer resource (with the model that is intended to be copied). The `target` parameter should be supplied from the @@ -321,8 +341,10 @@ async def copy_model( :func:`~get_copy_authorization()`. :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: CustomFormModelInfo - :rtype: ~azure.ai.formrecognizer.CustomFormModelInfo + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :return: An instance of an AsyncLROPoller. Call `result()` on the poller + object to return a :class:`~azure.ai.formrecognizer.CustomFormModelInfo`. + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.ai.formrecognizer.CustomFormModelInfo] :raises ~azure.core.exceptions.HttpResponseError: .. admonition:: Example: @@ -338,13 +360,14 @@ async def copy_model( if not model_id: raise ValueError("model_id cannot be None or empty.") + continuation_token = kwargs.pop("continuation_token", None) polling_interval = kwargs.pop("polling_interval", POLLING_INTERVAL) def _copy_callback(raw_response, _, headers): # pylint: disable=unused-argument copy_result = self._client._deserialize(CopyOperationResult, raw_response) return CustomFormModelInfo._from_generated(copy_result, target["modelId"]) - return await self._client.copy_custom_model( # type: ignore + return await self._client.begin_copy_custom_model( # type: ignore model_id=model_id, copy_request=CopyRequest( target_resource_id=target["resourceId"], @@ -356,8 +379,13 @@ def _copy_callback(raw_response, _, headers): # pylint: disable=unused-argument ) ), cls=kwargs.pop("cls", _copy_callback), - polling=AsyncLROBasePolling(timeout=polling_interval, lro_algorithms=[CopyPolling()], **kwargs), + polling=AsyncLROBasePolling( + timeout=polling_interval, + lro_algorithms=[CopyPolling()], + **kwargs + ), error_map=error_map, + continuation_token=continuation_token, **kwargs ) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_authentication_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_authentication_async.py index 7b5b28c89f65..03e9e45165fb 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_authentication_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_authentication_async.py @@ -47,7 +47,9 @@ async def authentication_with_api_key_credential_form_recognizer_client_async(se form_recognizer_client = FormRecognizerClient(endpoint, AzureKeyCredential(key)) # [END create_fr_client_with_key_async] - receipt = await form_recognizer_client.recognize_receipts_from_url(self.url) + async with form_recognizer_client: + poller = await form_recognizer_client.begin_recognize_receipts_from_url(self.url) + result = await poller.result() async def authentication_with_azure_active_directory_form_recognizer_client_async(self): """DefaultAzureCredential will use the values from these environment @@ -62,7 +64,9 @@ async def authentication_with_azure_active_directory_form_recognizer_client_asyn form_recognizer_client = FormRecognizerClient(endpoint, credential) # [END create_fr_client_with_aad_async] - poller = await form_recognizer_client.recognize_receipts_from_url(self.url) + async with form_recognizer_client: + poller = await form_recognizer_client.begin_recognize_receipts_from_url(self.url) + result = await poller.result() async def authentication_with_api_key_credential_form_training_client_async(self): # [START create_ft_client_with_key_async] @@ -73,7 +77,8 @@ async def authentication_with_api_key_credential_form_training_client_async(self form_training_client = FormTrainingClient(endpoint, AzureKeyCredential(key)) # [END create_ft_client_with_key_async] - properties = await form_training_client.get_account_properties() + async with form_training_client: + properties = await form_training_client.get_account_properties() async def authentication_with_azure_active_directory_form_training_client_async(self): """DefaultAzureCredential will use the values from these environment @@ -88,7 +93,8 @@ async def authentication_with_azure_active_directory_form_training_client_async( form_training_client = FormTrainingClient(endpoint, credential) # [END create_ft_client_with_aad_async] - properties = await form_training_client.get_account_properties() + async with form_training_client: + properties = await form_training_client.get_account_properties() async def main(): diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_copy_model_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_copy_model_async.py index 90b0c50ad8b6..1101cab2c5be 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_copy_model_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_copy_model_async.py @@ -59,10 +59,11 @@ async def copy_model_async(self): target_client = FormTrainingClient(endpoint=target_endpoint, credential=AzureKeyCredential(target_key)) async with source_client: - copy = await source_client.copy_model( + poller = await source_client.begin_copy_model( model_id=source_model_id, target=target ) + copy = await poller.result() async with target_client: copied_over_model = await target_client.get_custom_model(copy.model_id) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_differentiate_output_models_trained_with_and_without_labels_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_differentiate_output_models_trained_with_and_without_labels_async.py index 18a2b42702a6..8c11623a4a91 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_differentiate_output_models_trained_with_and_without_labels_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_differentiate_output_models_trained_with_and_without_labels_async.py @@ -11,7 +11,7 @@ DESCRIPTION: This sample demonstrates the differences in output that arise when recognize_custom_forms - is called with custom models trained with labeled and unlabeled data. For a more general + is called with custom models trained with labels and without labels. For a more general example of recognizing custom forms, see sample_recognize_custom_forms_async.py USAGE: python sample_differentiate_output_models_trained_with_and_without_labels_async.py @@ -26,11 +26,13 @@ import os import asyncio + def format_bounding_box(bounding_box): if not bounding_box: return "N/A" return ", ".join(["[{}, {}]".format(p.x, p.y) for p in bounding_box]) + class DifferentiateOutputModelsTrainedWithAndWithoutLabelsSampleAsync(object): async def recognize_custom_forms(self): @@ -49,14 +51,16 @@ async def recognize_custom_forms(self): # Make sure your form's type is included in the list of form types the custom model can recognize with open(path_to_sample_forms, "rb") as f: - stream = f.read() - forms_with_labeled_model = await form_recognizer_client.recognize_custom_forms( - model_id=model_trained_with_labels_id, form=stream - ) - forms_with_unlabeled_model = await form_recognizer_client.recognize_custom_forms( - model_id=model_trained_without_labels_id, form=stream + form = f.read() + with_labels_poller = await form_recognizer_client.begin_recognize_custom_forms( + model_id=model_trained_with_labels_id, form=form ) + forms_with_labeled_model = await with_labels_poller.result() + without_labels_poller = await form_recognizer_client.begin_recognize_custom_forms( + model_id=model_trained_without_labels_id, form=form + ) + forms_with_unlabeled_model = await without_labels_poller.result() # With a form recognized by a model trained with labels, this 'name' key will be its # training-time label, otherwise it will be denoted by numeric indices. # Label data is not returned for model trained with labels. @@ -91,7 +95,6 @@ async def recognize_custom_forms(self): )) - async def main(): sample = DifferentiateOutputModelsTrainedWithAndWithoutLabelsSampleAsync() await sample.recognize_custom_forms() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_get_bounding_boxes_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_get_bounding_boxes_async.py index f2b603a15b40..73a8f31f51c5 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_get_bounding_boxes_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_get_bounding_boxes_async.py @@ -30,6 +30,7 @@ def format_bounding_box(bounding_box): return "N/A" return ", ".join(["[{}, {}]".format(p.x, p.y) for p in bounding_box]) + class GetBoundingBoxesSampleAsync(object): async def get_bounding_boxes(self): @@ -49,10 +50,11 @@ async def get_bounding_boxes(self): async with form_recognizer_client: # Make sure your form's type is included in the list of form types the custom model can recognize with open(path_to_sample_forms, "rb") as f: - forms = await form_recognizer_client.recognize_custom_forms( - model_id=model_id, form=f.read(), include_text_content=True + poller = await form_recognizer_client.begin_recognize_custom_forms( + model_id=model_id, form=f, include_text_content=True ) + forms = await poller.result() for idx, form in enumerate(forms): print("--------RECOGNIZING FORM #{}--------".format(idx)) print("Form has type {}".format(form.form_type)) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_manage_custom_models_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_manage_custom_models_async.py index 8c2d089f8d1f..6a1a5ba4a8ab 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_manage_custom_models_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_manage_custom_models_async.py @@ -11,8 +11,8 @@ DESCRIPTION: This sample demonstrates how to manage the custom models on your account. To learn - how to create and train a custom model, look at sample_train_unlabeled_model.py and - sample_train_labeled_model.py. + how to create and train a custom model, look at sample_train_model_without_labels.py and + sample_train_model_with_labels.py. USAGE: python sample_manage_custom_models_async.py @@ -79,6 +79,7 @@ async def manage_custom_models(self): print("Successfully deleted model with id {}".format(custom_model.model_id)) # [END delete_model_async] + async def main(): sample = ManageCustomModelsSampleAsync() await sample.manage_custom_models() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_recognize_content_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_recognize_content_async.py index a20143df346e..64348e507c5d 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_recognize_content_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_recognize_content_async.py @@ -30,6 +30,7 @@ def format_bounding_box(bounding_box): return "N/A" return ", ".join(["[{}, {}]".format(p.x, p.y) for p in bounding_box]) + class RecognizeContentSampleAsync(object): async def recognize_content(self): @@ -46,7 +47,9 @@ async def recognize_content(self): ) as form_recognizer_client: with open(path_to_sample_forms, "rb") as f: - contents = await form_recognizer_client.recognize_content(form=f.read()) + poller = await form_recognizer_client.begin_recognize_content(form=f) + + contents = await poller.result() for idx, content in enumerate(contents): print("----Recognizing content from page #{}----".format(idx)) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_recognize_custom_forms_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_recognize_custom_forms_async.py index 0ffa898041d4..d763770c00ab 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_recognize_custom_forms_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_recognize_custom_forms_async.py @@ -13,7 +13,7 @@ This sample demonstrates how to analyze a form from a document with a custom trained model. The form must be of the same type as the forms the custom model was trained on. To learn how to train your own models, look at - sample_train_unlabeled_model_async.py and sample_train_labeled_model_async.py + sample_train_model_without_labels_async.py and sample_train_model_with_labels_async.py USAGE: python sample_recognize_custom_forms_async.py @@ -25,7 +25,6 @@ import os import asyncio -from pathlib import Path class RecognizeCustomFormsSampleAsync(object): @@ -46,9 +45,10 @@ async def recognize_custom_forms(self): # Make sure your form's type is included in the list of form types the custom model can recognize with open(path_to_sample_forms, "rb") as f: - forms = await form_recognizer_client.recognize_custom_forms( - model_id=model_id, form=f.read() + poller = await form_recognizer_client.begin_recognize_custom_forms( + model_id=model_id, form=f ) + forms = await poller.result() for idx, form in enumerate(forms): print("--------Recognizing Form #{}--------".format(idx)) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_recognize_receipts_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_recognize_receipts_async.py index 2e41b244a5e3..1b410bc6f20f 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_recognize_receipts_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_recognize_receipts_async.py @@ -22,7 +22,6 @@ import os import asyncio -from pathlib import Path class RecognizeReceiptsSampleAsync(object): @@ -41,23 +40,48 @@ async def recognize_receipts(self): ) as form_recognizer_client: with open(path_to_sample_forms, "rb") as f: - receipts = await form_recognizer_client.recognize_receipts(receipt=f.read()) + poller = await form_recognizer_client.begin_recognize_receipts(receipt=f) + + receipts = await poller.result() for idx, receipt in enumerate(receipts): print("--------Recognizing receipt #{}--------".format(idx)) - print("Receipt Type: {} has confidence: {}".format(receipt.receipt_type.type, receipt.receipt_type.confidence)) - print("Merchant Name: {} has confidence: {}".format(receipt.merchant_name.value, receipt.merchant_name.confidence)) - print("Transaction Date: {} has confidence: {}".format(receipt.transaction_date.value, receipt.transaction_date.confidence)) + receipt_type = receipt.fields.get("ReceiptType") + if receipt_type: + print("Receipt Type: {} has confidence: {}".format(receipt_type.value, receipt_type.confidence)) + merchant_name = receipt.fields.get("MerchantName") + if merchant_name: + print("Merchant Name: {} has confidence: {}".format(merchant_name.value, merchant_name.confidence)) + transaction_date = receipt.fields.get("TransactionDate") + if transaction_date: + print("Transaction Date: {} has confidence: {}".format(transaction_date.value, transaction_date.confidence)) print("Receipt items:") - for item in receipt.receipt_items: - print("...Item Name: {} has confidence: {}".format(item.name.value, item.name.confidence)) - print("...Item Quantity: {} has confidence: {}".format(item.quantity.value, item.quantity.confidence)) - print("...Individual Item Price: {} has confidence: {}".format(item.price.value, item.price.confidence)) - print("...Total Item Price: {} has confidence: {}".format(item.total_price.value, item.total_price.confidence)) - print("Subtotal: {} has confidence: {}".format(receipt.subtotal.value, receipt.subtotal.confidence)) - print("Tax: {} has confidence: {}".format(receipt.tax.value, receipt.tax.confidence)) - print("Tip: {} has confidence: {}".format(receipt.tip.value, receipt.tip.confidence)) - print("Total: {} has confidence: {}".format(receipt.total.value, receipt.total.confidence)) + for idx, item in enumerate(receipt.fields.get("Items").value): + print("...Item #{}".format(idx)) + item_name = item.value.get("Name") + if item_name: + print("......Item Name: {} has confidence: {}".format(item_name.value, item_name.confidence)) + item_quantity = item.value.get("Quantity") + if item_quantity: + print("......Item Quantity: {} has confidence: {}".format(item_quantity.value, item_quantity.confidence)) + item_price = item.value.get("Price") + if item_price: + print("......Individual Item Price: {} has confidence: {}".format(item_price.value, item_price.confidence)) + item_total_price = item.value.get("TotalPrice") + if item_total_price: + print("......Total Item Price: {} has confidence: {}".format(item_total_price.value, item_total_price.confidence)) + subtotal = receipt.fields.get("Subtotal") + if subtotal: + print("Subtotal: {} has confidence: {}".format(subtotal.value, subtotal.confidence)) + tax = receipt.fields.get("Tax") + if tax: + print("Tax: {} has confidence: {}".format(tax.value, tax.confidence)) + tip = receipt.fields.get("Tip") + if tip: + print("Tip: {} has confidence: {}".format(tip.value, tip.confidence)) + total = receipt.fields.get("Total") + if total: + print("Total: {} has confidence: {}".format(total.value, total.confidence)) print("--------------------------------------") # [END recognize_receipts_async] diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_recognize_receipts_from_url_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_recognize_receipts_from_url_async.py index 8831e076fc69..8f244f8b20c4 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_recognize_receipts_from_url_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_recognize_receipts_from_url_async.py @@ -38,23 +38,47 @@ async def recognize_receipts_from_url(self): endpoint=endpoint, credential=AzureKeyCredential(key) ) as form_recognizer_client: url = "https://raw.githubusercontent.com/Azure/azure-sdk-for-python/master/sdk/formrecognizer/azure-ai-formrecognizer/tests/sample_forms/receipt/contoso-receipt.png" - receipts = await form_recognizer_client.recognize_receipts_from_url(receipt_url=url) + poller = await form_recognizer_client.begin_recognize_receipts_from_url(receipt_url=url) + receipts = await poller.result() for idx, receipt in enumerate(receipts): print("--------Recognizing receipt #{}--------".format(idx)) - print("Receipt Type: {} has confidence: {}".format(receipt.receipt_type.type, receipt.receipt_type.confidence)) - print("Merchant Name: {} has confidence: {}".format(receipt.merchant_name.value, receipt.merchant_name.confidence)) - print("Transaction Date: {} has confidence: {}".format(receipt.transaction_date.value, receipt.transaction_date.confidence)) + receipt_type = receipt.fields.get("ReceiptType") + if receipt_type: + print("Receipt Type: {} has confidence: {}".format(receipt_type.value, receipt_type.confidence)) + merchant_name = receipt.fields.get("MerchantName") + if merchant_name: + print("Merchant Name: {} has confidence: {}".format(merchant_name.value, merchant_name.confidence)) + transaction_date = receipt.fields.get("TransactionDate") + if transaction_date: + print("Transaction Date: {} has confidence: {}".format(transaction_date.value, transaction_date.confidence)) print("Receipt items:") - for item in receipt.receipt_items: - print("...Item Name: {} has confidence: {}".format(item.name.value, item.name.confidence)) - print("...Item Quantity: {} has confidence: {}".format(item.quantity.value, item.quantity.confidence)) - print("...Individual Item Price: {} has confidence: {}".format(item.price.value, item.price.confidence)) - print("...Total Item Price: {} has confidence: {}".format(item.total_price.value, item.total_price.confidence)) - print("Subtotal: {} has confidence: {}".format(receipt.subtotal.value, receipt.subtotal.confidence)) - print("Tax: {} has confidence: {}".format(receipt.tax.value, receipt.tax.confidence)) - print("Tip: {} has confidence: {}".format(receipt.tip.value, receipt.tip.confidence)) - print("Total: {} has confidence: {}".format(receipt.total.value, receipt.total.confidence)) + for idx, item in enumerate(receipt.fields.get("Items").value): + print("...Item #{}".format(idx)) + item_name = item.value.get("Name") + if item_name: + print("......Item Name: {} has confidence: {}".format(item_name.value, item_name.confidence)) + item_quantity = item.value.get("Quantity") + if item_quantity: + print("......Item Quantity: {} has confidence: {}".format(item_quantity.value, item_quantity.confidence)) + item_price = item.value.get("Price") + if item_price: + print("......Individual Item Price: {} has confidence: {}".format(item_price.value, item_price.confidence)) + item_total_price = item.value.get("TotalPrice") + if item_total_price: + print("......Total Item Price: {} has confidence: {}".format(item_total_price.value, item_total_price.confidence)) + subtotal = receipt.fields.get("Subtotal") + if subtotal: + print("Subtotal: {} has confidence: {}".format(subtotal.value, subtotal.confidence)) + tax = receipt.fields.get("Tax") + if tax: + print("Tax: {} has confidence: {}".format(tax.value, tax.confidence)) + tip = receipt.fields.get("Tip") + if tip: + print("Tip: {} has confidence: {}".format(tip.value, tip.confidence)) + total = receipt.fields.get("Total") + if total: + print("Total: {} has confidence: {}".format(total.value, total.confidence)) print("--------------------------------------") # [END recognize_receipts_from_url_async] diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_train_model_with_labels_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_train_model_with_labels_async.py index 205aa36b855a..21d897d5a680 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_train_model_with_labels_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_train_model_with_labels_async.py @@ -10,8 +10,9 @@ FILE: sample_train_model_with_labels_async.py DESCRIPTION: - This sample demonstrates how to train a model with labeled data. To see how to label your documents. You can use the service's labeling tool - to label your documents: https://docs.microsoft.com/en-us/azure/cognitive-services/form-recognizer/quickstarts/label-tool, and follow their + This sample demonstrates how to train a model with labels. To see how to label your documents, you can use the + service's labeling tool to label your documents: + https://docs.microsoft.com/azure/cognitive-services/form-recognizer/quickstarts/label-tool. Follow the instructions to store these labeled files in your blob container with the other form files. See sample_recognize_custom_forms_async.py to recognize forms with your custom model. USAGE: @@ -21,8 +22,8 @@ 1) AZURE_FORM_RECOGNIZER_ENDPOINT - the endpoint to your Cognitive Services resource. 2) AZURE_FORM_RECOGNIZER_KEY - your Form Recognizer API key 3) CONTAINER_SAS_URL - The shared access signature (SAS) Url of your Azure Blob Storage container with your labeled data. - See https://docs.microsoft.com/en-us/azure/cognitive-services/form-recognizer/quickstarts/python-labeled-data#train-a-model-using-labeled-data - for more detailed descriptions on how to get it. + See https://docs.microsoft.com/azure/cognitive-services/form-recognizer/quickstarts/python-labeled-data#train-a-model-using-labeled-data + for more detailed descriptions on how to get it. """ import os @@ -44,7 +45,8 @@ async def train_model_with_labels(self): ) async with form_training_client: - model = await form_training_client.train_model(container_sas_url, use_training_labels=True) + poller = await form_training_client.begin_training(container_sas_url, use_training_labels=True) + model = await poller.result() # Custom model information print("Model ID: {}".format(model.model_id)) @@ -69,6 +71,7 @@ async def train_model_with_labels(self): print("Document page count: {}".format(doc.page_count)) print("Document errors: {}".format(doc.errors)) + async def main(): sample = TrainModelWithLabelsSampleAsync() await sample.train_model_with_labels() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_train_model_without_labels_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_train_model_without_labels_async.py index 37de8d1539d6..c483df401358 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_train_model_without_labels_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_train_model_without_labels_async.py @@ -19,8 +19,8 @@ 1) AZURE_FORM_RECOGNIZER_ENDPOINT - the endpoint to your Cognitive Services resource. 2) AZURE_FORM_RECOGNIZER_KEY - your Form Recognizer API key 3) CONTAINER_SAS_URL - The shared access signature (SAS) Url of your Azure Blob Storage container with your forms. - See https://docs.microsoft.com/en-us/azure/cognitive-services/form-recognizer/quickstarts/label-tool#connect-to-the-sample-labeling-tool - for more detailed descriptions on how to get it. + See https://docs.microsoft.com/azure/cognitive-services/form-recognizer/quickstarts/label-tool#connect-to-the-sample-labeling-tool + for more detailed descriptions on how to get it. """ import os @@ -42,7 +42,8 @@ async def train_model_without_labels(self): endpoint, AzureKeyCredential(key) ) as form_training_client: - model = await form_training_client.train_model(container_sas_url, use_training_labels=False) + poller = await form_training_client.begin_training(container_sas_url, use_training_labels=False) + model = await poller.result() # Custom model information print("Model ID: {}".format(model.model_id)) @@ -66,6 +67,7 @@ async def train_model_without_labels(self): print("Document page count: {}".format(doc.page_count)) print("Document errors: {}".format(doc.errors)) + async def main(): sample = TrainModelWithoutLabelsSampleAsync() await sample.train_model_without_labels() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/samples/sample_recognize_custom_forms.py b/sdk/formrecognizer/azure-ai-formrecognizer/samples/sample_recognize_custom_forms.py index da3092d399b6..175eff0486b6 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/samples/sample_recognize_custom_forms.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/samples/sample_recognize_custom_forms.py @@ -13,7 +13,7 @@ This sample demonstrates how to analyze a form from a document with a custom trained model. The form must be of the same type as the forms the custom model was trained on. To learn how to train your own models, look at - sample_train_unlabeled_model.py and sample_train_labeled_model.py + sample_train_model_without_labels.py and sample_train_model_with_labels.py USAGE: python sample_recognize_custom_forms.py diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/samples/sample_recognize_receipts.py b/sdk/formrecognizer/azure-ai-formrecognizer/samples/sample_recognize_receipts.py index b321ef76553e..a53c04497daa 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/samples/sample_recognize_receipts.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/samples/sample_recognize_receipts.py @@ -42,19 +42,42 @@ def recognize_receipts(self): for idx, receipt in enumerate(receipts): print("--------Recognizing receipt #{}--------".format(idx)) - print("Receipt Type: {} has confidence: {}".format(receipt.receipt_type.type, receipt.receipt_type.confidence)) - print("Merchant Name: {} has confidence: {}".format(receipt.merchant_name.value, receipt.merchant_name.confidence)) - print("Transaction Date: {} has confidence: {}".format(receipt.transaction_date.value, receipt.transaction_date.confidence)) + receipt_type = receipt.fields.get("ReceiptType") + if receipt_type: + print("Receipt Type: {} has confidence: {}".format(receipt_type.value, receipt_type.confidence)) + merchant_name = receipt.fields.get("MerchantName") + if merchant_name: + print("Merchant Name: {} has confidence: {}".format(merchant_name.value, merchant_name.confidence)) + transaction_date = receipt.fields.get("TransactionDate") + if transaction_date: + print("Transaction Date: {} has confidence: {}".format(transaction_date.value, transaction_date.confidence)) print("Receipt items:") - for item in receipt.receipt_items: - print("...Item Name: {} has confidence: {}".format(item.name.value, item.name.confidence)) - print("...Item Quantity: {} has confidence: {}".format(item.quantity.value, item.quantity.confidence)) - print("...Individual Item Price: {} has confidence: {}".format(item.price.value, item.price.confidence)) - print("...Total Item Price: {} has confidence: {}".format(item.total_price.value, item.total_price.confidence)) - print("Subtotal: {} has confidence: {}".format(receipt.subtotal.value, receipt.subtotal.confidence)) - print("Tax: {} has confidence: {}".format(receipt.tax.value, receipt.tax.confidence)) - print("Tip: {} has confidence: {}".format(receipt.tip.value, receipt.tip.confidence)) - print("Total: {} has confidence: {}".format(receipt.total.value, receipt.total.confidence)) + for idx, item in enumerate(receipt.fields.get("Items").value): + print("...Item #{}".format(idx)) + item_name = item.value.get("Name") + if item_name: + print("......Item Name: {} has confidence: {}".format(item_name.value, item_name.confidence)) + item_quantity = item.value.get("Quantity") + if item_quantity: + print("......Item Quantity: {} has confidence: {}".format(item_quantity.value, item_quantity.confidence)) + item_price = item.value.get("Price") + if item_price: + print("......Individual Item Price: {} has confidence: {}".format(item_price.value, item_price.confidence)) + item_total_price = item.value.get("TotalPrice") + if item_total_price: + print("......Total Item Price: {} has confidence: {}".format(item_total_price.value, item_total_price.confidence)) + subtotal = receipt.fields.get("Subtotal") + if subtotal: + print("Subtotal: {} has confidence: {}".format(subtotal.value, subtotal.confidence)) + tax = receipt.fields.get("Tax") + if tax: + print("Tax: {} has confidence: {}".format(tax.value, tax.confidence)) + tip = receipt.fields.get("Tip") + if tip: + print("Tip: {} has confidence: {}".format(tip.value, tip.confidence)) + total = receipt.fields.get("Total") + if total: + print("Total: {} has confidence: {}".format(total.value, total.confidence)) print("--------------------------------------") # [END recognize_receipts] diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/samples/sample_recognize_receipts_from_url.py b/sdk/formrecognizer/azure-ai-formrecognizer/samples/sample_recognize_receipts_from_url.py index 7ccd5c58586a..f3b333c4d7f1 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/samples/sample_recognize_receipts_from_url.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/samples/sample_recognize_receipts_from_url.py @@ -42,19 +42,42 @@ def recognize_receipts_from_url(self): for idx, receipt in enumerate(receipts): print("--------Recognizing receipt #{}--------".format(idx)) - print("Receipt Type: {} has confidence: {}".format(receipt.receipt_type.type, receipt.receipt_type.confidence)) - print("Merchant Name: {} has confidence: {}".format(receipt.merchant_name.value, receipt.merchant_name.confidence)) - print("Transaction Date: {} has confidence: {}".format(receipt.transaction_date.value, receipt.transaction_date.confidence)) + receipt_type = receipt.fields.get("ReceiptType") + if receipt_type: + print("Receipt Type: {} has confidence: {}".format(receipt_type.value, receipt_type.confidence)) + merchant_name = receipt.fields.get("MerchantName") + if merchant_name: + print("Merchant Name: {} has confidence: {}".format(merchant_name.value, merchant_name.confidence)) + transaction_date = receipt.fields.get("TransactionDate") + if transaction_date: + print("Transaction Date: {} has confidence: {}".format(transaction_date.value, transaction_date.confidence)) print("Receipt items:") - for item in receipt.receipt_items: - print("...Item Name: {} has confidence: {}".format(item.name.value, item.name.confidence)) - print("...Item Quantity: {} has confidence: {}".format(item.quantity.value, item.quantity.confidence)) - print("...Individual Item Price: {} has confidence: {}".format(item.price.value, item.price.confidence)) - print("...Total Item Price: {} has confidence: {}".format(item.total_price.value, item.total_price.confidence)) - print("Subtotal: {} has confidence: {}".format(receipt.subtotal.value, receipt.subtotal.confidence)) - print("Tax: {} has confidence: {}".format(receipt.tax.value, receipt.tax.confidence)) - print("Tip: {} has confidence: {}".format(receipt.tip.value, receipt.tip.confidence)) - print("Total: {} has confidence: {}".format(receipt.total.value, receipt.total.confidence)) + for idx, item in enumerate(receipt.fields.get("Items").value): + print("...Item #{}".format(idx)) + item_name = item.value.get("Name") + if item_name: + print("......Item Name: {} has confidence: {}".format(item_name.value, item_name.confidence)) + item_quantity = item.value.get("Quantity") + if item_quantity: + print("......Item Quantity: {} has confidence: {}".format(item_quantity.value, item_quantity.confidence)) + item_price = item.value.get("Price") + if item_price: + print("......Individual Item Price: {} has confidence: {}".format(item_price.value, item_price.confidence)) + item_total_price = item.value.get("TotalPrice") + if item_total_price: + print("......Total Item Price: {} has confidence: {}".format(item_total_price.value, item_total_price.confidence)) + subtotal = receipt.fields.get("Subtotal") + if subtotal: + print("Subtotal: {} has confidence: {}".format(subtotal.value, subtotal.confidence)) + tax = receipt.fields.get("Tax") + if tax: + print("Tax: {} has confidence: {}".format(tax.value, tax.confidence)) + tip = receipt.fields.get("Tip") + if tip: + print("Tip: {} has confidence: {}".format(tip.value, tip.confidence)) + total = receipt.fields.get("Total") + if total: + print("Total: {} has confidence: {}".format(total.value, total.confidence)) print("--------------------------------------") # [END recognize_receipts_from_url] diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/samples/sample_train_model_with_labels.py b/sdk/formrecognizer/azure-ai-formrecognizer/samples/sample_train_model_with_labels.py index 9508c4945876..0f6efbe46937 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/samples/sample_train_model_with_labels.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/samples/sample_train_model_with_labels.py @@ -10,8 +10,9 @@ FILE: sample_train_model_with_labels.py DESCRIPTION: - This sample demonstrates how to train a model with labeled data. To see how to label your documents. You can use the service's labeling tool - to label your documents: https://docs.microsoft.com/en-us/azure/cognitive-services/form-recognizer/quickstarts/label-tool, and follow their + This sample demonstrates how to train a model with labels. To see how to label your documents, you can use the + service's labeling tool to label your documents: + https://docs.microsoft.com/azure/cognitive-services/form-recognizer/quickstarts/label-tool. Follow the instructions to store these labeled files in your blob container with the other form files. See sample_recognize_custom_forms.py to recognize forms with your custom model. USAGE: @@ -21,8 +22,8 @@ 1) AZURE_FORM_RECOGNIZER_ENDPOINT - the endpoint to your Cognitive Services resource. 2) AZURE_FORM_RECOGNIZER_KEY - your Form Recognizer API key 3) CONTAINER_SAS_URL - The shared access signature (SAS) Url of your Azure Blob Storage container with your labeled data. - See https://docs.microsoft.com/en-us/azure/cognitive-services/form-recognizer/quickstarts/python-labeled-data#train-a-model-using-labeled-data - for more detailed descriptions on how to get it. + See https://docs.microsoft.com/azure/cognitive-services/form-recognizer/quickstarts/python-labeled-data#train-a-model-using-labeled-data + for more detailed descriptions on how to get it. """ import os @@ -39,8 +40,7 @@ def train_model_with_labels(self): container_sas_url = os.environ["CONTAINER_SAS_URL"] form_training_client = FormTrainingClient(endpoint, AzureKeyCredential(key)) - - poller = form_training_client.begin_train_model(container_sas_url, use_training_labels=True) + poller = form_training_client.begin_training(container_sas_url, use_training_labels=True) model = poller.result() # Custom model information @@ -66,6 +66,7 @@ def train_model_with_labels(self): print("Document page count: {}".format(doc.page_count)) print("Document errors: {}".format(doc.errors)) + if __name__ == '__main__': sample = TrainModelWithLabelsSample() sample.train_model_with_labels() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/samples/sample_train_model_without_labels.py b/sdk/formrecognizer/azure-ai-formrecognizer/samples/sample_train_model_without_labels.py index 73a69f17311b..9ddfbaaf2237 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/samples/sample_train_model_without_labels.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/samples/sample_train_model_without_labels.py @@ -19,8 +19,8 @@ 1) AZURE_FORM_RECOGNIZER_ENDPOINT - the endpoint to your Cognitive Services resource. 2) AZURE_FORM_RECOGNIZER_KEY - your Form Recognizer API key 3) CONTAINER_SAS_URL - The shared access signature (SAS) Url of your Azure Blob Storage container with your forms. - See https://docs.microsoft.com/en-us/azure/cognitive-services/form-recognizer/quickstarts/label-tool#connect-to-the-sample-labeling-tool - for more detailed descriptions on how to get it. + See https://docs.microsoft.com/azure/cognitive-services/form-recognizer/quickstarts/label-tool#connect-to-the-sample-labeling-tool + for more detailed descriptions on how to get it. """ import os @@ -38,8 +38,7 @@ def train_model_without_labels(self): container_sas_url = os.environ["CONTAINER_SAS_URL"] form_training_client = FormTrainingClient(endpoint, AzureKeyCredential(key)) - - poller = form_training_client.begin_train_model(container_sas_url, use_training_labels=False) + poller = form_training_client.begin_training(container_sas_url, use_training_labels=False) model = poller.result() # Custom model information @@ -64,6 +63,7 @@ def train_model_without_labels(self): print("Document page count: {}".format(doc.page_count)) print("Document errors: {}".format(doc.errors)) + if __name__ == '__main__': sample = TrainModelWithoutLabelsSample() sample.train_model_without_labels() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/setup.py b/sdk/formrecognizer/azure-ai-formrecognizer/setup.py index 7fde2ad11ac3..eb0854143789 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/setup.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/setup.py @@ -78,7 +78,7 @@ 'azure.ai', ]), install_requires=[ - "azure-core<2.0.0,>=1.4.0", + "azure-core<2.0.0,>=1.6.0", "msrest>=0.6.12", 'six>=1.6', ], diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content.py index ca49e789ff15..a4473c0446ff 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content.py @@ -4,6 +4,7 @@ # Licensed under the MIT License. # ------------------------------------ +import pytest from io import BytesIO from azure.core.exceptions import ServiceRequestError, ClientAuthenticationError, HttpResponseError from azure.core.credentials import AzureKeyCredential @@ -243,3 +244,18 @@ def callback(raw_response, _, headers): # Check form pages self.assertFormPagesTransformCorrect(layout, read_results, page_results) + + @GlobalFormRecognizerAccountPreparer() + @pytest.mark.live_test_only + def test_content_continuation_token(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): + client = FormRecognizerClient(form_recognizer_account, + AzureKeyCredential(form_recognizer_account_key)) + with open(self.form_jpg, "rb") as fd: + myfile = fd.read() + initial_poller = client.begin_recognize_content(myfile) + cont_token = initial_poller.continuation_token() + + poller = client.begin_recognize_content(myfile, continuation_token=cont_token) + result = poller.result() + self.assertIsNotNone(result) + initial_poller.wait() # necessary so azure-devtools doesn't throw assertion error diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content_async.py index dfb0d8dcb463..0d75274f4d8c 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content_async.py @@ -4,6 +4,7 @@ # Licensed under the MIT License. # ------------------------------------ +import pytest from io import BytesIO from azure.core.exceptions import ServiceRequestError, ClientAuthenticationError, HttpResponseError from azure.core.credentials import AzureKeyCredential @@ -23,30 +24,34 @@ async def test_content_bad_endpoint(self, resource_group, location, form_recogni myfile = fd.read() with self.assertRaises(ServiceRequestError): client = FormRecognizerClient("http://notreal.azure.com", AzureKeyCredential(form_recognizer_account_key)) - result = await client.recognize_content(myfile) + poller = await client.begin_recognize_content(myfile) + result = await poller.result() @GlobalFormRecognizerAccountPreparer() async def test_content_authentication_successful_key(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): client = FormRecognizerClient(form_recognizer_account, AzureKeyCredential(form_recognizer_account_key)) with open(self.invoice_pdf, "rb") as fd: myfile = fd.read() - result = await client.recognize_content(myfile) + poller = await client.begin_recognize_content(myfile) + result = await poller.result() @GlobalFormRecognizerAccountPreparer() async def test_content_authentication_bad_key(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): client = FormRecognizerClient(form_recognizer_account, AzureKeyCredential("xxxx")) with self.assertRaises(ClientAuthenticationError): - result = await client.recognize_content(b"xxx", content_type="application/pdf") + poller = await client.begin_recognize_content(b"xxx", content_type="application/pdf") + result = await poller.result() @GlobalFormRecognizerAccountPreparer() async def test_passing_enum_content_type(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): client = FormRecognizerClient(form_recognizer_account, AzureKeyCredential(form_recognizer_account_key)) with open(self.invoice_pdf, "rb") as fd: myfile = fd.read() - result = await client.recognize_content( + poller = await client.begin_recognize_content( myfile, content_type=FormContentType.application_pdf ) + result = await poller.result() self.assertIsNotNone(result) @GlobalFormRecognizerAccountPreparer() @@ -54,36 +59,40 @@ async def test_damaged_file_passed_as_bytes(self, resource_group, location, form client = FormRecognizerClient(form_recognizer_account, AzureKeyCredential(form_recognizer_account_key)) damaged_pdf = b"\x25\x50\x44\x46\x55\x55\x55" # still has correct bytes to be recognized as PDF with self.assertRaises(HttpResponseError): - poller = await client.recognize_content( + poller = await client.begin_recognize_content( damaged_pdf, ) + result = await poller.result() @GlobalFormRecognizerAccountPreparer() async def test_damaged_file_bytes_fails_autodetect_content_type(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): client = FormRecognizerClient(form_recognizer_account, AzureKeyCredential(form_recognizer_account_key)) damaged_pdf = b"\x50\x44\x46\x55\x55\x55" # doesn't match any magic file numbers with self.assertRaises(ValueError): - poller = await client.recognize_content( + poller = await client.begin_recognize_content( damaged_pdf, ) + result = await poller.result() @GlobalFormRecognizerAccountPreparer() async def test_damaged_file_passed_as_bytes_io(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): client = FormRecognizerClient(form_recognizer_account, AzureKeyCredential(form_recognizer_account_key)) damaged_pdf = BytesIO(b"\x25\x50\x44\x46\x55\x55\x55") # still has correct bytes to be recognized as PDF with self.assertRaises(HttpResponseError): - poller = await client.recognize_content( + poller = await client.begin_recognize_content( damaged_pdf, ) + result = await poller.result() @GlobalFormRecognizerAccountPreparer() async def test_damaged_file_bytes_io_fails_autodetect(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): client = FormRecognizerClient(form_recognizer_account, AzureKeyCredential(form_recognizer_account_key)) damaged_pdf = BytesIO(b"\x50\x44\x46\x55\x55\x55") # doesn't match any magic file numbers with self.assertRaises(ValueError): - poller = await client.recognize_content( + poller = await client.begin_recognize_content( damaged_pdf, ) + result = await poller.result() @GlobalFormRecognizerAccountPreparer() async def test_blank_page(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): @@ -91,9 +100,10 @@ async def test_blank_page(self, resource_group, location, form_recognizer_accoun with open(self.blank_pdf, "rb") as fd: blank = fd.read() - result = await client.recognize_content( + poller = await client.begin_recognize_content( blank, ) + result = await poller.result() self.assertIsNotNone(result) @GlobalFormRecognizerAccountPreparer() @@ -102,17 +112,19 @@ async def test_passing_bad_content_type_param_passed(self, resource_group, locat with open(self.invoice_pdf, "rb") as fd: myfile = fd.read() with self.assertRaises(ValueError): - result = await client.recognize_content( + poller = await client.begin_recognize_content( myfile, content_type="application/jpeg" ) + result = await poller.result() @GlobalFormRecognizerAccountPreparer() async def test_content_stream_passing_url(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): client = FormRecognizerClient(form_recognizer_account, AzureKeyCredential(form_recognizer_account_key)) with self.assertRaises(TypeError): - result = await client.recognize_content("https://badurl.jpg", content_type="application/json") + poller = await client.begin_recognize_content("https://badurl.jpg", content_type="application/json") + result = await poller.result() @GlobalFormRecognizerAccountPreparer() async def test_auto_detect_unsupported_stream_content(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): @@ -122,9 +134,10 @@ async def test_auto_detect_unsupported_stream_content(self, resource_group, loca myfile = fd.read() with self.assertRaises(ValueError): - result = await client.recognize_content( + poller = await client.begin_recognize_content( myfile ) + result = await poller.result() @GlobalFormRecognizerAccountPreparer() async def test_content_stream_transform_pdf(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): @@ -140,7 +153,8 @@ def callback(raw_response, _, headers): responses.append(analyze_result) responses.append(extracted_layout) - result = await client.recognize_content(myform, cls=callback) + poller = await client.begin_recognize_content(myform, cls=callback) + result = await poller.result() raw_response = responses[0] layout = responses[1] page_results = raw_response.analyze_result.page_results @@ -156,7 +170,8 @@ async def test_content_stream_pdf(self, resource_group, location, form_recognize with open(self.invoice_pdf, "rb") as fd: myform = fd.read() - result = await client.recognize_content(myform) + poller = await client.begin_recognize_content(myform) + result = await poller.result() self.assertEqual(len(result), 1) layout = result[0] self.assertEqual(layout.page_number, 1) @@ -179,7 +194,8 @@ def callback(raw_response, _, headers): responses.append(analyze_result) responses.append(extracted_layout) - result = await client.recognize_content(myform, cls=callback) + poller = await client.begin_recognize_content(myform, cls=callback) + result = await poller.result() raw_response = responses[0] layout = responses[1] page_results = raw_response.analyze_result.page_results @@ -195,7 +211,8 @@ async def test_content_stream_jpg(self, resource_group, location, form_recognize with open(self.form_jpg, "rb") as fd: myform = fd.read() - result = await client.recognize_content(myform) + poller = await client.begin_recognize_content(myform) + result = await poller.result() self.assertEqual(len(result), 1) layout = result[0] self.assertEqual(layout.page_number, 1) @@ -212,7 +229,8 @@ async def test_content_multipage(self, resource_group, location, form_recognizer client = FormRecognizerClient(form_recognizer_account, AzureKeyCredential(form_recognizer_account_key)) with open(self.multipage_invoice_pdf, "rb") as fd: invoice = fd.read() - result = await client.recognize_content(invoice) + poller = await client.begin_recognize_content(invoice) + result = await poller.result() self.assertEqual(len(result), 3) self.assertFormPagesHasValues(result) @@ -231,7 +249,8 @@ def callback(raw_response, _, headers): responses.append(analyze_result) responses.append(extracted_layout) - result = await client.recognize_content(myform, cls=callback) + poller = await client.begin_recognize_content(myform, cls=callback) + result = await poller.result() raw_response = responses[0] layout = responses[1] page_results = raw_response.analyze_result.page_results @@ -239,3 +258,18 @@ def callback(raw_response, _, headers): # Check form pages self.assertFormPagesTransformCorrect(layout, read_results, page_results) + + @GlobalFormRecognizerAccountPreparer() + @pytest.mark.live_test_only + async def test_content_continuation_token(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): + client = FormRecognizerClient(form_recognizer_account, + AzureKeyCredential(form_recognizer_account_key)) + with open(self.form_jpg, "rb") as fd: + myfile = fd.read() + initial_poller = await client.begin_recognize_content(myfile) + cont_token = initial_poller.continuation_token() + + poller = await client.begin_recognize_content(myfile, continuation_token=cont_token) + result = await poller.result() + self.assertIsNotNone(result) + await initial_poller.wait() # necessary so azure-devtools doesn't throw assertion error diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content_from_url.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content_from_url.py index c1ecc4f496ba..20d2f4530136 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content_from_url.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content_from_url.py @@ -4,6 +4,7 @@ # Licensed under the MIT License. # ------------------------------------ +import pytest from azure.core.exceptions import HttpResponseError, ServiceRequestError, ClientAuthenticationError from azure.core.credentials import AzureKeyCredential from azure.ai.formrecognizer._generated.models import AnalyzeOperationResult @@ -152,3 +153,16 @@ def callback(raw_response, _, headers): # Check form pages self.assertFormPagesTransformCorrect(layout, read_results, page_results) + + @GlobalFormRecognizerAccountPreparer() + @pytest.mark.live_test_only + def test_content_continuation_token(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): + client = FormRecognizerClient(form_recognizer_account, + AzureKeyCredential(form_recognizer_account_key)) + initial_poller = client.begin_recognize_content_from_url(self.form_url_jpg) + cont_token = initial_poller.continuation_token() + + poller = client.begin_recognize_content_from_url(self.form_url_jpg, continuation_token=cont_token) + result = poller.result() + self.assertIsNotNone(result) + initial_poller.wait() # necessary so azure-devtools doesn't throw assertion error \ No newline at end of file diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content_from_url_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content_from_url_async.py index 7f4263dd312f..5003a63387d8 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content_from_url_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content_from_url_async.py @@ -4,6 +4,7 @@ # Licensed under the MIT License. # ------------------------------------ +import pytest from azure.core.exceptions import HttpResponseError, ServiceRequestError, ClientAuthenticationError from azure.core.credentials import AzureKeyCredential from azure.ai.formrecognizer._generated.models import AnalyzeOperationResult @@ -19,25 +20,29 @@ class TestContentFromUrlAsync(AsyncFormRecognizerTest): async def test_content_url_bad_endpoint(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): with self.assertRaises(ServiceRequestError): client = FormRecognizerClient("http://notreal.azure.com", AzureKeyCredential(form_recognizer_account_key)) - result = await client.recognize_content_from_url(self.invoice_url_pdf) + poller = await client.begin_recognize_content_from_url(self.invoice_url_pdf) + result = await poller.result() @GlobalFormRecognizerAccountPreparer() async def test_content_url_auth_successful_key(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): client = FormRecognizerClient(form_recognizer_account, AzureKeyCredential(form_recognizer_account_key)) - result = await client.recognize_content_from_url(self.invoice_url_pdf) + poller = await client.begin_recognize_content_from_url(self.invoice_url_pdf) + result = await poller.result() @GlobalFormRecognizerAccountPreparer() async def test_content_url_auth_bad_key(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): client = FormRecognizerClient(form_recognizer_account, AzureKeyCredential("xxxx")) with self.assertRaises(ClientAuthenticationError): - result = await client.recognize_content_from_url(self.invoice_url_pdf) + poller = await client.begin_recognize_content_from_url(self.invoice_url_pdf) + result = await poller.result() @GlobalFormRecognizerAccountPreparer() async def test_content_bad_url(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): client = FormRecognizerClient(form_recognizer_account, AzureKeyCredential(form_recognizer_account_key)) with self.assertRaises(HttpResponseError): - result = await client.recognize_content_from_url("https://badurl.jpg") + poller = await client.begin_recognize_content_from_url("https://badurl.jpg") + result = await poller.result() @GlobalFormRecognizerAccountPreparer() async def test_content_url_pass_stream(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): @@ -46,7 +51,8 @@ async def test_content_url_pass_stream(self, resource_group, location, form_reco receipt = fd.read(4) # makes the recording smaller with self.assertRaises(HttpResponseError): - result = await client.recognize_content_from_url(receipt) + poller = await client.begin_recognize_content_from_url(receipt) + result = await poller.result() @GlobalFormRecognizerAccountPreparer() async def test_content_url_transform_pdf(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): @@ -60,7 +66,8 @@ def callback(raw_response, _, headers): responses.append(analyze_result) responses.append(extracted_layout) - result = await client.recognize_content_from_url(self.invoice_url_pdf, cls=callback) + poller = await client.begin_recognize_content_from_url(self.invoice_url_pdf, cls=callback) + result = await poller.result() raw_response = responses[0] layout = responses[1] page_results = raw_response.analyze_result.page_results @@ -74,7 +81,8 @@ async def test_content_url_pdf(self, resource_group, location, form_recognizer_a client = FormRecognizerClient(form_recognizer_account, AzureKeyCredential(form_recognizer_account_key)) - result = await client.recognize_content_from_url(self.invoice_url_pdf) + poller = await client.begin_recognize_content_from_url(self.invoice_url_pdf) + result = await poller.result() self.assertEqual(len(result), 1) layout = result[0] self.assertEqual(layout.page_number, 1) @@ -95,7 +103,8 @@ def callback(raw_response, _, headers): responses.append(analyze_result) responses.append(extracted_layout) - result = await client.recognize_content_from_url(self.form_url_jpg, cls=callback) + poller = await client.begin_recognize_content_from_url(self.form_url_jpg, cls=callback) + result = await poller.result() raw_response = responses[0] layout = responses[1] page_results = raw_response.analyze_result.page_results @@ -109,7 +118,8 @@ async def test_content_url_jpg(self, resource_group, location, form_recognizer_a client = FormRecognizerClient(form_recognizer_account, AzureKeyCredential(form_recognizer_account_key)) - result = await client.recognize_content_from_url(self.form_url_jpg) + poller = await client.begin_recognize_content_from_url(self.form_url_jpg) + result = await poller.result() self.assertEqual(len(result), 1) layout = result[0] self.assertEqual(layout.page_number, 1) @@ -124,8 +134,8 @@ async def test_content_url_jpg(self, resource_group, location, form_recognizer_a @GlobalFormRecognizerAccountPreparer() async def test_content_multipage_url(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): client = FormRecognizerClient(form_recognizer_account, AzureKeyCredential(form_recognizer_account_key)) - result = await client.recognize_content_from_url(self.multipage_url_pdf) - + poller = await client.begin_recognize_content_from_url(self.multipage_url_pdf) + result = await poller.result() self.assertEqual(len(result), 3) self.assertFormPagesHasValues(result) @@ -140,7 +150,8 @@ def callback(raw_response, _, headers): responses.append(analyze_result) responses.append(extracted_layout) - result = await client.recognize_content_from_url(self.multipage_url_pdf, cls=callback) + poller = await client.begin_recognize_content_from_url(self.multipage_url_pdf, cls=callback) + result = await poller.result() raw_response = responses[0] layout = responses[1] page_results = raw_response.analyze_result.page_results @@ -148,3 +159,17 @@ def callback(raw_response, _, headers): # Check form pages self.assertFormPagesTransformCorrect(layout, read_results, page_results) + + @GlobalFormRecognizerAccountPreparer() + @pytest.mark.live_test_only + async def test_content_continuation_token(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): + client = FormRecognizerClient(form_recognizer_account, + AzureKeyCredential(form_recognizer_account_key)) + initial_poller = await client.begin_recognize_content_from_url(self.form_url_jpg) + cont_token = initial_poller.continuation_token() + + poller = await client.begin_recognize_content_from_url(self.form_url_jpg, continuation_token=cont_token) + result = await poller.result() + self.assertIsNotNone(result) + await initial_poller.wait() # necessary so azure-devtools doesn't throw assertion error + diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_copy_model.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_copy_model.py index c486ae3091ab..b5e2cedf9e38 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_copy_model.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_copy_model.py @@ -4,6 +4,7 @@ # Licensed under the MIT License. # ------------------------------------ +import pytest import functools from azure.core.exceptions import HttpResponseError from azure.ai.formrecognizer._generated.models import CopyOperationResult @@ -33,7 +34,7 @@ def test_copy_model_empty_model_id(self, client, container_sas_url): @GlobalTrainingAccountPreparer(copy=True) def test_copy_model_successful(self, client, container_sas_url, location, resource_id): - poller = client.begin_train_model(container_sas_url, use_training_labels=False) + poller = client.begin_training(container_sas_url, use_training_labels=False) model = poller.result() target = client.get_copy_authorization(resource_region=location, resource_id=resource_id) @@ -54,7 +55,7 @@ def test_copy_model_successful(self, client, container_sas_url, location, resour @GlobalTrainingAccountPreparer(copy=True) def test_copy_model_fail(self, client, container_sas_url, location, resource_id): - poller = client.begin_train_model(container_sas_url, use_training_labels=False) + poller = client.begin_training(container_sas_url, use_training_labels=False) model = poller.result() # give an incorrect region @@ -68,7 +69,7 @@ def test_copy_model_fail(self, client, container_sas_url, location, resource_id) @GlobalTrainingAccountPreparer(copy=True) def test_copy_model_transform(self, client, container_sas_url, location, resource_id): - poller = client.begin_train_model(container_sas_url, use_training_labels=False) + poller = client.begin_training(container_sas_url, use_training_labels=False) model = poller.result() target = client.get_copy_authorization(resource_region=location, resource_id=resource_id) @@ -102,3 +103,23 @@ def test_copy_authorization(self, client, container_sas_url, location, resource_ self.assertIsNotNone(target["expirationDateTimeTicks"]) self.assertEqual(target["resourceRegion"], "eastus") self.assertEqual(target["resourceId"], resource_id) + + @GlobalFormRecognizerAccountPreparer() + @GlobalTrainingAccountPreparer(copy=True) + @pytest.mark.live_test_only + def test_copy_continuation_token(self, client, container_sas_url, location, resource_id): + + poller = client.begin_training(container_sas_url, use_training_labels=False) + model = poller.result() + + target = client.get_copy_authorization(resource_region=location, resource_id=resource_id) + initial_poller = client.begin_copy_model(model.model_id, target=target) + cont_token = initial_poller.continuation_token() + + poller = client.begin_copy_model(model.model_id, target=target, continuation_token=cont_token) + result = poller.result() + self.assertIsNotNone(result) + + copied_model = client.get_custom_model(result.model_id) + self.assertIsNotNone(copied_model) + initial_poller.wait() # necessary so azure-devtools doesn't throw assertion error diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_copy_model_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_copy_model_async.py index 912712233b63..e9c12e069677 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_copy_model_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_copy_model_async.py @@ -4,6 +4,7 @@ # Licensed under the MIT License. # ------------------------------------ +import pytest import functools from azure.core.exceptions import HttpResponseError from azure.ai.formrecognizer._generated.models import CopyOperationResult @@ -22,23 +23,25 @@ class TestCopyModelAsync(AsyncFormRecognizerTest): @GlobalTrainingAccountPreparer() async def test_copy_model_none_model_id(self, client, container_sas_url): with self.assertRaises(ValueError): - await client.copy_model(model_id=None, target={}) + await client.begin_copy_model(model_id=None, target={}) @GlobalFormRecognizerAccountPreparer() @GlobalTrainingAccountPreparer() async def test_copy_model_empty_model_id(self, client, container_sas_url): with self.assertRaises(ValueError): - await client.copy_model(model_id="", target={}) + await client.begin_copy_model(model_id="", target={}) @GlobalFormRecognizerAccountPreparer() @GlobalTrainingAccountPreparer(copy=True) async def test_copy_model_successful(self, client, container_sas_url, location, resource_id): - model = await client.train_model(container_sas_url, use_training_labels=False) + training_poller = await client.begin_training(container_sas_url, use_training_labels=False) + model = await training_poller.result() target = await client.get_copy_authorization(resource_region=location, resource_id=resource_id) - copy = await client.copy_model(model.model_id, target=target) + copy_poller = await client.begin_copy_model(model.model_id, target=target) + copy = await copy_poller.result() copied_model = await client.get_custom_model(copy.model_id) @@ -53,19 +56,22 @@ async def test_copy_model_successful(self, client, container_sas_url, location, @GlobalTrainingAccountPreparer(copy=True) async def test_copy_model_fail(self, client, container_sas_url, location, resource_id): - model = await client.train_model(container_sas_url, use_training_labels=False) + training_poller = await client.begin_training(container_sas_url, use_training_labels=False) + model = await training_poller.result() # give an incorrect region target = await client.get_copy_authorization(resource_region="eastus", resource_id=resource_id) with self.assertRaises(HttpResponseError): - copy = await client.copy_model(model.model_id, target=target) + poller = await client.begin_copy_model(model.model_id, target=target) + copy = await poller.result() @GlobalFormRecognizerAccountPreparer() @GlobalTrainingAccountPreparer(copy=True) async def test_copy_model_transform(self, client, container_sas_url, location, resource_id): - model = await client.train_model(container_sas_url, use_training_labels=False) + training_poller = await client.begin_training(container_sas_url, use_training_labels=False) + model = await training_poller.result() target = await client.get_copy_authorization(resource_region=location, resource_id=resource_id) @@ -77,7 +83,8 @@ def callback(response, _, headers): raw_response.append(copy_result) raw_response.append(model_info) - copy = await client.copy_model(model.model_id, target=target, cls=callback) + poller = await client.begin_copy_model(model.model_id, target=target, cls=callback) + copy = await poller.result() actual = raw_response[0] copy = raw_response[1] @@ -97,3 +104,23 @@ async def test_copy_authorization(self, client, container_sas_url, location, res self.assertIsNotNone(target["expirationDateTimeTicks"]) self.assertEqual(target["resourceRegion"], "eastus") self.assertEqual(target["resourceId"], resource_id) + + @GlobalFormRecognizerAccountPreparer() + @GlobalTrainingAccountPreparer(copy=True) + @pytest.mark.live_test_only + async def test_copy_continuation_token(self, client, container_sas_url, location, resource_id): + + poller = await client.begin_training(container_sas_url, use_training_labels=False) + model = await poller.result() + + target = await client.get_copy_authorization(resource_region=location, resource_id=resource_id) + + initial_poller = await client.begin_copy_model(model.model_id, target=target) + cont_token = initial_poller.continuation_token() + poller = await client.begin_copy_model(model.model_id, target=target, continuation_token=cont_token) + result = await poller.result() + self.assertIsNotNone(result) + + copied_model = await client.get_custom_model(result.model_id) + self.assertIsNotNone(copied_model) + await initial_poller.wait() # necessary so azure-devtools doesn't throw assertion error diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_custom_forms.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_custom_forms.py index ff24a677056d..8af45e30c197 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_custom_forms.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_custom_forms.py @@ -4,6 +4,7 @@ # Licensed under the MIT License. # ------------------------------------ +import pytest import functools from azure.core.credentials import AzureKeyCredential from azure.core.exceptions import ServiceRequestError, ClientAuthenticationError, HttpResponseError @@ -70,7 +71,7 @@ def test_auto_detect_unsupported_stream_content(self, resource_group, location, def test_custom_form_damaged_file(self, client, container_sas_url): fr_client = client.get_form_recognizer_client() - poller = client.begin_train_model(container_sas_url, use_training_labels=False) + poller = client.begin_training(container_sas_url, use_training_labels=False) model = poller.result() with self.assertRaises(HttpResponseError): @@ -85,7 +86,7 @@ def test_custom_form_damaged_file(self, client, container_sas_url): def test_custom_form_unlabeled(self, client, container_sas_url): fr_client = client.get_form_recognizer_client() - poller = client.begin_train_model(container_sas_url, use_training_labels=False) + poller = client.begin_training(container_sas_url, use_training_labels=False) model = poller.result() with open(self.form_jpg, "rb") as stream: @@ -110,7 +111,7 @@ def test_custom_form_unlabeled(self, client, container_sas_url): def test_custom_form_multipage_unlabeled(self, client, container_sas_url): fr_client = client.get_form_recognizer_client() - poller = client.begin_train_model(container_sas_url, use_training_labels=False) + poller = client.begin_training(container_sas_url, use_training_labels=False) model = poller.result() with open(self.multipage_invoice_pdf, "rb") as stream: @@ -136,7 +137,7 @@ def test_custom_form_multipage_unlabeled(self, client, container_sas_url): def test_custom_form_labeled(self, client, container_sas_url): fr_client = client.get_form_recognizer_client() - poller = client.begin_train_model( + poller = client.begin_training( container_sas_url, use_training_labels=True ) @@ -161,7 +162,7 @@ def test_custom_form_labeled(self, client, container_sas_url): def test_custom_form_multipage_labeled(self, client, container_sas_url): fr_client = client.get_form_recognizer_client() - poller = client.begin_train_model( + poller = client.begin_training( container_sas_url, use_training_labels=True ) @@ -191,7 +192,7 @@ def test_custom_form_multipage_labeled(self, client, container_sas_url): def test_custom_form_unlabeled_transform(self, client, container_sas_url): fr_client = client.get_form_recognizer_client() - poller = client.begin_train_model(container_sas_url, use_training_labels=False) + poller = client.begin_training(container_sas_url, use_training_labels=False) model = poller.result() responses = [] @@ -228,7 +229,7 @@ def callback(raw_response, _, headers): def test_custom_form_multipage_unlabeled_transform(self, client, container_sas_url): fr_client = client.get_form_recognizer_client() - poller = client.begin_train_model(container_sas_url, use_training_labels=False) + poller = client.begin_training(container_sas_url, use_training_labels=False) model = poller.result() responses = [] @@ -266,7 +267,7 @@ def callback(raw_response, _, headers): def test_custom_form_labeled_transform(self, client, container_sas_url): fr_client = client.get_form_recognizer_client() - poller = client.begin_train_model(container_sas_url, use_training_labels=True) + poller = client.begin_training(container_sas_url, use_training_labels=True) model = poller.result() responses = [] @@ -303,7 +304,7 @@ def callback(raw_response, _, headers): def test_custom_form_multipage_labeled_transform(self, client, container_sas_url): fr_client = client.get_form_recognizer_client() - poller = client.begin_train_model(container_sas_url, use_training_labels=True) + poller = client.begin_training(container_sas_url, use_training_labels=True) model = poller.result() responses = [] @@ -336,3 +337,28 @@ def callback(raw_response, _, headers): self.assertEqual(form.page_range.last_page_number, actual.page_range[1]) self.assertEqual(form.form_type, "form-"+model.model_id) self.assertLabeledFormFieldDictTransformCorrect(form.fields, actual.fields, read_results) + + @GlobalFormRecognizerAccountPreparer() + @GlobalTrainingAccountPreparer() + @pytest.mark.live_test_only + def test_custom_form_continuation_token(self, client, container_sas_url): + fr_client = client.get_form_recognizer_client() + + poller = client.begin_training(container_sas_url, use_training_labels=False) + model = poller.result() + + with open(self.form_jpg, "rb") as fd: + myfile = fd.read() + initial_poller = fr_client.begin_recognize_custom_forms( + model.model_id, + myfile + ) + cont_token = initial_poller.continuation_token() + poller = fr_client.begin_recognize_custom_forms( + model.model_id, + myfile, + continuation_token=cont_token + ) + result = poller.result() + self.assertIsNotNone(result) + initial_poller.wait() # necessary so azure-devtools doesn't throw assertion error diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_custom_forms_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_custom_forms_async.py index 41de5f298b13..5987e72b254a 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_custom_forms_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_custom_forms_async.py @@ -4,6 +4,7 @@ # Licensed under the MIT License. # ------------------------------------ +import pytest import functools from azure.core.credentials import AzureKeyCredential from azure.core.exceptions import ServiceRequestError, ClientAuthenticationError, HttpResponseError @@ -25,13 +26,13 @@ class TestCustomFormsAsync(AsyncFormRecognizerTest): async def test_custom_form_none_model_id(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): client = FormRecognizerClient(form_recognizer_account, AzureKeyCredential(form_recognizer_account_key)) with self.assertRaises(ValueError): - await client.recognize_custom_forms(model_id=None, form=b"xx") + await client.begin_recognize_custom_forms(model_id=None, form=b"xx") @GlobalFormRecognizerAccountPreparer() async def test_custom_form_empty_model_id(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): client = FormRecognizerClient(form_recognizer_account, AzureKeyCredential(form_recognizer_account_key)) with self.assertRaises(ValueError): - await client.recognize_custom_forms(model_id="", form=b"xx") + await client.begin_recognize_custom_forms(model_id="", form=b"xx") @GlobalFormRecognizerAccountPreparer() async def test_custom_form_bad_endpoint(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): @@ -39,20 +40,23 @@ async def test_custom_form_bad_endpoint(self, resource_group, location, form_rec myfile = fd.read() with self.assertRaises(ServiceRequestError): client = FormRecognizerClient("http://notreal.azure.com", AzureKeyCredential(form_recognizer_account_key)) - result = await client.recognize_custom_forms(model_id="xx", form=myfile) + poller = await client.begin_recognize_custom_forms(model_id="xx", form=myfile) + result = await poller.result() @GlobalFormRecognizerAccountPreparer() async def test_authentication_bad_key(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): client = FormRecognizerClient(form_recognizer_account, AzureKeyCredential("xxxx")) with self.assertRaises(ClientAuthenticationError): - result = await client.recognize_custom_forms(model_id="xx", form=b"xx", content_type="image/jpeg") + poller = await client.begin_recognize_custom_forms(model_id="xx", form=b"xx", content_type="image/jpeg") + result = await poller.result() @GlobalFormRecognizerAccountPreparer() async def test_passing_unsupported_url_content_type(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): client = FormRecognizerClient(form_recognizer_account, AzureKeyCredential(form_recognizer_account_key)) with self.assertRaises(TypeError): - result = await client.recognize_custom_forms(model_id="xx", form="https://badurl.jpg", content_type="application/json") + poller = await client.begin_recognize_custom_forms(model_id="xx", form="https://badurl.jpg", content_type="application/json") + result = await poller.result() @GlobalFormRecognizerAccountPreparer() async def test_auto_detect_unsupported_stream_content(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): @@ -62,36 +66,40 @@ async def test_auto_detect_unsupported_stream_content(self, resource_group, loca myfile = fd.read() with self.assertRaises(ValueError): - poller = await client.recognize_custom_forms( + poller = await client.begin_recognize_custom_forms( model_id="xxx", form=myfile, ) + result = await poller.result() @GlobalFormRecognizerAccountPreparer() @GlobalTrainingAccountPreparer() async def test_custom_form_damaged_file(self, client, container_sas_url): fr_client = client.get_form_recognizer_client() - model = await client.train_model(container_sas_url, use_training_labels=False) + training_poller = await client.begin_training(container_sas_url, use_training_labels=False) + model = await training_poller.result() with self.assertRaises(HttpResponseError): - form = await fr_client.recognize_custom_forms( + poller = await fr_client.begin_recognize_custom_forms( model.model_id, b"\x25\x50\x44\x46\x55\x55\x55", ) + result = await poller.result() @GlobalFormRecognizerAccountPreparer() @GlobalTrainingAccountPreparer() async def test_custom_form_unlabeled(self, client, container_sas_url): fr_client = client.get_form_recognizer_client() - model = await client.train_model(container_sas_url, use_training_labels=False) + training_poller = await client.begin_training(container_sas_url, use_training_labels=False) + model = await training_poller.result() with open(self.form_jpg, "rb") as fd: myfile = fd.read() - form = await fr_client.recognize_custom_forms(model.model_id, myfile, content_type=FormContentType.image_jpeg) - + poller = await fr_client.begin_recognize_custom_forms(model.model_id, myfile, content_type=FormContentType.image_jpeg) + form = await poller.result() self.assertEqual(form[0].form_type, "form-0") self.assertFormPagesHasValues(form[0].pages) for label, field in form[0].fields.items(): @@ -106,15 +114,18 @@ async def test_custom_form_unlabeled(self, client, container_sas_url): async def test_custom_form_multipage_unlabeled(self, client, container_sas_url): fr_client = client.get_form_recognizer_client() - model = await client.train_model(container_sas_url, use_training_labels=False) + training_poller = await client.begin_training(container_sas_url, use_training_labels=False) + model = await training_poller.result() with open(self.multipage_invoice_pdf, "rb") as fd: myfile = fd.read() - forms = await fr_client.recognize_custom_forms( + + poller = await fr_client.begin_recognize_custom_forms( model.model_id, myfile, content_type=FormContentType.application_pdf ) + forms = await poller.result() for form in forms: self.assertEqual(form.form_type, "form-0") @@ -131,12 +142,14 @@ async def test_custom_form_multipage_unlabeled(self, client, container_sas_url): async def test_custom_form_labeled(self, client, container_sas_url): fr_client = client.get_form_recognizer_client() - model = await client.train_model(container_sas_url, use_training_labels=True) + training_poller = await client.begin_training(container_sas_url, use_training_labels=True) + model = await training_poller.result() with open(self.form_jpg, "rb") as fd: myfile = fd.read() - form = await fr_client.recognize_custom_forms(model.model_id, myfile, content_type=FormContentType.image_jpeg) + poller = await fr_client.begin_recognize_custom_forms(model.model_id, myfile, content_type=FormContentType.image_jpeg) + form = await poller.result() self.assertEqual(form[0].form_type, "form-"+model.model_id) self.assertFormPagesHasValues(form[0].pages) @@ -151,19 +164,21 @@ async def test_custom_form_labeled(self, client, container_sas_url): async def test_custom_form_multipage_labeled(self, client, container_sas_url): fr_client = client.get_form_recognizer_client() - model = await client.train_model( + training_poller = await client.begin_training( container_sas_url, use_training_labels=True ) + model = await training_poller.result() with open(self.multipage_invoice_pdf, "rb") as fd: myfile = fd.read() - forms = await fr_client.recognize_custom_forms( + poller = await fr_client.begin_recognize_custom_forms( model.model_id, myfile, content_type=FormContentType.application_pdf ) + forms = await poller.result() for form in forms: self.assertEqual(form.form_type, "form-"+model.model_id) @@ -180,7 +195,8 @@ async def test_custom_form_multipage_labeled(self, client, container_sas_url): async def test_form_unlabeled_transform(self, client, container_sas_url): fr_client = client.get_form_recognizer_client() - model = await client.train_model(container_sas_url, use_training_labels=False) + training_poller = await client.begin_training(container_sas_url, use_training_labels=False) + model = await training_poller.result() responses = [] @@ -193,12 +209,13 @@ def callback(raw_response, _, headers): with open(self.form_jpg, "rb") as fd: myfile = fd.read() - form = await fr_client.recognize_custom_forms( + poller = await fr_client.begin_recognize_custom_forms( model.model_id, myfile, include_text_content=True, cls=callback ) + form = await poller.result() actual = responses[0] recognized_form = responses[1] @@ -216,7 +233,8 @@ def callback(raw_response, _, headers): async def test_custom_forms_multipage_unlabeled_transform(self, client, container_sas_url): fr_client = client.get_form_recognizer_client() - model = await client.train_model(container_sas_url, use_training_labels=False) + training_poller = await client.begin_training(container_sas_url, use_training_labels=False) + model = await training_poller.result() responses = [] @@ -229,12 +247,13 @@ def callback(raw_response, _, headers): with open(self.multipage_invoice_pdf, "rb") as fd: myfile = fd.read() - form = await fr_client.recognize_custom_forms( + poller = await fr_client.begin_recognize_custom_forms( model.model_id, myfile, include_text_content=True, cls=callback ) + form = await poller.result() actual = responses[0] recognized_form = responses[1] read_results = actual.analyze_result.read_results @@ -254,7 +273,8 @@ def callback(raw_response, _, headers): async def test_form_labeled_transform(self, client, container_sas_url): fr_client = client.get_form_recognizer_client() - model = await client.train_model(container_sas_url, use_training_labels=True) + training_polling = await client.begin_training(container_sas_url, use_training_labels=True) + model = await training_polling.result() responses = [] @@ -267,12 +287,13 @@ def callback(raw_response, _, headers): with open(self.form_jpg, "rb") as fd: myfile = fd.read() - form = await fr_client.recognize_custom_forms( + poller = await fr_client.begin_recognize_custom_forms( model.model_id, myfile, include_text_content=True, cls=callback ) + form = await poller.result() actual = responses[0] recognized_form = responses[1] @@ -290,7 +311,8 @@ def callback(raw_response, _, headers): async def test_custom_forms_multipage_labeled_transform(self, client, container_sas_url): fr_client = client.get_form_recognizer_client() - model = await client.train_model(container_sas_url, use_training_labels=True) + training_poller = await client.begin_training(container_sas_url, use_training_labels=True) + model = await training_poller.result() responses = [] @@ -303,12 +325,14 @@ def callback(raw_response, _, headers): with open(self.multipage_invoice_pdf, "rb") as fd: myfile = fd.read() - form = await fr_client.recognize_custom_forms( + poller = await fr_client.begin_recognize_custom_forms( model.model_id, myfile, include_text_content=True, cls=callback ) + form = await poller.result() + actual = responses[0] recognized_form = responses[1] read_results = actual.analyze_result.read_results @@ -321,3 +345,29 @@ def callback(raw_response, _, headers): self.assertEqual(form.page_range.last_page_number, actual.page_range[1]) self.assertEqual(form.form_type, "form-"+model.model_id) self.assertLabeledFormFieldDictTransformCorrect(form.fields, actual.fields, read_results) + + @GlobalFormRecognizerAccountPreparer() + @GlobalTrainingAccountPreparer() + @pytest.mark.live_test_only + async def test_custom_form_continuation_token(self, client, container_sas_url): + fr_client = client.get_form_recognizer_client() + + poller = await client.begin_training(container_sas_url, use_training_labels=False) + model = await poller.result() + + with open(self.form_jpg, "rb") as fd: + myfile = fd.read() + initial_poller = await fr_client.begin_recognize_custom_forms( + model.model_id, + myfile + ) + + cont_token = initial_poller.continuation_token() + poller = await fr_client.begin_recognize_custom_forms( + model.model_id, + myfile, + continuation_token=cont_token + ) + result = await poller.result() + self.assertIsNotNone(result) + await initial_poller.wait() # necessary so azure-devtools doesn't throw assertion error diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_custom_forms_from_url.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_custom_forms_from_url.py index 1f4ae6f7c579..64bb51301377 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_custom_forms_from_url.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_custom_forms_from_url.py @@ -4,6 +4,7 @@ # Licensed under the MIT License. # ------------------------------------ +import pytest import functools from azure.core.credentials import AzureKeyCredential from azure.core.exceptions import HttpResponseError, ServiceRequestError, ClientAuthenticationError @@ -66,7 +67,7 @@ def test_pass_stream_into_url(self, resource_group, location, form_recognizer_ac def test_custom_form_bad_url(self, client, container_sas_url): fr_client = client.get_form_recognizer_client() - poller = client.begin_train_model(container_sas_url, use_training_labels=True) + poller = client.begin_training(container_sas_url, use_training_labels=True) model = poller.result() with self.assertRaises(HttpResponseError): @@ -81,7 +82,7 @@ def test_custom_form_bad_url(self, client, container_sas_url): def test_custom_form_unlabeled(self, client, container_sas_url): fr_client = client.get_form_recognizer_client() - poller = client.begin_train_model(container_sas_url, use_training_labels=False) + poller = client.begin_training(container_sas_url, use_training_labels=False) model = poller.result() poller = fr_client.begin_recognize_custom_forms_from_url(model.model_id, self.form_url_jpg) @@ -101,7 +102,7 @@ def test_custom_form_unlabeled(self, client, container_sas_url): def test_form_multipage_unlabeled(self, client, container_sas_url, blob_sas_url): fr_client = client.get_form_recognizer_client() - poller = client.begin_train_model(container_sas_url, use_training_labels=False) + poller = client.begin_training(container_sas_url, use_training_labels=False) model = poller.result() poller = fr_client.begin_recognize_custom_forms_from_url( @@ -125,7 +126,7 @@ def test_form_multipage_unlabeled(self, client, container_sas_url, blob_sas_url) def test_custom_form_labeled(self, client, container_sas_url): fr_client = client.get_form_recognizer_client() - poller = client.begin_train_model(container_sas_url, use_training_labels=True) + poller = client.begin_training(container_sas_url, use_training_labels=True) model = poller.result() poller = fr_client.begin_recognize_custom_forms_from_url(model.model_id, self.form_url_jpg) @@ -144,7 +145,7 @@ def test_custom_form_labeled(self, client, container_sas_url): def test_form_multipage_labeled(self, client, container_sas_url, blob_sas_url): fr_client = client.get_form_recognizer_client() - poller = client.begin_train_model( + poller = client.begin_training( container_sas_url, use_training_labels=True ) @@ -171,7 +172,7 @@ def test_form_multipage_labeled(self, client, container_sas_url, blob_sas_url): def test_custom_form_unlabeled_transform(self, client, container_sas_url): fr_client = client.get_form_recognizer_client() - poller = client.begin_train_model(container_sas_url, use_training_labels=False) + poller = client.begin_training(container_sas_url, use_training_labels=False) model = poller.result() responses = [] @@ -205,7 +206,7 @@ def callback(raw_response, _, headers): def test_custom_form_multipage_unlabeled_transform(self, client, container_sas_url, blob_sas_url): fr_client = client.get_form_recognizer_client() - poller = client.begin_train_model(container_sas_url, use_training_labels=False) + poller = client.begin_training(container_sas_url, use_training_labels=False) model = poller.result() responses = [] @@ -241,7 +242,7 @@ def callback(raw_response, _, headers): def test_form_labeled_transform(self, client, container_sas_url): fr_client = client.get_form_recognizer_client() - poller = client.begin_train_model(container_sas_url, use_training_labels=True) + poller = client.begin_training(container_sas_url, use_training_labels=True) model = poller.result() responses = [] @@ -275,7 +276,7 @@ def callback(raw_response, _, headers): def test_custom_form_multipage_labeled_transform(self, client, container_sas_url, blob_sas_url): fr_client = client.get_form_recognizer_client() - poller = client.begin_train_model(container_sas_url, use_training_labels=True) + poller = client.begin_training(container_sas_url, use_training_labels=True) model = poller.result() responses = [] @@ -305,3 +306,27 @@ def callback(raw_response, _, headers): self.assertEqual(form.page_range.last_page_number, actual.page_range[1]) self.assertEqual(form.form_type, "form-"+model.model_id) self.assertLabeledFormFieldDictTransformCorrect(form.fields, actual.fields, read_results) + + @GlobalFormRecognizerAccountPreparer() + @GlobalTrainingAccountPreparer() + @pytest.mark.live_test_only + def test_custom_form_continuation_token(self, client, container_sas_url): + fr_client = client.get_form_recognizer_client() + + training_poller = client.begin_training(container_sas_url, use_training_labels=False) + model = training_poller.result() + + initial_poller = fr_client.begin_recognize_custom_forms_from_url( + model.model_id, + self.form_url_jpg + ) + + cont_token = initial_poller.continuation_token() + poller = fr_client.begin_recognize_custom_forms_from_url( + model.model_id, + self.form_url_jpg, + continuation_token=cont_token + ) + result = poller.result() + self.assertIsNotNone(result) + initial_poller.wait() # necessary so azure-devtools doesn't throw assertion error diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_custom_forms_from_url_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_custom_forms_from_url_async.py index c9cb60da7656..92fc73345c89 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_custom_forms_from_url_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_custom_forms_from_url_async.py @@ -4,6 +4,7 @@ # Licensed under the MIT License. # ------------------------------------ +import pytest import functools from azure.core.credentials import AzureKeyCredential from azure.core.exceptions import HttpResponseError, ServiceRequestError, ClientAuthenticationError @@ -23,32 +24,35 @@ class TestCustomFormsFromUrlAsync(AsyncFormRecognizerTest): async def test_custom_form_none_model_id(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): client = FormRecognizerClient(form_recognizer_account, AzureKeyCredential(form_recognizer_account_key)) with self.assertRaises(ValueError): - await client.recognize_custom_forms_from_url(model_id=None, form_url="https://badurl.jpg") + await client.begin_recognize_custom_forms_from_url(model_id=None, form_url="https://badurl.jpg") @GlobalFormRecognizerAccountPreparer() async def test_custom_form_empty_model_id(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): client = FormRecognizerClient(form_recognizer_account, AzureKeyCredential(form_recognizer_account_key)) with self.assertRaises(ValueError): - await client.recognize_custom_forms_from_url(model_id="", form_url="https://badurl.jpg") + await client.begin_recognize_custom_forms_from_url(model_id="", form_url="https://badurl.jpg") @GlobalFormRecognizerAccountPreparer() async def test_custom_form_url_bad_endpoint(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): with self.assertRaises(ServiceRequestError): client = FormRecognizerClient("http://notreal.azure.com", AzureKeyCredential(form_recognizer_account_key)) - result = await client.recognize_custom_forms_from_url(model_id="xx", form_url=self.form_url_jpg) + poller = await client.begin_recognize_custom_forms_from_url(model_id="xx", form_url=self.form_url_jpg) + result = await poller.result() @GlobalFormRecognizerAccountPreparer() async def test_url_authentication_bad_key(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): client = FormRecognizerClient(form_recognizer_account, AzureKeyCredential("xxxx")) with self.assertRaises(ClientAuthenticationError): - result = await client.recognize_custom_forms_from_url(model_id="xx", form_url=self.form_url_jpg) + poller = await client.begin_recognize_custom_forms_from_url(model_id="xx", form_url=self.form_url_jpg) + result = await poller.result() @GlobalFormRecognizerAccountPreparer() async def test_passing_bad_url(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): client = FormRecognizerClient(form_recognizer_account, AzureKeyCredential(form_recognizer_account_key)) with self.assertRaises(HttpResponseError): - result = await client.recognize_custom_forms_from_url(model_id="xx", form_url="https://badurl.jpg") + poller = await client.begin_recognize_custom_forms_from_url(model_id="xx", form_url="https://badurl.jpg") + result = await poller.result() @GlobalFormRecognizerAccountPreparer() async def test_pass_stream_into_url(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): @@ -56,32 +60,37 @@ async def test_pass_stream_into_url(self, resource_group, location, form_recogni with open(self.unsupported_content_py, "rb") as fd: with self.assertRaises(HttpResponseError): - result = await client.recognize_custom_forms_from_url( + poller = await client.begin_recognize_custom_forms_from_url( model_id="xxx", form_url=fd, ) + result = await poller.result() @GlobalFormRecognizerAccountPreparer() @GlobalTrainingAccountPreparer() async def test_form_bad_url(self, client, container_sas_url): fr_client = client.get_form_recognizer_client() - model = await client.train_model(container_sas_url, use_training_labels=True) + training_poller = await client.begin_training(container_sas_url, use_training_labels=True) + model = await training_poller.result() with self.assertRaises(HttpResponseError): - form = await fr_client.recognize_custom_forms_from_url( + poller = await fr_client.begin_recognize_custom_forms_from_url( model.model_id, form_url="https://badurl.jpg" ) + result = await poller.result() @GlobalFormRecognizerAccountPreparer() @GlobalTrainingAccountPreparer() async def test_form_unlabeled(self, client, container_sas_url): fr_client = client.get_form_recognizer_client() - model = await client.train_model(container_sas_url, use_training_labels=False) + training_poller = await client.begin_training(container_sas_url, use_training_labels=False) + model = await training_poller.result() - form = await fr_client.recognize_custom_forms_from_url(model.model_id, self.form_url_jpg) + poller = await fr_client.begin_recognize_custom_forms_from_url(model.model_id, self.form_url_jpg) + form = await poller.result() self.assertEqual(form[0].form_type, "form-0") self.assertFormPagesHasValues(form[0].pages) @@ -97,12 +106,14 @@ async def test_form_unlabeled(self, client, container_sas_url): async def test_custom_form_multipage_unlabeled(self, client, container_sas_url, blob_sas_url): fr_client = client.get_form_recognizer_client() - model = await client.train_model(container_sas_url, use_training_labels=False) + training_poller = await client.begin_training(container_sas_url, use_training_labels=False) + model = await training_poller.result() - forms = await fr_client.recognize_custom_forms_from_url( + poller = await fr_client.begin_recognize_custom_forms_from_url( model.model_id, blob_sas_url, ) + forms = await poller.result() for form in forms: self.assertEqual(form.form_type, "form-0") @@ -119,9 +130,11 @@ async def test_custom_form_multipage_unlabeled(self, client, container_sas_url, async def test_form_labeled(self, client, container_sas_url): fr_client = client.get_form_recognizer_client() - model = await client.train_model(container_sas_url, use_training_labels=True) + training_poller = await client.begin_training(container_sas_url, use_training_labels=True) + model = await training_poller.result() - form = await fr_client.recognize_custom_forms_from_url(model.model_id, self.form_url_jpg) + poller = await fr_client.begin_recognize_custom_forms_from_url(model.model_id, self.form_url_jpg) + form = await poller.result() self.assertEqual(form[0].form_type, "form-"+model.model_id) self.assertFormPagesHasValues(form[0].pages) @@ -136,15 +149,17 @@ async def test_form_labeled(self, client, container_sas_url): async def test_form_multipage_labeled(self, client, container_sas_url, blob_sas_url): fr_client = client.get_form_recognizer_client() - model = await client.train_model( + training_poller = await client.begin_training( container_sas_url, use_training_labels=True ) + model = await training_poller.result() - forms = await fr_client.recognize_custom_forms_from_url( + poller = await fr_client.begin_recognize_custom_forms_from_url( model.model_id, blob_sas_url ) + forms = await poller.result() for form in forms: self.assertEqual(form.form_type, "form-"+model.model_id) @@ -160,7 +175,8 @@ async def test_form_multipage_labeled(self, client, container_sas_url, blob_sas_ async def test_form_unlabeled_transform(self, client, container_sas_url): fr_client = client.get_form_recognizer_client() - model = await client.train_model(container_sas_url, use_training_labels=False) + training_poller = await client.begin_training(container_sas_url, use_training_labels=False) + model = await training_poller.result() responses = [] @@ -170,12 +186,13 @@ def callback(raw_response, _, headers): responses.append(analyze_result) responses.append(form) - form = await fr_client.recognize_custom_forms_from_url( + poller = await fr_client.begin_recognize_custom_forms_from_url( model.model_id, self.form_url_jpg, include_text_content=True, cls=callback ) + form = await poller.result() actual = responses[0] recognized_form = responses[1] @@ -193,7 +210,8 @@ def callback(raw_response, _, headers): async def test_multipage_unlabeled_transform(self, client, container_sas_url, blob_sas_url): fr_client = client.get_form_recognizer_client() - model = await client.train_model(container_sas_url, use_training_labels=False) + training_poller = await client.begin_training(container_sas_url, use_training_labels=False) + model = await training_poller.result() responses = [] @@ -203,12 +221,14 @@ def callback(raw_response, _, headers): responses.append(analyze_result) responses.append(form) - form = await fr_client.recognize_custom_forms_from_url( + poller = await fr_client.begin_recognize_custom_forms_from_url( model.model_id, blob_sas_url, include_text_content=True, cls=callback ) + + form = await poller.result() actual = responses[0] recognized_form = responses[1] read_results = actual.analyze_result.read_results @@ -226,7 +246,8 @@ def callback(raw_response, _, headers): async def test_form_labeled_transform(self, client, container_sas_url): fr_client = client.get_form_recognizer_client() - model = await client.train_model(container_sas_url, use_training_labels=True) + training_poller = await client.begin_training(container_sas_url, use_training_labels=True) + model = await training_poller.result() responses = [] @@ -236,12 +257,13 @@ def callback(raw_response, _, headers): responses.append(analyze_result) responses.append(form) - form = await fr_client.recognize_custom_forms_from_url( + poller = await fr_client.begin_recognize_custom_forms_from_url( model.model_id, self.form_url_jpg, include_text_content=True, cls=callback ) + form = await poller.result() actual = responses[0] recognized_form = responses[1] @@ -259,7 +281,8 @@ def callback(raw_response, _, headers): async def test_multipage_labeled_transform(self, client, container_sas_url, blob_sas_url): fr_client = client.get_form_recognizer_client() - model = await client.train_model(container_sas_url, use_training_labels=True) + training_poller = await client.begin_training(container_sas_url, use_training_labels=True) + model = await training_poller.result() responses = [] @@ -269,12 +292,13 @@ def callback(raw_response, _, headers): responses.append(analyze_result) responses.append(form) - form = await fr_client.recognize_custom_forms_from_url( + poller = await fr_client.begin_recognize_custom_forms_from_url( model.model_id, blob_sas_url, include_text_content=True, cls=callback ) + form = await poller.result() actual = responses[0] recognized_form = responses[1] @@ -288,3 +312,26 @@ def callback(raw_response, _, headers): self.assertEqual(form.page_range.last_page_number, actual.page_range[1]) self.assertEqual(form.form_type, "form-"+model.model_id) self.assertLabeledFormFieldDictTransformCorrect(form.fields, actual.fields, read_results) + + @GlobalFormRecognizerAccountPreparer() + @GlobalTrainingAccountPreparer() + @pytest.mark.live_test_only + async def test_custom_form_continuation_token(self, client, container_sas_url): + fr_client = client.get_form_recognizer_client() + + poller = await client.begin_training(container_sas_url, use_training_labels=False) + model = await poller.result() + + initial_poller = await fr_client.begin_recognize_custom_forms_from_url( + model.model_id, + self.form_url_jpg + ) + cont_token = initial_poller.continuation_token() + poller = await fr_client.begin_recognize_custom_forms_from_url( + model.model_id, + self.form_url_jpg, + continuation_token=cont_token + ) + result = await poller.result() + self.assertIsNotNone(result) + await initial_poller.wait() # necessary so azure-devtools doesn't throw assertion error diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_mgmt.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_mgmt.py index efaf90c6e49b..0de73c057d2d 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_mgmt.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_mgmt.py @@ -80,7 +80,7 @@ def test_account_properties(self, resource_group, location, form_recognizer_acco @GlobalTrainingAccountPreparer() def test_mgmt_model_labeled(self, client, container_sas_url): - poller = client.begin_train_model(container_sas_url, use_training_labels=True) + poller = client.begin_training(container_sas_url, use_training_labels=True) labeled_model_from_train = poller.result() labeled_model_from_get = client.get_custom_model(labeled_model_from_train.model_id) @@ -116,7 +116,7 @@ def test_mgmt_model_labeled(self, client, container_sas_url): @GlobalTrainingAccountPreparer() def test_mgmt_model_unlabeled(self, client, container_sas_url): - poller = client.begin_train_model(container_sas_url, use_training_labels=False) + poller = client.begin_training(container_sas_url, use_training_labels=False) unlabeled_model_from_train = poller.result() unlabeled_model_from_get = client.get_custom_model(unlabeled_model_from_train.model_id) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_mgmt_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_mgmt_async.py index f0b65db830f2..a8d9791d4bd3 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_mgmt_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_mgmt_async.py @@ -81,8 +81,8 @@ async def test_account_properties(self, resource_group, location, form_recognize @GlobalTrainingAccountPreparer() async def test_mgmt_model_labeled(self, client, container_sas_url): - labeled_model_from_train = await client.train_model(container_sas_url, use_training_labels=True) - + poller = await client.begin_training(container_sas_url, use_training_labels=True) + labeled_model_from_train = await poller.result() labeled_model_from_get = await client.get_custom_model(labeled_model_from_train.model_id) self.assertEqual(labeled_model_from_train.model_id, labeled_model_from_get.model_id) @@ -115,8 +115,8 @@ async def test_mgmt_model_labeled(self, client, container_sas_url): @GlobalFormRecognizerAccountPreparer() @GlobalTrainingAccountPreparer() async def test_mgmt_model_unlabeled(self, client, container_sas_url): - unlabeled_model_from_train = await client.train_model(container_sas_url, use_training_labels=False) - + poller = await client.begin_training(container_sas_url, use_training_labels=False) + unlabeled_model_from_train = await poller.result() unlabeled_model_from_get = await client.get_custom_model(unlabeled_model_from_train.model_id) self.assertEqual(unlabeled_model_from_train.model_id, unlabeled_model_from_get.model_id) @@ -155,6 +155,6 @@ async def test_get_form_recognizer_client(self, resource_group, location, form_r assert transport.session is not None async with ftc.get_form_recognizer_client() as frc: assert transport.session is not None - await frc.recognize_receipts_from_url(self.receipt_url_jpg) + await frc.begin_recognize_receipts_from_url(self.receipt_url_jpg) await ftc.get_account_properties() assert transport.session is not None diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt.py index e7a605036e63..3814319cd13e 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt.py @@ -4,12 +4,13 @@ # Licensed under the MIT License. # ------------------------------------ +import pytest from io import BytesIO from datetime import date, time from azure.core.exceptions import ClientAuthenticationError, ServiceRequestError, HttpResponseError from azure.core.credentials import AzureKeyCredential from azure.ai.formrecognizer._generated.models import AnalyzeOperationResult -from azure.ai.formrecognizer._response_handlers import prepare_us_receipt +from azure.ai.formrecognizer._response_handlers import prepare_receipt from azure.ai.formrecognizer import FormRecognizerClient, FormContentType from testcase import FormRecognizerTest, GlobalFormRecognizerAccountPreparer @@ -136,7 +137,7 @@ def test_receipt_stream_transform_png(self, resource_group, location, form_recog def callback(raw_response, _, headers): analyze_result = client._client._deserialize(AnalyzeOperationResult, raw_response) - extracted_receipt = prepare_us_receipt(analyze_result) + extracted_receipt = prepare_receipt(analyze_result) responses.append(analyze_result) responses.append(extracted_receipt) @@ -157,17 +158,6 @@ def callback(raw_response, _, headers): read_results = raw_response.analyze_result.read_results document_results = raw_response.analyze_result.document_results - # check hardcoded values - self.assertFormFieldTransformCorrect(receipt.merchant_address, actual.get("MerchantAddress"), read_results) - self.assertFormFieldTransformCorrect(receipt.merchant_name, actual.get("MerchantName"), read_results) - self.assertFormFieldTransformCorrect(receipt.merchant_phone_number, actual.get("MerchantPhoneNumber"), read_results) - self.assertFormFieldTransformCorrect(receipt.subtotal, actual.get("Subtotal"), read_results) - self.assertFormFieldTransformCorrect(receipt.tax, actual.get("Tax"), read_results) - self.assertFormFieldTransformCorrect(receipt.tip, actual.get("Tip"), read_results) - self.assertFormFieldTransformCorrect(receipt.total, actual.get("Total"), read_results) - self.assertFormFieldTransformCorrect(receipt.transaction_date, actual.get("TransactionDate"), read_results) - self.assertFormFieldTransformCorrect(receipt.transaction_time, actual.get("TransactionTime"), read_results) - # check dict values self.assertFormFieldTransformCorrect(receipt.fields.get("MerchantAddress"), actual.get("MerchantAddress"), read_results) self.assertFormFieldTransformCorrect(receipt.fields.get("MerchantName"), actual.get("MerchantName"), read_results) @@ -184,11 +174,12 @@ def callback(raw_response, _, headers): self.assertEqual(receipt.page_range.last_page_number, document_results[0].page_range[1]) # check receipt type - self.assertEqual(receipt.receipt_type.confidence, actual["ReceiptType"].confidence) - self.assertEqual(receipt.receipt_type.type, actual["ReceiptType"].value_string) + receipt_type = receipt.fields.get("ReceiptType") + self.assertEqual(receipt_type.confidence, actual["ReceiptType"].confidence) + self.assertEqual(receipt_type.value, actual["ReceiptType"].value_string) # check receipt items - self.assertReceiptItemsTransformCorrect(receipt.receipt_items, actual["Items"], read_results) + self.assertReceiptItemsTransformCorrect(receipt.fields["Items"].value, actual["Items"], read_results) # Check page metadata self.assertFormPagesTransformCorrect(receipt.pages, read_results) @@ -201,7 +192,7 @@ def test_receipt_stream_transform_jpg(self, resource_group, location, form_recog def callback(raw_response, _, headers): analyze_result = client._client._deserialize(AnalyzeOperationResult, raw_response) - extracted_receipt = prepare_us_receipt(analyze_result) + extracted_receipt = prepare_receipt(analyze_result) responses.append(analyze_result) responses.append(extracted_receipt) @@ -223,17 +214,6 @@ def callback(raw_response, _, headers): document_results = raw_response.analyze_result.document_results page_results = raw_response.analyze_result.page_results - # check hardcoded values - self.assertFormFieldTransformCorrect(receipt.merchant_address, actual.get("MerchantAddress"), read_results) - self.assertFormFieldTransformCorrect(receipt.merchant_name, actual.get("MerchantName"), read_results) - self.assertFormFieldTransformCorrect(receipt.merchant_phone_number, actual.get("MerchantPhoneNumber"), read_results) - self.assertFormFieldTransformCorrect(receipt.subtotal, actual.get("Subtotal"), read_results) - self.assertFormFieldTransformCorrect(receipt.tax, actual.get("Tax"), read_results) - self.assertFormFieldTransformCorrect(receipt.tip, actual.get("Tip"), read_results) - self.assertFormFieldTransformCorrect(receipt.total, actual.get("Total"), read_results) - self.assertFormFieldTransformCorrect(receipt.transaction_date, actual.get("TransactionDate"), read_results) - self.assertFormFieldTransformCorrect(receipt.transaction_time, actual.get("TransactionTime"), read_results) - # check dict values self.assertFormFieldTransformCorrect(receipt.fields.get("MerchantAddress"), actual.get("MerchantAddress"), read_results) self.assertFormFieldTransformCorrect(receipt.fields.get("MerchantName"), actual.get("MerchantName"), read_results) @@ -250,11 +230,12 @@ def callback(raw_response, _, headers): self.assertEqual(receipt.page_range.last_page_number, document_results[0].page_range[1]) # check receipt type - self.assertEqual(receipt.receipt_type.confidence, actual["ReceiptType"].confidence) - self.assertEqual(receipt.receipt_type.type, actual["ReceiptType"].value_string) + receipt_type = receipt.fields.get("ReceiptType") + self.assertEqual(receipt_type.confidence, actual["ReceiptType"].confidence) + self.assertEqual(receipt_type.value, actual["ReceiptType"].value_string) # check receipt items - self.assertReceiptItemsTransformCorrect(receipt.receipt_items, actual["Items"], read_results) + self.assertReceiptItemsTransformCorrect(receipt.fields["Items"].value, actual["Items"], read_results) # Check form pages self.assertFormPagesTransformCorrect(receipt.pages, read_results) @@ -271,21 +252,22 @@ def test_receipt_jpg(self, resource_group, location, form_recognizer_account, fo result = poller.result() self.assertEqual(len(result), 1) receipt = result[0] - self.assertEqual(receipt.merchant_address.value, '123 Main Street Redmond, WA 98052') - self.assertEqual(receipt.merchant_name.value, 'Contoso Contoso') - self.assertEqual(receipt.merchant_phone_number.value, '+19876543210') - self.assertEqual(receipt.subtotal.value, 11.7) - self.assertEqual(receipt.tax.value, 1.17) - self.assertEqual(receipt.tip.value, 1.63) - self.assertEqual(receipt.total.value, 14.5) - self.assertEqual(receipt.transaction_date.value, date(year=2019, month=6, day=10)) - self.assertEqual(receipt.transaction_time.value, time(hour=13, minute=59, second=0)) + self.assertEqual(receipt.fields.get("MerchantAddress").value, '123 Main Street Redmond, WA 98052') + self.assertEqual(receipt.fields.get("MerchantName").value, 'Contoso Contoso') + self.assertEqual(receipt.fields.get("MerchantPhoneNumber").value, '+19876543210') + self.assertEqual(receipt.fields.get("Subtotal").value, 11.7) + self.assertEqual(receipt.fields.get("Tax").value, 1.17) + self.assertEqual(receipt.fields.get("Tip").value, 1.63) + self.assertEqual(receipt.fields.get("Total").value, 14.5) + self.assertEqual(receipt.fields.get("TransactionDate").value, date(year=2019, month=6, day=10)) + self.assertEqual(receipt.fields.get("TransactionTime").value, time(hour=13, minute=59, second=0)) self.assertEqual(receipt.page_range.first_page_number, 1) self.assertEqual(receipt.page_range.last_page_number, 1) self.assertFormPagesHasValues(receipt.pages) - self.assertIsNotNone(receipt.receipt_type.confidence) - self.assertEqual(receipt.receipt_type.type, 'Itemized') - self.assertReceiptItemsHasValues(receipt.receipt_items, receipt.page_range.first_page_number, False) + receipt_type = receipt.fields.get("ReceiptType") + self.assertIsNotNone(receipt_type.confidence) + self.assertEqual(receipt_type.value, 'Itemized') + self.assertReceiptItemsHasValues(receipt.fields['Items'].value, receipt.page_range.first_page_number, False) @GlobalFormRecognizerAccountPreparer() def test_receipt_png(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): @@ -297,18 +279,19 @@ def test_receipt_png(self, resource_group, location, form_recognizer_account, fo result = poller.result() self.assertEqual(len(result), 1) receipt = result[0] - self.assertEqual(receipt.merchant_address.value, '123 Main Street Redmond, WA 98052') - self.assertEqual(receipt.merchant_name.value, 'Contoso Contoso') - self.assertEqual(receipt.subtotal.value, 1098.99) - self.assertEqual(receipt.tax.value, 104.4) - self.assertEqual(receipt.total.value, 1203.39) - self.assertEqual(receipt.transaction_date.value, date(year=2019, month=6, day=10)) - self.assertEqual(receipt.transaction_time.value, time(hour=13, minute=59, second=0)) + self.assertEqual(receipt.fields.get("MerchantAddress").value, '123 Main Street Redmond, WA 98052') + self.assertEqual(receipt.fields.get("MerchantName").value, 'Contoso Contoso') + self.assertEqual(receipt.fields.get("Subtotal").value, 1098.99) + self.assertEqual(receipt.fields.get("Tax").value, 104.4) + self.assertEqual(receipt.fields.get("Total").value, 1203.39) + self.assertEqual(receipt.fields.get("TransactionDate").value, date(year=2019, month=6, day=10)) + self.assertEqual(receipt.fields.get("TransactionTime").value, time(hour=13, minute=59, second=0)) self.assertEqual(receipt.page_range.first_page_number, 1) self.assertEqual(receipt.page_range.last_page_number, 1) self.assertFormPagesHasValues(receipt.pages) - self.assertIsNotNone(receipt.receipt_type.confidence) - self.assertEqual(receipt.receipt_type.type, 'Itemized') + receipt_type = receipt.fields.get("ReceiptType") + self.assertIsNotNone(receipt_type.confidence) + self.assertEqual(receipt_type.value, 'Itemized') @GlobalFormRecognizerAccountPreparer() def test_receipt_jpg_include_text_content(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): @@ -323,7 +306,7 @@ def test_receipt_jpg_include_text_content(self, resource_group, location, form_r self.assertFormPagesHasValues(receipt.pages) for field, value in receipt.__dict__.items(): - if field not in ["receipt_type", "receipt_items", "page_range", "pages", "fields", "form_type", "receipt_locale"]: + if field not in ["receipt_items", "page_range", "pages", "fields", "form_type"]: form_field = getattr(receipt, field) self.assertTextContentHasValues(form_field.value_data.text_content, receipt.page_range.first_page_number) @@ -340,27 +323,29 @@ def test_receipt_multipage(self, resource_group, location, form_recognizer_accou self.assertEqual(len(result), 3) receipt = result[0] - self.assertEqual(receipt.merchant_address.value, '123 Hobbit Lane 567 Main St. Redmond, WA Redmond, WA') - self.assertEqual(receipt.merchant_name.value, 'Bilbo Baggins') - self.assertEqual(receipt.merchant_phone_number.value, '+15555555555') - self.assertEqual(receipt.subtotal.value, 300.0) - self.assertEqual(receipt.total.value, 100.0) + self.assertEqual(receipt.fields.get("MerchantAddress").value, '123 Hobbit Lane 567 Main St. Redmond, WA Redmond, WA') + self.assertEqual(receipt.fields.get("MerchantName").value, 'Bilbo Baggins') + self.assertEqual(receipt.fields.get("MerchantPhoneNumber").value, '+15555555555') + self.assertEqual(receipt.fields.get("Subtotal").value, 300.0) + self.assertEqual(receipt.fields.get("Total").value, 100.0) self.assertEqual(receipt.page_range.first_page_number, 1) self.assertEqual(receipt.page_range.last_page_number, 1) self.assertFormPagesHasValues(receipt.pages) - self.assertIsNotNone(receipt.receipt_type.confidence) - self.assertEqual(receipt.receipt_type.type, 'Itemized') + receipt_type = receipt.fields.get("ReceiptType") + self.assertIsNotNone(receipt_type.confidence) + self.assertEqual(receipt_type.value, 'Itemized') receipt = result[2] - self.assertEqual(receipt.merchant_address.value, '123 Hobbit Lane 567 Main St. Redmond, WA Redmond, WA') - self.assertEqual(receipt.merchant_name.value, 'Frodo Baggins') - self.assertEqual(receipt.merchant_phone_number.value, '+15555555555') - self.assertEqual(receipt.subtotal.value, 3000.0) - self.assertEqual(receipt.total.value, 1000.0) + self.assertEqual(receipt.fields.get("MerchantAddress").value, '123 Hobbit Lane 567 Main St. Redmond, WA Redmond, WA') + self.assertEqual(receipt.fields.get("MerchantName").value, 'Frodo Baggins') + self.assertEqual(receipt.fields.get("MerchantPhoneNumber").value, '+15555555555') + self.assertEqual(receipt.fields.get("Subtotal").value, 3000.0) + self.assertEqual(receipt.fields.get("Total").value, 1000.0) self.assertEqual(receipt.page_range.first_page_number, 3) self.assertEqual(receipt.page_range.last_page_number, 3) self.assertFormPagesHasValues(receipt.pages) - self.assertIsNotNone(receipt.receipt_type.confidence) - self.assertEqual(receipt.receipt_type.type, 'Itemized') + receipt_type = receipt.fields.get("ReceiptType") + self.assertIsNotNone(receipt_type.confidence) + self.assertEqual(receipt_type.value, 'Itemized') @GlobalFormRecognizerAccountPreparer() def test_receipt_multipage_transform(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): @@ -370,7 +355,7 @@ def test_receipt_multipage_transform(self, resource_group, location, form_recogn def callback(raw_response, _, headers): analyze_result = client._client._deserialize(AnalyzeOperationResult, raw_response) - extracted_receipt = prepare_us_receipt(analyze_result) + extracted_receipt = prepare_receipt(analyze_result) responses.append(analyze_result) responses.append(extracted_receipt) @@ -395,15 +380,6 @@ def callback(raw_response, _, headers): for receipt, actual in zip(returned_model, actual): if actual.fields is None: # second page is blank continue - self.assertFormFieldTransformCorrect(receipt.merchant_address, actual.fields.get("MerchantAddress"), read_results) - self.assertFormFieldTransformCorrect(receipt.merchant_name, actual.fields.get("MerchantName"), read_results) - self.assertFormFieldTransformCorrect(receipt.merchant_phone_number, actual.fields.get("MerchantPhoneNumber"), read_results) - self.assertFormFieldTransformCorrect(receipt.subtotal, actual.fields.get("Subtotal"), read_results) - self.assertFormFieldTransformCorrect(receipt.tax, actual.fields.get("Tax"), read_results) - self.assertFormFieldTransformCorrect(receipt.tip, actual.fields.get("Tip"), read_results) - self.assertFormFieldTransformCorrect(receipt.total, actual.fields.get("Total"), read_results) - self.assertFormFieldTransformCorrect(receipt.transaction_date, actual.fields.get("TransactionDate"), read_results) - self.assertFormFieldTransformCorrect(receipt.transaction_time, actual.fields.get("TransactionTime"), read_results) # check dict values self.assertFormFieldTransformCorrect(receipt.fields.get("MerchantAddress"), actual.fields.get("MerchantAddress"), read_results) @@ -421,11 +397,27 @@ def callback(raw_response, _, headers): self.assertEqual(receipt.page_range.last_page_number, actual.page_range[1]) # check receipt type - self.assertEqual(receipt.receipt_type.confidence, actual.fields["ReceiptType"].confidence) - self.assertEqual(receipt.receipt_type.type, actual.fields["ReceiptType"].value_string) + receipt_type = receipt.fields.get("ReceiptType") + self.assertEqual(receipt_type.confidence, actual.fields["ReceiptType"].confidence) + self.assertEqual(receipt_type.value, actual.fields["ReceiptType"].value_string) # check receipt items - self.assertReceiptItemsTransformCorrect(receipt.receipt_items, actual.fields["Items"], read_results) + self.assertReceiptItemsTransformCorrect(receipt.fields["Items"].value, actual.fields["Items"], read_results) # Check form pages self.assertFormPagesTransformCorrect(returned_model, read_results) + + @GlobalFormRecognizerAccountPreparer() + @pytest.mark.live_test_only + def test_receipt_continuation_token(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): + client = FormRecognizerClient(form_recognizer_account, AzureKeyCredential(form_recognizer_account_key)) + + with open(self.receipt_jpg, "rb") as fd: + receipt = fd.read() + + initial_poller = client.begin_recognize_receipts(receipt) + cont_token = initial_poller.continuation_token() + poller = client.begin_recognize_receipts(receipt, continuation_token=cont_token) + result = poller.result() + self.assertIsNotNone(result) + initial_poller.wait() # necessary so azure-devtools doesn't throw assertion error diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_async.py index f496ee796fb5..79601625d9f4 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_async.py @@ -4,12 +4,13 @@ # Licensed under the MIT License. # ------------------------------------ +import pytest from io import BytesIO from datetime import date, time from azure.core.exceptions import ServiceRequestError, ClientAuthenticationError, HttpResponseError from azure.core.credentials import AzureKeyCredential from azure.ai.formrecognizer._generated.models import AnalyzeOperationResult -from azure.ai.formrecognizer._response_handlers import prepare_us_receipt +from azure.ai.formrecognizer._response_handlers import prepare_receipt from azure.ai.formrecognizer.aio import FormRecognizerClient from azure.ai.formrecognizer import FormContentType from testcase import GlobalFormRecognizerAccountPreparer @@ -24,30 +25,34 @@ async def test_receipt_bad_endpoint(self, resource_group, location, form_recogni myfile = fd.read() with self.assertRaises(ServiceRequestError): client = FormRecognizerClient("http://notreal.azure.com", AzureKeyCredential(form_recognizer_account_key)) - result = await client.recognize_receipts(myfile) + poller = await client.begin_recognize_receipts(myfile) + result = await poller.result() @GlobalFormRecognizerAccountPreparer() async def test_authentication_successful_key(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): client = FormRecognizerClient(form_recognizer_account, AzureKeyCredential(form_recognizer_account_key)) with open(self.receipt_jpg, "rb") as fd: myfile = fd.read() - result = await client.recognize_receipts(myfile) + poller = await client.begin_recognize_receipts(myfile) + result = await poller.result() @GlobalFormRecognizerAccountPreparer() async def test_authentication_bad_key(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): client = FormRecognizerClient(form_recognizer_account, AzureKeyCredential("xxxx")) with self.assertRaises(ClientAuthenticationError): - result = await client.recognize_receipts(b"xx", content_type="image/jpeg") + poller = await client.begin_recognize_receipts(b"xx", content_type="image/jpeg") + result = await poller.result() @GlobalFormRecognizerAccountPreparer() async def test_passing_enum_content_type(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): client = FormRecognizerClient(form_recognizer_account, AzureKeyCredential(form_recognizer_account_key)) with open(self.receipt_png, "rb") as fd: myfile = fd.read() - result = await client.recognize_receipts( + poller = await client.begin_recognize_receipts( myfile, content_type=FormContentType.image_png ) + result = await poller.result() self.assertIsNotNone(result) @GlobalFormRecognizerAccountPreparer() @@ -55,36 +60,40 @@ async def test_damaged_file_passed_as_bytes(self, resource_group, location, form client = FormRecognizerClient(form_recognizer_account, AzureKeyCredential(form_recognizer_account_key)) damaged_pdf = b"\x25\x50\x44\x46\x55\x55\x55" # still has correct bytes to be recognized as PDF with self.assertRaises(HttpResponseError): - poller = await client.recognize_receipts( + poller = await client.begin_recognize_receipts( damaged_pdf, ) + result = await poller.result() @GlobalFormRecognizerAccountPreparer() async def test_damaged_file_bytes_fails_autodetect_content_type(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): client = FormRecognizerClient(form_recognizer_account, AzureKeyCredential(form_recognizer_account_key)) damaged_pdf = b"\x50\x44\x46\x55\x55\x55" # doesn't match any magic file numbers with self.assertRaises(ValueError): - poller = await client.recognize_receipts( + poller = await client.begin_recognize_receipts( damaged_pdf, ) + result = await poller.result() @GlobalFormRecognizerAccountPreparer() async def test_damaged_file_passed_as_bytes_io(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): client = FormRecognizerClient(form_recognizer_account, AzureKeyCredential(form_recognizer_account_key)) damaged_pdf = BytesIO(b"\x25\x50\x44\x46\x55\x55\x55") # still has correct bytes to be recognized as PDF with self.assertRaises(HttpResponseError): - poller = await client.recognize_receipts( + poller = await client.begin_recognize_receipts( damaged_pdf, ) + result = await poller.result() @GlobalFormRecognizerAccountPreparer() async def test_damaged_file_bytes_io_fails_autodetect(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): client = FormRecognizerClient(form_recognizer_account, AzureKeyCredential(form_recognizer_account_key)) damaged_pdf = BytesIO(b"\x50\x44\x46\x55\x55\x55") # doesn't match any magic file numbers with self.assertRaises(ValueError): - poller = await client.recognize_receipts( + poller = await client.begin_recognize_receipts( damaged_pdf, ) + result = await poller.result() @GlobalFormRecognizerAccountPreparer() async def test_blank_page(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): @@ -92,9 +101,10 @@ async def test_blank_page(self, resource_group, location, form_recognizer_accoun with open(self.blank_pdf, "rb") as fd: blank = fd.read() - result = await client.recognize_receipts( + poller = await client.begin_recognize_receipts( blank, ) + result = await poller.result() self.assertIsNotNone(result) @GlobalFormRecognizerAccountPreparer() @@ -103,17 +113,19 @@ async def test_passing_bad_content_type_param_passed(self, resource_group, locat with open(self.receipt_jpg, "rb") as fd: myfile = fd.read() with self.assertRaises(ValueError): - result = await client.recognize_receipts( + poller = await client.begin_recognize_receipts( myfile, content_type="application/jpeg" ) + result = await poller.result() @GlobalFormRecognizerAccountPreparer() async def test_passing_unsupported_url_content_type(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): client = FormRecognizerClient(form_recognizer_account, AzureKeyCredential(form_recognizer_account_key)) with self.assertRaises(TypeError): - result = await client.recognize_receipts("https://badurl.jpg", content_type="application/json") + poller = await client.begin_recognize_receipts("https://badurl.jpg", content_type="application/json") + result = await poller.result() @GlobalFormRecognizerAccountPreparer() async def test_auto_detect_unsupported_stream_content(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): @@ -123,9 +135,10 @@ async def test_auto_detect_unsupported_stream_content(self, resource_group, loca myfile = fd.read() with self.assertRaises(ValueError): - result = await client.recognize_receipts( + poller = await client.begin_recognize_receipts( myfile, ) + result = await poller.result() @GlobalFormRecognizerAccountPreparer() async def test_receipt_stream_transform_png(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): @@ -135,18 +148,19 @@ async def test_receipt_stream_transform_png(self, resource_group, location, form def callback(raw_response, _, headers): analyze_result = client._client._deserialize(AnalyzeOperationResult, raw_response) - extracted_receipt = prepare_us_receipt(analyze_result) + extracted_receipt = prepare_receipt(analyze_result) responses.append(analyze_result) responses.append(extracted_receipt) with open(self.receipt_png, "rb") as fd: myfile = fd.read() - result = await client.recognize_receipts( + poller = await client.begin_recognize_receipts( receipt=myfile, include_text_content=True, cls=callback ) + result = await poller.result() raw_response = responses[0] returned_model = responses[1] @@ -155,17 +169,6 @@ def callback(raw_response, _, headers): read_results = raw_response.analyze_result.read_results document_results = raw_response.analyze_result.document_results - # check hardcoded values - self.assertFormFieldTransformCorrect(receipt.merchant_address, actual.get("MerchantAddress"), read_results) - self.assertFormFieldTransformCorrect(receipt.merchant_name, actual.get("MerchantName"), read_results) - self.assertFormFieldTransformCorrect(receipt.merchant_phone_number, actual.get("MerchantPhoneNumber"), read_results) - self.assertFormFieldTransformCorrect(receipt.subtotal, actual.get("Subtotal"), read_results) - self.assertFormFieldTransformCorrect(receipt.tax, actual.get("Tax"), read_results) - self.assertFormFieldTransformCorrect(receipt.tip, actual.get("Tip"), read_results) - self.assertFormFieldTransformCorrect(receipt.total, actual.get("Total"), read_results) - self.assertFormFieldTransformCorrect(receipt.transaction_date, actual.get("TransactionDate"), read_results) - self.assertFormFieldTransformCorrect(receipt.transaction_time, actual.get("TransactionTime"), read_results) - # check dict values self.assertFormFieldTransformCorrect(receipt.fields.get("MerchantAddress"), actual.get("MerchantAddress"), read_results) self.assertFormFieldTransformCorrect(receipt.fields.get("MerchantName"), actual.get("MerchantName"), read_results) @@ -182,11 +185,12 @@ def callback(raw_response, _, headers): self.assertEqual(receipt.page_range.last_page_number, document_results[0].page_range[1]) # check receipt type - self.assertEqual(receipt.receipt_type.confidence, actual["ReceiptType"].confidence) - self.assertEqual(receipt.receipt_type.type, actual["ReceiptType"].value_string) + receipt_type = receipt.fields.get("ReceiptType") + self.assertEqual(receipt_type.confidence, actual["ReceiptType"].confidence) + self.assertEqual(receipt_type.value, actual["ReceiptType"].value_string) # check receipt items - self.assertReceiptItemsTransformCorrect(receipt.receipt_items, actual["Items"], read_results) + self.assertReceiptItemsTransformCorrect(receipt.fields["Items"].value, actual["Items"], read_results) # Check page metadata self.assertFormPagesTransformCorrect(receipt.pages, read_results) @@ -199,18 +203,19 @@ async def test_receipt_stream_transform_jpg(self, resource_group, location, form def callback(raw_response, _, headers): analyze_result = client._client._deserialize(AnalyzeOperationResult, raw_response) - extracted_receipt = prepare_us_receipt(analyze_result) + extracted_receipt = prepare_receipt(analyze_result) responses.append(analyze_result) responses.append(extracted_receipt) with open(self.receipt_jpg, "rb") as fd: myfile = fd.read() - result = await client.recognize_receipts( + poller = await client.begin_recognize_receipts( receipt=myfile, include_text_content=True, cls=callback ) + result = await poller.result() raw_response = responses[0] returned_model = responses[1] @@ -220,17 +225,6 @@ def callback(raw_response, _, headers): document_results = raw_response.analyze_result.document_results page_results = raw_response.analyze_result.page_results - # check hardcoded values - self.assertFormFieldTransformCorrect(receipt.merchant_address, actual.get("MerchantAddress"), read_results) - self.assertFormFieldTransformCorrect(receipt.merchant_name, actual.get("MerchantName"), read_results) - self.assertFormFieldTransformCorrect(receipt.merchant_phone_number, actual.get("MerchantPhoneNumber"), read_results) - self.assertFormFieldTransformCorrect(receipt.subtotal, actual.get("Subtotal"), read_results) - self.assertFormFieldTransformCorrect(receipt.tax, actual.get("Tax"), read_results) - self.assertFormFieldTransformCorrect(receipt.tip, actual.get("Tip"), read_results) - self.assertFormFieldTransformCorrect(receipt.total, actual.get("Total"), read_results) - self.assertFormFieldTransformCorrect(receipt.transaction_date, actual.get("TransactionDate"), read_results) - self.assertFormFieldTransformCorrect(receipt.transaction_time, actual.get("TransactionTime"), read_results) - # check dict values self.assertFormFieldTransformCorrect(receipt.fields.get("MerchantAddress"), actual.get("MerchantAddress"), read_results) self.assertFormFieldTransformCorrect(receipt.fields.get("MerchantName"), actual.get("MerchantName"), read_results) @@ -247,11 +241,12 @@ def callback(raw_response, _, headers): self.assertEqual(receipt.page_range.last_page_number, document_results[0].page_range[1]) # check receipt type - self.assertEqual(receipt.receipt_type.confidence, actual["ReceiptType"].confidence) - self.assertEqual(receipt.receipt_type.type, actual["ReceiptType"].value_string) + receipt_type = receipt.fields.get("ReceiptType") + self.assertEqual(receipt_type.confidence, actual["ReceiptType"].confidence) + self.assertEqual(receipt_type.value, actual["ReceiptType"].value_string) # check receipt items - self.assertReceiptItemsTransformCorrect(receipt.receipt_items, actual["Items"], read_results) + self.assertReceiptItemsTransformCorrect(receipt.fields["Items"].value, actual["Items"], read_results) # Check form pages self.assertFormPagesTransformCorrect(receipt.pages, read_results) @@ -263,25 +258,27 @@ async def test_receipt_jpg(self, resource_group, location, form_recognizer_accou with open(self.receipt_jpg, "rb") as fd: receipt = fd.read() - result = await client.recognize_receipts(receipt) + poller = await client.begin_recognize_receipts(receipt) + result = await poller.result() self.assertEqual(len(result), 1) receipt = result[0] - self.assertEqual(receipt.merchant_address.value, '123 Main Street Redmond, WA 98052') - self.assertEqual(receipt.merchant_name.value, 'Contoso Contoso') - self.assertEqual(receipt.merchant_phone_number.value, '+19876543210') - self.assertEqual(receipt.subtotal.value, 11.7) - self.assertEqual(receipt.tax.value, 1.17) - self.assertEqual(receipt.tip.value, 1.63) - self.assertEqual(receipt.total.value, 14.5) - self.assertEqual(receipt.transaction_date.value, date(year=2019, month=6, day=10)) - self.assertEqual(receipt.transaction_time.value, time(hour=13, minute=59, second=0)) + self.assertEqual(receipt.fields.get("MerchantAddress").value, '123 Main Street Redmond, WA 98052') + self.assertEqual(receipt.fields.get("MerchantName").value, 'Contoso Contoso') + self.assertEqual(receipt.fields.get("MerchantPhoneNumber").value, '+19876543210') + self.assertEqual(receipt.fields.get("Subtotal").value, 11.7) + self.assertEqual(receipt.fields.get("Tax").value, 1.17) + self.assertEqual(receipt.fields.get("Tip").value, 1.63) + self.assertEqual(receipt.fields.get("Total").value, 14.5) + self.assertEqual(receipt.fields.get("TransactionDate").value, date(year=2019, month=6, day=10)) + self.assertEqual(receipt.fields.get("TransactionTime").value, time(hour=13, minute=59, second=0)) self.assertEqual(receipt.page_range.first_page_number, 1) self.assertEqual(receipt.page_range.last_page_number, 1) self.assertFormPagesHasValues(receipt.pages) - self.assertIsNotNone(receipt.receipt_type.confidence) - self.assertEqual(receipt.receipt_type.type, 'Itemized') - self.assertReceiptItemsHasValues(receipt.receipt_items, receipt.page_range.first_page_number, False) + receipt_type = receipt.fields.get("ReceiptType") + self.assertIsNotNone(receipt_type.confidence) + self.assertEqual(receipt_type.value, 'Itemized') + self.assertReceiptItemsHasValues(receipt.fields["Items"].value, receipt.page_range.first_page_number, False) @GlobalFormRecognizerAccountPreparer() async def test_receipt_png(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): @@ -290,35 +287,38 @@ async def test_receipt_png(self, resource_group, location, form_recognizer_accou with open(self.receipt_png, "rb") as fd: receipt = fd.read() - result = await client.recognize_receipts(receipt) + poller = await client.begin_recognize_receipts(receipt) + result = await poller.result() self.assertEqual(len(result), 1) receipt = result[0] - self.assertEqual(receipt.merchant_address.value, '123 Main Street Redmond, WA 98052') - self.assertEqual(receipt.merchant_name.value, 'Contoso Contoso') - self.assertEqual(receipt.subtotal.value, 1098.99) - self.assertEqual(receipt.tax.value, 104.4) - self.assertEqual(receipt.total.value, 1203.39) - self.assertEqual(receipt.transaction_date.value, date(year=2019, month=6, day=10)) - self.assertEqual(receipt.transaction_time.value, time(hour=13, minute=59, second=0)) + self.assertEqual(receipt.fields.get("MerchantAddress").value, '123 Main Street Redmond, WA 98052') + self.assertEqual(receipt.fields.get("MerchantName").value, 'Contoso Contoso') + self.assertEqual(receipt.fields.get("Subtotal").value, 1098.99) + self.assertEqual(receipt.fields.get("Tax").value, 104.4) + self.assertEqual(receipt.fields.get("Total").value, 1203.39) + self.assertEqual(receipt.fields.get("TransactionDate").value, date(year=2019, month=6, day=10)) + self.assertEqual(receipt.fields.get("TransactionTime").value, time(hour=13, minute=59, second=0)) self.assertEqual(receipt.page_range.first_page_number, 1) self.assertEqual(receipt.page_range.last_page_number, 1) self.assertFormPagesHasValues(receipt.pages) - self.assertIsNotNone(receipt.receipt_type.confidence) - self.assertEqual(receipt.receipt_type.type, 'Itemized') + receipt_type = receipt.fields.get("ReceiptType") + self.assertIsNotNone(receipt_type.confidence) + self.assertEqual(receipt_type.value, 'Itemized') @GlobalFormRecognizerAccountPreparer() async def test_receipt_jpg_include_text_content(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): client = FormRecognizerClient(form_recognizer_account, AzureKeyCredential(form_recognizer_account_key)) with open(self.receipt_jpg, "rb") as fd: receipt = fd.read() - result = await client.recognize_receipts(receipt, include_text_content=True) + poller = await client.begin_recognize_receipts(receipt, include_text_content=True) + result = await poller.result() self.assertEqual(len(result), 1) receipt = result[0] self.assertFormPagesHasValues(receipt.pages) for field, value in receipt.__dict__.items(): - if field not in ["receipt_type", "receipt_items", "page_range", "pages", "fields", "form_type", "receipt_locale"]: + if field not in ["receipt_items", "page_range", "pages", "fields", "form_type"]: form_field = getattr(receipt, field) self.assertTextContentHasValues(form_field.value_data.text_content, receipt.page_range.first_page_number) @@ -330,31 +330,34 @@ async def test_receipt_multipage(self, resource_group, location, form_recognizer client = FormRecognizerClient(form_recognizer_account, AzureKeyCredential(form_recognizer_account_key)) with open(self.multipage_invoice_pdf, "rb") as fd: receipt = fd.read() - result = await client.recognize_receipts(receipt, include_text_content=True) + poller = await client.begin_recognize_receipts(receipt, include_text_content=True) + result = await poller.result() self.assertEqual(len(result), 3) receipt = result[0] - self.assertEqual(receipt.merchant_address.value, '123 Hobbit Lane 567 Main St. Redmond, WA Redmond, WA') - self.assertEqual(receipt.merchant_name.value, 'Bilbo Baggins') - self.assertEqual(receipt.merchant_phone_number.value, '+15555555555') - self.assertEqual(receipt.subtotal.value, 300.0) - self.assertEqual(receipt.total.value, 100.0) + self.assertEqual(receipt.fields.get("MerchantAddress").value, '123 Hobbit Lane 567 Main St. Redmond, WA Redmond, WA') + self.assertEqual(receipt.fields.get("MerchantName").value, 'Bilbo Baggins') + self.assertEqual(receipt.fields.get("MerchantPhoneNumber").value, '+15555555555') + self.assertEqual(receipt.fields.get("Subtotal").value, 300.0) + self.assertEqual(receipt.fields.get("Total").value, 100.0) self.assertEqual(receipt.page_range.first_page_number, 1) self.assertEqual(receipt.page_range.last_page_number, 1) self.assertFormPagesHasValues(receipt.pages) - self.assertIsNotNone(receipt.receipt_type.confidence) - self.assertEqual(receipt.receipt_type.type, 'Itemized') + receipt_type = receipt.fields.get("ReceiptType") + self.assertIsNotNone(receipt_type.confidence) + self.assertEqual(receipt_type.value, 'Itemized') receipt = result[2] - self.assertEqual(receipt.merchant_address.value, '123 Hobbit Lane 567 Main St. Redmond, WA Redmond, WA') - self.assertEqual(receipt.merchant_name.value, 'Frodo Baggins') - self.assertEqual(receipt.merchant_phone_number.value, '+15555555555') - self.assertEqual(receipt.subtotal.value, 3000.0) - self.assertEqual(receipt.total.value, 1000.0) + self.assertEqual(receipt.fields.get("MerchantAddress").value, '123 Hobbit Lane 567 Main St. Redmond, WA Redmond, WA') + self.assertEqual(receipt.fields.get("MerchantName").value, 'Frodo Baggins') + self.assertEqual(receipt.fields.get("MerchantPhoneNumber").value, '+15555555555') + self.assertEqual(receipt.fields.get("Subtotal").value, 3000.0) + self.assertEqual(receipt.fields.get("Total").value, 1000.0) self.assertEqual(receipt.page_range.first_page_number, 3) self.assertEqual(receipt.page_range.last_page_number, 3) self.assertFormPagesHasValues(receipt.pages) - self.assertIsNotNone(receipt.receipt_type.confidence) - self.assertEqual(receipt.receipt_type.type, 'Itemized') + receipt_type = receipt.fields.get("ReceiptType") + self.assertIsNotNone(receipt_type.confidence) + self.assertEqual(receipt_type.value, 'Itemized') @GlobalFormRecognizerAccountPreparer() async def test_receipt_multipage_transform(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): @@ -364,18 +367,19 @@ async def test_receipt_multipage_transform(self, resource_group, location, form_ def callback(raw_response, _, headers): analyze_result = client._client._deserialize(AnalyzeOperationResult, raw_response) - extracted_receipt = prepare_us_receipt(analyze_result) + extracted_receipt = prepare_receipt(analyze_result) responses.append(analyze_result) responses.append(extracted_receipt) with open(self.multipage_invoice_pdf, "rb") as fd: myfile = fd.read() - result = await client.recognize_receipts( + poller = await client.begin_recognize_receipts( receipt=myfile, include_text_content=True, cls=callback ) + result = await poller.result() raw_response = responses[0] returned_model = responses[1] @@ -388,15 +392,6 @@ def callback(raw_response, _, headers): for receipt, actual in zip(returned_model, actual): if actual.fields is None: # second page is blank continue - self.assertFormFieldTransformCorrect(receipt.merchant_address, actual.fields.get("MerchantAddress"), read_results) - self.assertFormFieldTransformCorrect(receipt.merchant_name, actual.fields.get("MerchantName"), read_results) - self.assertFormFieldTransformCorrect(receipt.merchant_phone_number, actual.fields.get("MerchantPhoneNumber"), read_results) - self.assertFormFieldTransformCorrect(receipt.subtotal, actual.fields.get("Subtotal"), read_results) - self.assertFormFieldTransformCorrect(receipt.tax, actual.fields.get("Tax"), read_results) - self.assertFormFieldTransformCorrect(receipt.tip, actual.fields.get("Tip"), read_results) - self.assertFormFieldTransformCorrect(receipt.total, actual.fields.get("Total"), read_results) - self.assertFormFieldTransformCorrect(receipt.transaction_date, actual.fields.get("TransactionDate"), read_results) - self.assertFormFieldTransformCorrect(receipt.transaction_time, actual.fields.get("TransactionTime"), read_results) # check dict values self.assertFormFieldTransformCorrect(receipt.fields.get("MerchantAddress"), actual.fields.get("MerchantAddress"), read_results) @@ -414,11 +409,27 @@ def callback(raw_response, _, headers): self.assertEqual(receipt.page_range.last_page_number, actual.page_range[1]) # check receipt type - self.assertEqual(receipt.receipt_type.confidence, actual.fields["ReceiptType"].confidence) - self.assertEqual(receipt.receipt_type.type, actual.fields["ReceiptType"].value_string) + receipt_type = receipt.fields.get("ReceiptType") + self.assertEqual(receipt_type.confidence, actual.fields["ReceiptType"].confidence) + self.assertEqual(receipt_type.value, actual.fields["ReceiptType"].value_string) # check receipt items - self.assertReceiptItemsTransformCorrect(receipt.receipt_items, actual.fields["Items"], read_results) + self.assertReceiptItemsTransformCorrect(receipt.fields["Items"].value, actual.fields["Items"], read_results) # Check form pages self.assertFormPagesTransformCorrect(returned_model, read_results) + + @GlobalFormRecognizerAccountPreparer() + @pytest.mark.live_test_only + async def test_receipt_continuation_token(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): + client = FormRecognizerClient(form_recognizer_account, AzureKeyCredential(form_recognizer_account_key)) + + with open(self.receipt_jpg, "rb") as fd: + receipt = fd.read() + + initial_poller = await client.begin_recognize_receipts(receipt) + cont_token = initial_poller.continuation_token() + poller = await client.begin_recognize_receipts(receipt, continuation_token=cont_token) + result = await poller.result() + self.assertIsNotNone(result) + await initial_poller.wait() # necessary so azure-devtools doesn't throw assertion error diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_from_url.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_from_url.py index 9771d8255746..53504fb8fa19 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_from_url.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_from_url.py @@ -9,7 +9,7 @@ from azure.core.exceptions import HttpResponseError, ServiceRequestError, ClientAuthenticationError from azure.core.credentials import AzureKeyCredential from azure.ai.formrecognizer._generated.models import AnalyzeOperationResult -from azure.ai.formrecognizer._response_handlers import prepare_us_receipt +from azure.ai.formrecognizer._response_handlers import prepare_receipt from azure.ai.formrecognizer import FormRecognizerClient from testcase import FormRecognizerTest, GlobalFormRecognizerAccountPreparer @@ -65,7 +65,7 @@ def test_receipt_url_transform_jpg(self, resource_group, location, form_recogniz def callback(raw_response, _, headers): analyze_result = client._client._deserialize(AnalyzeOperationResult, raw_response) - extracted_receipt = prepare_us_receipt(analyze_result) + extracted_receipt = prepare_receipt(analyze_result) responses.append(analyze_result) responses.append(extracted_receipt) @@ -83,17 +83,6 @@ def callback(raw_response, _, headers): read_results = raw_response.analyze_result.read_results document_results = raw_response.analyze_result.document_results - # check hardcoded values - self.assertFormFieldTransformCorrect(receipt.merchant_address, actual.get("MerchantAddress"), read_results) - self.assertFormFieldTransformCorrect(receipt.merchant_name, actual.get("MerchantName"), read_results) - self.assertFormFieldTransformCorrect(receipt.merchant_phone_number, actual.get("MerchantPhoneNumber"), read_results) - self.assertFormFieldTransformCorrect(receipt.subtotal, actual.get("Subtotal"), read_results) - self.assertFormFieldTransformCorrect(receipt.tax, actual.get("Tax"), read_results) - self.assertFormFieldTransformCorrect(receipt.tip, actual.get("Tip"), read_results) - self.assertFormFieldTransformCorrect(receipt.total, actual.get("Total"), read_results) - self.assertFormFieldTransformCorrect(receipt.transaction_date, actual.get("TransactionDate"), read_results) - self.assertFormFieldTransformCorrect(receipt.transaction_time, actual.get("TransactionTime"), read_results) - # check dict values self.assertFormFieldTransformCorrect(receipt.fields.get("MerchantAddress"), actual.get("MerchantAddress"), read_results) self.assertFormFieldTransformCorrect(receipt.fields.get("MerchantName"), actual.get("MerchantName"), read_results) @@ -110,11 +99,12 @@ def callback(raw_response, _, headers): self.assertEqual(receipt.page_range.last_page_number, document_results[0].page_range[1]) # check receipt type - self.assertEqual(receipt.receipt_type.confidence, actual["ReceiptType"].confidence) - self.assertEqual(receipt.receipt_type.type, actual["ReceiptType"].value_string) + receipt_type = receipt.fields.get("ReceiptType") + self.assertEqual(receipt_type.confidence, actual["ReceiptType"].confidence) + self.assertEqual(receipt_type.value, actual["ReceiptType"].value_string) # check receipt items - self.assertReceiptItemsTransformCorrect(receipt.receipt_items, actual["Items"], read_results) + self.assertReceiptItemsTransformCorrect(receipt.fields["Items"].value, actual["Items"], read_results) # Check page metadata self.assertFormPagesTransformCorrect(receipt.pages, read_results) @@ -127,7 +117,7 @@ def test_receipt_url_transform_png(self, resource_group, location, form_recogniz def callback(raw_response, _, headers): analyze_result = client._client._deserialize(AnalyzeOperationResult, raw_response) - extracted_receipt = prepare_us_receipt(analyze_result) + extracted_receipt = prepare_receipt(analyze_result) responses.append(analyze_result) responses.append(extracted_receipt) @@ -145,17 +135,6 @@ def callback(raw_response, _, headers): read_results = raw_response.analyze_result.read_results document_results = raw_response.analyze_result.document_results - # check hardcoded values - self.assertFormFieldTransformCorrect(receipt.merchant_address, actual.get("MerchantAddress"), read_results) - self.assertFormFieldTransformCorrect(receipt.merchant_name, actual.get("MerchantName"), read_results) - self.assertFormFieldTransformCorrect(receipt.merchant_phone_number, actual.get("MerchantPhoneNumber"), read_results) - self.assertFormFieldTransformCorrect(receipt.subtotal, actual.get("Subtotal"), read_results) - self.assertFormFieldTransformCorrect(receipt.tax, actual.get("Tax"), read_results) - self.assertFormFieldTransformCorrect(receipt.tip, actual.get("Tip"), read_results) - self.assertFormFieldTransformCorrect(receipt.total, actual.get("Total"), read_results) - self.assertFormFieldTransformCorrect(receipt.transaction_date, actual.get("TransactionDate"), read_results) - self.assertFormFieldTransformCorrect(receipt.transaction_time, actual.get("TransactionTime"), read_results) - # check dict values self.assertFormFieldTransformCorrect(receipt.fields.get("MerchantAddress"), actual.get("MerchantAddress"), read_results) self.assertFormFieldTransformCorrect(receipt.fields.get("MerchantName"), actual.get("MerchantName"), read_results) @@ -172,11 +151,12 @@ def callback(raw_response, _, headers): self.assertEqual(receipt.page_range.last_page_number, document_results[0].page_range[1]) # check receipt type - self.assertEqual(receipt.receipt_type.confidence, actual["ReceiptType"].confidence) - self.assertEqual(receipt.receipt_type.type, actual["ReceiptType"].value_string) + receipt_type = receipt.fields.get("ReceiptType") + self.assertEqual(receipt_type.confidence, actual["ReceiptType"].confidence) + self.assertEqual(receipt_type.value, actual["ReceiptType"].value_string) # check receipt items - self.assertReceiptItemsTransformCorrect(receipt.receipt_items, actual["Items"], read_results) + self.assertReceiptItemsTransformCorrect(receipt.fields["Items"].value, actual["Items"], read_results) # Check page metadata self.assertFormPagesTransformCorrect(receipt.pages, read_results) @@ -196,7 +176,7 @@ def test_receipt_url_include_text_content(self, resource_group, location, form_r self.assertFormPagesHasValues(receipt.pages) for field, value in receipt.__dict__.items(): - if field not in ["receipt_type", "receipt_items", "page_range", "pages", "fields", "form_type", "receipt_locale"]: + if field not in ["receipt_items", "page_range", "pages", "fields", "form_type"]: field = getattr(receipt, field) self.assertTextContentHasValues(field.value_data.text_content, receipt.page_range.first_page_number) @@ -212,21 +192,22 @@ def test_receipt_url_jpg(self, resource_group, location, form_recognizer_account result = poller.result() self.assertEqual(len(result), 1) receipt = result[0] - self.assertEqual(receipt.merchant_address.value, '123 Main Street Redmond, WA 98052') - self.assertEqual(receipt.merchant_name.value, 'Contoso Contoso') - self.assertEqual(receipt.merchant_phone_number.value, '+19876543210') - self.assertEqual(receipt.subtotal.value, 11.7) - self.assertEqual(receipt.tax.value, 1.17) - self.assertEqual(receipt.tip.value, 1.63) - self.assertEqual(receipt.total.value, 14.5) - self.assertEqual(receipt.transaction_date.value, date(year=2019, month=6, day=10)) - self.assertEqual(receipt.transaction_time.value, time(hour=13, minute=59, second=0)) + self.assertEqual(receipt.fields.get("MerchantAddress").value, '123 Main Street Redmond, WA 98052') + self.assertEqual(receipt.fields.get("MerchantName").value, 'Contoso Contoso') + self.assertEqual(receipt.fields.get("MerchantPhoneNumber").value, '+19876543210') + self.assertEqual(receipt.fields.get("Subtotal").value, 11.7) + self.assertEqual(receipt.fields.get("Tax").value, 1.17) + self.assertEqual(receipt.fields.get("Tip").value, 1.63) + self.assertEqual(receipt.fields.get("Total").value, 14.5) + self.assertEqual(receipt.fields.get("TransactionDate").value, date(year=2019, month=6, day=10)) + self.assertEqual(receipt.fields.get("TransactionTime").value, time(hour=13, minute=59, second=0)) self.assertEqual(receipt.page_range.first_page_number, 1) self.assertEqual(receipt.page_range.last_page_number, 1) self.assertFormPagesHasValues(receipt.pages) - self.assertIsNotNone(receipt.receipt_type.confidence) - self.assertEqual(receipt.receipt_type.type, 'Itemized') - self.assertReceiptItemsHasValues(receipt.receipt_items, receipt.page_range.first_page_number, False) + receipt_type = receipt.fields.get("ReceiptType") + self.assertIsNotNone(receipt_type.confidence) + self.assertEqual(receipt_type.value, 'Itemized') + self.assertReceiptItemsHasValues(receipt.fields["Items"].value, receipt.page_range.first_page_number, False) @GlobalFormRecognizerAccountPreparer() def test_receipt_url_png(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): @@ -237,18 +218,19 @@ def test_receipt_url_png(self, resource_group, location, form_recognizer_account result = poller.result() self.assertEqual(len(result), 1) receipt = result[0] - self.assertEqual(receipt.merchant_address.value, '123 Main Street Redmond, WA 98052') - self.assertEqual(receipt.merchant_name.value, 'Contoso Contoso') - self.assertEqual(receipt.subtotal.value, 1098.99) - self.assertEqual(receipt.tax.value, 104.4) - self.assertEqual(receipt.total.value, 1203.39) - self.assertEqual(receipt.transaction_date.value, date(year=2019, month=6, day=10)) - self.assertEqual(receipt.transaction_time.value, time(hour=13, minute=59, second=0)) + self.assertEqual(receipt.fields.get("MerchantAddress").value, '123 Main Street Redmond, WA 98052') + self.assertEqual(receipt.fields.get("MerchantName").value, 'Contoso Contoso') + self.assertEqual(receipt.fields.get("Subtotal").value, 1098.99) + self.assertEqual(receipt.fields.get("Tax").value, 104.4) + self.assertEqual(receipt.fields.get("Total").value, 1203.39) + self.assertEqual(receipt.fields.get("TransactionDate").value, date(year=2019, month=6, day=10)) + self.assertEqual(receipt.fields.get("TransactionTime").value, time(hour=13, minute=59, second=0)) self.assertEqual(receipt.page_range.first_page_number, 1) self.assertEqual(receipt.page_range.last_page_number, 1) self.assertFormPagesHasValues(receipt.pages) - self.assertIsNotNone(receipt.receipt_type.confidence) - self.assertEqual(receipt.receipt_type.type, 'Itemized') + receipt_type = receipt.fields.get("ReceiptType") + self.assertIsNotNone(receipt_type.confidence) + self.assertEqual(receipt_type.value, 'Itemized') @GlobalFormRecognizerAccountPreparer() def test_receipt_multipage_url(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): @@ -259,27 +241,29 @@ def test_receipt_multipage_url(self, resource_group, location, form_recognizer_a self.assertEqual(len(result), 3) receipt = result[0] - self.assertEqual(receipt.merchant_address.value, '123 Hobbit Lane 567 Main St. Redmond, WA Redmond, WA') - self.assertEqual(receipt.merchant_name.value, 'Bilbo Baggins') - self.assertEqual(receipt.merchant_phone_number.value, '+15555555555') - self.assertEqual(receipt.subtotal.value, 300.0) - self.assertEqual(receipt.total.value, 100.0) + self.assertEqual(receipt.fields.get("MerchantAddress").value, '123 Hobbit Lane 567 Main St. Redmond, WA Redmond, WA') + self.assertEqual(receipt.fields.get("MerchantName").value, 'Bilbo Baggins') + self.assertEqual(receipt.fields.get("MerchantPhoneNumber").value, '+15555555555') + self.assertEqual(receipt.fields.get("Subtotal").value, 300.0) + self.assertEqual(receipt.fields.get("Total").value, 100.0) self.assertEqual(receipt.page_range.first_page_number, 1) self.assertEqual(receipt.page_range.last_page_number, 1) self.assertFormPagesHasValues(receipt.pages) - self.assertIsNotNone(receipt.receipt_type.confidence) - self.assertEqual(receipt.receipt_type.type, 'Itemized') + receipt_type = receipt.fields.get("ReceiptType") + self.assertIsNotNone(receipt_type.confidence) + self.assertEqual(receipt_type.value, 'Itemized') receipt = result[2] - self.assertEqual(receipt.merchant_address.value, '123 Hobbit Lane 567 Main St. Redmond, WA Redmond, WA') - self.assertEqual(receipt.merchant_name.value, 'Frodo Baggins') - self.assertEqual(receipt.merchant_phone_number.value, '+15555555555') - self.assertEqual(receipt.subtotal.value, 3000.0) - self.assertEqual(receipt.total.value, 1000.0) + self.assertEqual(receipt.fields.get("MerchantAddress").value, '123 Hobbit Lane 567 Main St. Redmond, WA Redmond, WA') + self.assertEqual(receipt.fields.get("MerchantName").value, 'Frodo Baggins') + self.assertEqual(receipt.fields.get("MerchantPhoneNumber").value, '+15555555555') + self.assertEqual(receipt.fields.get("Subtotal").value, 3000.0) + self.assertEqual(receipt.fields.get("Total").value, 1000.0) self.assertEqual(receipt.page_range.first_page_number, 3) self.assertEqual(receipt.page_range.last_page_number, 3) self.assertFormPagesHasValues(receipt.pages) - self.assertIsNotNone(receipt.receipt_type.confidence) - self.assertEqual(receipt.receipt_type.type, 'Itemized') + receipt_type = receipt.fields.get("ReceiptType") + self.assertIsNotNone(receipt_type.confidence) + self.assertEqual(receipt_type.value, 'Itemized') @GlobalFormRecognizerAccountPreparer() def test_receipt_multipage_transform_url(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): @@ -289,7 +273,7 @@ def test_receipt_multipage_transform_url(self, resource_group, location, form_re def callback(raw_response, _, headers): analyze_result = client._client._deserialize(AnalyzeOperationResult, raw_response) - extracted_receipt = prepare_us_receipt(analyze_result) + extracted_receipt = prepare_receipt(analyze_result) responses.append(analyze_result) responses.append(extracted_receipt) @@ -311,15 +295,6 @@ def callback(raw_response, _, headers): for receipt, actual in zip(returned_model, actual): if actual.fields is None: # second page is blank continue - self.assertFormFieldTransformCorrect(receipt.merchant_address, actual.fields.get("MerchantAddress"), read_results) - self.assertFormFieldTransformCorrect(receipt.merchant_name, actual.fields.get("MerchantName"), read_results) - self.assertFormFieldTransformCorrect(receipt.merchant_phone_number, actual.fields.get("MerchantPhoneNumber"), read_results) - self.assertFormFieldTransformCorrect(receipt.subtotal, actual.fields.get("Subtotal"), read_results) - self.assertFormFieldTransformCorrect(receipt.tax, actual.fields.get("Tax"), read_results) - self.assertFormFieldTransformCorrect(receipt.tip, actual.fields.get("Tip"), read_results) - self.assertFormFieldTransformCorrect(receipt.total, actual.fields.get("Total"), read_results) - self.assertFormFieldTransformCorrect(receipt.transaction_date, actual.fields.get("TransactionDate"), read_results) - self.assertFormFieldTransformCorrect(receipt.transaction_time, actual.fields.get("TransactionTime"), read_results) # check dict values self.assertFormFieldTransformCorrect(receipt.fields.get("MerchantAddress"), actual.fields.get("MerchantAddress"), read_results) @@ -337,11 +312,24 @@ def callback(raw_response, _, headers): self.assertEqual(receipt.page_range.last_page_number, actual.page_range[1]) # check receipt type - self.assertEqual(receipt.receipt_type.confidence, actual.fields["ReceiptType"].confidence) - self.assertEqual(receipt.receipt_type.type, actual.fields["ReceiptType"].value_string) + receipt_type = receipt.fields.get("ReceiptType") + self.assertEqual(receipt_type.confidence, actual.fields["ReceiptType"].confidence) + self.assertEqual(receipt_type.value, actual.fields["ReceiptType"].value_string) # check receipt items - self.assertReceiptItemsTransformCorrect(receipt.receipt_items, actual.fields["Items"], read_results) + self.assertReceiptItemsTransformCorrect(receipt.fields["Items"].value, actual.fields["Items"], read_results) # Check form pages self.assertFormPagesTransformCorrect(returned_model, read_results) + + @GlobalFormRecognizerAccountPreparer() + @pytest.mark.live_test_only + def test_receipt_continuation_token(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): + client = FormRecognizerClient(form_recognizer_account, AzureKeyCredential(form_recognizer_account_key)) + + initial_poller = client.begin_recognize_receipts_from_url(self.receipt_url_jpg) + cont_token = initial_poller.continuation_token() + poller = client.begin_recognize_receipts_from_url(self.receipt_url_jpg, continuation_token=cont_token) + result = poller.result() + self.assertIsNotNone(result) + initial_poller.wait() # necessary so azure-devtools doesn't throw assertion error diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_from_url_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_from_url_async.py index 3c95d8cf8d9d..24eb6cd79746 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_from_url_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_from_url_async.py @@ -9,7 +9,7 @@ from azure.core.exceptions import HttpResponseError, ServiceRequestError, ClientAuthenticationError from azure.core.credentials import AzureKeyCredential from azure.ai.formrecognizer._generated.models import AnalyzeOperationResult -from azure.ai.formrecognizer._response_handlers import prepare_us_receipt +from azure.ai.formrecognizer._response_handlers import prepare_receipt from azure.ai.formrecognizer.aio import FormRecognizerClient from testcase import GlobalFormRecognizerAccountPreparer from asynctestcase import AsyncFormRecognizerTest @@ -23,40 +23,45 @@ async def test_active_directory_auth_async(self): token = self.generate_oauth_token() endpoint = self.get_oauth_endpoint() client = FormRecognizerClient(endpoint, token) - result = await client.recognize_receipts_from_url( + poller = await client.begin_recognize_receipts_from_url( self.receipt_url_jpg ) + result = await poller.result() self.assertIsNotNone(result) @GlobalFormRecognizerAccountPreparer() async def test_receipt_url_bad_endpoint(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): with self.assertRaises(ServiceRequestError): client = FormRecognizerClient("http://notreal.azure.com", AzureKeyCredential(form_recognizer_account_key)) - result = await client.recognize_receipts_from_url( + poller = await client.begin_recognize_receipts_from_url( self.receipt_url_jpg ) + result = await poller.result() @GlobalFormRecognizerAccountPreparer() async def test_receipt_url_auth_successful_key(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): client = FormRecognizerClient(form_recognizer_account, AzureKeyCredential(form_recognizer_account_key)) - result = await client.recognize_receipts_from_url( + poller = await client.begin_recognize_receipts_from_url( self.receipt_url_jpg ) + result = await poller.result() @GlobalFormRecognizerAccountPreparer() async def test_receipt_url_auth_bad_key(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): client = FormRecognizerClient(form_recognizer_account, AzureKeyCredential("xxxx")) with self.assertRaises(ClientAuthenticationError): - result = await client.recognize_receipts_from_url( + poller = await client.begin_recognize_receipts_from_url( self.receipt_url_jpg ) + result = await poller.result() @GlobalFormRecognizerAccountPreparer() async def test_receipt_bad_url(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): client = FormRecognizerClient(form_recognizer_account, AzureKeyCredential(form_recognizer_account_key)) with self.assertRaises(HttpResponseError): - result = await client.recognize_receipts_from_url("https://badurl.jpg") + poller = await client.begin_recognize_receipts_from_url("https://badurl.jpg") + result = await poller.result() @GlobalFormRecognizerAccountPreparer() async def test_receipt_url_pass_stream(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): @@ -65,7 +70,8 @@ async def test_receipt_url_pass_stream(self, resource_group, location, form_reco receipt = fd.read(4) # makes the recording smaller with self.assertRaises(HttpResponseError): - result = await client.recognize_receipts_from_url(receipt) + poller = await client.begin_recognize_receipts_from_url(receipt) + result = await poller.result() @GlobalFormRecognizerAccountPreparer() async def test_receipt_url_transform_jpg(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): @@ -75,15 +81,16 @@ async def test_receipt_url_transform_jpg(self, resource_group, location, form_re def callback(raw_response, _, headers): analyze_result = client._client._deserialize(AnalyzeOperationResult, raw_response) - extracted_receipt = prepare_us_receipt(analyze_result) + extracted_receipt = prepare_receipt(analyze_result) responses.append(analyze_result) responses.append(extracted_receipt) - result = await client.recognize_receipts_from_url( + poller = await client.begin_recognize_receipts_from_url( self.receipt_url_jpg, include_text_content=True, cls=callback ) + result = await poller.result() raw_response = responses[0] returned_model = responses[1] @@ -92,17 +99,6 @@ def callback(raw_response, _, headers): read_results = raw_response.analyze_result.read_results document_results = raw_response.analyze_result.document_results - # check hardcoded values - self.assertFormFieldTransformCorrect(receipt.merchant_address, actual.get("MerchantAddress"), read_results) - self.assertFormFieldTransformCorrect(receipt.merchant_name, actual.get("MerchantName"), read_results) - self.assertFormFieldTransformCorrect(receipt.merchant_phone_number, actual.get("MerchantPhoneNumber"), read_results) - self.assertFormFieldTransformCorrect(receipt.subtotal, actual.get("Subtotal"), read_results) - self.assertFormFieldTransformCorrect(receipt.tax, actual.get("Tax"), read_results) - self.assertFormFieldTransformCorrect(receipt.tip, actual.get("Tip"), read_results) - self.assertFormFieldTransformCorrect(receipt.total, actual.get("Total"), read_results) - self.assertFormFieldTransformCorrect(receipt.transaction_date, actual.get("TransactionDate"), read_results) - self.assertFormFieldTransformCorrect(receipt.transaction_time, actual.get("TransactionTime"), read_results) - # check dict values self.assertFormFieldTransformCorrect(receipt.fields.get("MerchantAddress"), actual.get("MerchantAddress"), read_results) self.assertFormFieldTransformCorrect(receipt.fields.get("MerchantName"), actual.get("MerchantName"), read_results) @@ -119,11 +115,12 @@ def callback(raw_response, _, headers): self.assertEqual(receipt.page_range.last_page_number, document_results[0].page_range[1]) # check receipt type - self.assertEqual(receipt.receipt_type.confidence, actual["ReceiptType"].confidence) - self.assertEqual(receipt.receipt_type.type, actual["ReceiptType"].value_string) + receipt_type = receipt.fields.get("ReceiptType") + self.assertEqual(receipt_type.confidence, actual["ReceiptType"].confidence) + self.assertEqual(receipt_type.value, actual["ReceiptType"].value_string) # check receipt items - self.assertReceiptItemsTransformCorrect(receipt.receipt_items, actual["Items"], read_results) + self.assertReceiptItemsTransformCorrect(receipt.fields["Items"].value, actual["Items"], read_results) # Check page metadata self.assertFormPagesTransformCorrect(receipt.pages, read_results) @@ -136,15 +133,16 @@ async def test_receipt_url_transform_png(self, resource_group, location, form_re def callback(raw_response, _, headers): analyze_result = client._client._deserialize(AnalyzeOperationResult, raw_response) - extracted_receipt = prepare_us_receipt(analyze_result) + extracted_receipt = prepare_receipt(analyze_result) responses.append(analyze_result) responses.append(extracted_receipt) - result = await client.recognize_receipts_from_url( + poller = await client.begin_recognize_receipts_from_url( self.receipt_url_png, include_text_content=True, cls=callback ) + result = await poller.result() raw_response = responses[0] returned_model = responses[1] @@ -153,17 +151,6 @@ def callback(raw_response, _, headers): read_results = raw_response.analyze_result.read_results document_results = raw_response.analyze_result.document_results - # check hardcoded values - self.assertFormFieldTransformCorrect(receipt.merchant_address, actual.get("MerchantAddress"), read_results) - self.assertFormFieldTransformCorrect(receipt.merchant_name, actual.get("MerchantName"), read_results) - self.assertFormFieldTransformCorrect(receipt.merchant_phone_number, actual.get("MerchantPhoneNumber"), read_results) - self.assertFormFieldTransformCorrect(receipt.subtotal, actual.get("Subtotal"), read_results) - self.assertFormFieldTransformCorrect(receipt.tax, actual.get("Tax"), read_results) - self.assertFormFieldTransformCorrect(receipt.tip, actual.get("Tip"), read_results) - self.assertFormFieldTransformCorrect(receipt.total, actual.get("Total"), read_results) - self.assertFormFieldTransformCorrect(receipt.transaction_date, actual.get("TransactionDate"), read_results) - self.assertFormFieldTransformCorrect(receipt.transaction_time, actual.get("TransactionTime"), read_results) - # check dict values self.assertFormFieldTransformCorrect(receipt.fields.get("MerchantAddress"), actual.get("MerchantAddress"), read_results) self.assertFormFieldTransformCorrect(receipt.fields.get("MerchantName"), actual.get("MerchantName"), read_results) @@ -180,11 +167,12 @@ def callback(raw_response, _, headers): self.assertEqual(receipt.page_range.last_page_number, document_results[0].page_range[1]) # check receipt type - self.assertEqual(receipt.receipt_type.confidence, actual["ReceiptType"].confidence) - self.assertEqual(receipt.receipt_type.type, actual["ReceiptType"].value_string) + receipt_type = receipt.fields.get("ReceiptType") + self.assertEqual(receipt_type.confidence, actual["ReceiptType"].confidence) + self.assertEqual(receipt_type.value, actual["ReceiptType"].value_string) # check receipt items - self.assertReceiptItemsTransformCorrect(receipt.receipt_items, actual["Items"], read_results) + self.assertReceiptItemsTransformCorrect(receipt.fields["Items"].value, actual["Items"], read_results) # Check page metadata self.assertFormPagesTransformCorrect(receipt.pages, read_results) @@ -193,17 +181,18 @@ def callback(raw_response, _, headers): async def test_receipt_url_include_text_content(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): client = FormRecognizerClient(form_recognizer_account, AzureKeyCredential(form_recognizer_account_key)) - result = await client.recognize_receipts_from_url( + poller = await client.begin_recognize_receipts_from_url( self.receipt_url_jpg, include_text_content=True ) + result = await poller.result() self.assertEqual(len(result), 1) receipt = result[0] self.assertFormPagesHasValues(receipt.pages) for field, value in receipt.__dict__.items(): - if field not in ["receipt_type", "receipt_items", "page_range", "pages", "fields", "form_type", "receipt_locale"]: + if field not in ["page_range", "pages", "fields", "form_type"]: field = getattr(receipt, field) self.assertTextContentHasValues(field.value_data.text_content, receipt.page_range.first_page_number) @@ -214,78 +203,85 @@ async def test_receipt_url_include_text_content(self, resource_group, location, async def test_receipt_url_jpg(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): client = FormRecognizerClient(form_recognizer_account, AzureKeyCredential(form_recognizer_account_key)) - result = await client.recognize_receipts_from_url( + poller = await client.begin_recognize_receipts_from_url( self.receipt_url_jpg ) + result = await poller.result() self.assertEqual(len(result), 1) receipt = result[0] - self.assertEqual(receipt.merchant_address.value, '123 Main Street Redmond, WA 98052') - self.assertEqual(receipt.merchant_name.value, 'Contoso Contoso') - self.assertEqual(receipt.merchant_phone_number.value, '+19876543210') - self.assertEqual(receipt.subtotal.value, 11.7) - self.assertEqual(receipt.tax.value, 1.17) - self.assertEqual(receipt.tip.value, 1.63) - self.assertEqual(receipt.total.value, 14.5) - self.assertEqual(receipt.transaction_date.value, date(year=2019, month=6, day=10)) - self.assertEqual(receipt.transaction_time.value, time(hour=13, minute=59, second=0)) + self.assertEqual(receipt.fields.get("MerchantAddress").value, '123 Main Street Redmond, WA 98052') + self.assertEqual(receipt.fields.get("MerchantName").value, 'Contoso Contoso') + self.assertEqual(receipt.fields.get("MerchantPhoneNumber").value, '+19876543210') + self.assertEqual(receipt.fields.get("Subtotal").value, 11.7) + self.assertEqual(receipt.fields.get("Tax").value, 1.17) + self.assertEqual(receipt.fields.get("Tip").value, 1.63) + self.assertEqual(receipt.fields.get("Total").value, 14.5) + self.assertEqual(receipt.fields.get("TransactionDate").value, date(year=2019, month=6, day=10)) + self.assertEqual(receipt.fields.get("TransactionTime").value, time(hour=13, minute=59, second=0)) self.assertEqual(receipt.page_range.first_page_number, 1) self.assertEqual(receipt.page_range.last_page_number, 1) self.assertFormPagesHasValues(receipt.pages) - self.assertIsNotNone(receipt.receipt_type.confidence) - self.assertEqual(receipt.receipt_type.type, 'Itemized') - self.assertReceiptItemsHasValues(receipt.receipt_items, receipt.page_range.first_page_number, False) + receipt_type = receipt.fields.get("ReceiptType") + self.assertIsNotNone(receipt_type.confidence) + self.assertEqual(receipt_type.value, 'Itemized') + self.assertReceiptItemsHasValues(receipt.fields["Items"].value, receipt.page_range.first_page_number, False) @GlobalFormRecognizerAccountPreparer() async def test_receipt_url_png(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): client = FormRecognizerClient(form_recognizer_account, AzureKeyCredential(form_recognizer_account_key)) - result = await client.recognize_receipts_from_url(self.receipt_url_png) + poller = await client.begin_recognize_receipts_from_url(self.receipt_url_png) + result = await poller.result() self.assertEqual(len(result), 1) receipt = result[0] - self.assertEqual(receipt.merchant_address.value, '123 Main Street Redmond, WA 98052') - self.assertEqual(receipt.merchant_name.value, 'Contoso Contoso') - self.assertEqual(receipt.subtotal.value, 1098.99) - self.assertEqual(receipt.tax.value, 104.4) - self.assertEqual(receipt.total.value, 1203.39) - self.assertEqual(receipt.transaction_date.value, date(year=2019, month=6, day=10)) - self.assertEqual(receipt.transaction_time.value, time(hour=13, minute=59, second=0)) + self.assertEqual(receipt.fields.get("MerchantAddress").value, '123 Main Street Redmond, WA 98052') + self.assertEqual(receipt.fields.get("MerchantName").value, 'Contoso Contoso') + self.assertEqual(receipt.fields.get("Subtotal").value, 1098.99) + self.assertEqual(receipt.fields.get("Tax").value, 104.4) + self.assertEqual(receipt.fields.get("Total").value, 1203.39) + self.assertEqual(receipt.fields.get("TransactionDate").value, date(year=2019, month=6, day=10)) + self.assertEqual(receipt.fields.get("TransactionTime").value, time(hour=13, minute=59, second=0)) self.assertEqual(receipt.page_range.first_page_number, 1) self.assertEqual(receipt.page_range.last_page_number, 1) self.assertFormPagesHasValues(receipt.pages) - self.assertIsNotNone(receipt.receipt_type.confidence) - self.assertEqual(receipt.receipt_type.type, 'Itemized') + receipt_type = receipt.fields.get("ReceiptType") + self.assertIsNotNone(receipt_type.confidence) + self.assertEqual(receipt_type.value, 'Itemized') @GlobalFormRecognizerAccountPreparer() async def test_receipt_multipage_url(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): client = FormRecognizerClient(form_recognizer_account, AzureKeyCredential(form_recognizer_account_key)) - result = await client.recognize_receipts_from_url(self.multipage_url_pdf, include_text_content=True) + poller = await client.begin_recognize_receipts_from_url(self.multipage_url_pdf, include_text_content=True) + result = await poller.result() self.assertEqual(len(result), 3) receipt = result[0] - self.assertEqual(receipt.merchant_address.value, '123 Hobbit Lane 567 Main St. Redmond, WA Redmond, WA') - self.assertEqual(receipt.merchant_name.value, 'Bilbo Baggins') - self.assertEqual(receipt.merchant_phone_number.value, '+15555555555') - self.assertEqual(receipt.subtotal.value, 300.0) - self.assertEqual(receipt.total.value, 100.0) + self.assertEqual(receipt.fields.get("MerchantAddress").value, '123 Hobbit Lane 567 Main St. Redmond, WA Redmond, WA') + self.assertEqual(receipt.fields.get("MerchantName").value, 'Bilbo Baggins') + self.assertEqual(receipt.fields.get("MerchantPhoneNumber").value, '+15555555555') + self.assertEqual(receipt.fields.get("Subtotal").value, 300.0) + self.assertEqual(receipt.fields.get("Total").value, 100.0) self.assertEqual(receipt.page_range.first_page_number, 1) self.assertEqual(receipt.page_range.last_page_number, 1) self.assertFormPagesHasValues(receipt.pages) - self.assertIsNotNone(receipt.receipt_type.confidence) - self.assertEqual(receipt.receipt_type.type, 'Itemized') + receipt_type = receipt.fields.get("ReceiptType") + self.assertIsNotNone(receipt_type.confidence) + self.assertEqual(receipt_type.value, 'Itemized') receipt = result[2] - self.assertEqual(receipt.merchant_address.value, '123 Hobbit Lane 567 Main St. Redmond, WA Redmond, WA') - self.assertEqual(receipt.merchant_name.value, 'Frodo Baggins') - self.assertEqual(receipt.merchant_phone_number.value, '+15555555555') - self.assertEqual(receipt.subtotal.value, 3000.0) - self.assertEqual(receipt.total.value, 1000.0) + self.assertEqual(receipt.fields.get("MerchantAddress").value, '123 Hobbit Lane 567 Main St. Redmond, WA Redmond, WA') + self.assertEqual(receipt.fields.get("MerchantName").value, 'Frodo Baggins') + self.assertEqual(receipt.fields.get("MerchantPhoneNumber").value, '+15555555555') + self.assertEqual(receipt.fields.get("Subtotal").value, 3000.0) + self.assertEqual(receipt.fields.get("Total").value, 1000.0) self.assertEqual(receipt.page_range.first_page_number, 3) self.assertEqual(receipt.page_range.last_page_number, 3) self.assertFormPagesHasValues(receipt.pages) - self.assertIsNotNone(receipt.receipt_type.confidence) - self.assertEqual(receipt.receipt_type.type, 'Itemized') + receipt_type = receipt.fields.get("ReceiptType") + self.assertIsNotNone(receipt_type.confidence) + self.assertEqual(receipt_type.value, 'Itemized') @GlobalFormRecognizerAccountPreparer() async def test_receipt_multipage_transform_url(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): @@ -295,16 +291,17 @@ async def test_receipt_multipage_transform_url(self, resource_group, location, f def callback(raw_response, _, headers): analyze_result = client._client._deserialize(AnalyzeOperationResult, raw_response) - extracted_receipt = prepare_us_receipt(analyze_result) + extracted_receipt = prepare_receipt(analyze_result) responses.append(analyze_result) responses.append(extracted_receipt) - result = await client.recognize_receipts_from_url( + poller = await client.begin_recognize_receipts_from_url( self.multipage_url_pdf, include_text_content=True, cls=callback ) + result = await poller.result() raw_response = responses[0] returned_model = responses[1] actual = raw_response.analyze_result.document_results @@ -316,15 +313,6 @@ def callback(raw_response, _, headers): for receipt, actual in zip(returned_model, actual): if actual.fields is None: # second page is blank continue - self.assertFormFieldTransformCorrect(receipt.merchant_address, actual.fields.get("MerchantAddress"), read_results) - self.assertFormFieldTransformCorrect(receipt.merchant_name, actual.fields.get("MerchantName"), read_results) - self.assertFormFieldTransformCorrect(receipt.merchant_phone_number, actual.fields.get("MerchantPhoneNumber"), read_results) - self.assertFormFieldTransformCorrect(receipt.subtotal, actual.fields.get("Subtotal"), read_results) - self.assertFormFieldTransformCorrect(receipt.tax, actual.fields.get("Tax"), read_results) - self.assertFormFieldTransformCorrect(receipt.tip, actual.fields.get("Tip"), read_results) - self.assertFormFieldTransformCorrect(receipt.total, actual.fields.get("Total"), read_results) - self.assertFormFieldTransformCorrect(receipt.transaction_date, actual.fields.get("TransactionDate"), read_results) - self.assertFormFieldTransformCorrect(receipt.transaction_time, actual.fields.get("TransactionTime"), read_results) # check dict values self.assertFormFieldTransformCorrect(receipt.fields.get("MerchantAddress"), actual.fields.get("MerchantAddress"), read_results) @@ -342,11 +330,24 @@ def callback(raw_response, _, headers): self.assertEqual(receipt.page_range.last_page_number, actual.page_range[1]) # check receipt type - self.assertEqual(receipt.receipt_type.confidence, actual.fields["ReceiptType"].confidence) - self.assertEqual(receipt.receipt_type.type, actual.fields["ReceiptType"].value_string) + receipt_type = receipt.fields.get("ReceiptType") + self.assertEqual(receipt_type.confidence, actual.fields["ReceiptType"].confidence) + self.assertEqual(receipt_type.value, actual.fields["ReceiptType"].value_string) # check receipt items - self.assertReceiptItemsTransformCorrect(receipt.receipt_items, actual.fields["Items"], read_results) + self.assertReceiptItemsTransformCorrect(receipt.fields["Items"].value, actual.fields["Items"], read_results) # Check form pages self.assertFormPagesTransformCorrect(returned_model, read_results) + + @GlobalFormRecognizerAccountPreparer() + @pytest.mark.live_test_only + async def test_receipt_continuation_token(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): + client = FormRecognizerClient(form_recognizer_account, AzureKeyCredential(form_recognizer_account_key)) + + initial_poller = await client.begin_recognize_receipts_from_url(self.receipt_url_jpg) + cont_token = initial_poller.continuation_token() + poller = await client.begin_recognize_receipts_from_url(self.receipt_url_jpg, continuation_token=cont_token) + result = await poller.result() + self.assertIsNotNone(result) + await initial_poller.wait() # necessary so azure-devtools doesn't throw assertion error diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_repr.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_repr.py index ee4ab885f386..9510f300bc59 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_repr.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_repr.py @@ -95,20 +95,6 @@ def form_page(form_table, form_line): assert repr(model) == model_repr return model, model_repr -@pytest.fixture -def us_receipt_type(): - model = _models.ReceiptType(type="Itemized", confidence=1.0) - model_repr = "ReceiptType(type=Itemized, confidence=1.0)" - assert repr(model) == model_repr - return model, model_repr - -@pytest.fixture -def us_receipt_item(form_field_two): - model = _models.USReceiptItem(name=form_field_two[0], quantity=form_field_two[0], price=form_field_two[0], total_price=form_field_two[0]) - model_repr = "USReceiptItem(name={}, quantity={}, price={}, total_price={})".format(form_field_two[1], form_field_two[1], form_field_two[1], form_field_two[1])[:1024] - assert repr(model) == model_repr - return model, model_repr - @pytest.fixture def custom_form_model_field(): model = _models.CustomFormModelField(label="label", name="name", accuracy=0.99) @@ -141,65 +127,21 @@ def training_document_info(form_recognizer_error): class TestRepr(): # Not inheriting form FormRecognizerTest because that doesn't allow me to define pytest fixtures in the same file # Not worth moving pytest fixture definitions to conftest since all I would use is assertEqual and I can just use assert - def test_recognized_form(self, form_field_one, page_range, form_page, us_receipt_type, us_receipt_item): + def test_recognized_form(self, form_field_one, page_range, form_page): model = _models.RecognizedForm(form_type="receipt", fields={"one": form_field_one[0]}, page_range=page_range[0], pages=[form_page[0]]) model_repr = "RecognizedForm(form_type=receipt, fields={{'one': {}}}, page_range={}, pages=[{}])".format( form_field_one[1], page_range[1], form_page[1] )[:1024] assert repr(model) == model_repr - def test_recognized_receipt(self, form_field_one, page_range, form_page, us_receipt_type): + def test_recognized_receipt(self, form_field_one, page_range, form_page): model = _models.RecognizedReceipt( - form_type="receipt", fields={"one": form_field_one[0]}, page_range=page_range[0], pages=[form_page[0]], - receipt_type=us_receipt_type[0], receipt_locale="en-US") + form_type="receipt", fields={"one": form_field_one[0]}, page_range=page_range[0], pages=[form_page[0]]) model_repr = "RecognizedReceipt(form_type=receipt, fields={{'one': {}}}, page_range={}, pages=[{}])".format( - form_field_one[1], page_range[1], form_page[1], us_receipt_type[0], "en-US" + form_field_one[1], page_range[1], form_page[1] )[:1024] assert repr(model) == model_repr - def test_us_receipt(self, form_field_one, form_field_two, us_receipt_type, us_receipt_item, page_range, form_page): - model = _models.USReceipt( - merchant_address=form_field_one[0], - merchant_name=form_field_two[0], - merchant_phone_number=form_field_one[0], - receipt_type=us_receipt_type[0], - receipt_items=[us_receipt_item[0], us_receipt_item[0]], - subtotal=form_field_two[0], - tax=form_field_one[0], - tip=form_field_two[0], - total=form_field_one[0], - transaction_date=form_field_two[0], - transaction_time=form_field_one[0], - fields={ - "one": form_field_one[0] - }, - page_range=page_range[0], - pages=[form_page[0]], - form_type="test", - receipt_locale="en-US" - ) - model_repr="USReceipt(merchant_address={}, merchant_name={}, merchant_phone_number={}, receipt_type={}, receipt_items=[{}, {}], subtotal={}, " \ - "tax={}, tip={}, total={}, transaction_date={}, transaction_time={}, fields={{'one': {}}}, page_range={}, pages=[{}], " \ - "form_type=test, receipt_locale=en-US)".format( - form_field_one[1], - form_field_two[1], - form_field_one[1], - us_receipt_type[1], - us_receipt_item[1], - us_receipt_item[1], - form_field_two[1], - form_field_one[1], - form_field_two[1], - form_field_one[1], - form_field_two[1], - form_field_one[1], - form_field_one[1], - page_range[1], - form_page[1] - )[:1024] - - - assert repr(model) == model_repr def test_custom_form_model(self, custom_form_sub_model, form_recognizer_error, training_document_info): model = _models.CustomFormModel( diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_training.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_training.py index 2ee398403abf..f649b92b8868 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_training.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_training.py @@ -4,6 +4,7 @@ # Licensed under the MIT License. # ------------------------------------ +import pytest import functools from azure.core.credentials import AzureKeyCredential from azure.core.exceptions import ClientAuthenticationError, HttpResponseError @@ -23,13 +24,13 @@ class TestTraining(FormRecognizerTest): def test_training_auth_bad_key(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): client = FormTrainingClient(form_recognizer_account, AzureKeyCredential("xxxx")) with self.assertRaises(ClientAuthenticationError): - poller = client.begin_train_model("xx", use_training_labels=False) + poller = client.begin_training("xx", use_training_labels=False) @GlobalFormRecognizerAccountPreparer() @GlobalTrainingAccountPreparer() def test_training(self, client, container_sas_url): - poller = client.begin_train_model(training_files_url=container_sas_url, use_training_labels=False) + poller = client.begin_training(training_files_url=container_sas_url, use_training_labels=False) model = poller.result() self.assertIsNotNone(model.model_id) @@ -52,7 +53,7 @@ def test_training(self, client, container_sas_url): @GlobalTrainingAccountPreparer(multipage=True) def test_training_multipage(self, client, container_sas_url): - poller = client.begin_train_model(container_sas_url, use_training_labels=False) + poller = client.begin_training(container_sas_url, use_training_labels=False) model = poller.result() self.assertIsNotNone(model.model_id) @@ -83,7 +84,7 @@ def callback(response): raw_response.append(raw_model) raw_response.append(custom_model) - poller = client.begin_train_model(training_files_url=container_sas_url, use_training_labels=False, cls=callback) + poller = client.begin_training(training_files_url=container_sas_url, use_training_labels=False, cls=callback) model = poller.result() raw_model = raw_response[0] @@ -102,7 +103,7 @@ def callback(response): raw_response.append(raw_model) raw_response.append(custom_model) - poller = client.begin_train_model(container_sas_url, use_training_labels=False, cls=callback) + poller = client.begin_training(container_sas_url, use_training_labels=False, cls=callback) model = poller.result() raw_model = raw_response[0] @@ -113,7 +114,7 @@ def callback(response): @GlobalTrainingAccountPreparer() def test_training_with_labels(self, client, container_sas_url): - poller = client.begin_train_model(training_files_url=container_sas_url, use_training_labels=True) + poller = client.begin_training(training_files_url=container_sas_url, use_training_labels=True) model = poller.result() self.assertIsNotNone(model.model_id) @@ -137,7 +138,7 @@ def test_training_with_labels(self, client, container_sas_url): @GlobalTrainingAccountPreparer(multipage=True) def test_training_multipage_with_labels(self, client, container_sas_url): - poller = client.begin_train_model(container_sas_url, use_training_labels=True) + poller = client.begin_training(container_sas_url, use_training_labels=True) model = poller.result() self.assertIsNotNone(model.model_id) @@ -169,7 +170,7 @@ def callback(response): raw_response.append(raw_model) raw_response.append(custom_model) - poller = client.begin_train_model(training_files_url=container_sas_url, use_training_labels=True, cls=callback) + poller = client.begin_training(training_files_url=container_sas_url, use_training_labels=True, cls=callback) model = poller.result() raw_model = raw_response[0] @@ -188,7 +189,7 @@ def callback(response): raw_response.append(raw_model) raw_response.append(custom_model) - poller = client.begin_train_model(container_sas_url, use_training_labels=True, cls=callback) + poller = client.begin_training(container_sas_url, use_training_labels=True, cls=callback) model = poller.result() raw_model = raw_response[0] @@ -199,16 +200,28 @@ def callback(response): @GlobalTrainingAccountPreparer() def test_training_with_files_filter(self, client, container_sas_url): - poller = client.begin_train_model(training_files_url=container_sas_url, use_training_labels=False, include_sub_folders=True) + poller = client.begin_training(training_files_url=container_sas_url, use_training_labels=False, include_sub_folders=True) model = poller.result() self.assertEqual(len(model.training_documents), 6) self.assertEqual(model.training_documents[-1].document_name, "subfolder/Form_6.jpg") # we traversed subfolders - poller = client.begin_train_model(container_sas_url, use_training_labels=False, prefix="subfolder", include_sub_folders=True) + poller = client.begin_training(container_sas_url, use_training_labels=False, prefix="subfolder", include_sub_folders=True) model = poller.result() self.assertEqual(len(model.training_documents), 1) self.assertEqual(model.training_documents[0].document_name, "subfolder/Form_6.jpg") # we filtered for only subfolders with self.assertRaises(HttpResponseError): - poller = client.begin_train_model(training_files_url=container_sas_url, use_training_labels=False, prefix="xxx") + poller = client.begin_training(training_files_url=container_sas_url, use_training_labels=False, prefix="xxx") model = poller.result() + + @GlobalFormRecognizerAccountPreparer() + @GlobalTrainingAccountPreparer() + @pytest.mark.live_test_only + def test_training_continuation_token(self, client, container_sas_url): + + initial_poller = client.begin_training(training_files_url=container_sas_url, use_training_labels=False) + cont_token = initial_poller.continuation_token() + poller = client.begin_training(training_files_url=container_sas_url, use_training_labels=False, continuation_token=cont_token) + result = poller.result() + self.assertIsNotNone(result) + initial_poller.wait() # necessary so azure-devtools doesn't throw assertion error diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_training_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_training_async.py index 1507ea299c23..b693a0700ce7 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_training_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_training_async.py @@ -4,6 +4,7 @@ # Licensed under the MIT License. # ------------------------------------ +import pytest import functools from azure.core.credentials import AzureKeyCredential from azure.core.exceptions import ClientAuthenticationError, HttpResponseError @@ -23,15 +24,17 @@ class TestTrainingAsync(AsyncFormRecognizerTest): async def test_training_auth_bad_key(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): client = FormTrainingClient(form_recognizer_account, AzureKeyCredential("xxxx")) with self.assertRaises(ClientAuthenticationError): - result = await client.train_model("xx", use_training_labels=False) + poller = await client.begin_training("xx", use_training_labels=False) + result = await poller.result() @GlobalFormRecognizerAccountPreparer() @GlobalTrainingAccountPreparer() async def test_training(self, client, container_sas_url): - model = await client.train_model( + poller = await client.begin_training( training_files_url=container_sas_url, use_training_labels=False) + model = await poller.result() self.assertIsNotNone(model.model_id) self.assertIsNotNone(model.requested_on) @@ -53,7 +56,8 @@ async def test_training(self, client, container_sas_url): @GlobalTrainingAccountPreparer(multipage=True) async def test_training_multipage(self, client, container_sas_url): - model = await client.train_model(container_sas_url, use_training_labels=False) + poller = await client.begin_training(container_sas_url, use_training_labels=False) + model = await poller.result() self.assertIsNotNone(model.model_id) self.assertIsNotNone(model.requested_on) @@ -83,10 +87,11 @@ def callback(response): raw_response.append(raw_model) raw_response.append(custom_model) - model = await client.train_model( + poller = await client.begin_training( training_files_url=container_sas_url, use_training_labels=False, cls=callback) + model = await poller.result() raw_model = raw_response[0] custom_model = raw_response[1] @@ -104,7 +109,8 @@ def callback(response): raw_response.append(raw_model) raw_response.append(custom_model) - model = await client.train_model(container_sas_url, use_training_labels=False, cls=callback) + poller = await client.begin_training(container_sas_url, use_training_labels=False, cls=callback) + model = await poller.result() raw_model = raw_response[0] custom_model = raw_response[1] @@ -114,7 +120,8 @@ def callback(response): @GlobalTrainingAccountPreparer() async def test_training_with_labels(self, client, container_sas_url): - model = await client.train_model(training_files_url=container_sas_url, use_training_labels=True) + poller = await client.begin_training(training_files_url=container_sas_url, use_training_labels=True) + model = await poller.result() self.assertIsNotNone(model.model_id) self.assertIsNotNone(model.requested_on) @@ -136,7 +143,8 @@ async def test_training_with_labels(self, client, container_sas_url): @GlobalTrainingAccountPreparer(multipage=True) async def test_training_multipage_with_labels(self, client, container_sas_url): - model = await client.train_model(container_sas_url, use_training_labels=True) + poller = await client.begin_training(container_sas_url, use_training_labels=True) + model = await poller.result() self.assertIsNotNone(model.model_id) self.assertIsNotNone(model.requested_on) @@ -167,7 +175,8 @@ def callback(response): raw_response.append(raw_model) raw_response.append(custom_model) - model = await client.train_model(training_files_url=container_sas_url, use_training_labels=True, cls=callback) + poller = await client.begin_training(training_files_url=container_sas_url, use_training_labels=True, cls=callback) + model = await poller.result() raw_model = raw_response[0] custom_model = raw_response[1] @@ -185,7 +194,9 @@ def callback(response): raw_response.append(raw_model) raw_response.append(custom_model) - model = await client.train_model(container_sas_url, use_training_labels=True, cls=callback) + poller = await client.begin_training(container_sas_url, use_training_labels=True, cls=callback) + model = await poller.result() + raw_model = raw_response[0] custom_model = raw_response[1] self.assertModelTransformCorrect(custom_model, raw_model) @@ -194,13 +205,28 @@ def callback(response): @GlobalTrainingAccountPreparer() async def test_training_with_files_filter(self, client, container_sas_url): - model = await client.train_model(training_files_url=container_sas_url, use_training_labels=False, include_sub_folders=True) + poller = await client.begin_training(training_files_url=container_sas_url, use_training_labels=False, include_sub_folders=True) + model = await poller.result() self.assertEqual(len(model.training_documents), 6) self.assertEqual(model.training_documents[-1].document_name, "subfolder/Form_6.jpg") # we traversed subfolders - model = await client.train_model(container_sas_url, use_training_labels=False, prefix="subfolder", include_sub_folders=True) + poller = await client.begin_training(container_sas_url, use_training_labels=False, prefix="subfolder", include_sub_folders=True) + model = await poller.result() self.assertEqual(len(model.training_documents), 1) self.assertEqual(model.training_documents[0].document_name, "subfolder/Form_6.jpg") # we filtered for only subfolders with self.assertRaises(HttpResponseError): - model = await client.train_model(training_files_url=container_sas_url, use_training_labels=False, prefix="xxx") + poller = await client.begin_training(training_files_url=container_sas_url, use_training_labels=False, prefix="xxx") + model = await poller.result() + + @GlobalFormRecognizerAccountPreparer() + @GlobalTrainingAccountPreparer() + @pytest.mark.live_test_only + async def test_training_continuation_token(self, client, container_sas_url): + + initial_poller = await client.begin_training(training_files_url=container_sas_url, use_training_labels=False) + cont_token = initial_poller.continuation_token() + poller = await client.begin_training(training_files_url=container_sas_url, use_training_labels=False, continuation_token=cont_token) + result = await poller.result() + self.assertIsNotNone(result) + await initial_poller.wait() # necessary so azure-devtools doesn't throw assertion error diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/testcase.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/testcase.py index bdc95253117a..708950a652ad 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/testcase.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/testcase.py @@ -43,11 +43,12 @@ def process_response(self, response): import json try: body = json.loads(response['body']['string']) - body['accessToken'] = self._replacement + if 'accessToken' in body: + body['accessToken'] = self._replacement + response['body']['string'] = json.dumps(body) + return response except (KeyError, ValueError): return response - response['body']['string'] = json.dumps(body) - return response class FakeTokenCredential(object): @@ -262,10 +263,10 @@ def assertReceiptItemsTransformCorrect(self, items, actual_items, read_results=N actual = actual_items.value_array for r, a in zip(items, actual): - self.assertFormFieldTransformCorrect(r.name, a.value_object.get("Name"), read_results) - self.assertFormFieldTransformCorrect(r.quantity, a.value_object.get("Quantity"), read_results) - self.assertFormFieldTransformCorrect(r.total_price, a.value_object.get("TotalPrice"), read_results) - self.assertFormFieldTransformCorrect(r.price, a.value_object.get("Price"), read_results) + self.assertFormFieldTransformCorrect(r.value.get("Name"), a.value_object.get("Name"), read_results) + self.assertFormFieldTransformCorrect(r.value.get("Quantity"), a.value_object.get("Quantity"), read_results) + self.assertFormFieldTransformCorrect(r.value.get("TotalPrice"), a.value_object.get("TotalPrice"), read_results) + self.assertFormFieldTransformCorrect(r.value.get("Price"), a.value_object.get("Price"), read_results) def assertTablesTransformCorrect(self, layout, actual_layout, read_results=None, **kwargs): for table, actual_table in zip(layout, actual_layout): @@ -287,24 +288,24 @@ def assertTablesTransformCorrect(self, layout, actual_layout, read_results=None, def assertReceiptItemsHasValues(self, items, page_number, include_text_content): for item in items: - self.assertBoundingBoxHasPoints(item.name.value_data.bounding_box) - self.assertIsNotNone(item.name.confidence) - self.assertIsNotNone(item.name.value_data.text) - self.assertBoundingBoxHasPoints(item.quantity.value_data.bounding_box) - self.assertIsNotNone(item.quantity.confidence) - self.assertIsNotNone(item.quantity.value_data.text) - self.assertBoundingBoxHasPoints(item.total_price.value_data.bounding_box) - self.assertIsNotNone(item.total_price.confidence) - self.assertIsNotNone(item.total_price.value_data.text) + self.assertBoundingBoxHasPoints(item.value.get("Name").value_data.bounding_box) + self.assertIsNotNone(item.value.get("Name").confidence) + self.assertIsNotNone(item.value.get("Name").value_data.text) + self.assertBoundingBoxHasPoints(item.value.get("Quantity").value_data.bounding_box) + self.assertIsNotNone(item.value.get("Quantity").confidence) + self.assertIsNotNone(item.value.get("Quantity").value_data.text) + self.assertBoundingBoxHasPoints(item.value.get("TotalPrice").value_data.bounding_box) + self.assertIsNotNone(item.value.get("TotalPrice").confidence) + self.assertIsNotNone(item.value.get("TotalPrice").value_data.text) if include_text_content: - self.assertTextContentHasValues(item.name.value_data.text_content, page_number) - self.assertTextContentHasValues(item.name.value_data.text_content, page_number) - self.assertTextContentHasValues(item.name.value_data.text_content, page_number) + self.assertTextContentHasValues(item.value.get("Name").value_data.text_content, page_number) + self.assertTextContentHasValues(item.value.get("Name").value_data.text_content, page_number) + self.assertTextContentHasValues(item.value.get("Name").value_data.text_content, page_number) else: - self.assertIsNone(item.name.value_data.text_content) - self.assertIsNone(item.name.value_data.text_content) - self.assertIsNone(item.name.value_data.text_content) + self.assertIsNone(item.value.get("Name").value_data.text_content) + self.assertIsNone(item.value.get("Name").value_data.text_content) + self.assertIsNone(item.value.get("Name").value_data.text_content) def assertBoundingBoxHasPoints(self, box): if box is None: diff --git a/sdk/hdinsight/azure-mgmt-hdinsight/dev_requirements.txt b/sdk/hdinsight/azure-mgmt-hdinsight/dev_requirements.txt index b0c11033324b..99233514bcb6 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsight/dev_requirements.txt +++ b/sdk/hdinsight/azure-mgmt-hdinsight/dev_requirements.txt @@ -2,4 +2,5 @@ -e ../../core/azure-core -e ../../keyvault/azure-keyvault-keys -e ../../keyvault/azure-mgmt-keyvault +-e ../../loganalytics/azure-mgmt-loganalytics -e ../../resources/azure-mgmt-msi/ \ No newline at end of file diff --git a/sdk/hdinsight/azure-mgmt-hdinsight/test/recordings/test_mgmt_hdinsight.test_create_kafka_cluster_with_disk_encryption.yaml b/sdk/hdinsight/azure-mgmt-hdinsight/test/recordings/test_mgmt_hdinsight.test_create_kafka_cluster_with_disk_encryption.yaml index 216003de85b0..e37fcc777277 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsight/test/recordings/test_mgmt_hdinsight.test_create_kafka_cluster_with_disk_encryption.yaml +++ b/sdk/hdinsight/azure-mgmt-hdinsight/test/recordings/test_mgmt_hdinsight.test_create_kafka_cluster_with_disk_encryption.yaml @@ -2,31 +2,52 @@ interactions: - request: body: '{"location": "North Central US"}' headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['32'] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-msi/0.2.0 Azure-SDK-For-Python] - accept-language: [en-US] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '32' + Content-Type: + - application/json; charset=utf-8 + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-msi/1.0.0 Azure-SDK-For-Python + accept-language: + - en-US method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-8ce41b44/providers/Microsoft.ManagedIdentity/userAssignedIdentities/hdipyuai8ce41b44?api-version=2015-08-31-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-8ce41b44/providers/Microsoft.ManagedIdentity/userAssignedIdentities/hdipyuai8ce41b44?api-version=2018-11-30 response: - body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/hdipy-8ce41b44/providers/Microsoft.ManagedIdentity/userAssignedIdentities/hdipyuai8ce41b44","name":"hdipyuai8ce41b44","type":"Microsoft.ManagedIdentity/userAssignedIdentities","location":"northcentralus","tags":{},"properties":{"tenantId":"00000000-0000-0000-0000-000000000000","principalId":"52397674-1024-43c0-8826-a57b80ca8a39","clientId":"998e4f8e-72c2-439d-86e2-5f1e13db642d","clientSecretUrl":"https://control-northcentralus.identity.azure.net/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/hdipy-8ce41b44/providers/Microsoft.ManagedIdentity/userAssignedIdentities/hdipyuai8ce41b44/credentials?tid=00000000-0000-0000-0000-000000000000&oid=52397674-1024-43c0-8826-a57b80ca8a39&aid=998e4f8e-72c2-439d-86e2-5f1e13db642d"}}'} - headers: - cache-control: [no-cache] - content-length: ['818'] - content-type: [application/json; charset=utf-8] - date: ['Fri, 28 Dec 2018 09:03:00 GMT'] - expires: ['-1'] - location: [/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/hdipy-8ce41b44/providers/Microsoft.ManagedIdentity/userAssignedIdentities/hdipyuai8ce41b44] - pragma: [no-cache] - server: [Microsoft-HTTPAPI/2.0] - strict-transport-security: [max-age=31536000; includeSubDomains] - x-content-type-options: [nosniff] - x-ms-ratelimit-remaining-subscription-writes: ['1199'] - status: {code: 201, message: Created} + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/hdipy-8ce41b44/providers/Microsoft.ManagedIdentity/userAssignedIdentities/hdipyuai8ce41b44","name":"hdipyuai8ce41b44","type":"Microsoft.ManagedIdentity/userAssignedIdentities","location":"northcentralus","tags":{},"properties":{"tenantId":"00000000-0000-0000-0000-000000000000","principalId":"1b11ead4-22b6-4384-a14d-d081131fad4b","clientId":"1b12fe54-7b96-47a6-8f1b-ba1938623b65"}}' + headers: + cache-control: + - no-cache + content-length: + - '456' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 12:40:40 GMT + expires: + - '-1' + location: + - /subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/hdipy-8ce41b44/providers/Microsoft.ManagedIdentity/userAssignedIdentities/hdipyuai8ce41b44 + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created - request: body: 'b''b\''b\\\''{"location": "North Central US", "properties": {"tenantId": "00000000-0000-0000-0000-000000000000", "sku": {"family": "A", "name": "premium"}, @@ -40,104 +61,221 @@ interactions: "backup", "restore"], "storage": ["get", "list", "delete", "set", "update", "regeneratekey", "recover", "purge", "backup", "restore", "setsas", "listsas", "getsas", "deletesas"]}}, {"tenantId": "00000000-0000-0000-0000-000000000000", - "objectId": "52397674-1024-43c0-8826-a57b80ca8a39", "permissions": {"keys": + "objectId": "1b11ead4-22b6-4384-a14d-d081131fad4b", "permissions": {"keys": ["get", "wrapKey", "unwrapKey"], "secrets": ["get", "set", "delete"]}}], "vaultUri": - "https://hdipy8ce41b44.vault.azure.net/", "enabledForDeployment": true, "enabledForDiskEncryption": - true, "enabledForTemplateDeployment": true, "enableSoftDelete": true}}\\\''\''''' - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['1291'] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-keyvault/1.1.0 Azure-SDK-For-Python] - accept-language: [en-US] + "https://hdipy8ce41b44..vault.azure.net/", "enabledForDeployment": true, "enabledForDiskEncryption": + true, "enabledForTemplateDeployment": true, "enableSoftDelete": true, "softDeleteRetentionInDays": + 90, "enableRbacAuthorization": false}}\\\''\''''' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '1358' + Content-Type: + - application/json; charset=utf-8 + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-keyvault/2.2.0 Azure-SDK-For-Python + accept-language: + - en-US method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-8ce41b44/providers/Microsoft.KeyVault/vaults/hdipy8ce41b44?api-version=2018-02-14 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-8ce41b44/providers/Microsoft.KeyVault/vaults/hdipy8ce41b44?api-version=2019-09-01 response: - body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-8ce41b44/providers/Microsoft.KeyVault/vaults/hdipy8ce41b44","name":"hdipy8ce41b44","type":"Microsoft.KeyVault/vaults","location":"North - Central US","tags":{},"properties":{"sku":{"family":"A","name":"premium"},"tenantId":"00000000-0000-0000-0000-000000000000","accessPolicies":[{"tenantId":"00000000-0000-0000-0000-000000000000","objectId":"00000000-0000-0000-0000-000000000000","permissions":{"keys":["encrypt","decrypt","wrapKey","unwrapKey","sign","verify","get","list","create","update","import","delete","backup","restore","recover","purge"],"secrets":["get","list","set","delete","backup","restore","recover","purge"],"certificates":["get","list","delete","create","import","update","managecontacts","getissuers","listissuers","setissuers","deleteissuers","manageissuers","recover","purge","backup","restore"],"storage":["get","list","delete","set","update","regeneratekey","recover","purge","backup","restore","setsas","listsas","getsas","deletesas"]}},{"tenantId":"00000000-0000-0000-0000-000000000000","objectId":"52397674-1024-43c0-8826-a57b80ca8a39","permissions":{"keys":["get","wrapKey","unwrapKey"],"secrets":["get","set","delete"]}}],"enabledForDeployment":true,"enabledForDiskEncryption":true,"enabledForTemplateDeployment":true,"enableSoftDelete":true,"vaultUri":"https://hdipy8ce41b44.vault.azure.net/","provisioningState":"Succeeded"}}'} - headers: - cache-control: [no-cache] - content-length: ['1434'] - content-type: [application/json; charset=utf-8] - date: ['Fri, 28 Dec 2018 09:03:02 GMT'] - expires: ['-1'] - pragma: [no-cache] - server: [Microsoft-IIS/10.0] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-aspnet-version: [4.0.30319] - x-content-type-options: [nosniff] - x-ms-keyvault-service-version: [1.1.0.235] - x-ms-ratelimit-remaining-subscription-writes: ['1199'] - x-powered-by: [ASP.NET] - status: {code: 200, message: OK} + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-8ce41b44/providers/Microsoft.KeyVault/vaults/hdipy8ce41b44","name":"hdipy8ce41b44","type":"Microsoft.KeyVault/vaults","location":"North + Central US","tags":{},"properties":{"sku":{"family":"A","name":"premium"},"tenantId":"00000000-0000-0000-0000-000000000000","accessPolicies":[{"tenantId":"00000000-0000-0000-0000-000000000000","objectId":"00000000-0000-0000-0000-000000000000","permissions":{"keys":["encrypt","decrypt","wrapKey","unwrapKey","sign","verify","get","list","create","update","import","delete","backup","restore","recover","purge"],"secrets":["get","list","set","delete","backup","restore","recover","purge"],"certificates":["get","list","delete","create","import","update","managecontacts","getissuers","listissuers","setissuers","deleteissuers","manageissuers","recover","purge","backup","restore"],"storage":["get","list","delete","set","update","regeneratekey","recover","purge","backup","restore","setsas","listsas","getsas","deletesas"]}},{"tenantId":"00000000-0000-0000-0000-000000000000","objectId":"1b11ead4-22b6-4384-a14d-d081131fad4b","permissions":{"keys":["get","wrapKey","unwrapKey"],"secrets":["get","set","delete"]}}],"enabledForDeployment":true,"enabledForDiskEncryption":true,"enabledForTemplateDeployment":true,"enableSoftDelete":true,"softDeleteRetentionInDays":90,"enableRbacAuthorization":false,"vaultUri":"https://hdipy8ce41b44..vault.azure.net/","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '1497' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 12:40:43 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-aspnet-version: + - 4.0.30319 + x-content-type-options: + - nosniff + x-ms-keyvault-service-version: + - 1.1.0.281 + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK - request: - body: '' - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: [0] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-keyvault/7.0 Azure-SDK-For-Python] - accept-language: [en-US] + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Content-Type: + - application/json; charset=utf-8 + User-Agent: + - azsdk-python-keyvault-keys/4.2.0b2 Python/3.7.4 (Windows-10-10.0.18362-SP0) + method: POST + uri: https://hdipy8ce41b44..vault.azure.net/keys/hdipykey18ce41b44/create?api-version=7.1-preview + response: + body: + string: '{"error":{"code":"Unauthorized","message":"Request is missing a Bearer + or PoP token."}}' + headers: + cache-control: + - no-cache + content-length: + - '87' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 12:40:45 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000;includeSubDomains + www-authenticate: + - Bearer authorization="https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47", + resource="https://vault.azure.net" + x-aspnet-version: + - 4.0.30319 + x-content-type-options: + - nosniff + x-ms-keyvault-network-info: + - conn_type=Ipv4;addr=167.220.232.23;act_addr_fam=InterNetwork; + x-ms-keyvault-region: + - North Central US + x-ms-keyvault-service-version: + - 1.1.5.0 + x-powered-by: + - ASP.NET + status: + code: 401 + message: Unauthorized +- request: + body: '{"kty": "RSA"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '14' + Content-Type: + - application/json; charset=utf-8 + User-Agent: + - azsdk-python-keyvault-keys/4.2.0b2 Python/3.7.4 (Windows-10-10.0.18362-SP0) method: POST - uri: https://hdipy8ce41b44.vault.azure.net/keys/hdipykey18ce41b44/create?api-version=7.0 + uri: https://hdipy8ce41b44..vault.azure.net/keys/hdipykey18ce41b44/create?api-version=7.1-preview response: - body: {string: ''} - headers: - cache-control: [no-cache] - content-length: ['0'] - date: ['Fri, 28 Dec 2018 09:03:02 GMT'] - expires: ['-1'] - pragma: [no-cache] - server: [Microsoft-IIS/10.0] - strict-transport-security: [max-age=31536000;includeSubDomains] - www-authenticate: ['Bearer authorization="https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47", - resource="https://vault.azure.net"'] - x-aspnet-version: [4.0.30319] - x-content-type-options: [nosniff] - x-ms-keyvault-network-info: [addr=131.107.160.11;act_addr_fam=InterNetwork;] - x-ms-keyvault-region: [North Central US] - x-ms-keyvault-service-version: [1.1.0.859] - x-powered-by: [ASP.NET] - status: {code: 401, message: Unauthorized} + body: + string: '{"key":{"kid":"https://hdipy8ce41b44..vault.azure.net/keys/hdipykey18ce41b44/830e48e217534b51ad2ddcf2f1ce4adb","kty":"RSA","key_ops":["encrypt","decrypt","sign","verify","wrapKey","unwrapKey"],"n":"kJXp3s-u1l_J8ZZqF_pXPe--esCwOTzMqX_5W_XzTx_KEdjxYPM7NzpOGCbATR_CGfNONEnW5he_mb8_Ky9MVkfC3AdBKAY7d40AdFel04titIB8RSHg3u5ZMqZV8UVAyKB9huwjeFxsEK8uxHHsJU5-Mnq-SdNKsdAnREz0mW8YHt41IXB95G7iz0_nx_KyuDcwomy5lT-f_RCkO08CRVm-VmjBvvHiXfgmTedmcHn6LWgbMhbHIco_5YeMrOigXBOCkwFECq8ZgGnLurJR7Xj93vaW9pUmn2G0i32l8qmD12TgeFXiIRjmPAN2nA1iaIqy37nHROm_PvoB1F3Kcw","e":"AQAB"},"attributes":{"enabled":true,"created":1591188046,"updated":1591188046,"recoveryLevel":"Recoverable+Purgeable","recoverableDays":90}}' + headers: + cache-control: + - no-cache + content-length: + - '686' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 12:40:46 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000;includeSubDomains + x-aspnet-version: + - 4.0.30319 + x-content-type-options: + - nosniff + x-ms-keyvault-network-info: + - conn_type=Ipv4;addr=167.220.232.23;act_addr_fam=InterNetwork; + x-ms-keyvault-region: + - North Central US + x-ms-keyvault-service-version: + - 1.1.5.0 + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK - request: body: '{"kty": "RSA"}' headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['14'] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-keyvault/7.0 Azure-SDK-For-Python] - accept-language: [en-US] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '14' + Content-Type: + - application/json; charset=utf-8 + User-Agent: + - azsdk-python-keyvault-keys/4.2.0b2 Python/3.7.4 (Windows-10-10.0.18362-SP0) method: POST - uri: https://hdipy8ce41b44.vault.azure.net/keys/hdipykey18ce41b44/create?api-version=7.0 + uri: https://hdipy8ce41b44..vault.azure.net/keys/hdipykey28ce41b44/create?api-version=7.1-preview response: - body: {string: '{"key":{"kid":"https://hdipy8ce41b44.vault.azure.net/keys/hdipykey18ce41b44/8dc96189f25541c39c45221d01536eaf","kty":"RSA","key_ops":["encrypt","decrypt","sign","verify","wrapKey","unwrapKey"],"n":"3LMSjeDzM38A1tV4WxtHOeFFsmro8gw73flkzG0ZqtfKLwKeCv_DMQRQHypsGu8DEp62rxeogywUPryP9Gtgy7Oyo3h5NqnPjticEQAJOOcVJd6qY8cUsyo6au1ZxSUYWmHZ6TETTAy9IhM_eSQ0y7V6EWHWkJzDA3uJvN1vc47_Sfg8vfAuUyVRzVvhUlxOmlU88lgCxQXbw_B9mrQF0TYPJcL16_1UTvpkMcRsw-F7HXXejIx82ubW_K6J__WBxAxIKtpaUZHL_qM1iSxkmLmALhp4KckHR8i8kJzJ6Zxps_QU_Hgph72MktFmrlkUJ2sXBuNWXq-siwZfALD65w","e":"AQAB"},"attributes":{"enabled":true,"created":1545987783,"updated":1545987783,"recoveryLevel":"Recoverable+Purgeable"}}'} - headers: - cache-control: [no-cache] - content-length: ['665'] - content-type: [application/json; charset=utf-8] - date: ['Fri, 28 Dec 2018 09:03:03 GMT'] - expires: ['-1'] - pragma: [no-cache] - server: [Microsoft-IIS/10.0] - strict-transport-security: [max-age=31536000;includeSubDomains] - x-aspnet-version: [4.0.30319] - x-content-type-options: [nosniff] - x-ms-keyvault-network-info: [addr=131.107.160.11;act_addr_fam=InterNetwork;] - x-ms-keyvault-region: [North Central US] - x-ms-keyvault-service-version: [1.1.0.859] - x-powered-by: [ASP.NET] - status: {code: 200, message: OK} + body: + string: '{"key":{"kid":"https://hdipy8ce41b44..vault.azure.net/keys/hdipykey28ce41b44/58ef873805c14c5a9d292aaa20f10ccb","kty":"RSA","key_ops":["encrypt","decrypt","sign","verify","wrapKey","unwrapKey"],"n":"1IZKlVmqnmWJ7oONmq1Dtq_IQlsxpt6V4dNNatRHwFK8agwSBKdqZJJZsuEeMMwfwvMaaW-jMFjMnBmho_9Nvim3dLRZYOmu7PFDKex3DY8OMmQUWuWNhMHubE8dIZl_GakpUUQRE55AFUfjIBp-cnPsdHP-FRM1YjoCld6y0ev_u7SWk9jgDFgxoPU7UNNRKWtcIfCVFSYsd7EtKe1BmrMh_OvH86bh6O1M76zqjOUOmQo8gcUGhobYM6FL7EfuIZpbfrHrydWAqiaq19tpgbBscoXaruZFSNJxAEI_cogLjXYDvLQ7g3_SrvIzkR_5LqLjDSNfbFLfvp8Egk7TOw","e":"AQAB"},"attributes":{"enabled":true,"created":1591188047,"updated":1591188047,"recoveryLevel":"Recoverable+Purgeable","recoverableDays":90}}' + headers: + cache-control: + - no-cache + content-length: + - '686' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 12:40:46 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000;includeSubDomains + x-aspnet-version: + - 4.0.30319 + x-content-type-options: + - nosniff + x-ms-keyvault-network-info: + - conn_type=Ipv4;addr=167.220.232.23;act_addr_fam=InterNetwork; + x-ms-keyvault-region: + - North Central US + x-ms-keyvault-service-version: + - 1.1.5.0 + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK - request: body: 'b''b\''{"location": "North Central US", "tags": {}, "properties": {"clusterVersion": "3.6", "osType": "Linux", "tier": "Standard", "clusterDefinition": {"kind": @@ -151,919 +289,1633 @@ interactions: "dataDisksGroups": [{"disksPerNode": 8}]}, {"name": "zookeepernode", "targetInstanceCount": 3, "hardwareProfile": {"vmSize": "Small"}, "osProfile": {"linuxOperatingSystemProfile": {"username": "sshuser", "password": "Password1!"}}}]}, "storageProfile": {"storageaccounts": - [{"name": "hdipy8ce41b44.blob.core.windows.net", "isDefault": true, "container": - "hdisdk-kafka-byok8ce41b44", "key": "8Tm/F1xWzEjObfavswhyUl2S08j8goN7EBeN0Gf4nkcoLQ1IXNjUeNRixNIFS6fFK+us/CapU7rcfU73JKoMRg=="}]}, - "diskEncryptionProperties": {"vaultUri": "https://hdipy8ce41b44.vault.azure.net", - "keyName": "hdipykey18ce41b44", "keyVersion": "8dc96189f25541c39c45221d01536eaf", - "msiResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/hdipy-8ce41b44/providers/Microsoft.ManagedIdentity/userAssignedIdentities/hdipyuai8ce41b44"}}, + [{"name": "hdipy.blob.core.windows.net", "isDefault": true, "container": "hdisdk-kafka-byok8ce41b44", + "key": "4NAmrBx8TObfhTYfdNvPiwtd4P0H18hvmoa079B8eeyJobqs42ORlgtCDXOmLKYavC1sehvmksuCAPbjvuSiyA=="}]}, + "diskEncryptionProperties": {"vaultUri": "https://hdipy8ce41b44..vault.azure.net", "keyName": + "hdipykey18ce41b44", "keyVersion": "830e48e217534b51ad2ddcf2f1ce4adb", "msiResourceId": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/hdipy-8ce41b44/providers/Microsoft.ManagedIdentity/userAssignedIdentities/hdipyuai8ce41b44"}}, "identity": {"type": "UserAssigned", "userAssignedIdentities": {"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/hdipy-8ce41b44/providers/Microsoft.ManagedIdentity/userAssignedIdentities/hdipyuai8ce41b44": {}}}}\''''' headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['1781'] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - accept-language: [en-US] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '1781' + Content-Type: + - application/json; charset=utf-8 + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.4.0 Azure-SDK-For-Python + accept-language: + - en-US method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-8ce41b44/providers/Microsoft.HDInsight/clusters/hdisdk-kafka-byok8ce41b44?api-version=2018-06-01-preview response: - body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-8ce41b44/providers/Microsoft.HDInsight/clusters/hdisdk-kafka-byok8ce41b44","name":"hdisdk-kafka-byok8ce41b44","type":"Microsoft.HDInsight/clusters","location":"North - Central US","etag":"8b2fc785-1ec8-4e36-874a-1793259f42bd","tags":{},"properties":{"clusterVersion":"3.6.1000.67","clusterHdpVersion":"","osType":"Linux","clusterDefinition":{"blueprint":"https://blueprints.azurehdinsight.net/kafka-3.6.1000.67.1812120705.json","kind":"Kafka","componentVersion":{"Kafka":"1.1"}},"computeProfile":{"roles":[{"name":"headnode","targetInstanceCount":2,"hardwareProfile":{"vmSize":"Large"},"osProfile":{"linuxOperatingSystemProfile":{"username":"sshuser"}},"encryptDataDisks":false},{"name":"workernode","targetInstanceCount":3,"hardwareProfile":{"vmSize":"Large"},"osProfile":{"linuxOperatingSystemProfile":{"username":"sshuser"}},"dataDisksGroups":[{"disksPerNode":8,"storageAccountType":"Standard_LRS","diskSizeGB":1023}],"encryptDataDisks":false},{"name":"zookeepernode","targetInstanceCount":3,"hardwareProfile":{"vmSize":"Small"},"osProfile":{"linuxOperatingSystemProfile":{"username":"sshuser"}},"encryptDataDisks":false}]},"provisioningState":"InProgress","clusterState":"Accepted","createdDate":"2018-12-28T09:03:10.693","quotaInfo":{"coresUsed":23},"tier":"standard","diskEncryptionProperties":{"vaultUri":"https://hdipy8ce41b44.vault.azure.net","keyName":"hdipykey18ce41b44","keyVersion":"8dc96189f25541c39c45221d01536eaf","encryptionAlgorithm":"RSA-OAEP","msiResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/hdipy-8ce41b44/providers/microsoft.managedidentity/userassignedidentities/hdipyuai8ce41b44"}},"identity":{"type":"UserAssigned","userAssignedIdentities":{"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/hdipy-8ce41b44/providers/microsoft.managedidentity/userassignedidentities/hdipyuai8ce41b44":{}}}}'} - headers: - azure-asyncoperation: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-8ce41b44/providers/Microsoft.HDInsight/clusters/hdisdk-kafka-byok8ce41b44/azureasyncoperations/create?api-version=2018-06-01-preview'] - cache-control: [no-cache] - content-length: ['1944'] - content-type: [application/json; charset=utf-8] - date: ['Fri, 28 Dec 2018 09:03:10 GMT'] - etag: ['"8b2fc785-1ec8-4e36-874a-1793259f42bd"'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-clusteruri: ['https://management.azure.com/subscriptions/964c10bb-8a6c-43bc-83d3-6b318c6c7305/resourceGroups/hdipy-8ce41b44/providers/Microsoft.HDInsight/clusters/hdisdk-kafka-byok8ce41b44?api-version=2018-06-01-preview'] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - x-ms-ratelimit-remaining-subscription-writes: ['1199'] - status: {code: 200, message: OK} + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-8ce41b44/providers/Microsoft.HDInsight/clusters/hdisdk-kafka-byok8ce41b44","name":"hdisdk-kafka-byok8ce41b44","type":"Microsoft.HDInsight/clusters","location":"North + Central US","etag":"2515b354-0de3-4b9d-be0c-f7df55badceb","tags":{},"properties":{"clusterVersion":"3.6.1000.67","clusterHdpVersion":"","osType":"Linux","clusterDefinition":{"blueprint":"https://blueprints.azurehdinsight.net/kafka-3.6.1000.67.2004291541.json","kind":"Kafka","componentVersion":{"Kafka":"1.1"}},"computeProfile":{"roles":[{"name":"headnode","targetInstanceCount":2,"hardwareProfile":{"vmSize":"standard_a4_v2"},"osProfile":{"linuxOperatingSystemProfile":{"username":"sshuser"}},"encryptDataDisks":false},{"name":"workernode","targetInstanceCount":3,"hardwareProfile":{"vmSize":"standard_a4_v2"},"osProfile":{"linuxOperatingSystemProfile":{"username":"sshuser"}},"dataDisksGroups":[{"disksPerNode":8,"storageAccountType":"Standard_LRS","diskSizeGB":1023}],"encryptDataDisks":false},{"name":"zookeepernode","targetInstanceCount":3,"hardwareProfile":{"vmSize":"standard_a1_v2"},"osProfile":{"linuxOperatingSystemProfile":{"username":"sshuser"}},"encryptDataDisks":false}]},"provisioningState":"InProgress","clusterState":"Accepted","createdDate":"2020-06-03T12:41:11.943","quotaInfo":{"coresUsed":23},"tier":"standard","diskEncryptionProperties":{"vaultUri":"https://hdipy8ce41b44..vault.azure.net","keyName":"hdipykey18ce41b44","keyVersion":"830e48e217534b51ad2ddcf2f1ce4adb","encryptionAlgorithm":"RSA-OAEP","msiResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/hdipy-8ce41b44/providers/microsoft.managedidentity/userassignedidentities/hdipyuai8ce41b44"},"storageProfile":{"storageaccounts":[{"name":"hdipy.blob.core.windows.net","resourceId":null,"msiResourceId":null,"key":null,"fileSystem":null,"container":"hdisdk-kafka-byok8ce41b44","saskey":null,"isDefault":true}]}},"identity":{"type":"UserAssigned","userAssignedIdentities":{"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/hdipy-8ce41b44/providers/microsoft.managedidentity/userassignedidentities/hdipyuai8ce41b44":{}}}}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-8ce41b44/providers/Microsoft.HDInsight/clusters/hdisdk-kafka-byok8ce41b44/azureasyncoperations/create?api-version=2018-06-01-preview + cache-control: + - no-cache + content-length: + - '2196' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 12:41:13 GMT + etag: + - '"2515b354-0de3-4b9d-be0c-f7df55badceb"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-clusteruri: + - https://management.azure.com/subscriptions/964c10bb-8a6c-43bc-83d3-6b318c6c7305/resourceGroups/hdipy-8ce41b44/providers/Microsoft.HDInsight/clusters/hdisdk-kafka-byok8ce41b44?api-version=2018-06-01-preview + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK - request: body: null headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.4.0 Azure-SDK-For-Python method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-8ce41b44/providers/Microsoft.HDInsight/clusters/hdisdk-kafka-byok8ce41b44/azureasyncoperations/create?api-version=2018-06-01-preview response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Fri, 28 Dec 2018 09:03:41 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} + body: + string: '{"status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 12:41:45 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + status: + code: 200 + message: OK - request: body: null headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.4.0 Azure-SDK-For-Python method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-8ce41b44/providers/Microsoft.HDInsight/clusters/hdisdk-kafka-byok8ce41b44/azureasyncoperations/create?api-version=2018-06-01-preview response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Fri, 28 Dec 2018 09:04:13 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} + body: + string: '{"status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 12:42:16 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + status: + code: 200 + message: OK - request: body: null headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.4.0 Azure-SDK-For-Python method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-8ce41b44/providers/Microsoft.HDInsight/clusters/hdisdk-kafka-byok8ce41b44/azureasyncoperations/create?api-version=2018-06-01-preview response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Fri, 28 Dec 2018 09:04:43 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} + body: + string: '{"status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 12:42:47 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + status: + code: 200 + message: OK - request: body: null headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.4.0 Azure-SDK-For-Python method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-8ce41b44/providers/Microsoft.HDInsight/clusters/hdisdk-kafka-byok8ce41b44/azureasyncoperations/create?api-version=2018-06-01-preview response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Fri, 28 Dec 2018 09:05:14 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} + body: + string: '{"status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 12:43:17 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + status: + code: 200 + message: OK - request: body: null headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.4.0 Azure-SDK-For-Python method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-8ce41b44/providers/Microsoft.HDInsight/clusters/hdisdk-kafka-byok8ce41b44/azureasyncoperations/create?api-version=2018-06-01-preview response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Fri, 28 Dec 2018 09:05:45 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} + body: + string: '{"status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 12:43:48 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + status: + code: 200 + message: OK - request: body: null headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.4.0 Azure-SDK-For-Python method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-8ce41b44/providers/Microsoft.HDInsight/clusters/hdisdk-kafka-byok8ce41b44/azureasyncoperations/create?api-version=2018-06-01-preview response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Fri, 28 Dec 2018 09:06:16 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} + body: + string: '{"status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 12:44:19 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + status: + code: 200 + message: OK - request: body: null headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.4.0 Azure-SDK-For-Python method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-8ce41b44/providers/Microsoft.HDInsight/clusters/hdisdk-kafka-byok8ce41b44/azureasyncoperations/create?api-version=2018-06-01-preview response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Fri, 28 Dec 2018 09:06:47 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} + body: + string: '{"status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 12:44:49 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + status: + code: 200 + message: OK - request: body: null headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.4.0 Azure-SDK-For-Python method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-8ce41b44/providers/Microsoft.HDInsight/clusters/hdisdk-kafka-byok8ce41b44/azureasyncoperations/create?api-version=2018-06-01-preview response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Fri, 28 Dec 2018 09:07:18 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} + body: + string: '{"status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 12:45:20 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + status: + code: 200 + message: OK - request: body: null headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.4.0 Azure-SDK-For-Python method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-8ce41b44/providers/Microsoft.HDInsight/clusters/hdisdk-kafka-byok8ce41b44/azureasyncoperations/create?api-version=2018-06-01-preview response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Fri, 28 Dec 2018 09:07:50 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} + body: + string: '{"status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 12:45:50 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + status: + code: 200 + message: OK - request: body: null headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.4.0 Azure-SDK-For-Python method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-8ce41b44/providers/Microsoft.HDInsight/clusters/hdisdk-kafka-byok8ce41b44/azureasyncoperations/create?api-version=2018-06-01-preview response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Fri, 28 Dec 2018 09:08:21 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} + body: + string: '{"status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 12:46:22 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + status: + code: 200 + message: OK - request: body: null headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.4.0 Azure-SDK-For-Python method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-8ce41b44/providers/Microsoft.HDInsight/clusters/hdisdk-kafka-byok8ce41b44/azureasyncoperations/create?api-version=2018-06-01-preview response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Fri, 28 Dec 2018 09:08:52 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} + body: + string: '{"status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 12:46:53 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + status: + code: 200 + message: OK - request: body: null headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.4.0 Azure-SDK-For-Python method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-8ce41b44/providers/Microsoft.HDInsight/clusters/hdisdk-kafka-byok8ce41b44/azureasyncoperations/create?api-version=2018-06-01-preview response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Fri, 28 Dec 2018 09:09:22 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} + body: + string: '{"status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 12:47:23 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + status: + code: 200 + message: OK - request: body: null headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.4.0 Azure-SDK-For-Python method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-8ce41b44/providers/Microsoft.HDInsight/clusters/hdisdk-kafka-byok8ce41b44/azureasyncoperations/create?api-version=2018-06-01-preview response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Fri, 28 Dec 2018 09:09:53 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} + body: + string: '{"status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 12:47:54 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + status: + code: 200 + message: OK - request: body: null headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.4.0 Azure-SDK-For-Python method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-8ce41b44/providers/Microsoft.HDInsight/clusters/hdisdk-kafka-byok8ce41b44/azureasyncoperations/create?api-version=2018-06-01-preview response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Fri, 28 Dec 2018 09:10:25 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} + body: + string: '{"status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 12:48:25 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + status: + code: 200 + message: OK - request: body: null headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.4.0 Azure-SDK-For-Python method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-8ce41b44/providers/Microsoft.HDInsight/clusters/hdisdk-kafka-byok8ce41b44/azureasyncoperations/create?api-version=2018-06-01-preview response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Fri, 28 Dec 2018 09:10:55 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} + body: + string: '{"status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 12:48:55 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + status: + code: 200 + message: OK - request: body: null headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.4.0 Azure-SDK-For-Python method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-8ce41b44/providers/Microsoft.HDInsight/clusters/hdisdk-kafka-byok8ce41b44/azureasyncoperations/create?api-version=2018-06-01-preview response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Fri, 28 Dec 2018 09:11:26 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} + body: + string: '{"status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 12:49:26 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + status: + code: 200 + message: OK - request: body: null headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.4.0 Azure-SDK-For-Python method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-8ce41b44/providers/Microsoft.HDInsight/clusters/hdisdk-kafka-byok8ce41b44/azureasyncoperations/create?api-version=2018-06-01-preview response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Fri, 28 Dec 2018 09:11:57 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} + body: + string: '{"status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 12:49:57 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + status: + code: 200 + message: OK - request: body: null headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.4.0 Azure-SDK-For-Python method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-8ce41b44/providers/Microsoft.HDInsight/clusters/hdisdk-kafka-byok8ce41b44/azureasyncoperations/create?api-version=2018-06-01-preview response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Fri, 28 Dec 2018 09:12:29 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} + body: + string: '{"status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 12:50:27 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + status: + code: 200 + message: OK - request: body: null headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.4.0 Azure-SDK-For-Python method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-8ce41b44/providers/Microsoft.HDInsight/clusters/hdisdk-kafka-byok8ce41b44/azureasyncoperations/create?api-version=2018-06-01-preview response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Fri, 28 Dec 2018 09:12:59 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} + body: + string: '{"status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 12:50:59 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + status: + code: 200 + message: OK - request: body: null headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.4.0 Azure-SDK-For-Python method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-8ce41b44/providers/Microsoft.HDInsight/clusters/hdisdk-kafka-byok8ce41b44/azureasyncoperations/create?api-version=2018-06-01-preview response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Fri, 28 Dec 2018 09:13:30 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} + body: + string: '{"status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 12:51:30 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + status: + code: 200 + message: OK - request: body: null headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.4.0 Azure-SDK-For-Python method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-8ce41b44/providers/Microsoft.HDInsight/clusters/hdisdk-kafka-byok8ce41b44/azureasyncoperations/create?api-version=2018-06-01-preview response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Fri, 28 Dec 2018 09:14:02 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} + body: + string: '{"status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 12:52:00 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + status: + code: 200 + message: OK - request: body: null headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.4.0 Azure-SDK-For-Python method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-8ce41b44/providers/Microsoft.HDInsight/clusters/hdisdk-kafka-byok8ce41b44/azureasyncoperations/create?api-version=2018-06-01-preview response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Fri, 28 Dec 2018 09:14:32 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} + body: + string: '{"status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 12:52:31 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + status: + code: 200 + message: OK - request: body: null headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.4.0 Azure-SDK-For-Python method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-8ce41b44/providers/Microsoft.HDInsight/clusters/hdisdk-kafka-byok8ce41b44/azureasyncoperations/create?api-version=2018-06-01-preview response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Fri, 28 Dec 2018 09:15:04 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} + body: + string: '{"status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 12:53:02 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + status: + code: 200 + message: OK - request: body: null headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.4.0 Azure-SDK-For-Python method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-8ce41b44/providers/Microsoft.HDInsight/clusters/hdisdk-kafka-byok8ce41b44/azureasyncoperations/create?api-version=2018-06-01-preview response: - body: {string: '{"status":"Succeeded"}'} - headers: - cache-control: [no-cache] - content-length: ['22'] - content-type: [application/json; charset=utf-8] - date: ['Fri, 28 Dec 2018 09:15:34 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} + body: + string: '{"status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 12:53:32 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + status: + code: 200 + message: OK - request: body: null headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.4.0 Azure-SDK-For-Python method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-8ce41b44/providers/Microsoft.HDInsight/clusters/hdisdk-kafka-byok8ce41b44?api-version=2018-06-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-8ce41b44/providers/Microsoft.HDInsight/clusters/hdisdk-kafka-byok8ce41b44/azureasyncoperations/create?api-version=2018-06-01-preview response: - body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-8ce41b44/providers/Microsoft.HDInsight/clusters/hdisdk-kafka-byok8ce41b44","name":"hdisdk-kafka-byok8ce41b44","type":"Microsoft.HDInsight/clusters","location":"North - Central US","etag":"8b2fc785-1ec8-4e36-874a-1793259f42bd","tags":{},"properties":{"clusterVersion":"3.6.1000.67","clusterHdpVersion":"2.6.5.3005-27","osType":"Linux","clusterDefinition":{"blueprint":"https://blueprints.azurehdinsight.net/kafka-3.6.1000.67.1812120705.json","kind":"Kafka","componentVersion":{"Kafka":"1.1"}},"computeProfile":{"roles":[{"name":"headnode","targetInstanceCount":2,"hardwareProfile":{"vmSize":"Large"},"osProfile":{"linuxOperatingSystemProfile":{"username":"sshuser"}},"encryptDataDisks":false},{"name":"workernode","targetInstanceCount":3,"hardwareProfile":{"vmSize":"Large"},"osProfile":{"linuxOperatingSystemProfile":{"username":"sshuser"}},"dataDisksGroups":[{"disksPerNode":8,"storageAccountType":"Standard_LRS","diskSizeGB":1023}],"encryptDataDisks":false},{"name":"zookeepernode","targetInstanceCount":3,"hardwareProfile":{"vmSize":"Small"},"osProfile":{"linuxOperatingSystemProfile":{"username":"sshuser"}},"encryptDataDisks":false}]},"provisioningState":"Succeeded","clusterState":"Running","createdDate":"2018-12-28T09:03:10.693","quotaInfo":{"coresUsed":23},"connectivityEndpoints":[{"name":"SSH","protocol":"TCP","location":"hdisdk-kafka-byok8ce41b44-ssh.azurehdinsight.net","port":22},{"name":"HTTPS","protocol":"TCP","location":"hdisdk-kafka-byok8ce41b44.azurehdinsight.net","port":443}],"tier":"standard","diskEncryptionProperties":{"vaultUri":"https://hdipy8ce41b44.vault.azure.net","keyName":"hdipykey18ce41b44","keyVersion":"8dc96189f25541c39c45221d01536eaf","encryptionAlgorithm":"RSA-OAEP","msiResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/hdipy-8ce41b44/providers/microsoft.managedidentity/userassignedidentities/hdipyuai8ce41b44"}},"identity":{"type":"UserAssigned","userAssignedIdentities":{"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/hdipy-8ce41b44/providers/microsoft.managedidentity/userassignedidentities/hdipyuai8ce41b44":{"principalId":"998e4f8e-72c2-439d-86e2-5f1e13db642d","tenantId":"00000000-0000-0000-0000-000000000000"}}}}'} - headers: - cache-control: [no-cache] - content-length: ['2290'] - content-type: [application/json; charset=utf-8] - date: ['Fri, 28 Dec 2018 09:15:35 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} + body: + string: '{"status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 12:54:02 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + status: + code: 200 + message: OK - request: - body: '{"kty": "RSA"}' + body: null headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['14'] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-keyvault/7.0 Azure-SDK-For-Python] - accept-language: [en-US] - method: POST - uri: https://hdipy8ce41b44.vault.azure.net/keys/hdipykey28ce41b44/create?api-version=7.0 + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.4.0 Azure-SDK-For-Python + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-8ce41b44/providers/Microsoft.HDInsight/clusters/hdisdk-kafka-byok8ce41b44/azureasyncoperations/create?api-version=2018-06-01-preview + response: + body: + string: '{"status":"Succeeded"}' + headers: + cache-control: + - no-cache + content-length: + - '22' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 12:54:34 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.4.0 Azure-SDK-For-Python + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-8ce41b44/providers/Microsoft.HDInsight/clusters/hdisdk-kafka-byok8ce41b44?api-version=2018-06-01-preview response: - body: {string: '{"key":{"kid":"https://hdipy8ce41b44.vault.azure.net/keys/hdipykey28ce41b44/0e4ed336f038445f9b32ccdccac2f769","kty":"RSA","key_ops":["encrypt","decrypt","sign","verify","wrapKey","unwrapKey"],"n":"sJvTRrrs49qVdFNsIgRy1JM1aPZ7ddfgD_achlCfJxjP94vMb1xxyUY_Rq1hP09nWxAEKczrfoq8TdGS0RjH1ATiJSZaZve_diBKVxyLrRDWOTOyWWOcWXcFBFM8_assu_fte8kvjgq6LQoRgj22QVFR_l8B-YlZ-5P2Ha1khPnkpsH48NCSFYSkCFDlutcDkp-ZD-aQ9JwR4vXBOwcUnTHwqMfF0o4x1EvVdILeDfMoNHk9hYXNLqx0tT9U8ScC4ULlJIyK_7rj8TMDGqXhlPmGqJz7_9udX5mXWu17QMZiHeZMAohXGt5GmlxCGUW5SATTdHlK1vJwsfD1f4HtJw","e":"AQAB"},"attributes":{"enabled":true,"created":1545988536,"updated":1545988536,"recoveryLevel":"Recoverable+Purgeable"}}'} - headers: - cache-control: [no-cache] - content-length: ['665'] - content-type: [application/json; charset=utf-8] - date: ['Fri, 28 Dec 2018 09:15:37 GMT'] - expires: ['-1'] - pragma: [no-cache] - server: [Microsoft-IIS/10.0] - strict-transport-security: [max-age=31536000;includeSubDomains] - x-aspnet-version: [4.0.30319] - x-content-type-options: [nosniff] - x-ms-keyvault-network-info: [addr=131.107.160.11;act_addr_fam=InterNetwork;] - x-ms-keyvault-region: [North Central US] - x-ms-keyvault-service-version: [1.1.0.859] - x-powered-by: [ASP.NET] - status: {code: 200, message: OK} + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-8ce41b44/providers/Microsoft.HDInsight/clusters/hdisdk-kafka-byok8ce41b44","name":"hdisdk-kafka-byok8ce41b44","type":"Microsoft.HDInsight/clusters","location":"North + Central US","etag":"2515b354-0de3-4b9d-be0c-f7df55badceb","tags":{},"properties":{"clusterVersion":"3.6.1000.67","clusterHdpVersion":"2.6.5.3022-3","osType":"Linux","clusterDefinition":{"blueprint":"https://blueprints.azurehdinsight.net/kafka-3.6.1000.67.2004291541.json","kind":"Kafka","componentVersion":{"Kafka":"1.1"}},"computeProfile":{"roles":[{"name":"headnode","targetInstanceCount":2,"hardwareProfile":{"vmSize":"standard_a4_v2"},"osProfile":{"linuxOperatingSystemProfile":{"username":"sshuser"}},"encryptDataDisks":false},{"name":"workernode","targetInstanceCount":3,"hardwareProfile":{"vmSize":"standard_a4_v2"},"osProfile":{"linuxOperatingSystemProfile":{"username":"sshuser"}},"dataDisksGroups":[{"disksPerNode":8,"storageAccountType":"Standard_LRS","diskSizeGB":1023}],"encryptDataDisks":false},{"name":"zookeepernode","targetInstanceCount":3,"hardwareProfile":{"vmSize":"standard_a1_v2"},"osProfile":{"linuxOperatingSystemProfile":{"username":"sshuser"}},"encryptDataDisks":false}]},"provisioningState":"Succeeded","clusterState":"Running","createdDate":"2020-06-03T12:41:11.943","quotaInfo":{"coresUsed":23},"connectivityEndpoints":[{"name":"SSH","protocol":"TCP","location":"hdisdk-kafka-byok8ce41b44-ssh.azurehdinsight.net","port":22},{"name":"HTTPS","protocol":"TCP","location":"hdisdk-kafka-byok8ce41b44.azurehdinsight.net","port":443}],"tier":"standard","diskEncryptionProperties":{"vaultUri":"https://hdipy8ce41b44..vault.azure.net","keyName":"hdipykey18ce41b44","keyVersion":"830e48e217534b51ad2ddcf2f1ce4adb","encryptionAlgorithm":"RSA-OAEP","msiResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/hdipy-8ce41b44/providers/microsoft.managedidentity/userassignedidentities/hdipyuai8ce41b44"},"storageProfile":{"storageaccounts":[{"name":"hdipy.blob.core.windows.net","resourceId":null,"msiResourceId":null,"key":null,"fileSystem":null,"container":"hdisdk-kafka-byok8ce41b44","saskey":null,"isDefault":true}]}},"identity":{"type":"UserAssigned","userAssignedIdentities":{"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/hdipy-8ce41b44/providers/microsoft.managedidentity/userassignedidentities/hdipyuai8ce41b44":{"principalId":"1b12fe54-7b96-47a6-8f1b-ba1938623b65","tenantId":"00000000-0000-0000-0000-000000000000"}}}}' + headers: + cache-control: + - no-cache + content-length: + - '2541' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 12:54:35 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + status: + code: 200 + message: OK - request: - body: '{"vaultUri": "https://hdipy8ce41b44.vault.azure.net", "keyName": "hdipykey28ce41b44", - "keyVersion": "0e4ed336f038445f9b32ccdccac2f769"}' - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['135'] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - accept-language: [en-US] + body: 'b''{"vaultUri": "https://hdipy8ce41b44..vault.azure.net", "keyName": "hdipykey28ce41b44", + "keyVersion": "58ef873805c14c5a9d292aaa20f10ccb"}''' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '135' + Content-Type: + - application/json; charset=utf-8 + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.4.0 Azure-SDK-For-Python + accept-language: + - en-US method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-8ce41b44/providers/Microsoft.HDInsight/clusters/hdisdk-kafka-byok8ce41b44/rotatediskencryptionkey?api-version=2018-06-01-preview response: - body: {string: ''} - headers: - azure-asyncoperation: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-8ce41b44/providers/Microsoft.HDInsight/clusters/hdisdk-kafka-byok8ce41b44/azureasyncoperations/3ff45ea6-0c3f-4988-9057-03f87d333490-0-r?api-version=2018-06-01-preview'] - cache-control: [no-cache] - content-length: ['0'] - date: ['Fri, 28 Dec 2018 09:15:39 GMT'] - expires: ['-1'] - location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-8ce41b44/providers/Microsoft.HDInsight/clusters/hdisdk-kafka-byok8ce41b44/operationresults/3ff45ea6-0c3f-4988-9057-03f87d333490-0-r?api-version=2018-06-01-preview'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - x-ms-ratelimit-remaining-subscription-writes: ['1199'] - status: {code: 202, message: Accepted} + body: + string: '' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-8ce41b44/providers/Microsoft.HDInsight/clusters/hdisdk-kafka-byok8ce41b44/azureasyncoperations/9c89483a-13d2-4a90-bbd3-378115386b55-0-r?api-version=2018-06-01-preview + cache-control: + - no-cache + content-length: + - '0' + date: + - Wed, 03 Jun 2020 12:54:37 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-8ce41b44/providers/Microsoft.HDInsight/clusters/hdisdk-kafka-byok8ce41b44/operationresults/9c89483a-13d2-4a90-bbd3-378115386b55-0-r?api-version=2018-06-01-preview + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 202 + message: Accepted - request: body: null headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.4.0 Azure-SDK-For-Python method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-8ce41b44/providers/Microsoft.HDInsight/clusters/hdisdk-kafka-byok8ce41b44/azureasyncoperations/3ff45ea6-0c3f-4988-9057-03f87d333490-0-r?api-version=2018-06-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-8ce41b44/providers/Microsoft.HDInsight/clusters/hdisdk-kafka-byok8ce41b44/azureasyncoperations/9c89483a-13d2-4a90-bbd3-378115386b55-0-r?api-version=2018-06-01-preview response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Fri, 28 Dec 2018 09:16:40 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} + body: + string: '{"status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 12:55:39 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + status: + code: 200 + message: OK - request: body: null headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.4.0 Azure-SDK-For-Python method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-8ce41b44/providers/Microsoft.HDInsight/clusters/hdisdk-kafka-byok8ce41b44/azureasyncoperations/3ff45ea6-0c3f-4988-9057-03f87d333490-0-r?api-version=2018-06-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-8ce41b44/providers/Microsoft.HDInsight/clusters/hdisdk-kafka-byok8ce41b44/azureasyncoperations/9c89483a-13d2-4a90-bbd3-378115386b55-0-r?api-version=2018-06-01-preview response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Fri, 28 Dec 2018 09:17:11 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} + body: + string: '{"status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 12:56:09 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + status: + code: 200 + message: OK - request: body: null headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.4.0 Azure-SDK-For-Python method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-8ce41b44/providers/Microsoft.HDInsight/clusters/hdisdk-kafka-byok8ce41b44/azureasyncoperations/3ff45ea6-0c3f-4988-9057-03f87d333490-0-r?api-version=2018-06-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-8ce41b44/providers/Microsoft.HDInsight/clusters/hdisdk-kafka-byok8ce41b44/azureasyncoperations/9c89483a-13d2-4a90-bbd3-378115386b55-0-r?api-version=2018-06-01-preview response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Fri, 28 Dec 2018 09:17:41 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} + body: + string: '{"status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 12:56:40 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + status: + code: 200 + message: OK - request: body: null headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.4.0 Azure-SDK-For-Python method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-8ce41b44/providers/Microsoft.HDInsight/clusters/hdisdk-kafka-byok8ce41b44/azureasyncoperations/3ff45ea6-0c3f-4988-9057-03f87d333490-0-r?api-version=2018-06-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-8ce41b44/providers/Microsoft.HDInsight/clusters/hdisdk-kafka-byok8ce41b44/azureasyncoperations/9c89483a-13d2-4a90-bbd3-378115386b55-0-r?api-version=2018-06-01-preview response: - body: {string: '{"status":"Succeeded"}'} - headers: - cache-control: [no-cache] - content-length: ['22'] - content-type: [application/json; charset=utf-8] - date: ['Fri, 28 Dec 2018 09:18:12 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} + body: + string: '{"status":"Succeeded"}' + headers: + cache-control: + - no-cache + content-length: + - '22' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 12:57:10 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + status: + code: 200 + message: OK - request: body: null headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - accept-language: [en-US] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.4.0 Azure-SDK-For-Python + accept-language: + - en-US method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-8ce41b44/providers/Microsoft.HDInsight/clusters/hdisdk-kafka-byok8ce41b44?api-version=2018-06-01-preview response: - body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-8ce41b44/providers/Microsoft.HDInsight/clusters/hdisdk-kafka-byok8ce41b44","name":"hdisdk-kafka-byok8ce41b44","type":"Microsoft.HDInsight/clusters","location":"North - Central US","etag":"8b2fc785-1ec8-4e36-874a-1793259f42bd","tags":{},"properties":{"clusterVersion":"3.6.1000.67","clusterHdpVersion":"2.6.5.3005-27","osType":"Linux","clusterDefinition":{"blueprint":"https://blueprints.azurehdinsight.net/kafka-3.6.1000.67.1812120705.json","kind":"Kafka","componentVersion":{"Kafka":"1.1"}},"computeProfile":{"roles":[{"name":"headnode","targetInstanceCount":2,"hardwareProfile":{"vmSize":"Large"},"osProfile":{"linuxOperatingSystemProfile":{"username":"sshuser"}},"encryptDataDisks":false},{"name":"workernode","targetInstanceCount":3,"hardwareProfile":{"vmSize":"Large"},"osProfile":{"linuxOperatingSystemProfile":{"username":"sshuser"}},"dataDisksGroups":[{"disksPerNode":8,"storageAccountType":"Standard_LRS","diskSizeGB":1023}],"encryptDataDisks":false},{"name":"zookeepernode","targetInstanceCount":3,"hardwareProfile":{"vmSize":"Small"},"osProfile":{"linuxOperatingSystemProfile":{"username":"sshuser"}},"encryptDataDisks":false}]},"provisioningState":"Succeeded","clusterState":"Running","createdDate":"2018-12-28T09:03:10.693","quotaInfo":{"coresUsed":23},"connectivityEndpoints":[{"name":"SSH","protocol":"TCP","location":"hdisdk-kafka-byok8ce41b44-ssh.azurehdinsight.net","port":22},{"name":"HTTPS","protocol":"TCP","location":"hdisdk-kafka-byok8ce41b44.azurehdinsight.net","port":443}],"tier":"standard","diskEncryptionProperties":{"vaultUri":"https://hdipy8ce41b44.vault.azure.net","keyName":"hdipykey28ce41b44","keyVersion":"0e4ed336f038445f9b32ccdccac2f769","encryptionAlgorithm":"RSA-OAEP","msiResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/hdipy-8ce41b44/providers/microsoft.managedidentity/userassignedidentities/hdipyuai8ce41b44"}},"identity":{"type":"UserAssigned","userAssignedIdentities":{"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/hdipy-8ce41b44/providers/microsoft.managedidentity/userassignedidentities/hdipyuai8ce41b44":{"principalId":"998e4f8e-72c2-439d-86e2-5f1e13db642d","tenantId":"00000000-0000-0000-0000-000000000000"}}}}'} - headers: - cache-control: [no-cache] - content-length: ['2290'] - content-type: [application/json; charset=utf-8] - date: ['Fri, 28 Dec 2018 09:18:13 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-8ce41b44/providers/Microsoft.HDInsight/clusters/hdisdk-kafka-byok8ce41b44","name":"hdisdk-kafka-byok8ce41b44","type":"Microsoft.HDInsight/clusters","location":"North + Central US","etag":"2515b354-0de3-4b9d-be0c-f7df55badceb","tags":{},"properties":{"clusterVersion":"3.6.1000.67","clusterHdpVersion":"2.6.5.3022-3","osType":"Linux","clusterDefinition":{"blueprint":"https://blueprints.azurehdinsight.net/kafka-3.6.1000.67.2004291541.json","kind":"Kafka","componentVersion":{"Kafka":"1.1"}},"computeProfile":{"roles":[{"name":"headnode","targetInstanceCount":2,"hardwareProfile":{"vmSize":"standard_a4_v2"},"osProfile":{"linuxOperatingSystemProfile":{"username":"sshuser"}},"encryptDataDisks":false},{"name":"workernode","targetInstanceCount":3,"hardwareProfile":{"vmSize":"standard_a4_v2"},"osProfile":{"linuxOperatingSystemProfile":{"username":"sshuser"}},"dataDisksGroups":[{"disksPerNode":8,"storageAccountType":"Standard_LRS","diskSizeGB":1023}],"encryptDataDisks":false},{"name":"zookeepernode","targetInstanceCount":3,"hardwareProfile":{"vmSize":"standard_a1_v2"},"osProfile":{"linuxOperatingSystemProfile":{"username":"sshuser"}},"encryptDataDisks":false}]},"provisioningState":"Succeeded","clusterState":"Running","createdDate":"2020-06-03T12:41:11.943","quotaInfo":{"coresUsed":23},"connectivityEndpoints":[{"name":"SSH","protocol":"TCP","location":"hdisdk-kafka-byok8ce41b44-ssh.azurehdinsight.net","port":22},{"name":"HTTPS","protocol":"TCP","location":"hdisdk-kafka-byok8ce41b44.azurehdinsight.net","port":443}],"tier":"standard","diskEncryptionProperties":{"vaultUri":"https://hdipy8ce41b44..vault.azure.net","keyName":"hdipykey28ce41b44","keyVersion":"58ef873805c14c5a9d292aaa20f10ccb","encryptionAlgorithm":"RSA-OAEP","msiResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/hdipy-8ce41b44/providers/microsoft.managedidentity/userassignedidentities/hdipyuai8ce41b44"},"storageProfile":{"storageaccounts":[{"name":"hdipy.blob.core.windows.net","resourceId":null,"msiResourceId":null,"key":null,"fileSystem":null,"container":"hdisdk-kafka-byok8ce41b44","saskey":null,"isDefault":true}]}},"identity":{"type":"UserAssigned","userAssignedIdentities":{"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/hdipy-8ce41b44/providers/microsoft.managedidentity/userassignedidentities/hdipyuai8ce41b44":{"principalId":"1b12fe54-7b96-47a6-8f1b-ba1938623b65","tenantId":"00000000-0000-0000-0000-000000000000"}}}}' + headers: + cache-control: + - no-cache + content-length: + - '2541' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 12:57:13 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + status: + code: 200 + message: OK version: 1 diff --git a/sdk/hdinsight/azure-mgmt-hdinsight/test/recordings/test_mgmt_hdinsight.test_create_with_adls_gen1.yaml b/sdk/hdinsight/azure-mgmt-hdinsight/test/recordings/test_mgmt_hdinsight.test_create_with_adls_gen1.yaml deleted file mode 100644 index 5f7597fe1f9f..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsight/test/recordings/test_mgmt_hdinsight.test_create_with_adls_gen1.yaml +++ /dev/null @@ -1,930 +0,0 @@ -interactions: -- request: - body: 'b''b\''b\\\''b\\\\\\\''{"location": "East US 2", "tags": {}, "properties": - {"clusterVersion": "3.6", "osType": "Linux", "tier": "Standard", "clusterDefinition": - {"kind": "hadoop", "configurations": {"gateway": {"restAuthCredential.isEnabled": - "true", "restAuthCredential.username": "admin", "restAuthCredential.password": - "Password1!"}, "clusterIdentity": {"clusterIdentity.applicationId": "00000000-0000-0000-0000-000000000000", - "clusterIdentity.certificate": "MIIJ8gIBAzCCCa4GCSqGSIb3DQEHAaCCCZ8EggmbMIIJlzCCBgAGCSqGSIb3DQEHAaCCBfEEggXtMIIF6TCCBeUGCyqGSIb3DQEMCgECoIIE9jCCBPIwHAYKKoZIhvcNAQwBAzAOBAiTJstpWcGFZAICB9AEggTQZvg9qVE2ptb3hdH9hnDf5pwIeGghe9assBeEKj/W1JMUjsdEu7qzXH9/3Ro6C1HF6MvSqbav7MD8je9AMb0jl7T3ZmXPgGtrbUsSBTPruVv0hTXPRTxQmcfwae5vEkD03b/4W22sXMMYZB7wOTQMl1d5+0wt267qdF+G1XWtRI2jnxetK8/oyMQxn5Cwuz/VAmn1tXwRAN9gIiZDA8MwvpYha/iFVWKu/vnHg8HT47ry+27/wh8ifM9ea7JWhKh2tZoPIMou9/P/CgkkMv9KVHlmiMldA3Phxsrqjbh/wbd8RWBOtSM7rryMVnc1MYonZraDJMGOLGAhvEcXNBKLwRdmrDDYvpOYlDYKlmNvDXYDm410XCOia2aKP0WoP4qLsExtUwW8Qk2r2QRy5O4B5p2EbPZBlPlMMO4S1NkASjJCghuTCUgvk3uwe2L/mMf0IajAf+R0/VW/fXHbhJkFKobi5JlIqWaHsSC7hMidWj6771Yi8UEXOMshWERs2UHH05aIO3c50lnyypHyhA3BohKUXzNhHA0o7ImQRjmjjTJFBLMNiIZSW0aPtLN1+92pT0a6iS7P1PC0DqEnOjkcs/VOUI3qTt0X78b6wnDO+ATo39B13njGD0mtrVvtTeHclBouoFzpKHkS86GSGmDoHQH6EHhpGF/7wPVfAjAiSrNQb/QLjPHWo+BeiOml4Xrti0K6rWb0AXhY8AmtIlEUC9GscDSdT55v9j9tWONzOXECCgZBYDzNlagMLkCDIFHZwbEGPn3pOc7BTOmQf1GQjfvunLiLWWfe3of9pR+NCDyi1VJUNvjoE+/YnVoBBUMBBO6/4t2SL92iouEF4fyqkQFDb0FOPW4Kfh7H5W+sDZIN9NfqNzniK6HFcpS+jnGm9x9rx81DmMcwtiYZTfYDSivtNxOYrmRFXx574stBzvG0En11uc6E4QhWnkCSsBnnOMjRGDyv95BFVMZC0gIS0rWoKYxjdblpmo9w/yfDtAmQuCs3bdqcJ4mMYt0ueUUZImPRQRJOSrVyoq+brLw657EqM1SahtBmzTG7+HTl1Qi/xZ1xmz6paQDSFVPRcb5QSIp4v08j/Lmj0x4R9jQ4cAmZ3CfPKXBKuIRu2AI2EuqGOoAxvQQEpSjSKUs3fbQxjptUhK7o5FcXAfAxHLzdx2/9L1Iqbo/3HDkbmuix24NRXESG0e/kVr7VAGhoALI7L+eKAdn4AkgmBt55FXZ+uHY9bSKZUoz4Oed2bz2A+9sQBcXG06fLqQEwGVPhATEbYyRduuY6AdTRAmOKmadT5BTTD7+dnFlIt+u7ZpbXm6S6LcSqGqHVacig27SwDt0VznQsjMRDVCiHaWKg4W78xbP7YVvNTB/cBCHmhh5ZXfO/TucizXsQPJlwEMr2CbqByqldXi0i1GUrbg4aLUGZtxgUYex7dHlx6GUejOGRh7fLYCNBo43pjCFvbhFwb0/dWya0crJjpGiY3DNtl1YosJBmvso/Rli4QqVeN7tb45ZsGWTEUg1MDeoGRDqal7GDsvBnH574T5Sz3nSLAoNXR7k0rYaWhezJNobo/SDkuSXskVjNJpv+vjEyW2UGYNhaeK/UHKBP8IrmSAEIZejQj6OEzSPM6TNLW5qJb6LK9agxgdswEwYJKoZIhvcNAQkVMQYEBAEAAAAwXQYJKwYBBAGCNxEBMVAeTgBNAGkAYwByAG8AcwBvAGYAdAAgAFMAdAByAG8AbgBnACAAQwByAHkAcAB0AG8AZwByAGEAcABoAGkAYwAgAFAAcgBvAHYAaQBkAGUAcjBlBgkqhkiG9w0BCRQxWB5WAFAAdgBrAFQAbQBwADoAMAAyAGYAZQA0AGUAOAAzAC0AMgAzADEANgAtADQAMQA3AGMALQA5ADQANQBjAC0AZgA1ADUAMABhADUAZAAwAGIAMAAzAGEwggOPBgkqhkiG9w0BBwagggOAMIIDfAIBADCCA3UGCSqGSIb3DQEHATAcBgoqhkiG9w0BDAEDMA4ECAR1hzovrDkgAgIH0ICCA0gq6boOLRoE5PHFfVIXYtzqg1u2vPMm5mgBUvrh3u+VZ/1FMGTj8od9+Yu91cnumVSgfRiGq7lz+K6by5JsBqP68ksLA2d/PqtTdofCoZ7SgVIo+qqzA64HIQFkElNpo/BJMX/JGpc5OlFq7mdHe6xL2Pfx/3z/pNSV+D+WaAwaDnbLqI7MU6ED3j5l63mExk/8H/VVbiPdqMTzbhIp65oHTGanw86w7RlywqeNb3DkPVMB78Jhcg8vf2AxB8hKf6QiO2uJc/4WKkyLoLmNoD/zhaoUuAbC6hrNVAa9VRWNRfwKZrzwIMSLlKYwWmVcD/QgC8gwxuF+wV3UHwDNAdEe8TEsOhE99/ZiUiogxMdkopZwwtZMszzBB/x5mHCGySauDMVPwoYT6QXewJhGrUap0jwB/Vzy5FaWHi/m8964zWpwC6xfkT2hkDb+rfouWutpiAgMne5tD9YvqxTUmZFIlgwpLrVdPcKQS+b/uIXPTv8uW177XsCOmGGu728ld8H1Ifb2nPveK09Y0AA+ARFpOX0p0ZuxMQqk6NnlA+eESJVm5cLfKszorRcrNPINXaEOGl2okuijm8va30FH9GIYWRt+Be6s8qG672aTO/2eHaTHeR/qQ9aEt0ASDXGcugYS14Jnu2wbauyvotZ6eAvgl5tM2leMpgSLaQqYzPTV2uiD6zDUqxwjm2P8EZQihEQqLUV1jvQuQB4Ui7MryDQ+QiDBD2m5c+9SDPafcR7qgRe/cP4hj5BqzHTcNQAD5BLXze7Yx+TMdf+Qe/R1uBYm8bLjUv9hwUmtMeZP4RU6RPJrN2aRf7BUdgS0j/8YAhxViPucRENuhEfS4sotHf1CJZ7xJz0ZE9cpVY6JLl1tbmuf1Eh50cicZ1SHQhqSP0ggLHV6DNcJz+kyekEe9qggGDi6mreYz/kJnnumsDy5cToIHy9jJhtXzj+/ZNGkdpq9HWMiwAT/VR1WPpzjn06m7Z87PiLaiC3simQtjnl0gVF11Ev4rbIhYjFBL0nKfNpzaWlMaOVF+EumROk3EbZVpx1K6Yh0zWh/NocWSUrtSoHVklzwPCNRvnE1Ehyw5t9YbEBsTIDWRYyqbVYoFVfOUhq5p4TXrqEwOzAfMAcGBSsOAwIaBBSx7sJo66zYk4VOsgD9V/co1SikFAQUUvU/kE4wTRnPRnaWXnno+FCb56kCAgfQ", - "clusterIdentity.aadTenantId": "https://login.windows.net/00000000-0000-0000-0000-000000000000", - "clusterIdentity.resourceUri": "https://datalake.azure.net/", "clusterIdentity.certificatePassword": - "123"}, "core-site": {"fs.defaultFS": "adl://home", "dfs.adls.home.hostname": - "fakehdiadlsaccount.azuredatalakestore.net", "dfs.adls.home.mountpoint": "/clusters/hdi"}}}, - "computeProfile": {"roles": [{"name": "headnode", "targetInstanceCount": 2, - "hardwareProfile": {"vmSize": "Large"}, "osProfile": {"linuxOperatingSystemProfile": - {"username": "sshuser", "password": "Password1!"}}}, {"name": "workernode", - "targetInstanceCount": 3, "hardwareProfile": {"vmSize": "Large"}, "osProfile": - {"linuxOperatingSystemProfile": {"username": "sshuser", "password": "Password1!"}}}, - {"name": "zookeepernode", "targetInstanceCount": 3, "hardwareProfile": {"vmSize": - "Small"}, "osProfile": {"linuxOperatingSystemProfile": {"username": "sshuser", - "password": "Password1!"}}}]}, "storageProfile": {"storageaccounts": [{"name": - "hdipybcf5129f.blob.core.windows.net", "isDefault": false, "container": "hdisdk-adlsgen1bcf5129f", - "key": "TkbluDiyifRIM9uhGTWeoe66m6GV9cIAezOY/hC0XCQ6DNje1ZgpuIo4769Eb0aNxd5O7Zun2YomPQBPMLsZgg=="}]}}}\\\\\\\''\\\''\''''' - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['5044'] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - accept-language: [en-US] - method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-bcf5129f/providers/Microsoft.HDInsight/clusters/hdisdk-adlsgen1bcf5129f?api-version=2018-06-01-preview - response: - body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-bcf5129f/providers/Microsoft.HDInsight/clusters/hdisdk-adlsgen1bcf5129f","name":"hdisdk-adlsgen1bcf5129f","type":"Microsoft.HDInsight/clusters","location":"East - US 2","etag":"e012fb8d-f502-42b1-93ce-fd0bd46aa8b3","tags":{},"properties":{"clusterVersion":"3.6.1000.67","clusterHdpVersion":"","osType":"Linux","clusterDefinition":{"blueprint":"https://blueprints.azurehdinsight.net/hadoop-3.6.1000.67.1812120705.json","kind":"hadoop","componentVersion":{"hadoop":"2.7"}},"computeProfile":{"roles":[{"name":"headnode","targetInstanceCount":2,"hardwareProfile":{"vmSize":"Large"},"osProfile":{"linuxOperatingSystemProfile":{"username":"sshuser"}},"encryptDataDisks":false},{"name":"workernode","targetInstanceCount":3,"hardwareProfile":{"vmSize":"Large"},"osProfile":{"linuxOperatingSystemProfile":{"username":"sshuser"}},"encryptDataDisks":false},{"name":"zookeepernode","targetInstanceCount":3,"hardwareProfile":{"vmSize":"Medium"},"osProfile":{"linuxOperatingSystemProfile":{"username":"sshuser"}},"encryptDataDisks":false}]},"provisioningState":"InProgress","clusterState":"Accepted","createdDate":"2018-12-29T02:19:48.243","quotaInfo":{"coresUsed":20},"tier":"standard"}}'} - headers: - azure-asyncoperation: ['https://management.azure.com:443/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-bcf5129f/providers/Microsoft.HDInsight/clusters/hdisdk-adlsgen1bcf5129f/azureasyncoperations/create?api-version=2018-06-01-preview'] - cache-control: [no-cache] - content-length: ['1252'] - content-type: [application/json; charset=utf-8] - date: ['Sat, 29 Dec 2018 02:19:49 GMT'] - etag: ['"e012fb8d-f502-42b1-93ce-fd0bd46aa8b3"'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-clusteruri: ['https://management.azure.com/subscriptions/964c10bb-8a6c-43bc-83d3-6b318c6c7305/resourceGroups/hdipy-bcf5129f/providers/Microsoft.HDInsight/clusters/hdisdk-adlsgen1bcf5129f?api-version=2018-06-01-preview'] - x-ms-hdi-served-by: [global] - x-ms-ratelimit-remaining-subscription-writes: ['1199'] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-bcf5129f/providers/Microsoft.HDInsight/clusters/hdisdk-adlsgen1bcf5129f/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Sat, 29 Dec 2018 02:20:19 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-served-by: [global] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-bcf5129f/providers/Microsoft.HDInsight/clusters/hdisdk-adlsgen1bcf5129f/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Sat, 29 Dec 2018 02:20:51 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-served-by: [global] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-bcf5129f/providers/Microsoft.HDInsight/clusters/hdisdk-adlsgen1bcf5129f/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Sat, 29 Dec 2018 02:21:22 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-served-by: [global] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-bcf5129f/providers/Microsoft.HDInsight/clusters/hdisdk-adlsgen1bcf5129f/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Sat, 29 Dec 2018 02:21:53 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-served-by: [global] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-bcf5129f/providers/Microsoft.HDInsight/clusters/hdisdk-adlsgen1bcf5129f/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Sat, 29 Dec 2018 02:22:25 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-served-by: [global] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-bcf5129f/providers/Microsoft.HDInsight/clusters/hdisdk-adlsgen1bcf5129f/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Sat, 29 Dec 2018 02:22:55 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-served-by: [global] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-bcf5129f/providers/Microsoft.HDInsight/clusters/hdisdk-adlsgen1bcf5129f/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Sat, 29 Dec 2018 02:23:26 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-served-by: [global] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-bcf5129f/providers/Microsoft.HDInsight/clusters/hdisdk-adlsgen1bcf5129f/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Sat, 29 Dec 2018 02:23:57 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-served-by: [global] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-bcf5129f/providers/Microsoft.HDInsight/clusters/hdisdk-adlsgen1bcf5129f/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Sat, 29 Dec 2018 02:24:28 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-served-by: [global] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-bcf5129f/providers/Microsoft.HDInsight/clusters/hdisdk-adlsgen1bcf5129f/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Sat, 29 Dec 2018 02:24:59 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-served-by: [global] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-bcf5129f/providers/Microsoft.HDInsight/clusters/hdisdk-adlsgen1bcf5129f/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Sat, 29 Dec 2018 02:25:31 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-served-by: [global] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-bcf5129f/providers/Microsoft.HDInsight/clusters/hdisdk-adlsgen1bcf5129f/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Sat, 29 Dec 2018 02:26:01 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-served-by: [global] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-bcf5129f/providers/Microsoft.HDInsight/clusters/hdisdk-adlsgen1bcf5129f/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Sat, 29 Dec 2018 02:26:32 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-served-by: [global] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-bcf5129f/providers/Microsoft.HDInsight/clusters/hdisdk-adlsgen1bcf5129f/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Sat, 29 Dec 2018 02:27:04 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-served-by: [global] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-bcf5129f/providers/Microsoft.HDInsight/clusters/hdisdk-adlsgen1bcf5129f/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Sat, 29 Dec 2018 02:27:34 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-served-by: [global] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-bcf5129f/providers/Microsoft.HDInsight/clusters/hdisdk-adlsgen1bcf5129f/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Sat, 29 Dec 2018 02:28:06 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-served-by: [global] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-bcf5129f/providers/Microsoft.HDInsight/clusters/hdisdk-adlsgen1bcf5129f/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Sat, 29 Dec 2018 02:28:36 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-served-by: [global] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-bcf5129f/providers/Microsoft.HDInsight/clusters/hdisdk-adlsgen1bcf5129f/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Sat, 29 Dec 2018 02:29:07 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-served-by: [global] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-bcf5129f/providers/Microsoft.HDInsight/clusters/hdisdk-adlsgen1bcf5129f/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Sat, 29 Dec 2018 02:29:39 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-served-by: [global] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-bcf5129f/providers/Microsoft.HDInsight/clusters/hdisdk-adlsgen1bcf5129f/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Sat, 29 Dec 2018 02:30:09 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-served-by: [global] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-bcf5129f/providers/Microsoft.HDInsight/clusters/hdisdk-adlsgen1bcf5129f/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Sat, 29 Dec 2018 02:30:40 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-served-by: [global] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-bcf5129f/providers/Microsoft.HDInsight/clusters/hdisdk-adlsgen1bcf5129f/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Sat, 29 Dec 2018 02:31:11 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-served-by: [global] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-bcf5129f/providers/Microsoft.HDInsight/clusters/hdisdk-adlsgen1bcf5129f/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Sat, 29 Dec 2018 02:31:43 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-served-by: [global] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-bcf5129f/providers/Microsoft.HDInsight/clusters/hdisdk-adlsgen1bcf5129f/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Sat, 29 Dec 2018 02:32:14 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-served-by: [global] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-bcf5129f/providers/Microsoft.HDInsight/clusters/hdisdk-adlsgen1bcf5129f/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Sat, 29 Dec 2018 02:32:44 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-served-by: [global] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-bcf5129f/providers/Microsoft.HDInsight/clusters/hdisdk-adlsgen1bcf5129f/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Sat, 29 Dec 2018 02:33:16 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-served-by: [global] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-bcf5129f/providers/Microsoft.HDInsight/clusters/hdisdk-adlsgen1bcf5129f/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Sat, 29 Dec 2018 02:33:46 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-served-by: [global] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-bcf5129f/providers/Microsoft.HDInsight/clusters/hdisdk-adlsgen1bcf5129f/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Sat, 29 Dec 2018 02:34:18 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-served-by: [global] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-bcf5129f/providers/Microsoft.HDInsight/clusters/hdisdk-adlsgen1bcf5129f/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Sat, 29 Dec 2018 02:34:49 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-served-by: [global] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-bcf5129f/providers/Microsoft.HDInsight/clusters/hdisdk-adlsgen1bcf5129f/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Sat, 29 Dec 2018 02:35:19 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-served-by: [global] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-bcf5129f/providers/Microsoft.HDInsight/clusters/hdisdk-adlsgen1bcf5129f/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Sat, 29 Dec 2018 02:35:51 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-served-by: [global] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-bcf5129f/providers/Microsoft.HDInsight/clusters/hdisdk-adlsgen1bcf5129f/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Sat, 29 Dec 2018 02:36:23 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-served-by: [global] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-bcf5129f/providers/Microsoft.HDInsight/clusters/hdisdk-adlsgen1bcf5129f/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Sat, 29 Dec 2018 02:36:53 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-served-by: [global] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-bcf5129f/providers/Microsoft.HDInsight/clusters/hdisdk-adlsgen1bcf5129f/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"Succeeded"}'} - headers: - cache-control: [no-cache] - content-length: ['22'] - content-type: [application/json; charset=utf-8] - date: ['Sat, 29 Dec 2018 02:37:24 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-served-by: [global] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-bcf5129f/providers/Microsoft.HDInsight/clusters/hdisdk-adlsgen1bcf5129f?api-version=2018-06-01-preview - response: - body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-bcf5129f/providers/Microsoft.HDInsight/clusters/hdisdk-adlsgen1bcf5129f","name":"hdisdk-adlsgen1bcf5129f","type":"Microsoft.HDInsight/clusters","location":"East - US 2","etag":"e012fb8d-f502-42b1-93ce-fd0bd46aa8b3","tags":{},"properties":{"clusterVersion":"3.6.1000.67","clusterHdpVersion":"2.6.5.3005-27","osType":"Linux","clusterDefinition":{"blueprint":"https://blueprints.azurehdinsight.net/hadoop-3.6.1000.67.1812120705.json","kind":"hadoop","componentVersion":{"hadoop":"2.7"}},"computeProfile":{"roles":[{"name":"headnode","targetInstanceCount":2,"hardwareProfile":{"vmSize":"Large"},"osProfile":{"linuxOperatingSystemProfile":{"username":"sshuser"}},"encryptDataDisks":false},{"name":"workernode","targetInstanceCount":3,"hardwareProfile":{"vmSize":"Large"},"osProfile":{"linuxOperatingSystemProfile":{"username":"sshuser"}},"encryptDataDisks":false},{"name":"zookeepernode","targetInstanceCount":3,"hardwareProfile":{"vmSize":"Medium"},"osProfile":{"linuxOperatingSystemProfile":{"username":"sshuser"}},"encryptDataDisks":false}]},"provisioningState":"Succeeded","clusterState":"Running","createdDate":"2018-12-29T02:19:48.243","quotaInfo":{"coresUsed":20},"connectivityEndpoints":[{"name":"SSH","protocol":"TCP","location":"hdisdk-adlsgen1bcf5129f-ssh.azurehdinsight.net","port":22},{"name":"HTTPS","protocol":"TCP","location":"hdisdk-adlsgen1bcf5129f.azurehdinsight.net","port":443}],"tier":"standard"}}'} - headers: - cache-control: [no-cache] - content-length: ['1492'] - content-type: [application/json; charset=utf-8] - date: ['Sat, 29 Dec 2018 02:37:26 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-served-by: [global] - status: {code: 200, message: OK} -version: 1 diff --git a/sdk/hdinsight/azure-mgmt-hdinsight/test/recordings/test_mgmt_hdinsight.test_gateway_settings.yaml b/sdk/hdinsight/azure-mgmt-hdinsight/test/recordings/test_mgmt_hdinsight.test_gateway_settings.yaml new file mode 100644 index 000000000000..d0891ab0cbb9 --- /dev/null +++ b/sdk/hdinsight/azure-mgmt-hdinsight/test/recordings/test_mgmt_hdinsight.test_gateway_settings.yaml @@ -0,0 +1,1507 @@ +interactions: +- request: + body: 'b''{"location": "North Central US", "tags": {}, "properties": {"clusterVersion": + "3.6", "osType": "Linux", "tier": "Standard", "clusterDefinition": {"kind": + "hadoop", "configurations": {"gateway": {"restAuthCredential.isEnabled": "true", + "restAuthCredential.username": "admin", "restAuthCredential.password": "Password1!"}}}, + "computeProfile": {"roles": [{"name": "headnode", "targetInstanceCount": 2, + "hardwareProfile": {"vmSize": "Large"}, "osProfile": {"linuxOperatingSystemProfile": + {"username": "sshuser", "password": "Password1!"}}}, {"name": "workernode", + "targetInstanceCount": 3, "hardwareProfile": {"vmSize": "Large"}, "osProfile": + {"linuxOperatingSystemProfile": {"username": "sshuser", "password": "Password1!"}}}, + {"name": "zookeepernode", "targetInstanceCount": 3, "hardwareProfile": {"vmSize": + "Small"}, "osProfile": {"linuxOperatingSystemProfile": {"username": "sshuser", + "password": "Password1!"}}}]}, "storageProfile": {"storageaccounts": [{"name": + "hdipy.blob.core.windows.net", "isDefault": true, "container": "hdisdk-http64501105", + "key": "fyuFawWCkHUCWVfGKU/NI0ncpS1oQM5S4NGi3Yt5h4dXKBFM5hlB/OAVLd4wCE8b17ecLWZuopcfu3XKFho5rQ=="}]}}}''' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '1160' + Content-Type: + - application/json; charset=utf-8 + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.5.0 Azure-SDK-For-Python + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-64501105/providers/Microsoft.HDInsight/clusters/hdisdk-http64501105?api-version=2018-06-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-64501105/providers/Microsoft.HDInsight/clusters/hdisdk-http64501105","name":"hdisdk-http64501105","type":"Microsoft.HDInsight/clusters","location":"North + Central US","etag":"ede1f50f-d36e-412d-9f7b-abe90fc85fe5","tags":{},"properties":{"clusterVersion":"3.6.1000.67","clusterHdpVersion":"","osType":"Linux","clusterDefinition":{"blueprint":"https://blueprints.azurehdinsight.net/hadoop-3.6.1000.67.2004291541.json","kind":"hadoop","componentVersion":{"hadoop":"2.7"}},"computeProfile":{"roles":[{"name":"headnode","targetInstanceCount":2,"hardwareProfile":{"vmSize":"standard_a4_v2"},"osProfile":{"linuxOperatingSystemProfile":{"username":"sshuser"}},"encryptDataDisks":false},{"name":"workernode","targetInstanceCount":3,"hardwareProfile":{"vmSize":"standard_a4_v2"},"osProfile":{"linuxOperatingSystemProfile":{"username":"sshuser"}},"encryptDataDisks":false},{"name":"zookeepernode","targetInstanceCount":3,"hardwareProfile":{"vmSize":"standard_a2_v2"},"osProfile":{"linuxOperatingSystemProfile":{"username":"sshuser"}},"encryptDataDisks":false}]},"provisioningState":"InProgress","clusterState":"Accepted","createdDate":"2020-06-03T09:05:26.587","quotaInfo":{"coresUsed":20},"tier":"standard","storageProfile":{"storageaccounts":[{"name":"hdipy.blob.core.windows.net","resourceId":null,"msiResourceId":null,"key":null,"fileSystem":null,"container":"hdisdk-http64501105","saskey":null,"isDefault":true}]}}}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-64501105/providers/Microsoft.HDInsight/clusters/hdisdk-http64501105/azureasyncoperations/create?api-version=2018-06-01-preview + cache-control: + - no-cache + content-length: + - '1496' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 09:05:29 GMT + etag: + - '"ede1f50f-d36e-412d-9f7b-abe90fc85fe5"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-clusteruri: + - https://management.azure.com/subscriptions/964c10bb-8a6c-43bc-83d3-6b318c6c7305/resourceGroups/hdipy-64501105/providers/Microsoft.HDInsight/clusters/hdisdk-http64501105?api-version=2018-06-01-preview + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.5.0 Azure-SDK-For-Python + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-64501105/providers/Microsoft.HDInsight/clusters/hdisdk-http64501105/azureasyncoperations/create?api-version=2018-06-01-preview + response: + body: + string: '{"status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 09:06:00 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.5.0 Azure-SDK-For-Python + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-64501105/providers/Microsoft.HDInsight/clusters/hdisdk-http64501105/azureasyncoperations/create?api-version=2018-06-01-preview + response: + body: + string: '{"status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 09:06:31 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.5.0 Azure-SDK-For-Python + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-64501105/providers/Microsoft.HDInsight/clusters/hdisdk-http64501105/azureasyncoperations/create?api-version=2018-06-01-preview + response: + body: + string: '{"status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 09:07:01 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.5.0 Azure-SDK-For-Python + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-64501105/providers/Microsoft.HDInsight/clusters/hdisdk-http64501105/azureasyncoperations/create?api-version=2018-06-01-preview + response: + body: + string: '{"status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 09:07:32 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.5.0 Azure-SDK-For-Python + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-64501105/providers/Microsoft.HDInsight/clusters/hdisdk-http64501105/azureasyncoperations/create?api-version=2018-06-01-preview + response: + body: + string: '{"status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 09:08:02 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.5.0 Azure-SDK-For-Python + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-64501105/providers/Microsoft.HDInsight/clusters/hdisdk-http64501105/azureasyncoperations/create?api-version=2018-06-01-preview + response: + body: + string: '{"status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 09:08:33 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.5.0 Azure-SDK-For-Python + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-64501105/providers/Microsoft.HDInsight/clusters/hdisdk-http64501105/azureasyncoperations/create?api-version=2018-06-01-preview + response: + body: + string: '{"status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 09:09:03 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.5.0 Azure-SDK-For-Python + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-64501105/providers/Microsoft.HDInsight/clusters/hdisdk-http64501105/azureasyncoperations/create?api-version=2018-06-01-preview + response: + body: + string: '{"status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 09:09:33 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.5.0 Azure-SDK-For-Python + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-64501105/providers/Microsoft.HDInsight/clusters/hdisdk-http64501105/azureasyncoperations/create?api-version=2018-06-01-preview + response: + body: + string: '{"status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 09:10:04 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.5.0 Azure-SDK-For-Python + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-64501105/providers/Microsoft.HDInsight/clusters/hdisdk-http64501105/azureasyncoperations/create?api-version=2018-06-01-preview + response: + body: + string: '{"status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 09:10:35 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.5.0 Azure-SDK-For-Python + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-64501105/providers/Microsoft.HDInsight/clusters/hdisdk-http64501105/azureasyncoperations/create?api-version=2018-06-01-preview + response: + body: + string: '{"status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 09:11:05 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.5.0 Azure-SDK-For-Python + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-64501105/providers/Microsoft.HDInsight/clusters/hdisdk-http64501105/azureasyncoperations/create?api-version=2018-06-01-preview + response: + body: + string: '{"status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 09:11:35 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.5.0 Azure-SDK-For-Python + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-64501105/providers/Microsoft.HDInsight/clusters/hdisdk-http64501105/azureasyncoperations/create?api-version=2018-06-01-preview + response: + body: + string: '{"status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 09:12:06 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.5.0 Azure-SDK-For-Python + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-64501105/providers/Microsoft.HDInsight/clusters/hdisdk-http64501105/azureasyncoperations/create?api-version=2018-06-01-preview + response: + body: + string: '{"status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 09:12:37 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.5.0 Azure-SDK-For-Python + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-64501105/providers/Microsoft.HDInsight/clusters/hdisdk-http64501105/azureasyncoperations/create?api-version=2018-06-01-preview + response: + body: + string: '{"status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 09:13:07 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.5.0 Azure-SDK-For-Python + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-64501105/providers/Microsoft.HDInsight/clusters/hdisdk-http64501105/azureasyncoperations/create?api-version=2018-06-01-preview + response: + body: + string: '{"status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 09:13:38 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.5.0 Azure-SDK-For-Python + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-64501105/providers/Microsoft.HDInsight/clusters/hdisdk-http64501105/azureasyncoperations/create?api-version=2018-06-01-preview + response: + body: + string: '{"status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 09:14:08 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.5.0 Azure-SDK-For-Python + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-64501105/providers/Microsoft.HDInsight/clusters/hdisdk-http64501105/azureasyncoperations/create?api-version=2018-06-01-preview + response: + body: + string: '{"status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 09:14:39 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.5.0 Azure-SDK-For-Python + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-64501105/providers/Microsoft.HDInsight/clusters/hdisdk-http64501105/azureasyncoperations/create?api-version=2018-06-01-preview + response: + body: + string: '{"status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 09:15:09 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.5.0 Azure-SDK-For-Python + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-64501105/providers/Microsoft.HDInsight/clusters/hdisdk-http64501105/azureasyncoperations/create?api-version=2018-06-01-preview + response: + body: + string: '{"status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 09:15:40 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.5.0 Azure-SDK-For-Python + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-64501105/providers/Microsoft.HDInsight/clusters/hdisdk-http64501105/azureasyncoperations/create?api-version=2018-06-01-preview + response: + body: + string: '{"status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 09:16:11 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.5.0 Azure-SDK-For-Python + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-64501105/providers/Microsoft.HDInsight/clusters/hdisdk-http64501105/azureasyncoperations/create?api-version=2018-06-01-preview + response: + body: + string: '{"status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 09:16:41 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.5.0 Azure-SDK-For-Python + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-64501105/providers/Microsoft.HDInsight/clusters/hdisdk-http64501105/azureasyncoperations/create?api-version=2018-06-01-preview + response: + body: + string: '{"status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 09:17:11 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.5.0 Azure-SDK-For-Python + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-64501105/providers/Microsoft.HDInsight/clusters/hdisdk-http64501105/azureasyncoperations/create?api-version=2018-06-01-preview + response: + body: + string: '{"status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 09:17:42 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.5.0 Azure-SDK-For-Python + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-64501105/providers/Microsoft.HDInsight/clusters/hdisdk-http64501105/azureasyncoperations/create?api-version=2018-06-01-preview + response: + body: + string: '{"status":"Succeeded"}' + headers: + cache-control: + - no-cache + content-length: + - '22' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 09:18:12 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.5.0 Azure-SDK-For-Python + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-64501105/providers/Microsoft.HDInsight/clusters/hdisdk-http64501105?api-version=2018-06-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-64501105/providers/Microsoft.HDInsight/clusters/hdisdk-http64501105","name":"hdisdk-http64501105","type":"Microsoft.HDInsight/clusters","location":"North + Central US","etag":"ede1f50f-d36e-412d-9f7b-abe90fc85fe5","tags":{},"properties":{"clusterVersion":"3.6.1000.67","clusterHdpVersion":"2.6.5.3022-3","osType":"Linux","clusterDefinition":{"blueprint":"https://blueprints.azurehdinsight.net/hadoop-3.6.1000.67.2004291541.json","kind":"hadoop","componentVersion":{"hadoop":"2.7"}},"computeProfile":{"roles":[{"name":"headnode","targetInstanceCount":2,"hardwareProfile":{"vmSize":"standard_a4_v2"},"osProfile":{"linuxOperatingSystemProfile":{"username":"sshuser"}},"encryptDataDisks":false},{"name":"workernode","targetInstanceCount":3,"hardwareProfile":{"vmSize":"standard_a4_v2"},"osProfile":{"linuxOperatingSystemProfile":{"username":"sshuser"}},"encryptDataDisks":false},{"name":"zookeepernode","targetInstanceCount":3,"hardwareProfile":{"vmSize":"standard_a2_v2"},"osProfile":{"linuxOperatingSystemProfile":{"username":"sshuser"}},"encryptDataDisks":false}]},"provisioningState":"Succeeded","clusterState":"Running","createdDate":"2020-06-03T09:05:26.587","quotaInfo":{"coresUsed":20},"connectivityEndpoints":[{"name":"SSH","protocol":"TCP","location":"hdisdk-http64501105-ssh.azurehdinsight.net","port":22},{"name":"HTTPS","protocol":"TCP","location":"hdisdk-http64501105.azurehdinsight.net","port":443}],"tier":"standard","storageProfile":{"storageaccounts":[{"name":"hdipy.blob.core.windows.net","resourceId":null,"msiResourceId":null,"key":null,"fileSystem":null,"container":"hdisdk-http64501105","saskey":null,"isDefault":true}]}}}' + headers: + cache-control: + - no-cache + content-length: + - '1727' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 09:18:13 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.5.0 Azure-SDK-For-Python + accept-language: + - en-US + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-64501105/providers/Microsoft.HDInsight/clusters/hdisdk-http64501105/getGatewaySettings?api-version=2018-06-01-preview + response: + body: + string: '{"restAuthCredential.isEnabled":"true","restAuthCredential.username":"admin","restAuthCredential.password":"Password1!"}' + headers: + cache-control: + - no-cache + content-length: + - '120' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 09:18:14 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: '{"restAuthCredential.isEnabled": true, "restAuthCredential.username": "admin", + "restAuthCredential.password": "NewPassword1!"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '126' + Content-Type: + - application/json; charset=utf-8 + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.5.0 Azure-SDK-For-Python + accept-language: + - en-US + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-64501105/providers/Microsoft.HDInsight/clusters/hdisdk-http64501105/updateGatewaySettings?api-version=2018-06-01-preview + response: + body: + string: '' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-64501105/providers/Microsoft.HDInsight/clusters/hdisdk-http64501105/azureasyncoperations/8d5a4692-38ea-4524-a1d1-ada06d8d36ff-0-r?api-version=2018-06-01-preview + cache-control: + - no-cache + content-length: + - '0' + date: + - Wed, 03 Jun 2020 09:18:15 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-64501105/providers/Microsoft.HDInsight/clusters/hdisdk-http64501105/operationresults/8d5a4692-38ea-4524-a1d1-ada06d8d36ff-0-r?api-version=2018-06-01-preview + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.5.0 Azure-SDK-For-Python + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-64501105/providers/Microsoft.HDInsight/clusters/hdisdk-http64501105/azureasyncoperations/8d5a4692-38ea-4524-a1d1-ada06d8d36ff-0-r?api-version=2018-06-01-preview + response: + body: + string: '{"status":"Succeeded"}' + headers: + cache-control: + - no-cache + content-length: + - '22' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 09:19:18 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.5.0 Azure-SDK-For-Python + accept-language: + - en-US + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-64501105/providers/Microsoft.HDInsight/clusters/hdisdk-http64501105/getGatewaySettings?api-version=2018-06-01-preview + response: + body: + string: '{"restAuthCredential.isEnabled":"true","restAuthCredential.username":"admin","restAuthCredential.password":"NewPassword1!"}' + headers: + cache-control: + - no-cache + content-length: + - '123' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 09:19:19 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + x-ms-ratelimit-remaining-subscription-writes: + - '1197' + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/hdinsight/azure-mgmt-hdinsight/test/recordings/test_mgmt_hdinsight.test_http_extended.yaml b/sdk/hdinsight/azure-mgmt-hdinsight/test/recordings/test_mgmt_hdinsight.test_http_extended.yaml deleted file mode 100644 index 1f6625a2944e..000000000000 --- a/sdk/hdinsight/azure-mgmt-hdinsight/test/recordings/test_mgmt_hdinsight.test_http_extended.yaml +++ /dev/null @@ -1,1164 +0,0 @@ -interactions: -- request: - body: '{"location": "North Central US", "tags": {}, "properties": {"clusterVersion": - "3.6", "osType": "Linux", "tier": "Standard", "clusterDefinition": {"kind": - "hadoop", "configurations": {"gateway": {"restAuthCredential.isEnabled": "true", - "restAuthCredential.username": "admin", "restAuthCredential.password": "Password1!"}}}, - "computeProfile": {"roles": [{"name": "headnode", "targetInstanceCount": 2, - "hardwareProfile": {"vmSize": "Large"}, "osProfile": {"linuxOperatingSystemProfile": - {"username": "sshuser", "password": "Password1!"}}}, {"name": "workernode", - "targetInstanceCount": 3, "hardwareProfile": {"vmSize": "Large"}, "osProfile": - {"linuxOperatingSystemProfile": {"username": "sshuser", "password": "Password1!"}}}, - {"name": "zookeepernode", "targetInstanceCount": 3, "hardwareProfile": {"vmSize": - "Small"}, "osProfile": {"linuxOperatingSystemProfile": {"username": "sshuser", - "password": "Password1!"}}}]}, "storageProfile": {"storageaccounts": [{"name": - "hdipy33370fb3.blob.core.windows.net", "isDefault": true, "container": "hdisdk-http33370fb3", - "key": "QjPI8i2SeLFBj+mY1TqGenoLfINAaiJFWePiXS17fcL9Q8Ox/RIkWxATvMbomQZ72kBkaJTpB/iVNjG8Cl8KNA=="}]}}}' - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['1160'] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - accept-language: [en-US] - method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-33370fb3/providers/Microsoft.HDInsight/clusters/hdisdk-http33370fb3?api-version=2018-06-01-preview - response: - body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-33370fb3/providers/Microsoft.HDInsight/clusters/hdisdk-http33370fb3","name":"hdisdk-http33370fb3","type":"Microsoft.HDInsight/clusters","location":"North - Central US","etag":"5fdccf81-5141-4144-960e-4312a7672fe0","tags":{},"properties":{"clusterVersion":"3.6.1000.67","clusterHdpVersion":"","osType":"Linux","clusterDefinition":{"blueprint":"https://blueprints.azurehdinsight.net/hadoop-3.6.1000.67.1812120705.json","kind":"hadoop","componentVersion":{"hadoop":"2.7"}},"computeProfile":{"roles":[{"name":"headnode","targetInstanceCount":2,"hardwareProfile":{"vmSize":"Large"},"osProfile":{"linuxOperatingSystemProfile":{"username":"sshuser"}},"encryptDataDisks":false},{"name":"workernode","targetInstanceCount":3,"hardwareProfile":{"vmSize":"Large"},"osProfile":{"linuxOperatingSystemProfile":{"username":"sshuser"}},"encryptDataDisks":false},{"name":"zookeepernode","targetInstanceCount":3,"hardwareProfile":{"vmSize":"Medium"},"osProfile":{"linuxOperatingSystemProfile":{"username":"sshuser"}},"encryptDataDisks":false}]},"provisioningState":"InProgress","clusterState":"Accepted","createdDate":"2018-12-25T09:31:18.527","quotaInfo":{"coresUsed":20},"tier":"standard"}}'} - headers: - azure-asyncoperation: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-33370fb3/providers/Microsoft.HDInsight/clusters/hdisdk-http33370fb3/azureasyncoperations/create?api-version=2018-06-01-preview'] - cache-control: [no-cache] - content-length: ['1251'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 25 Dec 2018 09:31:18 GMT'] - etag: ['"5fdccf81-5141-4144-960e-4312a7672fe0"'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-clusteruri: ['https://management.azure.com/subscriptions/964c10bb-8a6c-43bc-83d3-6b318c6c7305/resourceGroups/hdipy-33370fb3/providers/Microsoft.HDInsight/clusters/hdisdk-http33370fb3?api-version=2018-06-01-preview'] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - x-ms-ratelimit-remaining-subscription-writes: ['1199'] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-33370fb3/providers/Microsoft.HDInsight/clusters/hdisdk-http33370fb3/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 25 Dec 2018 09:31:49 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-33370fb3/providers/Microsoft.HDInsight/clusters/hdisdk-http33370fb3/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 25 Dec 2018 09:32:20 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-33370fb3/providers/Microsoft.HDInsight/clusters/hdisdk-http33370fb3/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 25 Dec 2018 09:32:52 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-33370fb3/providers/Microsoft.HDInsight/clusters/hdisdk-http33370fb3/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 25 Dec 2018 09:33:23 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-33370fb3/providers/Microsoft.HDInsight/clusters/hdisdk-http33370fb3/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 25 Dec 2018 09:33:54 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-33370fb3/providers/Microsoft.HDInsight/clusters/hdisdk-http33370fb3/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 25 Dec 2018 09:34:24 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-33370fb3/providers/Microsoft.HDInsight/clusters/hdisdk-http33370fb3/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 25 Dec 2018 09:34:56 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-33370fb3/providers/Microsoft.HDInsight/clusters/hdisdk-http33370fb3/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 25 Dec 2018 09:35:27 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-33370fb3/providers/Microsoft.HDInsight/clusters/hdisdk-http33370fb3/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 25 Dec 2018 09:35:57 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-33370fb3/providers/Microsoft.HDInsight/clusters/hdisdk-http33370fb3/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 25 Dec 2018 09:36:28 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-33370fb3/providers/Microsoft.HDInsight/clusters/hdisdk-http33370fb3/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 25 Dec 2018 09:37:00 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-33370fb3/providers/Microsoft.HDInsight/clusters/hdisdk-http33370fb3/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 25 Dec 2018 09:37:30 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-33370fb3/providers/Microsoft.HDInsight/clusters/hdisdk-http33370fb3/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 25 Dec 2018 09:38:01 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-33370fb3/providers/Microsoft.HDInsight/clusters/hdisdk-http33370fb3/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 25 Dec 2018 09:38:32 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-33370fb3/providers/Microsoft.HDInsight/clusters/hdisdk-http33370fb3/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 25 Dec 2018 09:39:03 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-33370fb3/providers/Microsoft.HDInsight/clusters/hdisdk-http33370fb3/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 25 Dec 2018 09:39:34 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-33370fb3/providers/Microsoft.HDInsight/clusters/hdisdk-http33370fb3/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 25 Dec 2018 09:40:05 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-33370fb3/providers/Microsoft.HDInsight/clusters/hdisdk-http33370fb3/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 25 Dec 2018 09:40:36 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-33370fb3/providers/Microsoft.HDInsight/clusters/hdisdk-http33370fb3/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 25 Dec 2018 09:41:07 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-33370fb3/providers/Microsoft.HDInsight/clusters/hdisdk-http33370fb3/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 25 Dec 2018 09:41:38 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-33370fb3/providers/Microsoft.HDInsight/clusters/hdisdk-http33370fb3/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 25 Dec 2018 09:42:08 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-33370fb3/providers/Microsoft.HDInsight/clusters/hdisdk-http33370fb3/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 25 Dec 2018 09:42:40 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-33370fb3/providers/Microsoft.HDInsight/clusters/hdisdk-http33370fb3/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 25 Dec 2018 09:43:10 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-33370fb3/providers/Microsoft.HDInsight/clusters/hdisdk-http33370fb3/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 25 Dec 2018 09:43:42 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-33370fb3/providers/Microsoft.HDInsight/clusters/hdisdk-http33370fb3/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 25 Dec 2018 09:44:13 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-33370fb3/providers/Microsoft.HDInsight/clusters/hdisdk-http33370fb3/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 25 Dec 2018 09:44:44 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-33370fb3/providers/Microsoft.HDInsight/clusters/hdisdk-http33370fb3/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 25 Dec 2018 09:45:15 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-33370fb3/providers/Microsoft.HDInsight/clusters/hdisdk-http33370fb3/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 25 Dec 2018 09:45:46 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-33370fb3/providers/Microsoft.HDInsight/clusters/hdisdk-http33370fb3/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 25 Dec 2018 09:46:17 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-33370fb3/providers/Microsoft.HDInsight/clusters/hdisdk-http33370fb3/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 25 Dec 2018 09:46:48 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-33370fb3/providers/Microsoft.HDInsight/clusters/hdisdk-http33370fb3/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 25 Dec 2018 09:47:18 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-33370fb3/providers/Microsoft.HDInsight/clusters/hdisdk-http33370fb3/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 25 Dec 2018 09:47:49 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-33370fb3/providers/Microsoft.HDInsight/clusters/hdisdk-http33370fb3/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 25 Dec 2018 09:48:20 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-33370fb3/providers/Microsoft.HDInsight/clusters/hdisdk-http33370fb3/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 25 Dec 2018 09:48:52 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-33370fb3/providers/Microsoft.HDInsight/clusters/hdisdk-http33370fb3/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"InProgress"}'} - headers: - cache-control: [no-cache] - content-length: ['23'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 25 Dec 2018 09:49:23 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-33370fb3/providers/Microsoft.HDInsight/clusters/hdisdk-http33370fb3/azureasyncoperations/create?api-version=2018-06-01-preview - response: - body: {string: '{"status":"Succeeded"}'} - headers: - cache-control: [no-cache] - content-length: ['22'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 25 Dec 2018 09:49:54 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-33370fb3/providers/Microsoft.HDInsight/clusters/hdisdk-http33370fb3?api-version=2018-06-01-preview - response: - body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-33370fb3/providers/Microsoft.HDInsight/clusters/hdisdk-http33370fb3","name":"hdisdk-http33370fb3","type":"Microsoft.HDInsight/clusters","location":"North - Central US","etag":"5fdccf81-5141-4144-960e-4312a7672fe0","tags":{},"properties":{"clusterVersion":"3.6.1000.67","clusterHdpVersion":"2.6.5.3005-27","osType":"Linux","clusterDefinition":{"blueprint":"https://blueprints.azurehdinsight.net/hadoop-3.6.1000.67.1812120705.json","kind":"hadoop","componentVersion":{"hadoop":"2.7"}},"computeProfile":{"roles":[{"name":"headnode","targetInstanceCount":2,"hardwareProfile":{"vmSize":"Large"},"osProfile":{"linuxOperatingSystemProfile":{"username":"sshuser"}},"encryptDataDisks":false},{"name":"workernode","targetInstanceCount":3,"hardwareProfile":{"vmSize":"Large"},"osProfile":{"linuxOperatingSystemProfile":{"username":"sshuser"}},"encryptDataDisks":false},{"name":"zookeepernode","targetInstanceCount":3,"hardwareProfile":{"vmSize":"Medium"},"osProfile":{"linuxOperatingSystemProfile":{"username":"sshuser"}},"encryptDataDisks":false}]},"provisioningState":"Succeeded","clusterState":"Running","createdDate":"2018-12-25T09:31:18.527","quotaInfo":{"coresUsed":20},"connectivityEndpoints":[{"name":"SSH","protocol":"TCP","location":"hdisdk-http33370fb3-ssh.azurehdinsight.net","port":22},{"name":"HTTPS","protocol":"TCP","location":"hdisdk-http33370fb3.azurehdinsight.net","port":443}],"tier":"standard"}}'} - headers: - cache-control: [no-cache] - content-length: ['1483'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 25 Dec 2018 09:49:55 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - accept-language: [en-US] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-33370fb3/providers/Microsoft.HDInsight/clusters/hdisdk-http33370fb3/configurations/gateway?api-version=2018-06-01-preview - response: - body: {string: '{"restAuthCredential.isEnabled":"true","restAuthCredential.username":"admin","restAuthCredential.password":"Password1!"}'} - headers: - cache-control: [no-cache] - content-length: ['120'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 25 Dec 2018 09:49:56 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} -- request: - body: '{"restAuthCredential.isEnabled": "true", "restAuthCredential.username": - "admin", "restAuthCredential.password": "NewPassword1!"}' - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['128'] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - accept-language: [en-US] - method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-33370fb3/providers/Microsoft.HDInsight/clusters/hdisdk-http33370fb3/configurations/gateway?api-version=2018-06-01-preview - response: - body: {string: ''} - headers: - azure-asyncoperation: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-33370fb3/providers/Microsoft.HDInsight/clusters/hdisdk-http33370fb3/azureasyncoperations/d1409e55-9cf3-4543-b85d-5ba458ad4da3-0-r?api-version=2018-06-01-preview'] - cache-control: [no-cache] - content-length: ['0'] - date: ['Tue, 25 Dec 2018 09:49:56 GMT'] - expires: ['-1'] - location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-33370fb3/providers/Microsoft.HDInsight/clusters/hdisdk-http33370fb3/operationresults/d1409e55-9cf3-4543-b85d-5ba458ad4da3-0-r?api-version=2018-06-01-preview'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - x-ms-ratelimit-remaining-subscription-writes: ['1199'] - status: {code: 202, message: Accepted} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-33370fb3/providers/Microsoft.HDInsight/clusters/hdisdk-http33370fb3/azureasyncoperations/d1409e55-9cf3-4543-b85d-5ba458ad4da3-0-r?api-version=2018-06-01-preview - response: - body: {string: '{"status":"Succeeded"}'} - headers: - cache-control: [no-cache] - content-length: ['22'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 25 Dec 2018 09:50:58 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - accept-language: [en-US] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-33370fb3/providers/Microsoft.HDInsight/clusters/hdisdk-http33370fb3/configurations/gateway?api-version=2018-06-01-preview - response: - body: {string: '{"restAuthCredential.isEnabled":"true","restAuthCredential.username":"admin","restAuthCredential.password":"NewPassword1!"}'} - headers: - cache-control: [no-cache] - content-length: ['123'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 25 Dec 2018 09:50:59 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} -version: 1 diff --git a/sdk/hdinsight/azure-mgmt-hdinsight/test/recordings/test_mgmt_hdinsight.test_hue_on_running_cluster.yaml b/sdk/hdinsight/azure-mgmt-hdinsight/test/recordings/test_mgmt_hdinsight.test_hue_on_running_cluster.yaml index 7b0b04385367..10db33ebb1b3 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsight/test/recordings/test_mgmt_hdinsight.test_hue_on_running_cluster.yaml +++ b/sdk/hdinsight/azure-mgmt-hdinsight/test/recordings/test_mgmt_hdinsight.test_hue_on_running_cluster.yaml @@ -1,104 +1,174 @@ interactions: - request: - body: '{"location": "North Central US", "tags": {}, "properties": {"clusterVersion": + body: 'b''{"location": "North Central US", "tags": {}, "properties": {"clusterVersion": "3.6", "osType": "Linux", "tier": "Standard", "clusterDefinition": {"kind": - "hadoop", "configurations": {"gateway": {"restAuthCredential.isEnabled": - "true", "restAuthCredential.username": "admin", "restAuthCredential.password": - "Password1!"}}}, "computeProfile": {"roles": [{"name": "headnode", "targetInstanceCount": - 2, "hardwareProfile": {"vmSize": "Large"}, "osProfile": {"linuxOperatingSystemProfile": + "hadoop", "configurations": {"gateway": {"restAuthCredential.isEnabled": "true", + "restAuthCredential.username": "admin", "restAuthCredential.password": "Password1!"}}}, + "computeProfile": {"roles": [{"name": "headnode", "targetInstanceCount": 2, + "hardwareProfile": {"vmSize": "Large"}, "osProfile": {"linuxOperatingSystemProfile": {"username": "sshuser", "password": "Password1!"}}}, {"name": "workernode", - "targetInstanceCount": 1, "hardwareProfile": {"vmSize": "Large"}, "osProfile": - {"linuxOperatingSystemProfile": {"username": "sshuser", "password": "Password1!"}}}]}, - "storageProfile": {"storageaccounts": [{"name": "hdipyd29c1382.blob.core.windows.net", - "isDefault": true, "container": "hdisdk-applications-hued29c1382", "key": "TGsFHWwXRVNlFKURgc5OiS+ishTKFpqrZVJQL794VZKIjO2UvqOwP5dhirF3/DDMNxZWmi+Xq8DDkuRCYeIFHw=="}]}}}' + "targetInstanceCount": 3, "hardwareProfile": {"vmSize": "Large"}, "osProfile": + {"linuxOperatingSystemProfile": {"username": "sshuser", "password": "Password1!"}}}, + {"name": "zookeepernode", "targetInstanceCount": 3, "hardwareProfile": {"vmSize": + "Small"}, "osProfile": {"linuxOperatingSystemProfile": {"username": "sshuser", + "password": "Password1!"}}}]}, "storageProfile": {"storageaccounts": [{"name": + "hdipy.blob.core.windows.net", "isDefault": true, "container": "hdisdk-applications-hued29c1382", + "key": "8sFiS5xxlEDcIC3Q252wR9menGs5x6KaZw2DizQOat/oPUOUCYj6O4UhkSTbOxcy85yvfAljZYaKiN2cK6MHog=="}]}}}''' headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['991'] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - accept-language: [en-US] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '1172' + Content-Type: + - application/json; charset=utf-8 + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.5.0 Azure-SDK-For-Python + accept-language: + - en-US method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-d29c1382/providers/Microsoft.HDInsight/clusters/hdisdk-applications-hued29c1382?api-version=2018-06-01-preview response: - body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-d29c1382/providers/Microsoft.HDInsight/clusters/hdisdk-applications-hued29c1382","name":"hdisdk-applications-hued29c1382","type":"Microsoft.HDInsight/clusters","location":"North - Central US","etag":"b82c89e7-923d-4a01-b48e-ba4731f1150d","tags":{},"properties":{"clusterVersion":"3.6.1000.67","clusterHdpVersion":"2.6.5.3005-27","osType":"Linux","clusterDefinition":{"blueprint":"https://blueprints.azurehdinsight.net/hadoop-3.6.1000.67.1812120705.json","kind":"hadoop","componentVersion":{"hadoop":"2.7"}},"computeProfile":{"roles":[{"name":"headnode","targetInstanceCount":2,"hardwareProfile":{"vmSize":"Large"},"osProfile":{"linuxOperatingSystemProfile":{"username":"sshuser"}},"encryptDataDisks":false},{"name":"workernode","targetInstanceCount":1,"hardwareProfile":{"vmSize":"Large"},"osProfile":{"linuxOperatingSystemProfile":{"username":"sshuser"}},"encryptDataDisks":false},{"name":"zookeepernode","targetInstanceCount":3,"hardwareProfile":{"vmSize":"Medium"},"osProfile":{"linuxOperatingSystemProfile":{"username":"sshuser"}},"encryptDataDisks":false},{"name":"edgenode1","targetInstanceCount":1,"hardwareProfile":{"vmSize":"Large"},"osProfile":{"linuxOperatingSystemProfile":{"username":"sshuser"}},"encryptDataDisks":false}]},"provisioningState":"Succeeded","clusterState":"Running","createdDate":"2018-12-24T11:39:00.623","quotaInfo":{"coresUsed":16},"connectivityEndpoints":[{"name":"SSH","protocol":"TCP","location":"hdisdk-applications-hued29c1382-ssh.azurehdinsight.net","port":22},{"name":"HTTPS","protocol":"TCP","location":"hdisdk-applications-hued29c1382.azurehdinsight.net","port":443}],"tier":"standard"}}'} + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-d29c1382/providers/Microsoft.HDInsight/clusters/hdisdk-applications-hued29c1382","name":"hdisdk-applications-hued29c1382","type":"Microsoft.HDInsight/clusters","location":"North + Central US","etag":"27a1e167-8d5d-4c61-9503-8ca86abde447","tags":{},"properties":{"clusterVersion":"3.6.1000.67","clusterHdpVersion":"2.6.5.3022-3","osType":"Linux","clusterDefinition":{"blueprint":"https://blueprints.azurehdinsight.net/hadoop-3.6.1000.67.2004291541.json","kind":"hadoop","componentVersion":{"hadoop":"2.7"}},"computeProfile":{"roles":[{"name":"headnode","targetInstanceCount":2,"hardwareProfile":{"vmSize":"standard_a4_v2"},"osProfile":{"linuxOperatingSystemProfile":{"username":"sshuser"}},"encryptDataDisks":false},{"name":"workernode","targetInstanceCount":3,"hardwareProfile":{"vmSize":"standard_a4_v2"},"osProfile":{"linuxOperatingSystemProfile":{"username":"sshuser"}},"encryptDataDisks":false},{"name":"zookeepernode","targetInstanceCount":3,"hardwareProfile":{"vmSize":"standard_a2_v2"},"osProfile":{"linuxOperatingSystemProfile":{"username":"sshuser"}},"encryptDataDisks":false},{"name":"edgenode1","targetInstanceCount":1,"hardwareProfile":{"vmSize":"standard_a4_v2"},"osProfile":{"linuxOperatingSystemProfile":{"username":"sshuser"}},"encryptDataDisks":false}]},"provisioningState":"Succeeded","clusterState":"Running","createdDate":"2020-06-03T09:10:55.02","quotaInfo":{"coresUsed":24},"connectivityEndpoints":[{"name":"SSH","protocol":"TCP","location":"hdisdk-applications-hued29c1382-ssh.azurehdinsight.net","port":22},{"name":"HTTPS","protocol":"TCP","location":"hdisdk-applications-hued29c1382.azurehdinsight.net","port":443}],"tier":"standard","storageProfile":{"storageaccounts":[{"name":"hdipy.blob.core.windows.net","resourceId":null,"msiResourceId":null,"key":null,"fileSystem":null,"container":"hdisdk-applications-hued29c1382","saskey":null,"isDefault":true}]}}}' headers: - azure-asyncoperation: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-d29c1382/providers/Microsoft.HDInsight/clusters/hdisdk-applications-hued29c1382/azureasyncoperations/create?api-version=2018-06-01-preview'] - cache-control: [no-cache] - content-length: ['1705'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 25 Dec 2018 02:59:12 GMT'] - etag: ['"b82c89e7-923d-4a01-b48e-ba4731f1150d"'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-clusteruri: ['https://management.azure.com/subscriptions/964c10bb-8a6c-43bc-83d3-6b318c6c7305/resourceGroups/hdipy-d29c1382/providers/Microsoft.HDInsight/clusters/hdisdk-applications-hued29c1382?api-version=2018-06-01-preview'] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - x-ms-ratelimit-remaining-subscription-writes: ['1198'] - status: {code: 200, message: OK} + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-d29c1382/providers/Microsoft.HDInsight/clusters/hdisdk-applications-hued29c1382/azureasyncoperations/create?api-version=2018-06-01-preview + cache-control: + - no-cache + content-length: + - '1969' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 09:58:45 GMT + etag: + - '"27a1e167-8d5d-4c61-9503-8ca86abde447"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-clusteruri: + - https://management.azure.com/subscriptions/964c10bb-8a6c-43bc-83d3-6b318c6c7305/resourceGroups/hdipy-d29c1382/providers/Microsoft.HDInsight/clusters/hdisdk-applications-hued29c1382?api-version=2018-06-01-preview + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 200 + message: OK - request: body: null headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.5.0 Azure-SDK-For-Python method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-d29c1382/providers/Microsoft.HDInsight/clusters/hdisdk-applications-hued29c1382/azureasyncoperations/create?api-version=2018-06-01-preview response: - body: {string: '{"status":"Succeeded"}'} + body: + string: '{"status":"Succeeded"}' headers: - cache-control: [no-cache] - content-length: ['22'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 25 Dec 2018 02:59:43 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} + cache-control: + - no-cache + content-length: + - '22' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 09:59:16 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + status: + code: 200 + message: OK - request: body: null headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.5.0 Azure-SDK-For-Python method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-d29c1382/providers/Microsoft.HDInsight/clusters/hdisdk-applications-hued29c1382?api-version=2018-06-01-preview response: - body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-d29c1382/providers/Microsoft.HDInsight/clusters/hdisdk-applications-hued29c1382","name":"hdisdk-applications-hued29c1382","type":"Microsoft.HDInsight/clusters","location":"North - Central US","etag":"b82c89e7-923d-4a01-b48e-ba4731f1150d","tags":{},"properties":{"clusterVersion":"3.6.1000.67","clusterHdpVersion":"2.6.5.3005-27","osType":"Linux","clusterDefinition":{"blueprint":"https://blueprints.azurehdinsight.net/hadoop-3.6.1000.67.1812120705.json","kind":"hadoop","componentVersion":{"hadoop":"2.7"}},"computeProfile":{"roles":[{"name":"headnode","targetInstanceCount":2,"hardwareProfile":{"vmSize":"Large"},"osProfile":{"linuxOperatingSystemProfile":{"username":"sshuser"}},"encryptDataDisks":false},{"name":"workernode","targetInstanceCount":1,"hardwareProfile":{"vmSize":"Large"},"osProfile":{"linuxOperatingSystemProfile":{"username":"sshuser"}},"encryptDataDisks":false},{"name":"zookeepernode","targetInstanceCount":3,"hardwareProfile":{"vmSize":"Medium"},"osProfile":{"linuxOperatingSystemProfile":{"username":"sshuser"}},"encryptDataDisks":false},{"name":"edgenode1","targetInstanceCount":1,"hardwareProfile":{"vmSize":"Large"},"osProfile":{"linuxOperatingSystemProfile":{"username":"sshuser"}},"encryptDataDisks":false}]},"provisioningState":"Succeeded","clusterState":"Running","createdDate":"2018-12-24T11:39:00.623","quotaInfo":{"coresUsed":16},"connectivityEndpoints":[{"name":"SSH","protocol":"TCP","location":"hdisdk-applications-hued29c1382-ssh.azurehdinsight.net","port":22},{"name":"HTTPS","protocol":"TCP","location":"hdisdk-applications-hued29c1382.azurehdinsight.net","port":443}],"tier":"standard"}}'} + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-d29c1382/providers/Microsoft.HDInsight/clusters/hdisdk-applications-hued29c1382","name":"hdisdk-applications-hued29c1382","type":"Microsoft.HDInsight/clusters","location":"North + Central US","etag":"27a1e167-8d5d-4c61-9503-8ca86abde447","tags":{},"properties":{"clusterVersion":"3.6.1000.67","clusterHdpVersion":"2.6.5.3022-3","osType":"Linux","clusterDefinition":{"blueprint":"https://blueprints.azurehdinsight.net/hadoop-3.6.1000.67.2004291541.json","kind":"hadoop","componentVersion":{"hadoop":"2.7"}},"computeProfile":{"roles":[{"name":"headnode","targetInstanceCount":2,"hardwareProfile":{"vmSize":"standard_a4_v2"},"osProfile":{"linuxOperatingSystemProfile":{"username":"sshuser"}},"encryptDataDisks":false},{"name":"workernode","targetInstanceCount":3,"hardwareProfile":{"vmSize":"standard_a4_v2"},"osProfile":{"linuxOperatingSystemProfile":{"username":"sshuser"}},"encryptDataDisks":false},{"name":"zookeepernode","targetInstanceCount":3,"hardwareProfile":{"vmSize":"standard_a2_v2"},"osProfile":{"linuxOperatingSystemProfile":{"username":"sshuser"}},"encryptDataDisks":false},{"name":"edgenode1","targetInstanceCount":1,"hardwareProfile":{"vmSize":"standard_a4_v2"},"osProfile":{"linuxOperatingSystemProfile":{"username":"sshuser"}},"encryptDataDisks":false}]},"provisioningState":"Succeeded","clusterState":"Running","createdDate":"2020-06-03T09:10:55.02","quotaInfo":{"coresUsed":24},"connectivityEndpoints":[{"name":"SSH","protocol":"TCP","location":"hdisdk-applications-hued29c1382-ssh.azurehdinsight.net","port":22},{"name":"HTTPS","protocol":"TCP","location":"hdisdk-applications-hued29c1382.azurehdinsight.net","port":443}],"tier":"standard","storageProfile":{"storageaccounts":[{"name":"hdipy.blob.core.windows.net","resourceId":null,"msiResourceId":null,"key":null,"fileSystem":null,"container":"hdisdk-applications-hued29c1382","saskey":null,"isDefault":true}]}}}' headers: - cache-control: [no-cache] - content-length: ['1705'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 25 Dec 2018 02:59:44 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} + cache-control: + - no-cache + content-length: + - '1969' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 09:59:17 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + status: + code: 200 + message: OK - request: body: '{"properties": {"computeProfile": {"roles": [{"name": "edgenode", "targetInstanceCount": 1, "hardwareProfile": {"vmSize": "Large"}}]}, "installScriptActions": [{"name": @@ -106,204 +176,449 @@ interactions: "parameters": "-version latest -port 20000", "roles": ["edgenode"]}], "applicationType": "CustomApplication"}}' headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['398'] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - accept-language: [en-US] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '398' + Content-Type: + - application/json; charset=utf-8 + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.5.0 Azure-SDK-For-Python + accept-language: + - en-US method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-d29c1382/providers/Microsoft.HDInsight/clusters/hdisdk-applications-hued29c1382/applications/MyApplication?api-version=2018-06-01-preview response: - body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-d29c1382/providers/Microsoft.HDInsight/clusters/hdisdk-applications-hued29c1382/applications/MyApplication","name":"MyApplication","type":"Microsoft.HDInsight/clusters/applications","etag":"87B98989-136A-4541-B042-D5BDC4698217","tags":null,"properties":{"computeProfile":{"roles":[{"name":"edgenode","targetInstanceCount":1,"hardwareProfile":{"vmSize":"Large"},"encryptDataDisks":false}]},"installScriptActions":[{"name":"InstallHue","uri":"https://hdiconfigactions.blob.core.windows.net/linuxhueconfigactionv02/install-hue-uber-v02.sh","roles":["edgenode"]}],"uninstallScriptActions":[],"httpsEndpoints":[],"sshEndpoints":[{"location":"MyApplication.hdisdk-applications-hued29c1382-ssh.azurehdinsight.net:22","destinationPort":22,"publicPort":22}],"provisioningState":"Failed","applicationState":"Error","errors":[{"code":"FailedToAddApplicationErrorCode","message":"Failed - to add an application with id: 135"}],"createdDate":"2018-12-24T11:58:41.23","applicationType":"CustomApplication"}}'} + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-d29c1382/providers/Microsoft.HDInsight/clusters/hdisdk-applications-hued29c1382/applications/MyApplication","name":"MyApplication","type":"Microsoft.HDInsight/clusters/applications","etag":"99CD7556-3ECD-47AA-88DC-D2E3FE283B76","tags":null,"properties":{"computeProfile":{"roles":[{"name":"edgenode","targetInstanceCount":1,"VMGroupName":"edgenode1","hardwareProfile":{"vmSize":"standard_a4_v2"},"encryptDataDisks":false}]},"installScriptActions":[{"name":"InstallHue","uri":"https://hdiconfigactions.blob.core.windows.net/linuxhueconfigactionv02/install-hue-uber-v02.sh","roles":["edgenode"]}],"uninstallScriptActions":[],"httpsEndpoints":[],"sshEndpoints":[{"location":"MyApplication.hdisdk-applications-hued29c1382-ssh.azurehdinsight.net:22","destinationPort":22,"publicPort":22}],"provisioningState":"Failed","applicationState":"Error","errors":[{"code":"FailedToAddApplicationErrorCode","message":"Failed + to add an application {ApplicationName: MyApplication, ApplicationId: 256}"}],"createdDate":"2020-06-03T09:23:58.69","applicationType":"CustomApplication"}}' headers: - azure-asyncoperation: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-d29c1382/providers/Microsoft.HDInsight/clusters/hdisdk-applications-hued29c1382/azureasyncoperations/create?api-version=2018-06-01-preview'] - cache-control: [no-cache] - content-length: ['1071'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 25 Dec 2018 02:59:46 GMT'] - etag: ['"87B98989-136A-4541-B042-D5BDC4698217"'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-appuri: ['https://management.azure.com/subscriptions/964c10bb-8a6c-43bc-83d3-6b318c6c7305/resourceGroups/hdipy-d29c1382/providers/Microsoft.HDInsight/clusters/hdisdk-applications-hued29c1382/applications/MyApplication?api-version=2018-06-01-preview'] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - x-ms-ratelimit-remaining-subscription-writes: ['1199'] - status: {code: 200, message: OK} + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-d29c1382/providers/Microsoft.HDInsight/clusters/hdisdk-applications-hued29c1382/azureasyncoperations/create?api-version=2018-06-01-preview + cache-control: + - no-cache + content-length: + - '1146' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 09:59:18 GMT + etag: + - '"99CD7556-3ECD-47AA-88DC-D2E3FE283B76"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-appuri: + - https://management.azure.com/subscriptions/964c10bb-8a6c-43bc-83d3-6b318c6c7305/resourceGroups/hdipy-d29c1382/providers/Microsoft.HDInsight/clusters/hdisdk-applications-hued29c1382/applications/MyApplication?api-version=2018-06-01-preview + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + x-ms-ratelimit-remaining-subscription-writes: + - '1197' + status: + code: 200 + message: OK - request: body: null headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.5.0 Azure-SDK-For-Python method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-d29c1382/providers/Microsoft.HDInsight/clusters/hdisdk-applications-hued29c1382/azureasyncoperations/create?api-version=2018-06-01-preview response: - body: {string: '{"status":"Succeeded"}'} + body: + string: '{"status":"Succeeded"}' headers: - cache-control: [no-cache] - content-length: ['22'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 25 Dec 2018 03:00:17 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} + cache-control: + - no-cache + content-length: + - '22' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 09:59:50 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + status: + code: 200 + message: OK - request: body: null headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.5.0 Azure-SDK-For-Python method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-d29c1382/providers/Microsoft.HDInsight/clusters/hdisdk-applications-hued29c1382/applications/MyApplication?api-version=2018-06-01-preview response: - body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-d29c1382/providers/Microsoft.HDInsight/clusters/hdisdk-applications-hued29c1382/applications/MyApplication","name":"MyApplication","type":"Microsoft.HDInsight/clusters/applications","etag":"87B98989-136A-4541-B042-D5BDC4698217","tags":null,"properties":{"computeProfile":{"roles":[{"name":"edgenode","targetInstanceCount":1,"hardwareProfile":{"vmSize":"Large"},"encryptDataDisks":false}]},"installScriptActions":[{"name":"InstallHue","uri":"https://hdiconfigactions.blob.core.windows.net/linuxhueconfigactionv02/install-hue-uber-v02.sh","roles":["edgenode"]}],"uninstallScriptActions":[],"httpsEndpoints":[],"sshEndpoints":[{"location":"MyApplication.hdisdk-applications-hued29c1382-ssh.azurehdinsight.net:22","destinationPort":22,"publicPort":22}],"provisioningState":"Failed","applicationState":"Error","errors":[{"code":"FailedToAddApplicationErrorCode","message":"Failed - to add an application with id: 135"}],"createdDate":"2018-12-24T11:58:41.23","applicationType":"CustomApplication"}}'} + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-d29c1382/providers/Microsoft.HDInsight/clusters/hdisdk-applications-hued29c1382/applications/MyApplication","name":"MyApplication","type":"Microsoft.HDInsight/clusters/applications","etag":"99CD7556-3ECD-47AA-88DC-D2E3FE283B76","tags":null,"properties":{"computeProfile":{"roles":[{"name":"edgenode","targetInstanceCount":1,"VMGroupName":"edgenode1","hardwareProfile":{"vmSize":"standard_a4_v2"},"encryptDataDisks":false}]},"installScriptActions":[{"name":"InstallHue","uri":"https://hdiconfigactions.blob.core.windows.net/linuxhueconfigactionv02/install-hue-uber-v02.sh","roles":["edgenode"]}],"uninstallScriptActions":[],"httpsEndpoints":[],"sshEndpoints":[{"location":"MyApplication.hdisdk-applications-hued29c1382-ssh.azurehdinsight.net:22","destinationPort":22,"publicPort":22}],"provisioningState":"Failed","applicationState":"Error","errors":[{"code":"FailedToAddApplicationErrorCode","message":"Failed + to add an application {ApplicationName: MyApplication, ApplicationId: 256}"}],"createdDate":"2020-06-03T09:23:58.69","applicationType":"CustomApplication"}}' headers: - cache-control: [no-cache] - content-length: ['1071'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 25 Dec 2018 03:00:19 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} + cache-control: + - no-cache + content-length: + - '1146' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 09:59:50 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + status: + code: 200 + message: OK - request: body: null headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - accept-language: [en-US] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.5.0 Azure-SDK-For-Python + accept-language: + - en-US method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-d29c1382/providers/Microsoft.HDInsight/clusters/hdisdk-applications-hued29c1382/applications?api-version=2018-06-01-preview response: - body: {string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-d29c1382/providers/Microsoft.HDInsight/clusters/hdisdk-applications-hued29c1382/applications/MyApplication","name":"MyApplication","type":"Microsoft.HDInsight/clusters/applications","etag":"87B98989-136A-4541-B042-D5BDC4698217","tags":null,"properties":{"computeProfile":{"roles":[{"name":"edgenode","targetInstanceCount":1,"hardwareProfile":{"vmSize":"Large"},"encryptDataDisks":false}]},"installScriptActions":[{"name":"InstallHue","uri":"https://hdiconfigactions.blob.core.windows.net/linuxhueconfigactionv02/install-hue-uber-v02.sh","roles":["edgenode"]}],"uninstallScriptActions":[],"httpsEndpoints":[],"sshEndpoints":[{"location":"MyApplication.hdisdk-applications-hued29c1382-ssh.azurehdinsight.net:22","destinationPort":22,"publicPort":22}],"provisioningState":"Failed","applicationState":"Error","errors":[{"code":"FailedToAddApplicationErrorCode","message":"Failed - to add an application with id: 135"}],"createdDate":"2018-12-24T11:58:41.23","applicationType":"CustomApplication"}}]}'} + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-d29c1382/providers/Microsoft.HDInsight/clusters/hdisdk-applications-hued29c1382/applications/MyApplication","name":"MyApplication","type":"Microsoft.HDInsight/clusters/applications","etag":"99CD7556-3ECD-47AA-88DC-D2E3FE283B76","tags":null,"properties":{"computeProfile":{"roles":[{"name":"edgenode","targetInstanceCount":1,"VMGroupName":"edgenode1","hardwareProfile":{"vmSize":"standard_a4_v2"},"encryptDataDisks":false}]},"installScriptActions":[{"name":"InstallHue","uri":"https://hdiconfigactions.blob.core.windows.net/linuxhueconfigactionv02/install-hue-uber-v02.sh","roles":["edgenode"]}],"uninstallScriptActions":[],"httpsEndpoints":[],"sshEndpoints":[{"location":"MyApplication.hdisdk-applications-hued29c1382-ssh.azurehdinsight.net:22","destinationPort":22,"publicPort":22}],"provisioningState":"Failed","applicationState":"Error","errors":[{"code":"FailedToAddApplicationErrorCode","message":"Failed + to add an application {ApplicationName: MyApplication, ApplicationId: 256}"}],"createdDate":"2020-06-03T09:23:58.69","applicationType":"CustomApplication"}}]}' headers: - cache-control: [no-cache] - content-length: ['1083'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 25 Dec 2018 03:00:20 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} + cache-control: + - no-cache + content-length: + - '1158' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 09:59:51 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + status: + code: 200 + message: OK - request: body: null headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['0'] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - accept-language: [en-US] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.5.0 Azure-SDK-For-Python + accept-language: + - en-US method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-d29c1382/providers/Microsoft.HDInsight/clusters/hdisdk-applications-hued29c1382/applications/MyApplication?api-version=2018-06-01-preview response: - body: {string: ''} + body: + string: '' headers: - azure-asyncoperation: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-d29c1382/providers/Microsoft.HDInsight/clusters/hdisdk-applications-hued29c1382/azureasyncoperations/5868a637-1a93-4c5e-adaa-be752d473f53-0-r?api-version=2018-06-01-preview'] - cache-control: [no-cache] - content-length: ['0'] - date: ['Tue, 25 Dec 2018 03:00:22 GMT'] - expires: ['-1'] - location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-d29c1382/providers/Microsoft.HDInsight/clusters/hdisdk-applications-hued29c1382/operationresults/5868a637-1a93-4c5e-adaa-be752d473f53-0-r?api-version=2018-06-01-preview'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - x-ms-ratelimit-remaining-subscription-deletes: ['14999'] - status: {code: 202, message: Accepted} + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-d29c1382/providers/Microsoft.HDInsight/clusters/hdisdk-applications-hued29c1382/azureasyncoperations/48b33508-6e62-4452-8291-638e39c8fa3d-0-r?api-version=2018-06-01-preview + cache-control: + - no-cache + content-length: + - '0' + date: + - Wed, 03 Jun 2020 10:01:52 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-d29c1382/providers/Microsoft.HDInsight/clusters/hdisdk-applications-hued29c1382/operationresults/48b33508-6e62-4452-8291-638e39c8fa3d-0-r?api-version=2018-06-01-preview + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 202 + message: Accepted - request: body: null headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.5.0 Azure-SDK-For-Python method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-d29c1382/providers/Microsoft.HDInsight/clusters/hdisdk-applications-hued29c1382/azureasyncoperations/5868a637-1a93-4c5e-adaa-be752d473f53-0-r?api-version=2018-06-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-d29c1382/providers/Microsoft.HDInsight/clusters/hdisdk-applications-hued29c1382/azureasyncoperations/48b33508-6e62-4452-8291-638e39c8fa3d-0-r?api-version=2018-06-01-preview response: - body: {string: '{"status":"Succeeded"}'} + body: + string: '{"status":"InProgress"}' headers: - cache-control: [no-cache] - content-length: ['22'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 25 Dec 2018 03:01:23 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 10:02:53 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + status: + code: 200 + message: OK - request: body: null headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python/3.7.1 (Windows-10-10.0.14393-SP0) msrest/0.6.2 msrest_azure/0.4.34 - azure-mgmt-hdinsight/0.2.0 Azure-SDK-For-Python] - accept-language: [en-US] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.5.0 Azure-SDK-For-Python + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-d29c1382/providers/Microsoft.HDInsight/clusters/hdisdk-applications-hued29c1382/azureasyncoperations/48b33508-6e62-4452-8291-638e39c8fa3d-0-r?api-version=2018-06-01-preview + response: + body: + string: '{"status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 10:03:24 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.5.0 Azure-SDK-For-Python + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-d29c1382/providers/Microsoft.HDInsight/clusters/hdisdk-applications-hued29c1382/azureasyncoperations/48b33508-6e62-4452-8291-638e39c8fa3d-0-r?api-version=2018-06-01-preview + response: + body: + string: '{"status":"Succeeded"}' + headers: + cache-control: + - no-cache + content-length: + - '22' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 10:03:54 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.14 msrest_azure/0.6.3 + azure-mgmt-hdinsight/1.5.0 Azure-SDK-For-Python + accept-language: + - en-US method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hdipy-d29c1382/providers/Microsoft.HDInsight/clusters/hdisdk-applications-hued29c1382/applications?api-version=2018-06-01-preview response: - body: {string: '{"value":[]}'} + body: + string: '{"value":[]}' headers: - cache-control: [no-cache] - content-length: ['12'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 25 Dec 2018 03:01:23 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-content-type-options: [nosniff] - x-ms-hdi-matched-rule: [ClusterResourcesAndSubResources] - x-ms-hdi-routed-to: [RegionalRp] - x-ms-hdi-served-by: [northcentralus] - status: {code: 200, message: OK} + cache-control: + - no-cache + content-length: + - '12' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 03 Jun 2020 10:03:56 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-hdi-matched-rule: + - ClusterResourcesAndSubResources + x-ms-hdi-routed-to: + - RegionalRp + x-ms-hdi-served-by: + - northcentralus + status: + code: 200 + message: OK version: 1 diff --git a/sdk/hdinsight/azure-mgmt-hdinsight/test/test_mgmt_hdinsight.py b/sdk/hdinsight/azure-mgmt-hdinsight/test/test_mgmt_hdinsight.py index 65821f7d072f..36d331d9e3de 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsight/test/test_mgmt_hdinsight.py +++ b/sdk/hdinsight/azure-mgmt-hdinsight/test/test_mgmt_hdinsight.py @@ -1,18 +1,21 @@ # coding: utf-8 -#------------------------------------------------------------------------- +# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. -#-------------------------------------------------------------------------- +# -------------------------------------------------------------------------- import unittest +from azure.keyvault.keys import KeyVaultKey, KeyClient from azure.mgmt.hdinsight import HDInsightManagementClient from azure.mgmt.hdinsight.models import * from azure.mgmt.keyvault import KeyVaultManagementClient from azure.mgmt.msi import ManagedServiceIdentityClient from azure.mgmt.keyvault.models import SecretPermissions, KeyPermissions, CertificatePermissions, StoragePermissions, \ Permissions, Sku, SkuName, AccessPolicyEntry, VaultProperties, VaultCreateOrUpdateParameters, Vault +from azure.mgmt.loganalytics import LogAnalyticsManagementClient +from azure.mgmt.loganalytics.models import Workspace from azure.mgmt.storage.models import Kind from devtools_testutils import AzureMgmtTestCase, ResourceGroupPreparer, StorageAccountPreparer, FakeStorageAccount from mgmt_hdinsight_preparers import KeyVaultPreparer @@ -28,6 +31,7 @@ FAKE_WORKSPACE_ID = '1d364e89-bb71-4503-aa3d-a23535aea7bd' + class MgmtHDInsightTest(AzureMgmtTestCase): def setUp(self): @@ -38,13 +42,6 @@ def setUp(self): self.msi_client = self.create_mgmt_client(ManagedServiceIdentityClient) self.vault_mgmt_client = self.create_mgmt_client(KeyVaultManagementClient) - # if self.is_live: - # self.vault_client = self.create_basic_client(KeyVaultClient) - # else: - # def _auth_callback(server, resource, scope): - # return AccessToken('Bearer', 'fake-token') - # self.vault_client = KeyVaultClient(KeyVaultAuthentication(authorization_callback=_auth_callback)) - # sensitive test configs self.tenant_id = self.settings.TENANT_ID self.adls_account_name = self.settings.HDI_ADLS_ACCOUNT_NAME @@ -56,9 +53,10 @@ def setUp(self): self.ssh_username = 'sshuser' self.ssh_password = 'Password1!' self.adls_home_mountpoint = '/clusters/hdi' - self.cert_password = '123' - self.cert_content = 'MIIJ8gIBAzCCCa4GCSqGSIb3DQEHAaCCCZ8EggmbMIIJlzCCBgAGCSqGSIb3DQEHAaCCBfEEggXtMIIF6TCCBeUGCyqGSIb3DQEMCgECoIIE9jCCBPIwHAYKKoZIhvcNAQwBAzAOBAiTJstpWcGFZAICB9AEggTQZvg9qVE2ptb3hdH9hnDf5pwIeGghe9assBeEKj/W1JMUjsdEu7qzXH9/3Ro6C1HF6MvSqbav7MD8je9AMb0jl7T3ZmXPgGtrbUsSBTPruVv0hTXPRTxQmcfwae5vEkD03b/4W22sXMMYZB7wOTQMl1d5+0wt267qdF+G1XWtRI2jnxetK8/oyMQxn5Cwuz/VAmn1tXwRAN9gIiZDA8MwvpYha/iFVWKu/vnHg8HT47ry+27/wh8ifM9ea7JWhKh2tZoPIMou9/P/CgkkMv9KVHlmiMldA3Phxsrqjbh/wbd8RWBOtSM7rryMVnc1MYonZraDJMGOLGAhvEcXNBKLwRdmrDDYvpOYlDYKlmNvDXYDm410XCOia2aKP0WoP4qLsExtUwW8Qk2r2QRy5O4B5p2EbPZBlPlMMO4S1NkASjJCghuTCUgvk3uwe2L/mMf0IajAf+R0/VW/fXHbhJkFKobi5JlIqWaHsSC7hMidWj6771Yi8UEXOMshWERs2UHH05aIO3c50lnyypHyhA3BohKUXzNhHA0o7ImQRjmjjTJFBLMNiIZSW0aPtLN1+92pT0a6iS7P1PC0DqEnOjkcs/VOUI3qTt0X78b6wnDO+ATo39B13njGD0mtrVvtTeHclBouoFzpKHkS86GSGmDoHQH6EHhpGF/7wPVfAjAiSrNQb/QLjPHWo+BeiOml4Xrti0K6rWb0AXhY8AmtIlEUC9GscDSdT55v9j9tWONzOXECCgZBYDzNlagMLkCDIFHZwbEGPn3pOc7BTOmQf1GQjfvunLiLWWfe3of9pR+NCDyi1VJUNvjoE+/YnVoBBUMBBO6/4t2SL92iouEF4fyqkQFDb0FOPW4Kfh7H5W+sDZIN9NfqNzniK6HFcpS+jnGm9x9rx81DmMcwtiYZTfYDSivtNxOYrmRFXx574stBzvG0En11uc6E4QhWnkCSsBnnOMjRGDyv95BFVMZC0gIS0rWoKYxjdblpmo9w/yfDtAmQuCs3bdqcJ4mMYt0ueUUZImPRQRJOSrVyoq+brLw657EqM1SahtBmzTG7+HTl1Qi/xZ1xmz6paQDSFVPRcb5QSIp4v08j/Lmj0x4R9jQ4cAmZ3CfPKXBKuIRu2AI2EuqGOoAxvQQEpSjSKUs3fbQxjptUhK7o5FcXAfAxHLzdx2/9L1Iqbo/3HDkbmuix24NRXESG0e/kVr7VAGhoALI7L+eKAdn4AkgmBt55FXZ+uHY9bSKZUoz4Oed2bz2A+9sQBcXG06fLqQEwGVPhATEbYyRduuY6AdTRAmOKmadT5BTTD7+dnFlIt+u7ZpbXm6S6LcSqGqHVacig27SwDt0VznQsjMRDVCiHaWKg4W78xbP7YVvNTB/cBCHmhh5ZXfO/TucizXsQPJlwEMr2CbqByqldXi0i1GUrbg4aLUGZtxgUYex7dHlx6GUejOGRh7fLYCNBo43pjCFvbhFwb0/dWya0crJjpGiY3DNtl1YosJBmvso/Rli4QqVeN7tb45ZsGWTEUg1MDeoGRDqal7GDsvBnH574T5Sz3nSLAoNXR7k0rYaWhezJNobo/SDkuSXskVjNJpv+vjEyW2UGYNhaeK/UHKBP8IrmSAEIZejQj6OEzSPM6TNLW5qJb6LK9agxgdswEwYJKoZIhvcNAQkVMQYEBAEAAAAwXQYJKwYBBAGCNxEBMVAeTgBNAGkAYwByAG8AcwBvAGYAdAAgAFMAdAByAG8AbgBnACAAQwByAHkAcAB0AG8AZwByAGEAcABoAGkAYwAgAFAAcgBvAHYAaQBkAGUAcjBlBgkqhkiG9w0BCRQxWB5WAFAAdgBrAFQAbQBwADoAMAAyAGYAZQA0AGUAOAAzAC0AMgAzADEANgAtADQAMQA3AGMALQA5ADQANQBjAC0AZgA1ADUAMABhADUAZAAwAGIAMAAzAGEwggOPBgkqhkiG9w0BBwagggOAMIIDfAIBADCCA3UGCSqGSIb3DQEHATAcBgoqhkiG9w0BDAEDMA4ECAR1hzovrDkgAgIH0ICCA0gq6boOLRoE5PHFfVIXYtzqg1u2vPMm5mgBUvrh3u+VZ/1FMGTj8od9+Yu91cnumVSgfRiGq7lz+K6by5JsBqP68ksLA2d/PqtTdofCoZ7SgVIo+qqzA64HIQFkElNpo/BJMX/JGpc5OlFq7mdHe6xL2Pfx/3z/pNSV+D+WaAwaDnbLqI7MU6ED3j5l63mExk/8H/VVbiPdqMTzbhIp65oHTGanw86w7RlywqeNb3DkPVMB78Jhcg8vf2AxB8hKf6QiO2uJc/4WKkyLoLmNoD/zhaoUuAbC6hrNVAa9VRWNRfwKZrzwIMSLlKYwWmVcD/QgC8gwxuF+wV3UHwDNAdEe8TEsOhE99/ZiUiogxMdkopZwwtZMszzBB/x5mHCGySauDMVPwoYT6QXewJhGrUap0jwB/Vzy5FaWHi/m8964zWpwC6xfkT2hkDb+rfouWutpiAgMne5tD9YvqxTUmZFIlgwpLrVdPcKQS+b/uIXPTv8uW177XsCOmGGu728ld8H1Ifb2nPveK09Y0AA+ARFpOX0p0ZuxMQqk6NnlA+eESJVm5cLfKszorRcrNPINXaEOGl2okuijm8va30FH9GIYWRt+Be6s8qG672aTO/2eHaTHeR/qQ9aEt0ASDXGcugYS14Jnu2wbauyvotZ6eAvgl5tM2leMpgSLaQqYzPTV2uiD6zDUqxwjm2P8EZQihEQqLUV1jvQuQB4Ui7MryDQ+QiDBD2m5c+9SDPafcR7qgRe/cP4hj5BqzHTcNQAD5BLXze7Yx+TMdf+Qe/R1uBYm8bLjUv9hwUmtMeZP4RU6RPJrN2aRf7BUdgS0j/8YAhxViPucRENuhEfS4sotHf1CJZ7xJz0ZE9cpVY6JLl1tbmuf1Eh50cicZ1SHQhqSP0ggLHV6DNcJz+kyekEe9qggGDi6mreYz/kJnnumsDy5cToIHy9jJhtXzj+/ZNGkdpq9HWMiwAT/VR1WPpzjn06m7Z87PiLaiC3simQtjnl0gVF11Ev4rbIhYjFBL0nKfNpzaWlMaOVF+EumROk3EbZVpx1K6Yh0zWh/NocWSUrtSoHVklzwPCNRvnE1Ehyw5t9YbEBsTIDWRYyqbVYoFVfOUhq5p4TXrqEwOzAfMAcGBSsOAwIaBBSx7sJo66zYk4VOsgD9V/co1SikFAQUUvU/kE4wTRnPRnaWXnno+FCb56kCAgfQ' - self.workspace_id = '1d364e89-bb71-4503-aa3d-a23535aea7bd' + self.cert_password = 'password' + self.cert_content = 'MIIE5TCCAs0CFDGDR+Zz5To67BBDmsF3agvAtdUvMA0GCSqGSIb3DQEBCwUAMC8xCzAJBgNVBAYTAmNuMQ4wDAYDVQQIDAVjaGluYTEQMA4GA1UECgwHenp5dGVzdDAeFw0yMDA0MTYxMDEzNTlaFw0yMTA0MTYxMDEzNTlaMC8xCzAJBgNVBAYTAmNuMQ4wDAYDVQQIDAVjaGluYTEQMA4GA1UECgwHenp5dGVzdDCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMmvOHmbbD5kIXnvIdEGFPVd3dHe8RFHBKMBSyqVdcwiijPsaQGkx2/PHyD019FTFPDcwo5Wt2rPXdkOm5Em7NiHcYWjZTF/UDZytf+B2pihI1jDz5qUGf65vIGWI5VVtuuXHSGMOZ4RGyM8/3SyMfAy02db6bJnat2RziZJ2F3FSPfMebGYgFn8uxfYKLGQj7mPEqVyGHxcx0KqbH+2jfzBqDjbaQfo7vBsqxvMfG+2G9SAHaiZPBveym4HuyDDtBZ3ChslVHitWUw0qsbPEuR7Jp8NenAqKVrzvixoepAm7vvErRs/olkJFu3OcIusDIOEQcYem30/rSQejQvrXTcdIvD3UPcqApdzrEZvdiCvIr0ys1Ie2OoOwdz391KCIlH3zgGu4Tdg0vJ+RQIYNT8DNK2PUbbw1bENEcwklgkdT2uIjgh6kOIjMCuy6UzAPnWBF8bl9YY3rB5p/EjnGk8BSp/nCEggMVxzfUhUNQJGKo1C85yFl8Olet/jtPZgf8JV9TOJLdNHlzdkidwrcLGJ8SAEsbveF2w5CtobqeDoClrSieK6ANPPLOWplMNFPZWqUaLe45ReExGYlm7Q+hpdnJem7ywWanJTzI1GoVJMr04ZJmsMEmVYhoSqN4yvFfyWM+rDrKdpzBF6ZqknzWxw+T59u+Eu+PrRMOMAWsDJAgMBAAEwDQYJKoZIhvcNAQELBQADggIBAC/5VPkcsb8sH6wpS3LeKViG2Z+XBZ70Q7FUliE4wfLwP5duzN8DN6eJyxS/nTyxohvI6p18MVgZdhjPcvndR1FE8eBsMqZM0D3eDyCYoiB9Ghm1DSxn0AZyk7/aC4nNYLorZouWa1DdCCdOFZegod5I3USXIvUOBDh9eIQQAGCYdANSLkYsyaZgTaKWiBDH0pTVvCOroCJ7NCayibCMc4vdHUQY/UyKSgOZG0Y2M6AgwNI/yC3tyizu/D8OoF7RUb/A4JqvHnqkY2hGF3/GwEBO4eQrCmHFozrA5qZx40bWP4sXGzcmZz/4Nl9TWRWdIKe5Wh3xz6ZMtJ3gPDwt4Vi59ZHcmq187uwYIRvuvGzD4/oI4zeZ80nxhJUQrZdPh3beaA5GhvTS9MM/RGgkXgB+CA61iF0euAb3FEC3MvpjDwDq9DZDiBulAscRn3QnYhxaL2AxMkNgtj6oaHGx+RlepXKqPd11hsdWhKo8X0zcCVrtrz73b6yDQesSP+lDapLuo/74APJVyAuEXM7zGQSt3zTmeE6RTIywB00VpifqL9HmcekllopPuQrBgs0cpgrs6/VjbC6uwIwV9dUrIsP6geLeocS9j6aQmEIr/E/HjvEZ0kI+03Cw+gQqeAlSeKP6ZY9AgQsCFBIBsgORNcn/Aii0QenXC19LeFC0dJYm' + self.workspace_id = '3741ffb2-a54e-407c-952a-43ab44b57c9d' + self.primary_key = 'qFmud5LfxcCxWUvWcGMhKDp0v0KuBRLsO/AIddX734W7lzdInsVMsB5ILVoOrF+0fCfk/IYYy5SJ9Q+2v4aihQ==' @ResourceGroupPreparer(name_prefix='hdipy-', location=LOCATION) @StorageAccountPreparer(name_prefix='hdipy', location=LOCATION) @@ -71,17 +69,19 @@ def test_create_humboldt_cluster(self, resource_group, location, storage_account @ResourceGroupPreparer(name_prefix='hdipy-', location=LOCATION) @StorageAccountPreparer(name_prefix='hdipy', location=LOCATION) - def test_create_humboldt_cluster_with_premium_tier(self, resource_group, location, storage_account, storage_account_key): + def test_create_humboldt_cluster_with_premium_tier(self, resource_group, location, storage_account, + storage_account_key): cluster_name = self.get_resource_name('hdisdk-premium') create_params = self.get_cluster_create_params(location, cluster_name, storage_account, storage_account_key) - create_params.properties.tier=Tier.premium + create_params.properties.tier = Tier.premium create_poller = self.hdinsight_client.clusters.create(resource_group.name, cluster_name, create_params) cluster = create_poller.result() self.validate_cluster(cluster_name, create_params, cluster) @ResourceGroupPreparer(name_prefix='hdipy-', location=LOCATION) @StorageAccountPreparer(name_prefix='hdipy', location=LOCATION) - def test_create_with_empty_extended_parameters(self, resource_group, location, storage_account, storage_account_key): + def test_create_with_empty_extended_parameters(self, resource_group, location, storage_account, + storage_account_key): cluster_name = self.get_resource_name('hdisdk-cluster') create_params = ClusterCreateParametersExtended() @@ -95,12 +95,14 @@ def test_create_with_empty_extended_parameters(self, resource_group, location, s @ResourceGroupPreparer(name_prefix='hdipy-', location=LOCATION) @StorageAccountPreparer(name_prefix='hdipy', location=LOCATION) - def test_create_humboldt_cluster_with_custom_vm_sizes(self, resource_group, location, storage_account, storage_account_key): + def test_create_humboldt_cluster_with_custom_vm_sizes(self, resource_group, location, storage_account, + storage_account_key): cluster_name = self.get_resource_name('hdisdk-customvmsizes') create_params = self.get_cluster_create_params(location, cluster_name, storage_account, storage_account_key) headnode = next(item for item in create_params.properties.compute_profile.roles if item.name == 'headnode') headnode.hardware_profile = HardwareProfile(vm_size="ExtraLarge") - zookeepernode = next(item for item in create_params.properties.compute_profile.roles if item.name == 'zookeepernode') + zookeepernode = next( + item for item in create_params.properties.compute_profile.roles if item.name == 'zookeepernode') zookeepernode.hardware_profile = HardwareProfile(vm_size="Medium") create_poller = self.hdinsight_client.clusters.create(resource_group.name, cluster_name, create_params) cluster = create_poller.result() @@ -108,18 +110,20 @@ def test_create_humboldt_cluster_with_custom_vm_sizes(self, resource_group, loca @ResourceGroupPreparer(name_prefix='hdipy-', location=LOCATION) @StorageAccountPreparer(name_prefix='hdipy', location=LOCATION) - def test_create_linux_spark_cluster_with_component_version(self, resource_group, location, storage_account, storage_account_key): + def test_create_linux_spark_cluster_with_component_version(self, resource_group, location, storage_account, + storage_account_key): cluster_name = self.get_resource_name('hdisdk-sparkcomponentversions') create_params = self.get_cluster_create_params(location, cluster_name, storage_account, storage_account_key) create_params.properties.cluster_definition.kind = 'Spark' - create_params.properties.cluster_definition.Component_version = {'Spark' : '2.2'} + create_params.properties.cluster_definition.Component_version = {'Spark': '2.2'} create_poller = self.hdinsight_client.clusters.create(resource_group.name, cluster_name, create_params) cluster = create_poller.result() self.validate_cluster(cluster_name, create_params, cluster) @ResourceGroupPreparer(name_prefix='hdipy-', location=LOCATION) @StorageAccountPreparer(name_prefix='hdipy', location=LOCATION) - def test_create_kafka_cluster_with_managed_disks(self, resource_group, location, storage_account, storage_account_key): + def test_create_kafka_cluster_with_managed_disks(self, resource_group, location, storage_account, + storage_account_key): cluster_name = self.get_resource_name('hdisdk-kafka') create_params = self.get_cluster_create_params(location, cluster_name, storage_account, storage_account_key) create_params.properties.cluster_definition.kind = 'Kafka' @@ -133,23 +137,26 @@ def test_create_kafka_cluster_with_managed_disks(self, resource_group, location, cluster = create_poller.result() self.validate_cluster(cluster_name, create_params, cluster) - @unittest.skip('skipping temporarily to unblock azure-keyvault checkin') + # @unittest.skip('skipping temporarily to unblock azure-keyvault checkin') @ResourceGroupPreparer(name_prefix='hdipy-', location=LOCATION) @StorageAccountPreparer(name_prefix='hdipy', location=LOCATION) @KeyVaultPreparer(name_prefix='hdipy', location=LOCATION, enable_soft_delete=True) - def test_create_kafka_cluster_with_disk_encryption(self, resource_group, location, storage_account, storage_account_key, vault): + def test_create_kafka_cluster_with_disk_encryption(self, resource_group, location, storage_account, + storage_account_key, vault): # create managed identities for Azure resources. msi_name = self.get_resource_name('hdipyuai') msi_principal_id = "00000000-0000-0000-0000-000000000000" - msi_id = "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/{}/providers/microsoft.managedidentity/userassignedidentities/{}".format(resource_group.name, msi_name) + msi_id = "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/{}/providers/microsoft.managedidentity/userassignedidentities/{}".format( + resource_group.name, msi_name) if self.is_live: msi = self.msi_client.user_assigned_identities.create_or_update(resource_group.name, msi_name, location) msi_id = msi.id msi_principal_id = msi.principal_id # add managed identity to vault - required_permissions = Permissions(keys=[KeyPermissions.get, KeyPermissions.wrap_key, KeyPermissions.unwrap_key], - secrets=[SecretPermissions.get, SecretPermissions.set,SecretPermissions.delete]) + required_permissions = Permissions( + keys=[KeyPermissions.get, KeyPermissions.wrap_key, KeyPermissions.unwrap_key], + secrets=[SecretPermissions.get, SecretPermissions.set, SecretPermissions.delete]) vault.properties.access_policies.append( AccessPolicyEntry(tenant_id=self.tenant_id, object_id=msi_principal_id, @@ -160,11 +167,17 @@ def test_create_kafka_cluster_with_disk_encryption(self, resource_group, locatio vault = self.vault_mgmt_client.vaults.create_or_update(resource_group.name, vault.name, update_params).result() self.assertIsNotNone(vault) + # create keyclient + key_client_credential = self.settings.get_azure_core_credentials(scope="https://vault.azure.net/.default") + self.vault_client = KeyClient(vault_url=vault.properties.vault_uri, credential=key_client_credential) + # create key - vault_uri = vault.properties.vault_uri key_name = self.get_resource_name('hdipykey1') - created_bundle = self.vault_client.create_key(vault_uri, key_name, 'RSA') - vault_key = KeyVaultId.parse_key_id(created_bundle.key.kid) + vault_key = self.vault_client.create_key(key_name, 'RSA') + + # create a new key for test rotate + new_key_name = self.get_resource_name('hdipykey2') + new_vault_key = self.vault_client.create_key(new_key_name, 'RSA') # create HDInsight cluster with Kafka disk encryption rg_name = resource_group.name @@ -182,9 +195,9 @@ def test_create_kafka_cluster_with_disk_encryption(self, resource_group, locatio user_assigned_identities={msi_id: ClusterIdentityUserAssignedIdentitiesValue()} ) create_params.properties.disk_encryption_properties = DiskEncryptionProperties( - vault_uri=vault_key.vault, + vault_uri=vault_key.properties.vault_url, key_name=vault_key.name, - key_version=vault_key.version, + key_version=vault_key.properties.version, msi_resource_id=msi_id ) cluster = self.hdinsight_client.clusters.create(resource_group.name, cluster_name, create_params).result() @@ -192,18 +205,17 @@ def test_create_kafka_cluster_with_disk_encryption(self, resource_group, locatio # check disk encryption properties self.assertIsNotNone(cluster.properties.disk_encryption_properties) - self.assertEqual(create_params.properties.disk_encryption_properties.vault_uri, cluster.properties.disk_encryption_properties.vault_uri) - self.assertEqual(create_params.properties.disk_encryption_properties.key_name, cluster.properties.disk_encryption_properties.key_name) - self.assertEqual(create_params.properties.disk_encryption_properties.msi_resource_id.lower(), cluster.properties.disk_encryption_properties.msi_resource_id.lower()) + self.assertEqual(create_params.properties.disk_encryption_properties.vault_uri, + cluster.properties.disk_encryption_properties.vault_uri) + self.assertEqual(create_params.properties.disk_encryption_properties.key_name, + cluster.properties.disk_encryption_properties.key_name) + self.assertEqual(create_params.properties.disk_encryption_properties.msi_resource_id.lower(), + cluster.properties.disk_encryption_properties.msi_resource_id.lower()) - # create a new key - new_key_name = self.get_resource_name('hdipykey2') - created_bundle = self.vault_client.create_key(vault_uri, new_key_name, 'RSA') - new_vault_key = KeyVaultId.parse_key_id(created_bundle.key.kid) rotate_params = ClusterDiskEncryptionParameters( - vault_uri=new_vault_key.vault, + vault_uri=new_vault_key.properties.vault_url, key_name=new_vault_key.name, - key_version=new_vault_key.version + key_version=new_vault_key.properties.version ) # rotate cluster key @@ -216,6 +228,7 @@ def test_create_kafka_cluster_with_disk_encryption(self, resource_group, locatio self.assertEqual(rotate_params.key_name, cluster.properties.disk_encryption_properties.key_name) self.assertEqual(msi_id.lower(), cluster.properties.disk_encryption_properties.msi_resource_id.lower()) + @unittest.skip("There is something wrong in ADLS Gen1 from RP.") @ResourceGroupPreparer(name_prefix='hdipy-', location=ADLS_LOCATION) @StorageAccountPreparer(name_prefix='hdipy', location=ADLS_LOCATION) def test_create_with_adls_gen1(self, resource_group, location, storage_account, storage_account_key): @@ -241,7 +254,8 @@ def test_create_with_adls_gen1(self, resource_group, location, storage_account, def test_create_with_adls_gen2(self, resource_group, location, storage_account, storage_account_key, second_storage_account, second_storage_account_key): cluster_name = self.get_resource_name('hdisdk-adlgen2') - create_params = self.get_cluster_create_params_for_adls_gen2(location, cluster_name, storage_account, storage_account_key) + create_params = self.get_cluster_create_params_for_adls_gen2(location, cluster_name, storage_account, + storage_account_key) # Add additional storage account create_params.properties.storage_profile.storageaccounts.append( @@ -256,6 +270,7 @@ def test_create_with_adls_gen2(self, resource_group, location, storage_account, cluster = self.hdinsight_client.clusters.create(resource_group.name, cluster_name, create_params).result() self.validate_cluster(cluster_name, create_params, cluster) + @unittest.skip("This test depends on ADLS Gen1. Now there is something wrong with ADLS Gen1.") @ResourceGroupPreparer(name_prefix='hdipy-', location=LOCATION) @StorageAccountPreparer(name_prefix='hdipy', location=LOCATION) @StorageAccountPreparer(name_prefix='hdipy2', location=LOCATION, parameter_name='second_storage_account') @@ -307,7 +322,7 @@ def test_create_rserver_cluster(self, resource_group, location, storage_account, def test_create_mlservices_cluster(self, resource_group, location, storage_account, storage_account_key): cluster_name = self.get_resource_name('hdisdk-mlservices') create_params = self.get_cluster_create_params(location, cluster_name, storage_account, storage_account_key) - create_params.properties.cluster_version="3.6" + create_params.properties.cluster_version = "3.6" create_params.properties.cluster_definition.kind = 'MLServices' create_params.properties.compute_profile.roles.append( Role( @@ -371,7 +386,7 @@ def test_list_clusters_in_subscription(self, resource_group, location, storage_a def test_hue_on_running_cluster(self, resource_group, location, storage_account, storage_account_key): cluster_name = self.get_resource_name('hdisdk-applications-hue') create_params = self.get_cluster_create_params(location, cluster_name, storage_account, storage_account_key) - create_params.properties.cluster_version="3.6" + create_params.properties.cluster_version = "3.6" create_poller = self.hdinsight_client.clusters.create(resource_group.name, cluster_name, create_params) cluster = create_poller.result() self.validate_cluster(cluster_name, create_params, cluster) @@ -395,20 +410,25 @@ def test_hue_on_running_cluster(self, resource_group, location, storage_account, hardware_profile=HardwareProfile( vm_size="Large" ), - target_instance_count = 1 + target_instance_count=1 ) ] ) ) ) - self.hdinsight_client.applications.create(resource_group.name, cluster_name, application_name, application).wait() + self.hdinsight_client.applications.create(resource_group.name, cluster_name, application_name, + application).wait() application_list = list(self.hdinsight_client.applications.list_by_cluster(resource_group.name, cluster_name)) self.assertGreater(len(application_list), 0) application_match = [item for item in application_list if item.name == application_name] self.assertIsNotNone(application_match) self.assertEqual(len(application_match), 1) + # sleep for robust + import time + time.sleep(120) + self.hdinsight_client.applications.delete(resource_group.name, cluster_name, application_name).wait() application_list = list(self.hdinsight_client.applications.list_by_cluster(resource_group.name, cluster_name)) self.assertEqual(len(application_list), 0) @@ -467,7 +487,7 @@ def test_get_configurations(self, resource_group, location, storage_account, sto @ResourceGroupPreparer(name_prefix='hdipy-', location=LOCATION) @StorageAccountPreparer(name_prefix='hdipy', location=LOCATION) - def test_http_extended(self, resource_group, location, storage_account, storage_account_key): + def test_gateway_settings(self, resource_group, location, storage_account, storage_account_key): rg_name = resource_group.name cluster_name = self.get_resource_name('hdisdk-http') create_params = self.get_cluster_create_params(location, cluster_name, storage_account, storage_account_key) @@ -475,21 +495,17 @@ def test_http_extended(self, resource_group, location, storage_account, storage_ cluster = create_poller.result() self.validate_cluster(cluster_name, create_params, cluster) - gateway = 'gateway' user_name = self.cluster_username user_password = self.cluster_password - http_settings = self.hdinsight_client.configurations.get(rg_name, cluster_name, gateway) - self.validate_http_settings(http_settings, user_name, user_password) + gateway_settings = self.hdinsight_client.clusters.get_gateway_settings(rg_name, cluster_name) + self.validate_gateway_settings(gateway_settings, user_name, user_password) new_password = 'NewPassword1!' - update_params = { - 'restAuthCredential.isEnabled': 'true', - 'restAuthCredential.username': user_name, - 'restAuthCredential.password': new_password - } - self.hdinsight_client.configurations.update(rg_name, cluster_name, gateway, update_params).wait() - http_settings = self.hdinsight_client.configurations.get(rg_name, cluster_name, gateway) - self.validate_http_settings(http_settings, user_name, new_password) + update_params = UpdateGatewaySettingsParameters(is_credential_enabled=True, user_name=user_name, + password=new_password) + self.hdinsight_client.clusters.update_gateway_settings(rg_name, cluster_name, update_params).wait() + gateway_settings = self.hdinsight_client.clusters.get_gateway_settings(rg_name, cluster_name) + self.validate_gateway_settings(gateway_settings, user_name, new_password) def test_get_usages(self): usages = self.hdinsight_client.locations.list_usages(LOCATION) @@ -502,6 +518,7 @@ def test_get_usages(self): self.assertIsNotNone(usage.name) self.assertIsNotNone(usage.unit) + @unittest.skip("Script executed failed due to Internal server. The issue is related with RP not SDK.") @ResourceGroupPreparer(name_prefix='hdipy-', location=LOCATION) @StorageAccountPreparer(name_prefix='hdipy', location=LOCATION) def test_oms_on_running_cluster(self, resource_group, location, storage_account, storage_account_key): @@ -509,12 +526,23 @@ def test_oms_on_running_cluster(self, resource_group, location, storage_account, cluster_name = self.get_resource_name('hdisdk-oms') create_params = self.get_cluster_create_params(location, cluster_name, storage_account, storage_account_key) create_params.properties.cluster_definition.kind = 'Spark' - create_params.properties.cluster_version="3.6" + create_params.properties.cluster_version = "3.6" create_poller = self.hdinsight_client.clusters.create(resource_group.name, cluster_name, create_params) cluster = create_poller.result() self.validate_cluster(cluster_name, create_params, cluster) - self.hdinsight_client.extensions.enable_monitoring(rg_name, cluster_name, self.workspace_id).wait() + # create log analytics workspace + self.loganalytics_mgmt_client = self.create_mgmt_client(LogAnalyticsManagementClient) + workspace_name = self.get_resource_name('workspaceforpytest') + workspace_params = Workspace(name=workspace_name, location=location) + workspace_poller = self.loganalytics_mgmt_client.workspaces.create_or_update(rg_name, workspace_name, + workspace_params) + workspace = workspace_poller.result() + self.workspace_id = workspace.customer_id + self.primary_key = self.loganalytics_mgmt_client.shared_keys.get_shared_keys(rg_name, workspace_name) + + self.hdinsight_client.extensions.enable_monitoring(rg_name, cluster_name, self.workspace_id, + self.primary_key).wait() monitoring_status = self.hdinsight_client.extensions.get_monitoring_status(rg_name, cluster_name) self.assertTrue(monitoring_status.cluster_monitoring_enabled) self.assertEqual(monitoring_status.workspace_id, self.workspace_id) @@ -530,7 +558,8 @@ def test_resize_cluster(self, resource_group, location, storage_account, storage rg_name = resource_group.name cluster_name = self.get_resource_name('hdisdk-clusterresize') create_params = self.get_cluster_create_params(location, cluster_name, storage_account, storage_account_key) - workernode_params = next(item for item in create_params.properties.compute_profile.roles if item.name == 'workernode') + workernode_params = next( + item for item in create_params.properties.compute_profile.roles if item.name == 'workernode') create_poller = self.hdinsight_client.clusters.create(resource_group.name, cluster_name, create_params) cluster = create_poller.result() self.validate_cluster(cluster_name, create_params, cluster) @@ -577,7 +606,8 @@ def test_script_actions_on_running_cluster(self, resource_group, location, stora self.assertEqual(0, len(script_action_list)) # List script action history and validate script appears there. - list_history_response = list(self.hdinsight_client.script_execution_history.list_by_cluster(rg_name, cluster_name)) + list_history_response = list( + self.hdinsight_client.script_execution_history.list_by_cluster(rg_name, cluster_name)) self.assertEqual(1, len(list_history_response)) script_action = list_history_response[0] self.assertEqual(1, len(script_action.execution_summary)) @@ -587,7 +617,8 @@ def test_script_actions_on_running_cluster(self, resource_group, location, stora self.assertEqual("Succeeded", script_action.status) # Get the script action by ID and validate it's the same action. - script_action = self.hdinsight_client.script_actions.get_execution_detail(rg_name, cluster_name, str(list_history_response[0].script_execution_id)) + script_action = self.hdinsight_client.script_actions.get_execution_detail(rg_name, cluster_name, str( + list_history_response[0].script_execution_id)) self.assertEqual(script_action_params[0].name, script_action.name) # Execute script actions, but don't persist on success. @@ -595,7 +626,8 @@ def test_script_actions_on_running_cluster(self, resource_group, location, stora self.hdinsight_client.clusters.execute_script_actions(rg_name, cluster_name, False, script_action_params).wait() # List script action history and validate the new script also appears. - list_history_response = list(self.hdinsight_client.script_execution_history.list_by_cluster(rg_name, cluster_name)) + list_history_response = list( + self.hdinsight_client.script_execution_history.list_by_cluster(rg_name, cluster_name)) self.assertEqual(2, len(list_history_response)) script_action = next(a for a in list_history_response if a.name == script_action_params[0].name) self.assertIsNotNone(script_action) @@ -606,7 +638,8 @@ def test_script_actions_on_running_cluster(self, resource_group, location, stora self.assertEqual("Succeeded", script_action.status) # Promote non-persisted script. - self.hdinsight_client.script_execution_history.promote(rg_name, cluster_name, str(list_history_response[0].script_execution_id)) + self.hdinsight_client.script_execution_history.promote(rg_name, cluster_name, + str(list_history_response[0].script_execution_id)) # List script action list and validate the promoted script is the only one there. script_action_list = list(self.hdinsight_client.script_actions.list_by_cluster(rg_name, cluster_name)) @@ -617,16 +650,17 @@ def test_script_actions_on_running_cluster(self, resource_group, location, stora self.assertEqual(script_action_params[0].roles, script_action.roles) # List script action history and validate all three scripts are there. - list_history_response = list(self.hdinsight_client.script_execution_history.list_by_cluster(rg_name, cluster_name)) + list_history_response = list( + self.hdinsight_client.script_execution_history.list_by_cluster(rg_name, cluster_name)) self.assertEqual(2, len(list_history_response)) self.assertTrue(all(a.status == "Succeeded" for a in list_history_response)) def get_execute_script_action_params(self, script_name, script_uri): return [ RuntimeScriptAction( - name = script_name, - uri = script_uri, - roles = ['headnode', 'workernode'] + name=script_name, + uri=script_uri, + roles=['headnode', 'workernode'] ) ] @@ -656,7 +690,8 @@ def get_cluster_create_params_for_adls_gen1(self, location, cluster_name, create return create_params - def get_cluster_create_params_for_adls_gen2(self, location, cluster_name, storage_account, storage_account_key, create_params=None): + def get_cluster_create_params_for_adls_gen2(self, location, cluster_name, storage_account, storage_account_key, + create_params=None): if create_params is None: create_params = self.get_cluster_create_params(location, cluster_name) is_default = len(create_params.properties.storage_profile.storageaccounts) == 0 @@ -665,7 +700,7 @@ def get_cluster_create_params_for_adls_gen2(self, location, cluster_name, storag name=storage_account.name + STORAGE_ADLS_FILE_SYSTEM_ENDPOINT_SUFFIX, key=storage_account_key, file_system=cluster_name.lower(), - is_default= is_default + is_default=is_default ) ) @@ -760,15 +795,16 @@ def validate_cluster(self, cluster_name, create_parameters, cluster_response): self.assertEqual(create_parameters.properties.os_type, cluster_response.properties.os_type) self.assertIsNone(cluster_response.properties.errors) self.assertEqual(HDInsightClusterProvisioningState.succeeded, cluster_response.properties.provisioning_state) - self.assertEqual(create_parameters.properties.cluster_definition.kind, cluster_response.properties.cluster_definition.kind) + self.assertEqual(create_parameters.properties.cluster_definition.kind, + cluster_response.properties.cluster_definition.kind) self.assertEqual(create_parameters.properties.cluster_version, cluster_response.properties.cluster_version[0:3]) self.assertIsNone(cluster_response.properties.cluster_definition.configurations) - def validate_http_settings(self, http_settings, expected_user_name, expected_user_password): - self.assertIsNotNone(http_settings) - self.assertEqual('true', http_settings['restAuthCredential.isEnabled']) - self.assertEqual(expected_user_name, http_settings['restAuthCredential.username']) - self.assertEqual(expected_user_password, http_settings['restAuthCredential.password']) + def validate_gateway_settings(self, gateway_settings, expected_user_name, expected_user_password): + self.assertIsNotNone(gateway_settings) + self.assertEqual('true', gateway_settings.is_credential_enabled) + self.assertEqual(expected_user_name, gateway_settings.user_name) + self.assertEqual(expected_user_password, gateway_settings.password) def _setup_scrubber(self): super(MgmtHDInsightTest, self)._setup_scrubber() @@ -778,6 +814,7 @@ def _setup_scrubber(self): self.scrubber.register_name_pair(getattr(self.settings, key), getattr(self._fake_settings, key)) -#------------------------------------------------------------------------------ + +# ------------------------------------------------------------------------------ if __name__ == '__main__': unittest.main() diff --git a/sdk/identity/azure-identity/CHANGELOG.md b/sdk/identity/azure-identity/CHANGELOG.md index ea5b7fca0727..781fe4b105c3 100644 --- a/sdk/identity/azure-identity/CHANGELOG.md +++ b/sdk/identity/azure-identity/CHANGELOG.md @@ -1,6 +1,9 @@ # Release History ## 1.4.0b4 (Unreleased) +- `AzureCliCredential` and `VSCodeCredential`, which enable authenticating as + the identity signed in to the Azure CLI and Visual Studio Code, respectively, + can be imported from `azure.identity` and `azure.identity.aio`. - `azure.identity.aio.AuthorizationCodeCredential.get_token()` no longer accepts optional keyword arguments `executor` or `loop`. Prior versions of the method didn't use these correctly, provoking exceptions, and internal changes in this diff --git a/sdk/identity/azure-identity/azure/identity/__init__.py b/sdk/identity/azure-identity/azure/identity/__init__.py index 3fbc78c57bfa..5f408028a4c0 100644 --- a/sdk/identity/azure-identity/azure/identity/__init__.py +++ b/sdk/identity/azure-identity/azure/identity/__init__.py @@ -8,6 +8,7 @@ from ._exceptions import AuthenticationRequiredError, CredentialUnavailableError from ._constants import KnownAuthorities from ._credentials import ( + AzureCliCredential, AuthorizationCodeCredential, CertificateCredential, ChainedTokenCredential, @@ -19,11 +20,13 @@ ManagedIdentityCredential, SharedTokenCacheCredential, UsernamePasswordCredential, + VSCodeCredential, ) __all__ = [ "AuthenticationRecord", + "AzureCliCredential", "AuthenticationRequiredError", "AuthorizationCodeCredential", "CertificateCredential", @@ -38,6 +41,7 @@ "ManagedIdentityCredential", "SharedTokenCacheCredential", "UsernamePasswordCredential", + "VSCodeCredential", ] from ._version import VERSION diff --git a/sdk/identity/azure-identity/azure/identity/_credentials/__init__.py b/sdk/identity/azure-identity/azure/identity/_credentials/__init__.py index cd0068cc3cd8..baf64e6d5102 100644 --- a/sdk/identity/azure-identity/azure/identity/_credentials/__init__.py +++ b/sdk/identity/azure-identity/azure/identity/_credentials/__init__.py @@ -14,10 +14,12 @@ from .azure_cli import AzureCliCredential from .device_code import DeviceCodeCredential from .user_password import UsernamePasswordCredential +from .vscode_credential import VSCodeCredential __all__ = [ "AuthorizationCodeCredential", + "AzureCliCredential", "CertificateCredential", "ChainedTokenCredential", "ClientSecretCredential", @@ -29,4 +31,5 @@ "SharedTokenCacheCredential", "AzureCliCredential", "UsernamePasswordCredential", + "VSCodeCredential", ] diff --git a/sdk/identity/azure-identity/azure/identity/aio/__init__.py b/sdk/identity/azure-identity/azure/identity/aio/__init__.py index 775ee06abd85..3c2288e308a8 100644 --- a/sdk/identity/azure-identity/azure/identity/aio/__init__.py +++ b/sdk/identity/azure-identity/azure/identity/aio/__init__.py @@ -6,6 +6,7 @@ from ._credentials import ( AuthorizationCodeCredential, + AzureCliCredential, CertificateCredential, ChainedTokenCredential, ClientSecretCredential, @@ -13,11 +14,13 @@ EnvironmentCredential, ManagedIdentityCredential, SharedTokenCacheCredential, + VSCodeCredential, ) __all__ = [ "AuthorizationCodeCredential", + "AzureCliCredential", "CertificateCredential", "ClientSecretCredential", "DefaultAzureCredential", @@ -25,4 +28,5 @@ "ManagedIdentityCredential", "ChainedTokenCredential", "SharedTokenCacheCredential", + "VSCodeCredential", ] diff --git a/sdk/identity/azure-identity/azure/identity/aio/_credentials/__init__.py b/sdk/identity/azure-identity/azure/identity/aio/_credentials/__init__.py index cf63acbd84d6..d9146708694d 100644 --- a/sdk/identity/azure-identity/azure/identity/aio/_credentials/__init__.py +++ b/sdk/identity/azure-identity/azure/identity/aio/_credentials/__init__.py @@ -11,6 +11,7 @@ from .client_secret import ClientSecretCredential from .shared_cache import SharedTokenCacheCredential from .azure_cli import AzureCliCredential +from .vscode_credential import VSCodeCredential __all__ = [ @@ -23,4 +24,5 @@ "EnvironmentCredential", "ManagedIdentityCredential", "SharedTokenCacheCredential", + "VSCodeCredential", ] diff --git a/sdk/identity/azure-identity/tests/test_cli_credential.py b/sdk/identity/azure-identity/tests/test_cli_credential.py index bc588436668f..7377d330455e 100644 --- a/sdk/identity/azure-identity/tests/test_cli_credential.py +++ b/sdk/identity/azure-identity/tests/test_cli_credential.py @@ -5,8 +5,8 @@ from datetime import datetime import json -from azure.identity import CredentialUnavailableError -from azure.identity._credentials.azure_cli import AzureCliCredential, CLI_NOT_FOUND +from azure.identity import AzureCliCredential, CredentialUnavailableError +from azure.identity._credentials.azure_cli import CLI_NOT_FOUND from azure.core.exceptions import ClientAuthenticationError import subprocess diff --git a/sdk/identity/azure-identity/tests/test_cli_credential_async.py b/sdk/identity/azure-identity/tests/test_cli_credential_async.py index 1ad4dba493d9..9e8ad1f82217 100644 --- a/sdk/identity/azure-identity/tests/test_cli_credential_async.py +++ b/sdk/identity/azure-identity/tests/test_cli_credential_async.py @@ -8,7 +8,7 @@ from unittest import mock from azure.identity import CredentialUnavailableError -from azure.identity.aio._credentials.azure_cli import AzureCliCredential +from azure.identity.aio import AzureCliCredential from azure.identity._credentials.azure_cli import CLI_NOT_FOUND from azure.core.exceptions import ClientAuthenticationError import pytest diff --git a/sdk/identity/azure-identity/tests/test_vscode_credential.py b/sdk/identity/azure-identity/tests/test_vscode_credential.py index d4e0afe2b338..779578053d04 100644 --- a/sdk/identity/azure-identity/tests/test_vscode_credential.py +++ b/sdk/identity/azure-identity/tests/test_vscode_credential.py @@ -3,18 +3,20 @@ # Licensed under the MIT License. # ------------------------------------ import sys -import pytest + from azure.core.credentials import AccessToken -from azure.identity import CredentialUnavailableError +from azure.identity import CredentialUnavailableError, VSCodeCredential from azure.core.pipeline.policies import SansIOHTTPPolicy from azure.identity._internal.user_agent import USER_AGENT +from azure.identity._credentials.vscode_credential import get_credentials +import pytest + from helpers import build_aad_response, mock_response, Request, validating_transport try: from unittest import mock except ImportError: # python < 3.3 import mock -from azure.identity._credentials.vscode_credential import VSCodeCredential, get_credentials def test_no_scopes(): diff --git a/sdk/identity/azure-identity/tests/test_vscode_credential_async.py b/sdk/identity/azure-identity/tests/test_vscode_credential_async.py index 89f27a78d4f5..edd59dcc0b3d 100644 --- a/sdk/identity/azure-identity/tests/test_vscode_credential_async.py +++ b/sdk/identity/azure-identity/tests/test_vscode_credential_async.py @@ -2,15 +2,17 @@ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # ------------------------------------ -import pytest +from unittest import mock + from azure.core.credentials import AccessToken -from azure.identity._internal.user_agent import USER_AGENT from azure.identity import CredentialUnavailableError +from azure.identity.aio import VSCodeCredential +from azure.identity._internal.user_agent import USER_AGENT from azure.core.pipeline.policies import SansIOHTTPPolicy +import pytest + from helpers import build_aad_response, mock_response, Request from helpers_async import async_validating_transport, AsyncMockTransport, wrap_in_future -from unittest import mock -from azure.identity.aio._credentials.vscode_credential import VSCodeCredential @pytest.mark.asyncio diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/README.md b/sdk/machinelearning/azure-mgmt-machinelearningservices/README.md index 2105451adb19..ccd1260717e2 100644 --- a/sdk/machinelearning/azure-mgmt-machinelearningservices/README.md +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/README.md @@ -1,30 +1,21 @@ -## Microsoft Azure SDK for Python +# Microsoft Azure SDK for Python -This is the Microsoft Azure Machine Learning Services Management Client -Library. +This is the Microsoft Azure Machine Learning Services Management Client Library. +This package has been tested with Python 2.7, 3.5, 3.6, 3.7 and 3.8. +For a more complete view of Azure libraries, see the [Github repo](https://github.com/Azure/azure-sdk-for-python/) -Azure Resource Manager (ARM) is the next generation of management APIs -that replace the old Azure Service Management (ASM). -This package has been tested with Python 2.7, 3.5, 3.6 and 3.7. +# Usage -For the older Azure Service Management (ASM) libraries, see -[azure-servicemanagement-legacy](https://pypi.python.org/pypi/azure-servicemanagement-legacy) -library. +For code examples, see [Machine Learning Services Management](https://docs.microsoft.com/python/api/overview/azure/) +on docs.microsoft.com. -For a more complete set of Azure libraries, see the -[azure](https://pypi.python.org/pypi/azure) bundle package. -## Usage +# Provide Feedback -For code examples, see [Machine Learning Services -Management](https://docs.microsoft.com/python/api/overview/azure/) on -docs.microsoft.com. - -## Provide Feedback - -If you encounter any bugs or have suggestions, please file an issue in -the [Issues](https://github.com/Azure/azure-sdk-for-python/issues) +If you encounter any bugs or have suggestions, please file an issue in the +[Issues](https://github.com/Azure/azure-sdk-for-python/issues) section of the project. -![image](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-machinelearningservices%2FREADME.png) + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-machinelearningservices%2FREADME.png) diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/_azure_machine_learning_workspaces.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/_azure_machine_learning_workspaces.py index e0a0e2c4d834..79cd112470dd 100644 --- a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/_azure_machine_learning_workspaces.py +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/_azure_machine_learning_workspaces.py @@ -13,15 +13,20 @@ from msrest import Serializer, Deserializer from ._configuration import AzureMachineLearningWorkspacesConfiguration +from .operations import AzureMachineLearningWorkspacesOperationsMixin from .operations import Operations from .operations import WorkspacesOperations +from .operations import WorkspaceFeaturesOperations from .operations import UsagesOperations from .operations import VirtualMachineSizesOperations +from .operations import QuotasOperations from .operations import MachineLearningComputeOperations +from .operations import PrivateEndpointConnectionsOperations +from .operations import PrivateLinkResourcesOperations from . import models -class AzureMachineLearningWorkspaces(SDKClient): +class AzureMachineLearningWorkspaces(AzureMachineLearningWorkspacesOperationsMixin, SDKClient): """These APIs allow end users to operate on Azure Machine Learning Workspace resources. :ivar config: Configuration for client. @@ -31,12 +36,20 @@ class AzureMachineLearningWorkspaces(SDKClient): :vartype operations: azure.mgmt.machinelearningservices.operations.Operations :ivar workspaces: Workspaces operations :vartype workspaces: azure.mgmt.machinelearningservices.operations.WorkspacesOperations + :ivar workspace_features: WorkspaceFeatures operations + :vartype workspace_features: azure.mgmt.machinelearningservices.operations.WorkspaceFeaturesOperations :ivar usages: Usages operations :vartype usages: azure.mgmt.machinelearningservices.operations.UsagesOperations :ivar virtual_machine_sizes: VirtualMachineSizes operations :vartype virtual_machine_sizes: azure.mgmt.machinelearningservices.operations.VirtualMachineSizesOperations + :ivar quotas: Quotas operations + :vartype quotas: azure.mgmt.machinelearningservices.operations.QuotasOperations :ivar machine_learning_compute: MachineLearningCompute operations :vartype machine_learning_compute: azure.mgmt.machinelearningservices.operations.MachineLearningComputeOperations + :ivar private_endpoint_connections: PrivateEndpointConnections operations + :vartype private_endpoint_connections: azure.mgmt.machinelearningservices.operations.PrivateEndpointConnectionsOperations + :ivar private_link_resources: PrivateLinkResources operations + :vartype private_link_resources: azure.mgmt.machinelearningservices.operations.PrivateLinkResourcesOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -53,7 +66,7 @@ def __init__( super(AzureMachineLearningWorkspaces, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '2019-05-01' + self.api_version = '2020-05-15-preview' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) @@ -61,9 +74,17 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.workspaces = WorkspacesOperations( self._client, self.config, self._serialize, self._deserialize) + self.workspace_features = WorkspaceFeaturesOperations( + self._client, self.config, self._serialize, self._deserialize) self.usages = UsagesOperations( self._client, self.config, self._serialize, self._deserialize) self.virtual_machine_sizes = VirtualMachineSizesOperations( self._client, self.config, self._serialize, self._deserialize) + self.quotas = QuotasOperations( + self._client, self.config, self._serialize, self._deserialize) self.machine_learning_compute = MachineLearningComputeOperations( self._client, self.config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.private_link_resources = PrivateLinkResourcesOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/models/__init__.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/models/__init__.py index 2a709812fa94..02c767273746 100644 --- a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/models/__init__.py +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/models/__init__.py @@ -18,6 +18,7 @@ from ._models_py3 import AmlComputeNodeInformation from ._models_py3 import AmlComputeNodesInformation from ._models_py3 import AmlComputeProperties + from ._models_py3 import AmlUserFeature from ._models_py3 import ClusterUpdateParameters from ._models_py3 import Compute from ._models_py3 import ComputeNodesInformation @@ -29,34 +30,56 @@ from ._models_py3 import DataFactory from ._models_py3 import DataLakeAnalytics from ._models_py3 import DataLakeAnalyticsProperties + from ._models_py3 import EncryptionProperty from ._models_py3 import ErrorDetail - from ._models_py3 import ErrorResponse + from ._models_py3 import ErrorResponse, ErrorResponseException from ._models_py3 import HDInsight from ._models_py3 import HDInsightProperties from ._models_py3 import Identity + from ._models_py3 import IdentityUserAssignedIdentitiesValue + from ._models_py3 import KeyVaultProperties from ._models_py3 import ListWorkspaceKeysResult from ._models_py3 import MachineLearningServiceError, MachineLearningServiceErrorException from ._models_py3 import NodeStateCounts from ._models_py3 import Operation from ._models_py3 import OperationDisplay from ._models_py3 import Password + from ._models_py3 import PrivateEndpoint + from ._models_py3 import PrivateEndpointConnection + from ._models_py3 import PrivateLinkResource + from ._models_py3 import PrivateLinkResourceListResult + from ._models_py3 import PrivateLinkServiceConnectionState + from ._models_py3 import QuotaBaseProperties + from ._models_py3 import QuotaUpdateParameters from ._models_py3 import RegistryListCredentialsResult from ._models_py3 import Resource from ._models_py3 import ResourceId + from ._models_py3 import ResourceName + from ._models_py3 import ResourceQuota + from ._models_py3 import ResourceSkuLocationInfo + from ._models_py3 import ResourceSkuZoneDetails + from ._models_py3 import Restriction from ._models_py3 import ScaleSettings from ._models_py3 import ServicePrincipalCredentials + from ._models_py3 import SharedPrivateLinkResource + from ._models_py3 import Sku + from ._models_py3 import SKUCapability from ._models_py3 import SslConfiguration from ._models_py3 import SystemService + from ._models_py3 import UpdateWorkspaceQuotas + from ._models_py3 import UpdateWorkspaceQuotasResult from ._models_py3 import Usage from ._models_py3 import UsageName from ._models_py3 import UserAccountCredentials from ._models_py3 import VirtualMachine + from ._models_py3 import VirtualMachineImage from ._models_py3 import VirtualMachineProperties from ._models_py3 import VirtualMachineSecrets from ._models_py3 import VirtualMachineSize from ._models_py3 import VirtualMachineSizeListResult from ._models_py3 import VirtualMachineSshCredentials from ._models_py3 import Workspace + from ._models_py3 import WorkspaceSku from ._models_py3 import WorkspaceUpdateParameters except (SyntaxError, ImportError): from ._models import AKS @@ -67,6 +90,7 @@ from ._models import AmlComputeNodeInformation from ._models import AmlComputeNodesInformation from ._models import AmlComputeProperties + from ._models import AmlUserFeature from ._models import ClusterUpdateParameters from ._models import Compute from ._models import ComputeNodesInformation @@ -78,46 +102,80 @@ from ._models import DataFactory from ._models import DataLakeAnalytics from ._models import DataLakeAnalyticsProperties + from ._models import EncryptionProperty from ._models import ErrorDetail - from ._models import ErrorResponse + from ._models import ErrorResponse, ErrorResponseException from ._models import HDInsight from ._models import HDInsightProperties from ._models import Identity + from ._models import IdentityUserAssignedIdentitiesValue + from ._models import KeyVaultProperties from ._models import ListWorkspaceKeysResult from ._models import MachineLearningServiceError, MachineLearningServiceErrorException from ._models import NodeStateCounts from ._models import Operation from ._models import OperationDisplay from ._models import Password + from ._models import PrivateEndpoint + from ._models import PrivateEndpointConnection + from ._models import PrivateLinkResource + from ._models import PrivateLinkResourceListResult + from ._models import PrivateLinkServiceConnectionState + from ._models import QuotaBaseProperties + from ._models import QuotaUpdateParameters from ._models import RegistryListCredentialsResult from ._models import Resource from ._models import ResourceId + from ._models import ResourceName + from ._models import ResourceQuota + from ._models import ResourceSkuLocationInfo + from ._models import ResourceSkuZoneDetails + from ._models import Restriction from ._models import ScaleSettings from ._models import ServicePrincipalCredentials + from ._models import SharedPrivateLinkResource + from ._models import Sku + from ._models import SKUCapability from ._models import SslConfiguration from ._models import SystemService + from ._models import UpdateWorkspaceQuotas + from ._models import UpdateWorkspaceQuotasResult from ._models import Usage from ._models import UsageName from ._models import UserAccountCredentials from ._models import VirtualMachine + from ._models import VirtualMachineImage from ._models import VirtualMachineProperties from ._models import VirtualMachineSecrets from ._models import VirtualMachineSize from ._models import VirtualMachineSizeListResult from ._models import VirtualMachineSshCredentials from ._models import Workspace + from ._models import WorkspaceSku from ._models import WorkspaceUpdateParameters +from ._paged_models import AmlUserFeaturePaged from ._paged_models import ComputeResourcePaged from ._paged_models import OperationPaged +from ._paged_models import ResourceQuotaPaged from ._paged_models import UsagePaged from ._paged_models import WorkspacePaged +from ._paged_models import WorkspaceSkuPaged from ._azure_machine_learning_workspaces_enums import ( ProvisioningState, + EncryptionStatus, + PrivateEndpointServiceConnectionStatus, + PrivateEndpointConnectionProvisioningState, UsageUnit, + QuotaUnit, + Status, ResourceIdentityType, + OsType, VmPriority, + RemoteLoginPortPublicAccess, AllocationState, + NodeState, ComputeType, + ReasonCode, UnderlyingResourceAction, ) @@ -130,6 +188,7 @@ 'AmlComputeNodeInformation', 'AmlComputeNodesInformation', 'AmlComputeProperties', + 'AmlUserFeature', 'ClusterUpdateParameters', 'Compute', 'ComputeNodesInformation', @@ -141,44 +200,78 @@ 'DataFactory', 'DataLakeAnalytics', 'DataLakeAnalyticsProperties', + 'EncryptionProperty', 'ErrorDetail', - 'ErrorResponse', + 'ErrorResponse', 'ErrorResponseException', 'HDInsight', 'HDInsightProperties', 'Identity', + 'IdentityUserAssignedIdentitiesValue', + 'KeyVaultProperties', 'ListWorkspaceKeysResult', 'MachineLearningServiceError', 'MachineLearningServiceErrorException', 'NodeStateCounts', 'Operation', 'OperationDisplay', 'Password', + 'PrivateEndpoint', + 'PrivateEndpointConnection', + 'PrivateLinkResource', + 'PrivateLinkResourceListResult', + 'PrivateLinkServiceConnectionState', + 'QuotaBaseProperties', + 'QuotaUpdateParameters', 'RegistryListCredentialsResult', 'Resource', 'ResourceId', + 'ResourceName', + 'ResourceQuota', + 'ResourceSkuLocationInfo', + 'ResourceSkuZoneDetails', + 'Restriction', 'ScaleSettings', 'ServicePrincipalCredentials', + 'SharedPrivateLinkResource', + 'Sku', + 'SKUCapability', 'SslConfiguration', 'SystemService', + 'UpdateWorkspaceQuotas', + 'UpdateWorkspaceQuotasResult', 'Usage', 'UsageName', 'UserAccountCredentials', 'VirtualMachine', + 'VirtualMachineImage', 'VirtualMachineProperties', 'VirtualMachineSecrets', 'VirtualMachineSize', 'VirtualMachineSizeListResult', 'VirtualMachineSshCredentials', 'Workspace', + 'WorkspaceSku', 'WorkspaceUpdateParameters', 'OperationPaged', 'WorkspacePaged', + 'AmlUserFeaturePaged', 'UsagePaged', + 'ResourceQuotaPaged', 'ComputeResourcePaged', + 'WorkspaceSkuPaged', 'ProvisioningState', + 'EncryptionStatus', + 'PrivateEndpointServiceConnectionStatus', + 'PrivateEndpointConnectionProvisioningState', 'UsageUnit', + 'QuotaUnit', + 'Status', 'ResourceIdentityType', + 'OsType', 'VmPriority', + 'RemoteLoginPortPublicAccess', 'AllocationState', + 'NodeState', 'ComputeType', + 'ReasonCode', 'UnderlyingResourceAction', ] diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/models/_azure_machine_learning_workspaces_enums.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/models/_azure_machine_learning_workspaces_enums.py index 0e95e8e3d7ff..17413c9ad3af 100644 --- a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/models/_azure_machine_learning_workspaces_enums.py +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/models/_azure_machine_learning_workspaces_enums.py @@ -23,14 +23,63 @@ class ProvisioningState(str, Enum): canceled = "Canceled" +class EncryptionStatus(str, Enum): + + enabled = "Enabled" + disabled = "Disabled" + + +class PrivateEndpointServiceConnectionStatus(str, Enum): + + pending = "Pending" + approved = "Approved" + rejected = "Rejected" + disconnected = "Disconnected" + timeout = "Timeout" + + +class PrivateEndpointConnectionProvisioningState(str, Enum): + + succeeded = "Succeeded" + creating = "Creating" + deleting = "Deleting" + failed = "Failed" + + class UsageUnit(str, Enum): count = "Count" +class QuotaUnit(str, Enum): + + count = "Count" + + +class Status(str, Enum): + + undefined = "Undefined" + success = "Success" + failure = "Failure" + invalid_quota_below_cluster_minimum = "InvalidQuotaBelowClusterMinimum" + invalid_quota_exceeds_subscription_limit = "InvalidQuotaExceedsSubscriptionLimit" + invalid_vm_family_name = "InvalidVMFamilyName" + operation_not_supported_for_sku = "OperationNotSupportedForSku" + operation_not_enabled_for_region = "OperationNotEnabledForRegion" + + class ResourceIdentityType(str, Enum): system_assigned = "SystemAssigned" + user_assigned = "UserAssigned" + system_assigned_user_assigned = "SystemAssigned, UserAssigned" + none = "None" + + +class OsType(str, Enum): + + linux = "Linux" + windows = "Windows" class VmPriority(str, Enum): @@ -39,12 +88,29 @@ class VmPriority(str, Enum): low_priority = "LowPriority" +class RemoteLoginPortPublicAccess(str, Enum): + + enabled = "Enabled" + disabled = "Disabled" + not_specified = "NotSpecified" + + class AllocationState(str, Enum): steady = "Steady" resizing = "Resizing" +class NodeState(str, Enum): + + idle = "idle" + running = "running" + preparing = "preparing" + unusable = "unusable" + leaving = "leaving" + preempted = "preempted" + + class ComputeType(str, Enum): aks = "AKS" @@ -56,6 +122,13 @@ class ComputeType(str, Enum): data_lake_analytics = "DataLakeAnalytics" +class ReasonCode(str, Enum): + + not_specified = "NotSpecified" + not_available_for_region = "NotAvailableForRegion" + not_available_for_subscription = "NotAvailableForSubscription" + + class UnderlyingResourceAction(str, Enum): delete = "Delete" diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/models/_models.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/models/_models.py index 8ded2b35dd56..0598b345bd4d 100644 --- a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/models/_models.py +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/models/_models.py @@ -383,29 +383,50 @@ class AmlComputeNodeInformation(Model): :ivar node_id: Node ID. ID of the compute node. :vartype node_id: str - :ivar ip_address: IP address. Public IP address of the compute node. - :vartype ip_address: str + :ivar private_ip_address: Private IP address. Private IP address of the + compute node. + :vartype private_ip_address: str + :ivar public_ip_address: Public IP address. Public IP address of the + compute node. + :vartype public_ip_address: str :ivar port: Port. SSH port number of the node. :vartype port: float + :ivar node_state: State of the compute node. Values are idle, running, + preparing, unusable, leaving and preempted. Possible values include: + 'idle', 'running', 'preparing', 'unusable', 'leaving', 'preempted' + :vartype node_state: str or + ~azure.mgmt.machinelearningservices.models.NodeState + :ivar run_id: Run ID. ID of the Experiment running on the node, if any + else null. + :vartype run_id: str """ _validation = { 'node_id': {'readonly': True}, - 'ip_address': {'readonly': True}, + 'private_ip_address': {'readonly': True}, + 'public_ip_address': {'readonly': True}, 'port': {'readonly': True}, + 'node_state': {'readonly': True}, + 'run_id': {'readonly': True}, } _attribute_map = { 'node_id': {'key': 'nodeId', 'type': 'str'}, - 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, + 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, 'port': {'key': 'port', 'type': 'float'}, + 'node_state': {'key': 'nodeState', 'type': 'str'}, + 'run_id': {'key': 'runId', 'type': 'str'}, } def __init__(self, **kwargs): super(AmlComputeNodeInformation, self).__init__(**kwargs) self.node_id = None - self.ip_address = None + self.private_ip_address = None + self.public_ip_address = None self.port = None + self.node_state = None + self.run_id = None class ComputeNodesInformation(Model): @@ -487,12 +508,21 @@ class AmlComputeProperties(Model): Variables are only populated by the server, and will be ignored when sending a request. + :param os_type: Compute OS Type. Possible values include: 'Linux', + 'Windows' + :type os_type: str or ~azure.mgmt.machinelearningservices.models.OsType :param vm_size: Virtual Machine Size :type vm_size: str :param vm_priority: Virtual Machine priority. Possible values include: 'Dedicated', 'LowPriority' :type vm_priority: str or ~azure.mgmt.machinelearningservices.models.VmPriority + :param virtual_machine_image: Virtual Machine image for AML Compute - + windows only + :type virtual_machine_image: + ~azure.mgmt.machinelearningservices.models.VirtualMachineImage + :param isolated_network: Network is isolated or not + :type isolated_network: bool :param scale_settings: Scale settings for AML Compute :type scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings @@ -503,6 +533,17 @@ class AmlComputeProperties(Model): :param subnet: Subnet. Virtual network subnet resource ID the compute nodes belong to. :type subnet: ~azure.mgmt.machinelearningservices.models.ResourceId + :param remote_login_port_public_access: Close remote Login Access Port. + State of the public SSH port. Possible values are: Disabled - Indicates + that the public ssh port is closed on all nodes of the cluster. Enabled - + Indicates that the public ssh port is open on all nodes of the cluster. + NotSpecified - Indicates that the public ssh port is closed on all nodes + of the cluster if VNet is defined, else is open all public nodes. It can + be default only during cluster creation time, after creation it will be + either enabled or disabled. Possible values include: 'Enabled', + 'Disabled', 'NotSpecified'. Default value: "NotSpecified" . + :type remote_login_port_public_access: str or + ~azure.mgmt.machinelearningservices.models.RemoteLoginPortPublicAccess :ivar allocation_state: Allocation state. Allocation state of the compute. Possible values are: steady - Indicates that the compute is not resizing. There are no changes to the number of compute nodes in the compute in @@ -545,11 +586,15 @@ class AmlComputeProperties(Model): } _attribute_map = { + 'os_type': {'key': 'osType', 'type': 'str'}, 'vm_size': {'key': 'vmSize', 'type': 'str'}, 'vm_priority': {'key': 'vmPriority', 'type': 'str'}, + 'virtual_machine_image': {'key': 'virtualMachineImage', 'type': 'VirtualMachineImage'}, + 'isolated_network': {'key': 'isolatedNetwork', 'type': 'bool'}, 'scale_settings': {'key': 'scaleSettings', 'type': 'ScaleSettings'}, 'user_account_credentials': {'key': 'userAccountCredentials', 'type': 'UserAccountCredentials'}, 'subnet': {'key': 'subnet', 'type': 'ResourceId'}, + 'remote_login_port_public_access': {'key': 'remoteLoginPortPublicAccess', 'type': 'str'}, 'allocation_state': {'key': 'allocationState', 'type': 'str'}, 'allocation_state_transition_time': {'key': 'allocationStateTransitionTime', 'type': 'iso-8601'}, 'errors': {'key': 'errors', 'type': '[MachineLearningServiceError]'}, @@ -560,11 +605,15 @@ class AmlComputeProperties(Model): def __init__(self, **kwargs): super(AmlComputeProperties, self).__init__(**kwargs) + self.os_type = kwargs.get('os_type', None) self.vm_size = kwargs.get('vm_size', None) self.vm_priority = kwargs.get('vm_priority', None) + self.virtual_machine_image = kwargs.get('virtual_machine_image', None) + self.isolated_network = kwargs.get('isolated_network', None) self.scale_settings = kwargs.get('scale_settings', None) self.user_account_credentials = kwargs.get('user_account_credentials', None) self.subnet = kwargs.get('subnet', None) + self.remote_login_port_public_access = kwargs.get('remote_login_port_public_access', "NotSpecified") self.allocation_state = None self.allocation_state_transition_time = None self.errors = None @@ -573,6 +622,30 @@ def __init__(self, **kwargs): self.node_state_counts = None +class AmlUserFeature(Model): + """Features enabled for a workspace. + + :param id: Specifies the feature ID + :type id: str + :param display_name: Specifies the feature name + :type display_name: str + :param description: Describes the feature for user experience + :type description: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AmlUserFeature, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.display_name = kwargs.get('display_name', None) + self.description = kwargs.get('description', None) + + class CloudError(Model): """CloudError. """ @@ -609,20 +682,21 @@ class Resource(Model): :vartype id: str :ivar name: Specifies the name of the resource. :vartype name: str - :ivar identity: The identity of the resource. - :vartype identity: ~azure.mgmt.machinelearningservices.models.Identity + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.machinelearningservices.models.Identity :param location: Specifies the location of the resource. :type location: str :ivar type: Specifies the type of the resource. :vartype type: str :param tags: Contains resource tags defined as key/value pairs. :type tags: dict[str, str] + :param sku: The sku of the workspace. + :type sku: ~azure.mgmt.machinelearningservices.models.Sku """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, - 'identity': {'readonly': True}, 'type': {'readonly': True}, } @@ -633,16 +707,18 @@ class Resource(Model): 'location': {'key': 'location', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, } def __init__(self, **kwargs): super(Resource, self).__init__(**kwargs) self.id = None self.name = None - self.identity = None + self.identity = kwargs.get('identity', None) self.location = kwargs.get('location', None) self.type = None self.tags = kwargs.get('tags', None) + self.sku = kwargs.get('sku', None) class ComputeResource(Resource): @@ -655,14 +731,16 @@ class ComputeResource(Resource): :vartype id: str :ivar name: Specifies the name of the resource. :vartype name: str - :ivar identity: The identity of the resource. - :vartype identity: ~azure.mgmt.machinelearningservices.models.Identity + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.machinelearningservices.models.Identity :param location: Specifies the location of the resource. :type location: str :ivar type: Specifies the type of the resource. :vartype type: str :param tags: Contains resource tags defined as key/value pairs. :type tags: dict[str, str] + :param sku: The sku of the workspace. + :type sku: ~azure.mgmt.machinelearningservices.models.Sku :param properties: Compute properties :type properties: ~azure.mgmt.machinelearningservices.models.Compute """ @@ -670,7 +748,6 @@ class ComputeResource(Resource): _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, - 'identity': {'readonly': True}, 'type': {'readonly': True}, } @@ -681,6 +758,7 @@ class ComputeResource(Resource): 'location': {'key': 'location', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, 'properties': {'key': 'properties', 'type': 'Compute'}, } @@ -940,6 +1018,36 @@ def __init__(self, **kwargs): self.data_lake_store_account_name = kwargs.get('data_lake_store_account_name', None) +class EncryptionProperty(Model): + """EncryptionProperty. + + All required parameters must be populated in order to send to Azure. + + :param status: Required. Indicates whether or not the encryption is + enabled for the workspace. Possible values include: 'Enabled', 'Disabled' + :type status: str or + ~azure.mgmt.machinelearningservices.models.EncryptionStatus + :param key_vault_properties: Required. Customer Key vault properties. + :type key_vault_properties: + ~azure.mgmt.machinelearningservices.models.KeyVaultProperties + """ + + _validation = { + 'status': {'required': True}, + 'key_vault_properties': {'required': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'key_vault_properties': {'key': 'keyVaultProperties', 'type': 'KeyVaultProperties'}, + } + + def __init__(self, **kwargs): + super(EncryptionProperty, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.key_vault_properties = kwargs.get('key_vault_properties', None) + + class ErrorDetail(Model): """Error detail information. @@ -1001,6 +1109,18 @@ def __init__(self, **kwargs): self.details = None +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) + + class HDInsight(Compute): """A HDInsight compute. @@ -1100,24 +1220,35 @@ class Identity(Model): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar principal_id: The principal ID of resource identity. :vartype principal_id: str :ivar tenant_id: The tenant ID of resource. :vartype tenant_id: str - :param type: The identity type. Possible values include: 'SystemAssigned' + :param type: Required. The identity type. Possible values include: + 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', 'None' :type type: str or ~azure.mgmt.machinelearningservices.models.ResourceIdentityType + :param user_assigned_identities: The list of user identities associated + with resource. The user identity dictionary key references will be ARM + resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :type user_assigned_identities: dict[str, + ~azure.mgmt.machinelearningservices.models.IdentityUserAssignedIdentitiesValue] """ _validation = { 'principal_id': {'readonly': True}, 'tenant_id': {'readonly': True}, + 'type': {'required': True}, } _attribute_map = { 'principal_id': {'key': 'principalId', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{IdentityUserAssignedIdentitiesValue}'}, } def __init__(self, **kwargs): @@ -1125,6 +1256,69 @@ def __init__(self, **kwargs): self.principal_id = None self.tenant_id = None self.type = kwargs.get('type', None) + self.user_assigned_identities = kwargs.get('user_assigned_identities', None) + + +class IdentityUserAssignedIdentitiesValue(Model): + """IdentityUserAssignedIdentitiesValue. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(IdentityUserAssignedIdentitiesValue, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + +class KeyVaultProperties(Model): + """KeyVaultProperties. + + All required parameters must be populated in order to send to Azure. + + :param key_vault_arm_id: Required. The ArmId of the keyVault where the + customer owned encryption key is present. + :type key_vault_arm_id: str + :param key_identifier: Required. Key vault uri to access the encryption + key. + :type key_identifier: str + :param identity_client_id: For future use - The client id of the identity + which will be used to access key vault. + :type identity_client_id: str + """ + + _validation = { + 'key_vault_arm_id': {'required': True}, + 'key_identifier': {'required': True}, + } + + _attribute_map = { + 'key_vault_arm_id': {'key': 'keyVaultArmId', 'type': 'str'}, + 'key_identifier': {'key': 'keyIdentifier', 'type': 'str'}, + 'identity_client_id': {'key': 'identityClientId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(KeyVaultProperties, self).__init__(**kwargs) + self.key_vault_arm_id = kwargs.get('key_vault_arm_id', None) + self.key_identifier = kwargs.get('key_identifier', None) + self.identity_client_id = kwargs.get('identity_client_id', None) class ListWorkspaceKeysResult(Model): @@ -1332,6 +1526,242 @@ def __init__(self, **kwargs): self.value = None +class PrivateEndpoint(Model): + """The Private Endpoint resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The ARM identifier for Private Endpoint + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PrivateEndpoint, self).__init__(**kwargs) + self.id = None + + +class PrivateEndpointConnection(Resource): + """The Private Endpoint Connection resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Specifies the resource ID. + :vartype id: str + :ivar name: Specifies the name of the resource. + :vartype name: str + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.machinelearningservices.models.Identity + :param location: Specifies the location of the resource. + :type location: str + :ivar type: Specifies the type of the resource. + :vartype type: str + :param tags: Contains resource tags defined as key/value pairs. + :type tags: dict[str, str] + :param sku: The sku of the workspace. + :type sku: ~azure.mgmt.machinelearningservices.models.Sku + :param private_endpoint: The resource of private end point. + :type private_endpoint: + ~azure.mgmt.machinelearningservices.models.PrivateEndpoint + :param private_link_service_connection_state: Required. A collection of + information about the state of the connection between service consumer and + provider. + :type private_link_service_connection_state: + ~azure.mgmt.machinelearningservices.models.PrivateLinkServiceConnectionState + :param provisioning_state: The provisioning state of the private endpoint + connection resource. Possible values include: 'Succeeded', 'Creating', + 'Deleting', 'Failed' + :type provisioning_state: str or + ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnectionProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'private_link_service_connection_state': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PrivateEndpointConnection, self).__init__(**kwargs) + self.private_endpoint = kwargs.get('private_endpoint', None) + self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + + +class PrivateLinkResource(Resource): + """A private link resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Specifies the resource ID. + :vartype id: str + :ivar name: Specifies the name of the resource. + :vartype name: str + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.machinelearningservices.models.Identity + :param location: Specifies the location of the resource. + :type location: str + :ivar type: Specifies the type of the resource. + :vartype type: str + :param tags: Contains resource tags defined as key/value pairs. + :type tags: dict[str, str] + :param sku: The sku of the workspace. + :type sku: ~azure.mgmt.machinelearningservices.models.Sku + :ivar group_id: The private link resource group id. + :vartype group_id: str + :ivar required_members: The private link resource required member names. + :vartype required_members: list[str] + :param required_zone_names: The private link resource Private link DNS + zone name. + :type required_zone_names: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'group_id': {'readonly': True}, + 'required_members': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'group_id': {'key': 'properties.groupId', 'type': 'str'}, + 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, + 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(PrivateLinkResource, self).__init__(**kwargs) + self.group_id = None + self.required_members = None + self.required_zone_names = kwargs.get('required_zone_names', None) + + +class PrivateLinkResourceListResult(Model): + """A list of private link resources. + + :param value: Array of private link resources + :type value: + list[~azure.mgmt.machinelearningservices.models.PrivateLinkResource] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, + } + + def __init__(self, **kwargs): + super(PrivateLinkResourceListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class PrivateLinkServiceConnectionState(Model): + """A collection of information about the state of the connection between + service consumer and provider. + + :param status: Indicates whether the connection has been + Approved/Rejected/Removed by the owner of the service. Possible values + include: 'Pending', 'Approved', 'Rejected', 'Disconnected', 'Timeout' + :type status: str or + ~azure.mgmt.machinelearningservices.models.PrivateEndpointServiceConnectionStatus + :param description: The reason for approval/rejection of the connection. + :type description: str + :param actions_required: A message indicating if changes on the service + provider require any updates on the consumer. + :type actions_required: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.description = kwargs.get('description', None) + self.actions_required = kwargs.get('actions_required', None) + + +class QuotaBaseProperties(Model): + """The properties for Quota update or retrieval. + + :param id: Specifies the resource ID. + :type id: str + :param type: Specifies the resource type. + :type type: str + :param limit: Limit. The maximum permitted quota of the resource. + :type limit: long + :param unit: An enum describing the unit of quota measurement. Possible + values include: 'Count' + :type unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'limit': {'key': 'limit', 'type': 'long'}, + 'unit': {'key': 'unit', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(QuotaBaseProperties, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.type = kwargs.get('type', None) + self.limit = kwargs.get('limit', None) + self.unit = kwargs.get('unit', None) + + +class QuotaUpdateParameters(Model): + """Quota update parameters. + + :param value: The list for update quota. + :type value: + list[~azure.mgmt.machinelearningservices.models.QuotaBaseProperties] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[QuotaBaseProperties]'}, + } + + def __init__(self, **kwargs): + super(QuotaUpdateParameters, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + class RegistryListCredentialsResult(Model): """RegistryListCredentialsResult. @@ -1387,6 +1817,181 @@ def __init__(self, **kwargs): self.id = kwargs.get('id', None) +class ResourceName(Model): + """The Resource Name. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The name of the resource. + :vartype value: str + :ivar localized_value: The localized name of the resource. + :vartype localized_value: str + """ + + _validation = { + 'value': {'readonly': True}, + 'localized_value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ResourceName, self).__init__(**kwargs) + self.value = None + self.localized_value = None + + +class ResourceQuota(Model): + """The quota assigned to a resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Specifies the resource ID. + :vartype id: str + :ivar type: Specifies the resource type. + :vartype type: str + :ivar name: Name of the resource. + :vartype name: ~azure.mgmt.machinelearningservices.models.ResourceName + :ivar limit: Limit. The maximum permitted quota of the resource. + :vartype limit: long + :ivar unit: An enum describing the unit of quota measurement. Possible + values include: 'Count' + :vartype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'limit': {'readonly': True}, + 'unit': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'ResourceName'}, + 'limit': {'key': 'limit', 'type': 'long'}, + 'unit': {'key': 'unit', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ResourceQuota, self).__init__(**kwargs) + self.id = None + self.type = None + self.name = None + self.limit = None + self.unit = None + + +class ResourceSkuLocationInfo(Model): + """ResourceSkuLocationInfo. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar location: Location of the SKU + :vartype location: str + :ivar zones: List of availability zones where the SKU is supported. + :vartype zones: list[str] + :ivar zone_details: Details of capabilities available to a SKU in specific + zones. + :vartype zone_details: + list[~azure.mgmt.machinelearningservices.models.ResourceSkuZoneDetails] + """ + + _validation = { + 'location': {'readonly': True}, + 'zones': {'readonly': True}, + 'zone_details': {'readonly': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'zone_details': {'key': 'zoneDetails', 'type': '[ResourceSkuZoneDetails]'}, + } + + def __init__(self, **kwargs): + super(ResourceSkuLocationInfo, self).__init__(**kwargs) + self.location = None + self.zones = None + self.zone_details = None + + +class ResourceSkuZoneDetails(Model): + """Describes The zonal capabilities of a SKU. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The set of zones that the SKU is available in with the + specified capabilities. + :vartype name: list[str] + :ivar capabilities: A list of capabilities that are available for the SKU + in the specified list of zones. + :vartype capabilities: + list[~azure.mgmt.machinelearningservices.models.SKUCapability] + """ + + _validation = { + 'name': {'readonly': True}, + 'capabilities': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': '[str]'}, + 'capabilities': {'key': 'capabilities', 'type': '[SKUCapability]'}, + } + + def __init__(self, **kwargs): + super(ResourceSkuZoneDetails, self).__init__(**kwargs) + self.name = None + self.capabilities = None + + +class Restriction(Model): + """The restriction because of which SKU cannot be used. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The type of restrictions. As of now only possible value for + this is location. + :vartype type: str + :ivar values: The value of restrictions. If the restriction type is set to + location. This would be different locations where the SKU is restricted. + :vartype values: list[str] + :param reason_code: The reason for the restriction. Possible values + include: 'NotSpecified', 'NotAvailableForRegion', + 'NotAvailableForSubscription' + :type reason_code: str or + ~azure.mgmt.machinelearningservices.models.ReasonCode + """ + + _validation = { + 'type': {'readonly': True}, + 'values': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + 'reason_code': {'key': 'reasonCode', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Restriction, self).__init__(**kwargs) + self.type = None + self.values = None + self.reason_code = kwargs.get('reason_code', None) + + class ScaleSettings(Model): """scale settings for AML Compute. @@ -1445,6 +2050,82 @@ def __init__(self, **kwargs): self.client_secret = kwargs.get('client_secret', None) +class SharedPrivateLinkResource(Model): + """SharedPrivateLinkResource. + + :param name: Unique name of the private link. + :type name: str + :param private_link_resource_id: The resource id that private link links + to. + :type private_link_resource_id: str + :param group_id: The private link resource group id. + :type group_id: str + :param request_message: Request message. + :type request_message: str + :param status: Indicates whether the connection has been + Approved/Rejected/Removed by the owner of the service. Possible values + include: 'Pending', 'Approved', 'Rejected', 'Disconnected', 'Timeout' + :type status: str or + ~azure.mgmt.machinelearningservices.models.PrivateEndpointServiceConnectionStatus + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'private_link_resource_id': {'key': 'properties.privateLinkResourceId', 'type': 'str'}, + 'group_id': {'key': 'properties.groupId', 'type': 'str'}, + 'request_message': {'key': 'properties.requestMessage', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SharedPrivateLinkResource, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.private_link_resource_id = kwargs.get('private_link_resource_id', None) + self.group_id = kwargs.get('group_id', None) + self.request_message = kwargs.get('request_message', None) + self.status = kwargs.get('status', None) + + +class Sku(Model): + """Sku of the resource. + + :param name: Name of the sku + :type name: str + :param tier: Tier of the sku like Basic or Enterprise + :type tier: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + + +class SKUCapability(Model): + """Features/user capabilities associated with the sku. + + :param name: Capability/Feature ID + :type name: str + :param value: Details about the feature/capability + :type value: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SKUCapability, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.value = kwargs.get('value', None) + + class SslConfiguration(Model): """The ssl configuration for scoring. @@ -1507,6 +2188,83 @@ def __init__(self, **kwargs): self.version = None +class UpdateWorkspaceQuotas(Model): + """The properties for update Quota response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Specifies the resource ID. + :vartype id: str + :ivar type: Specifies the resource type. + :vartype type: str + :param limit: Limit. The maximum permitted quota of the resource. + :type limit: long + :ivar unit: An enum describing the unit of quota measurement. Possible + values include: 'Count' + :vartype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit + :param status: Update Workspace Quota Status. Status of update workspace + quota. Possible values include: 'Undefined', 'Success', 'Failure', + 'InvalidQuotaBelowClusterMinimum', 'InvalidQuotaExceedsSubscriptionLimit', + 'InvalidVMFamilyName', 'OperationNotSupportedForSku', + 'OperationNotEnabledForRegion' + :type status: str or ~azure.mgmt.machinelearningservices.models.Status + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'unit': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'limit': {'key': 'limit', 'type': 'long'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(UpdateWorkspaceQuotas, self).__init__(**kwargs) + self.id = None + self.type = None + self.limit = kwargs.get('limit', None) + self.unit = None + self.status = kwargs.get('status', None) + + +class UpdateWorkspaceQuotasResult(Model): + """The result of update workspace quota. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of workspace quota update result. + :vartype value: + list[~azure.mgmt.machinelearningservices.models.UpdateWorkspaceQuotas] + :ivar next_link: The URI to fetch the next page of workspace quota update + result. Call ListNext() with this to fetch the next page of Workspace + Quota update result. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[UpdateWorkspaceQuotas]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(UpdateWorkspaceQuotasResult, self).__init__(**kwargs) + self.value = None + self.next_link = None + + class Usage(Model): """Describes AML Resource Usage. @@ -1684,6 +2442,28 @@ def __init__(self, **kwargs): self.compute_type = 'VirtualMachine' +class VirtualMachineImage(Model): + """Virtual Machine image for Windows AML Compute. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. Virtual Machine image path + :type id: str + """ + + _validation = { + 'id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VirtualMachineImage, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + + class VirtualMachineProperties(Model): """VirtualMachineProperties. @@ -1755,6 +2535,9 @@ class VirtualMachineSize(Model): :ivar v_cp_us: Number of vPUs. The number of vCPUs supported by the virtual machine size. :vartype v_cp_us: int + :ivar gpus: Number of gPUs. The number of gPUs supported by the virtual + machine size. + :vartype gpus: int :ivar os_vhd_size_mb: OS VHD Disk size. The OS VHD disk size, in MB, allowed by the virtual machine size. :vartype os_vhd_size_mb: int @@ -1776,6 +2559,7 @@ class VirtualMachineSize(Model): 'name': {'readonly': True}, 'family': {'readonly': True}, 'v_cp_us': {'readonly': True}, + 'gpus': {'readonly': True}, 'os_vhd_size_mb': {'readonly': True}, 'max_resource_volume_mb': {'readonly': True}, 'memory_gb': {'readonly': True}, @@ -1787,6 +2571,7 @@ class VirtualMachineSize(Model): 'name': {'key': 'name', 'type': 'str'}, 'family': {'key': 'family', 'type': 'str'}, 'v_cp_us': {'key': 'vCPUs', 'type': 'int'}, + 'gpus': {'key': 'gpus', 'type': 'int'}, 'os_vhd_size_mb': {'key': 'osVhdSizeMB', 'type': 'int'}, 'max_resource_volume_mb': {'key': 'maxResourceVolumeMB', 'type': 'int'}, 'memory_gb': {'key': 'memoryGB', 'type': 'float'}, @@ -1799,6 +2584,7 @@ def __init__(self, **kwargs): self.name = None self.family = None self.v_cp_us = None + self.gpus = None self.os_vhd_size_mb = None self.max_resource_volume_mb = None self.memory_gb = None @@ -1862,14 +2648,16 @@ class Workspace(Resource): :vartype id: str :ivar name: Specifies the name of the resource. :vartype name: str - :ivar identity: The identity of the resource. - :vartype identity: ~azure.mgmt.machinelearningservices.models.Identity + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.machinelearningservices.models.Identity :param location: Specifies the location of the resource. :type location: str :ivar type: Specifies the type of the resource. :vartype type: str :param tags: Contains resource tags defined as key/value pairs. :type tags: dict[str, str] + :param sku: The sku of the workspace. + :type sku: ~azure.mgmt.machinelearningservices.models.Sku :ivar workspace_id: The immutable id associated with this workspace. :vartype workspace_id: str :param description: The description of this workspace. @@ -1903,16 +2691,43 @@ class Workspace(Resource): 'Deleting', 'Succeeded', 'Failed', 'Canceled' :vartype provisioning_state: str or ~azure.mgmt.machinelearningservices.models.ProvisioningState + :param encryption: The encryption settings of Azure ML workspace. + :type encryption: + ~azure.mgmt.machinelearningservices.models.EncryptionProperty + :param hbi_workspace: The flag to signal HBI data in the workspace and + reduce diagnostic data collected by the service. Default value: False . + :type hbi_workspace: bool + :ivar service_provisioned_resource_group: The name of the managed resource + group created by workspace RP in customer subscription if the workspace is + CMK workspace + :vartype service_provisioned_resource_group: str + :ivar private_link_count: Count of private connections in the workspace + :vartype private_link_count: int + :param image_build_compute: The compute name for image build + :type image_build_compute: str + :param allow_public_access_when_behind_vnet: The flag to indicate whether + to allow public access when behind VNet. Default value: False . + :type allow_public_access_when_behind_vnet: bool + :ivar private_endpoint_connections: The list of private endpoint + connections in the workspace. + :vartype private_endpoint_connections: + list[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection] + :param shared_private_link_resources: The list of shared private link + resources in this workspace. + :type shared_private_link_resources: + list[~azure.mgmt.machinelearningservices.models.SharedPrivateLinkResource] """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, - 'identity': {'readonly': True}, 'type': {'readonly': True}, 'workspace_id': {'readonly': True}, 'creation_time': {'readonly': True}, 'provisioning_state': {'readonly': True}, + 'service_provisioned_resource_group': {'readonly': True}, + 'private_link_count': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, } _attribute_map = { @@ -1922,6 +2737,7 @@ class Workspace(Resource): 'location': {'key': 'location', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, 'workspace_id': {'key': 'properties.workspaceId', 'type': 'str'}, 'description': {'key': 'properties.description', 'type': 'str'}, 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, @@ -1932,6 +2748,14 @@ class Workspace(Resource): 'storage_account': {'key': 'properties.storageAccount', 'type': 'str'}, 'discovery_url': {'key': 'properties.discoveryUrl', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'encryption': {'key': 'properties.encryption', 'type': 'EncryptionProperty'}, + 'hbi_workspace': {'key': 'properties.hbiWorkspace', 'type': 'bool'}, + 'service_provisioned_resource_group': {'key': 'properties.serviceProvisionedResourceGroup', 'type': 'str'}, + 'private_link_count': {'key': 'properties.privateLinkCount', 'type': 'int'}, + 'image_build_compute': {'key': 'properties.imageBuildCompute', 'type': 'str'}, + 'allow_public_access_when_behind_vnet': {'key': 'properties.allowPublicAccessWhenBehindVnet', 'type': 'bool'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, + 'shared_private_link_resources': {'key': 'properties.sharedPrivateLinkResources', 'type': '[SharedPrivateLinkResource]'}, } def __init__(self, **kwargs): @@ -1946,6 +2770,74 @@ def __init__(self, **kwargs): self.storage_account = kwargs.get('storage_account', None) self.discovery_url = kwargs.get('discovery_url', None) self.provisioning_state = None + self.encryption = kwargs.get('encryption', None) + self.hbi_workspace = kwargs.get('hbi_workspace', False) + self.service_provisioned_resource_group = None + self.private_link_count = None + self.image_build_compute = kwargs.get('image_build_compute', None) + self.allow_public_access_when_behind_vnet = kwargs.get('allow_public_access_when_behind_vnet', False) + self.private_endpoint_connections = None + self.shared_private_link_resources = kwargs.get('shared_private_link_resources', None) + + +class WorkspaceSku(Model): + """Describes Workspace Sku details and features. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar locations: The set of locations that the SKU is available. This will + be supported and registered Azure Geo Regions (e.g. West US, East US, + Southeast Asia, etc.). + :vartype locations: list[str] + :ivar location_info: A list of locations and availability zones in those + locations where the SKU is available. + :vartype location_info: + list[~azure.mgmt.machinelearningservices.models.ResourceSkuLocationInfo] + :ivar tier: Sku Tier like Basic or Enterprise + :vartype tier: str + :ivar resource_type: + :vartype resource_type: str + :ivar name: + :vartype name: str + :ivar capabilities: List of features/user capabilities associated with the + sku + :vartype capabilities: + list[~azure.mgmt.machinelearningservices.models.SKUCapability] + :param restrictions: The restrictions because of which SKU cannot be used. + This is empty if there are no restrictions. + :type restrictions: + list[~azure.mgmt.machinelearningservices.models.Restriction] + """ + + _validation = { + 'locations': {'readonly': True}, + 'location_info': {'readonly': True}, + 'tier': {'readonly': True}, + 'resource_type': {'readonly': True}, + 'name': {'readonly': True}, + 'capabilities': {'readonly': True}, + } + + _attribute_map = { + 'locations': {'key': 'locations', 'type': '[str]'}, + 'location_info': {'key': 'locationInfo', 'type': '[ResourceSkuLocationInfo]'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'capabilities': {'key': 'capabilities', 'type': '[SKUCapability]'}, + 'restrictions': {'key': 'restrictions', 'type': '[Restriction]'}, + } + + def __init__(self, **kwargs): + super(WorkspaceSku, self).__init__(**kwargs) + self.locations = None + self.location_info = None + self.tier = None + self.resource_type = None + self.name = None + self.capabilities = None + self.restrictions = kwargs.get('restrictions', None) class WorkspaceUpdateParameters(Model): @@ -1953,6 +2845,8 @@ class WorkspaceUpdateParameters(Model): :param tags: The resource tags for the machine learning workspace. :type tags: dict[str, str] + :param sku: The sku of the workspace. + :type sku: ~azure.mgmt.machinelearningservices.models.Sku :param description: The description of this workspace. :type description: str :param friendly_name: The friendly name for this workspace. @@ -1961,6 +2855,7 @@ class WorkspaceUpdateParameters(Model): _attribute_map = { 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, 'description': {'key': 'properties.description', 'type': 'str'}, 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, } @@ -1968,5 +2863,6 @@ class WorkspaceUpdateParameters(Model): def __init__(self, **kwargs): super(WorkspaceUpdateParameters, self).__init__(**kwargs) self.tags = kwargs.get('tags', None) + self.sku = kwargs.get('sku', None) self.description = kwargs.get('description', None) self.friendly_name = kwargs.get('friendly_name', None) diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/models/_models_py3.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/models/_models_py3.py index f173a48382ad..c3d31b842303 100644 --- a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/models/_models_py3.py +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/models/_models_py3.py @@ -383,29 +383,50 @@ class AmlComputeNodeInformation(Model): :ivar node_id: Node ID. ID of the compute node. :vartype node_id: str - :ivar ip_address: IP address. Public IP address of the compute node. - :vartype ip_address: str + :ivar private_ip_address: Private IP address. Private IP address of the + compute node. + :vartype private_ip_address: str + :ivar public_ip_address: Public IP address. Public IP address of the + compute node. + :vartype public_ip_address: str :ivar port: Port. SSH port number of the node. :vartype port: float + :ivar node_state: State of the compute node. Values are idle, running, + preparing, unusable, leaving and preempted. Possible values include: + 'idle', 'running', 'preparing', 'unusable', 'leaving', 'preempted' + :vartype node_state: str or + ~azure.mgmt.machinelearningservices.models.NodeState + :ivar run_id: Run ID. ID of the Experiment running on the node, if any + else null. + :vartype run_id: str """ _validation = { 'node_id': {'readonly': True}, - 'ip_address': {'readonly': True}, + 'private_ip_address': {'readonly': True}, + 'public_ip_address': {'readonly': True}, 'port': {'readonly': True}, + 'node_state': {'readonly': True}, + 'run_id': {'readonly': True}, } _attribute_map = { 'node_id': {'key': 'nodeId', 'type': 'str'}, - 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, + 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, 'port': {'key': 'port', 'type': 'float'}, + 'node_state': {'key': 'nodeState', 'type': 'str'}, + 'run_id': {'key': 'runId', 'type': 'str'}, } def __init__(self, **kwargs) -> None: super(AmlComputeNodeInformation, self).__init__(**kwargs) self.node_id = None - self.ip_address = None + self.private_ip_address = None + self.public_ip_address = None self.port = None + self.node_state = None + self.run_id = None class ComputeNodesInformation(Model): @@ -487,12 +508,21 @@ class AmlComputeProperties(Model): Variables are only populated by the server, and will be ignored when sending a request. + :param os_type: Compute OS Type. Possible values include: 'Linux', + 'Windows' + :type os_type: str or ~azure.mgmt.machinelearningservices.models.OsType :param vm_size: Virtual Machine Size :type vm_size: str :param vm_priority: Virtual Machine priority. Possible values include: 'Dedicated', 'LowPriority' :type vm_priority: str or ~azure.mgmt.machinelearningservices.models.VmPriority + :param virtual_machine_image: Virtual Machine image for AML Compute - + windows only + :type virtual_machine_image: + ~azure.mgmt.machinelearningservices.models.VirtualMachineImage + :param isolated_network: Network is isolated or not + :type isolated_network: bool :param scale_settings: Scale settings for AML Compute :type scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings @@ -503,6 +533,17 @@ class AmlComputeProperties(Model): :param subnet: Subnet. Virtual network subnet resource ID the compute nodes belong to. :type subnet: ~azure.mgmt.machinelearningservices.models.ResourceId + :param remote_login_port_public_access: Close remote Login Access Port. + State of the public SSH port. Possible values are: Disabled - Indicates + that the public ssh port is closed on all nodes of the cluster. Enabled - + Indicates that the public ssh port is open on all nodes of the cluster. + NotSpecified - Indicates that the public ssh port is closed on all nodes + of the cluster if VNet is defined, else is open all public nodes. It can + be default only during cluster creation time, after creation it will be + either enabled or disabled. Possible values include: 'Enabled', + 'Disabled', 'NotSpecified'. Default value: "NotSpecified" . + :type remote_login_port_public_access: str or + ~azure.mgmt.machinelearningservices.models.RemoteLoginPortPublicAccess :ivar allocation_state: Allocation state. Allocation state of the compute. Possible values are: steady - Indicates that the compute is not resizing. There are no changes to the number of compute nodes in the compute in @@ -545,11 +586,15 @@ class AmlComputeProperties(Model): } _attribute_map = { + 'os_type': {'key': 'osType', 'type': 'str'}, 'vm_size': {'key': 'vmSize', 'type': 'str'}, 'vm_priority': {'key': 'vmPriority', 'type': 'str'}, + 'virtual_machine_image': {'key': 'virtualMachineImage', 'type': 'VirtualMachineImage'}, + 'isolated_network': {'key': 'isolatedNetwork', 'type': 'bool'}, 'scale_settings': {'key': 'scaleSettings', 'type': 'ScaleSettings'}, 'user_account_credentials': {'key': 'userAccountCredentials', 'type': 'UserAccountCredentials'}, 'subnet': {'key': 'subnet', 'type': 'ResourceId'}, + 'remote_login_port_public_access': {'key': 'remoteLoginPortPublicAccess', 'type': 'str'}, 'allocation_state': {'key': 'allocationState', 'type': 'str'}, 'allocation_state_transition_time': {'key': 'allocationStateTransitionTime', 'type': 'iso-8601'}, 'errors': {'key': 'errors', 'type': '[MachineLearningServiceError]'}, @@ -558,13 +603,17 @@ class AmlComputeProperties(Model): 'node_state_counts': {'key': 'nodeStateCounts', 'type': 'NodeStateCounts'}, } - def __init__(self, *, vm_size: str=None, vm_priority=None, scale_settings=None, user_account_credentials=None, subnet=None, **kwargs) -> None: + def __init__(self, *, os_type=None, vm_size: str=None, vm_priority=None, virtual_machine_image=None, isolated_network: bool=None, scale_settings=None, user_account_credentials=None, subnet=None, remote_login_port_public_access="NotSpecified", **kwargs) -> None: super(AmlComputeProperties, self).__init__(**kwargs) + self.os_type = os_type self.vm_size = vm_size self.vm_priority = vm_priority + self.virtual_machine_image = virtual_machine_image + self.isolated_network = isolated_network self.scale_settings = scale_settings self.user_account_credentials = user_account_credentials self.subnet = subnet + self.remote_login_port_public_access = remote_login_port_public_access self.allocation_state = None self.allocation_state_transition_time = None self.errors = None @@ -573,6 +622,30 @@ def __init__(self, *, vm_size: str=None, vm_priority=None, scale_settings=None, self.node_state_counts = None +class AmlUserFeature(Model): + """Features enabled for a workspace. + + :param id: Specifies the feature ID + :type id: str + :param display_name: Specifies the feature name + :type display_name: str + :param description: Describes the feature for user experience + :type description: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, display_name: str=None, description: str=None, **kwargs) -> None: + super(AmlUserFeature, self).__init__(**kwargs) + self.id = id + self.display_name = display_name + self.description = description + + class CloudError(Model): """CloudError. """ @@ -609,20 +682,21 @@ class Resource(Model): :vartype id: str :ivar name: Specifies the name of the resource. :vartype name: str - :ivar identity: The identity of the resource. - :vartype identity: ~azure.mgmt.machinelearningservices.models.Identity + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.machinelearningservices.models.Identity :param location: Specifies the location of the resource. :type location: str :ivar type: Specifies the type of the resource. :vartype type: str :param tags: Contains resource tags defined as key/value pairs. :type tags: dict[str, str] + :param sku: The sku of the workspace. + :type sku: ~azure.mgmt.machinelearningservices.models.Sku """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, - 'identity': {'readonly': True}, 'type': {'readonly': True}, } @@ -633,16 +707,18 @@ class Resource(Model): 'location': {'key': 'location', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, } - def __init__(self, *, location: str=None, tags=None, **kwargs) -> None: + def __init__(self, *, identity=None, location: str=None, tags=None, sku=None, **kwargs) -> None: super(Resource, self).__init__(**kwargs) self.id = None self.name = None - self.identity = None + self.identity = identity self.location = location self.type = None self.tags = tags + self.sku = sku class ComputeResource(Resource): @@ -655,14 +731,16 @@ class ComputeResource(Resource): :vartype id: str :ivar name: Specifies the name of the resource. :vartype name: str - :ivar identity: The identity of the resource. - :vartype identity: ~azure.mgmt.machinelearningservices.models.Identity + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.machinelearningservices.models.Identity :param location: Specifies the location of the resource. :type location: str :ivar type: Specifies the type of the resource. :vartype type: str :param tags: Contains resource tags defined as key/value pairs. :type tags: dict[str, str] + :param sku: The sku of the workspace. + :type sku: ~azure.mgmt.machinelearningservices.models.Sku :param properties: Compute properties :type properties: ~azure.mgmt.machinelearningservices.models.Compute """ @@ -670,7 +748,6 @@ class ComputeResource(Resource): _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, - 'identity': {'readonly': True}, 'type': {'readonly': True}, } @@ -681,11 +758,12 @@ class ComputeResource(Resource): 'location': {'key': 'location', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, 'properties': {'key': 'properties', 'type': 'Compute'}, } - def __init__(self, *, location: str=None, tags=None, properties=None, **kwargs) -> None: - super(ComputeResource, self).__init__(location=location, tags=tags, **kwargs) + def __init__(self, *, identity=None, location: str=None, tags=None, sku=None, properties=None, **kwargs) -> None: + super(ComputeResource, self).__init__(identity=identity, location=location, tags=tags, sku=sku, **kwargs) self.properties = properties @@ -940,6 +1018,36 @@ def __init__(self, *, data_lake_store_account_name: str=None, **kwargs) -> None: self.data_lake_store_account_name = data_lake_store_account_name +class EncryptionProperty(Model): + """EncryptionProperty. + + All required parameters must be populated in order to send to Azure. + + :param status: Required. Indicates whether or not the encryption is + enabled for the workspace. Possible values include: 'Enabled', 'Disabled' + :type status: str or + ~azure.mgmt.machinelearningservices.models.EncryptionStatus + :param key_vault_properties: Required. Customer Key vault properties. + :type key_vault_properties: + ~azure.mgmt.machinelearningservices.models.KeyVaultProperties + """ + + _validation = { + 'status': {'required': True}, + 'key_vault_properties': {'required': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'key_vault_properties': {'key': 'keyVaultProperties', 'type': 'KeyVaultProperties'}, + } + + def __init__(self, *, status, key_vault_properties, **kwargs) -> None: + super(EncryptionProperty, self).__init__(**kwargs) + self.status = status + self.key_vault_properties = key_vault_properties + + class ErrorDetail(Model): """Error detail information. @@ -1001,6 +1109,18 @@ def __init__(self, **kwargs) -> None: self.details = None +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) + + class HDInsight(Compute): """A HDInsight compute. @@ -1100,31 +1220,105 @@ class Identity(Model): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar principal_id: The principal ID of resource identity. :vartype principal_id: str :ivar tenant_id: The tenant ID of resource. :vartype tenant_id: str - :param type: The identity type. Possible values include: 'SystemAssigned' + :param type: Required. The identity type. Possible values include: + 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', 'None' :type type: str or ~azure.mgmt.machinelearningservices.models.ResourceIdentityType + :param user_assigned_identities: The list of user identities associated + with resource. The user identity dictionary key references will be ARM + resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :type user_assigned_identities: dict[str, + ~azure.mgmt.machinelearningservices.models.IdentityUserAssignedIdentitiesValue] """ _validation = { 'principal_id': {'readonly': True}, 'tenant_id': {'readonly': True}, + 'type': {'required': True}, } _attribute_map = { 'principal_id': {'key': 'principalId', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{IdentityUserAssignedIdentitiesValue}'}, } - def __init__(self, *, type=None, **kwargs) -> None: + def __init__(self, *, type, user_assigned_identities=None, **kwargs) -> None: super(Identity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None self.type = type + self.user_assigned_identities = user_assigned_identities + + +class IdentityUserAssignedIdentitiesValue(Model): + """IdentityUserAssignedIdentitiesValue. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(IdentityUserAssignedIdentitiesValue, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + +class KeyVaultProperties(Model): + """KeyVaultProperties. + + All required parameters must be populated in order to send to Azure. + + :param key_vault_arm_id: Required. The ArmId of the keyVault where the + customer owned encryption key is present. + :type key_vault_arm_id: str + :param key_identifier: Required. Key vault uri to access the encryption + key. + :type key_identifier: str + :param identity_client_id: For future use - The client id of the identity + which will be used to access key vault. + :type identity_client_id: str + """ + + _validation = { + 'key_vault_arm_id': {'required': True}, + 'key_identifier': {'required': True}, + } + + _attribute_map = { + 'key_vault_arm_id': {'key': 'keyVaultArmId', 'type': 'str'}, + 'key_identifier': {'key': 'keyIdentifier', 'type': 'str'}, + 'identity_client_id': {'key': 'identityClientId', 'type': 'str'}, + } + + def __init__(self, *, key_vault_arm_id: str, key_identifier: str, identity_client_id: str=None, **kwargs) -> None: + super(KeyVaultProperties, self).__init__(**kwargs) + self.key_vault_arm_id = key_vault_arm_id + self.key_identifier = key_identifier + self.identity_client_id = identity_client_id class ListWorkspaceKeysResult(Model): @@ -1332,6 +1526,242 @@ def __init__(self, **kwargs) -> None: self.value = None +class PrivateEndpoint(Model): + """The Private Endpoint resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The ARM identifier for Private Endpoint + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(PrivateEndpoint, self).__init__(**kwargs) + self.id = None + + +class PrivateEndpointConnection(Resource): + """The Private Endpoint Connection resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Specifies the resource ID. + :vartype id: str + :ivar name: Specifies the name of the resource. + :vartype name: str + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.machinelearningservices.models.Identity + :param location: Specifies the location of the resource. + :type location: str + :ivar type: Specifies the type of the resource. + :vartype type: str + :param tags: Contains resource tags defined as key/value pairs. + :type tags: dict[str, str] + :param sku: The sku of the workspace. + :type sku: ~azure.mgmt.machinelearningservices.models.Sku + :param private_endpoint: The resource of private end point. + :type private_endpoint: + ~azure.mgmt.machinelearningservices.models.PrivateEndpoint + :param private_link_service_connection_state: Required. A collection of + information about the state of the connection between service consumer and + provider. + :type private_link_service_connection_state: + ~azure.mgmt.machinelearningservices.models.PrivateLinkServiceConnectionState + :param provisioning_state: The provisioning state of the private endpoint + connection resource. Possible values include: 'Succeeded', 'Creating', + 'Deleting', 'Failed' + :type provisioning_state: str or + ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnectionProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'private_link_service_connection_state': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, private_link_service_connection_state, identity=None, location: str=None, tags=None, sku=None, private_endpoint=None, provisioning_state=None, **kwargs) -> None: + super(PrivateEndpointConnection, self).__init__(identity=identity, location=location, tags=tags, sku=sku, **kwargs) + self.private_endpoint = private_endpoint + self.private_link_service_connection_state = private_link_service_connection_state + self.provisioning_state = provisioning_state + + +class PrivateLinkResource(Resource): + """A private link resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Specifies the resource ID. + :vartype id: str + :ivar name: Specifies the name of the resource. + :vartype name: str + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.machinelearningservices.models.Identity + :param location: Specifies the location of the resource. + :type location: str + :ivar type: Specifies the type of the resource. + :vartype type: str + :param tags: Contains resource tags defined as key/value pairs. + :type tags: dict[str, str] + :param sku: The sku of the workspace. + :type sku: ~azure.mgmt.machinelearningservices.models.Sku + :ivar group_id: The private link resource group id. + :vartype group_id: str + :ivar required_members: The private link resource required member names. + :vartype required_members: list[str] + :param required_zone_names: The private link resource Private link DNS + zone name. + :type required_zone_names: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'group_id': {'readonly': True}, + 'required_members': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'group_id': {'key': 'properties.groupId', 'type': 'str'}, + 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, + 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, + } + + def __init__(self, *, identity=None, location: str=None, tags=None, sku=None, required_zone_names=None, **kwargs) -> None: + super(PrivateLinkResource, self).__init__(identity=identity, location=location, tags=tags, sku=sku, **kwargs) + self.group_id = None + self.required_members = None + self.required_zone_names = required_zone_names + + +class PrivateLinkResourceListResult(Model): + """A list of private link resources. + + :param value: Array of private link resources + :type value: + list[~azure.mgmt.machinelearningservices.models.PrivateLinkResource] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(PrivateLinkResourceListResult, self).__init__(**kwargs) + self.value = value + + +class PrivateLinkServiceConnectionState(Model): + """A collection of information about the state of the connection between + service consumer and provider. + + :param status: Indicates whether the connection has been + Approved/Rejected/Removed by the owner of the service. Possible values + include: 'Pending', 'Approved', 'Rejected', 'Disconnected', 'Timeout' + :type status: str or + ~azure.mgmt.machinelearningservices.models.PrivateEndpointServiceConnectionStatus + :param description: The reason for approval/rejection of the connection. + :type description: str + :param actions_required: A message indicating if changes on the service + provider require any updates on the consumer. + :type actions_required: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, + } + + def __init__(self, *, status=None, description: str=None, actions_required: str=None, **kwargs) -> None: + super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) + self.status = status + self.description = description + self.actions_required = actions_required + + +class QuotaBaseProperties(Model): + """The properties for Quota update or retrieval. + + :param id: Specifies the resource ID. + :type id: str + :param type: Specifies the resource type. + :type type: str + :param limit: Limit. The maximum permitted quota of the resource. + :type limit: long + :param unit: An enum describing the unit of quota measurement. Possible + values include: 'Count' + :type unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'limit': {'key': 'limit', 'type': 'long'}, + 'unit': {'key': 'unit', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, type: str=None, limit: int=None, unit=None, **kwargs) -> None: + super(QuotaBaseProperties, self).__init__(**kwargs) + self.id = id + self.type = type + self.limit = limit + self.unit = unit + + +class QuotaUpdateParameters(Model): + """Quota update parameters. + + :param value: The list for update quota. + :type value: + list[~azure.mgmt.machinelearningservices.models.QuotaBaseProperties] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[QuotaBaseProperties]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(QuotaUpdateParameters, self).__init__(**kwargs) + self.value = value + + class RegistryListCredentialsResult(Model): """RegistryListCredentialsResult. @@ -1387,6 +1817,181 @@ def __init__(self, *, id: str, **kwargs) -> None: self.id = id +class ResourceName(Model): + """The Resource Name. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The name of the resource. + :vartype value: str + :ivar localized_value: The localized name of the resource. + :vartype localized_value: str + """ + + _validation = { + 'value': {'readonly': True}, + 'localized_value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ResourceName, self).__init__(**kwargs) + self.value = None + self.localized_value = None + + +class ResourceQuota(Model): + """The quota assigned to a resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Specifies the resource ID. + :vartype id: str + :ivar type: Specifies the resource type. + :vartype type: str + :ivar name: Name of the resource. + :vartype name: ~azure.mgmt.machinelearningservices.models.ResourceName + :ivar limit: Limit. The maximum permitted quota of the resource. + :vartype limit: long + :ivar unit: An enum describing the unit of quota measurement. Possible + values include: 'Count' + :vartype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'limit': {'readonly': True}, + 'unit': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'ResourceName'}, + 'limit': {'key': 'limit', 'type': 'long'}, + 'unit': {'key': 'unit', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ResourceQuota, self).__init__(**kwargs) + self.id = None + self.type = None + self.name = None + self.limit = None + self.unit = None + + +class ResourceSkuLocationInfo(Model): + """ResourceSkuLocationInfo. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar location: Location of the SKU + :vartype location: str + :ivar zones: List of availability zones where the SKU is supported. + :vartype zones: list[str] + :ivar zone_details: Details of capabilities available to a SKU in specific + zones. + :vartype zone_details: + list[~azure.mgmt.machinelearningservices.models.ResourceSkuZoneDetails] + """ + + _validation = { + 'location': {'readonly': True}, + 'zones': {'readonly': True}, + 'zone_details': {'readonly': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'zone_details': {'key': 'zoneDetails', 'type': '[ResourceSkuZoneDetails]'}, + } + + def __init__(self, **kwargs) -> None: + super(ResourceSkuLocationInfo, self).__init__(**kwargs) + self.location = None + self.zones = None + self.zone_details = None + + +class ResourceSkuZoneDetails(Model): + """Describes The zonal capabilities of a SKU. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The set of zones that the SKU is available in with the + specified capabilities. + :vartype name: list[str] + :ivar capabilities: A list of capabilities that are available for the SKU + in the specified list of zones. + :vartype capabilities: + list[~azure.mgmt.machinelearningservices.models.SKUCapability] + """ + + _validation = { + 'name': {'readonly': True}, + 'capabilities': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': '[str]'}, + 'capabilities': {'key': 'capabilities', 'type': '[SKUCapability]'}, + } + + def __init__(self, **kwargs) -> None: + super(ResourceSkuZoneDetails, self).__init__(**kwargs) + self.name = None + self.capabilities = None + + +class Restriction(Model): + """The restriction because of which SKU cannot be used. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The type of restrictions. As of now only possible value for + this is location. + :vartype type: str + :ivar values: The value of restrictions. If the restriction type is set to + location. This would be different locations where the SKU is restricted. + :vartype values: list[str] + :param reason_code: The reason for the restriction. Possible values + include: 'NotSpecified', 'NotAvailableForRegion', + 'NotAvailableForSubscription' + :type reason_code: str or + ~azure.mgmt.machinelearningservices.models.ReasonCode + """ + + _validation = { + 'type': {'readonly': True}, + 'values': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + 'reason_code': {'key': 'reasonCode', 'type': 'str'}, + } + + def __init__(self, *, reason_code=None, **kwargs) -> None: + super(Restriction, self).__init__(**kwargs) + self.type = None + self.values = None + self.reason_code = reason_code + + class ScaleSettings(Model): """scale settings for AML Compute. @@ -1445,6 +2050,82 @@ def __init__(self, *, client_id: str, client_secret: str, **kwargs) -> None: self.client_secret = client_secret +class SharedPrivateLinkResource(Model): + """SharedPrivateLinkResource. + + :param name: Unique name of the private link. + :type name: str + :param private_link_resource_id: The resource id that private link links + to. + :type private_link_resource_id: str + :param group_id: The private link resource group id. + :type group_id: str + :param request_message: Request message. + :type request_message: str + :param status: Indicates whether the connection has been + Approved/Rejected/Removed by the owner of the service. Possible values + include: 'Pending', 'Approved', 'Rejected', 'Disconnected', 'Timeout' + :type status: str or + ~azure.mgmt.machinelearningservices.models.PrivateEndpointServiceConnectionStatus + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'private_link_resource_id': {'key': 'properties.privateLinkResourceId', 'type': 'str'}, + 'group_id': {'key': 'properties.groupId', 'type': 'str'}, + 'request_message': {'key': 'properties.requestMessage', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, private_link_resource_id: str=None, group_id: str=None, request_message: str=None, status=None, **kwargs) -> None: + super(SharedPrivateLinkResource, self).__init__(**kwargs) + self.name = name + self.private_link_resource_id = private_link_resource_id + self.group_id = group_id + self.request_message = request_message + self.status = status + + +class Sku(Model): + """Sku of the resource. + + :param name: Name of the sku + :type name: str + :param tier: Tier of the sku like Basic or Enterprise + :type tier: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, tier: str=None, **kwargs) -> None: + super(Sku, self).__init__(**kwargs) + self.name = name + self.tier = tier + + +class SKUCapability(Model): + """Features/user capabilities associated with the sku. + + :param name: Capability/Feature ID + :type name: str + :param value: Details about the feature/capability + :type value: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, value: str=None, **kwargs) -> None: + super(SKUCapability, self).__init__(**kwargs) + self.name = name + self.value = value + + class SslConfiguration(Model): """The ssl configuration for scoring. @@ -1507,6 +2188,83 @@ def __init__(self, **kwargs) -> None: self.version = None +class UpdateWorkspaceQuotas(Model): + """The properties for update Quota response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Specifies the resource ID. + :vartype id: str + :ivar type: Specifies the resource type. + :vartype type: str + :param limit: Limit. The maximum permitted quota of the resource. + :type limit: long + :ivar unit: An enum describing the unit of quota measurement. Possible + values include: 'Count' + :vartype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit + :param status: Update Workspace Quota Status. Status of update workspace + quota. Possible values include: 'Undefined', 'Success', 'Failure', + 'InvalidQuotaBelowClusterMinimum', 'InvalidQuotaExceedsSubscriptionLimit', + 'InvalidVMFamilyName', 'OperationNotSupportedForSku', + 'OperationNotEnabledForRegion' + :type status: str or ~azure.mgmt.machinelearningservices.models.Status + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'unit': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'limit': {'key': 'limit', 'type': 'long'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, *, limit: int=None, status=None, **kwargs) -> None: + super(UpdateWorkspaceQuotas, self).__init__(**kwargs) + self.id = None + self.type = None + self.limit = limit + self.unit = None + self.status = status + + +class UpdateWorkspaceQuotasResult(Model): + """The result of update workspace quota. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of workspace quota update result. + :vartype value: + list[~azure.mgmt.machinelearningservices.models.UpdateWorkspaceQuotas] + :ivar next_link: The URI to fetch the next page of workspace quota update + result. Call ListNext() with this to fetch the next page of Workspace + Quota update result. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[UpdateWorkspaceQuotas]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(UpdateWorkspaceQuotasResult, self).__init__(**kwargs) + self.value = None + self.next_link = None + + class Usage(Model): """Describes AML Resource Usage. @@ -1684,6 +2442,28 @@ def __init__(self, *, compute_location: str=None, description: str=None, resourc self.compute_type = 'VirtualMachine' +class VirtualMachineImage(Model): + """Virtual Machine image for Windows AML Compute. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. Virtual Machine image path + :type id: str + """ + + _validation = { + 'id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str, **kwargs) -> None: + super(VirtualMachineImage, self).__init__(**kwargs) + self.id = id + + class VirtualMachineProperties(Model): """VirtualMachineProperties. @@ -1755,6 +2535,9 @@ class VirtualMachineSize(Model): :ivar v_cp_us: Number of vPUs. The number of vCPUs supported by the virtual machine size. :vartype v_cp_us: int + :ivar gpus: Number of gPUs. The number of gPUs supported by the virtual + machine size. + :vartype gpus: int :ivar os_vhd_size_mb: OS VHD Disk size. The OS VHD disk size, in MB, allowed by the virtual machine size. :vartype os_vhd_size_mb: int @@ -1776,6 +2559,7 @@ class VirtualMachineSize(Model): 'name': {'readonly': True}, 'family': {'readonly': True}, 'v_cp_us': {'readonly': True}, + 'gpus': {'readonly': True}, 'os_vhd_size_mb': {'readonly': True}, 'max_resource_volume_mb': {'readonly': True}, 'memory_gb': {'readonly': True}, @@ -1787,6 +2571,7 @@ class VirtualMachineSize(Model): 'name': {'key': 'name', 'type': 'str'}, 'family': {'key': 'family', 'type': 'str'}, 'v_cp_us': {'key': 'vCPUs', 'type': 'int'}, + 'gpus': {'key': 'gpus', 'type': 'int'}, 'os_vhd_size_mb': {'key': 'osVhdSizeMB', 'type': 'int'}, 'max_resource_volume_mb': {'key': 'maxResourceVolumeMB', 'type': 'int'}, 'memory_gb': {'key': 'memoryGB', 'type': 'float'}, @@ -1799,6 +2584,7 @@ def __init__(self, **kwargs) -> None: self.name = None self.family = None self.v_cp_us = None + self.gpus = None self.os_vhd_size_mb = None self.max_resource_volume_mb = None self.memory_gb = None @@ -1862,14 +2648,16 @@ class Workspace(Resource): :vartype id: str :ivar name: Specifies the name of the resource. :vartype name: str - :ivar identity: The identity of the resource. - :vartype identity: ~azure.mgmt.machinelearningservices.models.Identity + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.machinelearningservices.models.Identity :param location: Specifies the location of the resource. :type location: str :ivar type: Specifies the type of the resource. :vartype type: str :param tags: Contains resource tags defined as key/value pairs. :type tags: dict[str, str] + :param sku: The sku of the workspace. + :type sku: ~azure.mgmt.machinelearningservices.models.Sku :ivar workspace_id: The immutable id associated with this workspace. :vartype workspace_id: str :param description: The description of this workspace. @@ -1903,16 +2691,43 @@ class Workspace(Resource): 'Deleting', 'Succeeded', 'Failed', 'Canceled' :vartype provisioning_state: str or ~azure.mgmt.machinelearningservices.models.ProvisioningState + :param encryption: The encryption settings of Azure ML workspace. + :type encryption: + ~azure.mgmt.machinelearningservices.models.EncryptionProperty + :param hbi_workspace: The flag to signal HBI data in the workspace and + reduce diagnostic data collected by the service. Default value: False . + :type hbi_workspace: bool + :ivar service_provisioned_resource_group: The name of the managed resource + group created by workspace RP in customer subscription if the workspace is + CMK workspace + :vartype service_provisioned_resource_group: str + :ivar private_link_count: Count of private connections in the workspace + :vartype private_link_count: int + :param image_build_compute: The compute name for image build + :type image_build_compute: str + :param allow_public_access_when_behind_vnet: The flag to indicate whether + to allow public access when behind VNet. Default value: False . + :type allow_public_access_when_behind_vnet: bool + :ivar private_endpoint_connections: The list of private endpoint + connections in the workspace. + :vartype private_endpoint_connections: + list[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection] + :param shared_private_link_resources: The list of shared private link + resources in this workspace. + :type shared_private_link_resources: + list[~azure.mgmt.machinelearningservices.models.SharedPrivateLinkResource] """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, - 'identity': {'readonly': True}, 'type': {'readonly': True}, 'workspace_id': {'readonly': True}, 'creation_time': {'readonly': True}, 'provisioning_state': {'readonly': True}, + 'service_provisioned_resource_group': {'readonly': True}, + 'private_link_count': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, } _attribute_map = { @@ -1922,6 +2737,7 @@ class Workspace(Resource): 'location': {'key': 'location', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, 'workspace_id': {'key': 'properties.workspaceId', 'type': 'str'}, 'description': {'key': 'properties.description', 'type': 'str'}, 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, @@ -1932,10 +2748,18 @@ class Workspace(Resource): 'storage_account': {'key': 'properties.storageAccount', 'type': 'str'}, 'discovery_url': {'key': 'properties.discoveryUrl', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__(self, *, location: str=None, tags=None, description: str=None, friendly_name: str=None, key_vault: str=None, application_insights: str=None, container_registry: str=None, storage_account: str=None, discovery_url: str=None, **kwargs) -> None: - super(Workspace, self).__init__(location=location, tags=tags, **kwargs) + 'encryption': {'key': 'properties.encryption', 'type': 'EncryptionProperty'}, + 'hbi_workspace': {'key': 'properties.hbiWorkspace', 'type': 'bool'}, + 'service_provisioned_resource_group': {'key': 'properties.serviceProvisionedResourceGroup', 'type': 'str'}, + 'private_link_count': {'key': 'properties.privateLinkCount', 'type': 'int'}, + 'image_build_compute': {'key': 'properties.imageBuildCompute', 'type': 'str'}, + 'allow_public_access_when_behind_vnet': {'key': 'properties.allowPublicAccessWhenBehindVnet', 'type': 'bool'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, + 'shared_private_link_resources': {'key': 'properties.sharedPrivateLinkResources', 'type': '[SharedPrivateLinkResource]'}, + } + + def __init__(self, *, identity=None, location: str=None, tags=None, sku=None, description: str=None, friendly_name: str=None, key_vault: str=None, application_insights: str=None, container_registry: str=None, storage_account: str=None, discovery_url: str=None, encryption=None, hbi_workspace: bool=False, image_build_compute: str=None, allow_public_access_when_behind_vnet: bool=False, shared_private_link_resources=None, **kwargs) -> None: + super(Workspace, self).__init__(identity=identity, location=location, tags=tags, sku=sku, **kwargs) self.workspace_id = None self.description = description self.friendly_name = friendly_name @@ -1946,6 +2770,74 @@ def __init__(self, *, location: str=None, tags=None, description: str=None, frie self.storage_account = storage_account self.discovery_url = discovery_url self.provisioning_state = None + self.encryption = encryption + self.hbi_workspace = hbi_workspace + self.service_provisioned_resource_group = None + self.private_link_count = None + self.image_build_compute = image_build_compute + self.allow_public_access_when_behind_vnet = allow_public_access_when_behind_vnet + self.private_endpoint_connections = None + self.shared_private_link_resources = shared_private_link_resources + + +class WorkspaceSku(Model): + """Describes Workspace Sku details and features. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar locations: The set of locations that the SKU is available. This will + be supported and registered Azure Geo Regions (e.g. West US, East US, + Southeast Asia, etc.). + :vartype locations: list[str] + :ivar location_info: A list of locations and availability zones in those + locations where the SKU is available. + :vartype location_info: + list[~azure.mgmt.machinelearningservices.models.ResourceSkuLocationInfo] + :ivar tier: Sku Tier like Basic or Enterprise + :vartype tier: str + :ivar resource_type: + :vartype resource_type: str + :ivar name: + :vartype name: str + :ivar capabilities: List of features/user capabilities associated with the + sku + :vartype capabilities: + list[~azure.mgmt.machinelearningservices.models.SKUCapability] + :param restrictions: The restrictions because of which SKU cannot be used. + This is empty if there are no restrictions. + :type restrictions: + list[~azure.mgmt.machinelearningservices.models.Restriction] + """ + + _validation = { + 'locations': {'readonly': True}, + 'location_info': {'readonly': True}, + 'tier': {'readonly': True}, + 'resource_type': {'readonly': True}, + 'name': {'readonly': True}, + 'capabilities': {'readonly': True}, + } + + _attribute_map = { + 'locations': {'key': 'locations', 'type': '[str]'}, + 'location_info': {'key': 'locationInfo', 'type': '[ResourceSkuLocationInfo]'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'capabilities': {'key': 'capabilities', 'type': '[SKUCapability]'}, + 'restrictions': {'key': 'restrictions', 'type': '[Restriction]'}, + } + + def __init__(self, *, restrictions=None, **kwargs) -> None: + super(WorkspaceSku, self).__init__(**kwargs) + self.locations = None + self.location_info = None + self.tier = None + self.resource_type = None + self.name = None + self.capabilities = None + self.restrictions = restrictions class WorkspaceUpdateParameters(Model): @@ -1953,6 +2845,8 @@ class WorkspaceUpdateParameters(Model): :param tags: The resource tags for the machine learning workspace. :type tags: dict[str, str] + :param sku: The sku of the workspace. + :type sku: ~azure.mgmt.machinelearningservices.models.Sku :param description: The description of this workspace. :type description: str :param friendly_name: The friendly name for this workspace. @@ -1961,12 +2855,14 @@ class WorkspaceUpdateParameters(Model): _attribute_map = { 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, 'description': {'key': 'properties.description', 'type': 'str'}, 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, } - def __init__(self, *, tags=None, description: str=None, friendly_name: str=None, **kwargs) -> None: + def __init__(self, *, tags=None, sku=None, description: str=None, friendly_name: str=None, **kwargs) -> None: super(WorkspaceUpdateParameters, self).__init__(**kwargs) self.tags = tags + self.sku = sku self.description = description self.friendly_name = friendly_name diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/models/_paged_models.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/models/_paged_models.py index 9bc3567bbf90..4d33e2dc943a 100644 --- a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/models/_paged_models.py +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/models/_paged_models.py @@ -38,6 +38,19 @@ class WorkspacePaged(Paged): def __init__(self, *args, **kwargs): super(WorkspacePaged, self).__init__(*args, **kwargs) +class AmlUserFeaturePaged(Paged): + """ + A paging container for iterating over a list of :class:`AmlUserFeature ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[AmlUserFeature]'} + } + + def __init__(self, *args, **kwargs): + + super(AmlUserFeaturePaged, self).__init__(*args, **kwargs) class UsagePaged(Paged): """ A paging container for iterating over a list of :class:`Usage ` object @@ -51,6 +64,19 @@ class UsagePaged(Paged): def __init__(self, *args, **kwargs): super(UsagePaged, self).__init__(*args, **kwargs) +class ResourceQuotaPaged(Paged): + """ + A paging container for iterating over a list of :class:`ResourceQuota ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ResourceQuota]'} + } + + def __init__(self, *args, **kwargs): + + super(ResourceQuotaPaged, self).__init__(*args, **kwargs) class ComputeResourcePaged(Paged): """ A paging container for iterating over a list of :class:`ComputeResource ` object @@ -64,3 +90,16 @@ class ComputeResourcePaged(Paged): def __init__(self, *args, **kwargs): super(ComputeResourcePaged, self).__init__(*args, **kwargs) +class WorkspaceSkuPaged(Paged): + """ + A paging container for iterating over a list of :class:`WorkspaceSku ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[WorkspaceSku]'} + } + + def __init__(self, *args, **kwargs): + + super(WorkspaceSkuPaged, self).__init__(*args, **kwargs) diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/__init__.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/__init__.py index 4daae17a67dd..dd4e436e6df1 100644 --- a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/__init__.py +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/__init__.py @@ -11,14 +11,24 @@ from ._operations import Operations from ._workspaces_operations import WorkspacesOperations +from ._workspace_features_operations import WorkspaceFeaturesOperations from ._usages_operations import UsagesOperations from ._virtual_machine_sizes_operations import VirtualMachineSizesOperations +from ._quotas_operations import QuotasOperations from ._machine_learning_compute_operations import MachineLearningComputeOperations +from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations +from ._private_link_resources_operations import PrivateLinkResourcesOperations +from ._azure_machine_learning_workspaces_operations import AzureMachineLearningWorkspacesOperationsMixin __all__ = [ 'Operations', 'WorkspacesOperations', + 'WorkspaceFeaturesOperations', 'UsagesOperations', 'VirtualMachineSizesOperations', + 'QuotasOperations', 'MachineLearningComputeOperations', + 'PrivateEndpointConnectionsOperations', + 'PrivateLinkResourcesOperations', + 'AzureMachineLearningWorkspacesOperationsMixin', ] diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_azure_machine_learning_workspaces_operations.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_azure_machine_learning_workspaces_operations.py new file mode 100644 index 000000000000..63f1cc36b32d --- /dev/null +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_azure_machine_learning_workspaces_operations.py @@ -0,0 +1,85 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling +from .. import models +import uuid + + +class AzureMachineLearningWorkspacesOperationsMixin(object): + + def list_skus( + self, custom_headers=None, raw=False, **operation_config): + """Lists all skus with associated features. + + :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 WorkspaceSku + :rtype: + ~azure.mgmt.machinelearningservices.models.WorkspaceSkuPaged[~azure.mgmt.machinelearningservices.models.WorkspaceSku] + :raises: + :class:`MachineLearningServiceErrorException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_skus.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) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.MachineLearningServiceErrorException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.WorkspaceSkuPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_skus.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces/skus'} diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_machine_learning_compute_operations.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_machine_learning_compute_operations.py index 203b86e19b28..7dec3bfee5a9 100644 --- a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_machine_learning_compute_operations.py +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_machine_learning_compute_operations.py @@ -26,7 +26,7 @@ class MachineLearningComputeOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of Azure Machine Learning resource provider API. Constant value: "2019-05-01". + :ivar api_version: Version of Azure Machine Learning resource provider API. Constant value: "2020-05-15-preview". """ models = models @@ -36,7 +36,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-05-01" + self.api_version = "2020-05-15-preview" self.config = config diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_operations.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_operations.py index 7b558ec9d645..227d66c53b26 100644 --- a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_operations.py +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_operations.py @@ -24,7 +24,7 @@ class Operations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of Azure Machine Learning resource provider API. Constant value: "2019-05-01". + :ivar api_version: Version of Azure Machine Learning resource provider API. Constant value: "2020-05-15-preview". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-05-01" + self.api_version = "2020-05-15-preview" self.config = config diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_private_endpoint_connections_operations.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_private_endpoint_connections_operations.py new file mode 100644 index 000000000000..2b942e82b7d2 --- /dev/null +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_private_endpoint_connections_operations.py @@ -0,0 +1,238 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# 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 PrivateEndpointConnectionsOperations(object): + """PrivateEndpointConnectionsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of Azure Machine Learning resource provider API. Constant value: "2020-05-15-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-05-15-preview" + + self.config = config + + def get( + self, resource_group_name, workspace_name, private_endpoint_connection_name, custom_headers=None, raw=False, **operation_config): + """Gets the specified private endpoint connection associated with the + workspace. + + :param resource_group_name: Name of the resource group in which + workspace is located. + :type resource_group_name: str + :param workspace_name: Name of Azure Machine Learning workspace. + :type workspace_name: str + :param private_endpoint_connection_name: The name of the private + endpoint connection associated with the workspace + :type private_endpoint_connection_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PrivateEndpointConnection or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['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('PrivateEndpointConnection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}'} + + def put( + self, resource_group_name, workspace_name, private_endpoint_connection_name, properties, custom_headers=None, raw=False, **operation_config): + """Update the state of specified private endpoint connection associated + with the workspace. + + :param resource_group_name: Name of the resource group in which + workspace is located. + :type resource_group_name: str + :param workspace_name: Name of Azure Machine Learning workspace. + :type workspace_name: str + :param private_endpoint_connection_name: The name of the private + endpoint connection associated with the workspace + :type private_endpoint_connection_name: str + :param properties: The private endpoint connection properties. + :type properties: + ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection + :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: PrivateEndpointConnection or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.put.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'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['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(properties, 'PrivateEndpointConnection') + + # 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]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PrivateEndpointConnection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + put.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}'} + + def delete( + self, resource_group_name, workspace_name, private_endpoint_connection_name, custom_headers=None, raw=False, **operation_config): + """Deletes the specified private endpoint connection associated with the + workspace. + + :param resource_group_name: Name of the resource group in which + workspace is located. + :type resource_group_name: str + :param workspace_name: Name of Azure Machine Learning workspace. + :type workspace_name: str + :param private_endpoint_connection_name: The name of the private + endpoint connection associated with the workspace + :type private_endpoint_connection_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if 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, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}'} diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_private_link_resources_operations.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_private_link_resources_operations.py new file mode 100644 index 000000000000..d5ebed7c42df --- /dev/null +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_private_link_resources_operations.py @@ -0,0 +1,105 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# 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 PrivateLinkResourcesOperations(object): + """PrivateLinkResourcesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of Azure Machine Learning resource provider API. Constant value: "2020-05-15-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-05-15-preview" + + self.config = config + + def list_by_workspace( + self, resource_group_name, workspace_name, custom_headers=None, raw=False, **operation_config): + """Gets the private link resources that need to be created for a + workspace. + + :param resource_group_name: Name of the resource group in which + workspace is located. + :type resource_group_name: str + :param workspace_name: Name of Azure Machine Learning workspace. + :type workspace_name: 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: PrivateLinkResourceListResult or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.machinelearningservices.models.PrivateLinkResourceListResult + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_by_workspace.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'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PrivateLinkResourceListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_workspace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateLinkResources'} diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_quotas_operations.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_quotas_operations.py new file mode 100644 index 000000000000..ebef2745d1f4 --- /dev/null +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_quotas_operations.py @@ -0,0 +1,176 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class QuotasOperations(object): + """QuotasOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of Azure Machine Learning resource provider API. Constant value: "2020-05-15-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-05-15-preview" + + self.config = config + + def update( + self, location, value=None, custom_headers=None, raw=False, **operation_config): + """Update quota for each VM family in workspace. + + :param location: The location for update quota is queried. + :type location: str + :param value: The list for update quota. + :type value: + list[~azure.mgmt.machinelearningservices.models.QuotaBaseProperties] + :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: UpdateWorkspaceQuotasResult or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.machinelearningservices.models.UpdateWorkspaceQuotasResult + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`MachineLearningServiceErrorException` + """ + parameters = models.QuotaUpdateParameters(value=value) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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, 'QuotaUpdateParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.MachineLearningServiceErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('UpdateWorkspaceQuotasResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas'} + + def list( + self, location, custom_headers=None, raw=False, **operation_config): + """Gets the currently assigned Workspace Quotas based on VMFamily. + + :param location: The location for which resource usage is queried. + :type location: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ResourceQuota + :rtype: + ~azure.mgmt.machinelearningservices.models.ResourceQuotaPaged[~azure.mgmt.machinelearningservices.models.ResourceQuota] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$') + } + url = self._client.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) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.ResourceQuotaPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/Quotas'} diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_usages_operations.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_usages_operations.py index 212fbc700f27..6000d530ac16 100644 --- a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_usages_operations.py +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_usages_operations.py @@ -25,7 +25,7 @@ class UsagesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of Azure Machine Learning resource provider API. Constant value: "2019-05-01". + :ivar api_version: Version of Azure Machine Learning resource provider API. Constant value: "2020-05-15-preview". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-05-01" + self.api_version = "2020-05-15-preview" self.config = config diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_virtual_machine_sizes_operations.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_virtual_machine_sizes_operations.py index afbf3b4fc0b4..18a9cded2ba8 100644 --- a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_virtual_machine_sizes_operations.py +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_virtual_machine_sizes_operations.py @@ -25,7 +25,7 @@ class VirtualMachineSizesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of Azure Machine Learning resource provider API. Constant value: "2019-05-01". + :ivar api_version: Version of Azure Machine Learning resource provider API. Constant value: "2020-05-15-preview". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-05-01" + self.api_version = "2020-05-15-preview" self.config = config diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_workspace_features_operations.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_workspace_features_operations.py new file mode 100644 index 000000000000..3cb9cdb450c2 --- /dev/null +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_workspace_features_operations.py @@ -0,0 +1,111 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class WorkspaceFeaturesOperations(object): + """WorkspaceFeaturesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of Azure Machine Learning resource provider API. Constant value: "2020-05-15-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-05-15-preview" + + self.config = config + + def list( + self, resource_group_name, workspace_name, custom_headers=None, raw=False, **operation_config): + """Lists all enabled features for a workspace. + + :param resource_group_name: Name of the resource group in which + workspace is located. + :type resource_group_name: str + :param workspace_name: Name of Azure Machine Learning workspace. + :type workspace_name: 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 AmlUserFeature + :rtype: + ~azure.mgmt.machinelearningservices.models.AmlUserFeaturePaged[~azure.mgmt.machinelearningservices.models.AmlUserFeature] + :raises: + :class:`MachineLearningServiceErrorException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_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) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.MachineLearningServiceErrorException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.AmlUserFeaturePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features'} diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_workspaces_operations.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_workspaces_operations.py index 27bff19114d8..b14f1fb83aae 100644 --- a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_workspaces_operations.py +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_workspaces_operations.py @@ -11,6 +11,8 @@ import uuid from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +26,7 @@ class WorkspacesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of Azure Machine Learning resource provider API. Constant value: "2019-05-01". + :ivar api_version: Version of Azure Machine Learning resource provider API. Constant value: "2020-05-15-preview". """ models = models @@ -34,7 +36,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-05-01" + self.api_version = "2020-05-15-preview" self.config = config @@ -99,29 +101,9 @@ def get( return deserialized get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} - def create_or_update( - self, resource_group_name, workspace_name, parameters, custom_headers=None, raw=False, **operation_config): - """Creates or updates a workspace with the specified parameters. - :param resource_group_name: Name of the resource group in which - workspace is located. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param parameters: The parameters for creating or updating a machine - learning workspace. - :type parameters: ~azure.mgmt.machinelearningservices.models.Workspace - :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: Workspace or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.machinelearningservices.models.Workspace or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`MachineLearningServiceErrorException` - """ + def _create_or_update_initial( + self, resource_group_name, workspace_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL url = self.create_or_update.metadata['url'] path_format_arguments = { @@ -153,10 +135,11 @@ def create_or_update( request = self._client.put(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200, 201]: + if response.status_code not in [200, 201, 202]: raise models.MachineLearningServiceErrorException(self._deserialize, response) deserialized = None + if response.status_code == 200: deserialized = self._deserialize('Workspace', response) if response.status_code == 201: @@ -167,6 +150,58 @@ def create_or_update( return client_raw_response return deserialized + + def create_or_update( + self, resource_group_name, workspace_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates or updates a workspace with the specified parameters. + + :param resource_group_name: Name of the resource group in which + workspace is located. + :type resource_group_name: str + :param workspace_name: Name of Azure Machine Learning workspace. + :type workspace_name: str + :param parameters: The parameters for creating or updating a machine + learning workspace. + :type parameters: ~azure.mgmt.machinelearningservices.models.Workspace + :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 Workspace or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.machinelearningservices.models.Workspace] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.machinelearningservices.models.Workspace]] + :raises: + :class:`MachineLearningServiceErrorException` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + workspace_name=workspace_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Workspace', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} def delete( diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/setup.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/setup.py index a30c32487f73..5dbc4fd594cd 100644 --- a/sdk/machinelearning/azure-mgmt-machinelearningservices/setup.py +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/setup.py @@ -36,7 +36,9 @@ pass # Version extraction inspired from 'requests' -with open(os.path.join(package_folder_path, 'version.py'), 'r') as fd: +with open(os.path.join(package_folder_path, 'version.py') + if os.path.exists(os.path.join(package_folder_path, 'version.py')) + else os.path.join(package_folder_path, '_version.py'), 'r') as fd: version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1) @@ -67,6 +69,7 @@ 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', 'License :: OSI Approved :: MIT License', ], zip_safe=False, diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_models.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_models.py index 692178449da8..1b1bf19b29b8 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_models.py +++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_models.py @@ -63,15 +63,15 @@ class DetectedLanguage(DictMixin): """DetectedLanguage contains the predicted language found in text, its confidence score, and ISO 639-1 representation. - :param name: Long name of a detected language (e.g. English, + :ivar name: Long name of a detected language (e.g. English, French). - :type name: str - :param iso6391_name: A two letter representation of the detected + :vartype name: str + :ivar iso6391_name: A two letter representation of the detected language according to the ISO 639-1 standard (e.g. en, fr). - :type iso6391_name: str - :param confidence_score: A confidence score between 0 and 1. Scores close + :vartype iso6391_name: str + :ivar confidence_score: A confidence score between 0 and 1. Scores close to 1 indicate 100% certainty that the identified language is true. - :type confidence_score: float + :vartype confidence_score: float """ def __init__(self, **kwargs): @@ -94,21 +94,21 @@ class RecognizeEntitiesResult(DictMixin): """RecognizeEntitiesResult is a result object which contains the recognized entities from a particular document. - :param id: Unique, non-empty document identifier that matches the + :ivar id: Unique, non-empty document identifier that matches the document id that was passed in with the request. If not specified in the request, an id is assigned for the document. - :type id: str - :param entities: Recognized entities in the document. - :type entities: + :vartype id: str + :ivar entities: Recognized entities in the document. + :vartype entities: list[~azure.ai.textanalytics.CategorizedEntity] - :param warnings: Warnings encountered while processing document. Results will still be returned + :ivar warnings: Warnings encountered while processing document. Results will still be returned if there are warnings, but they may not be fully accurate. - :type warnings: list[~azure.ai.textanalytics.TextAnalyticsWarning] - :param statistics: If show_stats=true was specified in the request this + :vartype warnings: list[~azure.ai.textanalytics.TextAnalyticsWarning] + :ivar statistics: If show_stats=true was specified in the request this field will contain information about the document payload. - :type statistics: + :vartype statistics: ~azure.ai.textanalytics.TextDocumentStatistics - :param bool is_error: Boolean check for error item when iterating over list of + :ivar bool is_error: Boolean check for error item when iterating over list of results. Always False for an instance of a RecognizeEntitiesResult. """ @@ -128,20 +128,20 @@ class DetectLanguageResult(DictMixin): """DetectLanguageResult is a result object which contains the detected language of a particular document. - :param id: Unique, non-empty document identifier that matches the + :ivar id: Unique, non-empty document identifier that matches the document id that was passed in with the request. If not specified in the request, an id is assigned for the document. - :type id: str - :param primary_language: The primary language detected in the document. - :type primary_language: ~azure.ai.textanalytics.DetectedLanguage - :param warnings: Warnings encountered while processing document. Results will still be returned + :vartype id: str + :ivar primary_language: The primary language detected in the document. + :vartype primary_language: ~azure.ai.textanalytics.DetectedLanguage + :ivar warnings: Warnings encountered while processing document. Results will still be returned if there are warnings, but they may not be fully accurate. - :type warnings: list[~azure.ai.textanalytics.TextAnalyticsWarning] - :param statistics: If show_stats=true was specified in the request this + :vartype warnings: list[~azure.ai.textanalytics.TextAnalyticsWarning] + :ivar statistics: If show_stats=true was specified in the request this field will contain information about the document payload. - :type statistics: + :vartype statistics: ~azure.ai.textanalytics.TextDocumentStatistics - :param bool is_error: Boolean check for error item when iterating over list of + :ivar bool is_error: Boolean check for error item when iterating over list of results. Always False for an instance of a DetectLanguageResult. """ @@ -162,15 +162,15 @@ class CategorizedEntity(DictMixin): """CategorizedEntity contains information about a particular entity found in text. - :param text: Entity text as appears in the request. - :type text: str - :param category: Entity category, such as Person/Location/Org/SSN etc - :type category: str - :param subcategory: Entity subcategory, such as Age/Year/TimeRange etc - :type subcategory: str - :param confidence_score: Confidence score between 0 and 1 of the extracted + :ivar text: Entity text as appears in the request. + :vartype text: str + :ivar category: Entity category, such as Person/Location/Org/SSN etc + :vartype category: str + :ivar subcategory: Entity subcategory, such as Age/Year/TimeRange etc + :vartype subcategory: str + :ivar confidence_score: Confidence score between 0 and 1 of the extracted entity. - :type confidence_score: float + :vartype confidence_score: float """ def __init__(self, **kwargs): @@ -199,16 +199,16 @@ class TextAnalyticsError(DictMixin): other details that explain why the batch or individual document failed to be processed by the service. - :param code: Error code. Possible values include: + :ivar code: Error code. Possible values include: 'invalidRequest', 'invalidArgument', 'internalServerError', 'serviceUnavailable', 'invalidParameterValue', 'invalidRequestBodyFormat', 'emptyRequest', 'missingInputRecords', 'invalidDocument', 'modelVersionIncorrect', 'invalidDocumentBatch', 'unsupportedLanguageCode', 'invalidCountryHint' - :type code: str - :param message: Error message. - :type message: str - :param target: Error target. - :type target: str + :vartype code: str + :ivar message: Error message. + :vartype message: str + :ivar target: Error target. + :vartype target: str """ def __init__(self, **kwargs): @@ -238,11 +238,11 @@ class TextAnalyticsWarning(DictMixin): """TextAnalyticsWarning contains the warning code and message that explains why the response has a warning. - :param code: Warning code. Possible values include: 'LongWordsInDocument', + :ivar code: Warning code. Possible values include: 'LongWordsInDocument', 'DocumentTruncated'. - :type code: str - :param message: Warning message. - :type message: str + :vartype code: str + :ivar message: Warning message. + :vartype message: str """ def __init__(self, **kwargs): @@ -265,22 +265,22 @@ class ExtractKeyPhrasesResult(DictMixin): """ExtractKeyPhrasesResult is a result object which contains the key phrases found in a particular document. - :param id: Unique, non-empty document identifier that matches the + :ivar id: Unique, non-empty document identifier that matches the document id that was passed in with the request. If not specified in the request, an id is assigned for the document. - :type id: str - :param key_phrases: A list of representative words or phrases. + :vartype id: str + :ivar key_phrases: A list of representative words or phrases. The number of key phrases returned is proportional to the number of words in the input document. - :type key_phrases: list[str] - :param warnings: Warnings encountered while processing document. Results will still be returned + :vartype key_phrases: list[str] + :ivar warnings: Warnings encountered while processing document. Results will still be returned if there are warnings, but they may not be fully accurate. - :type warnings: list[~azure.ai.textanalytics.TextAnalyticsWarning] - :param statistics: If show_stats=true was specified in the request this + :vartype warnings: list[~azure.ai.textanalytics.TextAnalyticsWarning] + :ivar statistics: If show_stats=true was specified in the request this field will contain information about the document payload. - :type statistics: + :vartype statistics: ~azure.ai.textanalytics.TextDocumentStatistics - :param bool is_error: Boolean check for error item when iterating over list of + :ivar bool is_error: Boolean check for error item when iterating over list of results. Always False for an instance of a ExtractKeyPhrasesResult. """ @@ -300,21 +300,21 @@ class RecognizeLinkedEntitiesResult(DictMixin): """RecognizeLinkedEntitiesResult is a result object which contains links to a well-known knowledge base, like for example, Wikipedia or Bing. - :param id: Unique, non-empty document identifier that matches the + :ivar id: Unique, non-empty document identifier that matches the document id that was passed in with the request. If not specified in the request, an id is assigned for the document. - :type id: str - :param entities: Recognized well-known entities in the document. - :type entities: + :vartype id: str + :ivar entities: Recognized well-known entities in the document. + :vartype entities: list[~azure.ai.textanalytics.LinkedEntity] - :param warnings: Warnings encountered while processing document. Results will still be returned + :ivar warnings: Warnings encountered while processing document. Results will still be returned if there are warnings, but they may not be fully accurate. - :type warnings: list[~azure.ai.textanalytics.TextAnalyticsWarning] - :param statistics: If show_stats=true was specified in the request this + :vartype warnings: list[~azure.ai.textanalytics.TextAnalyticsWarning] + :ivar statistics: If show_stats=true was specified in the request this field will contain information about the document payload. - :type statistics: + :vartype statistics: ~azure.ai.textanalytics.TextDocumentStatistics - :param bool is_error: Boolean check for error item when iterating over list of + :ivar bool is_error: Boolean check for error item when iterating over list of results. Always False for an instance of a RecognizeLinkedEntitiesResult. """ @@ -335,29 +335,29 @@ class AnalyzeSentimentResult(DictMixin): the overall predicted sentiment and confidence scores for your document and a per-sentence sentiment prediction with scores. - :param id: Unique, non-empty document identifier that matches the + :ivar id: Unique, non-empty document identifier that matches the document id that was passed in with the request. If not specified in the request, an id is assigned for the document. - :type id: str - :param sentiment: Predicted sentiment for document (Negative, + :vartype id: str + :ivar sentiment: Predicted sentiment for document (Negative, Neutral, Positive, or Mixed). Possible values include: 'positive', 'neutral', 'negative', 'mixed' - :type sentiment: str - :param warnings: Warnings encountered while processing document. Results will still be returned + :vartype sentiment: str + :ivar warnings: Warnings encountered while processing document. Results will still be returned if there are warnings, but they may not be fully accurate. - :type warnings: list[~azure.ai.textanalytics.TextAnalyticsWarning] - :param statistics: If show_stats=true was specified in the request this + :vartype warnings: list[~azure.ai.textanalytics.TextAnalyticsWarning] + :ivar statistics: If show_stats=true was specified in the request this field will contain information about the document payload. - :type statistics: + :vartype statistics: ~azure.ai.textanalytics.TextDocumentStatistics - :param confidence_scores: Document level sentiment confidence + :ivar confidence_scores: Document level sentiment confidence scores between 0 and 1 for each sentiment label. - :type confidence_scores: + :vartype confidence_scores: ~azure.ai.textanalytics.SentimentConfidenceScores - :param sentences: Sentence level sentiment analysis. - :type sentences: + :ivar sentences: Sentence level sentiment analysis. + :vartype sentences: list[~azure.ai.textanalytics.SentenceSentiment] - :param bool is_error: Boolean check for error item when iterating over list of + :ivar bool is_error: Boolean check for error item when iterating over list of results. Always False for an instance of a AnalyzeSentimentResult. """ @@ -381,12 +381,12 @@ class TextDocumentStatistics(DictMixin): """TextDocumentStatistics contains information about the document payload. - :param character_count: Number of text elements recognized in + :ivar character_count: Number of text elements recognized in the document. - :type character_count: int - :param transaction_count: Number of transactions for the + :vartype character_count: int + :ivar transaction_count: Number of transactions for the document. - :type transaction_count: int + :vartype transaction_count: int """ def __init__(self, **kwargs): @@ -411,13 +411,13 @@ class DocumentError(DictMixin): """DocumentError is an error object which represents an error on the individual document. - :param id: Unique, non-empty document identifier that matches the + :ivar id: Unique, non-empty document identifier that matches the document id that was passed in with the request. If not specified in the request, an id is assigned for the document. - :type id: str - :param error: The document error. - :type error: ~azure.ai.textanalytics.TextAnalyticsError - :param bool is_error: Boolean check for error item when iterating over list of + :vartype id: str + :ivar error: The document error. + :vartype error: ~azure.ai.textanalytics.TextAnalyticsError + :ivar bool is_error: Boolean check for error item when iterating over list of results. Always True for an instance of a DocumentError. """ @@ -458,15 +458,15 @@ def __repr__(self): class DetectLanguageInput(LanguageInput): """The input document to be analyzed for detecting language. - :param id: Required. Unique, non-empty document identifier. - :type id: str - :param text: Required. The input text to process. - :type text: str - :param country_hint: A country hint to help better detect + :ivar id: Required. Unique, non-empty document identifier. + :vartype id: str + :ivar text: Required. The input text to process. + :vartype text: str + :ivar country_hint: A country hint to help better detect the language of the text. Accepts two letter country codes specified by ISO 3166-1 alpha-2. Defaults to "US". Pass in the string "none" to not use a country_hint. - :type country_hint: str + :vartype country_hint: str """ def __init__(self, **kwargs): @@ -486,21 +486,21 @@ class LinkedEntity(DictMixin): or Bing. It additionally includes all of the matches of this entity found in the document. - :param name: Entity Linking formal name. - :type name: str - :param matches: List of instances this entity appears in the text. - :type matches: + :ivar name: Entity Linking formal name. + :vartype name: str + :ivar matches: List of instances this entity appears in the text. + :vartype matches: list[~azure.ai.textanalytics.LinkedEntityMatch] - :param language: Language used in the data source. - :type language: str - :param data_source_entity_id: Unique identifier of the recognized entity from the data + :ivar language: Language used in the data source. + :vartype language: str + :ivar data_source_entity_id: Unique identifier of the recognized entity from the data source. - :type data_source_entity_id: str - :param url: URL to the entity's page from the data source. - :type url: str - :param data_source: Data source used to extract entity linking, + :vartype data_source_entity_id: str + :ivar url: URL to the entity's page from the data source. + :vartype url: str + :ivar data_source: Data source used to extract entity linking, such as Wiki/Bing etc. - :type data_source: str + :vartype data_source: str """ def __init__(self, **kwargs): @@ -533,12 +533,12 @@ class LinkedEntityMatch(DictMixin): the confidence score of the prediction and where the entity was found in the text. - :param confidence_score: If a well-known item is recognized, a + :ivar confidence_score: If a well-known item is recognized, a decimal number denoting the confidence level between 0 and 1 will be returned. - :type confidence_score: float - :param text: Entity text as appears in the request. - :type text: str + :vartype confidence_score: float + :ivar text: Entity text as appears in the request. + :vartype text: str """ def __init__(self, **kwargs): @@ -561,14 +561,14 @@ def __repr__(self): class TextDocumentInput(MultiLanguageInput): """The input document to be analyzed by the service. - :param id: Required. A unique, non-empty document identifier. - :type id: str - :param text: Required. The input text to process. - :type text: str - :param language: This is the 2 letter ISO 639-1 representation + :ivar id: Required. A unique, non-empty document identifier. + :vartype id: str + :ivar text: Required. The input text to process. + :vartype text: str + :ivar language: This is the 2 letter ISO 639-1 representation of a language. For example, use "en" for English; "es" for Spanish etc. If not set, uses "en" for English as default. - :type language: str + :vartype language: str """ def __init__(self, **kwargs): @@ -587,16 +587,16 @@ class TextDocumentBatchStatistics(DictMixin): request payload. Note: This object is not returned in the response and needs to be retrieved by a response hook. - :param document_count: Number of documents submitted in the request. - :type document_count: int - :param valid_document_count: Number of valid documents. This + :ivar document_count: Number of documents submitted in the request. + :vartype document_count: int + :ivar valid_document_count: Number of valid documents. This excludes empty, over-size limit or non-supported languages documents. - :type valid_document_count: int - :param erroneous_document_count: Number of invalid documents. + :vartype valid_document_count: int + :ivar erroneous_document_count: Number of invalid documents. This includes empty, over-size limit or non-supported languages documents. - :type erroneous_document_count: int - :param transaction_count: Number of transactions for the request. - :type transaction_count: long + :vartype erroneous_document_count: int + :ivar transaction_count: Number of transactions for the request. + :vartype transaction_count: long """ def __init__(self, **kwargs): @@ -626,14 +626,14 @@ class SentenceSentiment(DictMixin): """SentenceSentiment contains the predicted sentiment and confidence scores for each individual sentence in the document. - :param text: The sentence text. - :type text: str - :param sentiment: The predicted Sentiment for the sentence. + :ivar text: The sentence text. + :vartype text: str + :ivar sentiment: The predicted Sentiment for the sentence. Possible values include: 'positive', 'neutral', 'negative' - :type sentiment: str - :param confidence_scores: The sentiment confidence score between 0 + :vartype sentiment: str + :ivar confidence_scores: The sentiment confidence score between 0 and 1 for the sentence for all labels. - :type confidence_scores: + :vartype confidence_scores: ~azure.ai.textanalytics.SentimentConfidenceScores """ @@ -662,12 +662,12 @@ class SentimentConfidenceScores(DictMixin): """The confidence scores (Softmax scores) between 0 and 1. Higher values indicate higher confidence. - :param positive: Positive score. - :type positive: float - :param neutral: Neutral score. - :type neutral: float - :param negative: Negative score. - :type negative: float + :ivar positive: Positive score. + :vartype positive: float + :ivar neutral: Neutral score. + :vartype neutral: float + :ivar negative: Negative score. + :vartype negative: float """ def __init__(self, **kwargs): diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/test_analyze_sentiment.py b/sdk/textanalytics/azure-ai-textanalytics/tests/test_analyze_sentiment.py index 8d4f601134a7..e2f199c4777c 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/tests/test_analyze_sentiment.py +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/test_analyze_sentiment.py @@ -217,7 +217,8 @@ def test_out_of_order_ids(self, client): @TextAnalyticsClientPreparer() def test_show_stats_and_model_version(self, client): def callback(response): - self.assertIsNotNone(response.model_version) + self.assertIsNotNone(response) + self.assertIsNotNone(response.model_version, msg=response.raw_response) self.assertIsNotNone(response.raw_response) self.assertEqual(response.statistics.document_count, 5) self.assertEqual(response.statistics.transaction_count, 4) diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/test_analyze_sentiment_async.py b/sdk/textanalytics/azure-ai-textanalytics/tests/test_analyze_sentiment_async.py index 8e8b9c12f74d..d622ac552b4d 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/tests/test_analyze_sentiment_async.py +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/test_analyze_sentiment_async.py @@ -220,7 +220,8 @@ async def test_out_of_order_ids(self, client): @TextAnalyticsClientPreparer() async def test_show_stats_and_model_version(self, client): def callback(response): - self.assertIsNotNone(response.model_version) + self.assertIsNotNone(response) + self.assertIsNotNone(response.model_version, msg=response.raw_response) self.assertIsNotNone(response.raw_response) self.assertEqual(response.statistics.document_count, 5) self.assertEqual(response.statistics.transaction_count, 4) diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/test_detect_language.py b/sdk/textanalytics/azure-ai-textanalytics/tests/test_detect_language.py index d6efe1735f3c..31b9dcd654c7 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/tests/test_detect_language.py +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/test_detect_language.py @@ -210,7 +210,8 @@ def test_out_of_order_ids(self, client): @TextAnalyticsClientPreparer() def test_show_stats_and_model_version(self, client): def callback(response): - self.assertIsNotNone(response.model_version) + self.assertIsNotNone(response) + self.assertIsNotNone(response.model_version, msg=response.raw_response) self.assertIsNotNone(response.raw_response) self.assertEqual(response.statistics.document_count, 5) self.assertEqual(response.statistics.transaction_count, 4) diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/test_detect_language_async.py b/sdk/textanalytics/azure-ai-textanalytics/tests/test_detect_language_async.py index e7174961758b..c2db6b837911 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/tests/test_detect_language_async.py +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/test_detect_language_async.py @@ -223,7 +223,8 @@ async def test_out_of_order_ids(self, client): @TextAnalyticsClientPreparer() async def test_show_stats_and_model_version(self, client): def callback(response): - self.assertIsNotNone(response.model_version) + self.assertIsNotNone(response) + self.assertIsNotNone(response.model_version, msg=response.raw_response) self.assertIsNotNone(response.raw_response) self.assertEqual(response.statistics.document_count, 5) self.assertEqual(response.statistics.transaction_count, 4) diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/test_extract_key_phrases.py b/sdk/textanalytics/azure-ai-textanalytics/tests/test_extract_key_phrases.py index 48709c5928fe..c06a41d3d36d 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/tests/test_extract_key_phrases.py +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/test_extract_key_phrases.py @@ -172,7 +172,8 @@ def test_out_of_order_ids(self, client): @TextAnalyticsClientPreparer() def test_show_stats_and_model_version(self, client): def callback(response): - self.assertIsNotNone(response.model_version) + self.assertIsNotNone(response) + self.assertIsNotNone(response.model_version, msg=response.raw_response) self.assertIsNotNone(response.raw_response) self.assertEqual(response.statistics.document_count, 5) self.assertEqual(response.statistics.transaction_count, 4) diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/test_extract_key_phrases_async.py b/sdk/textanalytics/azure-ai-textanalytics/tests/test_extract_key_phrases_async.py index 2a43c350ba76..08b685bcf986 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/tests/test_extract_key_phrases_async.py +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/test_extract_key_phrases_async.py @@ -187,7 +187,8 @@ async def test_out_of_order_ids(self, client): @TextAnalyticsClientPreparer() async def test_show_stats_and_model_version(self, client): def callback(response): - self.assertIsNotNone(response.model_version) + self.assertIsNotNone(response) + self.assertIsNotNone(response.model_version, msg=response.raw_response) self.assertIsNotNone(response.raw_response) self.assertEqual(response.statistics.document_count, 5) self.assertEqual(response.statistics.transaction_count, 4) diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/test_recognize_entities.py b/sdk/textanalytics/azure-ai-textanalytics/tests/test_recognize_entities.py index 415ce0e97bf4..d10bad7350d9 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/tests/test_recognize_entities.py +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/test_recognize_entities.py @@ -180,7 +180,8 @@ def test_out_of_order_ids(self, client): @TextAnalyticsClientPreparer() def test_show_stats_and_model_version(self, client): def callback(response): - self.assertIsNotNone(response.model_version) + self.assertIsNotNone(response) + self.assertIsNotNone(response.model_version, msg=response.raw_response) self.assertIsNotNone(response.raw_response) self.assertEqual(response.statistics.document_count, 5) self.assertEqual(response.statistics.transaction_count, 4) diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/test_recognize_entities_async.py b/sdk/textanalytics/azure-ai-textanalytics/tests/test_recognize_entities_async.py index 3b05b33c8cc3..dbda319a5d2d 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/tests/test_recognize_entities_async.py +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/test_recognize_entities_async.py @@ -196,7 +196,8 @@ async def test_out_of_order_ids(self, client): @TextAnalyticsClientPreparer() async def test_show_stats_and_model_version(self, client): def callback(response): - self.assertIsNotNone(response.model_version) + self.assertIsNotNone(response) + self.assertIsNotNone(response.model_version, msg=response.raw_response) self.assertIsNotNone(response.raw_response) self.assertEqual(response.statistics.document_count, 5) self.assertEqual(response.statistics.transaction_count, 4) diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/test_recognize_linked_entities.py b/sdk/textanalytics/azure-ai-textanalytics/tests/test_recognize_linked_entities.py index 98b8c0f4c75c..4de37b91c59a 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/tests/test_recognize_linked_entities.py +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/test_recognize_linked_entities.py @@ -180,7 +180,8 @@ def test_out_of_order_ids(self, client): @TextAnalyticsClientPreparer() def test_show_stats_and_model_version(self, client): def callback(response): - self.assertIsNotNone(response.model_version) + self.assertIsNotNone(response) + self.assertIsNotNone(response.model_version, msg=response.raw_response) self.assertIsNotNone(response.raw_response) self.assertEqual(response.statistics.document_count, 5) self.assertEqual(response.statistics.transaction_count, 4) diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/test_recognize_linked_entities_async.py b/sdk/textanalytics/azure-ai-textanalytics/tests/test_recognize_linked_entities_async.py index b276c9a43199..22c53b363802 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/tests/test_recognize_linked_entities_async.py +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/test_recognize_linked_entities_async.py @@ -204,7 +204,8 @@ async def test_out_of_order_ids(self, client): async def test_show_stats_and_model_version(self, client): def callback(response): - self.assertIsNotNone(response.model_version) + self.assertIsNotNone(response) + self.assertIsNotNone(response.model_version, msg=response.raw_response) self.assertIsNotNone(response.raw_response) self.assertEqual(response.statistics.document_count, 5) self.assertEqual(response.statistics.transaction_count, 4) diff --git a/shared_requirements.txt b/shared_requirements.txt index 18d16c257e7f..fba887ea9b35 100644 --- a/shared_requirements.txt +++ b/shared_requirements.txt @@ -126,7 +126,7 @@ six>=1.6 #override azure-ai-textanalytics azure-core<2.0.0,>=1.4.0 #override azure-search-documents azure-core<2.0.0,>=1.4.0 #override azure-ai-formrecognizer msrest>=0.6.12 -#override azure-ai-formrecognizer azure-core<2.0.0,>=1.4.0 +#override azure-ai-formrecognizer azure-core<2.0.0,>=1.6.0 #override azure-storage-blob azure-core<2.0.0,>=1.4.0 #override azure-storage-blob msrest>=0.6.10 #override azure-storage-queue msrest>=0.6.10