diff --git a/docs/examples/1cecd4d87a92427175157d41859df2af.asciidoc b/docs/examples/1cecd4d87a92427175157d41859df2af.asciidoc new file mode 100644 index 000000000..f4ff982b7 --- /dev/null +++ b/docs/examples/1cecd4d87a92427175157d41859df2af.asciidoc @@ -0,0 +1,14 @@ +// cluster/allocation-explain.asciidoc:10 + +[source, python] +---- +resp = client.cluster.allocation_explain( + body={ + "index": "my-index-000001", + "shard": 0, + "primary": False, + "current_node": "my-node", + }, +) +print(resp) +---- \ No newline at end of file diff --git a/docs/examples/2cd8439db5054c93c49f1bf50433e1bb.asciidoc b/docs/examples/2cd8439db5054c93c49f1bf50433e1bb.asciidoc new file mode 100644 index 000000000..a4a64ba77 --- /dev/null +++ b/docs/examples/2cd8439db5054c93c49f1bf50433e1bb.asciidoc @@ -0,0 +1,28 @@ +// cluster/reroute.asciidoc:195 + +[source, python] +---- +resp = client.cluster.reroute( + metric="none", + body={ + "commands": [ + { + "move": { + "index": "test", + "shard": 0, + "from_node": "node1", + "to_node": "node2", + } + }, + { + "allocate_replica": { + "index": "test", + "shard": 1, + "node": "node3", + } + }, + ] + }, +) +print(resp) +---- \ No newline at end of file diff --git a/docs/examples/2fc80a2ad1ca8b2dcb13ed1895b8e861.asciidoc b/docs/examples/2fc80a2ad1ca8b2dcb13ed1895b8e861.asciidoc new file mode 100644 index 000000000..cbc310315 --- /dev/null +++ b/docs/examples/2fc80a2ad1ca8b2dcb13ed1895b8e861.asciidoc @@ -0,0 +1,9 @@ +// cluster/update-settings.asciidoc:123 + +[source, python] +---- +resp = client.cluster.put_settings( + body={"transient": {"indices.recovery.*": None}}, +) +print(resp) +---- \ No newline at end of file diff --git a/docs/examples/3541d4a85e27b2c3896a7a7ee98b4b37.asciidoc b/docs/examples/3541d4a85e27b2c3896a7a7ee98b4b37.asciidoc new file mode 100644 index 000000000..e189b1def --- /dev/null +++ b/docs/examples/3541d4a85e27b2c3896a7a7ee98b4b37.asciidoc @@ -0,0 +1,9 @@ +// health/health.asciidoc:470 + +[source, python] +---- +resp = client.health_report( + verbose="false", +) +print(resp) +---- \ No newline at end of file diff --git a/docs/examples/4029af36cb3f8202549017f7378803b4.asciidoc b/docs/examples/4029af36cb3f8202549017f7378803b4.asciidoc new file mode 100644 index 000000000..8319dd6ce --- /dev/null +++ b/docs/examples/4029af36cb3f8202549017f7378803b4.asciidoc @@ -0,0 +1,7 @@ +// cluster/get-settings.asciidoc:10 + +[source, python] +---- +resp = client.cluster.get_settings() +print(resp) +---- \ No newline at end of file diff --git a/docs/examples/4ca15672fc5ab1d80a127d086b6d2837.asciidoc b/docs/examples/4ca15672fc5ab1d80a127d086b6d2837.asciidoc new file mode 100644 index 000000000..4f9dcb5a9 --- /dev/null +++ b/docs/examples/4ca15672fc5ab1d80a127d086b6d2837.asciidoc @@ -0,0 +1,7 @@ +// cluster/allocation-explain.asciidoc:342 + +[source, python] +---- +resp = client.cluster.allocation_explain() +print(resp) +---- \ No newline at end of file diff --git a/docs/examples/87733deeea4b441b595d19a0f97346f0.asciidoc b/docs/examples/87733deeea4b441b595d19a0f97346f0.asciidoc new file mode 100644 index 000000000..7dce86873 --- /dev/null +++ b/docs/examples/87733deeea4b441b595d19a0f97346f0.asciidoc @@ -0,0 +1,9 @@ +// health/health.asciidoc:463 + +[source, python] +---- +resp = client.health_report( + feature="shards_availability", +) +print(resp) +---- \ No newline at end of file diff --git a/docs/examples/9d79645ab3a9da3f63c54a1516214a5a.asciidoc b/docs/examples/9d79645ab3a9da3f63c54a1516214a5a.asciidoc new file mode 100644 index 000000000..974117af4 --- /dev/null +++ b/docs/examples/9d79645ab3a9da3f63c54a1516214a5a.asciidoc @@ -0,0 +1,7 @@ +// health/health.asciidoc:455 + +[source, python] +---- +resp = client.health_report() +print(resp) +---- \ No newline at end of file diff --git a/docs/examples/ab8de34fcfc0277901cb39618ecfc9d5.asciidoc b/docs/examples/ab8de34fcfc0277901cb39618ecfc9d5.asciidoc new file mode 100644 index 000000000..7782e0d64 --- /dev/null +++ b/docs/examples/ab8de34fcfc0277901cb39618ecfc9d5.asciidoc @@ -0,0 +1,9 @@ +// cluster/allocation-explain.asciidoc:101 + +[source, python] +---- +resp = client.cluster.allocation_explain( + body={"index": "my-index-000001", "shard": 0, "primary": True}, +) +print(resp) +---- \ No newline at end of file diff --git a/docs/examples/ac85e05c0bf2fd5099fbcb9c492f447e.asciidoc b/docs/examples/ac85e05c0bf2fd5099fbcb9c492f447e.asciidoc new file mode 100644 index 000000000..cdef1b4a4 --- /dev/null +++ b/docs/examples/ac85e05c0bf2fd5099fbcb9c492f447e.asciidoc @@ -0,0 +1,10 @@ +// cluster/update-settings.asciidoc:68 + +[source, python] +---- +resp = client.cluster.put_settings( + flat_settings="true", + body={"transient": {"indices.recovery.max_bytes_per_sec": "20mb"}}, +) +print(resp) +---- \ No newline at end of file diff --git a/docs/examples/e5901f48eb8a419b878fc2cb815d8691.asciidoc b/docs/examples/e5901f48eb8a419b878fc2cb815d8691.asciidoc new file mode 100644 index 000000000..740c463d0 --- /dev/null +++ b/docs/examples/e5901f48eb8a419b878fc2cb815d8691.asciidoc @@ -0,0 +1,9 @@ +// cluster/update-settings.asciidoc:45 + +[source, python] +---- +resp = client.cluster.put_settings( + body={"persistent": {"indices.recovery.max_bytes_per_sec": "50mb"}}, +) +print(resp) +---- \ No newline at end of file diff --git a/docs/examples/eff8ecaed1ed084909c64450fc363a20.asciidoc b/docs/examples/eff8ecaed1ed084909c64450fc363a20.asciidoc new file mode 100644 index 000000000..b4c4142ca --- /dev/null +++ b/docs/examples/eff8ecaed1ed084909c64450fc363a20.asciidoc @@ -0,0 +1,9 @@ +// cluster/update-settings.asciidoc:96 + +[source, python] +---- +resp = client.cluster.put_settings( + body={"transient": {"indices.recovery.max_bytes_per_sec": None}}, +) +print(resp) +---- \ No newline at end of file diff --git a/utils/generate-examples.py b/utils/generate-examples.py index 9626e6e96..fedfd1c4d 100644 --- a/utils/generate-examples.py +++ b/utils/generate-examples.py @@ -101,6 +101,11 @@ "mapping/fields/id-field.asciidoc", "search.asciidoc", "mapping/params/multi-fields.asciidoc", + "cluster/allocation-explain.asciidoc", + "cluster/get-settings.asciidoc", + "cluster/update-settings.asciidoc", + "health/health.asciidoc", + "cluster/reroute.asciidoc", ]