-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Search Service stats API (#10371)
* add generated API * move _credential.py up one level * add SearchServiceClient * minor edits to existing tests * rename test_live -> test_index_live * add live tests * restore accidentally removed snippet * use correct odata.metadata=minimal * re-record service live tests * update unit test too
- Loading branch information
Showing
85 changed files
with
17,993 additions
and
1,002 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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 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 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 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 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 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.