From 0e8db7f8fc354fe58d5af7352db41e881384f3ea Mon Sep 17 00:00:00 2001 From: Xiang Yan Date: Wed, 3 Jun 2020 15:56:50 -0700 Subject: [PATCH 01/16] search method only takes search_text --- .../documents/_internal/_search_client.py | 17 +++----- .../_internal/aio/_search_client_async.py | 18 +++----- .../azure/search/documents/models/__init__.py | 2 - .../sample_crud_operations_async.py | 1 - .../async_samples/sample_facet_query_async.py | 5 +-- .../sample_filter_query_async.py | 13 +++--- .../samples/sample_facet_query.py | 5 +-- .../samples/sample_filter_query.py | 13 +++--- .../samples/sample_simple_query.py | 2 +- .../async_tests/test_index_live_async.py | 42 +++++++++---------- .../tests/test_index_live.py | 38 +++++++---------- .../tests/test_queries.py | 5 +-- .../tests/test_search_index_client.py | 5 +-- 13 files changed, 63 insertions(+), 103 deletions(-) diff --git a/sdk/search/azure-search-documents/azure/search/documents/_internal/_search_client.py b/sdk/search/azure-search-documents/azure/search/documents/_internal/_search_client.py index 30970f9dd23..d6fa723fd5e 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/_internal/_search_client.py +++ b/sdk/search/azure-search-documents/azure/search/documents/_internal/_search_client.py @@ -132,12 +132,12 @@ def get_document(self, key, selected_fields=None, **kwargs): return cast(dict, result) @distributed_trace - def search(self, query, **kwargs): - # type: (Union[str, SearchQuery], **Any) -> SearchItemPaged[dict] + def search(self, search_text, **kwargs): + # type: (str, **Any) -> SearchItemPaged[dict] """Search the Azure search index for documents. - :param query: An query for searching the index - :type documents: str or SearchQuery + :param str search_text: A full-text search query expression; Use "*" or omit this parameter to + match all documents. :rtype: SearchItemPaged[dict] .. admonition:: Example: @@ -167,14 +167,7 @@ def search(self, query, **kwargs): :dedent: 4 :caption: Get search result facets. """ - if isinstance(query, six.string_types): - query = SearchQuery(search_text=query) - elif not isinstance(query, SearchQuery): - raise TypeError( - "Expected a string or SearchQuery for 'query', but got {}".format( - repr(query) - ) - ) + query = SearchQuery(search_text=search_text, **kwargs) kwargs["headers"] = self._merge_client_headers(kwargs.get("headers")) return SearchItemPaged( diff --git a/sdk/search/azure-search-documents/azure/search/documents/_internal/aio/_search_client_async.py b/sdk/search/azure-search-documents/azure/search/documents/_internal/aio/_search_client_async.py index 6eac9830aa0..0d12eadf5ff 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/_internal/aio/_search_client_async.py +++ b/sdk/search/azure-search-documents/azure/search/documents/_internal/aio/_search_client_async.py @@ -104,12 +104,12 @@ async def get_document(self, key, selected_fields=None, **kwargs): return cast(dict, result) @distributed_trace_async - async def search(self, query, **kwargs): - # type: (Union[str, SearchQuery], **Any) -> AsyncSearchItemPaged[dict] + async def search(self, search_text, **kwargs): + # type: (str, **Any) -> AsyncSearchItemPaged[dict] """Search the Azure search index for documents. - :param query: An query for searching the index - :type documents: str or SearchQuery + :param str search_text: A full-text search query expression; Use "*" or omit this parameter to + match all documents. :rtype: AsyncSearchItemPaged[dict] .. admonition:: Example: @@ -139,14 +139,8 @@ async def search(self, query, **kwargs): :dedent: 4 :caption: Get search result facets. """ - if isinstance(query, six.string_types): - query = SearchQuery(search_text=query) - elif not isinstance(query, SearchQuery): - raise TypeError( - "Expected a string or SearchQuery for 'query', but got {}".format( - repr(query) - ) - ) + query = SearchQuery(search_text=search_text, **kwargs) + kwargs["headers"] = self._merge_client_headers(kwargs.get("headers")) return AsyncSearchItemPaged( self._client, query, kwargs, page_iterator_class=AsyncSearchPageIterator diff --git a/sdk/search/azure-search-documents/azure/search/documents/models/__init__.py b/sdk/search/azure-search-documents/azure/search/documents/models/__init__.py index 4b120c5c396..9a8f5307fbb 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/models/__init__.py +++ b/sdk/search/azure-search-documents/azure/search/documents/models/__init__.py @@ -27,7 +27,6 @@ from .._internal import ( IndexAction, IndexingResult, - SearchQuery, odata, ) @@ -35,6 +34,5 @@ __all__ = ( "IndexAction", "IndexingResult", - "SearchQuery", "odata", ) diff --git a/sdk/search/azure-search-documents/samples/async_samples/sample_crud_operations_async.py b/sdk/search/azure-search-documents/samples/async_samples/sample_crud_operations_async.py index 577a6893645..895fa975d49 100644 --- a/sdk/search/azure-search-documents/samples/async_samples/sample_crud_operations_async.py +++ b/sdk/search/azure-search-documents/samples/async_samples/sample_crud_operations_async.py @@ -29,7 +29,6 @@ from azure.core.credentials import AzureKeyCredential from azure.search.documents.aio import SearchClient -from azure.search.documents.models import SearchQuery search_client = SearchClient(service_endpoint, index_name, AzureKeyCredential(key)) diff --git a/sdk/search/azure-search-documents/samples/async_samples/sample_facet_query_async.py b/sdk/search/azure-search-documents/samples/async_samples/sample_facet_query_async.py index 476d2ed795a..82522585818 100644 --- a/sdk/search/azure-search-documents/samples/async_samples/sample_facet_query_async.py +++ b/sdk/search/azure-search-documents/samples/async_samples/sample_facet_query_async.py @@ -32,14 +32,11 @@ async def filter_query(): # [START facet_query_async] from azure.core.credentials import AzureKeyCredential from azure.search.documents.aio import SearchClient - from azure.search.documents.models import SearchQuery search_client = SearchClient(service_endpoint, index_name, AzureKeyCredential(key)) - query = SearchQuery(search_text="WiFi", facets=["Category"], top=0) - async with search_client: - results = await search_client.search(query=query) + results = await search_client.search(search_text="WiFi", facets=["Category"], top=0) facets = await results.get_facets() diff --git a/sdk/search/azure-search-documents/samples/async_samples/sample_filter_query_async.py b/sdk/search/azure-search-documents/samples/async_samples/sample_filter_query_async.py index 0084482c920..d1a105d6bda 100644 --- a/sdk/search/azure-search-documents/samples/async_samples/sample_filter_query_async.py +++ b/sdk/search/azure-search-documents/samples/async_samples/sample_filter_query_async.py @@ -32,17 +32,16 @@ async def filter_query(): # [START filter_query_async] from azure.core.credentials import AzureKeyCredential from azure.search.documents.aio import SearchClient - from azure.search.documents.models import SearchQuery search_client = SearchClient(service_endpoint, index_name, AzureKeyCredential(key)) - query = SearchQuery(search_text="WiFi") - query.filter("Address/StateProvince eq 'FL' and Address/Country eq 'USA'") - query.select("HotelName", "Rating") - query.order_by("Rating desc") - async with search_client: - results = await search_client.search(query=query) + results = await search_client.search( + search_text="WiFi", + filter="Address/StateProvince eq 'FL' and Address/Country eq 'USA'", + select=",".join("HotelName", "Rating"), + order_by="Rating desc" + ) print("Florida hotels containing 'WiFi', sorted by Rating:") async for result in results: diff --git a/sdk/search/azure-search-documents/samples/sample_facet_query.py b/sdk/search/azure-search-documents/samples/sample_facet_query.py index 4e20ae5a9df..b2252f744b4 100644 --- a/sdk/search/azure-search-documents/samples/sample_facet_query.py +++ b/sdk/search/azure-search-documents/samples/sample_facet_query.py @@ -30,13 +30,10 @@ def filter_query(): # [START facet_query] from azure.core.credentials import AzureKeyCredential from azure.search.documents import SearchClient - from azure.search.documents.models import SearchQuery search_client = SearchClient(service_endpoint, index_name, AzureKeyCredential(key)) - query = SearchQuery(search_text="WiFi", facets=["Category"], top=0) - - results = search_client.search(query=query) + results = search_client.search(search_text="WiFi", facets=["Category"], top=0) facets = results.get_facets() diff --git a/sdk/search/azure-search-documents/samples/sample_filter_query.py b/sdk/search/azure-search-documents/samples/sample_filter_query.py index 58770bd1fe5..82484b7bee7 100644 --- a/sdk/search/azure-search-documents/samples/sample_filter_query.py +++ b/sdk/search/azure-search-documents/samples/sample_filter_query.py @@ -30,16 +30,15 @@ def filter_query(): # [START filter_query] from azure.core.credentials import AzureKeyCredential from azure.search.documents import SearchClient - from azure.search.documents.models import SearchQuery search_client = SearchClient(service_endpoint, index_name, AzureKeyCredential(key)) - query = SearchQuery(search_text="WiFi") - query.filter("Address/StateProvince eq 'FL' and Address/Country eq 'USA'") - query.select("HotelName", "Rating") - query.order_by("Rating desc") - - results = search_client.search(query=query) + results = search_client.search( + search_text="WiFi", + filter="Address/StateProvince eq 'FL' and Address/Country eq 'USA'", + select=",".join("HotelName", "Rating"), + order_by="Rating desc" + ) print("Florida hotels containing 'WiFi', sorted by Rating:") for result in results: diff --git a/sdk/search/azure-search-documents/samples/sample_simple_query.py b/sdk/search/azure-search-documents/samples/sample_simple_query.py index 3948ae446a7..19d9a83b7e9 100644 --- a/sdk/search/azure-search-documents/samples/sample_simple_query.py +++ b/sdk/search/azure-search-documents/samples/sample_simple_query.py @@ -33,7 +33,7 @@ def simple_text_query(): search_client = SearchClient(service_endpoint, index_name, AzureKeyCredential(key)) - results = search_client.search(query="spa") + results = search_client.search(search_text="spa") print("Hotels containing 'spa' in the name (or other fields):") for result in results: diff --git a/sdk/search/azure-search-documents/tests/async_tests/test_index_live_async.py b/sdk/search/azure-search-documents/tests/async_tests/test_index_live_async.py index 0bd090623c4..4f97bf5d759 100644 --- a/sdk/search/azure-search-documents/tests/async_tests/test_index_live_async.py +++ b/sdk/search/azure-search-documents/tests/async_tests/test_index_live_async.py @@ -24,7 +24,6 @@ from azure.core.exceptions import HttpResponseError from azure.core.credentials import AzureKeyCredential -from azure.search.documents.models import SearchQuery from azure.search.documents.aio import SearchClient TIME_TO_SLEEP = 3 @@ -103,14 +102,14 @@ async def test_get_search_filter(self, api_key, endpoint, index_name, **kwargs): endpoint, index_name, AzureKeyCredential(api_key) ) - query = SearchQuery(search_text="WiFi") - query.filter("category eq 'Budget'") - query.select("hotelName", "category", "description") - query.order_by("hotelName desc") - async with client: results = [] - async for x in await client.search(query=query): + async for x in await client.search( + search_text="WiFi", + filter="category eq 'Budget'", + select=",".join("hotelName", "category", "description"), + order_by="hotelName desc" + ): results.append(x) assert [x["hotelName"] for x in results] == sorted( [x["hotelName"] for x in results], reverse=True @@ -132,12 +131,10 @@ async def test_get_search_counts(self, api_key, endpoint, index_name, **kwargs): endpoint, index_name, AzureKeyCredential(api_key) ) - query = SearchQuery(search_text="hotel") - results = await client.search(query=query) + results = await client.search(search_text="hotel") assert await results.get_count() is None - query = SearchQuery(search_text="hotel", include_total_result_count=True) - results = await client.search(query=query) + results = await client.search(search_text="hotel", include_total_result_count=True) assert await results.get_count() == 7 @ResourceGroupPreparer(random_name_enabled=True) @@ -147,12 +144,10 @@ async def test_get_search_coverage(self, api_key, endpoint, index_name, **kwargs endpoint, index_name, AzureKeyCredential(api_key) ) - query = SearchQuery(search_text="hotel") - results = await client.search(query=query) + results = await client.search(search_text="hotel") assert await results.get_coverage() is None - query = SearchQuery(search_text="hotel", minimum_coverage=50.0) - results = await client.search(query=query) + results = await client.search(search_text="hotel", minimum_coverage=50.0) cov = await results.get_coverage() assert isinstance(cov, float) assert cov >= 50.0 @@ -166,11 +161,11 @@ async def test_get_search_facets_none( endpoint, index_name, AzureKeyCredential(api_key) ) - query = SearchQuery(search_text="WiFi") - query.select("hotelName", "category", "description") - async with client: - results = await client.search(query=query) + results = await client.search( + search_text="WiFi", + select=",".join("hotelName", "category", "description") + ) assert await results.get_facets() is None @ResourceGroupPreparer(random_name_enabled=True) @@ -182,11 +177,12 @@ async def test_get_search_facets_result( endpoint, index_name, AzureKeyCredential(api_key) ) - query = SearchQuery(search_text="WiFi", facets=["category"]) - query.select("hotelName", "category", "description") - async with client: - results = await client.search(query=query) + results = await client.search( + search_text="WiFi", + facets=["category"], + select=",".join("hotelName", "category", "description") + ) assert await results.get_facets() == { "category": [ {"value": "Budget", "count": 4}, diff --git a/sdk/search/azure-search-documents/tests/test_index_live.py b/sdk/search/azure-search-documents/tests/test_index_live.py index 52d04f9e574..c4b31cd1631 100644 --- a/sdk/search/azure-search-documents/tests/test_index_live.py +++ b/sdk/search/azure-search-documents/tests/test_index_live.py @@ -21,7 +21,6 @@ from azure.core.exceptions import HttpResponseError from azure.core.credentials import AzureKeyCredential from azure.search.documents import SearchClient -from azure.search.documents.models import SearchQuery TIME_TO_SLEEP = 3 @@ -75,12 +74,12 @@ def test_get_search_filter(self, api_key, endpoint, index_name, **kwargs): endpoint, index_name, AzureKeyCredential(api_key) ) - query = SearchQuery(search_text="WiFi") - query.filter("category eq 'Budget'") - query.select("hotelName", "category", "description") - query.order_by("hotelName desc") - - results = list(client.search(query=query)) + results = list(client.search( + search_text="WiFi", + filter="category eq 'Budget'", + select=",".join("hotelName", "category", "description"), + order_by="hotelName desc" + )) assert [x["hotelName"] for x in results] == sorted( [x["hotelName"] for x in results], reverse=True ) @@ -101,12 +100,10 @@ def test_get_search_counts(self, api_key, endpoint, index_name, **kwargs): endpoint, index_name, AzureKeyCredential(api_key) ) - query = SearchQuery(search_text="hotel") - results = client.search(query=query) + results = client.search(search_text="hotel") assert results.get_count() is None - query = SearchQuery(search_text="hotel", include_total_result_count=True) - results = client.search(query=query) + results = client.search(search_text="hotel", include_total_result_count=True) assert results.get_count() == 7 @ResourceGroupPreparer(random_name_enabled=True) @@ -116,12 +113,10 @@ def test_get_search_coverage(self, api_key, endpoint, index_name, **kwargs): endpoint, index_name, AzureKeyCredential(api_key) ) - query = SearchQuery(search_text="hotel") - results = client.search(query=query) + results = client.search(search_text="hotel") assert results.get_coverage() is None - query = SearchQuery(search_text="hotel", minimum_coverage=50.0) - results = client.search(query=query) + results = client.search(search_text="hotel", minimum_coverage=50.0) cov = results.get_coverage() assert isinstance(cov, float) assert cov >= 50.0 @@ -133,10 +128,7 @@ def test_get_search_facets_none(self, api_key, endpoint, index_name, **kwargs): endpoint, index_name, AzureKeyCredential(api_key) ) - query = SearchQuery(search_text="WiFi") - query.select("hotelName", "category", "description") - - results = client.search(query=query) + results = client.search(search_text="WiFi", select=",".join("hotelName", "category", "description")) assert results.get_facets() is None @ResourceGroupPreparer(random_name_enabled=True) @@ -146,10 +138,10 @@ def test_get_search_facets_result(self, api_key, endpoint, index_name, **kwargs) endpoint, index_name, AzureKeyCredential(api_key) ) - query = SearchQuery(search_text="WiFi", facets=["category"]) - query.select("hotelName", "category", "description") - - results = client.search(query=query) + results = client.search(search_text="WiFi", + facets=["category"], + select=",".join("hotelName", "category", "description") + ) assert results.get_facets() == { "category": [ {"value": "Budget", "count": 4}, diff --git a/sdk/search/azure-search-documents/tests/test_queries.py b/sdk/search/azure-search-documents/tests/test_queries.py index 0bbca28a1f1..53abf62af37 100644 --- a/sdk/search/azure-search-documents/tests/test_queries.py +++ b/sdk/search/azure-search-documents/tests/test_queries.py @@ -16,8 +16,7 @@ SuggestRequest, ) -from azure.search.documents.models import SearchQuery -from azure.search.documents._internal._queries import AutocompleteQuery, SuggestQuery +from azure.search.documents._internal._queries import AutocompleteQuery, SuggestQuery, SearchQuery class TestAutocompleteQuery(object): @@ -63,7 +62,7 @@ def test_init(self): assert query.request.order_by is None assert query.request.select is None - @mock.patch("azure.search.documents.models.SearchQuery._request_type") + @mock.patch("azure.search.documents._internal._queries.SearchQuery._request_type") def test_kwargs_forwarded(self, mock_request): mock_request.return_value = None SearchQuery(foo=10, bar=20) diff --git a/sdk/search/azure-search-documents/tests/test_search_index_client.py b/sdk/search/azure-search-documents/tests/test_search_index_client.py index 667f4a7b4e4..829025be8c1 100644 --- a/sdk/search/azure-search-documents/tests/test_search_index_client.py +++ b/sdk/search/azure-search-documents/tests/test_search_index_client.py @@ -25,10 +25,7 @@ IndexDocumentsBatch, SearchClient, ) -from azure.search.documents.models import ( - SearchQuery, - odata, -) +from azure.search.documents.models import odata CREDENTIAL = AzureKeyCredential(key="test_api_key") From 2cb37507ef0db5fe87c0250008476d85a4358faa Mon Sep 17 00:00:00 2001 From: Xiang Yan Date: Wed, 3 Jun 2020 19:36:55 -0700 Subject: [PATCH 02/16] update --- sdk/search/azure-search-documents/README.md | 6 +- .../documents/_internal/_search_client.py | 80 ++++++++++++++++- .../_internal/aio/_search_client_async.py | 86 +++++++++++++++++-- .../sample_filter_query_async.py | 3 +- .../sample_simple_query_async.py | 2 +- .../samples/sample_filter_query.py | 3 +- .../async_tests/test_index_live_async.py | 13 +-- .../tests/test_index_live.py | 14 +-- .../tests/test_search_index_client.py | 15 +--- 9 files changed, 183 insertions(+), 39 deletions(-) diff --git a/sdk/search/azure-search-documents/README.md b/sdk/search/azure-search-documents/README.md index d36170a7698..1de92c0b959 100644 --- a/sdk/search/azure-search-documents/README.md +++ b/sdk/search/azure-search-documents/README.md @@ -83,7 +83,7 @@ client = SearchServiceClient(endpoint="" You can use the `SearchClient` you created in the first section above to make a basic search request: ```python -results = client.search(query="spa") +results = client.search(search_text="spa") print("Hotels containing 'spa' in the name (or other fields):") for result in results: @@ -126,7 +126,7 @@ from azure.core.credentials import AzureKeyCredential from azure.search.documents import SearchClient client = SearchClient("", "", AzureKeyCredential("")) -results = client.search(query="spa") +results = client.search(search_text="spa") print("Hotels containing 'spa' in the name (or other fields):") for result in results: @@ -257,7 +257,7 @@ client = SearchClient("", "", AzureKeyCredential(" Similarly, `logging_enable` can enable detailed logging for a single operation, even when it isn't enabled for the client: ```python -result = client.search(query="spa", logging_enable=True) +result = client.search(search_text="spa", logging_enable=True) ``` ## Next steps diff --git a/sdk/search/azure-search-documents/azure/search/documents/_internal/_search_client.py b/sdk/search/azure-search-documents/azure/search/documents/_internal/_search_client.py index d6fa723fd5e..d7a190d4af4 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/_internal/_search_client.py +++ b/sdk/search/azure-search-documents/azure/search/documents/_internal/_search_client.py @@ -167,7 +167,41 @@ def search(self, search_text, **kwargs): :dedent: 4 :caption: Get search result facets. """ - query = SearchQuery(search_text=search_text, **kwargs) + include_total_result_count = kwargs.pop("include_total_result_count", None) + facets = kwargs.pop("facets", None) + filter = kwargs.pop("filter", None) + highlight_fields = kwargs.pop("highlight_fields", None) + highlight_post_tag = kwargs.pop("highlight_post_tag", None) + highlight_pre_tag = kwargs.pop("highlight_pre_tag", None) + minimum_coverage = kwargs.pop("minimum_coverage", None) + order_by = kwargs.pop("order_by", None) + query_type = kwargs.pop("query_type", None) + scoring_parameters = kwargs.pop("scoring_parameters", None) + scoring_profile = kwargs.pop("scoring_profile", None) + search_fields = kwargs.pop("search_fields", None) + search_mode = kwargs.pop("search_mode", None) + select = kwargs.pop("select", None) + skip = kwargs.pop("skip", None) + top = kwargs.pop("top", None) + query = SearchQuery( + search_text=search_text, + include_total_result_count=include_total_result_count, + facets=facets, + filter=filter, + highlight_fields=highlight_fields, + highlight_post_tag=highlight_post_tag, + highlight_pre_tag=highlight_pre_tag, + minimum_coverage=minimum_coverage, + order_by=order_by, + query_type=query_type, + scoring_parameters=scoring_parameters, + scoring_profile=scoring_profile, + search_fields=search_fields, + search_mode=search_mode, + select=select, + skip=skip, + top=top + ) kwargs["headers"] = self._merge_client_headers(kwargs.get("headers")) return SearchItemPaged( @@ -194,7 +228,28 @@ def suggest(self, search_text, suggester_name, **kwargs): :dedent: 4 :caption: Get search suggestions. """ - query = SuggestQuery(search_text=search_text, suggester_name=suggester_name, **kwargs) + filter = kwargs.pop("filter", None) + use_fuzzy_matching = kwargs.pop("use_fuzzy_matching", None) + highlight_post_tag = kwargs.pop("highlight_post_tag", None) + highlight_pre_tag = kwargs.pop("highlight_pre_tag", None) + minimum_coverage = kwargs.pop("minimum_coverage", None) + order_by = kwargs.pop("order_by", None) + search_fields = kwargs.pop("search_fields", None) + select = kwargs.pop("select", None) + top = kwargs.pop("top", None) + query = SuggestQuery( + search_text=search_text, + suggester_name=suggester_name, + filter=filter, + use_fuzzy_matching=use_fuzzy_matching, + highlight_post_tag=highlight_post_tag, + highlight_pre_tag=highlight_pre_tag, + minimum_coverage=minimum_coverage, + order_by=order_by, + search_fields=search_fields, + select=select, + top=top + ) kwargs["headers"] = self._merge_client_headers(kwargs.get("headers")) response = self._client.documents.suggest_post( @@ -222,7 +277,26 @@ def autocomplete(self, search_text, suggester_name, **kwargs): :dedent: 4 :caption: Get a auto-completions. """ - query = AutocompleteQuery(search_text=search_text, suggester_name=suggester_name, **kwargs) + autocomplete_mode = kwargs.pop("autocomplete_mode", None) + filter = kwargs.pop("filter", None) + use_fuzzy_matching = kwargs.pop("use_fuzzy_matching", None) + highlight_post_tag = kwargs.pop("highlight_post_tag", None) + highlight_pre_tag = kwargs.pop("highlight_pre_tag", None) + minimum_coverage = kwargs.pop("minimum_coverage", None) + search_fields = kwargs.pop("search_fields", None) + top = kwargs.pop("top", None) + query = AutocompleteQuery( + search_text=search_text, + suggester_name=suggester_name, + autocomplete_mode=autocomplete_mode, + filter=filter, + use_fuzzy_matching=use_fuzzy_matching, + highlight_post_tag=highlight_post_tag, + highlight_pre_tag=highlight_pre_tag, + minimum_coverage=minimum_coverage, + search_fields=search_fields, + top=top + ) kwargs["headers"] = self._merge_client_headers(kwargs.get("headers")) response = self._client.documents.autocomplete_post( diff --git a/sdk/search/azure-search-documents/azure/search/documents/_internal/aio/_search_client_async.py b/sdk/search/azure-search-documents/azure/search/documents/_internal/aio/_search_client_async.py index 0d12eadf5ff..b07d561a441 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/_internal/aio/_search_client_async.py +++ b/sdk/search/azure-search-documents/azure/search/documents/_internal/aio/_search_client_async.py @@ -5,12 +5,10 @@ # -------------------------------------------------------------------------- from typing import cast, List, TYPE_CHECKING -import six - from azure.core.tracing.decorator_async import distributed_trace_async from ._paging import AsyncSearchItemPaged, AsyncSearchPageIterator from .._generated.aio import SearchIndexClient -from .._generated.models import IndexBatch, IndexingResult, SearchRequest +from .._generated.models import IndexBatch, IndexingResult from .._index_documents_batch import IndexDocumentsBatch from .._queries import AutocompleteQuery, SearchQuery, SuggestQuery from ..._headers_mixin import HeadersMixin @@ -139,7 +137,41 @@ async def search(self, search_text, **kwargs): :dedent: 4 :caption: Get search result facets. """ - query = SearchQuery(search_text=search_text, **kwargs) + include_total_result_count = kwargs.pop("include_total_result_count", None) + facets = kwargs.pop("facets", None) + filter = kwargs.pop("filter", None) + highlight_fields = kwargs.pop("highlight_fields", None) + highlight_post_tag = kwargs.pop("highlight_post_tag", None) + highlight_pre_tag = kwargs.pop("highlight_pre_tag", None) + minimum_coverage = kwargs.pop("minimum_coverage", None) + order_by = kwargs.pop("order_by", None) + query_type = kwargs.pop("query_type", None) + scoring_parameters = kwargs.pop("scoring_parameters", None) + scoring_profile = kwargs.pop("scoring_profile", None) + search_fields = kwargs.pop("search_fields", None) + search_mode = kwargs.pop("search_mode", None) + select = kwargs.pop("select", None) + skip = kwargs.pop("skip", None) + top = kwargs.pop("top", None) + query = SearchQuery( + search_text=search_text, + include_total_result_count=include_total_result_count, + facets=facets, + filter=filter, + highlight_fields=highlight_fields, + highlight_post_tag=highlight_post_tag, + highlight_pre_tag=highlight_pre_tag, + minimum_coverage=minimum_coverage, + order_by=order_by, + query_type=query_type, + scoring_parameters=scoring_parameters, + scoring_profile=scoring_profile, + search_fields=search_fields, + search_mode=search_mode, + select=select, + skip=skip, + top=top + ) kwargs["headers"] = self._merge_client_headers(kwargs.get("headers")) return AsyncSearchItemPaged( @@ -148,7 +180,7 @@ async def search(self, search_text, **kwargs): @distributed_trace_async async def suggest(self, search_text, suggester_name, **kwargs): - # type: (Union[str, SuggestQuery], **Any) -> List[dict] + # type: (str, str, **Any) -> List[dict] """Get search suggestion results from the Azure search index. :param str search_text: Required. The search text to use to suggest documents. Must be at least 1 @@ -166,7 +198,28 @@ async def suggest(self, search_text, suggester_name, **kwargs): :dedent: 4 :caption: Get search suggestions. """ - query = SuggestQuery(search_text=search_text, suggester_name=suggester_name, **kwargs) + filter = kwargs.pop("filter", None) + use_fuzzy_matching = kwargs.pop("use_fuzzy_matching", None) + highlight_post_tag = kwargs.pop("highlight_post_tag", None) + highlight_pre_tag = kwargs.pop("highlight_pre_tag", None) + minimum_coverage = kwargs.pop("minimum_coverage", None) + order_by = kwargs.pop("order_by", None) + search_fields = kwargs.pop("search_fields", None) + select = kwargs.pop("select", None) + top = kwargs.pop("top", None) + query = SuggestQuery( + search_text=search_text, + suggester_name=suggester_name, + filter=filter, + use_fuzzy_matching=use_fuzzy_matching, + highlight_post_tag=highlight_post_tag, + highlight_pre_tag=highlight_pre_tag, + minimum_coverage=minimum_coverage, + order_by=order_by, + search_fields=search_fields, + select=select, + top=top + ) kwargs["headers"] = self._merge_client_headers(kwargs.get("headers")) response = await self._client.documents.suggest_post( @@ -194,7 +247,26 @@ async def autocomplete(self, search_text, suggester_name, **kwargs): :dedent: 4 :caption: Get a auto-completions. """ - query = AutocompleteQuery(search_text=search_text, suggester_name=suggester_name, **kwargs) + autocomplete_mode = kwargs.pop("autocomplete_mode", None) + filter = kwargs.pop("filter", None) + use_fuzzy_matching = kwargs.pop("use_fuzzy_matching", None) + highlight_post_tag = kwargs.pop("highlight_post_tag", None) + highlight_pre_tag = kwargs.pop("highlight_pre_tag", None) + minimum_coverage = kwargs.pop("minimum_coverage", None) + search_fields = kwargs.pop("search_fields", None) + top = kwargs.pop("top", None) + query = AutocompleteQuery( + search_text=search_text, + suggester_name=suggester_name, + autocomplete_mode=autocomplete_mode, + filter=filter, + use_fuzzy_matching=use_fuzzy_matching, + highlight_post_tag=highlight_post_tag, + highlight_pre_tag=highlight_pre_tag, + minimum_coverage=minimum_coverage, + search_fields=search_fields, + top=top + ) kwargs["headers"] = self._merge_client_headers(kwargs.get("headers")) response = await self._client.documents.autocomplete_post( diff --git a/sdk/search/azure-search-documents/samples/async_samples/sample_filter_query_async.py b/sdk/search/azure-search-documents/samples/async_samples/sample_filter_query_async.py index d1a105d6bda..8b8e9cd10dd 100644 --- a/sdk/search/azure-search-documents/samples/async_samples/sample_filter_query_async.py +++ b/sdk/search/azure-search-documents/samples/async_samples/sample_filter_query_async.py @@ -35,11 +35,12 @@ async def filter_query(): search_client = SearchClient(service_endpoint, index_name, AzureKeyCredential(key)) + select = ("HotelName", "Rating") async with search_client: results = await search_client.search( search_text="WiFi", filter="Address/StateProvince eq 'FL' and Address/Country eq 'USA'", - select=",".join("HotelName", "Rating"), + select=",".join(select), order_by="Rating desc" ) diff --git a/sdk/search/azure-search-documents/samples/async_samples/sample_simple_query_async.py b/sdk/search/azure-search-documents/samples/async_samples/sample_simple_query_async.py index 28810821a5f..d87f9a76aa7 100644 --- a/sdk/search/azure-search-documents/samples/async_samples/sample_simple_query_async.py +++ b/sdk/search/azure-search-documents/samples/async_samples/sample_simple_query_async.py @@ -36,7 +36,7 @@ async def simple_text_query(): search_client = SearchClient(service_endpoint, index_name, AzureKeyCredential(key)) async with search_client: - results = await search_client.search(query="spa") + results = await search_client.search(search_text="spa") print("Hotels containing 'spa' in the name (or other fields):") async for result in results: diff --git a/sdk/search/azure-search-documents/samples/sample_filter_query.py b/sdk/search/azure-search-documents/samples/sample_filter_query.py index 82484b7bee7..1ad1f76fb20 100644 --- a/sdk/search/azure-search-documents/samples/sample_filter_query.py +++ b/sdk/search/azure-search-documents/samples/sample_filter_query.py @@ -33,10 +33,11 @@ def filter_query(): search_client = SearchClient(service_endpoint, index_name, AzureKeyCredential(key)) + select = ("HotelName", "Rating") results = search_client.search( search_text="WiFi", filter="Address/StateProvince eq 'FL' and Address/Country eq 'USA'", - select=",".join("HotelName", "Rating"), + select=",".join(select), order_by="Rating desc" ) diff --git a/sdk/search/azure-search-documents/tests/async_tests/test_index_live_async.py b/sdk/search/azure-search-documents/tests/async_tests/test_index_live_async.py index 4f97bf5d759..b47e3c78ffc 100644 --- a/sdk/search/azure-search-documents/tests/async_tests/test_index_live_async.py +++ b/sdk/search/azure-search-documents/tests/async_tests/test_index_live_async.py @@ -86,12 +86,12 @@ async def test_get_search_simple(self, api_key, endpoint, index_name, **kwargs): ) async with client: results = [] - async for x in await client.search(query="hotel"): + async for x in await client.search(search_text="hotel"): results.append(x) assert len(results) == 7 results = [] - async for x in await client.search(query="motel"): + async for x in await client.search(search_text="motel"): results.append(x) assert len(results) == 2 @@ -104,10 +104,11 @@ async def test_get_search_filter(self, api_key, endpoint, index_name, **kwargs): async with client: results = [] + select = ("hotelName", "category", "description") async for x in await client.search( search_text="WiFi", filter="category eq 'Budget'", - select=",".join("hotelName", "category", "description"), + select=",".join(select), order_by="hotelName desc" ): results.append(x) @@ -162,9 +163,10 @@ async def test_get_search_facets_none( ) async with client: + select = ("hotelName", "category", "description") results = await client.search( search_text="WiFi", - select=",".join("hotelName", "category", "description") + select=",".join(select) ) assert await results.get_facets() is None @@ -178,10 +180,11 @@ async def test_get_search_facets_result( ) async with client: + select = ("hotelName", "category", "description") results = await client.search( search_text="WiFi", facets=["category"], - select=",".join("hotelName", "category", "description") + select=",".join(select) ) assert await results.get_facets() == { "category": [ diff --git a/sdk/search/azure-search-documents/tests/test_index_live.py b/sdk/search/azure-search-documents/tests/test_index_live.py index c4b31cd1631..b59fa5782c2 100644 --- a/sdk/search/azure-search-documents/tests/test_index_live.py +++ b/sdk/search/azure-search-documents/tests/test_index_live.py @@ -61,10 +61,10 @@ def test_get_search_simple(self, api_key, endpoint, index_name, **kwargs): client = SearchClient( endpoint, index_name, AzureKeyCredential(api_key) ) - results = list(client.search(query="hotel")) + results = list(client.search(search_text="hotel")) assert len(results) == 7 - results = list(client.search(query="motel")) + results = list(client.search(search_text="motel")) assert len(results) == 2 @ResourceGroupPreparer(random_name_enabled=True) @@ -74,10 +74,11 @@ def test_get_search_filter(self, api_key, endpoint, index_name, **kwargs): endpoint, index_name, AzureKeyCredential(api_key) ) + select = ("hotelName", "category", "description") results = list(client.search( search_text="WiFi", filter="category eq 'Budget'", - select=",".join("hotelName", "category", "description"), + select=",".join(select), order_by="hotelName desc" )) assert [x["hotelName"] for x in results] == sorted( @@ -104,6 +105,7 @@ def test_get_search_counts(self, api_key, endpoint, index_name, **kwargs): assert results.get_count() is None results = client.search(search_text="hotel", include_total_result_count=True) + temp = list(results) assert results.get_count() == 7 @ResourceGroupPreparer(random_name_enabled=True) @@ -128,7 +130,8 @@ def test_get_search_facets_none(self, api_key, endpoint, index_name, **kwargs): endpoint, index_name, AzureKeyCredential(api_key) ) - results = client.search(search_text="WiFi", select=",".join("hotelName", "category", "description")) + select = ("hotelName", "category", "description") + results = client.search(search_text="WiFi", select=",".join(select)) assert results.get_facets() is None @ResourceGroupPreparer(random_name_enabled=True) @@ -138,9 +141,10 @@ def test_get_search_facets_result(self, api_key, endpoint, index_name, **kwargs) endpoint, index_name, AzureKeyCredential(api_key) ) + select = ("hotelName", "category", "description") results = client.search(search_text="WiFi", facets=["category"], - select=",".join("hotelName", "category", "description") + select=",".join(select) ) assert results.get_facets() == { "category": [ diff --git a/sdk/search/azure-search-documents/tests/test_search_index_client.py b/sdk/search/azure-search-documents/tests/test_search_index_client.py index 829025be8c1..f4cc4b5ca9c 100644 --- a/sdk/search/azure-search-documents/tests/test_search_index_client.py +++ b/sdk/search/azure-search-documents/tests/test_search_index_client.py @@ -137,15 +137,12 @@ def test_get_document(self, mock_get): assert mock_get.call_args[1]["key"] == "some_key" assert mock_get.call_args[1]["selected_fields"] == "foo" - @pytest.mark.parametrize( - "query", ["search text", SearchQuery(search_text="search text")], ids=repr - ) @mock.patch( "azure.search.documents._internal._generated.operations._documents_operations.DocumentsOperations.search_post" ) - def test_search_query_argument(self, mock_search_post, query): + def test_search_query_argument(self, mock_search_post): client = SearchClient("endpoint", "index name", CREDENTIAL) - result = client.search(query) + result = client.search(search_text="search text") assert isinstance(result, ItemPaged) assert result._page_iterator_class is SearchPageIterator search_result = SearchDocumentsResult() @@ -159,14 +156,6 @@ def test_search_query_argument(self, mock_search_post, query): mock_search_post.call_args[1]["search_request"].search_text == "search text" ) - def test_search_bad_argument(self): - client = SearchClient("endpoint", "index name", CREDENTIAL) - with pytest.raises(TypeError) as e: - client.search(10) - assert str(e) == "Expected a SuggestQuery for 'query', but got {}".format( - repr(10) - ) - @mock.patch( "azure.search.documents._internal._generated.operations._documents_operations.DocumentsOperations.suggest_post" ) From da6d4f56e9838fb40ede080afebe2dedccda7670 Mon Sep 17 00:00:00 2001 From: Xiang Yan Date: Wed, 3 Jun 2020 19:43:13 -0700 Subject: [PATCH 03/16] Add AzureCliCredential and VSCodeCredential to public API (#11790) (#11805) Co-authored-by: Charles Lowell --- sdk/identity/azure-identity/CHANGELOG.md | 3 +++ sdk/identity/azure-identity/azure/identity/__init__.py | 4 ++++ .../azure/identity/_credentials/__init__.py | 3 +++ .../azure-identity/azure/identity/aio/__init__.py | 4 ++++ .../azure/identity/aio/_credentials/__init__.py | 2 ++ .../azure-identity/tests/test_cli_credential.py | 4 ++-- .../azure-identity/tests/test_cli_credential_async.py | 2 +- .../azure-identity/tests/test_vscode_credential.py | 8 +++++--- .../tests/test_vscode_credential_async.py | 10 ++++++---- 9 files changed, 30 insertions(+), 10 deletions(-) diff --git a/sdk/identity/azure-identity/CHANGELOG.md b/sdk/identity/azure-identity/CHANGELOG.md index ea5b7fca072..781fe4b105c 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 3fbc78c57bf..5f408028a4c 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 cd0068cc3cd..baf64e6d510 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 775ee06abd8..3c2288e308a 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 cf63acbd84d..d9146708694 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 bc588436668..7377d330455 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 1ad4dba493d..9e8ad1f8221 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 d4e0afe2b33..779578053d0 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 89f27a78d4f..edd59dcc0b3 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 From 119e4e8c11ba63d33b37bed841db7548914c7d5d Mon Sep 17 00:00:00 2001 From: Xiang Yan Date: Thu, 4 Jun 2020 11:09:43 -0700 Subject: [PATCH 04/16] get master (#11823) * [HDInsight] Fix hdi test failure (#11806) * Initial generation Synapse autorest v5 * Fix empty model generation * Fix Test Failure: Skip 3 test case: test_create_with_adlsgen1, test_create_with_additional_storage, test_oms_on_running_cluster Rename test_http_extend to test_gateway_setting for http settings is replaced with gateway settings Co-authored-by: Laurent Mazuel Co-authored-by: Zhenyu Zhou * disable some by design bandit warnings (#11495) * disable some by design bandit warnings * Packaging update of azure-mgmt-datalake-analytics Co-authored-by: Azure SDK Bot * Increment package version after release of azure_core (#11795) * Use subject claim as home_account_id when no client_info (#11639) * Refactor ClientCertificateCredential to use AadClient (#11719) * Refactor ClientSecretCredential to use AadClient (#11718) * [Cosmos] Fixed incorrect ID type error (#11798) * Fixed incorrect ID type error * Fix pylint * [text analytics] Update readme (#11796) * try something (#11797) * Search refactoring 3 (#11804) * create_or_update takes object * rename is_hidden to hidden * fix types * updates Co-authored-by: aim-for-better Co-authored-by: Laurent Mazuel Co-authored-by: Zhenyu Zhou Co-authored-by: Azure SDK Bot Co-authored-by: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Co-authored-by: Charles Lowell Co-authored-by: annatisch Co-authored-by: iscai-msft <43154838+iscai-msft@users.noreply.github.com> Co-authored-by: Krista Pratico --- sdk/core/azure-core/CHANGELOG.md | 3 + sdk/core/azure-core/azure/core/_version.py | 2 +- sdk/cosmos/azure-cosmos/CHANGELOG.md | 5 + .../azure/cosmos/_cosmos_client_connection.py | 14 +- .../azure-cosmos/azure/cosmos/_version.py | 2 +- .../access_cosmos_with_resource_token.py | 2 +- sdk/cosmos/azure-cosmos/test/test_crud.py | 21 +- sdk/cosmos/azure-cosmos/test/test_globaldb.py | 4 +- .../azure-cosmos/test/test_multi_orderby.py | 2 +- sdk/cosmos/azure-cosmos/test/test_orderby.py | 8 +- sdk/cosmos/azure-cosmos/test/test_query.py | 18 +- .../azure-mgmt-datalake-analytics/README.md | 33 +- .../azure-mgmt-datalake-analytics/setup.py | 5 +- .../tests/test_mgmt_datalake_analytics.py | 2 +- .../_vendor/storage/blob/_shared/policies.py | 2 +- .../_vendor/storage/blob/_shared/policies.py | 2 +- .../azure-mgmt-hdinsight/dev_requirements.txt | 1 + ...te_kafka_cluster_with_disk_encryption.yaml | 2526 +++++++++++------ ..._hdinsight.test_create_with_adls_gen1.yaml | 930 ------ ..._mgmt_hdinsight.test_gateway_settings.yaml | 1507 ++++++++++ ...est_mgmt_hdinsight.test_http_extended.yaml | 1164 -------- ...hdinsight.test_hue_on_running_cluster.yaml | 781 +++-- .../test/test_mgmt_hdinsight.py | 189 +- .../azure-identity/azure/identity/_base.py | 88 - .../identity/_credentials/certificate.py | 12 +- .../identity/_credentials/client_secret.py | 18 +- .../azure/identity/_internal/__init__.py | 6 + .../azure/identity/_internal/aad_client.py | 21 +- .../identity/_internal/aad_client_base.py | 73 +- .../_internal/aadclient_certificate.py | 41 + .../_internal/certificate_credential_base.py | 47 + .../client_secret_credential_base.py | 35 + .../identity/_internal/msal_credentials.py | 12 +- .../identity/aio/_credentials/certificate.py | 15 +- .../aio/_credentials/client_secret.py | 22 +- .../identity/aio/_internal/aad_client.py | 18 + .../azure-identity/tests/test_aad_client.py | 24 + .../tests/test_aad_client_async.py | 24 + .../tests/test_browser_credential.py | 4 +- .../tests/test_certificate_credential.py | 2 +- .../tests/test_interactive_credential.py | 53 + .../azure-search-documents/CHANGELOG.md | 1 + .../documents/indexes/_internal/_index.py | 20 +- .../indexes/_internal/_search_index_client.py | 90 +- .../_internal/_search_indexer_client.py | 112 +- .../documents/indexes/_internal/_utils.py | 20 +- .../_internal/aio/_search_index_client.py | 98 +- .../_internal/aio/_search_indexer_client.py | 113 +- .../documents/indexes/models/__init__.py | 2 + .../sample_synonym_map_operations_async.py | 5 +- .../sample_indexer_datasource_skillset.py | 3 +- .../samples/sample_synonym_map_operations.py | 5 +- .../async_tests/test_service_live_async.py | 93 +- .../tests/test_index_field_helpers.py | 4 +- .../tests/test_service_live.py | 101 +- .../azure/storage/blob/_shared/policies.py | 2 +- .../blob_samples_client_side_encryption.py | 8 +- .../tests/encryption_test_helper.py | 8 +- .../storage/filedatalake/_shared/policies.py | 2 +- .../tests/testcase.py | 2 +- .../storage/fileshare/_shared/policies.py | 2 +- .../tests/encryption_test_helper.py | 8 +- .../azure/storage/queue/_shared/policies.py | 2 +- .../tests/encryption_test_helper.py | 8 +- .../azure-ai-textanalytics/README.md | 127 +- .../azure/ai/textanalytics/_policies.py | 11 +- .../ai/textanalytics/aio/_policies_async.py | 17 +- 67 files changed, 4717 insertions(+), 3885 deletions(-) delete mode 100644 sdk/hdinsight/azure-mgmt-hdinsight/test/recordings/test_mgmt_hdinsight.test_create_with_adls_gen1.yaml create mode 100644 sdk/hdinsight/azure-mgmt-hdinsight/test/recordings/test_mgmt_hdinsight.test_gateway_settings.yaml delete mode 100644 sdk/hdinsight/azure-mgmt-hdinsight/test/recordings/test_mgmt_hdinsight.test_http_extended.yaml delete mode 100644 sdk/identity/azure-identity/azure/identity/_base.py create mode 100644 sdk/identity/azure-identity/azure/identity/_internal/aadclient_certificate.py create mode 100644 sdk/identity/azure-identity/azure/identity/_internal/certificate_credential_base.py create mode 100644 sdk/identity/azure-identity/azure/identity/_internal/client_secret_credential_base.py diff --git a/sdk/core/azure-core/CHANGELOG.md b/sdk/core/azure-core/CHANGELOG.md index 5fd84d19d46..bc650815c81 100644 --- a/sdk/core/azure-core/CHANGELOG.md +++ b/sdk/core/azure-core/CHANGELOG.md @@ -1,6 +1,9 @@ # Release History +## 1.6.1 (Unreleased) + + ## 1.6.0 (2020-06-03) ### Bug fixes diff --git a/sdk/core/azure-core/azure/core/_version.py b/sdk/core/azure-core/azure/core/_version.py index f83b7924083..63b396f7f78 100644 --- a/sdk/core/azure-core/azure/core/_version.py +++ b/sdk/core/azure-core/azure/core/_version.py @@ -9,4 +9,4 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "1.6.0" +VERSION = "1.6.1" diff --git a/sdk/cosmos/azure-cosmos/CHANGELOG.md b/sdk/cosmos/azure-cosmos/CHANGELOG.md index 24a11dd3619..075644d2aea 100644 --- a/sdk/cosmos/azure-cosmos/CHANGELOG.md +++ b/sdk/cosmos/azure-cosmos/CHANGELOG.md @@ -1,3 +1,8 @@ +## 4.0.1 (Unreleased) + +- Fixed error raised when a non string ID is used in an item. It now raises TypeError rather than AttributeError. Issue 11793 - thank you @Rabbit994. + + ## 4.0.0 (2020-05-20) - Stable release. diff --git a/sdk/cosmos/azure-cosmos/azure/cosmos/_cosmos_client_connection.py b/sdk/cosmos/azure-cosmos/azure/cosmos/_cosmos_client_connection.py index 3fa09e0ed51..f9183e73976 100644 --- a/sdk/cosmos/azure-cosmos/azure/cosmos/_cosmos_client_connection.py +++ b/sdk/cosmos/azure-cosmos/azure/cosmos/_cosmos_client_connection.py @@ -31,6 +31,7 @@ from urllib3.util.retry import Retry from azure.core.paging import ItemPaged # type: ignore from azure.core import PipelineClient # type: ignore +from azure.core.exceptions import raise_with_traceback # type: ignore from azure.core.pipeline.policies import ( # type: ignore HTTPPolicy, ContentDecodePolicy, @@ -2480,11 +2481,14 @@ def __CheckAndUnifyQueryFormat(self, query_body): def __ValidateResource(resource): id_ = resource.get("id") if id_: - if id_.find("/") != -1 or id_.find("\\") != -1 or id_.find("?") != -1 or id_.find("#") != -1: - raise ValueError("Id contains illegal chars.") - - if id_[-1] == " ": - raise ValueError("Id ends with a space.") + try: + if id_.find("/") != -1 or id_.find("\\") != -1 or id_.find("?") != -1 or id_.find("#") != -1: + raise ValueError("Id contains illegal chars.") + + if id_[-1] == " ": + raise ValueError("Id ends with a space.") + except AttributeError: + raise_with_traceback(TypeError, message="Id type must be a string.") # Adds the partition key to options def _AddPartitionKey(self, collection_link, document, options): diff --git a/sdk/cosmos/azure-cosmos/azure/cosmos/_version.py b/sdk/cosmos/azure-cosmos/azure/cosmos/_version.py index e2f89349120..db751d88b3e 100644 --- a/sdk/cosmos/azure-cosmos/azure/cosmos/_version.py +++ b/sdk/cosmos/azure-cosmos/azure/cosmos/_version.py @@ -19,4 +19,4 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -VERSION = "4.0.0" +VERSION = "4.0.1" diff --git a/sdk/cosmos/azure-cosmos/samples/access_cosmos_with_resource_token.py b/sdk/cosmos/azure-cosmos/samples/access_cosmos_with_resource_token.py index 9efb03da0ac..87cc629a9f5 100644 --- a/sdk/cosmos/azure-cosmos/samples/access_cosmos_with_resource_token.py +++ b/sdk/cosmos/azure-cosmos/samples/access_cosmos_with_resource_token.py @@ -14,7 +14,7 @@ # https://docs.microsoft.com/azure/cosmos-db/create-sql-api-python#create-a-database-account # # 2. Microsoft Azure Cosmos -# pip install azure-cosmos==4.0.0 +# pip install azure-cosmos>=4.0.0 # ---------------------------------------------------------------------------------------------------------- # Sample - how to get and use resource token that allows restricted access to data # ---------------------------------------------------------------------------------------------------------- diff --git a/sdk/cosmos/azure-cosmos/test/test_crud.py b/sdk/cosmos/azure-cosmos/test/test_crud.py index d8e4480381a..a809382a197 100644 --- a/sdk/cosmos/azure-cosmos/test/test_crud.py +++ b/sdk/cosmos/azure-cosmos/test/test_crud.py @@ -207,7 +207,7 @@ def test_sql_query_crud(self): self.assertEqual(0, len(databases), 'Unexpected number of query results.') # query with a string. - databases = list(self.client.query_databases('SELECT * FROM root r WHERE r.id="' + db2.id + '"')) + databases = list(self.client.query_databases('SELECT * FROM root r WHERE r.id="' + db2.id + '"')) #nosec self.assertEqual(1, len(databases), 'Unexpected number of query results.') self.client.delete_database(db1.id) self.client.delete_database(db2.id) @@ -507,7 +507,7 @@ def test_partitioned_collection_document_crud_and_query(self): # query document on the partition key specified in the predicate will pass even without setting enableCrossPartitionQuery or passing in the partitionKey value documentlist = list(created_collection.query_items( { - 'query': 'SELECT * FROM root r WHERE r.id=\'' + replaced_document.get('id') + '\'' + 'query': 'SELECT * FROM root r WHERE r.id=\'' + replaced_document.get('id') + '\'' #nosec })) self.assertEqual(1, len(documentlist)) @@ -515,14 +515,14 @@ def test_partitioned_collection_document_crud_and_query(self): try: list(created_collection.query_items( { - 'query': 'SELECT * FROM root r WHERE r.key=\'' + replaced_document.get('key') + '\'' + 'query': 'SELECT * FROM root r WHERE r.key=\'' + replaced_document.get('key') + '\'' #nosec })) except Exception: pass # cross partition query documentlist = list(created_collection.query_items( - query='SELECT * FROM root r WHERE r.key=\'' + replaced_document.get('key') + '\'', + query='SELECT * FROM root r WHERE r.key=\'' + replaced_document.get('key') + '\'', #nosec enable_cross_partition_query=True )) @@ -530,7 +530,7 @@ def test_partitioned_collection_document_crud_and_query(self): # query document by providing the partitionKey value documentlist = list(created_collection.query_items( - query='SELECT * FROM root r WHERE r.key=\'' + replaced_document.get('key') + '\'', + query='SELECT * FROM root r WHERE r.key=\'' + replaced_document.get('key') + '\'', #nosec partition_key=replaced_document.get('id') )) @@ -746,14 +746,14 @@ def test_partitioned_collection_conflict_crud_and_query(self): # query conflicts on any property other than partitionKey will fail without setting enableCrossPartitionQuery or passing in the partitionKey value try: list(created_collection.query_conflicts( - query='SELECT * FROM root r WHERE r.resourceType=\'' + conflict_definition.get( + query='SELECT * FROM root r WHERE r.resourceType=\'' + conflict_definition.get( #nosec 'resourceType') + '\'' )) except Exception: pass conflictlist = list(created_collection.query_conflicts( - query='SELECT * FROM root r WHERE r.resourceType=\'' + conflict_definition.get('resourceType') + '\'', + query='SELECT * FROM root r WHERE r.resourceType=\'' + conflict_definition.get('resourceType') + '\'', #nosec enable_cross_partition_query=True )) @@ -762,7 +762,7 @@ def test_partitioned_collection_conflict_crud_and_query(self): # query conflicts by providing the partitionKey value options = {'partitionKey': conflict_definition.get('id')} conflictlist = list(created_collection.query_conflicts( - query='SELECT * FROM root r WHERE r.resourceType=\'' + conflict_definition.get('resourceType') + '\'', + query='SELECT * FROM root r WHERE r.resourceType=\'' + conflict_definition.get('resourceType') + '\'', #nosec partition_key=conflict_definition['id'] )) @@ -939,6 +939,11 @@ def test_document_upsert(self): self.assertEqual(created_document['id'], document_definition['id']) + # test error for non-string id + with pytest.raises(TypeError): + document_definition['id'] = 7 + created_collection.upsert_item(body=document_definition) + # read documents after creation and verify updated count documents = list(created_collection.read_all_items()) self.assertEqual( diff --git a/sdk/cosmos/azure-cosmos/test/test_globaldb.py b/sdk/cosmos/azure-cosmos/test/test_globaldb.py index 467a0de40e6..88a9289c669 100644 --- a/sdk/cosmos/azure-cosmos/test/test_globaldb.py +++ b/sdk/cosmos/azure-cosmos/test/test_globaldb.py @@ -89,7 +89,7 @@ def setUp(self): self.client = cosmos_client_connection.CosmosClientConnection(Test_globaldb_tests.host, Test_globaldb_tests.masterKey) # Create the test database only when it's not already present - query_iterable = self.client.QueryDatabases('SELECT * FROM root r WHERE r.id=\'' + Test_globaldb_tests.test_database_id + '\'') + query_iterable = self.client.QueryDatabases('SELECT * FROM root r WHERE r.id=\'' + Test_globaldb_tests.test_database_id + '\'') #nosec it = iter(query_iterable) self.test_db = next(it, None) @@ -97,7 +97,7 @@ def setUp(self): self.test_db = self.client.CreateDatabase({'id' : Test_globaldb_tests.test_database_id}) # Create the test collection only when it's not already present - query_iterable = self.client.QueryContainers(self.test_db['_self'], 'SELECT * FROM root r WHERE r.id=\'' + Test_globaldb_tests.test_collection_id + '\'') + query_iterable = self.client.QueryContainers(self.test_db['_self'], 'SELECT * FROM root r WHERE r.id=\'' + Test_globaldb_tests.test_collection_id + '\'') #nosec it = iter(query_iterable) self.test_coll = next(it, None) diff --git a/sdk/cosmos/azure-cosmos/test/test_multi_orderby.py b/sdk/cosmos/azure-cosmos/test/test_multi_orderby.py index b68db27b520..1b68b39ae09 100644 --- a/sdk/cosmos/azure-cosmos/test/test_multi_orderby.py +++ b/sdk/cosmos/azure-cosmos/test/test_multi_orderby.py @@ -252,7 +252,7 @@ def test_multi_orderby_queries(self): where_string = "WHERE root." + self.NUMBER_FIELD + " % 2 = 0" if has_filter else "" query = "SELECT " + top_string + " [" + select_item_builder + "] " + \ "FROM root " + where_string + " " + \ - "ORDER BY " + orderby_item_builder + "ORDER BY " + orderby_item_builder #nosec expected_ordered_list = self.top(self.sort(self.filter(self.items, has_filter), composite_index, invert), has_top, top_count) diff --git a/sdk/cosmos/azure-cosmos/test/test_orderby.py b/sdk/cosmos/azure-cosmos/test/test_orderby.py index ba1eb99b3c1..da9e26bc3d1 100644 --- a/sdk/cosmos/azure-cosmos/test/test_orderby.py +++ b/sdk/cosmos/azure-cosmos/test/test_orderby.py @@ -168,7 +168,7 @@ def test_orderby_top_query(self): # an order by query with top, total existing docs more than requested top count query = { - 'query': 'SELECT top %d * FROM root r order by r.spam' % top_count + 'query': 'SELECT top %d * FROM root r order by r.spam' % top_count #nosec } def get_order_by_key(r): @@ -186,7 +186,7 @@ def test_orderby_top_query_less_results_than_top_counts(self): # an order by query with top, total existing docs less than requested top count query = { - 'query': 'SELECT top %d * FROM root r order by r.spam' % top_count + 'query': 'SELECT top %d * FROM root r order by r.spam' % top_count #nosec } def get_order_by_key(r): @@ -226,7 +226,7 @@ def test_top_query(self): # a top query, the results will be sorted based on the target partition key range query = { - 'query': 'SELECT top %d * FROM root r' % len(expected_ordered_ids) + 'query': 'SELECT top %d * FROM root r' % len(expected_ordered_ids) #nosec } self.execute_query_and_validate_results(query, expected_ordered_ids) @@ -260,7 +260,7 @@ def test_top_query_as_string(self): expected_ordered_ids = [d['id'] for d in first_two_ranges_results] # a top query, the results will be sorted based on the target partition key range - query = 'SELECT top %d * FROM root r' % len(expected_ordered_ids) + query = 'SELECT top %d * FROM root r' % len(expected_ordered_ids) #nosec self.execute_query_and_validate_results(query, expected_ordered_ids) def test_parametrized_top_query(self): diff --git a/sdk/cosmos/azure-cosmos/test/test_query.py b/sdk/cosmos/azure-cosmos/test/test_query.py index e9e066c8df5..80cb9c3ec32 100644 --- a/sdk/cosmos/azure-cosmos/test/test_query.py +++ b/sdk/cosmos/azure-cosmos/test/test_query.py @@ -349,55 +349,55 @@ def test_distinct(self): padded_docs = self._pad_with_none(documents, distinct_field) self._validate_distinct(created_collection=created_collection, - query='SELECT distinct c.%s from c ORDER BY c.%s' % (distinct_field, distinct_field), + query='SELECT distinct c.%s from c ORDER BY c.%s' % (distinct_field, distinct_field), #nosec results=self._get_distinct_docs(self._get_order_by_docs(padded_docs, distinct_field, None), distinct_field, None, True), is_select=False, fields=[distinct_field]) self._validate_distinct(created_collection=created_collection, - query='SELECT distinct c.%s, c.%s from c ORDER BY c.%s, c.%s' % (distinct_field, pk_field, pk_field, distinct_field), + query='SELECT distinct c.%s, c.%s from c ORDER BY c.%s, c.%s' % (distinct_field, pk_field, pk_field, distinct_field), #nosec results=self._get_distinct_docs(self._get_order_by_docs(padded_docs, pk_field, distinct_field), distinct_field, pk_field, True), is_select=False, fields=[distinct_field, pk_field]) self._validate_distinct(created_collection=created_collection, - query='SELECT distinct c.%s, c.%s from c ORDER BY c.%s, c.%s' % (distinct_field, pk_field, distinct_field, pk_field), + query='SELECT distinct c.%s, c.%s from c ORDER BY c.%s, c.%s' % (distinct_field, pk_field, distinct_field, pk_field), #nosec results=self._get_distinct_docs(self._get_order_by_docs(padded_docs, distinct_field, pk_field), distinct_field, pk_field, True), is_select=False, fields=[distinct_field, pk_field]) self._validate_distinct(created_collection=created_collection, - query='SELECT distinct value c.%s from c ORDER BY c.%s' % (distinct_field, distinct_field), + query='SELECT distinct value c.%s from c ORDER BY c.%s' % (distinct_field, distinct_field), #nosec results=self._get_distinct_docs(self._get_order_by_docs(padded_docs, distinct_field, None), distinct_field, None, True), is_select=False, fields=[distinct_field]) self._validate_distinct(created_collection=created_collection, - query='SELECT distinct c.%s from c' % (distinct_field), + query='SELECT distinct c.%s from c' % (distinct_field), #nosec results=self._get_distinct_docs(padded_docs, distinct_field, None, False), is_select=True, fields=[distinct_field]) self._validate_distinct(created_collection=created_collection, - query='SELECT distinct c.%s, c.%s from c' % (distinct_field, pk_field), + query='SELECT distinct c.%s, c.%s from c' % (distinct_field, pk_field), #nosec results=self._get_distinct_docs(padded_docs, distinct_field, pk_field, False), is_select=True, fields=[distinct_field, pk_field]) self._validate_distinct(created_collection=created_collection, - query='SELECT distinct value c.%s from c' % (distinct_field), + query='SELECT distinct value c.%s from c' % (distinct_field), #nosec results=self._get_distinct_docs(padded_docs, distinct_field, None, True), is_select=True, fields=[distinct_field]) self._validate_distinct(created_collection=created_collection, - query='SELECT distinct c.%s from c ORDER BY c.%s' % (different_field, different_field), + query='SELECT distinct c.%s from c ORDER BY c.%s' % (different_field, different_field), #nosec results=[], is_select=True, fields=[different_field]) self._validate_distinct(created_collection=created_collection, - query='SELECT distinct c.%s from c' % (different_field), + query='SELECT distinct c.%s from c' % (different_field), #nosec results=['None'], is_select=True, fields=[different_field]) diff --git a/sdk/datalake/azure-mgmt-datalake-analytics/README.md b/sdk/datalake/azure-mgmt-datalake-analytics/README.md index a7b30f74cea..e90c728d4da 100644 --- a/sdk/datalake/azure-mgmt-datalake-analytics/README.md +++ b/sdk/datalake/azure-mgmt-datalake-analytics/README.md @@ -1,30 +1,21 @@ -## Microsoft Azure SDK for Python +# Microsoft Azure SDK for Python -This is the Microsoft Azure Data Lake Analytics Management Client -Library. +This is the Microsoft Azure Data Lake Analytics 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 a more complete set of Azure libraries, see the -[azure](https://pypi.python.org/pypi/azure) bundle package. - -## Usage - -For code examples, see [Data Lake Analytics -Management](https://docs.microsoft.com/python/api/overview/azure/data-lake-analytics) +For code examples, see [Data Lake Analytics Management](https://docs.microsoft.com/python/api/overview/azure/data-lake-analytics) 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) +# 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) section of the project. -![image](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-datalake-analytics%2FREADME.png) + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-datalake-analytics%2FREADME.png) diff --git a/sdk/datalake/azure-mgmt-datalake-analytics/setup.py b/sdk/datalake/azure-mgmt-datalake-analytics/setup.py index 59d06fe2161..7cde837fe30 100644 --- a/sdk/datalake/azure-mgmt-datalake-analytics/setup.py +++ b/sdk/datalake/azure-mgmt-datalake-analytics/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/datalake/azure-mgmt-datalake-analytics/tests/test_mgmt_datalake_analytics.py b/sdk/datalake/azure-mgmt-datalake-analytics/tests/test_mgmt_datalake_analytics.py index fd9d27cf5e6..812dd68c8f3 100644 --- a/sdk/datalake/azure-mgmt-datalake-analytics/tests/test_mgmt_datalake_analytics.py +++ b/sdk/datalake/azure-mgmt-datalake-analytics/tests/test_mgmt_datalake_analytics.py @@ -154,7 +154,7 @@ def setUp(self): ) AS T(a, b); -END;""".format(self.db_name, self.table_name, self.tvf_name, self.view_name, self.proc_name) +END;""".format(self.db_name, self.table_name, self.tvf_name, self.view_name, self.proc_name) #nosec # define all the job IDs to be used during execution if self.is_playback(): diff --git a/sdk/eventhub/azure-eventhub-checkpointstoreblob-aio/azure/eventhub/extensions/checkpointstoreblobaio/_vendor/storage/blob/_shared/policies.py b/sdk/eventhub/azure-eventhub-checkpointstoreblob-aio/azure/eventhub/extensions/checkpointstoreblobaio/_vendor/storage/blob/_shared/policies.py index b603efe505e..07331541191 100644 --- a/sdk/eventhub/azure-eventhub-checkpointstoreblob-aio/azure/eventhub/extensions/checkpointstoreblobaio/_vendor/storage/blob/_shared/policies.py +++ b/sdk/eventhub/azure-eventhub-checkpointstoreblob-aio/azure/eventhub/extensions/checkpointstoreblobaio/_vendor/storage/blob/_shared/policies.py @@ -350,7 +350,7 @@ def __init__(self, **kwargs): # pylint: disable=unused-argument @staticmethod def get_content_md5(data): - md5 = hashlib.md5() + md5 = hashlib.md5() #nosec if isinstance(data, bytes): md5.update(data) elif hasattr(data, 'read'): diff --git a/sdk/eventhub/azure-eventhub-checkpointstoreblob/azure/eventhub/extensions/checkpointstoreblob/_vendor/storage/blob/_shared/policies.py b/sdk/eventhub/azure-eventhub-checkpointstoreblob/azure/eventhub/extensions/checkpointstoreblob/_vendor/storage/blob/_shared/policies.py index b603efe505e..07331541191 100644 --- a/sdk/eventhub/azure-eventhub-checkpointstoreblob/azure/eventhub/extensions/checkpointstoreblob/_vendor/storage/blob/_shared/policies.py +++ b/sdk/eventhub/azure-eventhub-checkpointstoreblob/azure/eventhub/extensions/checkpointstoreblob/_vendor/storage/blob/_shared/policies.py @@ -350,7 +350,7 @@ def __init__(self, **kwargs): # pylint: disable=unused-argument @staticmethod def get_content_md5(data): - md5 = hashlib.md5() + md5 = hashlib.md5() #nosec if isinstance(data, bytes): md5.update(data) elif hasattr(data, 'read'): diff --git a/sdk/hdinsight/azure-mgmt-hdinsight/dev_requirements.txt b/sdk/hdinsight/azure-mgmt-hdinsight/dev_requirements.txt index b0c11033324..99233514bcb 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 216003de85b..e37fcc77727 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 5f7597fe1f9..00000000000 --- 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 00000000000..d0891ab0cbb --- /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 1f6625a2944..00000000000 --- 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 7b0b0438536..10db33ebb1b 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 65821f7d072..36d331d9e3d 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/azure/identity/_base.py b/sdk/identity/azure-identity/azure/identity/_base.py deleted file mode 100644 index 45941d80a88..00000000000 --- a/sdk/identity/azure-identity/azure/identity/_base.py +++ /dev/null @@ -1,88 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -import abc -import binascii - -from cryptography import x509 -from cryptography.hazmat.primitives import hashes, serialization -from cryptography.hazmat.backends import default_backend -from msal.oauth2cli import JwtSigner -import six - -try: - ABC = abc.ABC -except AttributeError: # Python 2.7, abc exists, but not ABC - ABC = abc.ABCMeta("ABC", (object,), {"__slots__": ()}) # type: ignore - -try: - from typing import TYPE_CHECKING -except ImportError: - TYPE_CHECKING = False - -if TYPE_CHECKING: - # pylint:disable=unused-import - from typing import Any, Optional, Union - - -class ClientSecretCredentialBase(object): - """Sans I/O base for client secret credentials""" - - def __init__(self, tenant_id, client_id, secret, **kwargs): # pylint:disable=unused-argument - # type: (str, str, str, **Any) -> None - if not client_id: - raise ValueError("client_id should be the id of an Azure Active Directory application") - if not secret: - raise ValueError("secret should be an Azure Active Directory application's client secret") - if not tenant_id: - raise ValueError( - "tenant_id should be an Azure Active Directory tenant's id (also called its 'directory id')" - ) - self._form_data = {"client_id": client_id, "client_secret": secret, "grant_type": "client_credentials"} - super(ClientSecretCredentialBase, self).__init__() - - -class CertificateCredentialBase(ABC): - """Sans I/O base for certificate credentials""" - - def __init__(self, tenant_id, client_id, certificate_path, **kwargs): # pylint:disable=unused-argument - # type: (str, str, str, **Any) -> None - if not certificate_path: - raise ValueError( - "'certificate_path' must be the path to a PEM file containing an x509 certificate and its private key" - ) - - super(CertificateCredentialBase, self).__init__() - - password = kwargs.pop("password", None) - if isinstance(password, six.text_type): - password = password.encode(encoding="utf-8") - - with open(certificate_path, "rb") as f: - pem_bytes = f.read() - - private_key = serialization.load_pem_private_key(pem_bytes, password=password, backend=default_backend()) - cert = x509.load_pem_x509_certificate(pem_bytes, default_backend()) - fingerprint = cert.fingerprint(hashes.SHA1()) #nosec - - self._client = self._get_auth_client(tenant_id, **kwargs) - self._client_id = client_id - self._signer = JwtSigner(private_key, "RS256", sha1_thumbprint=binascii.hexlify(fingerprint)) - - def _get_request_data(self, *scopes): - assertion = self._signer.sign_assertion(audience=self._client.auth_url, issuer=self._client_id) - if isinstance(assertion, six.binary_type): - assertion = assertion.decode("utf-8") - - return { - "client_assertion": assertion, - "client_assertion_type": "urn:ietf:params:oauth:client-assertion-type:jwt-bearer", - "client_id": self._client_id, - "grant_type": "client_credentials", - "scope": " ".join(scopes), - } - - @abc.abstractmethod - def _get_auth_client(self, tenant_id, **kwargs): - pass diff --git a/sdk/identity/azure-identity/azure/identity/_credentials/certificate.py b/sdk/identity/azure-identity/azure/identity/_credentials/certificate.py index 3ed84cd335a..56d640c12e3 100644 --- a/sdk/identity/azure-identity/azure/identity/_credentials/certificate.py +++ b/sdk/identity/azure-identity/azure/identity/_credentials/certificate.py @@ -4,8 +4,7 @@ # ------------------------------------ from typing import TYPE_CHECKING -from .._authn_client import AuthnClient -from .._base import CertificateCredentialBase +from .._internal import AadClient, CertificateCredentialBase if TYPE_CHECKING: from azure.core.credentials import AccessToken @@ -42,11 +41,10 @@ def get_token(self, *scopes, **kwargs): # pylint:disable=unused-argument if not scopes: raise ValueError("'get_token' requires at least one scope") - token = self._client.get_cached_token(scopes) + token = self._client.get_cached_access_token(scopes) if not token: - data = self._get_request_data(*scopes) - token = self._client.request_token(scopes, form_data=data) + token = self._client.obtain_token_by_client_certificate(scopes, self._certificate, **kwargs) return token - def _get_auth_client(self, tenant_id, **kwargs): - return AuthnClient(tenant=tenant_id, **kwargs) + def _get_auth_client(self, tenant_id, client_id, **kwargs): + return AadClient(tenant_id, client_id, **kwargs) diff --git a/sdk/identity/azure-identity/azure/identity/_credentials/client_secret.py b/sdk/identity/azure-identity/azure/identity/_credentials/client_secret.py index f8dbd45bce9..35ec0403114 100644 --- a/sdk/identity/azure-identity/azure/identity/_credentials/client_secret.py +++ b/sdk/identity/azure-identity/azure/identity/_credentials/client_secret.py @@ -2,8 +2,7 @@ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # ------------------------------------ -from .._authn_client import AuthnClient -from .._base import ClientSecretCredentialBase +from .._internal import AadClient, ClientSecretCredentialBase try: from typing import TYPE_CHECKING @@ -28,12 +27,7 @@ class ClientSecretCredential(ClientSecretCredentialBase): defines authorities for other clouds. """ - def __init__(self, tenant_id, client_id, client_secret, **kwargs): - # type: (str, str, str, **Any) -> None - super(ClientSecretCredential, self).__init__(tenant_id, client_id, client_secret, **kwargs) - self._client = AuthnClient(tenant=tenant_id, **kwargs) - - def get_token(self, *scopes, **kwargs): # pylint:disable=unused-argument + def get_token(self, *scopes, **kwargs): # type: (*str, **Any) -> AccessToken """Request an access token for `scopes`. @@ -48,8 +42,10 @@ def get_token(self, *scopes, **kwargs): # pylint:disable=unused-argument if not scopes: raise ValueError("'get_token' requires at least one scope") - token = self._client.get_cached_token(scopes) + token = self._client.get_cached_access_token(scopes) if not token: - data = dict(self._form_data, scope=" ".join(scopes)) - token = self._client.request_token(scopes, form_data=data) + token = self._client.obtain_token_by_client_secret(scopes, self._secret, **kwargs) return token + + def _get_auth_client(self, tenant_id, client_id, **kwargs): + return AadClient(tenant_id, client_id, **kwargs) diff --git a/sdk/identity/azure-identity/azure/identity/_internal/__init__.py b/sdk/identity/azure-identity/azure/identity/_internal/__init__.py index b6d5ec1f263..40a11461b55 100644 --- a/sdk/identity/azure-identity/azure/identity/_internal/__init__.py +++ b/sdk/identity/azure-identity/azure/identity/_internal/__init__.py @@ -33,6 +33,9 @@ def get_default_authority(): from .aad_client import AadClient from .aad_client_base import AadClientBase from .auth_code_redirect_handler import AuthCodeRedirectServer +from .aadclient_certificate import AadClientCertificate +from .certificate_credential_base import CertificateCredentialBase +from .client_secret_credential_base import ClientSecretCredentialBase from .exception_wrapper import wrap_exceptions from .msal_credentials import ConfidentialClientCredential, InteractiveCredential, PublicClientCredential from .msal_transport_adapter import MsalTransportAdapter, MsalTransportResponse @@ -56,6 +59,9 @@ def _scopes_to_resource(*scopes): "AadClient", "AadClientBase", "AuthCodeRedirectServer", + "AadClientCertificate", + "CertificateCredentialBase", + "ClientSecretCredentialBase", "ConfidentialClientCredential", "get_default_authority", "InteractiveCredential", diff --git a/sdk/identity/azure-identity/azure/identity/_internal/aad_client.py b/sdk/identity/azure-identity/azure/identity/_internal/aad_client.py index 75de3d05cf4..d84fe1ea0d3 100644 --- a/sdk/identity/azure-identity/azure/identity/_internal/aad_client.py +++ b/sdk/identity/azure-identity/azure/identity/_internal/aad_client.py @@ -26,13 +26,14 @@ from azure.core.credentials import AccessToken from azure.core.pipeline.policies import HTTPPolicy, SansIOHTTPPolicy from azure.core.pipeline.transport import HttpTransport + from .._internal import AadClientCertificate Policy = Union[HTTPPolicy, SansIOHTTPPolicy] class AadClient(AadClientBase): def obtain_token_by_authorization_code(self, scopes, code, redirect_uri, client_secret=None, **kwargs): - # type: (str, str, Sequence[str], Optional[str], **Any) -> AccessToken + # type: (Sequence[str], str, str, Optional[str], **Any) -> AccessToken request = self._get_auth_code_request( scopes=scopes, code=code, redirect_uri=redirect_uri, client_secret=client_secret ) @@ -41,8 +42,24 @@ def obtain_token_by_authorization_code(self, scopes, code, redirect_uri, client_ content = ContentDecodePolicy.deserialize_from_http_generics(response.http_response) return self._process_response(response=content, scopes=scopes, now=now) + def obtain_token_by_client_certificate(self, scopes, certificate, **kwargs): + # type: (Sequence[str], AadClientCertificate, **Any) -> AccessToken + request = self._get_client_certificate_request(scopes, certificate) + now = int(time.time()) + response = self._pipeline.run(request, stream=False, **kwargs) + content = ContentDecodePolicy.deserialize_from_http_generics(response.http_response) + return self._process_response(response=content, scopes=scopes, now=now) + + def obtain_token_by_client_secret(self, scopes, secret, **kwargs): + # type: (Sequence[str], str, **Any) -> AccessToken + request = self._get_client_secret_request(scopes, secret) + now = int(time.time()) + response = self._pipeline.run(request, stream=False, **kwargs) + content = ContentDecodePolicy.deserialize_from_http_generics(response.http_response) + return self._process_response(response=content, scopes=scopes, now=now) + def obtain_token_by_refresh_token(self, scopes, refresh_token, **kwargs): - # type: (str, Sequence[str], **Any) -> AccessToken + # type: (Sequence[str], str, **Any) -> AccessToken request = self._get_refresh_token_request(scopes, refresh_token) now = int(time.time()) response = self._pipeline.run(request, stream=False, **kwargs) diff --git a/sdk/identity/azure-identity/azure/identity/_internal/aad_client_base.py b/sdk/identity/azure-identity/azure/identity/_internal/aad_client_base.py index bf659087a2c..61c69733726 100644 --- a/sdk/identity/azure-identity/azure/identity/_internal/aad_client_base.py +++ b/sdk/identity/azure-identity/azure/identity/_internal/aad_client_base.py @@ -3,9 +3,13 @@ # Licensed under the MIT License. # ------------------------------------ import abc +import base64 import copy +import json import time +from uuid import uuid4 +import six from msal import TokenCache from azure.core.pipeline.transport import HttpRequest @@ -29,6 +33,7 @@ from azure.core.pipeline import AsyncPipeline, Pipeline from azure.core.pipeline.policies import AsyncHTTPPolicy, HTTPPolicy, SansIOHTTPPolicy from azure.core.pipeline.transport import AsyncHttpTransport, HttpTransport + from .._internal import AadClientCertificate PipelineType = Union[AsyncPipeline, Pipeline] PolicyType = Union[AsyncHTTPPolicy, HTTPPolicy, SansIOHTTPPolicy] @@ -62,6 +67,14 @@ def get_cached_refresh_tokens(self, scopes): def obtain_token_by_authorization_code(self, scopes, code, redirect_uri, client_secret=None, **kwargs): pass + @abc.abstractmethod + def obtain_token_by_client_certificate(self, scopes, certificate, **kwargs): + pass + + @abc.abstractmethod + def obtain_token_by_client_secret(self, scopes, secret, **kwargs): + pass + @abc.abstractmethod def obtain_token_by_refresh_token(self, scopes, refresh_token, **kwargs): pass @@ -90,8 +103,7 @@ def _process_response(self, response, scopes, now): return AccessToken(response_copy["access_token"], expires_on) def _get_auth_code_request(self, scopes, code, redirect_uri, client_secret=None): - # type: (str, str, Sequence[str], Optional[str]) -> HttpRequest - + # type: (Sequence[str], str, str, Optional[str]) -> HttpRequest data = { "client_id": self._client_id, "code": code, @@ -107,9 +119,62 @@ def _get_auth_code_request(self, scopes, code, redirect_uri, client_secret=None) ) return request - def _get_refresh_token_request(self, scopes, refresh_token): - # type: (str, Sequence[str]) -> HttpRequest + def _get_client_certificate_request(self, scopes, certificate): + # type: (Sequence[str], AadClientCertificate) -> HttpRequest + assertion = self._get_jwt_assertion(certificate) + data = { + "client_assertion": assertion, + "client_assertion_type": "urn:ietf:params:oauth:client-assertion-type:jwt-bearer", + "client_id": self._client_id, + "grant_type": "client_credentials", + "scope": " ".join(scopes), + } + request = HttpRequest( + "POST", self._token_endpoint, headers={"Content-Type": "application/x-www-form-urlencoded"}, data=data + ) + return request + + def _get_client_secret_request(self, scopes, secret): + # type: (Sequence[str], str) -> HttpRequest + data = { + "client_id": self._client_id, + "client_secret": secret, + "grant_type": "client_credentials", + "scope": " ".join(scopes), + } + request = HttpRequest( + "POST", self._token_endpoint, headers={"Content-Type": "application/x-www-form-urlencoded"}, data=data + ) + return request + + def _get_jwt_assertion(self, certificate): + # type: (AadClientCertificate) -> str + now = int(time.time()) + header = six.ensure_binary( + json.dumps({"typ": "JWT", "alg": "RS256", "x5t": certificate.thumbprint}), encoding="utf-8" + ) + payload = six.ensure_binary( + json.dumps( + { + "jti": str(uuid4()), + "aud": self._token_endpoint, + "iss": self._client_id, + "sub": self._client_id, + "nbf": now, + "exp": now + (60 * 30), + } + ), + encoding="utf-8", + ) + jws = base64.urlsafe_b64encode(header) + b"." + base64.urlsafe_b64encode(payload) + signature = certificate.sign(jws) + jwt_bytes = jws + b"." + base64.urlsafe_b64encode(signature) + + return jwt_bytes.decode("utf-8") + + def _get_refresh_token_request(self, scopes, refresh_token): + # type: (Sequence[str], str) -> HttpRequest data = { "grant_type": "refresh_token", "refresh_token": refresh_token, diff --git a/sdk/identity/azure-identity/azure/identity/_internal/aadclient_certificate.py b/sdk/identity/azure-identity/azure/identity/_internal/aadclient_certificate.py new file mode 100644 index 00000000000..271fcd42dcb --- /dev/null +++ b/sdk/identity/azure-identity/azure/identity/_internal/aadclient_certificate.py @@ -0,0 +1,41 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +import base64 +from typing import TYPE_CHECKING + +from cryptography import x509 +from cryptography.hazmat.primitives import hashes, serialization +from cryptography.hazmat.primitives.asymmetric import padding +from cryptography.hazmat.backends import default_backend +import six + +if TYPE_CHECKING: + # pylint:disable=unused-import,ungrouped-imports + from typing import Optional + + +class AadClientCertificate(object): + """Wraps 'cryptography' to provide the crypto operations AadClient requires for certificate authentication. + + :param bytes pem_bytes: bytes of a a PEM-encoded certificate including the private key + :param bytes password: (optional) the certificate's password + """ + def __init__(self, pem_bytes, password=None): + # type: (bytes, Optional[bytes]) -> None + cert = x509.load_pem_x509_certificate(pem_bytes, default_backend()) + fingerprint = cert.fingerprint(hashes.SHA1()) # nosec + self._private_key = serialization.load_pem_private_key(pem_bytes, password=password, backend=default_backend()) + self._thumbprint = six.ensure_str(base64.urlsafe_b64encode(fingerprint), encoding="utf-8") + + @property + def thumbprint(self): + # type: () -> str + """The certificate's SHA1 thumbprint as a base64url-encoded string""" + return self._thumbprint + + def sign(self, plaintext): + # type: (bytes) -> bytes + """Sign bytes using RS256""" + return self._private_key.sign(plaintext, padding.PKCS1v15(), hashes.SHA256()) diff --git a/sdk/identity/azure-identity/azure/identity/_internal/certificate_credential_base.py b/sdk/identity/azure-identity/azure/identity/_internal/certificate_credential_base.py new file mode 100644 index 00000000000..1b8736c1401 --- /dev/null +++ b/sdk/identity/azure-identity/azure/identity/_internal/certificate_credential_base.py @@ -0,0 +1,47 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +import abc + +import six +from azure.identity._internal import AadClientCertificate + +try: + ABC = abc.ABC +except AttributeError: # Python 2.7, abc exists, but not ABC + ABC = abc.ABCMeta("ABC", (object,), {"__slots__": ()}) # type: ignore + +try: + from typing import TYPE_CHECKING +except ImportError: + TYPE_CHECKING = False + +if TYPE_CHECKING: + # pylint:disable=unused-import + from typing import Any + + +class CertificateCredentialBase(ABC): + def __init__(self, tenant_id, client_id, certificate_path, **kwargs): + # type: (str, str, str, **Any) -> None + if not certificate_path: + raise ValueError( + "'certificate_path' must be the path to a PEM file containing an x509 certificate and its private key" + ) + + super(CertificateCredentialBase, self).__init__() + + password = kwargs.pop("password", None) + if isinstance(password, six.text_type): + password = password.encode(encoding="utf-8") + + with open(certificate_path, "rb") as f: + pem_bytes = f.read() + + self._certificate = AadClientCertificate(pem_bytes, password=password) + self._client = self._get_auth_client(tenant_id, client_id, **kwargs) + + @abc.abstractmethod + def _get_auth_client(self, tenant_id, client_id, **kwargs): + pass diff --git a/sdk/identity/azure-identity/azure/identity/_internal/client_secret_credential_base.py b/sdk/identity/azure-identity/azure/identity/_internal/client_secret_credential_base.py new file mode 100644 index 00000000000..977c55dab40 --- /dev/null +++ b/sdk/identity/azure-identity/azure/identity/_internal/client_secret_credential_base.py @@ -0,0 +1,35 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +import abc +from typing import TYPE_CHECKING + +try: + ABC = abc.ABC +except AttributeError: # Python 2.7 + ABC = abc.ABCMeta("ABC", (object,), {"__slots__": ()}) # type: ignore + +if TYPE_CHECKING: + # pylint:disable=unused-import,ungrouped-imports + from typing import Any + + +class ClientSecretCredentialBase(ABC): + def __init__(self, tenant_id, client_id, client_secret, **kwargs): + # type: (str, str, str, **Any) -> None + if not client_id: + raise ValueError("client_id should be the id of an Azure Active Directory application") + if not client_secret: + raise ValueError("secret should be an Azure Active Directory application's client secret") + if not tenant_id: + raise ValueError( + "tenant_id should be an Azure Active Directory tenant's id (also called its 'directory id')" + ) + + self._client = self._get_auth_client(tenant_id, client_id, **kwargs) + self._secret = client_secret + + @abc.abstractmethod + def _get_auth_client(self, tenant_id, client_id, **kwargs): + pass diff --git a/sdk/identity/azure-identity/azure/identity/_internal/msal_credentials.py b/sdk/identity/azure-identity/azure/identity/_internal/msal_credentials.py index 1701a0c12b8..775b11b7936 100644 --- a/sdk/identity/azure-identity/azure/identity/_internal/msal_credentials.py +++ b/sdk/identity/azure-identity/azure/identity/_internal/msal_credentials.py @@ -61,18 +61,24 @@ def _build_auth_record(response): """Build an AuthenticationRecord from the result of an MSAL ClientApplication token request""" try: - client_info = json.loads(_decode_client_info(response["client_info"])) id_token = response["id_token_claims"] + if "client_info" in response: + client_info = json.loads(_decode_client_info(response["client_info"])) + home_account_id = "{uid}.{utid}".format(**client_info) + else: + # MSAL uses the subject claim as home_account_id when the STS doesn't provide client_info + home_account_id = id_token["sub"] + return AuthenticationRecord( authority=urlparse(id_token["iss"]).netloc, # "iss" is the URL of the issuing tenant client_id=id_token["aud"], - home_account_id="{uid}.{utid}".format(**client_info), + home_account_id=home_account_id, tenant_id=id_token["tid"], # tenant which issued the token, not necessarily user's home tenant username=id_token["preferred_username"], ) except (KeyError, ValueError): - # surprising: msal.ClientApplication always requests client_info and an id token, whose shapes shouldn't change + # surprising: msal.ClientApplication always requests an id token, whose shape shouldn't change return None diff --git a/sdk/identity/azure-identity/azure/identity/aio/_credentials/certificate.py b/sdk/identity/azure-identity/azure/identity/aio/_credentials/certificate.py index 300728f221f..f79a61276ce 100644 --- a/sdk/identity/azure-identity/azure/identity/aio/_credentials/certificate.py +++ b/sdk/identity/azure-identity/azure/identity/aio/_credentials/certificate.py @@ -5,8 +5,8 @@ from typing import TYPE_CHECKING from .base import AsyncCredentialBase -from .._authn_client import AsyncAuthnClient -from ..._base import CertificateCredentialBase +from .._internal import AadClient +from ..._internal import CertificateCredentialBase if TYPE_CHECKING: from typing import Any @@ -51,11 +51,10 @@ async def get_token(self, *scopes: str, **kwargs: "Any") -> "AccessToken": # py if not scopes: raise ValueError("'get_token' requires at least one scope") - token = self._client.get_cached_token(scopes) + token = self._client.get_cached_access_token(scopes) if not token: - data = self._get_request_data(*scopes) - token = await self._client.request_token(scopes, form_data=data) - return token # type: ignore + token = await self._client.obtain_token_by_client_certificate(scopes, self._certificate, **kwargs) + return token - def _get_auth_client(self, tenant_id, **kwargs): - return AsyncAuthnClient(tenant=tenant_id, **kwargs) + def _get_auth_client(self, tenant_id, client_id, **kwargs): + return AadClient(tenant_id, client_id, **kwargs) diff --git a/sdk/identity/azure-identity/azure/identity/aio/_credentials/client_secret.py b/sdk/identity/azure-identity/azure/identity/aio/_credentials/client_secret.py index 60a51bb037e..80b5a557792 100644 --- a/sdk/identity/azure-identity/azure/identity/aio/_credentials/client_secret.py +++ b/sdk/identity/azure-identity/azure/identity/aio/_credentials/client_secret.py @@ -5,15 +5,15 @@ from typing import TYPE_CHECKING from .base import AsyncCredentialBase -from .._authn_client import AsyncAuthnClient -from ..._base import ClientSecretCredentialBase +from .._internal import AadClient +from ..._internal import ClientSecretCredentialBase if TYPE_CHECKING: from typing import Any from azure.core.credentials import AccessToken -class ClientSecretCredential(ClientSecretCredentialBase, AsyncCredentialBase): +class ClientSecretCredential(AsyncCredentialBase, ClientSecretCredentialBase): """Authenticates as a service principal using a client ID and client secret. :param str tenant_id: ID of the service principal's tenant. Also called its 'directory' ID. @@ -25,10 +25,6 @@ class ClientSecretCredential(ClientSecretCredentialBase, AsyncCredentialBase): defines authorities for other clouds. """ - def __init__(self, tenant_id: str, client_id: str, client_secret: str, **kwargs: "Any") -> None: - super(ClientSecretCredential, self).__init__(tenant_id, client_id, client_secret, **kwargs) - self._client = AsyncAuthnClient(tenant=tenant_id, **kwargs) - async def __aenter__(self): await self._client.__aenter__() return self @@ -38,7 +34,7 @@ async def close(self): await self._client.__aexit__() - async def get_token(self, *scopes: str, **kwargs: "Any") -> "AccessToken": # pylint:disable=unused-argument + async def get_token(self, *scopes: str, **kwargs: "Any") -> "AccessToken": """Asynchronously request an access token for `scopes`. .. note:: This method is called by Azure SDK clients. It isn't intended for use in application code. @@ -52,8 +48,10 @@ async def get_token(self, *scopes: str, **kwargs: "Any") -> "AccessToken": # py if not scopes: raise ValueError("'get_token' requires at least one scope") - token = self._client.get_cached_token(scopes) + token = self._client.get_cached_access_token(scopes) if not token: - data = dict(self._form_data, scope=" ".join(scopes)) - token = await self._client.request_token(scopes, form_data=data) - return token # type: ignore + token = await self._client.obtain_token_by_client_secret(scopes, self._secret, **kwargs) + return token + + def _get_auth_client(self, tenant_id, client_id, **kwargs): + return AadClient(tenant_id, client_id, **kwargs) diff --git a/sdk/identity/azure-identity/azure/identity/aio/_internal/aad_client.py b/sdk/identity/azure-identity/azure/identity/aio/_internal/aad_client.py index 98075b9aeb6..85136ea0e4d 100644 --- a/sdk/identity/azure-identity/azure/identity/aio/_internal/aad_client.py +++ b/sdk/identity/azure-identity/azure/identity/aio/_internal/aad_client.py @@ -25,6 +25,7 @@ from azure.core.credentials import AccessToken from azure.core.pipeline.policies import AsyncHTTPPolicy, SansIOHTTPPolicy from azure.core.pipeline.transport import AsyncHttpTransport + from ..._internal import AadClientCertificate Policy = Union[AsyncHTTPPolicy, SansIOHTTPPolicy] @@ -58,6 +59,23 @@ async def obtain_token_by_authorization_code( content = ContentDecodePolicy.deserialize_from_http_generics(response.http_response) return self._process_response(response=content, scopes=scopes, now=now) + async def obtain_token_by_client_certificate(self, scopes, certificate, **kwargs): + # type: (Sequence[str], AadClientCertificate, **Any) -> AccessToken + request = self._get_client_certificate_request(scopes, certificate) + now = int(time.time()) + response = await self._pipeline.run(request, stream=False, **kwargs) + content = ContentDecodePolicy.deserialize_from_http_generics(response.http_response) + return self._process_response(response=content, scopes=scopes, now=now) + + async def obtain_token_by_client_secret( + self, scopes: "Sequence[str]", secret: str, **kwargs: "Any" + ) -> "AccessToken": + request = self._get_client_secret_request(scopes, secret) + now = int(time.time()) + response = await self._pipeline.run(request, **kwargs) + content = ContentDecodePolicy.deserialize_from_http_generics(response.http_response) + return self._process_response(response=content, scopes=scopes, now=now) + async def obtain_token_by_refresh_token( self, scopes: "Sequence[str]", refresh_token: str, **kwargs: "Any" ) -> "AccessToken": diff --git a/sdk/identity/azure-identity/tests/test_aad_client.py b/sdk/identity/azure-identity/tests/test_aad_client.py index 98a74fa4ae6..90d0a931071 100644 --- a/sdk/identity/azure-identity/tests/test_aad_client.py +++ b/sdk/identity/azure-identity/tests/test_aad_client.py @@ -126,6 +126,30 @@ def send(request, **_): assert transport.send.call_count == 1 +def test_client_secret(): + tenant_id = "tenant-id" + client_id = "client-id" + scope = "scope" + secret = "refresh-token" + access_token = "***" + + def send(request, **_): + assert request.data["client_id"] == client_id + assert request.data["client_secret"] == secret + assert request.data["grant_type"] == "client_credentials" + assert request.data["scope"] == scope + + return mock_response(json_payload={"access_token": access_token, "expires_in": 42}) + + transport = Mock(send=Mock(wraps=send)) + + client = AadClient(tenant_id, client_id, transport=transport) + token = client.obtain_token_by_client_secret(scopes=(scope,), secret=secret) + + assert token.token == access_token + assert transport.send.call_count == 1 + + def test_refresh_token(): tenant_id = "tenant-id" client_id = "client-id" diff --git a/sdk/identity/azure-identity/tests/test_aad_client_async.py b/sdk/identity/azure-identity/tests/test_aad_client_async.py index db7ce99c3e3..f3a5d996caa 100644 --- a/sdk/identity/azure-identity/tests/test_aad_client_async.py +++ b/sdk/identity/azure-identity/tests/test_aad_client_async.py @@ -108,6 +108,30 @@ async def send(request, **_): assert transport.send.call_count == 1 +async def test_client_secret(): + tenant_id = "tenant-id" + client_id = "client-id" + scope = "scope" + secret = "refresh-token" + access_token = "***" + + async def send(request, **_): + assert request.data["client_id"] == client_id + assert request.data["client_secret"] == secret + assert request.data["grant_type"] == "client_credentials" + assert request.data["scope"] == scope + + return mock_response(json_payload={"access_token": access_token, "expires_in": 42}) + + transport = Mock(send=Mock(wraps=send)) + + client = AadClient(tenant_id, client_id, transport=transport) + token = await client.obtain_token_by_client_secret(scopes=(scope,), secret=secret) + + assert token.token == access_token + assert transport.send.call_count == 1 + + async def test_refresh_token(): tenant_id = "tenant-id" client_id = "client-id" diff --git a/sdk/identity/azure-identity/tests/test_browser_credential.py b/sdk/identity/azure-identity/tests/test_browser_credential.py index 3892d18ffc5..e662b027d7d 100644 --- a/sdk/identity/azure-identity/tests/test_browser_credential.py +++ b/sdk/identity/azure-identity/tests/test_browser_credential.py @@ -284,8 +284,8 @@ def test_redirect_server(): thread.start() # send a request, verify the server exposes the query - url = "http://127.0.0.1:{}/?{}={}".format(port, expected_param, expected_value) - response = urllib.request.urlopen(url) + url = "http://127.0.0.1:{}/?{}={}".format(port, expected_param, expected_value) #nosec + response = urllib.request.urlopen(url) #nosec assert response.code == 200 assert server.query_params[expected_param] == [expected_value] diff --git a/sdk/identity/azure-identity/tests/test_certificate_credential.py b/sdk/identity/azure-identity/tests/test_certificate_credential.py index 06b65ee54c8..7a783b4a727 100644 --- a/sdk/identity/azure-identity/tests/test_certificate_credential.py +++ b/sdk/identity/azure-identity/tests/test_certificate_credential.py @@ -135,7 +135,7 @@ def validate_jwt(request, client_id, pem_bytes): deserialized_header = json.loads(header.decode("utf-8")) assert deserialized_header["alg"] == "RS256" assert deserialized_header["typ"] == "JWT" - assert urlsafeb64_decode(deserialized_header["x5t"]) == cert.fingerprint(hashes.SHA1()) + assert urlsafeb64_decode(deserialized_header["x5t"]) == cert.fingerprint(hashes.SHA1()) #nosec assert claims["aud"] == request.url assert claims["iss"] == claims["sub"] == client_id diff --git a/sdk/identity/azure-identity/tests/test_interactive_credential.py b/sdk/identity/azure-identity/tests/test_interactive_credential.py index 631844567f0..0f3efd57d32 100644 --- a/sdk/identity/azure-identity/tests/test_interactive_credential.py +++ b/sdk/identity/azure-identity/tests/test_interactive_credential.py @@ -18,6 +18,8 @@ except ImportError: # python < 3.3 from mock import Mock, patch # type: ignore +from helpers import build_aad_response + class MockCredential(InteractiveCredential): """Test class to drive InteractiveCredential. @@ -266,3 +268,54 @@ def _request_token(self, *_, **__): TestCredential(enable_persistent_cache=True, allow_unencrypted_cache=True) assert mock_extensions.PersistedTokenCache.called_with(mock_extensions.FilePersistence) + + +def test_home_account_id_client_info(): + """when MSAL returns client_info, the credential should decode it to get the home_account_id""" + + object_id = "object-id" + home_tenant = "home-tenant-id" + msal_response = build_aad_response(uid=object_id, utid=home_tenant, access_token="***", refresh_token="**") + msal_response["id_token_claims"] = { + "aud": "client-id", + "iss": "https://localhost", + "object_id": object_id, + "tid": home_tenant, + "preferred_username": "me", + "sub": "subject", + } + + class TestCredential(InteractiveCredential): + def __init__(self, **kwargs): + super(TestCredential, self).__init__(client_id="...", **kwargs) + + def _request_token(self, *_, **__): + return msal_response + + record = TestCredential().authenticate() + assert record.home_account_id == "{}.{}".format(object_id, home_tenant) + + +def test_home_account_id_no_client_info(): + """the credential should use the subject claim as home_account_id when MSAL doesn't provide client_info""" + + subject = "subject" + msal_response = build_aad_response(access_token="***", refresh_token="**") + msal_response["id_token_claims"] = { + "aud": "client-id", + "iss": "https://localhost", + "object_id": "some-guid", + "tid": "some-tenant", + "preferred_username": "me", + "sub": subject, + } + + class TestCredential(InteractiveCredential): + def __init__(self, **kwargs): + super(TestCredential, self).__init__(client_id="...", **kwargs) + + def _request_token(self, *_, **__): + return msal_response + + record = TestCredential().authenticate() + assert record.home_account_id == subject diff --git a/sdk/search/azure-search-documents/CHANGELOG.md b/sdk/search/azure-search-documents/CHANGELOG.md index 5e225273415..317ffb4b0d0 100644 --- a/sdk/search/azure-search-documents/CHANGELOG.md +++ b/sdk/search/azure-search-documents/CHANGELOG.md @@ -24,6 +24,7 @@ PathHierarchyTokenizerV2 -> PathHierarchyTokenizer - Renamed DataSource methods to DataSourceConnection #11693 - Autocomplete & suggest methods now takes arguments search_text & suggester_name rather than query objects #11747 +- Create_or_updates methods does not support partial updates ## 1.0.0b3 (2020-05-04) diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/_index.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/_index.py index 7f128cdfd2c..7d555ab22d2 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/_index.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/_index.py @@ -32,13 +32,13 @@ class SearchField(msrest.serialization.Model): type Edm.String. Key fields can be used to look up documents directly and update or delete specific documents. Default is false for simple fields and null for complex fields. :type key: bool - :param is_hidden: A value indicating whether the field can be returned in a search result. + :param hidden: A value indicating whether the field can be returned in a search result. You can enable this option if you want to use a field (for example, margin) as a filter, sorting, or scoring mechanism but do not want the field to be visible to the end user. This property must be False for key fields, and it must be null for complex fields. This property can be changed on existing fields. Enabling this property does not cause any increase in index storage requirements. Default is False for simple fields and null for complex fields. - :type is_hidden: bool + :type hidden: bool :param searchable: A value indicating whether the field is full-text searchable. This means it will undergo analysis such as word-breaking during indexing. If you set a searchable field to a value like "sunny day", internally it will be split into the individual tokens "sunny" and @@ -161,7 +161,7 @@ class SearchField(msrest.serialization.Model): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'key': {'key': 'key', 'type': 'bool'}, - 'is_hidden': {'key': 'isHidden', 'type': 'bool'}, + 'hidden': {'key': 'hidden', 'type': 'bool'}, 'searchable': {'key': 'searchable', 'type': 'bool'}, 'filterable': {'key': 'filterable', 'type': 'bool'}, 'sortable': {'key': 'sortable', 'type': 'bool'}, @@ -181,7 +181,7 @@ def __init__( self.name = kwargs['name'] self.type = kwargs['type'] self.key = kwargs.get('key', None) - self.is_hidden = kwargs.get('is_hidden', None) + self.hidden = kwargs.get('hidden', None) self.searchable = kwargs.get('searchable', None) self.filterable = kwargs.get('filterable', None) self.sortable = kwargs.get('sortable', None) @@ -210,13 +210,13 @@ def SimpleField(**kw): type SearchFieldDataType.String. Key fields can be used to look up documents directly and update or delete specific documents. Default is False :type key: bool - :param is_hidden: A value indicating whether the field can be returned in a search result. + :param hidden: A value indicating whether the field can be returned in a search result. You can enable this option if you want to use a field (for example, margin) as a filter, sorting, or scoring mechanism but do not want the field to be visible to the end user. This property must be False for key fields. This property can be changed on existing fields. Enabling this property does not cause any increase in index storage requirements. Default is False. - :type is_hidden: bool + :type hidden: bool :param filterable: A value indicating whether to enable the field to be referenced in $filter queries. filterable differs from searchable in how strings are handled. Fields of type SearchFieldDataType.String or Collection(SearchFieldDataType.String) that are filterable do @@ -246,7 +246,7 @@ def SimpleField(**kw): result["filterable"] = kw.get("filterable", False) result["facetable"] = kw.get("facetable", False) result["sortable"] = kw.get("sortable", False) - result["is_hidden"] = kw.get("is_hidden", False) + result["hidden"] = kw.get("hidden", False) return SearchField(**result) @@ -264,13 +264,13 @@ def SearchableField(**kw): type SearchFieldDataType.String. Key fields can be used to look up documents directly and update or delete specific documents. Default is False :type key: bool - :param is_hidden: A value indicating whether the field can be returned in a search result. + :param hidden: A value indicating whether the field can be returned in a search result. You can enable this option if you want to use a field (for example, margin) as a filter, sorting, or scoring mechanism but do not want the field to be visible to the end user. This property must be False for key fields. This property can be changed on existing fields. Enabling this property does not cause any increase in index storage requirements. Default is False. - :type is_hidden: bool + :type hidden: bool :param searchable: A value indicating whether the field is full-text searchable. This means it will undergo analysis such as word-breaking during indexing. If you set a searchable field to a value like "sunny day", internally it will be split into the individual tokens "sunny" and @@ -375,7 +375,7 @@ def SearchableField(**kw): result["filterable"] = kw.get("filterable", False) result["facetable"] = kw.get("facetable", False) result["sortable"] = kw.get("sortable", False) - result["is_hidden"] = kw.get("is_hidden", False) + result["hidden"] = kw.get("hidden", False) if "analyzer_name" in kw: result["analyzer_name"] = kw["analyzer_name"] if "search_analyzer_name" in kw: diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/_search_index_client.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/_search_index_client.py index 9a5bd5e783a..176c5778096 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/_search_index_client.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/_search_index_client.py @@ -10,12 +10,11 @@ from azure.core.paging import ItemPaged from ._generated import SearchServiceClient as _SearchServiceClient -from ._generated.models import SynonymMap as _SynonymMap from ._utils import ( unpack_search_index, pack_search_index, - unpack_synonyms, - pack_search_resource_encryption_key, + unpack_synonym_map, + pack_synonym_map, get_access_conditions, normalize_endpoint, ) @@ -55,7 +54,7 @@ def __exit__(self, *args): def close(self): # type: () -> None - """Close the :class:`~azure.search.documents.SearchIndexClient` session. + """Close the :class:`~azure.search.documents.indexes.SearchIndexClient` session. """ return self._client.close() @@ -77,7 +76,7 @@ def list_indexes(self, **kwargs): """List the indexes in an Azure Search service. :return: List of indexes - :rtype: list[~azure.search.documents.SearchIndex] + :rtype: list[~azure.search.documents.indexes.models.SearchIndex] :raises: ~azure.core.exceptions.HttpResponseError """ @@ -86,14 +85,14 @@ def list_indexes(self, **kwargs): return self._client.indexes.list(cls=lambda objs: [unpack_search_index(x) for x in objs], **kwargs) @distributed_trace - def get_index(self, index_name, **kwargs): + def get_index(self, name, **kwargs): # type: (str, **Any) -> SearchIndex """ - :param index_name: The name of the index to retrieve. - :type index_name: str + :param name: The name of the index to retrieve. + :type name: str :return: SearchIndex object - :rtype: ~azure.search.documents.SearchIndex + :rtype: ~azure.search.documents.indexes.models.SearchIndex :raises: ~azure.core.exceptions.HttpResponseError .. admonition:: Example: @@ -106,7 +105,7 @@ def get_index(self, index_name, **kwargs): :caption: Get an index. """ kwargs["headers"] = self._merge_client_headers(kwargs.get("headers")) - result = self._client.indexes.get(index_name, **kwargs) + result = self._client.indexes.get(name, **kwargs) return unpack_search_index(result) @distributed_trace @@ -118,7 +117,7 @@ def get_index_statistics(self, index_name, **kwargs): :param index_name: The name of the index to retrieve. :type index_name: str :return: Statistics for the given index, including a document count and storage usage. - :rtype: ~azure.search.documents.GetIndexStatisticsResult + :rtype: dict :raises: ~azure.core.exceptions.HttpResponseError """ @@ -133,7 +132,7 @@ def delete_index(self, index, **kwargs): provided instead of the name to use the access conditions. :param index: The index to retrieve. - :type index: str or ~search.models.SearchIndex + :type index: str or ~azure.search.documents.indexes.models.SearchIndex :keyword match_condition: The match condition to use upon the etag :type match_condition: ~azure.core.MatchConditions :raises: ~azure.core.exceptions.HttpResponseError @@ -166,9 +165,9 @@ def create_index(self, index, **kwargs): """Creates a new search index. :param index: The index object. - :type index: ~azure.search.documents.SearchIndex + :type index: ~azure.search.documents.indexes.models.SearchIndex :return: The index created - :rtype: ~azure.search.documents.SearchIndex + :rtype: ~azure.search.documents.indexes.models.SearchIndex :raises: ~azure.core.exceptions.HttpResponseError .. admonition:: Example: @@ -187,15 +186,13 @@ def create_index(self, index, **kwargs): @distributed_trace def create_or_update_index( - self, index_name, index, allow_index_downtime=None, **kwargs + self, index, allow_index_downtime=None, **kwargs ): - # type: (str, SearchIndex, bool, **Any) -> SearchIndex + # type: (SearchIndex, bool, **Any) -> SearchIndex """Creates a new search index or updates an index if it already exists. - :param index_name: The name of the index. - :type index_name: str :param index: The index object. - :type index: ~azure.search.documents.SearchIndex + :type index: ~azure.search.documents.indexes.models.SearchIndex :param allow_index_downtime: Allows new analyzers, tokenizers, token filters, or char filters to be added to an index by taking the index offline for at least a few seconds. This temporarily causes indexing and query requests to fail. Performance and write availability of @@ -205,7 +202,7 @@ def create_or_update_index( :keyword match_condition: The match condition to use upon the etag :type match_condition: ~azure.core.MatchConditions :return: The index created or updated - :rtype: :class:`~azure.search.documents.SearchIndex` + :rtype: :class:`~azure.search.documents.indexes.models.SearchIndex` :raises: :class:`~azure.core.exceptions.ResourceNotFoundError`, \ :class:`~azure.core.exceptions.ResourceModifiedError`, \ :class:`~azure.core.exceptions.ResourceNotModifiedError`, \ @@ -228,7 +225,7 @@ def create_or_update_index( kwargs.update(access_condition) patched_index = pack_search_index(index) result = self._client.indexes.create_or_update( - index_name=index_name, + index_name=index.name, index=patched_index, allow_index_downtime=allow_index_downtime, error_map=error_map, @@ -246,7 +243,7 @@ def analyze_text(self, index_name, analyze_request, **kwargs): :param analyze_request: The text and analyzer or analysis components to test. :type analyze_request: ~azure.search.documents.AnalyzeRequest :return: AnalyzeResult - :rtype: ~azure.search.documents.AnalyzeResult + :rtype: ~azure.search.documents.indexes.models.AnalyzeResult :raises: ~azure.core.exceptions.HttpResponseError .. admonition:: Example: @@ -285,7 +282,7 @@ def get_synonym_maps(self, **kwargs): """ kwargs["headers"] = self._merge_client_headers(kwargs.get("headers")) result = self._client.synonym_maps.list(**kwargs) - return [unpack_synonyms(x) for x in result.synonym_maps] + return [unpack_synonym_map(x) for x in result.synonym_maps] @distributed_trace def get_synonym_map_names(self, **kwargs): @@ -324,7 +321,7 @@ def get_synonym_map(self, name, **kwargs): """ kwargs["headers"] = self._merge_client_headers(kwargs.get("headers")) result = self._client.synonym_maps.get(name, **kwargs) - return unpack_synonyms(result) + return unpack_synonym_map(result) @distributed_trace def delete_synonym_map(self, synonym_map, **kwargs): @@ -334,7 +331,7 @@ def delete_synonym_map(self, synonym_map, **kwargs): the name of the synonym map to delete unconditionally. :param name: The Synonym Map to delete - :type name: str or ~search.models.SynonymMap + :type name: str or ~azure.search.documents.indexes.models.SynonymMap :keyword match_condition: The match condition to use upon the etag :type match_condition: ~azure.core.MatchConditions :return: None @@ -364,14 +361,12 @@ def delete_synonym_map(self, synonym_map, **kwargs): ) @distributed_trace - def create_synonym_map(self, name, synonyms, **kwargs): - # type: (str, Sequence[str], **Any) -> SynonymMap + def create_synonym_map(self, synonym_map, **kwargs): + # type: (SynonymMap, **Any) -> SynonymMap """Create a new Synonym Map in an Azure Search service - :param name: The name of the Synonym Map to create - :type name: str - :param synonyms: The list of synonyms in SOLR format - :type synonyms: List[str] + :param synonym_map: The Synonym Map object + :type synonym_map: ~azure.search.documents.indexes.models.SynonymMap :return: The created Synonym Map :rtype: ~azure.search.documents.indexes.models.SynonymMap @@ -386,21 +381,18 @@ def create_synonym_map(self, name, synonyms, **kwargs): """ kwargs["headers"] = self._merge_client_headers(kwargs.get("headers")) - solr_format_synonyms = "\n".join(synonyms) - synonym_map = _SynonymMap(name=name, synonyms=solr_format_synonyms) - result = self._client.synonym_maps.create(synonym_map, **kwargs) - return unpack_synonyms(result) + patched_synonym_map = pack_synonym_map(synonym_map) + result = self._client.synonym_maps.create(patched_synonym_map, **kwargs) + return unpack_synonym_map(result) @distributed_trace - def create_or_update_synonym_map(self, synonym_map, synonyms=None, **kwargs): - # type: (Union[str, SynonymMap], Optional[Sequence[str]], **Any) -> SynonymMap + def create_or_update_synonym_map(self, synonym_map, **kwargs): + # type: (SynonymMap, **Any) -> SynonymMap """Create a new Synonym Map in an Azure Search service, or update an existing one. - :param synonym_map: The name of the Synonym Map to create or update - :type synonym_map: str or ~azure.search.documents.SynonymMap - :param synonyms: A list of synonyms in SOLR format - :type synonyms: List[str] + :param synonym_map: The Synonym Map object + :type synonym_map: ~azure.search.documents.indexes.models.SynonymMap :keyword match_condition: The match condition to use upon the etag :type match_condition: ~azure.core.MatchConditions :return: The created or updated Synonym Map @@ -412,22 +404,14 @@ def create_or_update_synonym_map(self, synonym_map, synonyms=None, **kwargs): synonym_map, kwargs.pop("match_condition", MatchConditions.Unconditionally) ) kwargs.update(access_condition) - try: - name = synonym_map.name - if synonyms: - synonym_map.synonyms = "\n".join(synonyms) - synonym_map.encryption_key = pack_search_resource_encryption_key(synonym_map.encryption_key) - except AttributeError: - name = synonym_map - solr_format_synonyms = "\n".join(synonyms) - synonym_map = _SynonymMap(name=name, synonyms=solr_format_synonyms) + patched_synonym_map = pack_synonym_map(synonym_map) result = self._client.synonym_maps.create_or_update( - synonym_map_name=name, - synonym_map=synonym_map, + synonym_map_name=synonym_map.name, + synonym_map=patched_synonym_map, error_map=error_map, **kwargs ) - return unpack_synonyms(result) + return unpack_synonym_map(result) @distributed_trace def get_service_statistics(self, **kwargs): diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/_search_indexer_client.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/_search_indexer_client.py index 0e5c69c5552..41c73f023fa 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/_search_indexer_client.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/_search_indexer_client.py @@ -7,7 +7,6 @@ from azure.core import MatchConditions from azure.core.tracing.decorator import distributed_trace -from azure.core.exceptions import ClientAuthenticationError, ResourceNotFoundError from ._generated import SearchServiceClient as _SearchServiceClient from ._generated.models import SearchIndexerSkillset @@ -54,7 +53,7 @@ def __exit__(self, *args): def close(self): # type: () -> None - """Close the :class:`~azure.search.documents.SearchIndexerClient` session. + """Close the :class:`~azure.search.documents.indexes.SearchIndexerClient` session. """ return self._client.close() @@ -65,9 +64,9 @@ def create_indexer(self, indexer, **kwargs): """Creates a new SearchIndexer. :param indexer: The definition of the indexer to create. - :type indexer: ~~azure.search.documents.SearchIndexer + :type indexer: ~azure.search.documents.indexes.models.SearchIndexer :return: The created SearchIndexer - :rtype: ~azure.search.documents.SearchIndexer + :rtype: ~azure.search.documents.indexes.models.SearchIndexer .. admonition:: Example: @@ -83,24 +82,21 @@ def create_indexer(self, indexer, **kwargs): return result @distributed_trace - def create_or_update_indexer(self, indexer, name=None, **kwargs): - # type: (SearchIndexer, Optional[str], **Any) -> SearchIndexer + def create_or_update_indexer(self, indexer, **kwargs): + # type: (SearchIndexer, **Any) -> SearchIndexer """Creates a new indexer or updates a indexer if it already exists. - :param name: The name of the indexer to create or update. - :type name: str :param indexer: The definition of the indexer to create or update. - :type indexer: ~azure.search.documents.SearchIndexer + :type indexer: ~azure.search.documents.indexes.models.SearchIndexer :return: The created IndexSearchIndexerer - :rtype: ~azure.search.documents.SearchIndexer + :rtype: ~azure.search.documents.indexes.models.SearchIndexer """ kwargs["headers"] = self._merge_client_headers(kwargs.get("headers")) error_map, access_condition = get_access_conditions( indexer, kwargs.pop("match_condition", MatchConditions.Unconditionally) ) kwargs.update(access_condition) - if not name: - name = indexer.name + name = indexer.name result = self._client.indexers.create_or_update( indexer_name=name, indexer=indexer, error_map=error_map, **kwargs ) @@ -179,7 +175,7 @@ def delete_indexer(self, indexer, **kwargs): the name of the indexer to delete unconditionally. :param indexer: The indexer to delete. - :type indexer: str or ~azure.search.documents.SearchIndexer + :type indexer: str or ~azure.search.documents.indexes.models.SearchIndexer :keyword match_condition: The match condition to use upon the etag :type match_condition: ~azure.core.MatchConditions @@ -261,7 +257,7 @@ def get_indexer_status(self, name, **kwargs): :type name: str :return: SearchIndexerStatus - :rtype: SearchIndexerStatus + :rtype: ~azure.search.documents.indexes.models.SearchIndexerStatus .. admonition:: Example: @@ -281,9 +277,9 @@ def create_data_source_connection(self, data_source_connection, **kwargs): """Creates a new data source connection. :param data_source_connection: The definition of the data source connection to create. - :type data_source_connection: ~search.models.SearchIndexerDataSourceConnection + :type data_source_connection: ~azure.search.documents.indexes.models.SearchIndexerDataSourceConnection :return: The created SearchIndexerDataSourceConnection - :rtype: ~search.models.SearchIndexerDataSourceConnection + :rtype: ~azure.search.documents.indexes.models.SearchIndexerDataSourceConnection .. admonition:: Example: @@ -300,25 +296,22 @@ def create_data_source_connection(self, data_source_connection, **kwargs): return unpack_search_indexer_data_source(result) @distributed_trace - def create_or_update_data_source_connection(self, data_source_connection, name=None, **kwargs): - # type: (SearchIndexerDataSourceConnection, Optional[str], **Any) -> SearchIndexerDataSourceConnection + def create_or_update_data_source_connection(self, data_source_connection, **kwargs): + # type: (SearchIndexerDataSourceConnection, **Any) -> SearchIndexerDataSourceConnection """Creates a new data source connection or updates a data source connection if it already exists. - :param name: The name of the data source connection to create or update. - :type name: str :param data_source_connection: The definition of the data source connection to create or update. - :type data_source_connection: ~search.models.SearchIndexerDataSourceConnection + :type data_source_connection: ~azure.search.documents.indexes.models.SearchIndexerDataSourceConnection :keyword match_condition: The match condition to use upon the etag :type match_condition: ~azure.core.MatchConditions :return: The created SearchIndexerDataSourceConnection - :rtype: ~search.models.SearchIndexerDataSourceConnection + :rtype: ~azure.search.documents.indexes.models.SearchIndexerDataSourceConnection """ kwargs["headers"] = self._merge_client_headers(kwargs.get("headers")) error_map, access_condition = get_access_conditions( data_source_connection, kwargs.pop("match_condition", MatchConditions.Unconditionally) ) kwargs.update(access_condition) - if not name: - name = data_source_connection.name + name = data_source_connection.name packed_data_source = pack_search_indexer_data_source(data_source_connection) result = self._client.data_sources.create_or_update( data_source_name=name, @@ -336,7 +329,7 @@ def get_data_source_connection(self, name, **kwargs): :param name: The name of the data source connection to retrieve. :type name: str :return: The SearchIndexerDataSourceConnection that is fetched. - :rtype: ~search.models.SearchIndexerDataSourceConnection + :rtype: ~azure.search.documents.indexes.models.SearchIndexerDataSourceConnection .. admonition:: Example: @@ -357,7 +350,7 @@ def get_data_source_connections(self, **kwargs): """Lists all data source connections available for a search service. :return: List of all the data source connections. - :rtype: `list[~search.models.SearchIndexerDataSourceConnection]` + :rtype: `list[~azure.search.documents.indexes.models.SearchIndexerDataSourceConnection]` .. admonition:: Example: @@ -393,7 +386,7 @@ def delete_data_source_connection(self, data_source_connection, **kwargs): to delete unconditionally :param data_source_connection: The data source connection to delete. - :type data_source_connection: str or ~search.models.SearchIndexerDataSourceConnection + :type data_source_connection: str or ~azure.search.documents.indexes.models.SearchIndexerDataSourceConnection :keyword match_condition: The match condition to use upon the etag :type match_condition: ~azure.core.MatchConditions :return: None @@ -490,7 +483,7 @@ def delete_skillset(self, skillset, **kwargs): the name of the skillset to delete unconditionally :param name: The SearchIndexerSkillset to delete - :type name: str or ~search.models.SearchIndexerSkillset + :type name: str or ~azure.search.documents.indexes.models.SearchIndexerSkillset :keyword match_condition: The match condition to use upon the etag :type match_condition: ~azure.core.MatchConditions @@ -516,16 +509,12 @@ def delete_skillset(self, skillset, **kwargs): self._client.skillsets.delete(name, error_map=error_map, **kwargs) @distributed_trace - def create_skillset(self, name, skills, description, **kwargs): - # type: (str, Sequence[SearchIndexerSkill], str, **Any) -> SearchIndexerSkillset + def create_skillset(self, skillset, **kwargs): + # type: (SearchIndexerSkillset, **Any) -> SearchIndexerSkillset """Create a new SearchIndexerSkillset in an Azure Search service - :param name: The name of the SearchIndexerSkillset to create - :type name: str - :param skills: A list of Skill objects to include in the SearchIndexerSkillset - :type skills: List[SearchIndexerSkill]] - :param description: A description for the SearchIndexerSkillset - :type description: Optional[str] + :param skillset: The SearchIndexerSkillset object to create + :type skillset: ~azure.search.documents.indexes.models.SearchIndexerSkillset :return: The created SearchIndexerSkillset :rtype: ~azure.search.documents.indexes.models.SearchIndexerSkillset @@ -541,59 +530,28 @@ def create_skillset(self, name, skills, description, **kwargs): """ kwargs["headers"] = self._merge_client_headers(kwargs.get("headers")) - skillset = SearchIndexerSkillset( - name=name, skills=list(skills), description=description - ) - return self._client.skillsets.create(skillset, **kwargs) @distributed_trace - def create_or_update_skillset(self, name, **kwargs): - # type: (str, **Any) -> SearchIndexerSkillset + def create_or_update_skillset(self, skillset, **kwargs): + # type: (SearchIndexerSkillset, **Any) -> SearchIndexerSkillset """Create a new SearchIndexerSkillset in an Azure Search service, or update an - existing one. The skillset param must be provided to perform the - operation with access conditions. + existing one. - :param name: The name of the SearchIndexerSkillset to create or update - :type name: str - :keyword skills: A list of Skill objects to include in the SearchIndexerSkillset - :type skills: List[SearchIndexerSkill] - :keyword description: A description for the SearchIndexerSkillset - :type description: Optional[str] - :keyword skillset: A SearchIndexerSkillset to create or update. - :type skillset: :class:`~azure.search.documents.SearchIndexerSkillset` + :param skillset: The SearchIndexerSkillset object to create or update + :type skillset: ~azure.search.documents.indexes.models.SearchIndexerSkillset :keyword match_condition: The match condition to use upon the etag :type match_condition: ~azure.core.MatchConditions :return: The created or updated SearchIndexerSkillset :rtype: ~azure.search.documents.indexes.models.SearchIndexerSkillset - If a `skillset` is passed in, any optional `skills`, or - `description` parameter values will override it. - """ kwargs["headers"] = self._merge_client_headers(kwargs.get("headers")) - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError} - access_condition = None - - if "skillset" in kwargs: - skillset = kwargs.pop("skillset") - error_map, access_condition = get_access_conditions( - skillset, kwargs.pop("match_condition", MatchConditions.Unconditionally) - ) - kwargs.update(access_condition) - skillset = SearchIndexerSkillset.deserialize(skillset.serialize()) - skillset.name = name - for param in ("description", "skills"): - if param in kwargs: - setattr(skillset, param, kwargs.pop(param)) - else: - - skillset = SearchIndexerSkillset( - name=name, - description=kwargs.pop("description", None), - skills=kwargs.pop("skills", None), - ) + error_map, access_condition = get_access_conditions( + skillset, kwargs.pop("match_condition", MatchConditions.Unconditionally) + ) + kwargs.update(access_condition) return self._client.skillsets.create_or_update( - skillset_name=name, skillset=skillset, error_map=error_map, **kwargs + skillset_name=skillset.name, skillset=skillset, error_map=error_map, **kwargs ) diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/_utils.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/_utils.py index e29bcbcc9ea..8e7021b8c91 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/_utils.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/_utils.py @@ -217,7 +217,17 @@ def unpack_search_index(search_index): ) -def unpack_synonyms(synonym_map): +def pack_synonym_map(synonym_map): + # type: (SynonymMap) -> _SynonymMap + return _SynonymMap( + name=synonym_map.name, + synonyms="\n".join(synonym_map.synonyms), + encryption_key=pack_search_resource_encryption_key(synonym_map.encryption_key), + e_tag=synonym_map.e_tag + ) + + +def unpack_synonym_map(synonym_map): # type: (_SynonymMap) -> SynonymMap return SynonymMap( name=synonym_map.name, @@ -347,7 +357,7 @@ def pack_search_field(search_field): name = search_field.get("name") field_type = search_field.get("type") key = search_field.get("key") - is_hidden = search_field.get("is_hidden") + hidden = search_field.get("hidden") searchable = search_field.get("searchable") filterable = search_field.get("filterable") sortable = search_field.get("sortable") @@ -362,7 +372,7 @@ def pack_search_field(search_field): name=name, type=field_type, key=key, - retrievable=not is_hidden, + retrievable=not hidden, searchable=searchable, filterable=filterable, sortable=sortable, @@ -379,7 +389,7 @@ def pack_search_field(search_field): name=search_field.name, type=search_field.type, key=search_field.key, - retrievable=not search_field.is_hidden, + retrievable=not search_field.hidden, searchable=search_field.searchable, filterable=search_field.filterable, sortable=search_field.sortable, @@ -402,7 +412,7 @@ def unpack_search_field(search_field): name=search_field.name, type=search_field.type, key=search_field.key, - is_hidden=search_field.retrievable, + hidden=not search_field.retrievable, searchable=search_field.searchable, filterable=search_field.filterable, sortable=search_field.sortable, diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/aio/_search_index_client.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/aio/_search_index_client.py index 0f5537d8ffe..6ea84468765 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/aio/_search_index_client.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/aio/_search_index_client.py @@ -10,13 +10,12 @@ from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.async_paging import AsyncItemPaged from .._generated.aio import SearchServiceClient as _SearchServiceClient -from .._generated.models import SynonymMap from ....aio import SearchClient from .._utils import ( pack_search_index, unpack_search_index, - unpack_synonyms, - pack_search_resource_encryption_key, + unpack_synonym_map, + pack_synonym_map, get_access_conditions, normalize_endpoint, ) @@ -60,7 +59,7 @@ async def __aexit__(self, *args): async def close(self): # type: () -> None - """Close the :class:`~azure.search.documents.aio.SearchIndexClient` session. + """Close the :class:`~azure.search.documents.indexes.aio.SearchIndexClient` session. """ return await self._client.close() @@ -81,7 +80,7 @@ def list_indexes(self, **kwargs): """List the indexes in an Azure Search service. :return: List of indexes - :rtype: list[~azure.search.documents.SearchIndex] + :rtype: list[:class:`~azure.search.documents.indexes.models.SearchIndex`] :raises: ~azure.core.exceptions.HttpResponseError """ @@ -90,14 +89,14 @@ def list_indexes(self, **kwargs): return self._client.indexes.list(cls=lambda objs: [unpack_search_index(x) for x in objs], **kwargs) @distributed_trace_async - async def get_index(self, index_name, **kwargs): + async def get_index(self, name, **kwargs): # type: (str, **Any) -> SearchIndex """ - :param index_name: The name of the index to retrieve. - :type index_name: str + :param name: The name of the index to retrieve. + :type name: str :return: SearchIndex object - :rtype: ~azure.search.documents.SearchIndex + :rtype: :class:`~azure.search.documents.indexes.models.SearchIndex` :raises: ~azure.core.exceptions.HttpResponseError .. admonition:: Example: @@ -110,7 +109,7 @@ async def get_index(self, index_name, **kwargs): :caption: Get an index. """ kwargs["headers"] = self._merge_client_headers(kwargs.get("headers")) - result = await self._client.indexes.get(index_name, **kwargs) + result = await self._client.indexes.get(name, **kwargs) return unpack_search_index(result) @distributed_trace_async @@ -122,7 +121,7 @@ async def get_index_statistics(self, index_name, **kwargs): :param index_name: The name of the index to retrieve. :type index_name: str :return: Statistics for the given index, including a document count and storage usage. - :rtype: ~azure.search.documents.GetIndexStatisticsResult + :rtype: dict :raises: ~azure.core.exceptions.HttpResponseError """ @@ -137,7 +136,7 @@ async def delete_index(self, index, **kwargs): provided instead of the name to use the access conditions :param index: The index to retrieve. - :type index: str or ~search.models.SearchIndex + :type index: str or :class:`~azure.search.documents.indexes.models.SearchIndex` :keyword match_condition: The match condition to use upon the etag :type match_condition: ~azure.core.MatchConditions :raises: ~azure.core.exceptions.HttpResponseError @@ -170,9 +169,9 @@ async def create_index(self, index, **kwargs): """Creates a new search index. :param index: The index object. - :type index: ~azure.search.documents.SearchIndex + :type index: :class:`~azure.search.documents.indexes.models.SearchIndex` :return: The index created - :rtype: ~azure.search.documents.SearchIndex + :rtype: :class:`~azure.search.documents.indexes.models.SearchIndex` :raises: ~azure.core.exceptions.HttpResponseError .. admonition:: Example: @@ -191,15 +190,13 @@ async def create_index(self, index, **kwargs): @distributed_trace_async async def create_or_update_index( - self, index_name, index, allow_index_downtime=None, **kwargs + self, index, allow_index_downtime=None, **kwargs ): - # type: (str, SearchIndex, bool, MatchConditions, **Any) -> SearchIndex + # type: (SearchIndex, bool, MatchConditions, **Any) -> SearchIndex """Creates a new search index or updates an index if it already exists. - :param index_name: The name of the index. - :type index_name: str :param index: The index object. - :type index: ~azure.search.documents.SearchIndex + :type index: :class:`~azure.search.documents.indexes.models.SearchIndex` :param allow_index_downtime: Allows new analyzers, tokenizers, token filters, or char filters to be added to an index by taking the index offline for at least a few seconds. This temporarily causes indexing and query requests to fail. Performance and write availability of @@ -209,7 +206,7 @@ async def create_or_update_index( :keyword match_condition: The match condition to use upon the etag :type match_condition: ~azure.core.MatchConditions :return: The index created or updated - :rtype: :class:`~azure.search.documents.SearchIndex` + :rtype: :class:`~azure.search.documents.indexes.models.SearchIndex` :raises: :class:`~azure.core.exceptions.ResourceNotFoundError`, \ :class:`~azure.core.exceptions.ResourceModifiedError`, \ :class:`~azure.core.exceptions.ResourceNotModifiedError`, \ @@ -232,7 +229,7 @@ async def create_or_update_index( kwargs.update(access_condition) patched_index = pack_search_index(index) result = await self._client.indexes.create_or_update( - index_name=index_name, + index_name=index.name, index=patched_index, allow_index_downtime=allow_index_downtime, error_map=error_map, @@ -248,9 +245,9 @@ async def analyze_text(self, index_name, analyze_request, **kwargs): :param index_name: The name of the index for which to test an analyzer. :type index_name: str :param analyze_request: The text and analyzer or analysis components to test. - :type analyze_request: ~azure.search.documents.AnalyzeRequest + :type analyze_request: :class:`~azure.search.documents.indexes.models.AnalyzeRequest :return: AnalyzeResult - :rtype: ~azure.search.documents.AnalyzeResult + :rtype: :class:`~azure.search.documents.indexes.models.AnalyzeRequest :raises: ~azure.core.exceptions.HttpResponseError .. admonition:: Example: @@ -289,7 +286,7 @@ async def get_synonym_maps(self, **kwargs): """ kwargs["headers"] = self._merge_client_headers(kwargs.get("headers")) result = await self._client.synonym_maps.list(**kwargs) - return [unpack_synonyms(x) for x in result.synonym_maps] + return [unpack_synonym_map(x) for x in result.synonym_maps] @distributed_trace_async async def get_synonym_map_names(self, **kwargs): @@ -313,7 +310,7 @@ async def get_synonym_map(self, name, **kwargs): :param name: The name of the Synonym Map to get :type name: str :return: The retrieved Synonym Map - :rtype: ~azure.search.documents.indexes.models.SynonymMap + :rtype: :class:`~azure.search.documents.indexes.models.SynonymMap :raises: :class:`~azure.core.exceptions.ResourceNotFoundError` .. admonition:: Example: @@ -328,7 +325,7 @@ async def get_synonym_map(self, name, **kwargs): """ kwargs["headers"] = self._merge_client_headers(kwargs.get("headers")) result = await self._client.synonym_maps.get(name, **kwargs) - return unpack_synonyms(result) + return unpack_synonym_map(result) @distributed_trace_async async def delete_synonym_map(self, synonym_map, **kwargs): @@ -338,7 +335,7 @@ async def delete_synonym_map(self, synonym_map, **kwargs): the name of the synonym map to delete unconditionally. :param name: The Synonym Map to delete - :type name: str or ~search.models.SynonymMap + :type name: str or ~azure.search.documents.indexes.models.SynonymMap :keyword match_condition: The match condition to use upon the etag :type match_condition: ~azure.core.MatchConditions :return: None @@ -369,16 +366,14 @@ async def delete_synonym_map(self, synonym_map, **kwargs): ) @distributed_trace_async - async def create_synonym_map(self, name, synonyms, **kwargs): - # type: (str, Sequence[str], **Any) -> SynonymMap + async def create_synonym_map(self, synonym_map, **kwargs): + # type: (SynonymMap, **Any) -> SynonymMap """Create a new Synonym Map in an Azure Search service - :param name: The name of the Synonym Map to create - :type name: str - :param synonyms: A list of synonyms in SOLR format - :type synonyms: List[str] + :param synonym_map: The Synonym Map object + :type synonym_map: :class:`~azure.search.documents.indexes.models.SynonymMap :return: The created Synonym Map - :rtype: ~azure.search.documents.indexes.models.SynonymMap + :rtype: :class:`~azure.search.documents.indexes.models.SynonymMap .. admonition:: Example: @@ -391,25 +386,22 @@ async def create_synonym_map(self, name, synonyms, **kwargs): """ kwargs["headers"] = self._merge_client_headers(kwargs.get("headers")) - solr_format_synonyms = "\n".join(synonyms) - synonym_map = SynonymMap(name=name, synonyms=solr_format_synonyms) - result = await self._client.synonym_maps.create(synonym_map, **kwargs) - return unpack_synonyms(result) + patched_synonym_map = pack_synonym_map(synonym_map) + result = await self._client.synonym_maps.create(patched_synonym_map, **kwargs) + return unpack_synonym_map(result) @distributed_trace_async - async def create_or_update_synonym_map(self, synonym_map, synonyms=None, **kwargs): - # type: (Union[str, SynonymMap], Optional[Sequence[str]], **Any) -> SynonymMap + async def create_or_update_synonym_map(self, synonym_map, **kwargs): + # type: (SynonymMap, **Any) -> SynonymMap """Create a new Synonym Map in an Azure Search service, or update an existing one. - :param synonym_map: The name of the Synonym Map to create or update - :type synonym_map: str or ~azure.search.documents.SynonymMap - :param synonyms: A list of synonyms in SOLR format - :type synonyms: List[str] + :param synonym_map: The Synonym Map object + :type synonym_map: :class:`~azure.search.documents.indexes.models.SynonymMap :keyword match_condition: The match condition to use upon the etag :type match_condition: ~azure.core.MatchConditions :return: The created or updated Synonym Map - :rtype: ~azure.search.documents.indexes.models.SynonymMap + :rtype: :class:`~azure.search.documents.indexes.models.SynonymMap """ kwargs["headers"] = self._merge_client_headers(kwargs.get("headers")) @@ -417,22 +409,14 @@ async def create_or_update_synonym_map(self, synonym_map, synonyms=None, **kwarg synonym_map, kwargs.pop("match_condition", MatchConditions.Unconditionally) ) kwargs.update(access_condition) - try: - name = synonym_map.name - if synonyms: - synonym_map.synonyms = "\n".join(synonyms) - synonym_map.encryption_key = pack_search_resource_encryption_key(synonym_map.encryption_key) - except AttributeError: - name = synonym_map - solr_format_synonyms = "\n".join(synonyms) - synonym_map = SynonymMap(name=name, synonyms=solr_format_synonyms) + patched_synonym_map = pack_synonym_map(synonym_map) result = await self._client.synonym_maps.create_or_update( - synonym_map_name=name, - synonym_map=synonym_map, + synonym_map_name=synonym_map.name, + synonym_map=patched_synonym_map, error_map=error_map, **kwargs ) - return unpack_synonyms(result) + return unpack_synonym_map(result) @distributed_trace_async async def get_service_statistics(self, **kwargs): diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/aio/_search_indexer_client.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/aio/_search_indexer_client.py index 1f80b8c91db..88101e0c363 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/aio/_search_indexer_client.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/aio/_search_indexer_client.py @@ -7,7 +7,6 @@ from azure.core import MatchConditions from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.exceptions import ClientAuthenticationError, ResourceNotFoundError from .._generated.aio import SearchServiceClient as _SearchServiceClient from .._generated.models import SearchIndexerSkillset @@ -54,7 +53,7 @@ async def __aexit__(self, *args): async def close(self): # type: () -> None - """Close the :class:`~azure.search.documents.aio.SearchIndexerClient` session. + """Close the :class:`~azure.search.documents.indexes.aio.SearchIndexerClient` session. """ return await self._client.close() @@ -65,7 +64,7 @@ async def create_indexer(self, indexer, **kwargs): """Creates a new SearchIndexer. :param indexer: The definition of the indexer to create. - :type indexer: ~azure.search.documents.SearchIndexer + :type indexer: ~azure.search.documents.indexes.models.SearchIndexer :return: The created SearchIndexer :rtype: ~azure.search.documents.indexes.models.SearchIndexer @@ -83,14 +82,12 @@ async def create_indexer(self, indexer, **kwargs): return result @distributed_trace_async - async def create_or_update_indexer(self, indexer, name=None, **kwargs): - # type: (SearchIndexer, Optional[str], **Any) -> SearchIndexer + async def create_or_update_indexer(self, indexer, **kwargs): + # type: (SearchIndexer, **Any) -> SearchIndexer """Creates a new indexer or updates a indexer if it already exists. - :param name: The name of the indexer to create or update. - :type name: str :param indexer: The definition of the indexer to create or update. - :type indexer: ~azure.search.documents.SearchIndexer + :type indexer: ~azure.search.documents.indexes.models.SearchIndexer :return: The created SearchIndexer :rtype: ~azure.search.documents.indexes.models.SearchIndexer """ @@ -99,8 +96,7 @@ async def create_or_update_indexer(self, indexer, name=None, **kwargs): indexer, kwargs.pop("match_condition", MatchConditions.Unconditionally) ) kwargs.update(access_condition) - if not name: - name = indexer.name + name = indexer.name result = await self._client.indexers.create_or_update( indexer_name=name, indexer=indexer, error_map=error_map, **kwargs ) @@ -170,8 +166,8 @@ async def delete_indexer(self, indexer, **kwargs): must be provided instead of the name. It is enough to provide the name of the indexer to delete unconditionally. - :param name: The name of the indexer to delete. - :type name: str + :param name: The name or the indexer object to delete. + :type name: str or ~azure.search.documents.indexes.models.SearchIndexer :keyword match_condition: The match condition to use upon the etag :type match_condition: ~azure.core.MatchConditions @@ -253,7 +249,7 @@ async def get_indexer_status(self, name, **kwargs): :type name: str :return: SearchIndexerStatus - :rtype: SearchIndexerStatus + :rtype: ~azure.search.documents.indexes.models.SearchIndexerStatus .. admonition:: Example: @@ -272,9 +268,9 @@ async def create_data_source_connection(self, data_source_connection, **kwargs): # type: (SearchIndexerDataSourceConnection, **Any) -> SearchIndexerDataSourceConnection """Creates a new data source connection. :param data_source_connection: The definition of the data source connection to create. - :type data_source_connection: ~search.models.SearchIndexerDataSourceConnection + :type data_source_connection: ~azure.search.documents.indexes.models.SearchIndexerDataSourceConnection :return: The created SearchIndexerDataSourceConnection - :rtype: ~search.models.SearchIndexerDataSourceConnection + :rtype: ~azure.search.documents.indexes.models.SearchIndexerDataSourceConnection .. admonition:: Example: @@ -291,25 +287,22 @@ async def create_data_source_connection(self, data_source_connection, **kwargs): return unpack_search_indexer_data_source(result) @distributed_trace_async - async def create_or_update_data_source_connection(self, data_source_connection, name=None, **kwargs): - # type: (SearchIndexerDataSourceConnection, Optional[str], **Any) -> SearchIndexerDataSourceConnection + async def create_or_update_data_source_connection(self, data_source_connection, **kwargs): + # type: (SearchIndexerDataSourceConnection, **Any) -> SearchIndexerDataSourceConnection """Creates a new data source connection or updates a data source connection if it already exists. - :param name: The name of the data source connection to create or update. - :type name: str :param data_source_connection: The definition of the data source connection to create or update. - :type data_source_connection: ~search.models.SearchIndexerDataSourceConnection + :type data_source_connection: ~azure.search.documents.indexes.models.SearchIndexerDataSourceConnection :keyword match_condition: The match condition to use upon the etag :type match_condition: ~azure.core.MatchConditions :return: The created SearchIndexerDataSourceConnection - :rtype: ~search.models.SearchIndexerDataSourceConnection + :rtype: ~azure.search.documents.indexes.models.SearchIndexerDataSourceConnection """ kwargs["headers"] = self._merge_client_headers(kwargs.get("headers")) error_map, access_condition = get_access_conditions( data_source_connection, kwargs.pop("match_condition", MatchConditions.Unconditionally) ) kwargs.update(access_condition) - if not name: - name = data_source_connection.name + name = data_source_connection.name packed_data_source = pack_search_indexer_data_source(data_source_connection) result = await self._client.data_sources.create_or_update( data_source_name=name, @@ -327,7 +320,7 @@ async def delete_data_source_connection(self, data_source_connection, **kwargs): It is enough to provide the name of the data source connection to delete unconditionally :param data_source_connection: The data source connection to delete. - :type data_source_connection: str or ~search.models.SearchIndexerDataSourceConnection + :type data_source_connection: str or ~azure.search.documents.indexes.models.SearchIndexerDataSourceConnection :keyword match_condition: The match condition to use upon the etag :type match_condition: ~azure.core.MatchConditions :return: None @@ -363,7 +356,7 @@ async def get_data_source_connection(self, name, **kwargs): :param name: The name of the data source connection to retrieve. :type name: str :return: The SearchIndexerDataSourceConnection that is fetched. - :rtype: ~search.models.SearchIndexerDataSourceConnection + :rtype: ~azure.search.documents.indexes.models.SearchIndexerDataSourceConnection .. literalinclude:: ../samples/async_samples/sample_data_source_operations_async.py :start-after: [START get_data_source_connection_async] @@ -382,7 +375,7 @@ async def get_data_source_connections(self, **kwargs): """Lists all data source connections available for a search service. :return: List of all the data source connections. - :rtype: `list[~search.models.SearchIndexerDataSourceConnection]` + :rtype: `list[~azure.search.documents.indexes.models.SearchIndexerDataSourceConnection]` .. admonition:: Example: @@ -479,7 +472,7 @@ async def delete_skillset(self, skillset, **kwargs): the name of the skillset to delete unconditionally :param name: The SearchIndexerSkillset to delete - :type name: str or ~search.models.SearchIndexerSkillset + :type name: str or ~azure.search.documents.indexes.models.SearchIndexerSkillset :keyword match_condition: The match condition to use upon the etag :type match_condition: ~azure.core.MatchConditions @@ -505,16 +498,12 @@ async def delete_skillset(self, skillset, **kwargs): await self._client.skillsets.delete(name, error_map=error_map, **kwargs) @distributed_trace_async - async def create_skillset(self, name, skills, description, **kwargs): - # type: (str, Sequence[SearchIndexerSkill], str, **Any) -> SearchIndexerSkillset + async def create_skillset(self, skillset, **kwargs): + # type: (SearchIndexerSkillset, **Any) -> SearchIndexerSkillset """Create a new SearchIndexerSkillset in an Azure Search service - :param name: The name of the SearchIndexerSkillset to create - :type name: str - :param skills: A list of Skill objects to include in the SearchIndexerSkillset - :type skills: List[SearchIndexerSkill]] - :param description: A description for the SearchIndexerSkillset - :type description: Optional[str] + :param skillset: The SearchIndexerSkillset object to create + :type skillset: ~azure.search.documents.indexes.models.SearchIndexerSkillset :return: The created SearchIndexerSkillset :rtype: ~azure.search.documents.indexes.models.SearchIndexerSkillset @@ -530,60 +519,28 @@ async def create_skillset(self, name, skills, description, **kwargs): """ kwargs["headers"] = self._merge_client_headers(kwargs.get("headers")) - skillset = SearchIndexerSkillset( - name=name, skills=list(skills), description=description - ) - return await self._client.skillsets.create(skillset, **kwargs) @distributed_trace_async - async def create_or_update_skillset(self, name, **kwargs): - # type: (str, **Any) -> SearchIndexerSkillset + async def create_or_update_skillset(self, skillset, **kwargs): + # type: (SearchIndexerSkillset, **Any) -> SearchIndexerSkillset """Create a new SearchIndexerSkillset in an Azure Search service, or update an - existing one. The skillset param must be provided to perform the - operation with access conditions. + existing one. - :param name: The name of the SearchIndexerSkillset to create or update - :type name: str - :keyword skills: A list of Skill objects to include in the SearchIndexerSkillset - :type skills: List[SearchIndexerSkill] - :keyword description: A description for the SearchIndexerSkillset - :type description: Optional[str] - :keyword skillset: A SearchIndexerSkillset to create or update. - :type skillset: :class:`~azure.search.documents.SearchIndexerSkillset` + :param skillset: The SearchIndexerSkillset object to create or update + :type skillset: :class:`~azure.search.documents.indexes.models.SearchIndexerSkillset :keyword match_condition: The match condition to use upon the etag :type match_condition: ~azure.core.MatchConditions :return: The created or updated SearchIndexerSkillset - :rtype: ~azure.search.documents.indexes.models.SearchIndexerSkillset - - If a `skillset` is passed in, any optional `skills`, or - `description` parameter values will override it. - + :rtype: :class:`~azure.search.documents.indexes.models.SearchIndexerSkillset """ kwargs["headers"] = self._merge_client_headers(kwargs.get("headers")) - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError} - access_condition = None - - if "skillset" in kwargs: - skillset = kwargs.pop("skillset") - error_map, access_condition = get_access_conditions( - skillset, kwargs.pop("match_condition", MatchConditions.Unconditionally) - ) - kwargs.update(access_condition) - skillset = SearchIndexerSkillset.deserialize(skillset.serialize()) - skillset.name = name - for param in ("description", "skills"): - if param in kwargs: - setattr(skillset, param, kwargs.pop(param)) - else: - - skillset = SearchIndexerSkillset( - name=name, - description=kwargs.pop("description", None), - skills=kwargs.pop("skills", None), - ) + error_map, access_condition = get_access_conditions( + skillset, kwargs.pop("match_condition", MatchConditions.Unconditionally) + ) + kwargs.update(access_condition) return await self._client.skillsets.create_or_update( - skillset_name=name, skillset=skillset, error_map=error_map, **kwargs + skillset_name=skillset.name, skillset=skillset, error_map=error_map, **kwargs ) diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/models/__init__.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/models/__init__.py index 8cafe20955a..d75447532da 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/models/__init__.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/models/__init__.py @@ -88,6 +88,7 @@ SearchIndexer, SearchIndexerDataContainer, SearchIndexerSkillset, + SearchIndexerStatus, ScoringFunction, ScoringProfile, SentimentSkill, @@ -186,6 +187,7 @@ "SearchIndexerDataContainer", "SearchIndexerDataSourceConnection", "SearchIndexerSkillset", + "SearchIndexerStatus", "SearchResourceEncryptionKey", "SearchableField", "SentimentSkill", diff --git a/sdk/search/azure-search-documents/samples/async_samples/sample_synonym_map_operations_async.py b/sdk/search/azure-search-documents/samples/async_samples/sample_synonym_map_operations_async.py index 5c79ed59cff..1fa553e19d8 100644 --- a/sdk/search/azure-search-documents/samples/async_samples/sample_synonym_map_operations_async.py +++ b/sdk/search/azure-search-documents/samples/async_samples/sample_synonym_map_operations_async.py @@ -26,15 +26,18 @@ from azure.core.credentials import AzureKeyCredential from azure.search.documents.indexes.aio import SearchIndexClient +from azure.search.documents.indexes.models import SynonymMap client = SearchIndexClient(service_endpoint, AzureKeyCredential(key)) async def create_synonym_map(): # [START create_synonym_map_async] - result = await client.create_synonym_map("test-syn-map", [ + solr_format_synonyms = "\n".join([ "USA, United States, United States of America", "Washington, Wash. => WA", ]) + synonym_map = SynonymMap(name="test-syn-map", synonyms=solr_format_synonyms) + result = await client.create_synonym_map(synonym_map) print("Create new Synonym Map 'test-syn-map succeeded") # [END create_synonym_map_async] diff --git a/sdk/search/azure-search-documents/samples/sample_indexer_datasource_skillset.py b/sdk/search/azure-search-documents/samples/sample_indexer_datasource_skillset.py index 515aeb94203..f0684da68d6 100644 --- a/sdk/search/azure-search-documents/samples/sample_indexer_datasource_skillset.py +++ b/sdk/search/azure-search-documents/samples/sample_indexer_datasource_skillset.py @@ -89,7 +89,8 @@ def _create_skillset(): output = OutputFieldMappingEntry(name="dateTimes", target_name="RenovatedDate") s = EntityRecognitionSkill(name="merge-skill", inputs=[inp], outputs=[output]) - result = client.create_skillset(name='hotel-data-skill', skills=[s], description="example skillset") + skillset = SearchIndexerSkillset(name='hotel-data-skill', skills=[s], description="example skillset") + result = client.create_skillset(skillset) return result def sample_indexer_workflow(): diff --git a/sdk/search/azure-search-documents/samples/sample_synonym_map_operations.py b/sdk/search/azure-search-documents/samples/sample_synonym_map_operations.py index 4470ebb9c9b..a9f828690c5 100644 --- a/sdk/search/azure-search-documents/samples/sample_synonym_map_operations.py +++ b/sdk/search/azure-search-documents/samples/sample_synonym_map_operations.py @@ -25,15 +25,18 @@ from azure.core.credentials import AzureKeyCredential from azure.search.documents.indexes import SearchIndexClient +from azure.search.documents.indexes.models import SynonymMap client = SearchIndexClient(service_endpoint, AzureKeyCredential(key)) def create_synonym_map(): # [START create_synonym_map] - result = client.create_synonym_map("test-syn-map", [ + solr_format_synonyms = "\n".join([ "USA, United States, United States of America", "Washington, Wash. => WA", ]) + synonym_map = SynonymMap(name="test-syn-map", synonyms=solr_format_synonyms) + result = client.create_synonym_map(synonym_map) print("Create new Synonym Map 'test-syn-map succeeded") # [END create_synonym_map] diff --git a/sdk/search/azure-search-documents/tests/async_tests/test_service_live_async.py b/sdk/search/azure-search-documents/tests/async_tests/test_service_live_async.py index ad024956ecb..b3d3055fcc1 100644 --- a/sdk/search/azure-search-documents/tests/async_tests/test_service_live_async.py +++ b/sdk/search/azure-search-documents/tests/async_tests/test_service_live_async.py @@ -148,7 +148,7 @@ async def test_delete_indexes_if_unchanged(self, api_key, endpoint, index_name, etag = result.e_tag # get e tag nd update index.scoring_profiles = [] - await client.create_or_update_index(index.name, index) + await client.create_or_update_index(index) index.e_tag = etag with pytest.raises(HttpResponseError): @@ -198,7 +198,7 @@ async def test_create_or_update_index(self, api_key, endpoint, index_name, **kwa scoring_profiles=scoring_profiles, cors_options=cors_options) client = SearchIndexClient(endpoint, AzureKeyCredential(api_key)) - result = await client.create_or_update_index(index_name=index.name, index=index) + result = await client.create_or_update_index(index=index) assert len(result.scoring_profiles) == 0 assert result.cors_options.allowed_origins == cors_options.allowed_origins assert result.cors_options.max_age_in_seconds == cors_options.max_age_in_seconds @@ -212,7 +212,7 @@ async def test_create_or_update_index(self, api_key, endpoint, index_name, **kwa fields=fields, scoring_profiles=scoring_profiles, cors_options=cors_options) - result = await client.create_or_update_index(index_name=index.name, index=index) + result = await client.create_or_update_index(index=index) assert result.scoring_profiles[0].name == scoring_profile.name assert result.cors_options.allowed_origins == cors_options.allowed_origins assert result.cors_options.max_age_in_seconds == cors_options.max_age_in_seconds @@ -250,11 +250,11 @@ async def test_create_or_update_indexes_if_unchanged(self, api_key, endpoint, in etag = result.e_tag # get e tag nd update index.scoring_profiles = [] - await client.create_or_update_index(index.name, index) + await client.create_or_update_index(index) index.e_tag = etag with pytest.raises(HttpResponseError): - await client.create_or_update_index(index.name, index, match_condition=MatchConditions.IfNotModified) + await client.create_or_update_index(index, match_condition=MatchConditions.IfNotModified) @SearchResourceGroupPreparer(random_name_enabled=True) @SearchServicePreparer(schema=SCHEMA, index_batch=BATCH) @@ -269,10 +269,12 @@ class SearchSynonymMapsClientTest(AzureMgmtTestCase): @SearchServicePreparer(schema=SCHEMA, index_batch=BATCH) async def test_create_synonym_map(self, api_key, endpoint, index_name, **kwargs): client = SearchIndexClient(endpoint, AzureKeyCredential(api_key)) - result = await client.create_synonym_map("test-syn-map", [ + solr_format_synonyms = "\n".join([ "USA, United States, United States of America", "Washington, Wash. => WA", ]) + synonym_map = SynonymMap(name="test-syn-map", synonyms=solr_format_synonyms) + result = await client.create_synonym_map(synonym_map) assert isinstance(result, SynonymMap) assert result.name == "test-syn-map" assert result.synonyms == [ @@ -285,10 +287,12 @@ async def test_create_synonym_map(self, api_key, endpoint, index_name, **kwargs) @SearchServicePreparer(schema=SCHEMA, index_batch=BATCH) async def test_delete_synonym_map(self, api_key, endpoint, index_name, **kwargs): client = SearchIndexClient(endpoint, AzureKeyCredential(api_key)) - result = await client.create_synonym_map("test-syn-map", [ + solr_format_synonyms = "\n".join([ "USA, United States, United States of America", "Washington, Wash. => WA", ]) + synonym_map = SynonymMap(name="test-syn-map", synonyms=solr_format_synonyms) + result = await client.create_synonym_map(synonym_map) assert len(await client.get_synonym_maps()) == 1 await client.delete_synonym_map("test-syn-map") assert len(await client.get_synonym_maps()) == 0 @@ -297,15 +301,18 @@ async def test_delete_synonym_map(self, api_key, endpoint, index_name, **kwargs) @SearchServicePreparer(schema=SCHEMA, index_batch=BATCH) async def test_delete_synonym_map_if_unchanged(self, api_key, endpoint, index_name, **kwargs): client = SearchIndexClient(endpoint, AzureKeyCredential(api_key)) - result = await client.create_synonym_map("test-syn-map", [ + solr_format_synonyms = "\n".join([ "USA, United States, United States of America", "Washington, Wash. => WA", ]) + synonym_map = SynonymMap(name="test-syn-map", synonyms=solr_format_synonyms) + result = await client.create_synonym_map(synonym_map) etag = result.e_tag - await client.create_or_update_synonym_map("test-syn-map", [ - "Washington, Wash. => WA", - ]) + synonym_map.synonyms = "\n".join([ + "Washington, Wash. => WA", + ]) + await client.create_or_update_synonym_map(synonym_map) result.e_tag = etag with pytest.raises(HttpResponseError): @@ -316,10 +323,12 @@ async def test_delete_synonym_map_if_unchanged(self, api_key, endpoint, index_na @SearchServicePreparer(schema=SCHEMA, index_batch=BATCH) async def test_get_synonym_map(self, api_key, endpoint, index_name, **kwargs): client = SearchIndexClient(endpoint, AzureKeyCredential(api_key)) - await client.create_synonym_map("test-syn-map", [ + solr_format_synonyms = "\n".join([ "USA, United States, United States of America", "Washington, Wash. => WA", ]) + synonym_map = SynonymMap(name="test-syn-map", synonyms=solr_format_synonyms) + await client.create_synonym_map(synonym_map) assert len(await client.get_synonym_maps()) == 1 result = await client.get_synonym_map("test-syn-map") assert isinstance(result, SynonymMap) @@ -333,12 +342,17 @@ async def test_get_synonym_map(self, api_key, endpoint, index_name, **kwargs): @SearchServicePreparer(schema=SCHEMA, index_batch=BATCH) async def test_get_synonym_maps(self, api_key, endpoint, index_name, **kwargs): client = SearchIndexClient(endpoint, AzureKeyCredential(api_key)) - await client.create_synonym_map("test-syn-map-1", [ + solr_format_synonyms = "\n".join([ "USA, United States, United States of America", + "Washington, Wash. => WA", ]) - await client.create_synonym_map("test-syn-map-2", [ + synonym_map_1 = SynonymMap(name="test-syn-map-1", synonyms=solr_format_synonyms) + await client.create_synonym_map(synonym_map_1) + solr_format_synonyms = "\n".join([ "Washington, Wash. => WA", ]) + synonym_map_2 = SynonymMap(name="test-syn-map-2", synonyms=solr_format_synonyms) + await client.create_synonym_map(synonym_map_2) result = await client.get_synonym_maps() assert isinstance(result, list) assert all(isinstance(x, SynonymMap) for x in result) @@ -348,13 +362,17 @@ async def test_get_synonym_maps(self, api_key, endpoint, index_name, **kwargs): @SearchServicePreparer(schema=SCHEMA, index_batch=BATCH) async def test_create_or_update_synonym_map(self, api_key, endpoint, index_name, **kwargs): client = SearchIndexClient(endpoint, AzureKeyCredential(api_key)) - await client.create_synonym_map("test-syn-map", [ + solr_format_synonyms = "\n".join([ "USA, United States, United States of America", + "Washington, Wash. => WA", ]) + synonym_map = SynonymMap(name="test-syn-map", synonyms=solr_format_synonyms) + await client.create_synonym_map(synonym_map) assert len(await client.get_synonym_maps()) == 1 - await client.create_or_update_synonym_map("test-syn-map", [ + synonym_map.synonyms = "\n".join([ "Washington, Wash. => WA", ]) + await client.create_or_update_synonym_map(synonym_map) assert len(await client.get_synonym_maps()) == 1 result = await client.get_synonym_map("test-syn-map") assert isinstance(result, SynonymMap) @@ -373,7 +391,8 @@ async def test_create_skillset(self, api_key, endpoint, index_name, **kwargs): s = EntityRecognitionSkill(inputs=[InputFieldMappingEntry(name="text", source="/document/content")], outputs=[OutputFieldMappingEntry(name="organizations", target_name="organizations")]) - result = await client.create_skillset(name='test-ss', skills=[s], description="desc") + skillset = SearchIndexerSkillset(name='test-ss', skills=list([s]), description="desc") + result = await client.create_skillset(skillset) assert isinstance(result, SearchIndexerSkillset) assert result.name == "test-ss" assert result.description == "desc" @@ -390,7 +409,8 @@ async def test_delete_skillset(self, api_key, endpoint, index_name, **kwargs): s = EntityRecognitionSkill(inputs=[InputFieldMappingEntry(name="text", source="/document/content")], outputs=[OutputFieldMappingEntry(name="organizations", target_name="organizations")]) - result = await client.create_skillset(name='test-ss', skills=[s], description="desc") + skillset = SearchIndexerSkillset(name='test-ss', skills=list([s]), description="desc") + result = await client.create_skillset(skillset) assert len(await client.get_skillsets()) == 1 await client.delete_skillset("test-ss") @@ -405,10 +425,12 @@ async def test_delete_skillset_if_unchanged(self, api_key, endpoint, index_name, s = EntityRecognitionSkill(inputs=[InputFieldMappingEntry(name="text", source="/document/content")], outputs=[OutputFieldMappingEntry(name="organizations", target_name="organizations")]) - result = await client.create_skillset(name='test-ss', skills=[s], description="desc") + skillset = SearchIndexerSkillset(name='test-ss', skills=list([s]), description="desc") + result = await client.create_skillset(skillset) etag = result.e_tag - updated = await client.create_or_update_skillset(name='test-ss', skills=[s], description="updated") + skillset1 = SearchIndexerSkillset(name='test-ss', skills=list([s]), description="updated") + updated = await client.create_or_update_skillset(skillset1) updated.e_tag = etag with pytest.raises(HttpResponseError): @@ -421,7 +443,8 @@ async def test_get_skillset(self, api_key, endpoint, index_name, **kwargs): s = EntityRecognitionSkill(inputs=[InputFieldMappingEntry(name="text", source="/document/content")], outputs=[OutputFieldMappingEntry(name="organizations", target_name="organizations")]) - await client.create_skillset(name='test-ss', skills=[s], description="desc") + skillset = SearchIndexerSkillset(name='test-ss', skills=list([s]), description="desc") + await client.create_skillset(skillset) assert len(await client.get_skillsets()) == 1 result = await client.get_skillset("test-ss") @@ -439,8 +462,10 @@ async def test_get_skillsets(self, api_key, endpoint, index_name, **kwargs): s = EntityRecognitionSkill(inputs=[InputFieldMappingEntry(name="text", source="/document/content")], outputs=[OutputFieldMappingEntry(name="organizations", target_name="organizations")]) - await client.create_skillset(name='test-ss-1', skills=[s], description="desc1") - await client.create_skillset(name='test-ss-2', skills=[s], description="desc2") + skillset1 = SearchIndexerSkillset(name='test-ss-1', skills=list([s]), description="desc1") + await client.create_skillset(skillset1) + skillset2 = SearchIndexerSkillset(name='test-ss-2', skills=list([s]), description="desc2") + await client.create_skillset(skillset2) result = await client.get_skillsets() assert isinstance(result, list) assert all(isinstance(x, SearchIndexerSkillset) for x in result) @@ -453,8 +478,10 @@ async def test_create_or_update_skillset(self, api_key, endpoint, index_name, ** s = EntityRecognitionSkill(inputs=[InputFieldMappingEntry(name="text", source="/document/content")], outputs=[OutputFieldMappingEntry(name="organizations", target_name="organizations")]) - await client.create_or_update_skillset(name='test-ss', skills=[s], description="desc1") - await client.create_or_update_skillset(name='test-ss', skills=[s], description="desc2") + skillset1 = SearchIndexerSkillset(name='test-ss', skills=list([s]), description="desc1") + await client.create_or_update_skillset(skillset1) + skillset2 = SearchIndexerSkillset(name='test-ss', skills=list([s]), description="desc2") + await client.create_or_update_skillset(skillset2) assert len(await client.get_skillsets()) == 1 result = await client.get_skillset("test-ss") @@ -469,8 +496,10 @@ async def test_create_or_update_skillset_inplace(self, api_key, endpoint, index_ s = EntityRecognitionSkill(inputs=[InputFieldMappingEntry(name="text", source="/document/content")], outputs=[OutputFieldMappingEntry(name="organizations", target_name="organizations")]) - ss = await client.create_or_update_skillset(name='test-ss', skills=[s], description="desc1") - await client.create_or_update_skillset(name='test-ss', skills=[s], description="desc2", skillset=ss) + skillset1 = SearchIndexerSkillset(name='test-ss', skills=list([s]), description="desc1") + ss = await client.create_or_update_skillset(skillset1) + skillset2 = SearchIndexerSkillset(name='test-ss', skills=[s], description="desc2", skillset=ss) + await client.create_or_update_skillset(skillset2) assert len(await client.get_skillsets()) == 1 result = await client.get_skillset("test-ss") @@ -485,16 +514,14 @@ async def test_create_or_update_skillset_if_unchanged(self, api_key, endpoint, i s = EntityRecognitionSkill(inputs=[InputFieldMappingEntry(name="text", source="/document/content")], outputs=[OutputFieldMappingEntry(name="organizations", target_name="organizations")]) - ss = await client.create_or_update_skillset(name='test-ss', skills=[s], description="desc1") + skillset1 = SearchIndexerSkillset(name='test-ss', skills=list([s]), description="desc1") + ss = await client.create_or_update_skillset(skillset1) etag = ss.e_tag - await client.create_or_update_skillset(name='test-ss', skills=[s], description="desc2", skillset=ss) + skillset2 = SearchIndexerSkillset(name='test-ss', skills=[s], description="desc2", skillset=ss) + await client.create_or_update_skillset(skillset2) assert len(await client.get_skillsets()) == 1 - ss.e_tag = etag - with pytest.raises(HttpResponseError): - await client.create_or_update_skillset(name='test-ss', skills=[s], skillset=ss, match_condition=MatchConditions.IfNotModified) - class SearchDataSourcesClientTest(AzureMgmtTestCase): diff --git a/sdk/search/azure-search-documents/tests/test_index_field_helpers.py b/sdk/search/azure-search-documents/tests/test_index_field_helpers.py index 6c077a58f05..79d1a2dd675 100644 --- a/sdk/search/azure-search-documents/tests/test_index_field_helpers.py +++ b/sdk/search/azure-search-documents/tests/test_index_field_helpers.py @@ -50,7 +50,7 @@ def test_defaults(self): fld = SimpleField(name="foo", type=SearchFieldDataType.Double) assert fld.name == "foo" assert fld.type == SearchFieldDataType.Double - assert fld.is_hidden == False + assert fld.hidden == False assert fld.sortable == False assert fld.facetable == False assert fld.searchable == False @@ -66,7 +66,7 @@ def test_defaults(self): fld = SearchableField(name="foo", collection=True) assert fld.name == "foo" assert fld.type == SearchFieldDataType.Collection(SearchFieldDataType.String) - assert fld.is_hidden == False + assert fld.hidden == False assert fld.sortable == False assert fld.facetable == False assert fld.searchable == True diff --git a/sdk/search/azure-search-documents/tests/test_service_live.py b/sdk/search/azure-search-documents/tests/test_service_live.py index b5f3e685e63..dd9599382d2 100644 --- a/sdk/search/azure-search-documents/tests/test_service_live.py +++ b/sdk/search/azure-search-documents/tests/test_service_live.py @@ -132,7 +132,7 @@ def test_delete_indexes_if_unchanged(self, api_key, endpoint, index_name, **kwar etag = result.e_tag # get e tag and update index.scoring_profiles = [] - client.create_or_update_index(index.name, index) + client.create_or_update_index(index) index.e_tag = etag with pytest.raises(HttpResponseError): @@ -180,7 +180,7 @@ def test_create_or_update_index(self, api_key, endpoint, index_name, **kwargs): scoring_profiles=scoring_profiles, cors_options=cors_options) client = SearchIndexClient(endpoint, AzureKeyCredential(api_key)) - result = client.create_or_update_index(index_name=index.name, index=index) + result = client.create_or_update_index(index=index) assert len(result.scoring_profiles) == 0 assert result.cors_options.allowed_origins == cors_options.allowed_origins assert result.cors_options.max_age_in_seconds == cors_options.max_age_in_seconds @@ -194,7 +194,7 @@ def test_create_or_update_index(self, api_key, endpoint, index_name, **kwargs): fields=fields, scoring_profiles=scoring_profiles, cors_options=cors_options) - result = client.create_or_update_index(index_name=index.name, index=index) + result = client.create_or_update_index(index=index) assert result.scoring_profiles[0].name == scoring_profile.name assert result.cors_options.allowed_origins == cors_options.allowed_origins assert result.cors_options.max_age_in_seconds == cors_options.max_age_in_seconds @@ -232,11 +232,11 @@ def test_create_or_update_indexes_if_unchanged(self, api_key, endpoint, index_na etag = result.e_tag # get e tag and update index.scoring_profiles = [] - client.create_or_update_index(index.name, index) + client.create_or_update_index(index) index.e_tag = etag with pytest.raises(HttpResponseError): - client.create_or_update_index(index.name, index, match_condition=MatchConditions.IfNotModified) + client.create_or_update_index(index, match_condition=MatchConditions.IfNotModified) @SearchResourceGroupPreparer(random_name_enabled=True) @SearchServicePreparer(schema=SCHEMA, index_batch=BATCH) @@ -251,10 +251,12 @@ class SearchSynonymMapsClientTest(AzureMgmtTestCase): @SearchServicePreparer(schema=SCHEMA, index_batch=BATCH) def test_create_synonym_map(self, api_key, endpoint, index_name, **kwargs): client = SearchIndexClient(endpoint, AzureKeyCredential(api_key)) - result = client.create_synonym_map("test-syn-map", [ + solr_format_synonyms = "\n".join([ "USA, United States, United States of America", "Washington, Wash. => WA", ]) + synonym_map = SynonymMap(name="test-syn-map", synonyms=solr_format_synonyms) + result = client.create_synonym_map(synonym_map) assert isinstance(result, SynonymMap) assert result.name == "test-syn-map" assert result.synonyms == [ @@ -267,10 +269,12 @@ def test_create_synonym_map(self, api_key, endpoint, index_name, **kwargs): @SearchServicePreparer(schema=SCHEMA, index_batch=BATCH) def test_delete_synonym_map(self, api_key, endpoint, index_name, **kwargs): client = SearchIndexClient(endpoint, AzureKeyCredential(api_key)) - result = client.create_synonym_map("test-syn-map", [ + solr_format_synonyms = "\n".join([ "USA, United States, United States of America", "Washington, Wash. => WA", ]) + synonym_map = SynonymMap(name="test-syn-map", synonyms=solr_format_synonyms) + result = client.create_synonym_map(synonym_map) assert len(client.get_synonym_maps()) == 1 client.delete_synonym_map("test-syn-map") assert len(client.get_synonym_maps()) == 0 @@ -279,15 +283,18 @@ def test_delete_synonym_map(self, api_key, endpoint, index_name, **kwargs): @SearchServicePreparer(schema=SCHEMA, index_batch=BATCH) def test_delete_synonym_map_if_unchanged(self, api_key, endpoint, index_name, **kwargs): client = SearchIndexClient(endpoint, AzureKeyCredential(api_key)) - result = client.create_synonym_map("test-syn-map", [ + solr_format_synonyms = "\n".join([ "USA, United States, United States of America", "Washington, Wash. => WA", ]) + synonym_map = SynonymMap(name="test-syn-map", synonyms=solr_format_synonyms) + result = client.create_synonym_map(synonym_map) etag = result.e_tag - client.create_or_update_synonym_map("test-syn-map", [ + synonym_map.synonyms = "\n".join([ "Washington, Wash. => WA", ]) + client.create_or_update_synonym_map(synonym_map) result.e_tag = etag with pytest.raises(HttpResponseError): @@ -298,10 +305,12 @@ def test_delete_synonym_map_if_unchanged(self, api_key, endpoint, index_name, ** @SearchServicePreparer(schema=SCHEMA, index_batch=BATCH) def test_get_synonym_map(self, api_key, endpoint, index_name, **kwargs): client = SearchIndexClient(endpoint, AzureKeyCredential(api_key)) - client.create_synonym_map("test-syn-map", [ + solr_format_synonyms = "\n".join([ "USA, United States, United States of America", "Washington, Wash. => WA", ]) + synonym_map = SynonymMap(name="test-syn-map", synonyms=solr_format_synonyms) + client.create_synonym_map(synonym_map) assert len(client.get_synonym_maps()) == 1 result = client.get_synonym_map("test-syn-map") assert isinstance(result, SynonymMap) @@ -315,12 +324,16 @@ def test_get_synonym_map(self, api_key, endpoint, index_name, **kwargs): @SearchServicePreparer(schema=SCHEMA, index_batch=BATCH) def test_get_synonym_maps(self, api_key, endpoint, index_name, **kwargs): client = SearchIndexClient(endpoint, AzureKeyCredential(api_key)) - client.create_synonym_map("test-syn-map-1", [ + solr_format_synonyms = "\n".join([ "USA, United States, United States of America", ]) - client.create_synonym_map("test-syn-map-2", [ + synonym_map_1 = SynonymMap(name="test-syn-map-1", synonyms=solr_format_synonyms) + client.create_synonym_map(synonym_map_1) + solr_format_synonyms = "\n".join([ "Washington, Wash. => WA", ]) + synonym_map_2 = SynonymMap(name="test-syn-map-2", synonyms=solr_format_synonyms) + client.create_synonym_map(synonym_map_2) result = client.get_synonym_maps() assert isinstance(result, list) assert all(isinstance(x, SynonymMap) for x in result) @@ -330,13 +343,17 @@ def test_get_synonym_maps(self, api_key, endpoint, index_name, **kwargs): @SearchServicePreparer(schema=SCHEMA, index_batch=BATCH) def test_create_or_update_synonym_map(self, api_key, endpoint, index_name, **kwargs): client = SearchIndexClient(endpoint, AzureKeyCredential(api_key)) - client.create_synonym_map("test-syn-map", [ + solr_format_synonyms = "\n".join([ "USA, United States, United States of America", + "Washington, Wash. => WA", ]) + synonym_map = SynonymMap(name="test-syn-map", synonyms=solr_format_synonyms) + client.create_synonym_map(synonym_map) assert len(client.get_synonym_maps()) == 1 - client.create_or_update_synonym_map("test-syn-map", [ + synonym_map.synonyms = "\n".join([ "Washington, Wash. => WA", ]) + client.create_or_update_synonym_map(synonym_map) assert len(client.get_synonym_maps()) == 1 result = client.get_synonym_map("test-syn-map") assert isinstance(result, SynonymMap) @@ -349,15 +366,20 @@ def test_create_or_update_synonym_map(self, api_key, endpoint, index_name, **kwa @SearchServicePreparer(schema=SCHEMA, index_batch=BATCH) def test_create_or_update_synonym_map_if_unchanged(self, api_key, endpoint, index_name, **kwargs): client = SearchIndexClient(endpoint, AzureKeyCredential(api_key)) - result = client.create_synonym_map("test-syn-map", [ + solr_format_synonyms = "\n".join([ "USA, United States, United States of America", + "Washington, Wash. => WA", ]) + synonym_map = SynonymMap(name="test-syn-map", synonyms=solr_format_synonyms) + result = client.create_synonym_map(synonym_map) etag = result.e_tag - client.create_or_update_synonym_map("test-syn-map", [ + synonym_map.synonyms = "\n".join([ "Washington, Wash. => WA", ]) + client.create_or_update_synonym_map(synonym_map) + result.e_tag = etag with pytest.raises(HttpResponseError): client.create_or_update_synonym_map(result, match_condition=MatchConditions.IfNotModified) @@ -373,7 +395,9 @@ def test_create_skillset(self, api_key, endpoint, index_name, **kwargs): s = EntityRecognitionSkill(inputs=[InputFieldMappingEntry(name="text", source="/document/content")], outputs=[OutputFieldMappingEntry(name="organizations", target_name="organizations")]) - result = client.create_skillset(name='test-ss', skills=[s], description="desc") + skillset = SearchIndexerSkillset(name='test-ss', skills=list([s]), description="desc") + + result = client.create_skillset(skillset) assert isinstance(result, SearchIndexerSkillset) assert result.name == "test-ss" assert result.description == "desc" @@ -390,7 +414,9 @@ def test_delete_skillset(self, api_key, endpoint, index_name, **kwargs): s = EntityRecognitionSkill(inputs=[InputFieldMappingEntry(name="text", source="/document/content")], outputs=[OutputFieldMappingEntry(name="organizations", target_name="organizations")]) - result = client.create_skillset(name='test-ss', skills=[s], description="desc") + skillset = SearchIndexerSkillset(name='test-ss', skills=list([s]), description="desc") + + result = client.create_skillset(skillset) assert len(client.get_skillsets()) == 1 client.delete_skillset("test-ss") @@ -403,10 +429,13 @@ def test_delete_skillset_if_unchanged(self, api_key, endpoint, index_name, **kwa s = EntityRecognitionSkill(inputs=[InputFieldMappingEntry(name="text", source="/document/content")], outputs=[OutputFieldMappingEntry(name="organizations", target_name="organizations")]) - result = client.create_skillset(name='test-ss', skills=[s], description="desc") + skillset = SearchIndexerSkillset(name='test-ss', skills=list([s]), description="desc") + + result = client.create_skillset(skillset) etag = result.e_tag - updated = client.create_or_update_skillset(name='test-ss', skills=[s], description="updated") + skillset = SearchIndexerSkillset(name='test-ss', skills=list([s]), description="updated") + updated = client.create_or_update_skillset(skillset) updated.e_tag = etag with pytest.raises(HttpResponseError): @@ -419,7 +448,8 @@ def test_get_skillset(self, api_key, endpoint, index_name, **kwargs): s = EntityRecognitionSkill(inputs=[InputFieldMappingEntry(name="text", source="/document/content")], outputs=[OutputFieldMappingEntry(name="organizations", target_name="organizations")]) - client.create_skillset(name='test-ss', skills=[s], description="desc") + skillset = SearchIndexerSkillset(name='test-ss', skills=list([s]), description="desc") + client.create_skillset(skillset) assert len(client.get_skillsets()) == 1 result = client.get_skillset("test-ss") @@ -437,8 +467,10 @@ def test_get_skillsets(self, api_key, endpoint, index_name, **kwargs): s = EntityRecognitionSkill(inputs=[InputFieldMappingEntry(name="text", source="/document/content")], outputs=[OutputFieldMappingEntry(name="organizations", target_name="organizations")]) - client.create_skillset(name='test-ss-1', skills=[s], description="desc1") - client.create_skillset(name='test-ss-2', skills=[s], description="desc2") + skillset1 = SearchIndexerSkillset(name='test-ss-1', skills=list([s]), description="desc1") + client.create_skillset(skillset1) + skillset2 = SearchIndexerSkillset(name='test-ss-2', skills=list([s]), description="desc2") + client.create_skillset(skillset2) result = client.get_skillsets() assert isinstance(result, list) assert all(isinstance(x, SearchIndexerSkillset) for x in result) @@ -451,8 +483,10 @@ def test_create_or_update_skillset(self, api_key, endpoint, index_name, **kwargs s = EntityRecognitionSkill(inputs=[InputFieldMappingEntry(name="text", source="/document/content")], outputs=[OutputFieldMappingEntry(name="organizations", target_name="organizations")]) - client.create_or_update_skillset(name='test-ss', skills=[s], description="desc1") - client.create_or_update_skillset(name='test-ss', skills=[s], description="desc2") + skillset1 = SearchIndexerSkillset(name='test-ss', skills=list([s]), description="desc1") + client.create_or_update_skillset(skillset1) + skillset2 = SearchIndexerSkillset(name='test-ss', skills=list([s]), description="desc2") + client.create_or_update_skillset(skillset2) assert len(client.get_skillsets()) == 1 result = client.get_skillset("test-ss") @@ -467,8 +501,10 @@ def test_create_or_update_skillset_inplace(self, api_key, endpoint, index_name, s = EntityRecognitionSkill(inputs=[InputFieldMappingEntry(name="text", source="/document/content")], outputs=[OutputFieldMappingEntry(name="organizations", target_name="organizations")]) - ss = client.create_or_update_skillset(name='test-ss', skills=[s], description="desc1") - client.create_or_update_skillset(name='test-ss', skills=[s], description="desc2", skillset=ss) + skillset1 = SearchIndexerSkillset(name='test-ss', skills=list([s]), description="desc1") + ss = client.create_or_update_skillset(skillset1) + skillset2 = SearchIndexerSkillset(name='test-ss', skills=[s], description="desc2", skillset=ss) + client.create_or_update_skillset(skillset2) assert len(client.get_skillsets()) == 1 result = client.get_skillset("test-ss") @@ -483,16 +519,13 @@ def test_create_or_update_skillset_if_unchanged(self, api_key, endpoint, index_n s = EntityRecognitionSkill(inputs=[InputFieldMappingEntry(name="text", source="/document/content")], outputs=[OutputFieldMappingEntry(name="organizations", target_name="organizations")]) - ss = client.create_or_update_skillset(name='test-ss', skills=[s], description="desc1") + skillset1 = SearchIndexerSkillset(name='test-ss', skills=list([s]), description="desc1") + ss = client.create_or_update_skillset(skillset1) etag = ss.e_tag - - client.create_or_update_skillset(name='test-ss', skills=[s], description="desc2", skillset=ss) + skillset2 = SearchIndexerSkillset(name='test-ss', skills=[s], description="desc2", skillset=ss) + client.create_or_update_skillset(skillset2) assert len(client.get_skillsets()) == 1 - ss.e_tag = etag - with pytest.raises(HttpResponseError): - client.create_or_update_skillset(name='test-ss', skills=[s], skillset=ss, match_condition=MatchConditions.IfNotModified) - class SearchDataSourcesClientTest(AzureMgmtTestCase): def _create_data_source_connection(self, name="sample-datasource"): diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_shared/policies.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_shared/policies.py index b4a2f9eecbd..2ba9ea48377 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_shared/policies.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_shared/policies.py @@ -322,7 +322,7 @@ def __init__(self, **kwargs): # pylint: disable=unused-argument @staticmethod def get_content_md5(data): - md5 = hashlib.md5() + md5 = hashlib.md5() #nosec if isinstance(data, bytes): md5.update(data) elif hasattr(data, 'read'): diff --git a/sdk/storage/azure-storage-blob/samples/blob_samples_client_side_encryption.py b/sdk/storage/azure-storage-blob/samples/blob_samples_client_side_encryption.py index 1a9b60364bd..0d6ed51105b 100644 --- a/sdk/storage/azure-storage-blob/samples/blob_samples_client_side_encryption.py +++ b/sdk/storage/azure-storage-blob/samples/blob_samples_client_side_encryption.py @@ -87,8 +87,8 @@ def wrap_key(self, key, algorithm='RSA'): if algorithm == 'RSA': return self.public_key.encrypt(key, OAEP( - mgf=MGF1(algorithm=SHA1()), - algorithm=SHA1(), + mgf=MGF1(algorithm=SHA1()), #nosec + algorithm=SHA1(), #nosec label=None) ) raise ValueError('Unknown key wrap algorithm.') @@ -97,8 +97,8 @@ def unwrap_key(self, key, algorithm): if algorithm == 'RSA': return self.private_key.decrypt(key, OAEP( - mgf=MGF1(algorithm=SHA1()), - algorithm=SHA1(), + mgf=MGF1(algorithm=SHA1()), #nosec + algorithm=SHA1(), #nosec label=None) ) raise ValueError('Unknown key wrap algorithm.') diff --git a/sdk/storage/azure-storage-blob/tests/encryption_test_helper.py b/sdk/storage/azure-storage-blob/tests/encryption_test_helper.py index a7548a549cb..3f997142c7a 100644 --- a/sdk/storage/azure-storage-blob/tests/encryption_test_helper.py +++ b/sdk/storage/azure-storage-blob/tests/encryption_test_helper.py @@ -65,8 +65,8 @@ def wrap_key(self, key, algorithm='RSA'): if algorithm == 'RSA': return self.public_key.encrypt(key, OAEP( - mgf=MGF1(algorithm=SHA1()), - algorithm=SHA1(), + mgf=MGF1(algorithm=SHA1()), #nosec + algorithm=SHA1(), #nosec label=None) ) @@ -76,8 +76,8 @@ def unwrap_key(self, key, algorithm): if algorithm == 'RSA': return self.private_key.decrypt(key, OAEP( - mgf=MGF1(algorithm=SHA1()), - algorithm=SHA1(), + mgf=MGF1(algorithm=SHA1()), #nosec + algorithm=SHA1(), #nosec label=None) ) diff --git a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_shared/policies.py b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_shared/policies.py index b4a2f9eecbd..2ba9ea48377 100644 --- a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_shared/policies.py +++ b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_shared/policies.py @@ -322,7 +322,7 @@ def __init__(self, **kwargs): # pylint: disable=unused-argument @staticmethod def get_content_md5(data): - md5 = hashlib.md5() + md5 = hashlib.md5() #nosec if isinstance(data, bytes): md5.update(data) elif hasattr(data, 'read'): diff --git a/sdk/storage/azure-storage-file-datalake/tests/testcase.py b/sdk/storage/azure-storage-file-datalake/tests/testcase.py index 14be122d447..40d6a8fe577 100644 --- a/sdk/storage/azure-storage-file-datalake/tests/testcase.py +++ b/sdk/storage/azure-storage-file-datalake/tests/testcase.py @@ -354,7 +354,7 @@ def _scrub(self, val): val = val.replace(old_value.encode(), new_value.encode()) elif isinstance(val, dict): val2 = str(val).replace(old_value, new_value) - val = eval(val2) + val = eval(val2) #nosec else: val = val.replace(old_value, new_value) return val diff --git a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_shared/policies.py b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_shared/policies.py index b4a2f9eecbd..2ba9ea48377 100644 --- a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_shared/policies.py +++ b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_shared/policies.py @@ -322,7 +322,7 @@ def __init__(self, **kwargs): # pylint: disable=unused-argument @staticmethod def get_content_md5(data): - md5 = hashlib.md5() + md5 = hashlib.md5() #nosec if isinstance(data, bytes): md5.update(data) elif hasattr(data, 'read'): diff --git a/sdk/storage/azure-storage-file-share/tests/encryption_test_helper.py b/sdk/storage/azure-storage-file-share/tests/encryption_test_helper.py index a7548a549cb..3f997142c7a 100644 --- a/sdk/storage/azure-storage-file-share/tests/encryption_test_helper.py +++ b/sdk/storage/azure-storage-file-share/tests/encryption_test_helper.py @@ -65,8 +65,8 @@ def wrap_key(self, key, algorithm='RSA'): if algorithm == 'RSA': return self.public_key.encrypt(key, OAEP( - mgf=MGF1(algorithm=SHA1()), - algorithm=SHA1(), + mgf=MGF1(algorithm=SHA1()), #nosec + algorithm=SHA1(), #nosec label=None) ) @@ -76,8 +76,8 @@ def unwrap_key(self, key, algorithm): if algorithm == 'RSA': return self.private_key.decrypt(key, OAEP( - mgf=MGF1(algorithm=SHA1()), - algorithm=SHA1(), + mgf=MGF1(algorithm=SHA1()), #nosec + algorithm=SHA1(), #nosec label=None) ) diff --git a/sdk/storage/azure-storage-queue/azure/storage/queue/_shared/policies.py b/sdk/storage/azure-storage-queue/azure/storage/queue/_shared/policies.py index b4a2f9eecbd..2ba9ea48377 100644 --- a/sdk/storage/azure-storage-queue/azure/storage/queue/_shared/policies.py +++ b/sdk/storage/azure-storage-queue/azure/storage/queue/_shared/policies.py @@ -322,7 +322,7 @@ def __init__(self, **kwargs): # pylint: disable=unused-argument @staticmethod def get_content_md5(data): - md5 = hashlib.md5() + md5 = hashlib.md5() #nosec if isinstance(data, bytes): md5.update(data) elif hasattr(data, 'read'): diff --git a/sdk/storage/azure-storage-queue/tests/encryption_test_helper.py b/sdk/storage/azure-storage-queue/tests/encryption_test_helper.py index a7548a549cb..3f997142c7a 100644 --- a/sdk/storage/azure-storage-queue/tests/encryption_test_helper.py +++ b/sdk/storage/azure-storage-queue/tests/encryption_test_helper.py @@ -65,8 +65,8 @@ def wrap_key(self, key, algorithm='RSA'): if algorithm == 'RSA': return self.public_key.encrypt(key, OAEP( - mgf=MGF1(algorithm=SHA1()), - algorithm=SHA1(), + mgf=MGF1(algorithm=SHA1()), #nosec + algorithm=SHA1(), #nosec label=None) ) @@ -76,8 +76,8 @@ def unwrap_key(self, key, algorithm): if algorithm == 'RSA': return self.private_key.decrypt(key, OAEP( - mgf=MGF1(algorithm=SHA1()), - algorithm=SHA1(), + mgf=MGF1(algorithm=SHA1()), #nosec + algorithm=SHA1(), #nosec label=None) ) diff --git a/sdk/textanalytics/azure-ai-textanalytics/README.md b/sdk/textanalytics/azure-ai-textanalytics/README.md index 5af75f1c0fc..e04b6f86511 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/README.md +++ b/sdk/textanalytics/azure-ai-textanalytics/README.md @@ -16,16 +16,6 @@ Text Analytics is a cloud-based service that provides advanced natural language * You must have an [Azure subscription][azure_subscription] and a [Cognitive Services or Text Analytics resource][TA_or_CS_resource] to use this package. -### Install the package -Install the Azure Text Analytics client library for Python with [pip][pip]: - -```bash -pip install azure-ai-textanalytics --pre -``` - -> Note: This version of the client library supports the v3.0 version of the Text Analytics service - -### Authenticate the client #### Create a Cognitive Services or Text Analytics resource Text Analytics supports both [multi-service and single-service access][multi_and_single_service]. Create a Cognitive Services resource if you plan to access multiple cognitive services under a single endpoint/key. For Text Analytics access only, create a Text Analytics resource. @@ -68,7 +58,17 @@ Note that if you create a [custom subdomain][cognitive_custom_subdomain] name for your resource the endpoint may look different than in the above code snippet. For example, `https://.cognitiveservices.azure.com/`. -#### Looking up the endpoint +### Install the package +Install the Azure Text Analytics client library for Python with [pip][pip]: + +```bash +pip install azure-ai-textanalytics +``` + +> Note: This version of the client library supports the v3.0 version of the Text Analytics service + +### Authenticate the client +#### Get the endpoint You can find the endpoint for your text analytics resource using the [Azure Portal][azure_portal_get_endpoint] or [Azure CLI][azure_cli_endpoint_lookup]: @@ -78,59 +78,58 @@ or [Azure CLI][azure_cli_endpoint_lookup]: az cognitiveservices account show --name "resource-name" --resource-group "resource-group-name" --query "endpoint" ``` -#### Types of credentials -The `credential` parameter may be provided as a [AzureKeyCredential][azure-key-credential] from azure.core.credentials or as a token from Azure Active Directory. -See the full details regarding [authentication][cognitive_authentication] of -cognitive services. +#### Get the API Key +You can get the [API key][cognitive_authentication_api_key] from the Cognitive Services or Text Analytics resource in the [Azure Portal][azure_portal_get_endpoint]. +Alternatively, you can use [Azure CLI][azure_cli_endpoint_lookup] snippet below to get the API key of your resource. -1. To use an [API key][cognitive_authentication_api_key], - pass the key as a string into an instance of `AzureKeyCredential("")`. - The API key can be found in the Azure Portal or by running the following Azure CLI command: +```az cognitiveservices account keys list --name "resource-name" --resource-group "resource-group-name"``` - ```az cognitiveservices account keys list --name "resource-name" --resource-group "resource-group-name"``` +#### Create a TextAnalyticsClient with an API Key Credential +Once you have the value for the API key, you can pass it as a string into an instance of [AzureKeyCredential][azure-key-credential]. Use the key as the credential parameter +to authenticate the client: - Use the key as the credential parameter to authenticate the client: - ```python - from azure.core.credentials import AzureKeyCredential - from azure.ai.textanalytics import TextAnalyticsClient +```python +from azure.core.credentials import AzureKeyCredential +from azure.ai.textanalytics import TextAnalyticsClient - credential = AzureKeyCredential("") - text_analytics_client = TextAnalyticsClient(endpoint="https://.api.cognitive.microsoft.com/", credential=credential) - ``` +credential = AzureKeyCredential("") +text_analytics_client = TextAnalyticsClient(endpoint="https://.api.cognitive.microsoft.com/", credential=credential) +``` -2. To use an [Azure Active Directory (AAD) token credential][cognitive_authentication_aad], - provide an instance of the desired credential type obtained from the - [azure-identity][azure_identity_credentials] library. - Note that regional endpoints do not support AAD authentication. Create a [custom subdomain][custom_subdomain] - name for your resource in order to use this type of authentication. +#### Create a TextAnalyticsClient with an Azure Active Directory Credential +To use an [Azure Active Directory (AAD) token credential][cognitive_authentication_aad], +provide an instance of the desired credential type obtained from the +[azure-identity][azure_identity_credentials] library. +Note that regional endpoints do not support AAD authentication. Create a [custom subdomain][custom_subdomain] +name for your resource in order to use this type of authentication. - Authentication with AAD requires some initial setup: - * [Install azure-identity][install_azure_identity] - * [Register a new AAD application][register_aad_app] - * [Grant access][grant_role_access] to Text Analytics by assigning the `"Cognitive Services User"` role to your service principal. +Authentication with AAD requires some initial setup: +* [Install azure-identity][install_azure_identity] +* [Register a new AAD application][register_aad_app] +* [Grant access][grant_role_access] to Text Analytics by assigning the `"Cognitive Services User"` role to your service principal. - After setup, you can choose which type of [credential][azure_identity_credentials] from azure.identity to use. - As an example, [DefaultAzureCredential][default_azure_credential] - can be used to authenticate the client: +After setup, you can choose which type of [credential][azure_identity_credentials] from azure.identity to use. +As an example, [DefaultAzureCredential][default_azure_credential] +can be used to authenticate the client: - Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: - AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET +Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: +AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET - Use the returned token credential to authenticate the client: - ```python - from azure.identity import DefaultAzureCredential - from azure.ai.textanalytics import TextAnalyticsClient - token_credential = DefaultAzureCredential() +Use the returned token credential to authenticate the client: +```python +from azure.identity import DefaultAzureCredential +from azure.ai.textanalytics import TextAnalyticsClient +token_credential = DefaultAzureCredential() - text_analytics_client = TextAnalyticsClient( - endpoint="https://.cognitiveservices.azure.com/", - credential=token_credential - ) - ``` +text_analytics_client = TextAnalyticsClient( + endpoint="https://.cognitiveservices.azure.com/", + credential=token_credential +) +``` ## Key concepts -### Client +### TextAnalyticsClient The Text Analytics client library provides a [TextAnalyticsClient][text_analytics_client] to do analysis on [batches of documents](#Examples "examples"). It provides both synchronous and asynchronous operations to access a specific use of Text Analytics, such as language detection or key phrase extraction. @@ -432,7 +431,7 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [source_code]: azure/ai/textanalytics [TA_pypi]: https://pypi.org/project/azure-ai-textanalytics/ [TA_ref_docs]: https://aka.ms/azsdk-python-textanalytics-ref-docs -[TA_samples]: samples +[TA_samples]: https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/textanalytics/azure-ai-textanalytics/samples [TA_product_documentation]: https://docs.microsoft.com/azure/cognitive-services/text-analytics/overview [azure_subscription]: https://azure.microsoft.com/free/ [TA_or_CS_resource]: https://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account?tabs=multiservice%2Cwindows @@ -485,18 +484,18 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [azure_core]: ../../core/azure-core/README.md [azure_identity]: ../../identity/azure-identity [python_logging]: https://docs.python.org/3.5/library/logging.html -[sample_authentication]: samples/sample_authentication.py -[sample_authentication_async]: samples/async_samples/sample_authentication_async.py -[detect_language_sample]: samples/sample_detect_language.py -[detect_language_sample_async]: samples/async_samples/sample_detect_language_async.py -[analyze_sentiment_sample]: samples/sample_analyze_sentiment.py -[analyze_sentiment_sample_async]: samples/async_samples/sample_analyze_sentiment_async.py -[extract_key_phrases_sample]: samples/sample_extract_key_phrases.py -[extract_key_phrases_sample_async]: samples/async_samples/sample_extract_key_phrases_async.py -[recognize_entities_sample]: samples/sample_recognize_entities.py -[recognize_entities_sample_async]: samples/async_samples/sample_recognize_entities_async.py -[recognize_linked_entities_sample]: samples/sample_recognize_linked_entities.py -[recognize_linked_entities_sample_async]: samples/async_samples/sample_recognize_linked_entities_async.py +[sample_authentication]: https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/textanalytics/azure-ai-textanalytics/samples/sample_authentication.py +[sample_authentication_async]: https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/textanalytics/azure-ai-textanalytics/samples/async_samples/sample_authentication_async.py +[detect_language_sample]: https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/textanalytics/azure-ai-textanalytics/samples/sample_detect_language.py +[detect_language_sample_async]: https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/textanalytics/azure-ai-textanalytics/samples/async_samples/sample_detect_language_async.py +[analyze_sentiment_sample]: https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/textanalytics/azure-ai-textanalytics/samples/sample_analyze_sentiment.py +[analyze_sentiment_sample_async]: https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/textanalytics/azure-ai-textanalytics/samples/async_samples/sample_analyze_sentiment_async.py +[extract_key_phrases_sample]: https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/textanalytics/azure-ai-textanalytics/samples/sample_extract_key_phrases.py +[extract_key_phrases_sample_async]: https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/textanalytics/azure-ai-textanalytics/samples/async_samples/sample_extract_key_phrases_async.py +[recognize_entities_sample]: https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/textanalytics/azure-ai-textanalytics/samples/sample_recognize_entities.py +[recognize_entities_sample_async]: https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/textanalytics/azure-ai-textanalytics/samples/async_samples/sample_recognize_entities_async.py +[recognize_linked_entities_sample]: https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/textanalytics/azure-ai-textanalytics/samples/sample_recognize_linked_entities.py +[recognize_linked_entities_sample_async]: https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/textanalytics/azure-ai-textanalytics/samples/async_samples/sample_recognize_linked_entities_async.py [cla]: https://cla.microsoft.com [code_of_conduct]: https://opensource.microsoft.com/codeofconduct/ diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_policies.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_policies.py index be929257047..3d0fca67ebc 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_policies.py +++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_policies.py @@ -23,8 +23,9 @@ def on_response(self, request, response): statistics = data.get("statistics", None) model_version = data.get("modelVersion", None) - batch_statistics = TextDocumentBatchStatistics._from_generated(statistics) # pylint: disable=protected-access - response.statistics = batch_statistics - response.model_version = model_version - response.raw_response = data - self._response_callback(response) + if statistics or model_version: + batch_statistics = TextDocumentBatchStatistics._from_generated(statistics) # pylint: disable=protected-access + response.statistics = batch_statistics + response.model_version = model_version + response.raw_response = data + self._response_callback(response) diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/aio/_policies_async.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/aio/_policies_async.py index c8ba797a874..f035a52520f 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/aio/_policies_async.py +++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/aio/_policies_async.py @@ -25,11 +25,12 @@ async def on_response(self, request, response): statistics = data.get("statistics", None) model_version = data.get("modelVersion", None) - batch_statistics = TextDocumentBatchStatistics._from_generated(statistics) # pylint: disable=protected-access - response.statistics = batch_statistics - response.model_version = model_version - response.raw_response = data - if asyncio.iscoroutine(self._response_callback): - await self._response_callback(response) - else: - self._response_callback(response) + if statistics or model_version: + batch_statistics = TextDocumentBatchStatistics._from_generated(statistics) # pylint: disable=protected-access + response.statistics = batch_statistics + response.model_version = model_version + response.raw_response = data + if asyncio.iscoroutine(self._response_callback): + await self._response_callback(response) + else: + self._response_callback(response) From 88f88956db9ffdc89aa2c96e88e0e524b70c6531 Mon Sep 17 00:00:00 2001 From: Xiang Yan Date: Thu, 4 Jun 2020 11:31:57 -0700 Subject: [PATCH 05/16] rename AnalyzeText to AnalyzeTextRequest --- .../search/documents/_internal/_search_client.py | 12 ++++++------ .../documents/_internal/aio/_search_client_async.py | 12 ++++++------ .../indexes/_internal/_search_index_client.py | 2 +- .../indexes/_internal/aio/_search_index_client.py | 6 +++--- .../search/documents/indexes/models/__init__.py | 4 ++-- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/sdk/search/azure-search-documents/azure/search/documents/_internal/_search_client.py b/sdk/search/azure-search-documents/azure/search/documents/_internal/_search_client.py index d7a190d4af4..ec52445ba74 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/_internal/_search_client.py +++ b/sdk/search/azure-search-documents/azure/search/documents/_internal/_search_client.py @@ -169,7 +169,7 @@ def search(self, search_text, **kwargs): """ include_total_result_count = kwargs.pop("include_total_result_count", None) facets = kwargs.pop("facets", None) - filter = kwargs.pop("filter", None) + filter_arg = kwargs.pop("filter", None) highlight_fields = kwargs.pop("highlight_fields", None) highlight_post_tag = kwargs.pop("highlight_post_tag", None) highlight_pre_tag = kwargs.pop("highlight_pre_tag", None) @@ -187,7 +187,7 @@ def search(self, search_text, **kwargs): search_text=search_text, include_total_result_count=include_total_result_count, facets=facets, - filter=filter, + filter=filter_arg, highlight_fields=highlight_fields, highlight_post_tag=highlight_post_tag, highlight_pre_tag=highlight_pre_tag, @@ -228,7 +228,7 @@ def suggest(self, search_text, suggester_name, **kwargs): :dedent: 4 :caption: Get search suggestions. """ - filter = kwargs.pop("filter", None) + filter_arg = kwargs.pop("filter", None) use_fuzzy_matching = kwargs.pop("use_fuzzy_matching", None) highlight_post_tag = kwargs.pop("highlight_post_tag", None) highlight_pre_tag = kwargs.pop("highlight_pre_tag", None) @@ -240,7 +240,7 @@ def suggest(self, search_text, suggester_name, **kwargs): query = SuggestQuery( search_text=search_text, suggester_name=suggester_name, - filter=filter, + filter=filter_arg, use_fuzzy_matching=use_fuzzy_matching, highlight_post_tag=highlight_post_tag, highlight_pre_tag=highlight_pre_tag, @@ -278,7 +278,7 @@ def autocomplete(self, search_text, suggester_name, **kwargs): :caption: Get a auto-completions. """ autocomplete_mode = kwargs.pop("autocomplete_mode", None) - filter = kwargs.pop("filter", None) + filter_arg = kwargs.pop("filter", None) use_fuzzy_matching = kwargs.pop("use_fuzzy_matching", None) highlight_post_tag = kwargs.pop("highlight_post_tag", None) highlight_pre_tag = kwargs.pop("highlight_pre_tag", None) @@ -289,7 +289,7 @@ def autocomplete(self, search_text, suggester_name, **kwargs): search_text=search_text, suggester_name=suggester_name, autocomplete_mode=autocomplete_mode, - filter=filter, + filter=filter_arg, use_fuzzy_matching=use_fuzzy_matching, highlight_post_tag=highlight_post_tag, highlight_pre_tag=highlight_pre_tag, diff --git a/sdk/search/azure-search-documents/azure/search/documents/_internal/aio/_search_client_async.py b/sdk/search/azure-search-documents/azure/search/documents/_internal/aio/_search_client_async.py index b07d561a441..60d359d8939 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/_internal/aio/_search_client_async.py +++ b/sdk/search/azure-search-documents/azure/search/documents/_internal/aio/_search_client_async.py @@ -139,7 +139,7 @@ async def search(self, search_text, **kwargs): """ include_total_result_count = kwargs.pop("include_total_result_count", None) facets = kwargs.pop("facets", None) - filter = kwargs.pop("filter", None) + filter_arg = kwargs.pop("filter", None) highlight_fields = kwargs.pop("highlight_fields", None) highlight_post_tag = kwargs.pop("highlight_post_tag", None) highlight_pre_tag = kwargs.pop("highlight_pre_tag", None) @@ -157,7 +157,7 @@ async def search(self, search_text, **kwargs): search_text=search_text, include_total_result_count=include_total_result_count, facets=facets, - filter=filter, + filter=filter_arg, highlight_fields=highlight_fields, highlight_post_tag=highlight_post_tag, highlight_pre_tag=highlight_pre_tag, @@ -198,7 +198,7 @@ async def suggest(self, search_text, suggester_name, **kwargs): :dedent: 4 :caption: Get search suggestions. """ - filter = kwargs.pop("filter", None) + filter_arg = kwargs.pop("filter", None) use_fuzzy_matching = kwargs.pop("use_fuzzy_matching", None) highlight_post_tag = kwargs.pop("highlight_post_tag", None) highlight_pre_tag = kwargs.pop("highlight_pre_tag", None) @@ -210,7 +210,7 @@ async def suggest(self, search_text, suggester_name, **kwargs): query = SuggestQuery( search_text=search_text, suggester_name=suggester_name, - filter=filter, + filter=filter_arg, use_fuzzy_matching=use_fuzzy_matching, highlight_post_tag=highlight_post_tag, highlight_pre_tag=highlight_pre_tag, @@ -248,7 +248,7 @@ async def autocomplete(self, search_text, suggester_name, **kwargs): :caption: Get a auto-completions. """ autocomplete_mode = kwargs.pop("autocomplete_mode", None) - filter = kwargs.pop("filter", None) + filter_arg = kwargs.pop("filter", None) use_fuzzy_matching = kwargs.pop("use_fuzzy_matching", None) highlight_post_tag = kwargs.pop("highlight_post_tag", None) highlight_pre_tag = kwargs.pop("highlight_pre_tag", None) @@ -259,7 +259,7 @@ async def autocomplete(self, search_text, suggester_name, **kwargs): search_text=search_text, suggester_name=suggester_name, autocomplete_mode=autocomplete_mode, - filter=filter, + filter=filter_arg, use_fuzzy_matching=use_fuzzy_matching, highlight_post_tag=highlight_post_tag, highlight_pre_tag=highlight_pre_tag, diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/_search_index_client.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/_search_index_client.py index 176c5778096..807bc8cd966 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/_search_index_client.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/_search_index_client.py @@ -235,7 +235,7 @@ def create_or_update_index( @distributed_trace def analyze_text(self, index_name, analyze_request, **kwargs): - # type: (str, AnalyzeRequest, **Any) -> AnalyzeResult + # type: (str, AnalyzeTextRequest, **Any) -> AnalyzeResult """Shows how an analyzer breaks text into tokens. :param index_name: The name of the index for which to test an analyzer. diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/aio/_search_index_client.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/aio/_search_index_client.py index 6ea84468765..79ab8829200 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/aio/_search_index_client.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/aio/_search_index_client.py @@ -24,7 +24,7 @@ if TYPE_CHECKING: # pylint:disable=unused-import,ungrouped-imports - from .._generated.models import AnalyzeRequest, AnalyzeResult, SearchIndex + from .._generated.models import AnalyzeRequest as AnalyzeTextRequest, AnalyzeResult, SearchIndex from typing import Any, Dict, List, Union from azure.core.credentials import AzureKeyCredential @@ -239,13 +239,13 @@ async def create_or_update_index( @distributed_trace_async async def analyze_text(self, index_name, analyze_request, **kwargs): - # type: (str, AnalyzeRequest, **Any) -> AnalyzeResult + # type: (str, AnalyzeTextRequest, **Any) -> AnalyzeResult """Shows how an analyzer breaks text into tokens. :param index_name: The name of the index for which to test an analyzer. :type index_name: str :param analyze_request: The text and analyzer or analysis components to test. - :type analyze_request: :class:`~azure.search.documents.indexes.models.AnalyzeRequest + :type analyze_request: :class:`~azure.search.documents.indexes.models.AnalyzeTextRequest :return: AnalyzeResult :rtype: :class:`~azure.search.documents.indexes.models.AnalyzeRequest :raises: ~azure.core.exceptions.HttpResponseError diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/models/__init__.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/models/__init__.py index d75447532da..a6760957796 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/models/__init__.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/models/__init__.py @@ -32,7 +32,7 @@ SearchFieldDataType, ) from .._internal._generated.models import ( - AnalyzeRequest, + AnalyzeRequest as AnalyzeTextRequest, AnalyzeResult, AnalyzedTokenInfo, AsciiFoldingTokenFilter, @@ -124,7 +124,7 @@ __all__ = ( - "AnalyzeRequest", + "AnalyzeTextRequest", "AnalyzeResult", "AnalyzedTokenInfo", "AsciiFoldingTokenFilter", From 25a07551cafb73543fdff031053e060d0eb1ee4f Mon Sep 17 00:00:00 2001 From: Xiang Yan Date: Thu, 4 Jun 2020 11:42:32 -0700 Subject: [PATCH 06/16] fixes --- .../tests/async_tests/test_service_live_async.py | 2 +- sdk/search/azure-search-documents/tests/test_service_live.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/search/azure-search-documents/tests/async_tests/test_service_live_async.py b/sdk/search/azure-search-documents/tests/async_tests/test_service_live_async.py index b3d3055fcc1..5e962c746ef 100644 --- a/sdk/search/azure-search-documents/tests/async_tests/test_service_live_async.py +++ b/sdk/search/azure-search-documents/tests/async_tests/test_service_live_async.py @@ -20,7 +20,7 @@ from azure.core.exceptions import HttpResponseError from azure.search.documents.indexes.models import( - AnalyzeRequest, + AnalyzeTextRequest, AnalyzeResult, CorsOptions, EntityRecognitionSkill, diff --git a/sdk/search/azure-search-documents/tests/test_service_live.py b/sdk/search/azure-search-documents/tests/test_service_live.py index dd9599382d2..37a9717999c 100644 --- a/sdk/search/azure-search-documents/tests/test_service_live.py +++ b/sdk/search/azure-search-documents/tests/test_service_live.py @@ -17,7 +17,7 @@ from azure.core.credentials import AzureKeyCredential from azure.core.exceptions import HttpResponseError from azure.search.documents.indexes.models import( - AnalyzeRequest, + AnalyzeTextRequest, AnalyzeResult, CorsOptions, EntityRecognitionSkill, From d4cf25256927a22e518d86f7ce906ee51488d424 Mon Sep 17 00:00:00 2001 From: Xiang Yan Date: Thu, 4 Jun 2020 11:57:01 -0700 Subject: [PATCH 07/16] update --- .../tests/async_tests/test_service_live_async.py | 2 +- sdk/search/azure-search-documents/tests/test_service_live.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/search/azure-search-documents/tests/async_tests/test_service_live_async.py b/sdk/search/azure-search-documents/tests/async_tests/test_service_live_async.py index 5e962c746ef..358e89394ce 100644 --- a/sdk/search/azure-search-documents/tests/async_tests/test_service_live_async.py +++ b/sdk/search/azure-search-documents/tests/async_tests/test_service_live_async.py @@ -260,7 +260,7 @@ async def test_create_or_update_indexes_if_unchanged(self, api_key, endpoint, in @SearchServicePreparer(schema=SCHEMA, index_batch=BATCH) async def test_analyze_text(self, api_key, endpoint, index_name, **kwargs): client = SearchIndexClient(endpoint, AzureKeyCredential(api_key)) - analyze_request = AnalyzeRequest(text="One's ", analyzer="standard.lucene") + analyze_request = AnalyzeTextRequest(text="One's ", analyzer="standard.lucene") result = await client.analyze_text(index_name, analyze_request) assert len(result.tokens) == 2 diff --git a/sdk/search/azure-search-documents/tests/test_service_live.py b/sdk/search/azure-search-documents/tests/test_service_live.py index 37a9717999c..d571ff8c1cd 100644 --- a/sdk/search/azure-search-documents/tests/test_service_live.py +++ b/sdk/search/azure-search-documents/tests/test_service_live.py @@ -242,7 +242,7 @@ def test_create_or_update_indexes_if_unchanged(self, api_key, endpoint, index_na @SearchServicePreparer(schema=SCHEMA, index_batch=BATCH) def test_analyze_text(self, api_key, endpoint, index_name, **kwargs): client = SearchIndexClient(endpoint, AzureKeyCredential(api_key)) - analyze_request = AnalyzeRequest(text="One's ", analyzer="standard.lucene") + analyze_request = AnalyzeTextRequest(text="One's ", analyzer="standard.lucene") result = client.analyze_text(index_name, analyze_request) assert len(result.tokens) == 2 From 62129641c3037208af9ee5a1cf79478719ac5b0b Mon Sep 17 00:00:00 2001 From: Xiang Yan Date: Thu, 4 Jun 2020 13:08:09 -0700 Subject: [PATCH 08/16] update changelog --- sdk/search/azure-search-documents/CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sdk/search/azure-search-documents/CHANGELOG.md b/sdk/search/azure-search-documents/CHANGELOG.md index 317ffb4b0d0..b7365773e30 100644 --- a/sdk/search/azure-search-documents/CHANGELOG.md +++ b/sdk/search/azure-search-documents/CHANGELOG.md @@ -24,7 +24,8 @@ PathHierarchyTokenizerV2 -> PathHierarchyTokenizer - Renamed DataSource methods to DataSourceConnection #11693 - Autocomplete & suggest methods now takes arguments search_text & suggester_name rather than query objects #11747 -- Create_or_updates methods does not support partial updates +- Create_or_updates methods does not support partial updates #11800 +- Renamed AnalyzeRequest to AnalyzeTextRequest #11800 ## 1.0.0b3 (2020-05-04) From af02a00266e008d3ae9df5ccdbe25f00b27ad19d Mon Sep 17 00:00:00 2001 From: Xiang Yan Date: Thu, 4 Jun 2020 13:25:51 -0700 Subject: [PATCH 09/16] update --- .../indexes/_internal/_search_index_client.py | 14 ++++++++++++++ .../indexes/_internal/aio/_search_index_client.py | 14 ++++++++++++++ .../tests/test_index_live.py | 1 - 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/_search_index_client.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/_search_index_client.py index 807bc8cd966..b53997802d7 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/_search_index_client.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/_search_index_client.py @@ -84,6 +84,20 @@ def list_indexes(self, **kwargs): return self._client.indexes.list(cls=lambda objs: [unpack_search_index(x) for x in objs], **kwargs) + @distributed_trace + def list_index_names(self, **kwargs): + # type: (**Any) -> ItemPaged[str] + """List the index names in an Azure Search service. + + :return: List of index names + :rtype: list[str] + :raises: ~azure.core.exceptions.HttpResponseError + + """ + kwargs["headers"] = self._merge_client_headers(kwargs.get("headers")) + + return self._client.indexes.list(cls=lambda objs: [x.name for x in objs], **kwargs) + @distributed_trace def get_index(self, name, **kwargs): # type: (str, **Any) -> SearchIndex diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/aio/_search_index_client.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/aio/_search_index_client.py index 79ab8829200..6d16bc90acc 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/aio/_search_index_client.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/aio/_search_index_client.py @@ -88,6 +88,20 @@ def list_indexes(self, **kwargs): return self._client.indexes.list(cls=lambda objs: [unpack_search_index(x) for x in objs], **kwargs) + @distributed_trace + def list_index_names(self, **kwargs): + # type: (**Any) -> AsyncItemPaged[str] + """List the index names in an Azure Search service. + + :return: List of index names + :rtype: list[str] + :raises: ~azure.core.exceptions.HttpResponseError + + """ + kwargs["headers"] = self._merge_client_headers(kwargs.get("headers")) + + return self._client.indexes.list(cls=lambda objs: [x.name for x in objs], **kwargs) + @distributed_trace_async async def get_index(self, name, **kwargs): # type: (str, **Any) -> SearchIndex diff --git a/sdk/search/azure-search-documents/tests/test_index_live.py b/sdk/search/azure-search-documents/tests/test_index_live.py index b59fa5782c2..4401009e473 100644 --- a/sdk/search/azure-search-documents/tests/test_index_live.py +++ b/sdk/search/azure-search-documents/tests/test_index_live.py @@ -105,7 +105,6 @@ def test_get_search_counts(self, api_key, endpoint, index_name, **kwargs): assert results.get_count() is None results = client.search(search_text="hotel", include_total_result_count=True) - temp = list(results) assert results.get_count() == 7 @ResourceGroupPreparer(random_name_enabled=True) From 0c3f697409f935a6c9f82745f7b3cc05d9a3b23a Mon Sep 17 00:00:00 2001 From: Xiang Yan Date: Thu, 4 Jun 2020 13:45:57 -0700 Subject: [PATCH 10/16] add types --- .../documents/indexes/_internal/_index.py | 4 +-- .../documents/indexes/models/__init__.py | 32 ++++++++++++++++++- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/_index.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/_index.py index 7d555ab22d2..8d2ac52f9c5 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/_index.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/_index.py @@ -465,13 +465,13 @@ class SearchIndex(msrest.serialization.Model): 'scoring_profiles': {'key': 'scoringProfiles', 'type': '[ScoringProfile]'}, 'default_scoring_profile': {'key': 'defaultScoringProfile', 'type': 'str'}, 'cors_options': {'key': 'corsOptions', 'type': 'CorsOptions'}, - 'suggesters': {'key': 'suggesters', 'type': '[Suggester]'}, + 'suggesters': {'key': 'suggesters', 'type': '[SearchSuggester]'}, 'analyzers': {'key': 'analyzers', 'type': '[LexicalAnalyzer]'}, 'tokenizers': {'key': 'tokenizers', 'type': '[LexicalTokenizer]'}, 'token_filters': {'key': 'tokenFilters', 'type': '[TokenFilter]'}, 'char_filters': {'key': 'charFilters', 'type': '[CharFilter]'}, 'encryption_key': {'key': 'encryptionKey', 'type': 'SearchResourceEncryptionKey'}, - 'similarity': {'key': 'similarity', 'type': 'Similarity'}, + 'similarity': {'key': 'similarity', 'type': 'SimilarityAlgorithm'}, 'e_tag': {'key': '@odata\\.etag', 'type': 'str'}, } diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/models/__init__.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/models/__init__.py index a6760957796..f780722d19e 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/models/__init__.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/models/__init__.py @@ -31,6 +31,7 @@ SimpleField, SearchFieldDataType, ) +from ..._internal._generated.models import SuggestOptions from .._internal._generated.models import ( AnalyzeRequest as AnalyzeTextRequest, AnalyzeResult, @@ -60,7 +61,7 @@ KeepTokenFilter, KeyPhraseExtractionSkill, KeywordMarkerTokenFilter, - KeywordTokenizer, + KeywordTokenizerV2 as KeywordTokenizer, LanguageDetectionSkill, LengthTokenFilter, LexicalAnalyzer, @@ -87,31 +88,45 @@ SearchIndex, SearchIndexer, SearchIndexerDataContainer, + SearchIndexerError, + SearchIndexerLimits, SearchIndexerSkillset, SearchIndexerStatus, ScoringFunction, ScoringProfile, SentimentSkill, + SentimentSkillLanguage, ShaperSkill, ShingleTokenFilter, Similarity as SimilarityAlgorithm, SnowballTokenFilter, + SnowballTokenFilterLanguage, + SoftDeleteColumnDeletionDetectionPolicy, SplitSkill, + SplitSkillLanguage, + SqlIntegratedChangeTrackingPolicy, StemmerOverrideTokenFilter, StemmerTokenFilter, + StemmerTokenFilterLanguage, StopAnalyzer, + StopwordsList, StopwordsTokenFilter, Suggester as SearchSuggester, SynonymTokenFilter, TagScoringFunction, TagScoringParameters, + TextSplitMode, TextTranslationSkill, + TextTranslationSkillLanguage, TextWeights, + TokenCharacterKind, TokenFilter, + TokenFilterName, TruncateTokenFilter, UaxUrlEmailTokenizer, UniqueTokenFilter, WebApiSkill, + VisualFeature, WordDelimiterTokenFilter, ) from .._internal._models import ( @@ -186,32 +201,47 @@ "SearchIndexer", "SearchIndexerDataContainer", "SearchIndexerDataSourceConnection", + "SearchIndexerError", + "SearchIndexerLimits", "SearchIndexerSkillset", "SearchIndexerStatus", "SearchResourceEncryptionKey", "SearchableField", "SentimentSkill", + "SentimentSkillLanguage", "ShaperSkill", "ShingleTokenFilter", "SimpleField", "SimilarityAlgorithm", "SnowballTokenFilter", + "SnowballTokenFilterLanguage", + "SoftDeleteColumnDeletionDetectionPolicy", "SplitSkill", + "SplitSkillLanguage", + "SqlIntegratedChangeTrackingPolicy", "StemmerOverrideTokenFilter", "StemmerTokenFilter", + "StemmerTokenFilterLanguage", "StopAnalyzer", + "StopwordsList", "StopwordsTokenFilter", "SearchSuggester", + "SuggestOptions", "SynonymMap", "SynonymTokenFilter", "TagScoringFunction", "TagScoringParameters", + "TextSplitMode", "TextTranslationSkill", + "TextTranslationSkillLanguage", "TextWeights", + "TokenCharacterKind", "TokenFilter", + "TokenFilterName", "TruncateTokenFilter", "UaxUrlEmailTokenizer", "UniqueTokenFilter", + "VisualFeature", "WebApiSkill", "WordDelimiterTokenFilter", "SearchFieldDataType", From 637658713e819ab2e07ab4aa4630074989dca903 Mon Sep 17 00:00:00 2001 From: Xiang Yan Date: Thu, 4 Jun 2020 14:33:38 -0700 Subject: [PATCH 11/16] update --- sdk/search/azure-search-documents/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/search/azure-search-documents/CHANGELOG.md b/sdk/search/azure-search-documents/CHANGELOG.md index b7365773e30..78396424d37 100644 --- a/sdk/search/azure-search-documents/CHANGELOG.md +++ b/sdk/search/azure-search-documents/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 1.0.0b4 (Unreleased) +## 1.0.0b4 (2020-06-09) **Breaking Changes** From a3f66a84c479b86da63b4123ce376a5f6849719f Mon Sep 17 00:00:00 2001 From: Xiang Yan Date: Thu, 4 Jun 2020 16:44:20 -0700 Subject: [PATCH 12/16] rename batch methods --- sdk/search/azure-search-documents/CHANGELOG.md | 1 + .../search/documents/_internal/_index_documents_batch.py | 8 ++++---- .../azure/search/documents/_internal/_search_client.py | 8 ++++---- .../documents/_internal/aio/_search_client_async.py | 8 ++++---- .../tests/test_index_documents_batch.py | 8 ++++---- .../tests/test_search_index_client.py | 8 ++++---- 6 files changed, 21 insertions(+), 20 deletions(-) diff --git a/sdk/search/azure-search-documents/CHANGELOG.md b/sdk/search/azure-search-documents/CHANGELOG.md index 78396424d37..50432c4397c 100644 --- a/sdk/search/azure-search-documents/CHANGELOG.md +++ b/sdk/search/azure-search-documents/CHANGELOG.md @@ -26,6 +26,7 @@ - Autocomplete & suggest methods now takes arguments search_text & suggester_name rather than query objects #11747 - Create_or_updates methods does not support partial updates #11800 - Renamed AnalyzeRequest to AnalyzeTextRequest #11800 +- Renamed Batch methods #11800 ## 1.0.0b3 (2020-05-04) diff --git a/sdk/search/azure-search-documents/azure/search/documents/_internal/_index_documents_batch.py b/sdk/search/azure-search-documents/azure/search/documents/_internal/_index_documents_batch.py index fd02a58e4b2..dd267efc6af 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/_internal/_index_documents_batch.py +++ b/sdk/search/azure-search-documents/azure/search/documents/_internal/_index_documents_batch.py @@ -36,7 +36,7 @@ def __repr__(self): # type: () -> str return "".format(len(self.actions))[:1024] - def add_upload_documents(self, *documents): + def add_upload_actions(self, *documents): # type (Union[List[dict], List[List[dict]]]) -> None """Add documents to upload to the Azure search index. @@ -50,7 +50,7 @@ def add_upload_documents(self, *documents): """ self._extend_batch(flatten_args(documents), "upload") - def add_delete_documents(self, *documents): + def add_delete_actions(self, *documents): # type (Union[List[dict], List[List[dict]]]) -> None """Add documents to delete to the Azure search index. @@ -69,7 +69,7 @@ def add_delete_documents(self, *documents): """ self._extend_batch(flatten_args(documents), "delete") - def add_merge_documents(self, *documents): + def add_merge_actions(self, *documents): # type (Union[List[dict], List[List[dict]]]) -> None """Add documents to merge in to existing documets in the Azure search index. @@ -85,7 +85,7 @@ def add_merge_documents(self, *documents): """ self._extend_batch(flatten_args(documents), "merge") - def add_merge_or_upload_documents(self, *documents): + def add_merge_or_upload_actions(self, *documents): # type (Union[List[dict], List[List[dict]]]) -> None """Add documents to merge in to existing documets in the Azure search index, or upload if they do not yet exist. diff --git a/sdk/search/azure-search-documents/azure/search/documents/_internal/_search_client.py b/sdk/search/azure-search-documents/azure/search/documents/_internal/_search_client.py index ec52445ba74..45694e8b6d0 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/_internal/_search_client.py +++ b/sdk/search/azure-search-documents/azure/search/documents/_internal/_search_client.py @@ -327,7 +327,7 @@ def upload_documents(self, documents, **kwargs): :caption: Upload new documents to an index """ batch = IndexDocumentsBatch() - batch.add_upload_documents(documents) + batch.add_upload_actions(documents) kwargs["headers"] = self._merge_client_headers(kwargs.get("headers")) results = self.index_documents(batch, **kwargs) @@ -360,7 +360,7 @@ def delete_documents(self, documents, **kwargs): :caption: Delete existing documents to an index """ batch = IndexDocumentsBatch() - batch.add_delete_documents(documents) + batch.add_delete_actions(documents) kwargs["headers"] = self._merge_client_headers(kwargs.get("headers")) results = self.index_documents(batch, **kwargs) @@ -389,7 +389,7 @@ def merge_documents(self, documents, **kwargs): :caption: Merge fields into existing documents to an index """ batch = IndexDocumentsBatch() - batch.add_merge_documents(documents) + batch.add_merge_actions(documents) kwargs["headers"] = self._merge_client_headers(kwargs.get("headers")) results = self.index_documents(batch, **kwargs) @@ -409,7 +409,7 @@ def merge_or_upload_documents(self, documents, **kwargs): :rtype: List[IndexingResult] """ batch = IndexDocumentsBatch() - batch.add_merge_or_upload_documents(documents) + batch.add_merge_or_upload_actions(documents) kwargs["headers"] = self._merge_client_headers(kwargs.get("headers")) results = self.index_documents(batch, **kwargs) diff --git a/sdk/search/azure-search-documents/azure/search/documents/_internal/aio/_search_client_async.py b/sdk/search/azure-search-documents/azure/search/documents/_internal/aio/_search_client_async.py index 60d359d8939..7a2ed34e240 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/_internal/aio/_search_client_async.py +++ b/sdk/search/azure-search-documents/azure/search/documents/_internal/aio/_search_client_async.py @@ -297,7 +297,7 @@ async def upload_documents(self, documents, **kwargs): :caption: Upload new documents to an index """ batch = IndexDocumentsBatch() - batch.add_upload_documents(documents) + batch.add_upload_actions(documents) kwargs["headers"] = self._merge_client_headers(kwargs.get("headers")) results = await self.index_documents(batch, **kwargs) @@ -330,7 +330,7 @@ async def delete_documents(self, documents, **kwargs): :caption: Delete existing documents to an index """ batch = IndexDocumentsBatch() - batch.add_delete_documents(documents) + batch.add_delete_actions(documents) kwargs["headers"] = self._merge_client_headers(kwargs.get("headers")) results = await self.index_documents(batch, **kwargs) @@ -359,7 +359,7 @@ async def merge_documents(self, documents, **kwargs): :caption: Merge fields into existing documents to an index """ batch = IndexDocumentsBatch() - batch.add_merge_documents(documents) + batch.add_merge_actions(documents) kwargs["headers"] = self._merge_client_headers(kwargs.get("headers")) results = await self.index_documents(batch, **kwargs) @@ -379,7 +379,7 @@ async def merge_or_upload_documents(self, documents, **kwargs): :rtype: List[IndexingResult] """ batch = IndexDocumentsBatch() - batch.add_merge_or_upload_documents(documents) + batch.add_merge_or_upload_actions(documents) kwargs["headers"] = self._merge_client_headers(kwargs.get("headers")) results = await self.index_documents(batch, **kwargs) diff --git a/sdk/search/azure-search-documents/tests/test_index_documents_batch.py b/sdk/search/azure-search-documents/tests/test_index_documents_batch.py index 9fd058fe842..7aa45a76529 100644 --- a/sdk/search/azure-search-documents/tests/test_index_documents_batch.py +++ b/sdk/search/azure-search-documents/tests/test_index_documents_batch.py @@ -10,10 +10,10 @@ from azure.search.documents import IndexDocumentsBatch METHOD_NAMES = [ - "add_upload_documents", - "add_delete_documents", - "add_merge_documents", - "add_merge_or_upload_documents", + "add_upload_actions", + "add_delete_actions", + "add_merge_actions", + "add_merge_or_upload_actions", ] METHOD_MAP = dict(zip(METHOD_NAMES, ["upload", "delete", "merge", "mergeOrUpload"])) diff --git a/sdk/search/azure-search-documents/tests/test_search_index_client.py b/sdk/search/azure-search-documents/tests/test_search_index_client.py index f4cc4b5ca9c..db4c5031b6f 100644 --- a/sdk/search/azure-search-documents/tests/test_search_index_client.py +++ b/sdk/search/azure-search-documents/tests/test_search_index_client.py @@ -238,10 +238,10 @@ def test_index_documents(self, mock_index): client = SearchClient("endpoint", "index name", CREDENTIAL) batch = IndexDocumentsBatch() - batch.add_upload_documents("upload1") - batch.add_delete_documents("delete1", "delete2") - batch.add_merge_documents(["merge1", "merge2", "merge3"]) - batch.add_merge_or_upload_documents("merge_or_upload1") + batch.add_upload_actions("upload1") + batch.add_delete_actions("delete1", "delete2") + batch.add_merge_actions(["merge1", "merge2", "merge3"]) + batch.add_merge_or_upload_actions("merge_or_upload1") client.index_documents(batch, extra="foo") assert mock_index.called From 42e60ec45e6af137a7c7f0b03289729fb770b2a8 Mon Sep 17 00:00:00 2001 From: Xiang Yan Date: Thu, 4 Jun 2020 17:33:47 -0700 Subject: [PATCH 13/16] update --- .../azure-search-documents/CHANGELOG.md | 2 +- .../documents/indexes/_internal/_models.py | 134 +++++++++++++++++- .../indexes/_internal/_search_index_client.py | 7 +- .../documents/indexes/_internal/_utils.py | 64 +++++++-- .../_internal/aio/_search_index_client.py | 21 +-- .../_internal/aio/_search_indexer_client.py | 4 +- .../documents/indexes/models/__init__.py | 6 +- .../async_tests/test_service_live_async.py | 4 +- .../tests/test_service_live.py | 4 +- 9 files changed, 209 insertions(+), 37 deletions(-) diff --git a/sdk/search/azure-search-documents/CHANGELOG.md b/sdk/search/azure-search-documents/CHANGELOG.md index 50432c4397c..c98afa0f794 100644 --- a/sdk/search/azure-search-documents/CHANGELOG.md +++ b/sdk/search/azure-search-documents/CHANGELOG.md @@ -25,7 +25,7 @@ - Renamed DataSource methods to DataSourceConnection #11693 - Autocomplete & suggest methods now takes arguments search_text & suggester_name rather than query objects #11747 - Create_or_updates methods does not support partial updates #11800 -- Renamed AnalyzeRequest to AnalyzeTextRequest #11800 +- Renamed AnalyzeRequest to AnalyzeTextOptions #11800 - Renamed Batch methods #11800 diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/_models.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/_models.py index 8bc71209d88..9df7969fb92 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/_models.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/_models.py @@ -4,7 +4,139 @@ # license information. # -------------------------------------------------------------------------- import msrest.serialization -from ._generated.models import LexicalAnalyzer, LexicalTokenizer +from ._generated.models import ( + LexicalAnalyzer, + LexicalTokenizer, + AnalyzeRequest, + CustomAnalyzer as _CustomAnalyzer, +) + + +class AnalyzeTextOptions(msrest.serialization.Model): + """Specifies some text and analysis components used to break that text into tokens. + + All required parameters must be populated in order to send to Azure. + + :param text: Required. The text to break into tokens. + :type text: str + :param analyzer_name: The name of the analyzer to use to break the given text. If this parameter is + not specified, you must specify a tokenizer instead. The tokenizer and analyzer parameters are + mutually exclusive. Possible values include: "ar.microsoft", "ar.lucene", "hy.lucene", + "bn.microsoft", "eu.lucene", "bg.microsoft", "bg.lucene", "ca.microsoft", "ca.lucene", "zh- + Hans.microsoft", "zh-Hans.lucene", "zh-Hant.microsoft", "zh-Hant.lucene", "hr.microsoft", + "cs.microsoft", "cs.lucene", "da.microsoft", "da.lucene", "nl.microsoft", "nl.lucene", + "en.microsoft", "en.lucene", "et.microsoft", "fi.microsoft", "fi.lucene", "fr.microsoft", + "fr.lucene", "gl.lucene", "de.microsoft", "de.lucene", "el.microsoft", "el.lucene", + "gu.microsoft", "he.microsoft", "hi.microsoft", "hi.lucene", "hu.microsoft", "hu.lucene", + "is.microsoft", "id.microsoft", "id.lucene", "ga.lucene", "it.microsoft", "it.lucene", + "ja.microsoft", "ja.lucene", "kn.microsoft", "ko.microsoft", "ko.lucene", "lv.microsoft", + "lv.lucene", "lt.microsoft", "ml.microsoft", "ms.microsoft", "mr.microsoft", "nb.microsoft", + "no.lucene", "fa.lucene", "pl.microsoft", "pl.lucene", "pt-BR.microsoft", "pt-BR.lucene", "pt- + PT.microsoft", "pt-PT.lucene", "pa.microsoft", "ro.microsoft", "ro.lucene", "ru.microsoft", + "ru.lucene", "sr-cyrillic.microsoft", "sr-latin.microsoft", "sk.microsoft", "sl.microsoft", + "es.microsoft", "es.lucene", "sv.microsoft", "sv.lucene", "ta.microsoft", "te.microsoft", + "th.microsoft", "th.lucene", "tr.microsoft", "tr.lucene", "uk.microsoft", "ur.microsoft", + "vi.microsoft", "standard.lucene", "standardasciifolding.lucene", "keyword", "pattern", + "simple", "stop", "whitespace". + :type analyzer_name: str or ~azure.search.documents.indexes.models.LexicalAnalyzerName + :param tokenizer_name: The name of the tokenizer to use to break the given text. If this parameter + is not specified, you must specify an analyzer instead. The tokenizer and analyzer parameters + are mutually exclusive. Possible values include: "classic", "edgeNGram", "keyword_v2", + "letter", "lowercase", "microsoft_language_tokenizer", "microsoft_language_stemming_tokenizer", + "nGram", "path_hierarchy_v2", "pattern", "standard_v2", "uax_url_email", "whitespace". + :type tokenizer_name: str or ~azure.search.documents.indexes.models.LexicalTokenizerName + :param token_filters: An optional list of token filters to use when breaking the given text. + This parameter can only be set when using the tokenizer parameter. + :type token_filters: list[str or ~azure.search.documents.indexes.models.TokenFilterName] + :param char_filters: An optional list of character filters to use when breaking the given text. + This parameter can only be set when using the tokenizer parameter. + :type char_filters: list[str] + """ + + _validation = { + 'text': {'required': True}, + } + + _attribute_map = { + 'text': {'key': 'text', 'type': 'str'}, + 'analyzer_name': {'key': 'analyzerName', 'type': 'str'}, + 'tokenizer_name': {'key': 'tokenizerName', 'type': 'str'}, + 'token_filters': {'key': 'tokenFilters', 'type': '[str]'}, + 'char_filters': {'key': 'charFilters', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(AnalyzeTextOptions, self).__init__(**kwargs) + self.text = kwargs['text'] + self.analyzer_name = kwargs.get('analyzer_name', None) + self.tokenizer_name = kwargs.get('tokenizer_name', None) + self.token_filters = kwargs.get('token_filters', None) + self.char_filters = kwargs.get('char_filters', None) + + def to_analyze_request(self): + return AnalyzeRequest( + text=self.text, + analyzer=self.analyzer_name, + tokenizer=self.tokenizer_name, + token_filters=self.token_filters, + char_filters=self.char_filters + ) + + +class CustomAnalyzer(LexicalAnalyzer): + """Allows you to take control over the process of converting text into indexable/searchable tokens. It's a user-defined configuration consisting of a single predefined tokenizer and one or more filters. The tokenizer is responsible for breaking text into tokens, and the filters for modifying tokens emitted by the tokenizer. + + All required parameters must be populated in order to send to Azure. + + :param odata_type: Required. Identifies the concrete type of the analyzer.Constant filled by + server. + :type odata_type: str + :param name: Required. The name of the analyzer. It must only contain letters, digits, spaces, + dashes or underscores, can only start and end with alphanumeric characters, and is limited to + 128 characters. + :type name: str + :param tokenizer_name: Required. The name of the tokenizer to use to divide continuous text into a + sequence of tokens, such as breaking a sentence into words. Possible values include: "classic", + "edgeNGram", "keyword_v2", "letter", "lowercase", "microsoft_language_tokenizer", + "microsoft_language_stemming_tokenizer", "nGram", "path_hierarchy_v2", "pattern", + "standard_v2", "uax_url_email", "whitespace". + :type tokenizer_name: str or ~azure.search.documents.indexes.models.LexicalTokenizerName + :param token_filters: A list of token filters used to filter out or modify the tokens generated + by a tokenizer. For example, you can specify a lowercase filter that converts all characters to + lowercase. The filters are run in the order in which they are listed. + :type token_filters: list[str or ~azure.search.documents.indexes.models.TokenFilterName] + :param char_filters: A list of character filters used to prepare input text before it is + processed by the tokenizer. For instance, they can replace certain characters or symbols. The + filters are run in the order in which they are listed. + :type char_filters: list[str] + """ + + _validation = { + 'odata_type': {'required': True}, + 'name': {'required': True}, + 'tokenizer': {'required': True}, + } + + _attribute_map = { + 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tokenizer_name': {'key': 'tokenizerName', 'type': 'str'}, + 'token_filters': {'key': 'tokenFilters', 'type': '[str]'}, + 'char_filters': {'key': 'charFilters', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(CustomAnalyzer, self).__init__(**kwargs) + self.odata_type = '#Microsoft.Azure.Search.CustomAnalyzer' + self.tokenizer_name = kwargs['tokenizer_name'] + self.token_filters = kwargs.get('token_filters', None) + self.char_filters = kwargs.get('char_filters', None) class PatternAnalyzer(LexicalAnalyzer): diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/_search_index_client.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/_search_index_client.py index b53997802d7..bb6c2cc46c2 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/_search_index_client.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/_search_index_client.py @@ -24,6 +24,7 @@ if TYPE_CHECKING: # pylint:disable=unused-import,ungrouped-imports + from ._models import AnalyzeTextOptions from typing import Any, Dict, List, Sequence, Union, Optional from azure.core.credentials import AzureKeyCredential @@ -249,13 +250,13 @@ def create_or_update_index( @distributed_trace def analyze_text(self, index_name, analyze_request, **kwargs): - # type: (str, AnalyzeTextRequest, **Any) -> AnalyzeResult + # type: (str, AnalyzeTextOptions, **Any) -> AnalyzeResult """Shows how an analyzer breaks text into tokens. :param index_name: The name of the index for which to test an analyzer. :type index_name: str :param analyze_request: The text and analyzer or analysis components to test. - :type analyze_request: ~azure.search.documents.AnalyzeRequest + :type analyze_request: ~azure.search.documents.indexes.models.AnalyzeTextOptions :return: AnalyzeResult :rtype: ~azure.search.documents.indexes.models.AnalyzeResult :raises: ~azure.core.exceptions.HttpResponseError @@ -271,7 +272,7 @@ def analyze_text(self, index_name, analyze_request, **kwargs): """ kwargs["headers"] = self._merge_client_headers(kwargs.get("headers")) result = self._client.indexes.analyze( - index_name=index_name, request=analyze_request, **kwargs + index_name=index_name, request=analyze_request.to_analyze_request(), **kwargs ) return result diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/_utils.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/_utils.py index 8e7021b8c91..98acd82634c 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/_utils.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/_utils.py @@ -15,6 +15,7 @@ ) from ._generated.models import ( AzureActiveDirectoryApplicationCredentials, + CustomAnalyzer as _CustomAnalyzer, DataSourceCredentials, SearchIndexerDataSource as _SearchIndexerDataSource, SearchResourceEncryptionKey as _SearchResourceEncryptionKey, @@ -25,6 +26,7 @@ PatternTokenizer as _PatternTokenizer, ) from ._models import ( + CustomAnalyzer, PatternAnalyzer, PatternTokenizer, SynonymMap, @@ -73,7 +75,27 @@ def prep_if_none_match(etag, match_condition): return None -def delistize_flags_for_pattern_analyzer(pattern_analyzer): +def pack_custom_analyzer(custom_analyzer): + # type: (CustomAnalyzer) -> _CustomAnalyzer + return _CustomAnalyzer( + odata_type=custom_analyzer.odata_type, + tokenizer=custom_analyzer.tokenizer_name, + token_filters=custom_analyzer.token_filters, + char_filters=custom_analyzer.char_filters + ) + + +def unpack_custom_analyzer(custom_analyzer): + # type: (_CustomAnalyzer) -> CustomAnalyzer + return _CustomAnalyzer( + odata_type=custom_analyzer.odata_type, + tokenizer_name=custom_analyzer.tokenizer, + token_filters=custom_analyzer.token_filters, + char_filters=custom_analyzer.char_filters + ) + + +def pack_pattern_analyzer(pattern_analyzer): # type: (PatternAnalyzer) -> _PatternAnalyzer if not pattern_analyzer.flags: flags = None @@ -88,8 +110,8 @@ def delistize_flags_for_pattern_analyzer(pattern_analyzer): ) -def listize_flags_for_pattern_analyzer(pattern_analyzer): - # type: (PatternAnalyzer) -> PatternAnalyzer +def unpack_pattern_analyzer(pattern_analyzer): + # type: (_PatternAnalyzer) -> PatternAnalyzer if not pattern_analyzer.flags: flags = None else: @@ -103,7 +125,27 @@ def listize_flags_for_pattern_analyzer(pattern_analyzer): ) -def delistize_flags_for_pattern_tokenizer(pattern_tokenizer): +def pack_analyzer(analyzer): + if not analyzer: + return None + if isinstance(analyzer, PatternAnalyzer): + return pack_pattern_analyzer(analyzer) + if isinstance(analyzer, CustomAnalyzer): + return pack_custom_analyzer(analyzer) + return analyzer + + +def unpack_analyzer(analyzer): + if not analyzer: + return None + if isinstance(analyzer, _PatternAnalyzer): + return unpack_pattern_analyzer(analyzer) + if isinstance(analyzer, _CustomAnalyzer): + return unpack_custom_analyzer(analyzer) + return analyzer + + +def pack_pattern_tokenizer(pattern_tokenizer): # type: (PatternTokenizer) -> _PatternTokenizer if not pattern_tokenizer.flags: flags = None @@ -117,7 +159,7 @@ def delistize_flags_for_pattern_tokenizer(pattern_tokenizer): ) -def listize_flags_for_pattern_tokenizer(pattern_tokenizer): +def unpack_pattern_tokenizer(pattern_tokenizer): # type: (PatternTokenizer) -> PatternTokenizer if not pattern_tokenizer.flags: flags = None @@ -137,16 +179,14 @@ def pack_search_index(search_index): return None if search_index.analyzers: analyzers = [ - delistize_flags_for_pattern_analyzer(x) # type: ignore - if isinstance(x, PatternAnalyzer) - else x + pack_analyzer(x) # type: ignore for x in search_index.analyzers ] # mypy: ignore else: analyzers = None if search_index.tokenizers: tokenizers = [ - delistize_flags_for_pattern_tokenizer(x) # type: ignore + pack_pattern_tokenizer(x) # type: ignore if isinstance(x, PatternTokenizer) else x for x in search_index.tokenizers @@ -180,16 +220,14 @@ def unpack_search_index(search_index): return None if search_index.analyzers: analyzers = [ - listize_flags_for_pattern_analyzer(x) # type: ignore - if isinstance(x, _PatternAnalyzer) - else x + unpack_analyzer(x) # type: ignore for x in search_index.analyzers ] else: analyzers = None if search_index.tokenizers: tokenizers = [ - listize_flags_for_pattern_tokenizer(x) # type: ignore + unpack_pattern_tokenizer(x) # type: ignore if isinstance(x, _PatternTokenizer) else x for x in search_index.tokenizers diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/aio/_search_index_client.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/aio/_search_index_client.py index 6d16bc90acc..49bcaace91e 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/aio/_search_index_client.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/aio/_search_index_client.py @@ -24,7 +24,8 @@ if TYPE_CHECKING: # pylint:disable=unused-import,ungrouped-imports - from .._generated.models import AnalyzeRequest as AnalyzeTextRequest, AnalyzeResult, SearchIndex + from .._generated.models import AnalyzeResult, SearchIndex + from .._models import AnalyzeTextOptions from typing import Any, Dict, List, Union from azure.core.credentials import AzureKeyCredential @@ -253,15 +254,15 @@ async def create_or_update_index( @distributed_trace_async async def analyze_text(self, index_name, analyze_request, **kwargs): - # type: (str, AnalyzeTextRequest, **Any) -> AnalyzeResult + # type: (str, AnalyzeTextOptions, **Any) -> AnalyzeResult """Shows how an analyzer breaks text into tokens. :param index_name: The name of the index for which to test an analyzer. :type index_name: str :param analyze_request: The text and analyzer or analysis components to test. - :type analyze_request: :class:`~azure.search.documents.indexes.models.AnalyzeTextRequest + :type analyze_request: ~azure.search.documents.indexes.models.AnalyzeTextOptions :return: AnalyzeResult - :rtype: :class:`~azure.search.documents.indexes.models.AnalyzeRequest + :rtype: ~azure.search.documents.indexes.models.AnalyzeRequest :raises: ~azure.core.exceptions.HttpResponseError .. admonition:: Example: @@ -275,7 +276,7 @@ async def analyze_text(self, index_name, analyze_request, **kwargs): """ kwargs["headers"] = self._merge_client_headers(kwargs.get("headers")) result = await self._client.indexes.analyze( - index_name=index_name, request=analyze_request, **kwargs + index_name=index_name, request=analyze_request.to_analyze_request(), **kwargs ) return result @@ -324,7 +325,7 @@ async def get_synonym_map(self, name, **kwargs): :param name: The name of the Synonym Map to get :type name: str :return: The retrieved Synonym Map - :rtype: :class:`~azure.search.documents.indexes.models.SynonymMap + :rtype: :class:`~azure.search.documents.indexes.models.SynonymMap` :raises: :class:`~azure.core.exceptions.ResourceNotFoundError` .. admonition:: Example: @@ -385,9 +386,9 @@ async def create_synonym_map(self, synonym_map, **kwargs): """Create a new Synonym Map in an Azure Search service :param synonym_map: The Synonym Map object - :type synonym_map: :class:`~azure.search.documents.indexes.models.SynonymMap + :type synonym_map: :class:`~azure.search.documents.indexes.models.SynonymMap` :return: The created Synonym Map - :rtype: :class:`~azure.search.documents.indexes.models.SynonymMap + :rtype: :class:`~azure.search.documents.indexes.models.SynonymMap` .. admonition:: Example: @@ -411,11 +412,11 @@ async def create_or_update_synonym_map(self, synonym_map, **kwargs): existing one. :param synonym_map: The Synonym Map object - :type synonym_map: :class:`~azure.search.documents.indexes.models.SynonymMap + :type synonym_map: :class:`~azure.search.documents.indexes.models.SynonymMap` :keyword match_condition: The match condition to use upon the etag :type match_condition: ~azure.core.MatchConditions :return: The created or updated Synonym Map - :rtype: :class:`~azure.search.documents.indexes.models.SynonymMap + :rtype: :class:`~azure.search.documents.indexes.models.SynonymMap` """ kwargs["headers"] = self._merge_client_headers(kwargs.get("headers")) diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/aio/_search_indexer_client.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/aio/_search_indexer_client.py index 88101e0c363..d4194179bce 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/aio/_search_indexer_client.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/aio/_search_indexer_client.py @@ -528,11 +528,11 @@ async def create_or_update_skillset(self, skillset, **kwargs): existing one. :param skillset: The SearchIndexerSkillset object to create or update - :type skillset: :class:`~azure.search.documents.indexes.models.SearchIndexerSkillset + :type skillset: :class:`~azure.search.documents.indexes.models.SearchIndexerSkillset` :keyword match_condition: The match condition to use upon the etag :type match_condition: ~azure.core.MatchConditions :return: The created or updated SearchIndexerSkillset - :rtype: :class:`~azure.search.documents.indexes.models.SearchIndexerSkillset + :rtype: :class:`~azure.search.documents.indexes.models.SearchIndexerSkillset` """ kwargs["headers"] = self._merge_client_headers(kwargs.get("headers")) diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/models/__init__.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/models/__init__.py index f780722d19e..552d5691ef4 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/models/__init__.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/models/__init__.py @@ -33,7 +33,6 @@ ) from ..._internal._generated.models import SuggestOptions from .._internal._generated.models import ( - AnalyzeRequest as AnalyzeTextRequest, AnalyzeResult, AnalyzedTokenInfo, AsciiFoldingTokenFilter, @@ -43,7 +42,6 @@ CommonGramTokenFilter, ConditionalSkill, CorsOptions, - CustomAnalyzer, DictionaryDecompounderTokenFilter, DistanceScoringFunction, DistanceScoringParameters, @@ -130,6 +128,8 @@ WordDelimiterTokenFilter, ) from .._internal._models import ( + AnalyzeTextOptions, + CustomAnalyzer, PatternAnalyzer, PatternTokenizer, SearchIndexerDataSourceConnection, @@ -139,7 +139,7 @@ __all__ = ( - "AnalyzeTextRequest", + "AnalyzeTextOptions", "AnalyzeResult", "AnalyzedTokenInfo", "AsciiFoldingTokenFilter", diff --git a/sdk/search/azure-search-documents/tests/async_tests/test_service_live_async.py b/sdk/search/azure-search-documents/tests/async_tests/test_service_live_async.py index 358e89394ce..6ffa76fa12f 100644 --- a/sdk/search/azure-search-documents/tests/async_tests/test_service_live_async.py +++ b/sdk/search/azure-search-documents/tests/async_tests/test_service_live_async.py @@ -20,7 +20,7 @@ from azure.core.exceptions import HttpResponseError from azure.search.documents.indexes.models import( - AnalyzeTextRequest, + AnalyzeTextOptions, AnalyzeResult, CorsOptions, EntityRecognitionSkill, @@ -260,7 +260,7 @@ async def test_create_or_update_indexes_if_unchanged(self, api_key, endpoint, in @SearchServicePreparer(schema=SCHEMA, index_batch=BATCH) async def test_analyze_text(self, api_key, endpoint, index_name, **kwargs): client = SearchIndexClient(endpoint, AzureKeyCredential(api_key)) - analyze_request = AnalyzeTextRequest(text="One's ", analyzer="standard.lucene") + analyze_request = AnalyzeTextOptions(text="One's ", analyzer_name="standard.lucene") result = await client.analyze_text(index_name, analyze_request) assert len(result.tokens) == 2 diff --git a/sdk/search/azure-search-documents/tests/test_service_live.py b/sdk/search/azure-search-documents/tests/test_service_live.py index d571ff8c1cd..6b7e7853bde 100644 --- a/sdk/search/azure-search-documents/tests/test_service_live.py +++ b/sdk/search/azure-search-documents/tests/test_service_live.py @@ -17,7 +17,7 @@ from azure.core.credentials import AzureKeyCredential from azure.core.exceptions import HttpResponseError from azure.search.documents.indexes.models import( - AnalyzeTextRequest, + AnalyzeTextOptions, AnalyzeResult, CorsOptions, EntityRecognitionSkill, @@ -242,7 +242,7 @@ def test_create_or_update_indexes_if_unchanged(self, api_key, endpoint, index_na @SearchServicePreparer(schema=SCHEMA, index_batch=BATCH) def test_analyze_text(self, api_key, endpoint, index_name, **kwargs): client = SearchIndexClient(endpoint, AzureKeyCredential(api_key)) - analyze_request = AnalyzeTextRequest(text="One's ", analyzer="standard.lucene") + analyze_request = AnalyzeTextOptions(text="One's ", analyzer_name="standard.lucene") result = client.analyze_text(index_name, analyze_request) assert len(result.tokens) == 2 From 13d56f4501c04d9a843b64196f66bc8f277c5534 Mon Sep 17 00:00:00 2001 From: Xiang Yan Date: Thu, 4 Jun 2020 18:45:18 -0700 Subject: [PATCH 14/16] update --- .../samples/async_samples/sample_analyze_text_async.py | 4 ++-- .../azure-search-documents/samples/sample_analyze_text.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sdk/search/azure-search-documents/samples/async_samples/sample_analyze_text_async.py b/sdk/search/azure-search-documents/samples/async_samples/sample_analyze_text_async.py index 3fbf5e23324..cf14d3383f5 100644 --- a/sdk/search/azure-search-documents/samples/async_samples/sample_analyze_text_async.py +++ b/sdk/search/azure-search-documents/samples/async_samples/sample_analyze_text_async.py @@ -30,11 +30,11 @@ async def simple_analyze_text(): # [START simple_analyze_text_async] from azure.core.credentials import AzureKeyCredential from azure.search.documents.indexes.aio import SearchIndexClient - from azure.search.documents.indexes.models import AnalyzeRequest + from azure.search.documents.indexes.models import AnalyzeTextOptions client = SearchIndexClient(service_endpoint, AzureKeyCredential(key)) - analyze_request = AnalyzeRequest(text="One's ", analyzer="standard.lucene") + analyze_request = AnalyzeTextOptions(text="One's ", analyzer_name="standard.lucene") async with client: result = await client.analyze_text(index_name, analyze_request) diff --git a/sdk/search/azure-search-documents/samples/sample_analyze_text.py b/sdk/search/azure-search-documents/samples/sample_analyze_text.py index edf3b43f435..280060a9a74 100644 --- a/sdk/search/azure-search-documents/samples/sample_analyze_text.py +++ b/sdk/search/azure-search-documents/samples/sample_analyze_text.py @@ -29,11 +29,11 @@ def simple_analyze_text(): # [START simple_analyze_text] from azure.core.credentials import AzureKeyCredential from azure.search.documents.indexes import SearchIndexClient - from azure.search.documents.indexes.models import AnalyzeRequest + from azure.search.documents.indexes.models import AnalyzeTextOptions client = SearchIndexClient(service_endpoint, AzureKeyCredential(key)) - analyze_request = AnalyzeRequest(text="One's ", analyzer="standard.lucene") + analyze_request = AnalyzeTextOptions(text="One's ", analyzer_name="standard.lucene") result = client.analyze_text(index_name, analyze_request) print(result.as_dict()) From a5444049b4c35041d3bf30c9cc3f3d5f86334f5d Mon Sep 17 00:00:00 2001 From: Xiang Yan Date: Thu, 4 Jun 2020 21:51:17 -0700 Subject: [PATCH 15/16] update --- sdk/search/azure-search-documents/README.md | 65 +++++++++++-------- .../documents/indexes/_internal/_models.py | 5 +- 2 files changed, 42 insertions(+), 28 deletions(-) diff --git a/sdk/search/azure-search-documents/README.md b/sdk/search/azure-search-documents/README.md index 1de92c0b959..b464d6e63af 100644 --- a/sdk/search/azure-search-documents/README.md +++ b/sdk/search/azure-search-documents/README.md @@ -40,10 +40,11 @@ The above creates a resource with the "Standard" pricing tier. See [choosing a p In order to interact with the Cognitive Search service you'll need to create an instance of the Search Client class. To make this possible you will need an [api-key of the Cognitive Search service](https://docs.microsoft.com/en-us/azure/search/search-security-api-keys). -The SDK provides two clients. +The SDK provides three clients. 1. SearchClient for all document operations. -2. SearchServiceClient for all CRUD operations on service resources. +2. SearchIndexClient for all CRUD operations on index resources. +3. SearchIndexerClient for all CRUD operations on indexer resources. #### Create a SearchClient @@ -64,18 +65,33 @@ client = SearchClient(endpoint="", credential=credential) ``` -#### Create a SearchServiceClient +#### Create a SearchIndexClient Once you have the values of the Cognitive Search Service [service endpoint](https://docs.microsoft.com/en-us/azure/search/search-create-service-portal#get-a-key-and-url-endpoint) and [api key](https://docs.microsoft.com/en-us/azure/search/search-security-api-keys) you can create the Search Service client: ```python from azure.core.credentials import AzureKeyCredential -from azure.search.documents import SearchServiceClient +from azure.search.documents.indexes import SearchIndexClient credential = AzureKeyCredential("") -client = SearchServiceClient(endpoint="" +client = SearchIndexClient(endpoint="" + credential=credential) +``` + +#### Create a SearchIndexerClient + +Once you have the values of the Cognitive Search Service [service endpoint](https://docs.microsoft.com/en-us/azure/search/search-create-service-portal#get-a-key-and-url-endpoint) +and [api key](https://docs.microsoft.com/en-us/azure/search/search-security-api-keys) you can create the Search Service client: + +```python +from azure.core.credentials import AzureKeyCredential +from azure.search.documents.indexes import SearchIndexerClient + +credential = AzureKeyCredential("") + +client = SearchIndexerClient(endpoint="" credential=credential) ``` @@ -83,7 +99,7 @@ client = SearchServiceClient(endpoint="" You can use the `SearchClient` you created in the first section above to make a basic search request: ```python -results = client.search(search_text="spa") +results = client.search(query="spa") print("Hotels containing 'spa' in the name (or other fields):") for result in results: @@ -100,7 +116,7 @@ source to extract and load data into an index. There are several types of operations that can be executed against the service: - **Index management operations** Create, delete, update, or configure a search index. ([API Reference](https://azuresdkdocs.blob.core.windows.net/$web/python/azure-search-documents/latest/azure.search.documents.html#azure.search.documents.SearchIndexesClient), [Service Docs](https://docs.microsoft.com/en-us/rest/api/searchservice/index-operations)) -- **Document operations** Add, update, or delete documents in the index, query the index, or look up specific documents by ID. ([API Reference](https://azuresdkdocs.blob.core.windows.net/$web/python/azure-search-documents/latest/azure.search.documents.html#azure.search.documents.SearchClient), [Service Docs](https://docs.microsoft.com/en-us/rest/api/searchservice/document-operations)) +- **Document operations** Add, update, or delete documents in the index, query the index, or look up specific documents by ID. ([API Reference](https://azuresdkdocs.blob.core.windows.net/$web/python/azure-search-documents/latest/azure.search.documents.html#azure.search.documents.SearchClient), [Service Docs](https://docs.microsoft.com/en-us/rest/api/searchservice/document-operations)) - **Datasource operations** Create, delete, update, or configure data sources for Search Indexers ([API Reference](https://azuresdkdocs.blob.core.windows.net/$web/python/azure-search-documents/latest/azure.search.documents.html#azure.search.documents.SearchDataSourcesClient), [Service Docs](https://docs.microsoft.com/en-us/rest/api/searchservice/indexer-operations)) - **Indexer operations** Automate aspects of an indexing operation by configuring a data source and an indexer that you can schedule or run on demand. This feature is supported for a limited number of data source types. ([API Reference](https://azuresdkdocs.blob.core.windows.net/$web/python/azure-search-documents/latest/azure.search.documents.html#azure.search.documents.SearchIndexersClient), [Service Docs](https://docs.microsoft.com/en-us/rest/api/searchservice/indexer-operations)) - **Skillset operations** Part of a cognitive search workload, a skillset defines a series of a series of enrichment processing steps. A skillset is consumed by an indexer. ([API Reference](https://azuresdkdocs.blob.core.windows.net/$web/python/azure-search-documents/latest/azure.search.documents.html#azure.search.documents.SearchSkillsetsClient), [Service Docs](https://docs.microsoft.com/en-us/rest/api/searchservice/skillset-operations)) @@ -126,7 +142,7 @@ from azure.core.credentials import AzureKeyCredential from azure.search.documents import SearchClient client = SearchClient("", "", AzureKeyCredential("")) -results = client.search(search_text="spa") +results = client.search(query="spa") print("Hotels containing 'spa' in the name (or other fields):") for result in results: @@ -154,12 +170,10 @@ Get search suggestions for related terms, e.g. find search suggestions for the term "coffee": ```python from azure.core.credentials import AzureKeyCredential -from azure.search.documents import SearchClient, SuggestQuery +from azure.search.documents import SearchClient client = SearchClient("", "", AzureKeyCredential("")) -query = SuggestQuery(search_text="coffee", suggester_name="sg") - -results = client.suggest(query=query) +results = client.suggest(search_text="coffee", suggester_name="sg") print("Search suggestions for 'coffee'") for result in results: @@ -172,25 +186,22 @@ for result in results: ```python from azure.core.credentials import AzureKeyCredential -from azure.search.documents import SearchServiceClient, CorsOptions, Index, ScoringProfile -client = SearchServiceClient("", AzureKeyCredential("")).get_indexes_client() +from azure.search.documents.indexes import SearchIndexClient, CorsOptions, SearchIndex, ScoringProfile +client = SearchIndexClient("", AzureKeyCredential("")) name = "hotels" fields = [ - { - "name": "hotelId", - "type": "Edm.String", - "key": True, - "searchable": False - }, - { - "name": "baseRate", - "type": "Edm.Double" - } -] + SimpleField(name="hotelId", type=SearchFieldDataType.String, key=True), + SimpleField(name="baseRate", type=SearchFieldDataType.Double), + SearchableField(name="description", type=SearchFieldDataType.String), + ComplexField(name="address", fields=[ + SimpleField(name="streetAddress", type=SearchFieldDataType.String), + SimpleField(name="city", type=SearchFieldDataType.String), + ]) + ] cors_options = CorsOptions(allowed_origins=["*"], max_age_in_seconds=60) scoring_profiles = [] -index = Index( +index = SearchIndex( name=name, fields=fields, scoring_profiles=scoring_profiles, @@ -257,7 +268,7 @@ client = SearchClient("", "", AzureKeyCredential(" Similarly, `logging_enable` can enable detailed logging for a single operation, even when it isn't enabled for the client: ```python -result = client.search(search_text="spa", logging_enable=True) +result = client.search(query="spa", logging_enable=True) ``` ## Next steps diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/_models.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/_models.py index 9df7969fb92..6da11c7146d 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/_models.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_internal/_models.py @@ -87,7 +87,10 @@ def to_analyze_request(self): class CustomAnalyzer(LexicalAnalyzer): - """Allows you to take control over the process of converting text into indexable/searchable tokens. It's a user-defined configuration consisting of a single predefined tokenizer and one or more filters. The tokenizer is responsible for breaking text into tokens, and the filters for modifying tokens emitted by the tokenizer. + """Allows you to take control over the process of converting text into indexable/searchable tokens. + It's a user-defined configuration consisting of a single predefined tokenizer and one or more filters. + The tokenizer is responsible for breaking text into tokens, and the filters for modifying tokens + emitted by the tokenizer. All required parameters must be populated in order to send to Azure. From a6d0fa744ca121897b272c3a08df2755f8a249a3 Mon Sep 17 00:00:00 2001 From: Xiang Yan Date: Fri, 5 Jun 2020 10:51:07 -0700 Subject: [PATCH 16/16] updates --- sdk/search/azure-search-documents/README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sdk/search/azure-search-documents/README.md b/sdk/search/azure-search-documents/README.md index b464d6e63af..b9d00d8b7c8 100644 --- a/sdk/search/azure-search-documents/README.md +++ b/sdk/search/azure-search-documents/README.md @@ -68,7 +68,7 @@ client = SearchClient(endpoint="", #### Create a SearchIndexClient Once you have the values of the Cognitive Search Service [service endpoint](https://docs.microsoft.com/en-us/azure/search/search-create-service-portal#get-a-key-and-url-endpoint) -and [api key](https://docs.microsoft.com/en-us/azure/search/search-security-api-keys) you can create the Search Service client: +and [api key](https://docs.microsoft.com/en-us/azure/search/search-security-api-keys) you can create the Search Index client: ```python from azure.core.credentials import AzureKeyCredential @@ -76,14 +76,14 @@ from azure.search.documents.indexes import SearchIndexClient credential = AzureKeyCredential("") -client = SearchIndexClient(endpoint="" +client = SearchIndexClient(endpoint="", credential=credential) ``` #### Create a SearchIndexerClient Once you have the values of the Cognitive Search Service [service endpoint](https://docs.microsoft.com/en-us/azure/search/search-create-service-portal#get-a-key-and-url-endpoint) -and [api key](https://docs.microsoft.com/en-us/azure/search/search-security-api-keys) you can create the Search Service client: +and [api key](https://docs.microsoft.com/en-us/azure/search/search-security-api-keys) you can create the Search Indexer client: ```python from azure.core.credentials import AzureKeyCredential @@ -91,7 +91,7 @@ from azure.search.documents.indexes import SearchIndexerClient credential = AzureKeyCredential("") -client = SearchIndexerClient(endpoint="" +client = SearchIndexerClient(endpoint="", credential=credential) ``` @@ -99,7 +99,7 @@ client = SearchIndexerClient(endpoint="" You can use the `SearchClient` you created in the first section above to make a basic search request: ```python -results = client.search(query="spa") +results = client.search(search_text="spa") print("Hotels containing 'spa' in the name (or other fields):") for result in results: @@ -142,7 +142,7 @@ from azure.core.credentials import AzureKeyCredential from azure.search.documents import SearchClient client = SearchClient("", "", AzureKeyCredential("")) -results = client.search(query="spa") +results = client.search(search_text="spa") print("Hotels containing 'spa' in the name (or other fields):") for result in results: @@ -268,7 +268,7 @@ client = SearchClient("", "", AzureKeyCredential(" Similarly, `logging_enable` can enable detailed logging for a single operation, even when it isn't enabled for the client: ```python -result = client.search(query="spa", logging_enable=True) +result = client.search(search_text="spa", logging_enable=True) ``` ## Next steps