-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Add Search Service stats API #10371
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Add Search Service stats API #10371
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
611eb59
add generated API
bryevdv 372fa0f
move _credential.py up one level
bryevdv 6db7ff4
add SearchServiceClient
bryevdv 03d7a3d
minor edits to existing tests
bryevdv dde2082
rename test_live -> test_index_live
bryevdv 08d4b9f
add live tests
bryevdv bdc399d
restore accidentally removed snippet
bryevdv df761e9
use correct odata.metadata=minimal
bryevdv 88d9508
re-record service live tests
bryevdv b4de774
update unit test too
bryevdv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
sdk/search/azure-search-documents/azure/search/documents/_service/__init__.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # ------------------------------------ | ||
| # Copyright (c) Microsoft Corporation. | ||
| # Licensed under the MIT License. | ||
| # ------------------------------------ | ||
| from ._search_service_client import SearchServiceClient # pylint: disable=unused-import |
8 changes: 8 additions & 0 deletions
8
sdk/search/azure-search-documents/azure/search/documents/_service/_generated/__init__.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| # coding=utf-8 | ||
| # -------------------------------------------------------------------------- | ||
| # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.0.6257, generator: {generator}) | ||
| # Changes may cause incorrect behavior and will be lost if the code is regenerated. | ||
| # -------------------------------------------------------------------------- | ||
|
|
||
| from ._search_service_client import SearchServiceClient | ||
| __all__ = ['SearchServiceClient'] |
51 changes: 51 additions & 0 deletions
51
...earch/azure-search-documents/azure/search/documents/_service/_generated/_configuration.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| # coding=utf-8 | ||
| # -------------------------------------------------------------------------- | ||
| # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.0.6257, generator: {generator}) | ||
| # Changes may cause incorrect behavior and will be lost if the code is regenerated. | ||
| # -------------------------------------------------------------------------- | ||
|
|
||
| from typing import Any | ||
|
|
||
| from azure.core.configuration import Configuration | ||
| from azure.core.pipeline import policies | ||
|
|
||
| VERSION = "unknown" | ||
|
|
||
| class SearchServiceClientConfiguration(Configuration): | ||
| """Configuration for SearchServiceClient. | ||
|
|
||
| Note that all parameters used to create this instance are saved as instance | ||
| attributes. | ||
|
|
||
| :param endpoint: The endpoint URL of the search service. | ||
| :type endpoint: str | ||
| """ | ||
|
|
||
| def __init__( | ||
| self, | ||
| endpoint, # type: str | ||
| **kwargs # type: Any | ||
| ): | ||
| # type: (...) -> None | ||
| if endpoint is None: | ||
| raise ValueError("Parameter 'endpoint' must not be None.") | ||
| super(SearchServiceClientConfiguration, self).__init__(**kwargs) | ||
|
|
||
| self.endpoint = endpoint | ||
| self.api_version = "2019-05-06-Preview" | ||
| kwargs.setdefault('sdk_moniker', 'searchserviceclient/{}'.format(VERSION)) | ||
| self._configure(**kwargs) | ||
|
|
||
| def _configure( | ||
| self, | ||
| **kwargs # type: Any | ||
| ): | ||
| # type: (...) -> None | ||
| self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) | ||
| self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) | ||
| self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) | ||
| self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) | ||
| self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) | ||
| self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) | ||
| self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) | ||
| self.authentication_policy = kwargs.get('authentication_policy') |
75 changes: 75 additions & 0 deletions
75
...ure-search-documents/azure/search/documents/_service/_generated/_search_service_client.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| # coding=utf-8 | ||
| # -------------------------------------------------------------------------- | ||
| # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.0.6257, generator: {generator}) | ||
| # Changes may cause incorrect behavior and will be lost if the code is regenerated. | ||
| # -------------------------------------------------------------------------- | ||
|
|
||
| from typing import Any | ||
|
|
||
| from azure.core import PipelineClient | ||
| from msrest import Deserializer, Serializer | ||
|
|
||
| from ._configuration import SearchServiceClientConfiguration | ||
| from .operations import DataSourcesOperations | ||
| from .operations import IndexersOperations | ||
| from .operations import SkillsetsOperations | ||
| from .operations import SynonymMapsOperations | ||
| from .operations import IndexesOperations | ||
| from .operations import SearchServiceClientOperationsMixin | ||
| from . import models | ||
|
|
||
|
|
||
| class SearchServiceClient(SearchServiceClientOperationsMixin): | ||
| """Client that can be used to manage and query indexes and documents, as well as manage other resources, on a search service. | ||
|
|
||
| :ivar data_sources: DataSourcesOperations operations | ||
| :vartype data_sources: search_service_client.operations.DataSourcesOperations | ||
| :ivar indexers: IndexersOperations operations | ||
| :vartype indexers: search_service_client.operations.IndexersOperations | ||
| :ivar skillsets: SkillsetsOperations operations | ||
| :vartype skillsets: search_service_client.operations.SkillsetsOperations | ||
| :ivar synonym_maps: SynonymMapsOperations operations | ||
| :vartype synonym_maps: search_service_client.operations.SynonymMapsOperations | ||
| :ivar indexes: IndexesOperations operations | ||
| :vartype indexes: search_service_client.operations.IndexesOperations | ||
| :param endpoint: The endpoint URL of the search service. | ||
| :type endpoint: str | ||
| """ | ||
|
|
||
| def __init__( | ||
| self, | ||
| endpoint, # type: str | ||
| **kwargs # type: Any | ||
| ): | ||
| # type: (...) -> None | ||
| base_url = '{endpoint}' | ||
| self._config = SearchServiceClientConfiguration(endpoint, **kwargs) | ||
| self._client = PipelineClient(base_url=base_url, config=self._config, **kwargs) | ||
|
|
||
| client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} | ||
| self._serialize = Serializer(client_models) | ||
| self._deserialize = Deserializer(client_models) | ||
|
|
||
| self.data_sources = DataSourcesOperations( | ||
| self._client, self._config, self._serialize, self._deserialize) | ||
| self.indexers = IndexersOperations( | ||
| self._client, self._config, self._serialize, self._deserialize) | ||
| self.skillsets = SkillsetsOperations( | ||
| self._client, self._config, self._serialize, self._deserialize) | ||
| self.synonym_maps = SynonymMapsOperations( | ||
| self._client, self._config, self._serialize, self._deserialize) | ||
| self.indexes = IndexesOperations( | ||
| self._client, self._config, self._serialize, self._deserialize) | ||
|
|
||
| def close(self): | ||
| # type: () -> None | ||
| self._client.close() | ||
|
|
||
| def __enter__(self): | ||
| # type: () -> SearchServiceClient | ||
| self._client.__enter__() | ||
| return self | ||
|
|
||
| def __exit__(self, *exc_details): | ||
| # type: (Any) -> None | ||
| self._client.__exit__(*exc_details) |
8 changes: 8 additions & 0 deletions
8
sdk/search/azure-search-documents/azure/search/documents/_service/_generated/aio/__init__.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| # coding=utf-8 | ||
| # -------------------------------------------------------------------------- | ||
| # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.0.6257, generator: {generator}) | ||
| # Changes may cause incorrect behavior and will be lost if the code is regenerated. | ||
| # -------------------------------------------------------------------------- | ||
|
|
||
| from ._search_service_client_async import SearchServiceClient | ||
| __all__ = ['SearchServiceClient'] |
49 changes: 49 additions & 0 deletions
49
...e-search-documents/azure/search/documents/_service/_generated/aio/_configuration_async.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| # coding=utf-8 | ||
| # -------------------------------------------------------------------------- | ||
| # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.0.6257, generator: {generator}) | ||
| # Changes may cause incorrect behavior and will be lost if the code is regenerated. | ||
| # -------------------------------------------------------------------------- | ||
|
|
||
| from typing import Any | ||
|
|
||
| from azure.core.configuration import Configuration | ||
| from azure.core.pipeline import policies | ||
|
|
||
| VERSION = "unknown" | ||
|
|
||
| class SearchServiceClientConfiguration(Configuration): | ||
| """Configuration for SearchServiceClient. | ||
|
|
||
| Note that all parameters used to create this instance are saved as instance | ||
| attributes. | ||
|
|
||
| :param endpoint: The endpoint URL of the search service. | ||
| :type endpoint: str | ||
| """ | ||
|
|
||
| def __init__( | ||
| self, | ||
| endpoint: str, | ||
| **kwargs: Any | ||
| ) -> None: | ||
| if endpoint is None: | ||
| raise ValueError("Parameter 'endpoint' must not be None.") | ||
| super(SearchServiceClientConfiguration, self).__init__(**kwargs) | ||
|
|
||
| self.endpoint = endpoint | ||
| self.api_version = "2019-05-06-Preview" | ||
| kwargs.setdefault('sdk_moniker', 'searchserviceclient/{}'.format(VERSION)) | ||
| self._configure(**kwargs) | ||
|
|
||
| def _configure( | ||
| self, | ||
| **kwargs: Any | ||
| ) -> None: | ||
| self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) | ||
| self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) | ||
| self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) | ||
| self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) | ||
| self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) | ||
| self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) | ||
| self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) | ||
| self.authentication_policy = kwargs.get('authentication_policy') |
71 changes: 71 additions & 0 deletions
71
...-documents/azure/search/documents/_service/_generated/aio/_search_service_client_async.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| # coding=utf-8 | ||
| # -------------------------------------------------------------------------- | ||
| # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.0.6257, generator: {generator}) | ||
| # Changes may cause incorrect behavior and will be lost if the code is regenerated. | ||
| # -------------------------------------------------------------------------- | ||
|
|
||
| from typing import Any | ||
|
|
||
| from azure.core import AsyncPipelineClient | ||
| from msrest import Deserializer, Serializer | ||
|
|
||
| from ._configuration_async import SearchServiceClientConfiguration | ||
| from .operations_async import DataSourcesOperations | ||
| from .operations_async import IndexersOperations | ||
| from .operations_async import SkillsetsOperations | ||
| from .operations_async import SynonymMapsOperations | ||
| from .operations_async import IndexesOperations | ||
| from .operations_async import SearchServiceClientOperationsMixin | ||
| from .. import models | ||
|
|
||
|
|
||
| class SearchServiceClient(SearchServiceClientOperationsMixin): | ||
| """Client that can be used to manage and query indexes and documents, as well as manage other resources, on a search service. | ||
|
|
||
| :ivar data_sources: DataSourcesOperations operations | ||
| :vartype data_sources: search_service_client.aio.operations_async.DataSourcesOperations | ||
| :ivar indexers: IndexersOperations operations | ||
| :vartype indexers: search_service_client.aio.operations_async.IndexersOperations | ||
| :ivar skillsets: SkillsetsOperations operations | ||
| :vartype skillsets: search_service_client.aio.operations_async.SkillsetsOperations | ||
| :ivar synonym_maps: SynonymMapsOperations operations | ||
| :vartype synonym_maps: search_service_client.aio.operations_async.SynonymMapsOperations | ||
| :ivar indexes: IndexesOperations operations | ||
| :vartype indexes: search_service_client.aio.operations_async.IndexesOperations | ||
| :param endpoint: The endpoint URL of the search service. | ||
| :type endpoint: str | ||
| """ | ||
|
|
||
| def __init__( | ||
| self, | ||
| endpoint: str, | ||
| **kwargs: Any | ||
| ) -> None: | ||
| base_url = '{endpoint}' | ||
| self._config = SearchServiceClientConfiguration(endpoint, **kwargs) | ||
| self._client = AsyncPipelineClient(base_url=base_url, config=self._config, **kwargs) | ||
|
|
||
| client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} | ||
| self._serialize = Serializer(client_models) | ||
| self._deserialize = Deserializer(client_models) | ||
|
|
||
| self.data_sources = DataSourcesOperations( | ||
| self._client, self._config, self._serialize, self._deserialize) | ||
| self.indexers = IndexersOperations( | ||
| self._client, self._config, self._serialize, self._deserialize) | ||
| self.skillsets = SkillsetsOperations( | ||
| self._client, self._config, self._serialize, self._deserialize) | ||
| self.synonym_maps = SynonymMapsOperations( | ||
| self._client, self._config, self._serialize, self._deserialize) | ||
| self.indexes = IndexesOperations( | ||
| self._client, self._config, self._serialize, self._deserialize) | ||
|
|
||
| async def close(self) -> None: | ||
| await self._client.close() | ||
|
|
||
| async def __aenter__(self) -> "SearchServiceClient": | ||
| await self._client.__aenter__() | ||
| return self | ||
|
|
||
| async def __aexit__(self, *exc_details) -> None: | ||
| await self._client.__aexit__(*exc_details) |
21 changes: 21 additions & 0 deletions
21
...rch-documents/azure/search/documents/_service/_generated/aio/operations_async/__init__.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| # coding=utf-8 | ||
| # -------------------------------------------------------------------------- | ||
| # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.0.6257, generator: {generator}) | ||
| # Changes may cause incorrect behavior and will be lost if the code is regenerated. | ||
| # -------------------------------------------------------------------------- | ||
|
|
||
| from ._data_sources_operations_async import DataSourcesOperations | ||
| from ._indexers_operations_async import IndexersOperations | ||
| from ._skillsets_operations_async import SkillsetsOperations | ||
| from ._synonym_maps_operations_async import SynonymMapsOperations | ||
| from ._indexes_operations_async import IndexesOperations | ||
| from ._search_service_client_operations_async import SearchServiceClientOperationsMixin | ||
|
|
||
| __all__ = [ | ||
| 'DataSourcesOperations', | ||
| 'IndexersOperations', | ||
| 'SkillsetsOperations', | ||
| 'SynonymMapsOperations', | ||
| 'IndexesOperations', | ||
| 'SearchServiceClientOperationsMixin', | ||
| ] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.