From 18379acb42558ed15cfd09a340f04023ab397d02 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Fri, 4 Dec 2026 14:33:08 +0000 Subject: [PATCH] docs(generated): add postIndexInfo examples Generated SDK source code using: - Generator version 3.117.3 - Specification version 1.0.0-dev0.1.41 - Automation (cloudant-sdks) version d56f0ce --- examples/README.md | 42 +++++++++++++++++++ .../snippets/postIndexInfo/example_request.py | 12 ++++++ .../example_request_with_type_and_keys.py | 14 +++++++ 3 files changed, 68 insertions(+) create mode 100644 examples/snippets/postIndexInfo/example_request.py create mode 100644 examples/snippets/postIndexInfo/example_request_with_type_and_keys.py diff --git a/examples/README.md b/examples/README.md index 6670d434..6c64fa84 100644 --- a/examples/README.md +++ b/examples/README.md @@ -1477,6 +1477,48 @@ print(response) # This example will fail if `getUserByName` index doesn't exist. To create the index, see [Create a new index on a database.](#postindex) ``` +## postIndexInfo + +_POST `/{db}/_index_info`_ + +### [Example request](snippets/postIndexInfo/example_request.py) + +[embedmd]:# (snippets/postIndexInfo/example_request.py) +```py +# section: code +from ibmcloudant.cloudant_v1 import CloudantV1 + +service = CloudantV1.new_instance() + +response = service.post_index_info( + db='products' +).get_result() + +print(response) +# section: markdown +# This example requires the `appliances` design document to exist with a Cloudant Search index. To create the design document, see [Create or modify a design document.](#putdesigndocument) +``` + +### [Example request with type and keys](snippets/postIndexInfo/example_request_with_type_and_keys.py) + +[embedmd]:# (snippets/postIndexInfo/example_request_with_type_and_keys.py) +```py +# section: code +from ibmcloudant.cloudant_v1 import CloudantV1 + +service = CloudantV1.new_instance() + +response = service.post_index_info( + db='products', + keys=['_design/appliances'], + type=['search'] +).get_result() + +print(response) +# section: markdown +# This example requires the `appliances` design document to exist with a Cloudant Search index. To create the design document, see [Create or modify a design document.](#putdesigndocument) +``` + ## deleteLocalDocument _DELETE `/{db}/_local/{doc_id}`_ diff --git a/examples/snippets/postIndexInfo/example_request.py b/examples/snippets/postIndexInfo/example_request.py new file mode 100644 index 00000000..b097c288 --- /dev/null +++ b/examples/snippets/postIndexInfo/example_request.py @@ -0,0 +1,12 @@ +# section: code +from ibmcloudant.cloudant_v1 import CloudantV1 + +service = CloudantV1.new_instance() + +response = service.post_index_info( + db='products' +).get_result() + +print(response) +# section: markdown +# This example requires the `appliances` design document to exist with a Cloudant Search index. To create the design document, see [Create or modify a design document.](#putdesigndocument) diff --git a/examples/snippets/postIndexInfo/example_request_with_type_and_keys.py b/examples/snippets/postIndexInfo/example_request_with_type_and_keys.py new file mode 100644 index 00000000..e5078c33 --- /dev/null +++ b/examples/snippets/postIndexInfo/example_request_with_type_and_keys.py @@ -0,0 +1,14 @@ +# section: code +from ibmcloudant.cloudant_v1 import CloudantV1 + +service = CloudantV1.new_instance() + +response = service.post_index_info( + db='products', + keys=['_design/appliances'], + type=['search'] +).get_result() + +print(response) +# section: markdown +# This example requires the `appliances` design document to exist with a Cloudant Search index. To create the design document, see [Create or modify a design document.](#putdesigndocument)