diff --git a/docs/examples/00fea15cbca83be9d5f1a024ff2ec708.asciidoc b/docs/examples/00fea15cbca83be9d5f1a024ff2ec708.asciidoc index 7862d115f..5920f9712 100644 --- a/docs/examples/00fea15cbca83be9d5f1a024ff2ec708.asciidoc +++ b/docs/examples/00fea15cbca83be9d5f1a024ff2ec708.asciidoc @@ -3,11 +3,10 @@ [source, python] ---- -resp = client.perform_request( - "PUT", - "/_inference/text_embedding/my-e5-model", - headers={"Content-Type": "application/json"}, - body={ +resp = client.inference.put( + task_type="text_embedding", + inference_id="my-e5-model", + inference_config={ "service": "elasticsearch", "service_settings": { "num_allocations": 1, diff --git a/docs/examples/04412d11783dac25b5fd2ec5407078a3.asciidoc b/docs/examples/04412d11783dac25b5fd2ec5407078a3.asciidoc index 9c0b36a2d..639dc270c 100644 --- a/docs/examples/04412d11783dac25b5fd2ec5407078a3.asciidoc +++ b/docs/examples/04412d11783dac25b5fd2ec5407078a3.asciidoc @@ -3,14 +3,10 @@ [source, python] ---- -resp = client.perform_request( - "PUT", - "/_connector/my-connector/_api_key_id", - headers={"Content-Type": "application/json"}, - body={ - "api_key_id": "my-api-key-id", - "api_key_secret_id": "my-connector-secret-id" - }, +resp = client.connector.update_api_key_id( + connector_id="my-connector", + api_key_id="my-api-key-id", + api_key_secret_id="my-connector-secret-id", ) print(resp) ---- diff --git a/docs/examples/04de2e3a9c00c2056b07bf9cf9e63a99.asciidoc b/docs/examples/04de2e3a9c00c2056b07bf9cf9e63a99.asciidoc index 289990ad6..078edad78 100644 --- a/docs/examples/04de2e3a9c00c2056b07bf9cf9e63a99.asciidoc +++ b/docs/examples/04de2e3a9c00c2056b07bf9cf9e63a99.asciidoc @@ -3,11 +3,10 @@ [source, python] ---- -resp = client.perform_request( - "PUT", - "/_inference/text_embedding/google_vertex_ai_embeddings", - headers={"Content-Type": "application/json"}, - body={ +resp = client.inference.put( + task_type="text_embedding", + inference_id="google_vertex_ai_embeddings", + inference_config={ "service": "googlevertexai", "service_settings": { "service_account_json": "", diff --git a/docs/examples/0ad8edd10542ec2c4d5d8700d7e2ba97.asciidoc b/docs/examples/0ad8edd10542ec2c4d5d8700d7e2ba97.asciidoc index 46b85fcc8..67f603109 100644 --- a/docs/examples/0ad8edd10542ec2c4d5d8700d7e2ba97.asciidoc +++ b/docs/examples/0ad8edd10542ec2c4d5d8700d7e2ba97.asciidoc @@ -3,11 +3,10 @@ [source, python] ---- -resp = client.perform_request( - "PUT", - "/_inference/text_embedding/amazon_bedrock_embeddings", - headers={"Content-Type": "application/json"}, - body={ +resp = client.inference.put( + task_type="text_embedding", + inference_id="amazon_bedrock_embeddings", + inference_config={ "service": "amazonbedrock", "service_settings": { "access_key": "", diff --git a/docs/examples/0ade87c8cb0e3c188d2e3dce279d5cc2.asciidoc b/docs/examples/0ade87c8cb0e3c188d2e3dce279d5cc2.asciidoc index 7520852f5..bf81f55e9 100644 --- a/docs/examples/0ade87c8cb0e3c188d2e3dce279d5cc2.asciidoc +++ b/docs/examples/0ade87c8cb0e3c188d2e3dce279d5cc2.asciidoc @@ -3,30 +3,26 @@ [source, python] ---- -resp = client.perform_request( - "PUT", - "/_connector/my-g-drive-connector/_filtering", - headers={"Content-Type": "application/json"}, - body={ - "rules": [ - { - "field": "file_extension", - "id": "exclude-txt-files", - "order": 0, - "policy": "exclude", - "rule": "equals", - "value": "txt" - }, - { - "field": "_", - "id": "DEFAULT", - "order": 1, - "policy": "include", - "rule": "regex", - "value": ".*" - } - ] - }, +resp = client.connector.update_filtering( + connector_id="my-g-drive-connector", + rules=[ + { + "field": "file_extension", + "id": "exclude-txt-files", + "order": 0, + "policy": "exclude", + "rule": "equals", + "value": "txt" + }, + { + "field": "_", + "id": "DEFAULT", + "order": 1, + "policy": "include", + "rule": "regex", + "value": ".*" + } + ], ) print(resp) ---- diff --git a/docs/examples/0ea2167ce7c87d311b20c4f8c698a8d0.asciidoc b/docs/examples/0ea2167ce7c87d311b20c4f8c698a8d0.asciidoc index c1e1b6a99..bbccc1dc4 100644 --- a/docs/examples/0ea2167ce7c87d311b20c4f8c698a8d0.asciidoc +++ b/docs/examples/0ea2167ce7c87d311b20c4f8c698a8d0.asciidoc @@ -1,5 +1,5 @@ // This file is autogenerated, DO NOT EDIT -// search/point-in-time-api.asciidoc:152 +// search/point-in-time-api.asciidoc:190 [source, python] ---- diff --git a/docs/examples/0fb7705ddbf1fc2b65d2de2e00fe5769.asciidoc b/docs/examples/0fb7705ddbf1fc2b65d2de2e00fe5769.asciidoc index e351212f5..5021fce0e 100644 --- a/docs/examples/0fb7705ddbf1fc2b65d2de2e00fe5769.asciidoc +++ b/docs/examples/0fb7705ddbf1fc2b65d2de2e00fe5769.asciidoc @@ -1,5 +1,5 @@ // This file is autogenerated, DO NOT EDIT -// aggregations/metrics/scripted-metric-aggregation.asciidoc:59 +// aggregations/metrics/scripted-metric-aggregation.asciidoc:61 [source, python] ---- diff --git a/docs/examples/13ecdf99114098c76b050397d9c3d4e6.asciidoc b/docs/examples/13ecdf99114098c76b050397d9c3d4e6.asciidoc index 49ce1d72d..fa54e865d 100644 --- a/docs/examples/13ecdf99114098c76b050397d9c3d4e6.asciidoc +++ b/docs/examples/13ecdf99114098c76b050397d9c3d4e6.asciidoc @@ -3,13 +3,10 @@ [source, python] ---- -resp = client.perform_request( - "POST", - "/_inference/sparse_embedding/my-elser-model", - headers={"Content-Type": "application/json"}, - body={ - "input": "The sky above the port was the color of television tuned to a dead channel." - }, +resp = client.inference.inference( + task_type="sparse_embedding", + inference_id="my-elser-model", + input="The sky above the port was the color of television tuned to a dead channel.", ) print(resp) ---- diff --git a/docs/examples/187733e50c60350f3f75921bea3b72c2.asciidoc b/docs/examples/187733e50c60350f3f75921bea3b72c2.asciidoc index 301522fec..718144564 100644 --- a/docs/examples/187733e50c60350f3f75921bea3b72c2.asciidoc +++ b/docs/examples/187733e50c60350f3f75921bea3b72c2.asciidoc @@ -1,5 +1,5 @@ // This file is autogenerated, DO NOT EDIT -// search/search-your-data/paginate-search-results.asciidoc:613 +// search/search-your-data/paginate-search-results.asciidoc:615 [source, python] ---- diff --git a/docs/examples/19d60e4890cc57151d596326484d9076.asciidoc b/docs/examples/19d60e4890cc57151d596326484d9076.asciidoc index ff07af566..62e24dbbd 100644 --- a/docs/examples/19d60e4890cc57151d596326484d9076.asciidoc +++ b/docs/examples/19d60e4890cc57151d596326484d9076.asciidoc @@ -3,9 +3,9 @@ [source, python] ---- -resp = client.ingest.delete_geoip_database( - id="my-database-id", - body=None, +resp = client.perform_request( + "DELETE", + "/_ingest/geoip/database/my-database-id", ) print(resp) ---- diff --git a/docs/examples/1a56df055b94466ca76818e0858752c6.asciidoc b/docs/examples/1a56df055b94466ca76818e0858752c6.asciidoc index 72cc5f18b..e45764af1 100644 --- a/docs/examples/1a56df055b94466ca76818e0858752c6.asciidoc +++ b/docs/examples/1a56df055b94466ca76818e0858752c6.asciidoc @@ -3,11 +3,10 @@ [source, python] ---- -resp = client.perform_request( - "PUT", - "/_inference/text_embedding/openai_embeddings", - headers={"Content-Type": "application/json"}, - body={ +resp = client.inference.put( + task_type="text_embedding", + inference_id="openai_embeddings", + inference_config={ "service": "openai", "service_settings": { "api_key": "", diff --git a/docs/examples/1a9e03ce0355872a7db27fedc783fbec.asciidoc b/docs/examples/1a9e03ce0355872a7db27fedc783fbec.asciidoc index 5e90297fa..e0431da95 100644 --- a/docs/examples/1a9e03ce0355872a7db27fedc783fbec.asciidoc +++ b/docs/examples/1a9e03ce0355872a7db27fedc783fbec.asciidoc @@ -3,11 +3,10 @@ [source, python] ---- -resp = client.perform_request( - "PUT", - "/_inference/rerank/google_vertex_ai_rerank", - headers={"Content-Type": "application/json"}, - body={ +resp = client.inference.put( + task_type="rerank", + inference_id="google_vertex_ai_rerank", + inference_config={ "service": "googlevertexai", "service_settings": { "service_account_json": "", diff --git a/docs/examples/1b60ad542abb511cbd926ac8c55b609c.asciidoc b/docs/examples/1b60ad542abb511cbd926ac8c55b609c.asciidoc index 43c3d6235..4e3a57eb3 100644 --- a/docs/examples/1b60ad542abb511cbd926ac8c55b609c.asciidoc +++ b/docs/examples/1b60ad542abb511cbd926ac8c55b609c.asciidoc @@ -3,11 +3,10 @@ [source, python] ---- -resp = client.perform_request( - "PUT", - "/_inference/sparse_embedding/my-elser-model", - headers={"Content-Type": "application/json"}, - body={ +resp = client.inference.put( + task_type="sparse_embedding", + inference_id="my-elser-model", + inference_config={ "service": "elser", "service_settings": { "adaptive_allocations": { diff --git a/docs/examples/1dadb7efe27b6c0c231eb6535e413bd9.asciidoc b/docs/examples/1dadb7efe27b6c0c231eb6535e413bd9.asciidoc index 164a2f1da..78c452868 100644 --- a/docs/examples/1dadb7efe27b6c0c231eb6535e413bd9.asciidoc +++ b/docs/examples/1dadb7efe27b6c0c231eb6535e413bd9.asciidoc @@ -3,11 +3,10 @@ [source, python] ---- -resp = client.perform_request( - "PUT", - "/_inference/text_embedding/azure_ai_studio_embeddings", - headers={"Content-Type": "application/json"}, - body={ +resp = client.inference.put( + task_type="text_embedding", + inference_id="azure_ai_studio_embeddings", + inference_config={ "service": "azureaistudio", "service_settings": { "api_key": "", diff --git a/docs/examples/1e26353d546d733634187b8c3a7837a7.asciidoc b/docs/examples/1e26353d546d733634187b8c3a7837a7.asciidoc index cd3ed1602..588151968 100644 --- a/docs/examples/1e26353d546d733634187b8c3a7837a7.asciidoc +++ b/docs/examples/1e26353d546d733634187b8c3a7837a7.asciidoc @@ -3,12 +3,8 @@ [source, python] ---- -resp = client.perform_request( - "GET", - "/_connector", - params={ - "service_type": "sharepoint_online" - }, +resp = client.connector.list( + service_type="sharepoint_online", ) print(resp) ---- diff --git a/docs/examples/21cd01cb90d3ea1acd0ab22d7edd2c88.asciidoc b/docs/examples/21cd01cb90d3ea1acd0ab22d7edd2c88.asciidoc index ecacf5b86..00a052e0f 100644 --- a/docs/examples/21cd01cb90d3ea1acd0ab22d7edd2c88.asciidoc +++ b/docs/examples/21cd01cb90d3ea1acd0ab22d7edd2c88.asciidoc @@ -3,11 +3,10 @@ [source, python] ---- -resp = client.perform_request( - "PUT", - "/_inference/text_embedding/azure_ai_studio_embeddings", - headers={"Content-Type": "application/json"}, - body={ +resp = client.inference.put( + task_type="text_embedding", + inference_id="azure_ai_studio_embeddings", + inference_config={ "service": "azureaistudio", "service_settings": { "api_key": "", diff --git a/docs/examples/24f4dfdf9922d5aa79151675b7767742.asciidoc b/docs/examples/24f4dfdf9922d5aa79151675b7767742.asciidoc index b10bdf250..454f46a64 100644 --- a/docs/examples/24f4dfdf9922d5aa79151675b7767742.asciidoc +++ b/docs/examples/24f4dfdf9922d5aa79151675b7767742.asciidoc @@ -1,5 +1,5 @@ // This file is autogenerated, DO NOT EDIT -// search/search-your-data/paginate-search-results.asciidoc:383 +// search/search-your-data/paginate-search-results.asciidoc:385 [source, python] ---- diff --git a/docs/examples/342ddf9121aeddd82fea2464665e25da.asciidoc b/docs/examples/342ddf9121aeddd82fea2464665e25da.asciidoc index ee8f4d450..13694ba05 100644 --- a/docs/examples/342ddf9121aeddd82fea2464665e25da.asciidoc +++ b/docs/examples/342ddf9121aeddd82fea2464665e25da.asciidoc @@ -3,15 +3,11 @@ [source, python] ---- -resp = client.perform_request( - "PUT", - "/_connector/my-connector", - headers={"Content-Type": "application/json"}, - body={ - "index_name": "search-google-drive", - "name": "My Connector", - "service_type": "google_drive" - }, +resp = client.connector.put( + connector_id="my-connector", + index_name="search-google-drive", + name="My Connector", + service_type="google_drive", ) print(resp) ---- diff --git a/docs/examples/3758b8f2ab9f6f28a764ee6c42c85766.asciidoc b/docs/examples/3758b8f2ab9f6f28a764ee6c42c85766.asciidoc index d0744c6b3..0e548f378 100644 --- a/docs/examples/3758b8f2ab9f6f28a764ee6c42c85766.asciidoc +++ b/docs/examples/3758b8f2ab9f6f28a764ee6c42c85766.asciidoc @@ -1,5 +1,5 @@ // This file is autogenerated, DO NOT EDIT -// search/search-your-data/paginate-search-results.asciidoc:548 +// search/search-your-data/paginate-search-results.asciidoc:550 [source, python] ---- diff --git a/docs/examples/398389933901b572a06a752bc780af7c.asciidoc b/docs/examples/398389933901b572a06a752bc780af7c.asciidoc index 88dffad44..8855fa937 100644 --- a/docs/examples/398389933901b572a06a752bc780af7c.asciidoc +++ b/docs/examples/398389933901b572a06a752bc780af7c.asciidoc @@ -3,11 +3,10 @@ [source, python] ---- -resp = client.perform_request( - "PUT", - "/_inference/completion/anthropic_completion", - headers={"Content-Type": "application/json"}, - body={ +resp = client.inference.put( + task_type="completion", + inference_id="anthropic_completion", + inference_config={ "service": "anthropic", "service_settings": { "api_key": "", diff --git a/docs/examples/3b6718257421b5419bf4cd6a7303c57e.asciidoc b/docs/examples/3b6718257421b5419bf4cd6a7303c57e.asciidoc index 5ed3bb861..0bea327f3 100644 --- a/docs/examples/3b6718257421b5419bf4cd6a7303c57e.asciidoc +++ b/docs/examples/3b6718257421b5419bf4cd6a7303c57e.asciidoc @@ -3,9 +3,9 @@ [source, python] ---- -resp = client.ingest.get_geoip_database( - id="my-database-id", - body=None, +resp = client.perform_request( + "GET", + "/_ingest/geoip/database/my-database-id", ) print(resp) ---- diff --git a/docs/examples/41175d304e660da2931764f9a4418fd3.asciidoc b/docs/examples/41175d304e660da2931764f9a4418fd3.asciidoc index 82cd2a533..d58c99075 100644 --- a/docs/examples/41175d304e660da2931764f9a4418fd3.asciidoc +++ b/docs/examples/41175d304e660da2931764f9a4418fd3.asciidoc @@ -3,17 +3,13 @@ [source, python] ---- -resp = client.perform_request( - "PUT", - "/_connector/my-connector/_pipeline", - headers={"Content-Type": "application/json"}, - body={ - "pipeline": { - "extract_binary_content": True, - "name": "my-connector-pipeline", - "reduce_whitespace": True, - "run_ml_inference": True - } +resp = client.connector.update_pipeline( + connector_id="my-connector", + pipeline={ + "extract_binary_content": True, + "name": "my-connector-pipeline", + "reduce_whitespace": True, + "run_ml_inference": True }, ) print(resp) diff --git a/docs/examples/430705509f8367aef92be413f702520b.asciidoc b/docs/examples/430705509f8367aef92be413f702520b.asciidoc index 864b49004..2bf5117b8 100644 --- a/docs/examples/430705509f8367aef92be413f702520b.asciidoc +++ b/docs/examples/430705509f8367aef92be413f702520b.asciidoc @@ -3,13 +3,9 @@ [source, python] ---- -resp = client.perform_request( - "PUT", - "/_connector/my-connector/_status", - headers={"Content-Type": "application/json"}, - body={ - "status": "needs_configuration" - }, +resp = client.connector.update_status( + connector_id="my-connector", + status="needs_configuration", ) print(resp) ---- diff --git a/docs/examples/4342ccf6cc24fd80bd3cd1f9a4c2ef8e.asciidoc b/docs/examples/4342ccf6cc24fd80bd3cd1f9a4c2ef8e.asciidoc index 65a28ff70..ea2dda1ee 100644 --- a/docs/examples/4342ccf6cc24fd80bd3cd1f9a4c2ef8e.asciidoc +++ b/docs/examples/4342ccf6cc24fd80bd3cd1f9a4c2ef8e.asciidoc @@ -1,5 +1,5 @@ // This file is autogenerated, DO NOT EDIT -// search/search-your-data/paginate-search-results.asciidoc:513 +// search/search-your-data/paginate-search-results.asciidoc:515 [source, python] ---- diff --git a/docs/examples/47909e194d10743093f4a22c27a85925.asciidoc b/docs/examples/47909e194d10743093f4a22c27a85925.asciidoc index 9f07d4aa6..845b3e147 100644 --- a/docs/examples/47909e194d10743093f4a22c27a85925.asciidoc +++ b/docs/examples/47909e194d10743093f4a22c27a85925.asciidoc @@ -1,5 +1,5 @@ // This file is autogenerated, DO NOT EDIT -// search/search-your-data/paginate-search-results.asciidoc:196 +// search/search-your-data/paginate-search-results.asciidoc:198 [source, python] ---- diff --git a/docs/examples/4c9350ed09b28f00e297ebe73c3b95a2.asciidoc b/docs/examples/4c9350ed09b28f00e297ebe73c3b95a2.asciidoc index 591c0e3dd..587eacec5 100644 --- a/docs/examples/4c9350ed09b28f00e297ebe73c3b95a2.asciidoc +++ b/docs/examples/4c9350ed09b28f00e297ebe73c3b95a2.asciidoc @@ -3,11 +3,10 @@ [source, python] ---- -resp = client.perform_request( - "PUT", - "/_inference/text_embedding/my-msmarco-minilm-model", - headers={"Content-Type": "application/json"}, - body={ +resp = client.inference.put( + task_type="text_embedding", + inference_id="my-msmarco-minilm-model", + inference_config={ "service": "elasticsearch", "service_settings": { "num_allocations": 1, diff --git a/docs/examples/4e3414fc712b16311f9e433dd366f49d.asciidoc b/docs/examples/4e3414fc712b16311f9e433dd366f49d.asciidoc index 750523d85..0335ed397 100644 --- a/docs/examples/4e3414fc712b16311f9e433dd366f49d.asciidoc +++ b/docs/examples/4e3414fc712b16311f9e433dd366f49d.asciidoc @@ -3,9 +3,9 @@ [source, python] ---- -resp = client.perform_request( - "DELETE", - "/_inference/sparse_embedding/my-elser-model", +resp = client.inference.delete( + task_type="sparse_embedding", + inference_id="my-elser-model", ) print(resp) ---- diff --git a/docs/examples/4e50d9d25bfb07ac73e3a2be5d2fbbf7.asciidoc b/docs/examples/4e50d9d25bfb07ac73e3a2be5d2fbbf7.asciidoc index 46f659edd..59b09c26e 100644 --- a/docs/examples/4e50d9d25bfb07ac73e3a2be5d2fbbf7.asciidoc +++ b/docs/examples/4e50d9d25bfb07ac73e3a2be5d2fbbf7.asciidoc @@ -1,5 +1,5 @@ // This file is autogenerated, DO NOT EDIT -// search/search-your-data/paginate-search-results.asciidoc:227 +// search/search-your-data/paginate-search-results.asciidoc:229 [source, python] ---- diff --git a/docs/examples/533087d787b48878a0bf3fa8d0851b64.asciidoc b/docs/examples/533087d787b48878a0bf3fa8d0851b64.asciidoc index aa736cebc..ee9fdaefd 100644 --- a/docs/examples/533087d787b48878a0bf3fa8d0851b64.asciidoc +++ b/docs/examples/533087d787b48878a0bf3fa8d0851b64.asciidoc @@ -3,9 +3,9 @@ [source, python] ---- -resp = client.ingest.delete_geoip_database( - id="example-database-id", - body=None, +resp = client.perform_request( + "DELETE", + "/_ingest/geoip/database/example-database-id", ) print(resp) ---- diff --git a/docs/examples/59d736a4d064ed2013c7ead8e32e0998.asciidoc b/docs/examples/59d736a4d064ed2013c7ead8e32e0998.asciidoc index 9ede943ca..f825daf85 100644 --- a/docs/examples/59d736a4d064ed2013c7ead8e32e0998.asciidoc +++ b/docs/examples/59d736a4d064ed2013c7ead8e32e0998.asciidoc @@ -3,11 +3,10 @@ [source, python] ---- -resp = client.perform_request( - "PUT", - "/_inference/completion/openai-completion", - headers={"Content-Type": "application/json"}, - body={ +resp = client.inference.put( + task_type="completion", + inference_id="openai-completion", + inference_config={ "service": "openai", "service_settings": { "api_key": "", diff --git a/docs/examples/640621cea39cdeeb76fbc95bff31a18d.asciidoc b/docs/examples/640621cea39cdeeb76fbc95bff31a18d.asciidoc index 914efe79c..7d20c7a29 100644 --- a/docs/examples/640621cea39cdeeb76fbc95bff31a18d.asciidoc +++ b/docs/examples/640621cea39cdeeb76fbc95bff31a18d.asciidoc @@ -3,22 +3,18 @@ [source, python] ---- -resp = client.perform_request( - "PUT", - "/_connector/my-connector/_last_sync", - headers={"Content-Type": "application/json"}, - body={ - "last_access_control_sync_error": "Houston, we have a problem!", - "last_access_control_sync_scheduled_at": "2023-11-09T15:13:08.231Z", - "last_access_control_sync_status": "pending", - "last_deleted_document_count": 42, - "last_incremental_sync_scheduled_at": "2023-11-09T15:13:08.231Z", - "last_indexed_document_count": 42, - "last_sync_error": "Houston, we have a problem!", - "last_sync_scheduled_at": "2024-11-09T15:13:08.231Z", - "last_sync_status": "completed", - "last_synced": "2024-11-09T15:13:08.231Z" - }, +resp = client.connector.last_sync( + connector_id="my-connector", + last_access_control_sync_error="Houston, we have a problem!", + last_access_control_sync_scheduled_at="2023-11-09T15:13:08.231Z", + last_access_control_sync_status="pending", + last_deleted_document_count=42, + last_incremental_sync_scheduled_at="2023-11-09T15:13:08.231Z", + last_indexed_document_count=42, + last_sync_error="Houston, we have a problem!", + last_sync_scheduled_at="2024-11-09T15:13:08.231Z", + last_sync_status="completed", + last_synced="2024-11-09T15:13:08.231Z", ) print(resp) ---- diff --git a/docs/examples/6606d46685d10377b996b5f20f1229b5.asciidoc b/docs/examples/6606d46685d10377b996b5f20f1229b5.asciidoc index 0c832ccaa..9e0132018 100644 --- a/docs/examples/6606d46685d10377b996b5f20f1229b5.asciidoc +++ b/docs/examples/6606d46685d10377b996b5f20f1229b5.asciidoc @@ -3,13 +3,9 @@ [source, python] ---- -resp = client.perform_request( - "PUT", - "/_connector/my-connector/_index_name", - headers={"Content-Type": "application/json"}, - body={ - "index_name": "data-from-my-google-drive" - }, +resp = client.connector.update_index_name( + connector_id="my-connector", + index_name="data-from-my-google-drive", ) print(resp) ---- diff --git a/docs/examples/6636701d31b0c9eb8316f1f8e99cc918.asciidoc b/docs/examples/6636701d31b0c9eb8316f1f8e99cc918.asciidoc index 1afa9ad3b..afbe3f43f 100644 --- a/docs/examples/6636701d31b0c9eb8316f1f8e99cc918.asciidoc +++ b/docs/examples/6636701d31b0c9eb8316f1f8e99cc918.asciidoc @@ -1,5 +1,5 @@ // This file is autogenerated, DO NOT EDIT -// aggregations/metrics/scripted-metric-aggregation.asciidoc:15 +// aggregations/metrics/scripted-metric-aggregation.asciidoc:17 [source, python] ---- diff --git a/docs/examples/6ddd4e657efbf45def430a6419825796.asciidoc b/docs/examples/6ddd4e657efbf45def430a6419825796.asciidoc index bfa47bf60..b7861383a 100644 --- a/docs/examples/6ddd4e657efbf45def430a6419825796.asciidoc +++ b/docs/examples/6ddd4e657efbf45def430a6419825796.asciidoc @@ -3,11 +3,10 @@ [source, python] ---- -resp = client.perform_request( - "PUT", - "/_inference/completion/azure_ai_studio_completion", - headers={"Content-Type": "application/json"}, - body={ +resp = client.inference.put( + task_type="completion", + inference_id="azure_ai_studio_completion", + inference_config={ "service": "azureaistudio", "service_settings": { "api_key": "", diff --git a/docs/examples/72beebe779a258c225dee7b023e60c52.asciidoc b/docs/examples/72beebe779a258c225dee7b023e60c52.asciidoc index ce6925d22..4b0eeca27 100644 --- a/docs/examples/72beebe779a258c225dee7b023e60c52.asciidoc +++ b/docs/examples/72beebe779a258c225dee7b023e60c52.asciidoc @@ -1,5 +1,5 @@ // This file is autogenerated, DO NOT EDIT -// search/point-in-time-api.asciidoc:108 +// search/point-in-time-api.asciidoc:146 [source, python] ---- diff --git a/docs/examples/7429b16221fe741fd31b0584786dd0b0.asciidoc b/docs/examples/7429b16221fe741fd31b0584786dd0b0.asciidoc index 51787a870..a124435ab 100644 --- a/docs/examples/7429b16221fe741fd31b0584786dd0b0.asciidoc +++ b/docs/examples/7429b16221fe741fd31b0584786dd0b0.asciidoc @@ -3,15 +3,12 @@ [source, python] ---- -resp = client.perform_request( - "POST", - "/_inference/text_embedding/my-cohere-endpoint", - headers={"Content-Type": "application/json"}, - body={ - "input": "The sky above the port was the color of television tuned to a dead channel.", - "task_settings": { - "input_type": "ingest" - } +resp = client.inference.inference( + task_type="text_embedding", + inference_id="my-cohere-endpoint", + input="The sky above the port was the color of television tuned to a dead channel.", + task_settings={ + "input_type": "ingest" }, ) print(resp) diff --git a/docs/examples/7594a9a85c8511701e281974cbc253e1.asciidoc b/docs/examples/7594a9a85c8511701e281974cbc253e1.asciidoc index 3487ecc69..5341b6947 100644 --- a/docs/examples/7594a9a85c8511701e281974cbc253e1.asciidoc +++ b/docs/examples/7594a9a85c8511701e281974cbc253e1.asciidoc @@ -3,11 +3,10 @@ [source, python] ---- -resp = client.perform_request( - "PUT", - "/_inference/text_embedding/amazon_bedrock_embeddings", - headers={"Content-Type": "application/json"}, - body={ +resp = client.inference.put( + task_type="text_embedding", + inference_id="amazon_bedrock_embeddings", + inference_config={ "service": "amazonbedrock", "service_settings": { "access_key": "", diff --git a/docs/examples/75e360d03fb416f0a65ca37c662c2e9c.asciidoc b/docs/examples/75e360d03fb416f0a65ca37c662c2e9c.asciidoc index ba108824b..4cccf15fc 100644 --- a/docs/examples/75e360d03fb416f0a65ca37c662c2e9c.asciidoc +++ b/docs/examples/75e360d03fb416f0a65ca37c662c2e9c.asciidoc @@ -1,5 +1,5 @@ // This file is autogenerated, DO NOT EDIT -// aggregations/metrics/scripted-metric-aggregation.asciidoc:155 +// aggregations/metrics/scripted-metric-aggregation.asciidoc:157 [source, python] ---- diff --git a/docs/examples/7752b677825523bfb0c38ad9325a6d47.asciidoc b/docs/examples/7752b677825523bfb0c38ad9325a6d47.asciidoc index c4779aee5..3d71c943a 100644 --- a/docs/examples/7752b677825523bfb0c38ad9325a6d47.asciidoc +++ b/docs/examples/7752b677825523bfb0c38ad9325a6d47.asciidoc @@ -3,12 +3,9 @@ [source, python] ---- -resp = client.perform_request( - "DELETE", - "/_connector/another-connector", - params={ - "delete_sync_jobs": "true" - }, +resp = client.connector.delete( + connector_id="another-connector", + delete_sync_jobs=True, ) print(resp) ---- diff --git a/docs/examples/77b90f6787195767b6da60d8532714b4.asciidoc b/docs/examples/77b90f6787195767b6da60d8532714b4.asciidoc index 6f22e60d0..5590d6b84 100644 --- a/docs/examples/77b90f6787195767b6da60d8532714b4.asciidoc +++ b/docs/examples/77b90f6787195767b6da60d8532714b4.asciidoc @@ -3,11 +3,10 @@ [source, python] ---- -resp = client.perform_request( - "PUT", - "/_inference/text_embedding/azure_openai_embeddings", - headers={"Content-Type": "application/json"}, - body={ +resp = client.inference.put( + task_type="text_embedding", + inference_id="azure_openai_embeddings", + inference_config={ "service": "azureopenai", "service_settings": { "api_key": "", diff --git a/docs/examples/7846974b47a3eab1832a475663d23ad9.asciidoc b/docs/examples/7846974b47a3eab1832a475663d23ad9.asciidoc index c0dd53dea..0fc04cfc2 100644 --- a/docs/examples/7846974b47a3eab1832a475663d23ad9.asciidoc +++ b/docs/examples/7846974b47a3eab1832a475663d23ad9.asciidoc @@ -1,5 +1,5 @@ // This file is autogenerated, DO NOT EDIT -// search/search-your-data/paginate-search-results.asciidoc:290 +// search/search-your-data/paginate-search-results.asciidoc:292 [source, python] ---- diff --git a/docs/examples/82844ef45e11c0eece100d3109db3182.asciidoc b/docs/examples/82844ef45e11c0eece100d3109db3182.asciidoc index f615b1bec..9c30a4e8e 100644 --- a/docs/examples/82844ef45e11c0eece100d3109db3182.asciidoc +++ b/docs/examples/82844ef45e11c0eece100d3109db3182.asciidoc @@ -3,11 +3,10 @@ [source, python] ---- -resp = client.perform_request( - "PUT", - "/_inference/completion/amazon_bedrock_completion", - headers={"Content-Type": "application/json"}, - body={ +resp = client.inference.put( + task_type="completion", + inference_id="amazon_bedrock_completion", + inference_config={ "service": "amazonbedrock", "service_settings": { "access_key": "", diff --git a/docs/examples/840f8c863c30b04abcf2dd66b846f157.asciidoc b/docs/examples/840f8c863c30b04abcf2dd66b846f157.asciidoc index 5bdb2ee0d..e8bba377d 100644 --- a/docs/examples/840f8c863c30b04abcf2dd66b846f157.asciidoc +++ b/docs/examples/840f8c863c30b04abcf2dd66b846f157.asciidoc @@ -3,11 +3,10 @@ [source, python] ---- -resp = client.perform_request( - "PUT", - "/_inference/text_embedding/my-e5-model", - headers={"Content-Type": "application/json"}, - body={ +resp = client.inference.put( + task_type="text_embedding", + inference_id="my-e5-model", + inference_config={ "service": "elasticsearch", "service_settings": { "adaptive_allocations": { diff --git a/docs/examples/8566f5ecf4ae14802ba63c8cc7c629f8.asciidoc b/docs/examples/8566f5ecf4ae14802ba63c8cc7c629f8.asciidoc index cd0ac925d..eb4f786fd 100644 --- a/docs/examples/8566f5ecf4ae14802ba63c8cc7c629f8.asciidoc +++ b/docs/examples/8566f5ecf4ae14802ba63c8cc7c629f8.asciidoc @@ -3,11 +3,10 @@ [source, python] ---- -resp = client.perform_request( - "PUT", - "/_inference/text_embedding/mistral_embeddings", - headers={"Content-Type": "application/json"}, - body={ +resp = client.inference.put( + task_type="text_embedding", + inference_id="mistral_embeddings", + inference_config={ "service": "mistral", "service_settings": { "api_key": "", diff --git a/docs/examples/8619bd17bbfe33490b1f277007f654db.asciidoc b/docs/examples/8619bd17bbfe33490b1f277007f654db.asciidoc index 87fc32989..57c7e9c05 100644 --- a/docs/examples/8619bd17bbfe33490b1f277007f654db.asciidoc +++ b/docs/examples/8619bd17bbfe33490b1f277007f654db.asciidoc @@ -3,11 +3,10 @@ [source, python] ---- -resp = client.perform_request( - "PUT", - "/_inference/rerank/cohere-rerank", - headers={"Content-Type": "application/json"}, - body={ +resp = client.inference.put( + task_type="rerank", + inference_id="cohere-rerank", + inference_config={ "service": "cohere", "service_settings": { "api_key": "", diff --git a/docs/examples/8e89fee0be6a436c4e3d7c152659c47e.asciidoc b/docs/examples/8e89fee0be6a436c4e3d7c152659c47e.asciidoc index 80d0c7fcf..5d065d20d 100644 --- a/docs/examples/8e89fee0be6a436c4e3d7c152659c47e.asciidoc +++ b/docs/examples/8e89fee0be6a436c4e3d7c152659c47e.asciidoc @@ -3,24 +3,20 @@ [source, python] ---- -resp = client.perform_request( - "PUT", - "/_connector/my-connector/_scheduling", - headers={"Content-Type": "application/json"}, - body={ - "scheduling": { - "access_control": { - "enabled": True, - "interval": "0 10 0 * * ?" - }, - "full": { - "enabled": True, - "interval": "0 20 0 * * ?" - }, - "incremental": { - "enabled": False, - "interval": "0 30 0 * * ?" - } +resp = client.connector.update_scheduling( + connector_id="my-connector", + scheduling={ + "access_control": { + "enabled": True, + "interval": "0 10 0 * * ?" + }, + "full": { + "enabled": True, + "interval": "0 20 0 * * ?" + }, + "incremental": { + "enabled": False, + "interval": "0 30 0 * * ?" } }, ) diff --git a/docs/examples/981b331db1404b39c1a612a135e4e76d.asciidoc b/docs/examples/981b331db1404b39c1a612a135e4e76d.asciidoc index 332548060..6f3574e63 100644 --- a/docs/examples/981b331db1404b39c1a612a135e4e76d.asciidoc +++ b/docs/examples/981b331db1404b39c1a612a135e4e76d.asciidoc @@ -3,8 +3,10 @@ [source, python] ---- -resp = client.ingest.put_geoip_database( - id="my-database-id", +resp = client.perform_request( + "PUT", + "/_ingest/geoip/database/my-database-id", + headers={"Content-Type": "application/json"}, body={ "name": "GeoIP2-Domain", "maxmind": { diff --git a/docs/examples/99803d7b111b862c0c82e9908e549b16.asciidoc b/docs/examples/99803d7b111b862c0c82e9908e549b16.asciidoc index 518de3b0d..ceee23cce 100644 --- a/docs/examples/99803d7b111b862c0c82e9908e549b16.asciidoc +++ b/docs/examples/99803d7b111b862c0c82e9908e549b16.asciidoc @@ -3,11 +3,10 @@ [source, python] ---- -resp = client.perform_request( - "PUT", - "/_inference/text_embedding/mistral-embeddings-test", - headers={"Content-Type": "application/json"}, - body={ +resp = client.inference.put( + task_type="text_embedding", + inference_id="mistral-embeddings-test", + inference_config={ "service": "mistral", "service_settings": { "api_key": "", diff --git a/docs/examples/9a203aae3e1412d919546276fb52a5ca.asciidoc b/docs/examples/9a203aae3e1412d919546276fb52a5ca.asciidoc index a048e8fd6..57789d3dd 100644 --- a/docs/examples/9a203aae3e1412d919546276fb52a5ca.asciidoc +++ b/docs/examples/9a203aae3e1412d919546276fb52a5ca.asciidoc @@ -3,11 +3,10 @@ [source, python] ---- -resp = client.perform_request( - "PUT", - "/_inference/text_embedding/cohere-embeddings", - headers={"Content-Type": "application/json"}, - body={ +resp = client.inference.put( + task_type="text_embedding", + inference_id="cohere-embeddings", + inference_config={ "service": "cohere", "service_settings": { "api_key": "", diff --git a/docs/examples/9c021836acf7c0370e289f611325868d.asciidoc b/docs/examples/9c021836acf7c0370e289f611325868d.asciidoc index 4816fda40..9fc291d61 100644 --- a/docs/examples/9c021836acf7c0370e289f611325868d.asciidoc +++ b/docs/examples/9c021836acf7c0370e289f611325868d.asciidoc @@ -3,18 +3,14 @@ [source, python] ---- -resp = client.perform_request( - "PUT", - "/_connector/my-spo-connector/_configuration", - headers={"Content-Type": "application/json"}, - body={ - "values": { - "tenant_id": "my-tenant-id", - "tenant_name": "my-sharepoint-site", - "client_id": "foo", - "secret_value": "bar", - "site_collections": "*" - } +resp = client.connector.update_configuration( + connector_id="my-spo-connector", + values={ + "tenant_id": "my-tenant-id", + "tenant_name": "my-sharepoint-site", + "client_id": "foo", + "secret_value": "bar", + "site_collections": "*" }, ) print(resp) diff --git a/docs/examples/9f16fca9813304e398ee052aa857dbcd.asciidoc b/docs/examples/9f16fca9813304e398ee052aa857dbcd.asciidoc index 03bb2e03f..f56b0349b 100644 --- a/docs/examples/9f16fca9813304e398ee052aa857dbcd.asciidoc +++ b/docs/examples/9f16fca9813304e398ee052aa857dbcd.asciidoc @@ -3,11 +3,10 @@ [source, python] ---- -resp = client.perform_request( - "PUT", - "/_inference/text_embedding/openai-embeddings", - headers={"Content-Type": "application/json"}, - body={ +resp = client.inference.put( + task_type="text_embedding", + inference_id="openai-embeddings", + inference_config={ "service": "openai", "service_settings": { "api_key": "", diff --git a/docs/examples/9ff9b2a73419a6c82f17a358b4991499.asciidoc b/docs/examples/9ff9b2a73419a6c82f17a358b4991499.asciidoc index c8ce35cb5..6a64b2870 100644 --- a/docs/examples/9ff9b2a73419a6c82f17a358b4991499.asciidoc +++ b/docs/examples/9ff9b2a73419a6c82f17a358b4991499.asciidoc @@ -1,5 +1,5 @@ // This file is autogenerated, DO NOT EDIT -// search/point-in-time-api.asciidoc:121 +// search/point-in-time-api.asciidoc:159 [source, python] ---- diff --git a/docs/examples/a225fc8c134cb21a85bc6025dac9368b.asciidoc b/docs/examples/a225fc8c134cb21a85bc6025dac9368b.asciidoc index 2a1d0ea96..073a56a4e 100644 --- a/docs/examples/a225fc8c134cb21a85bc6025dac9368b.asciidoc +++ b/docs/examples/a225fc8c134cb21a85bc6025dac9368b.asciidoc @@ -3,11 +3,10 @@ [source, python] ---- -resp = client.perform_request( - "PUT", - "/_inference/sparse_embedding/elser_embeddings", - headers={"Content-Type": "application/json"}, - body={ +resp = client.inference.put( + task_type="sparse_embedding", + inference_id="elser_embeddings", + inference_config={ "service": "elser", "service_settings": { "num_allocations": 1, diff --git a/docs/examples/a4a3c3cd09efa75168dab90105afb2e9.asciidoc b/docs/examples/a4a3c3cd09efa75168dab90105afb2e9.asciidoc index bd6ce3af8..cc4db4e1d 100644 --- a/docs/examples/a4a3c3cd09efa75168dab90105afb2e9.asciidoc +++ b/docs/examples/a4a3c3cd09efa75168dab90105afb2e9.asciidoc @@ -3,9 +3,9 @@ [source, python] ---- -resp = client.perform_request( - "GET", - "/_inference/sparse_embedding/my-elser-model", +resp = client.inference.get( + task_type="sparse_embedding", + inference_id="my-elser-model", ) print(resp) ---- diff --git a/docs/examples/a4ee2214d621bcfaf768c46d21325958.asciidoc b/docs/examples/a4ee2214d621bcfaf768c46d21325958.asciidoc index 88a2ad691..7c2c97f72 100644 --- a/docs/examples/a4ee2214d621bcfaf768c46d21325958.asciidoc +++ b/docs/examples/a4ee2214d621bcfaf768c46d21325958.asciidoc @@ -3,11 +3,10 @@ [source, python] ---- -resp = client.perform_request( - "PUT", - "/_inference/text_embedding/hugging_face_embeddings", - headers={"Content-Type": "application/json"}, - body={ +resp = client.inference.put( + task_type="text_embedding", + inference_id="hugging_face_embeddings", + inference_config={ "service": "hugging_face", "service_settings": { "api_key": "", diff --git a/docs/examples/a594f05459d9eecc8050c73fc8da336f.asciidoc b/docs/examples/a594f05459d9eecc8050c73fc8da336f.asciidoc index a06fb32f3..c714c6bd4 100644 --- a/docs/examples/a594f05459d9eecc8050c73fc8da336f.asciidoc +++ b/docs/examples/a594f05459d9eecc8050c73fc8da336f.asciidoc @@ -3,11 +3,10 @@ [source, python] ---- -resp = client.perform_request( - "PUT", - "/_inference/text_embedding/azure_openai_embeddings", - headers={"Content-Type": "application/json"}, - body={ +resp = client.inference.put( + task_type="text_embedding", + inference_id="azure_openai_embeddings", + inference_config={ "service": "azureopenai", "service_settings": { "api_key": "", diff --git a/docs/examples/a960b43e720b4934edb74ab4b085ca77.asciidoc b/docs/examples/a960b43e720b4934edb74ab4b085ca77.asciidoc index 961cadca5..6bf107489 100644 --- a/docs/examples/a960b43e720b4934edb74ab4b085ca77.asciidoc +++ b/docs/examples/a960b43e720b4934edb74ab4b085ca77.asciidoc @@ -3,9 +3,6 @@ [source, python] ---- -resp = client.perform_request( - "GET", - "/_connector", -) +resp = client.connector.list() print(resp) ---- diff --git a/docs/examples/add240aa149d8b11139947502b279ee0.asciidoc b/docs/examples/add240aa149d8b11139947502b279ee0.asciidoc index 1eb49e7e3..eee73448f 100644 --- a/docs/examples/add240aa149d8b11139947502b279ee0.asciidoc +++ b/docs/examples/add240aa149d8b11139947502b279ee0.asciidoc @@ -1,5 +1,5 @@ // This file is autogenerated, DO NOT EDIT -// search/search-your-data/paginate-search-results.asciidoc:401 +// search/search-your-data/paginate-search-results.asciidoc:403 [source, python] ---- diff --git a/docs/examples/b16700002af3aa70639f3e88c733bf35.asciidoc b/docs/examples/b16700002af3aa70639f3e88c733bf35.asciidoc new file mode 100644 index 000000000..7667385c2 --- /dev/null +++ b/docs/examples/b16700002af3aa70639f3e88c733bf35.asciidoc @@ -0,0 +1,12 @@ +// This file is autogenerated, DO NOT EDIT +// search/point-in-time-api.asciidoc:95 + +[source, python] +---- +resp = client.open_point_in_time( + index="my-index-000001", + keep_alive="1m", + allow_partial_search_results=True, +) +print(resp) +---- diff --git a/docs/examples/b45a8c6fc746e9c90fd181e69a605fad.asciidoc b/docs/examples/b45a8c6fc746e9c90fd181e69a605fad.asciidoc index 99bdebfba..9b704644e 100644 --- a/docs/examples/b45a8c6fc746e9c90fd181e69a605fad.asciidoc +++ b/docs/examples/b45a8c6fc746e9c90fd181e69a605fad.asciidoc @@ -3,13 +3,10 @@ [source, python] ---- -resp = client.perform_request( - "POST", - "/_inference/completion/openai_chat_completions", - headers={"Content-Type": "application/json"}, - body={ - "input": "What is Elastic?" - }, +resp = client.inference.inference( + task_type="completion", + inference_id="openai_chat_completions", + input="What is Elastic?", ) print(resp) ---- diff --git a/docs/examples/b94cee0f74f57742b3948f9b784dfdd4.asciidoc b/docs/examples/b94cee0f74f57742b3948f9b784dfdd4.asciidoc index d682836ca..fca964943 100644 --- a/docs/examples/b94cee0f74f57742b3948f9b784dfdd4.asciidoc +++ b/docs/examples/b94cee0f74f57742b3948f9b784dfdd4.asciidoc @@ -1,5 +1,5 @@ // This file is autogenerated, DO NOT EDIT -// search/search-your-data/paginate-search-results.asciidoc:535 +// search/search-your-data/paginate-search-results.asciidoc:537 [source, python] ---- diff --git a/docs/examples/bdb671866e2f0195f8dfbdb7f20bf591.asciidoc b/docs/examples/bdb671866e2f0195f8dfbdb7f20bf591.asciidoc index 214ea3e71..f398c9d7c 100644 --- a/docs/examples/bdb671866e2f0195f8dfbdb7f20bf591.asciidoc +++ b/docs/examples/bdb671866e2f0195f8dfbdb7f20bf591.asciidoc @@ -3,11 +3,10 @@ [source, python] ---- -resp = client.perform_request( - "PUT", - "/_inference/sparse_embedding/my-elser-endpoint", - headers={"Content-Type": "application/json"}, - body={ +resp = client.inference.put( + task_type="sparse_embedding", + inference_id="my-elser-endpoint", + inference_config={ "service": "elser", "service_settings": { "num_allocations": 1, diff --git a/docs/examples/c00c9412609832ebceb9e786dd9542df.asciidoc b/docs/examples/c00c9412609832ebceb9e786dd9542df.asciidoc index 81fdc7ab7..ea55b13c7 100644 --- a/docs/examples/c00c9412609832ebceb9e786dd9542df.asciidoc +++ b/docs/examples/c00c9412609832ebceb9e786dd9542df.asciidoc @@ -3,14 +3,10 @@ [source, python] ---- -resp = client.perform_request( - "PUT", - "/_connector/my-connector/_name", - headers={"Content-Type": "application/json"}, - body={ - "name": "Custom connector", - "description": "This is my customized connector" - }, +resp = client.connector.update_name( + connector_id="my-connector", + name="Custom connector", + description="This is my customized connector", ) print(resp) ---- diff --git a/docs/examples/c0ddfb2e6315f5bcf0d3ef414b5bbed3.asciidoc b/docs/examples/c0ddfb2e6315f5bcf0d3ef414b5bbed3.asciidoc index 9e160d106..d005a58f0 100644 --- a/docs/examples/c0ddfb2e6315f5bcf0d3ef414b5bbed3.asciidoc +++ b/docs/examples/c0ddfb2e6315f5bcf0d3ef414b5bbed3.asciidoc @@ -3,14 +3,10 @@ [source, python] ---- -resp = client.perform_request( - "PUT", - "/_connector/my-spo-connector/_configuration", - headers={"Content-Type": "application/json"}, - body={ - "values": { - "secret_value": "foo-bar" - } +resp = client.connector.update_configuration( + connector_id="my-spo-connector", + values={ + "secret_value": "foo-bar" }, ) print(resp) diff --git a/docs/examples/c18100d62ed31bc9e05f62900156e6a8.asciidoc b/docs/examples/c18100d62ed31bc9e05f62900156e6a8.asciidoc index 55999d278..0be644e92 100644 --- a/docs/examples/c18100d62ed31bc9e05f62900156e6a8.asciidoc +++ b/docs/examples/c18100d62ed31bc9e05f62900156e6a8.asciidoc @@ -3,12 +3,8 @@ [source, python] ---- -resp = client.perform_request( - "GET", - "/_connector", - params={ - "index_name": "search-google-drive" - }, +resp = client.connector.list( + index_name="search-google-drive", ) print(resp) ---- diff --git a/docs/examples/c21eb4bc30087188241cbba6b6b89999.asciidoc b/docs/examples/c21eb4bc30087188241cbba6b6b89999.asciidoc index 8bd13a945..f2ad14f33 100644 --- a/docs/examples/c21eb4bc30087188241cbba6b6b89999.asciidoc +++ b/docs/examples/c21eb4bc30087188241cbba6b6b89999.asciidoc @@ -3,13 +3,9 @@ [source, python] ---- -resp = client.perform_request( - "PUT", - "/_connector/my-connector/_service_type", - headers={"Content-Type": "application/json"}, - body={ - "service_type": "sharepoint_online" - }, +resp = client.connector.update_service_type( + connector_id="my-connector", + service_type="sharepoint_online", ) print(resp) ---- diff --git a/docs/examples/c2c21e2824fbf6b7198ede30419da82b.asciidoc b/docs/examples/c2c21e2824fbf6b7198ede30419da82b.asciidoc index 9cc582462..1f047c0e7 100644 --- a/docs/examples/c2c21e2824fbf6b7198ede30419da82b.asciidoc +++ b/docs/examples/c2c21e2824fbf6b7198ede30419da82b.asciidoc @@ -1,5 +1,5 @@ // This file is autogenerated, DO NOT EDIT -// search/search-your-data/paginate-search-results.asciidoc:527 +// search/search-your-data/paginate-search-results.asciidoc:529 [source, python] ---- diff --git a/docs/examples/ce13afc0c976c5e1f424b58e0c97fd64.asciidoc b/docs/examples/ce13afc0c976c5e1f424b58e0c97fd64.asciidoc index 13cd662a9..bb8f5780c 100644 --- a/docs/examples/ce13afc0c976c5e1f424b58e0c97fd64.asciidoc +++ b/docs/examples/ce13afc0c976c5e1f424b58e0c97fd64.asciidoc @@ -3,17 +3,13 @@ [source, python] ---- -resp = client.perform_request( - "PUT", - "/_connector/my-connector", - headers={"Content-Type": "application/json"}, - body={ - "index_name": "search-google-drive", - "name": "My Connector", - "description": "My Connector to sync data to Elastic index from Google Drive", - "service_type": "google_drive", - "language": "english" - }, +resp = client.connector.put( + connector_id="my-connector", + index_name="search-google-drive", + name="My Connector", + description="My Connector to sync data to Elastic index from Google Drive", + service_type="google_drive", + language="english", ) print(resp) ---- diff --git a/docs/examples/cedb56a71cc743d80263ce352bb21720.asciidoc b/docs/examples/cedb56a71cc743d80263ce352bb21720.asciidoc index dbd041aa7..9f552c719 100644 --- a/docs/examples/cedb56a71cc743d80263ce352bb21720.asciidoc +++ b/docs/examples/cedb56a71cc743d80263ce352bb21720.asciidoc @@ -3,11 +3,10 @@ [source, python] ---- -resp = client.perform_request( - "PUT", - "/_inference/sparse_embedding/my-elser-model", - headers={"Content-Type": "application/json"}, - body={ +resp = client.inference.put( + task_type="sparse_embedding", + inference_id="my-elser-model", + inference_config={ "service": "elser", "service_settings": { "num_allocations": 1, diff --git a/docs/examples/d03139a851888db53f8b7affd85eb495.asciidoc b/docs/examples/d03139a851888db53f8b7affd85eb495.asciidoc index d032f16a1..15826f686 100644 --- a/docs/examples/d03139a851888db53f8b7affd85eb495.asciidoc +++ b/docs/examples/d03139a851888db53f8b7affd85eb495.asciidoc @@ -3,9 +3,8 @@ [source, python] ---- -resp = client.perform_request( - "PUT", - "/_connector/my-connector/_check_in", +resp = client.connector.check_in( + connector_id="my-connector", ) print(resp) ---- diff --git a/docs/examples/d5dcddc6398b473b6ad9bce5c6adf986.asciidoc b/docs/examples/d5dcddc6398b473b6ad9bce5c6adf986.asciidoc index d306117a8..a432416ab 100644 --- a/docs/examples/d5dcddc6398b473b6ad9bce5c6adf986.asciidoc +++ b/docs/examples/d5dcddc6398b473b6ad9bce5c6adf986.asciidoc @@ -1,5 +1,5 @@ // This file is autogenerated, DO NOT EDIT -// search/search-your-data/paginate-search-results.asciidoc:433 +// search/search-your-data/paginate-search-results.asciidoc:435 [source, python] ---- diff --git a/docs/examples/d6a21afa4a94b9baa734eac430940bcf.asciidoc b/docs/examples/d6a21afa4a94b9baa734eac430940bcf.asciidoc index 0b6e6686f..c7fca7b67 100644 --- a/docs/examples/d6a21afa4a94b9baa734eac430940bcf.asciidoc +++ b/docs/examples/d6a21afa4a94b9baa734eac430940bcf.asciidoc @@ -3,13 +3,9 @@ [source, python] ---- -resp = client.perform_request( - "GET", - "/_connector", - params={ - "from": "0", - "size": "2" - }, +resp = client.connector.list( + from_="0", + size="2", ) print(resp) ---- diff --git a/docs/examples/d7b61bfb6adb22986a43388b823894cc.asciidoc b/docs/examples/d7b61bfb6adb22986a43388b823894cc.asciidoc index 6f5b953a0..6c74ad761 100644 --- a/docs/examples/d7b61bfb6adb22986a43388b823894cc.asciidoc +++ b/docs/examples/d7b61bfb6adb22986a43388b823894cc.asciidoc @@ -3,11 +3,10 @@ [source, python] ---- -resp = client.perform_request( - "PUT", - "/_inference/text_embedding/cohere_embeddings", - headers={"Content-Type": "application/json"}, - body={ +resp = client.inference.put( + task_type="text_embedding", + inference_id="cohere_embeddings", + inference_config={ "service": "cohere", "service_settings": { "api_key": "", diff --git a/docs/examples/e9fc47015922d51c2b05e502ce9c622e.asciidoc b/docs/examples/e9fc47015922d51c2b05e502ce9c622e.asciidoc index 4bcce83e4..1e857e8bf 100644 --- a/docs/examples/e9fc47015922d51c2b05e502ce9c622e.asciidoc +++ b/docs/examples/e9fc47015922d51c2b05e502ce9c622e.asciidoc @@ -3,11 +3,10 @@ [source, python] ---- -resp = client.perform_request( - "PUT", - "/_inference/completion/google_ai_studio_completion", - headers={"Content-Type": "application/json"}, - body={ +resp = client.inference.put( + task_type="completion", + inference_id="google_ai_studio_completion", + inference_config={ "service": "googleaistudio", "service_settings": { "api_key": "", diff --git a/docs/examples/eb54506fbc71a7d250e86b22d0600114.asciidoc b/docs/examples/eb54506fbc71a7d250e86b22d0600114.asciidoc index 4d9246f3a..e4e933248 100644 --- a/docs/examples/eb54506fbc71a7d250e86b22d0600114.asciidoc +++ b/docs/examples/eb54506fbc71a7d250e86b22d0600114.asciidoc @@ -3,12 +3,8 @@ [source, python] ---- -resp = client.perform_request( - "GET", - "/_connector", - params={ - "service_type": "sharepoint_online,google_drive" - }, +resp = client.connector.list( + service_type="sharepoint_online,google_drive", ) print(resp) ---- diff --git a/docs/examples/eb96d7dd5f3116a50f7a86b729f1a934.asciidoc b/docs/examples/eb96d7dd5f3116a50f7a86b729f1a934.asciidoc index 0b825b148..8f52a9370 100644 --- a/docs/examples/eb96d7dd5f3116a50f7a86b729f1a934.asciidoc +++ b/docs/examples/eb96d7dd5f3116a50f7a86b729f1a934.asciidoc @@ -3,16 +3,12 @@ [source, python] ---- -resp = client.perform_request( - "PUT", - "/_connector/my-connector/_scheduling", - headers={"Content-Type": "application/json"}, - body={ - "scheduling": { - "full": { - "enabled": True, - "interval": "0 10 0 * * ?" - } +resp = client.connector.update_scheduling( + connector_id="my-connector", + scheduling={ + "full": { + "enabled": True, + "interval": "0 10 0 * * ?" } }, ) diff --git a/docs/examples/ecfd0d94dd14ef05dfa861f22544b388.asciidoc b/docs/examples/ecfd0d94dd14ef05dfa861f22544b388.asciidoc index 1542e8268..39218d68e 100644 --- a/docs/examples/ecfd0d94dd14ef05dfa861f22544b388.asciidoc +++ b/docs/examples/ecfd0d94dd14ef05dfa861f22544b388.asciidoc @@ -3,13 +3,9 @@ [source, python] ---- -resp = client.perform_request( - "PUT", - "/_connector/my-connector/_error", - headers={"Content-Type": "application/json"}, - body={ - "error": "Houston, we have a problem!" - }, +resp = client.connector.update_error( + connector_id="my-connector", + error="Houston, we have a problem!", ) print(resp) ---- diff --git a/docs/examples/eee6110831c08b9c1b3f56b24656e95b.asciidoc b/docs/examples/eee6110831c08b9c1b3f56b24656e95b.asciidoc index 4002e58ff..a342f7ada 100644 --- a/docs/examples/eee6110831c08b9c1b3f56b24656e95b.asciidoc +++ b/docs/examples/eee6110831c08b9c1b3f56b24656e95b.asciidoc @@ -3,11 +3,10 @@ [source, python] ---- -resp = client.perform_request( - "PUT", - "/_inference/text_embedding/hugging-face-embeddings", - headers={"Content-Type": "application/json"}, - body={ +resp = client.inference.put( + task_type="text_embedding", + inference_id="hugging-face-embeddings", + inference_config={ "service": "hugging_face", "service_settings": { "api_key": "", diff --git a/docs/examples/f1b24217b1d9ba6ea5e4fa6e6f412022.asciidoc b/docs/examples/f1b24217b1d9ba6ea5e4fa6e6f412022.asciidoc index 9da7e218d..2464c2786 100644 --- a/docs/examples/f1b24217b1d9ba6ea5e4fa6e6f412022.asciidoc +++ b/docs/examples/f1b24217b1d9ba6ea5e4fa6e6f412022.asciidoc @@ -3,22 +3,19 @@ [source, python] ---- -resp = client.perform_request( - "POST", - "/_inference/rerank/cohere_rerank", - headers={"Content-Type": "application/json"}, - body={ - "input": [ - "luke", - "like", - "leia", - "chewy", - "r2d2", - "star", - "wars" - ], - "query": "star wars main character" - }, +resp = client.inference.inference( + task_type="rerank", + inference_id="cohere_rerank", + input=[ + "luke", + "like", + "leia", + "chewy", + "r2d2", + "star", + "wars" + ], + query="star wars main character", ) print(resp) ---- diff --git a/docs/examples/f2a5f77f929cc7b893b80f4bd5b1a192.asciidoc b/docs/examples/f2a5f77f929cc7b893b80f4bd5b1a192.asciidoc index 420e990ca..5f93f7a79 100644 --- a/docs/examples/f2a5f77f929cc7b893b80f4bd5b1a192.asciidoc +++ b/docs/examples/f2a5f77f929cc7b893b80f4bd5b1a192.asciidoc @@ -3,9 +3,8 @@ [source, python] ---- -resp = client.perform_request( - "GET", - "/_connector/my-connector", +resp = client.connector.get( + connector_id="my-connector", ) print(resp) ---- diff --git a/docs/examples/f57ce7de0946e9416ddb9150e95f4b74.asciidoc b/docs/examples/f57ce7de0946e9416ddb9150e95f4b74.asciidoc index eb39c2d70..47691a06e 100644 --- a/docs/examples/f57ce7de0946e9416ddb9150e95f4b74.asciidoc +++ b/docs/examples/f57ce7de0946e9416ddb9150e95f4b74.asciidoc @@ -3,11 +3,10 @@ [source, python] ---- -resp = client.perform_request( - "PUT", - "/_inference/completion/azure_openai_completion", - headers={"Content-Type": "application/json"}, - body={ +resp = client.inference.put( + task_type="completion", + inference_id="azure_openai_completion", + inference_config={ "service": "azureopenai", "service_settings": { "api_key": "", diff --git a/docs/examples/fd620f09dbce62c6f0f603a366623607.asciidoc b/docs/examples/fd620f09dbce62c6f0f603a366623607.asciidoc index 38b7603ab..c8d98272a 100644 --- a/docs/examples/fd620f09dbce62c6f0f603a366623607.asciidoc +++ b/docs/examples/fd620f09dbce62c6f0f603a366623607.asciidoc @@ -3,22 +3,18 @@ [source, python] ---- -resp = client.perform_request( - "PUT", - "/_connector/my-sql-connector/_filtering", - headers={"Content-Type": "application/json"}, - body={ - "advanced_snippet": { - "value": [ - { - "tables": [ - "users", - "orders" - ], - "query": "SELECT users.id AS id, orders.order_id AS order_id FROM users JOIN orders ON users.id = orders.user_id" - } - ] - } +resp = client.connector.update_filtering( + connector_id="my-sql-connector", + advanced_snippet={ + "value": [ + { + "tables": [ + "users", + "orders" + ], + "query": "SELECT users.id AS id, orders.order_id AS order_id FROM users JOIN orders ON users.id = orders.user_id" + } + ] }, ) print(resp) diff --git a/utils/generate-docs-examples/package-lock.json b/utils/generate-docs-examples/package-lock.json index 775320851..f482f91c6 100644 --- a/utils/generate-docs-examples/package-lock.json +++ b/utils/generate-docs-examples/package-lock.json @@ -7,7 +7,7 @@ "": { "name": "generate-docs-examples", "version": "1.0.0", - "license": "ISC", + "license": "Apache-2.0", "dependencies": { "@elastic/request-converter": "^8.15.2", "minimist": "^1.2.6", @@ -17,9 +17,9 @@ } }, "node_modules/@elastic/request-converter": { - "version": "8.15.3", - "resolved": "https://registry.npmjs.org/@elastic/request-converter/-/request-converter-8.15.3.tgz", - "integrity": "sha512-sUhVQReQ1VPn4qRlsYyjDOp340LZxYmaQCcu1HgKSYr1NR7pdSUhbSxmEbl/sH4HXh7Avq4bRf14vBvtHi19kA==", + "version": "8.15.4", + "resolved": "https://registry.npmjs.org/@elastic/request-converter/-/request-converter-8.15.4.tgz", + "integrity": "sha512-iZDQpZpygV+AVOweaDzTsMJBfa2hwwduPXNNzk/yTXgC9qtjmns/AjehtLStKXs274+u3fg+BFxVt6NcMwUAAg==", "dependencies": { "child-process-promise": "^2.2.1", "commander": "^12.1.0",