Update APIs to 7.x-SNAPSHOT
This commit is contained in:
committed by
Seth Michael Larson
parent
82b3daf6aa
commit
de52e149a5
@@ -45,6 +45,7 @@ from .remote import RemoteClient
|
||||
from .rollup import RollupClient
|
||||
from .searchable_snapshots import SearchableSnapshotsClient
|
||||
from .security import SecurityClient
|
||||
from .shutdown import ShutdownClient
|
||||
from .slm import SlmClient
|
||||
from .snapshot import SnapshotClient
|
||||
from .sql import SqlClient
|
||||
@@ -89,6 +90,7 @@ class AsyncElasticsearch(object):
|
||||
rollup: RollupClient
|
||||
searchable_snapshots: SearchableSnapshotsClient
|
||||
security: SecurityClient
|
||||
shutdown: ShutdownClient
|
||||
slm: SlmClient
|
||||
sql: SqlClient
|
||||
ssl: SslClient
|
||||
|
||||
@@ -1646,3 +1646,80 @@ class IndicesClient(NamespacedClient):
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params(
|
||||
"allow_no_indices",
|
||||
"expand_wildcards",
|
||||
"flush",
|
||||
"ignore_unavailable",
|
||||
"run_expensive_tasks",
|
||||
)
|
||||
async def disk_usage(self, index, params=None, headers=None):
|
||||
"""
|
||||
Analyzes the disk usage of each field of an index or data stream
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-disk-usage.html>`_
|
||||
|
||||
.. warning::
|
||||
|
||||
This API is **experimental** so may include breaking changes
|
||||
or be removed in a future version
|
||||
|
||||
:arg index: Comma-separated list of indices or data streams to
|
||||
analyze the disk usage
|
||||
:arg allow_no_indices: Whether to ignore if a wildcard indices
|
||||
expression resolves into no concrete indices. (This includes `_all`
|
||||
string or when no indices have been specified)
|
||||
:arg expand_wildcards: Whether to expand wildcard expression to
|
||||
concrete indices that are open, closed or both. Valid choices: open,
|
||||
closed, hidden, none, all Default: open
|
||||
:arg flush: Whether flush or not before analyzing the index disk
|
||||
usage. Defaults to true
|
||||
:arg ignore_unavailable: Whether specified concrete indices
|
||||
should be ignored when unavailable (missing or closed)
|
||||
:arg run_expensive_tasks: Must be set to [true] in order for the
|
||||
task to be performed. Defaults to false.
|
||||
"""
|
||||
if index in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'index'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"POST", _make_path(index, "_disk_usage"), params=params, headers=headers
|
||||
)
|
||||
|
||||
@query_params(
|
||||
"allow_no_indices", "expand_wildcards", "fields", "ignore_unavailable"
|
||||
)
|
||||
async def field_usage_stats(self, index, params=None, headers=None):
|
||||
"""
|
||||
Returns the field usage stats for each field of an index
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-field-usage-stats.html>`_
|
||||
|
||||
.. warning::
|
||||
|
||||
This API is **experimental** so may include breaking changes
|
||||
or be removed in a future version
|
||||
|
||||
:arg index: A comma-separated list of index names; use `_all` or
|
||||
empty string to perform the operation on all indices
|
||||
:arg allow_no_indices: Whether to ignore if a wildcard indices
|
||||
expression resolves into no concrete indices. (This includes `_all`
|
||||
string or when no indices have been specified)
|
||||
:arg expand_wildcards: Whether to expand wildcard expression to
|
||||
concrete indices that are open, closed or both. Valid choices: open,
|
||||
closed, hidden, none, all Default: open
|
||||
:arg fields: A comma-separated list of fields to include in the
|
||||
stats if only a subset of fields should be returned (supports wildcards)
|
||||
:arg ignore_unavailable: Whether specified concrete indices
|
||||
should be ignored when unavailable (missing or closed)
|
||||
"""
|
||||
if index in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'index'.")
|
||||
|
||||
return await self.transport.perform_request(
|
||||
"GET",
|
||||
_make_path(index, "_field_usage_stats"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@@ -1205,3 +1205,46 @@ class IndicesClient(NamespacedClient):
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def disk_usage(
|
||||
self,
|
||||
index: Any,
|
||||
*,
|
||||
allow_no_indices: Optional[Any] = ...,
|
||||
expand_wildcards: Optional[Any] = ...,
|
||||
flush: Optional[Any] = ...,
|
||||
ignore_unavailable: Optional[Any] = ...,
|
||||
run_expensive_tasks: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
async def field_usage_stats(
|
||||
self,
|
||||
index: Any,
|
||||
*,
|
||||
allow_no_indices: Optional[Any] = ...,
|
||||
expand_wildcards: Optional[Any] = ...,
|
||||
fields: Optional[Any] = ...,
|
||||
ignore_unavailable: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
|
||||
@@ -945,7 +945,9 @@ class MlClient(NamespacedClient):
|
||||
body=body,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
@query_params(
|
||||
"allow_no_indices", "expand_wildcards", "ignore_throttled", "ignore_unavailable"
|
||||
)
|
||||
async def put_job(self, job_id, body, params=None, headers=None):
|
||||
"""
|
||||
Instantiates an anomaly detection job.
|
||||
@@ -954,6 +956,17 @@ class MlClient(NamespacedClient):
|
||||
|
||||
:arg job_id: The ID of the job to create
|
||||
:arg body: The job
|
||||
:arg allow_no_indices: Ignore if the source indices expressions
|
||||
resolves to no concrete indices (default: true). Only set if
|
||||
datafeed_config is provided.
|
||||
:arg expand_wildcards: Whether source index expressions should
|
||||
get expanded to open or closed indices (default: open). Only set if
|
||||
datafeed_config is provided. Valid choices: open, closed, hidden, none,
|
||||
all
|
||||
:arg ignore_throttled: Ignore indices that are marked as
|
||||
throttled (default: true). Only set if datafeed_config is provided.
|
||||
:arg ignore_unavailable: Ignore unavailable indexes (default:
|
||||
false). Only set if datafeed_config is provided.
|
||||
"""
|
||||
for param in (job_id, body):
|
||||
if param in SKIP_IN_PATH:
|
||||
|
||||
@@ -712,6 +712,10 @@ class MlClient(NamespacedClient):
|
||||
job_id: Any,
|
||||
*,
|
||||
body: Any,
|
||||
allow_no_indices: Optional[Any] = ...,
|
||||
expand_wildcards: Optional[Any] = ...,
|
||||
ignore_throttled: Optional[Any] = ...,
|
||||
ignore_unavailable: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
|
||||
@@ -45,6 +45,7 @@ from .remote import RemoteClient
|
||||
from .rollup import RollupClient
|
||||
from .searchable_snapshots import SearchableSnapshotsClient
|
||||
from .security import SecurityClient
|
||||
from .shutdown import ShutdownClient
|
||||
from .slm import SlmClient
|
||||
from .snapshot import SnapshotClient
|
||||
from .sql import SqlClient
|
||||
@@ -89,6 +90,7 @@ class Elasticsearch(object):
|
||||
rollup: RollupClient
|
||||
searchable_snapshots: SearchableSnapshotsClient
|
||||
security: SecurityClient
|
||||
shutdown: ShutdownClient
|
||||
slm: SlmClient
|
||||
sql: SqlClient
|
||||
ssl: SslClient
|
||||
|
||||
@@ -1642,3 +1642,80 @@ class IndicesClient(NamespacedClient):
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@query_params(
|
||||
"allow_no_indices",
|
||||
"expand_wildcards",
|
||||
"flush",
|
||||
"ignore_unavailable",
|
||||
"run_expensive_tasks",
|
||||
)
|
||||
def disk_usage(self, index, params=None, headers=None):
|
||||
"""
|
||||
Analyzes the disk usage of each field of an index or data stream
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-disk-usage.html>`_
|
||||
|
||||
.. warning::
|
||||
|
||||
This API is **experimental** so may include breaking changes
|
||||
or be removed in a future version
|
||||
|
||||
:arg index: Comma-separated list of indices or data streams to
|
||||
analyze the disk usage
|
||||
:arg allow_no_indices: Whether to ignore if a wildcard indices
|
||||
expression resolves into no concrete indices. (This includes `_all`
|
||||
string or when no indices have been specified)
|
||||
:arg expand_wildcards: Whether to expand wildcard expression to
|
||||
concrete indices that are open, closed or both. Valid choices: open,
|
||||
closed, hidden, none, all Default: open
|
||||
:arg flush: Whether flush or not before analyzing the index disk
|
||||
usage. Defaults to true
|
||||
:arg ignore_unavailable: Whether specified concrete indices
|
||||
should be ignored when unavailable (missing or closed)
|
||||
:arg run_expensive_tasks: Must be set to [true] in order for the
|
||||
task to be performed. Defaults to false.
|
||||
"""
|
||||
if index in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'index'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"POST", _make_path(index, "_disk_usage"), params=params, headers=headers
|
||||
)
|
||||
|
||||
@query_params(
|
||||
"allow_no_indices", "expand_wildcards", "fields", "ignore_unavailable"
|
||||
)
|
||||
def field_usage_stats(self, index, params=None, headers=None):
|
||||
"""
|
||||
Returns the field usage stats for each field of an index
|
||||
|
||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-field-usage-stats.html>`_
|
||||
|
||||
.. warning::
|
||||
|
||||
This API is **experimental** so may include breaking changes
|
||||
or be removed in a future version
|
||||
|
||||
:arg index: A comma-separated list of index names; use `_all` or
|
||||
empty string to perform the operation on all indices
|
||||
:arg allow_no_indices: Whether to ignore if a wildcard indices
|
||||
expression resolves into no concrete indices. (This includes `_all`
|
||||
string or when no indices have been specified)
|
||||
:arg expand_wildcards: Whether to expand wildcard expression to
|
||||
concrete indices that are open, closed or both. Valid choices: open,
|
||||
closed, hidden, none, all Default: open
|
||||
:arg fields: A comma-separated list of fields to include in the
|
||||
stats if only a subset of fields should be returned (supports wildcards)
|
||||
:arg ignore_unavailable: Whether specified concrete indices
|
||||
should be ignored when unavailable (missing or closed)
|
||||
"""
|
||||
if index in SKIP_IN_PATH:
|
||||
raise ValueError("Empty value passed for a required argument 'index'.")
|
||||
|
||||
return self.transport.perform_request(
|
||||
"GET",
|
||||
_make_path(index, "_field_usage_stats"),
|
||||
params=params,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@@ -1205,3 +1205,46 @@ class IndicesClient(NamespacedClient):
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def disk_usage(
|
||||
self,
|
||||
index: Any,
|
||||
*,
|
||||
allow_no_indices: Optional[Any] = ...,
|
||||
expand_wildcards: Optional[Any] = ...,
|
||||
flush: Optional[Any] = ...,
|
||||
ignore_unavailable: Optional[Any] = ...,
|
||||
run_expensive_tasks: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
def field_usage_stats(
|
||||
self,
|
||||
index: Any,
|
||||
*,
|
||||
allow_no_indices: Optional[Any] = ...,
|
||||
expand_wildcards: Optional[Any] = ...,
|
||||
fields: Optional[Any] = ...,
|
||||
ignore_unavailable: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
format: Optional[str] = ...,
|
||||
filter_path: Optional[Union[str, Collection[str]]] = ...,
|
||||
request_timeout: Optional[Union[int, float]] = ...,
|
||||
ignore: Optional[Union[int, Collection[int]]] = ...,
|
||||
opaque_id: Optional[str] = ...,
|
||||
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
|
||||
params: Optional[MutableMapping[str, Any]] = ...,
|
||||
headers: Optional[MutableMapping[str, str]] = ...,
|
||||
) -> Any: ...
|
||||
|
||||
@@ -931,7 +931,9 @@ class MlClient(NamespacedClient):
|
||||
body=body,
|
||||
)
|
||||
|
||||
@query_params()
|
||||
@query_params(
|
||||
"allow_no_indices", "expand_wildcards", "ignore_throttled", "ignore_unavailable"
|
||||
)
|
||||
def put_job(self, job_id, body, params=None, headers=None):
|
||||
"""
|
||||
Instantiates an anomaly detection job.
|
||||
@@ -940,6 +942,17 @@ class MlClient(NamespacedClient):
|
||||
|
||||
:arg job_id: The ID of the job to create
|
||||
:arg body: The job
|
||||
:arg allow_no_indices: Ignore if the source indices expressions
|
||||
resolves to no concrete indices (default: true). Only set if
|
||||
datafeed_config is provided.
|
||||
:arg expand_wildcards: Whether source index expressions should
|
||||
get expanded to open or closed indices (default: open). Only set if
|
||||
datafeed_config is provided. Valid choices: open, closed, hidden, none,
|
||||
all
|
||||
:arg ignore_throttled: Ignore indices that are marked as
|
||||
throttled (default: true). Only set if datafeed_config is provided.
|
||||
:arg ignore_unavailable: Ignore unavailable indexes (default:
|
||||
false). Only set if datafeed_config is provided.
|
||||
"""
|
||||
for param in (job_id, body):
|
||||
if param in SKIP_IN_PATH:
|
||||
|
||||
@@ -712,6 +712,10 @@ class MlClient(NamespacedClient):
|
||||
job_id: Any,
|
||||
*,
|
||||
body: Any,
|
||||
allow_no_indices: Optional[Any] = ...,
|
||||
expand_wildcards: Optional[Any] = ...,
|
||||
ignore_throttled: Optional[Any] = ...,
|
||||
ignore_unavailable: Optional[Any] = ...,
|
||||
pretty: Optional[bool] = ...,
|
||||
human: Optional[bool] = ...,
|
||||
error_trace: Optional[bool] = ...,
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params
|
||||
from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params
|
||||
|
||||
|
||||
class SqlClient(NamespacedClient):
|
||||
|
||||
Reference in New Issue
Block a user