Skip to content

Commit 887da1d

Browse files
committed
Update APIs to 7.14-SNAPSHOT
1 parent b015b7c commit 887da1d

File tree

6 files changed

+240
-2
lines changed

6 files changed

+240
-2
lines changed

elasticsearch/_async/client/__init__.pyi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ from .remote import RemoteClient
4545
from .rollup import RollupClient
4646
from .searchable_snapshots import SearchableSnapshotsClient
4747
from .security import SecurityClient
48+
from .shutdown import ShutdownClient
4849
from .slm import SlmClient
4950
from .snapshot import SnapshotClient
5051
from .sql import SqlClient
@@ -89,6 +90,7 @@ class AsyncElasticsearch(object):
8990
rollup: RollupClient
9091
searchable_snapshots: SearchableSnapshotsClient
9192
security: SecurityClient
93+
shutdown: ShutdownClient
9294
slm: SlmClient
9395
sql: SqlClient
9496
ssl: SslClient

elasticsearch/_async/client/sql.py

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18-
from .utils import SKIP_IN_PATH, NamespacedClient, query_params
18+
from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params
1919

2020

2121
class SqlClient(NamespacedClient):
@@ -70,3 +70,66 @@ async def translate(self, body, params=None, headers=None):
7070
return await self.transport.perform_request(
7171
"POST", "/_sql/translate", params=params, headers=headers, body=body
7272
)
73+
74+
@query_params()
75+
async def delete_async(self, id, params=None, headers=None):
76+
"""
77+
Deletes an async SQL search or a stored synchronous SQL search. If the search
78+
is still running, the API cancels it.
79+
80+
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.14/delete-async-sql-search-api.html>`_
81+
82+
:arg id: The async search ID
83+
"""
84+
if id in SKIP_IN_PATH:
85+
raise ValueError("Empty value passed for a required argument 'id'.")
86+
87+
return await self.transport.perform_request(
88+
"DELETE",
89+
_make_path("_sql", "async", "delete", id),
90+
params=params,
91+
headers=headers,
92+
)
93+
94+
@query_params("delimiter", "format", "keep_alive", "wait_for_completion_timeout")
95+
async def get_async(self, id, params=None, headers=None):
96+
"""
97+
Returns the current status and available results for an async SQL search or
98+
stored synchronous SQL search
99+
100+
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.14/get-async-sql-search-api.html>`_
101+
102+
:arg id: The async search ID
103+
:arg delimiter: Separator for CSV results Default: ,
104+
:arg format: Short version of the Accept header, e.g. json, yaml
105+
:arg keep_alive: Retention period for the search and its results
106+
Default: 5d
107+
:arg wait_for_completion_timeout: Duration to wait for complete
108+
results
109+
"""
110+
if id in SKIP_IN_PATH:
111+
raise ValueError("Empty value passed for a required argument 'id'.")
112+
113+
return await self.transport.perform_request(
114+
"GET", _make_path("_sql", "async", id), params=params, headers=headers
115+
)
116+
117+
@query_params()
118+
async def get_async_status(self, id, params=None, headers=None):
119+
"""
120+
Returns the current status of an async SQL search or a stored synchronous SQL
121+
search
122+
123+
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.14/get-async-sql-search-status-api.html>`_
124+
125+
:arg id: The async search ID
126+
"""
127+
if id in SKIP_IN_PATH:
128+
raise ValueError("Empty value passed for a required argument 'id'.")
129+
130+
return await self.transport.perform_request(
131+
"GET",
132+
_make_path("_sql", "async", "status", id),
133+
params=params,
134+
headers=headers,
135+
)

elasticsearch/_async/client/sql.pyi

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,57 @@ class SqlClient(NamespacedClient):
7171
params: Optional[MutableMapping[str, Any]] = ...,
7272
headers: Optional[MutableMapping[str, str]] = ...,
7373
) -> Any: ...
74+
async def delete_async(
75+
self,
76+
id: Any,
77+
*,
78+
pretty: Optional[bool] = ...,
79+
human: Optional[bool] = ...,
80+
error_trace: Optional[bool] = ...,
81+
format: Optional[str] = ...,
82+
filter_path: Optional[Union[str, Collection[str]]] = ...,
83+
request_timeout: Optional[Union[int, float]] = ...,
84+
ignore: Optional[Union[int, Collection[int]]] = ...,
85+
opaque_id: Optional[str] = ...,
86+
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
87+
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
88+
params: Optional[MutableMapping[str, Any]] = ...,
89+
headers: Optional[MutableMapping[str, str]] = ...,
90+
) -> Any: ...
91+
async def get_async(
92+
self,
93+
id: Any,
94+
*,
95+
delimiter: Optional[Any] = ...,
96+
format: Optional[Any] = ...,
97+
keep_alive: Optional[Any] = ...,
98+
wait_for_completion_timeout: Optional[Any] = ...,
99+
pretty: Optional[bool] = ...,
100+
human: Optional[bool] = ...,
101+
error_trace: Optional[bool] = ...,
102+
filter_path: Optional[Union[str, Collection[str]]] = ...,
103+
request_timeout: Optional[Union[int, float]] = ...,
104+
ignore: Optional[Union[int, Collection[int]]] = ...,
105+
opaque_id: Optional[str] = ...,
106+
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
107+
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
108+
params: Optional[MutableMapping[str, Any]] = ...,
109+
headers: Optional[MutableMapping[str, str]] = ...,
110+
) -> Any: ...
111+
async def get_async_status(
112+
self,
113+
id: Any,
114+
*,
115+
pretty: Optional[bool] = ...,
116+
human: Optional[bool] = ...,
117+
error_trace: Optional[bool] = ...,
118+
format: Optional[str] = ...,
119+
filter_path: Optional[Union[str, Collection[str]]] = ...,
120+
request_timeout: Optional[Union[int, float]] = ...,
121+
ignore: Optional[Union[int, Collection[int]]] = ...,
122+
opaque_id: Optional[str] = ...,
123+
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
124+
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
125+
params: Optional[MutableMapping[str, Any]] = ...,
126+
headers: Optional[MutableMapping[str, str]] = ...,
127+
) -> Any: ...

elasticsearch/client/__init__.pyi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ from .remote import RemoteClient
4545
from .rollup import RollupClient
4646
from .searchable_snapshots import SearchableSnapshotsClient
4747
from .security import SecurityClient
48+
from .shutdown import ShutdownClient
4849
from .slm import SlmClient
4950
from .snapshot import SnapshotClient
5051
from .sql import SqlClient
@@ -89,6 +90,7 @@ class Elasticsearch(object):
8990
rollup: RollupClient
9091
searchable_snapshots: SearchableSnapshotsClient
9192
security: SecurityClient
93+
shutdown: ShutdownClient
9294
slm: SlmClient
9395
sql: SqlClient
9496
ssl: SslClient

elasticsearch/client/sql.py

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18-
from .utils import SKIP_IN_PATH, NamespacedClient, query_params
18+
from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params
1919

2020

2121
class SqlClient(NamespacedClient):
@@ -70,3 +70,66 @@ def translate(self, body, params=None, headers=None):
7070
return self.transport.perform_request(
7171
"POST", "/_sql/translate", params=params, headers=headers, body=body
7272
)
73+
74+
@query_params()
75+
def delete_async(self, id, params=None, headers=None):
76+
"""
77+
Deletes an async SQL search or a stored synchronous SQL search. If the search
78+
is still running, the API cancels it.
79+
80+
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.14/delete-async-sql-search-api.html>`_
81+
82+
:arg id: The async search ID
83+
"""
84+
if id in SKIP_IN_PATH:
85+
raise ValueError("Empty value passed for a required argument 'id'.")
86+
87+
return self.transport.perform_request(
88+
"DELETE",
89+
_make_path("_sql", "async", "delete", id),
90+
params=params,
91+
headers=headers,
92+
)
93+
94+
@query_params("delimiter", "format", "keep_alive", "wait_for_completion_timeout")
95+
def get_async(self, id, params=None, headers=None):
96+
"""
97+
Returns the current status and available results for an async SQL search or
98+
stored synchronous SQL search
99+
100+
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.14/get-async-sql-search-api.html>`_
101+
102+
:arg id: The async search ID
103+
:arg delimiter: Separator for CSV results Default: ,
104+
:arg format: Short version of the Accept header, e.g. json, yaml
105+
:arg keep_alive: Retention period for the search and its results
106+
Default: 5d
107+
:arg wait_for_completion_timeout: Duration to wait for complete
108+
results
109+
"""
110+
if id in SKIP_IN_PATH:
111+
raise ValueError("Empty value passed for a required argument 'id'.")
112+
113+
return self.transport.perform_request(
114+
"GET", _make_path("_sql", "async", id), params=params, headers=headers
115+
)
116+
117+
@query_params()
118+
def get_async_status(self, id, params=None, headers=None):
119+
"""
120+
Returns the current status of an async SQL search or a stored synchronous SQL
121+
search
122+
123+
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.14/get-async-sql-search-status-api.html>`_
124+
125+
:arg id: The async search ID
126+
"""
127+
if id in SKIP_IN_PATH:
128+
raise ValueError("Empty value passed for a required argument 'id'.")
129+
130+
return self.transport.perform_request(
131+
"GET",
132+
_make_path("_sql", "async", "status", id),
133+
params=params,
134+
headers=headers,
135+
)

elasticsearch/client/sql.pyi

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,57 @@ class SqlClient(NamespacedClient):
7171
params: Optional[MutableMapping[str, Any]] = ...,
7272
headers: Optional[MutableMapping[str, str]] = ...,
7373
) -> Any: ...
74+
def delete_async(
75+
self,
76+
id: Any,
77+
*,
78+
pretty: Optional[bool] = ...,
79+
human: Optional[bool] = ...,
80+
error_trace: Optional[bool] = ...,
81+
format: Optional[str] = ...,
82+
filter_path: Optional[Union[str, Collection[str]]] = ...,
83+
request_timeout: Optional[Union[int, float]] = ...,
84+
ignore: Optional[Union[int, Collection[int]]] = ...,
85+
opaque_id: Optional[str] = ...,
86+
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
87+
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
88+
params: Optional[MutableMapping[str, Any]] = ...,
89+
headers: Optional[MutableMapping[str, str]] = ...,
90+
) -> Any: ...
91+
def get_async(
92+
self,
93+
id: Any,
94+
*,
95+
delimiter: Optional[Any] = ...,
96+
format: Optional[Any] = ...,
97+
keep_alive: Optional[Any] = ...,
98+
wait_for_completion_timeout: Optional[Any] = ...,
99+
pretty: Optional[bool] = ...,
100+
human: Optional[bool] = ...,
101+
error_trace: Optional[bool] = ...,
102+
filter_path: Optional[Union[str, Collection[str]]] = ...,
103+
request_timeout: Optional[Union[int, float]] = ...,
104+
ignore: Optional[Union[int, Collection[int]]] = ...,
105+
opaque_id: Optional[str] = ...,
106+
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
107+
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
108+
params: Optional[MutableMapping[str, Any]] = ...,
109+
headers: Optional[MutableMapping[str, str]] = ...,
110+
) -> Any: ...
111+
def get_async_status(
112+
self,
113+
id: Any,
114+
*,
115+
pretty: Optional[bool] = ...,
116+
human: Optional[bool] = ...,
117+
error_trace: Optional[bool] = ...,
118+
format: Optional[str] = ...,
119+
filter_path: Optional[Union[str, Collection[str]]] = ...,
120+
request_timeout: Optional[Union[int, float]] = ...,
121+
ignore: Optional[Union[int, Collection[int]]] = ...,
122+
opaque_id: Optional[str] = ...,
123+
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
124+
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
125+
params: Optional[MutableMapping[str, Any]] = ...,
126+
headers: Optional[MutableMapping[str, str]] = ...,
127+
) -> Any: ...

0 commit comments

Comments
 (0)