Skip to content

Commit fc6f865

Browse files
update connector API documentation examples
1 parent f253f1b commit fc6f865

File tree

132 files changed

+409
-747
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

132 files changed

+409
-747
lines changed

Diff for: docs/examples/00fea15cbca83be9d5f1a024ff2ec708.asciidoc

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
// This file is autogenerated, DO NOT EDIT
2-
// inference/service-elasticsearch.asciidoc:111
2+
// inference/service-elasticsearch.asciidoc:93
33

44
[source, python]
55
----
6-
resp = client.perform_request(
7-
"PUT",
8-
"/_inference/text_embedding/my-e5-model",
9-
headers={"Content-Type": "application/json"},
10-
body={
6+
resp = client.inference.put(
7+
task_type="text_embedding",
8+
inference_id="my-e5-model",
9+
inference_config={
1110
"service": "elasticsearch",
1211
"service_settings": {
1312
"num_allocations": 1,

Diff for: docs/examples/04412d11783dac25b5fd2ec5407078a3.asciidoc

+4-8
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,10 @@
33

44
[source, python]
55
----
6-
resp = client.perform_request(
7-
"PUT",
8-
"/_connector/my-connector/_api_key_id",
9-
headers={"Content-Type": "application/json"},
10-
body={
11-
"api_key_id": "my-api-key-id",
12-
"api_key_secret_id": "my-connector-secret-id"
13-
},
6+
resp = client.connector.update_api_key_id(
7+
connector_id="my-connector",
8+
api_key_id="my-api-key-id",
9+
api_key_secret_id="my-connector-secret-id",
1410
)
1511
print(resp)
1612
----

Diff for: docs/examples/04de2e3a9c00c2056b07bf9cf9e63a99.asciidoc

+4-5
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@
33

44
[source, python]
55
----
6-
resp = client.perform_request(
7-
"PUT",
8-
"/_inference/text_embedding/google_vertex_ai_embeddings",
9-
headers={"Content-Type": "application/json"},
10-
body={
6+
resp = client.inference.put(
7+
task_type="text_embedding",
8+
inference_id="google_vertex_ai_embeddings",
9+
inference_config={
1110
"service": "googlevertexai",
1211
"service_settings": {
1312
"service_account_json": "<service_account_json>",

Diff for: docs/examples/09769561f082b50558fb7d8707719963.asciidoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This file is autogenerated, DO NOT EDIT
2-
// cluster/nodes-stats.asciidoc:2578
2+
// cluster/nodes-stats.asciidoc:2434
33

44
[source, python]
55
----

Diff for: docs/examples/09cb1b18bf4033b4afafb25bd3dab12c.asciidoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This file is autogenerated, DO NOT EDIT
2-
// query-dsl/rule-query.asciidoc:65
2+
// query-dsl/rule-query.asciidoc:64
33

44
[source, python]
55
----

Diff for: docs/examples/0ad8edd10542ec2c4d5d8700d7e2ba97.asciidoc

+4-5
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@
33

44
[source, python]
55
----
6-
resp = client.perform_request(
7-
"PUT",
8-
"/_inference/text_embedding/amazon_bedrock_embeddings",
9-
headers={"Content-Type": "application/json"},
10-
body={
6+
resp = client.inference.put(
7+
task_type="text_embedding",
8+
inference_id="amazon_bedrock_embeddings",
9+
inference_config={
1110
"service": "amazonbedrock",
1211
"service_settings": {
1312
"access_key": "<aws_access_key>",

Diff for: docs/examples/0ade87c8cb0e3c188d2e3dce279d5cc2.asciidoc

+20-24
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,26 @@
33

44
[source, python]
55
----
6-
resp = client.perform_request(
7-
"PUT",
8-
"/_connector/my-g-drive-connector/_filtering",
9-
headers={"Content-Type": "application/json"},
10-
body={
11-
"rules": [
12-
{
13-
"field": "file_extension",
14-
"id": "exclude-txt-files",
15-
"order": 0,
16-
"policy": "exclude",
17-
"rule": "equals",
18-
"value": "txt"
19-
},
20-
{
21-
"field": "_",
22-
"id": "DEFAULT",
23-
"order": 1,
24-
"policy": "include",
25-
"rule": "regex",
26-
"value": ".*"
27-
}
28-
]
29-
},
6+
resp = client.connector.update_filtering(
7+
connector_id="my-g-drive-connector",
8+
rules=[
9+
{
10+
"field": "file_extension",
11+
"id": "exclude-txt-files",
12+
"order": 0,
13+
"policy": "exclude",
14+
"rule": "equals",
15+
"value": "txt"
16+
},
17+
{
18+
"field": "_",
19+
"id": "DEFAULT",
20+
"order": 1,
21+
"policy": "include",
22+
"rule": "regex",
23+
"value": ".*"
24+
}
25+
],
3026
)
3127
print(resp)
3228
----

Diff for: docs/examples/0e5d25c7bb738c42d471020d678e2966.asciidoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This file is autogenerated, DO NOT EDIT
2-
// ml/trained-models/apis/start-trained-model-deployment.asciidoc:200
2+
// ml/trained-models/apis/start-trained-model-deployment.asciidoc:173
33

44
[source, python]
55
----

Diff for: docs/examples/10f0c8fed98455c460c374b50ffbb204.asciidoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This file is autogenerated, DO NOT EDIT
2-
// data-streams/lifecycle/tutorial-migrate-data-stream-from-ilm-to-dsl.asciidoc:301
2+
// data-streams/lifecycle/tutorial-migrate-data-stream-from-ilm-to-dsl.asciidoc:299
33

44
[source, python]
55
----

Diff for: docs/examples/13ebcb01ebf1b5d2b5c52739db47e30c.asciidoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This file is autogenerated, DO NOT EDIT
2-
// indices/recovery.asciidoc:179
2+
// indices/recovery.asciidoc:193
33

44
[source, python]
55
----

Diff for: docs/examples/13ecdf99114098c76b050397d9c3d4e6.asciidoc

+4-7
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,10 @@
33

44
[source, python]
55
----
6-
resp = client.perform_request(
7-
"POST",
8-
"/_inference/sparse_embedding/my-elser-model",
9-
headers={"Content-Type": "application/json"},
10-
body={
11-
"input": "The sky above the port was the color of television tuned to a dead channel."
12-
},
6+
resp = client.inference.inference(
7+
task_type="sparse_embedding",
8+
inference_id="my-elser-model",
9+
input="The sky above the port was the color of television tuned to a dead channel.",
1310
)
1411
print(resp)
1512
----

Diff for: docs/examples/14a33c364873c2f930ca83d0a3005389.asciidoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This file is autogenerated, DO NOT EDIT
2-
// troubleshooting/common-issues/disk-usage-exceeded.asciidoc:42
2+
// troubleshooting/common-issues/disk-usage-exceeded.asciidoc:34
33

44
[source, python]
55
----

Diff for: docs/examples/150b5fee5678bf8cdf0932da73eada80.asciidoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This file is autogenerated, DO NOT EDIT
2-
// cluster/nodes-stats.asciidoc:2546
2+
// cluster/nodes-stats.asciidoc:2402
33

44
[source, python]
55
----

Diff for: docs/examples/1736545c8b5674f6d311f3277eb387f1.asciidoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This file is autogenerated, DO NOT EDIT
2-
// data-streams/lifecycle/tutorial-manage-data-stream-retention.asciidoc:128
2+
// data-streams/lifecycle/tutorial-manage-existing-data-stream.asciidoc:30
33

44
[source, python]
55
----

Diff for: docs/examples/19d60e4890cc57151d596326484d9076.asciidoc

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33

44
[source, python]
55
----
6-
resp = client.ingest.delete_geoip_database(
7-
id="my-database-id",
8-
body=None,
6+
resp = client.perform_request(
7+
"DELETE",
8+
"/_ingest/geoip/database/my-database-id",
99
)
1010
print(resp)
1111
----

Diff for: docs/examples/1a56df055b94466ca76818e0858752c6.asciidoc

+4-5
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@
33

44
[source, python]
55
----
6-
resp = client.perform_request(
7-
"PUT",
8-
"/_inference/text_embedding/openai_embeddings",
9-
headers={"Content-Type": "application/json"},
10-
body={
6+
resp = client.inference.put(
7+
task_type="text_embedding",
8+
inference_id="openai_embeddings",
9+
inference_config={
1110
"service": "openai",
1211
"service_settings": {
1312
"api_key": "<api_key>",

Diff for: docs/examples/1a9e03ce0355872a7db27fedc783fbec.asciidoc

+4-5
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@
33

44
[source, python]
55
----
6-
resp = client.perform_request(
7-
"PUT",
8-
"/_inference/rerank/google_vertex_ai_rerank",
9-
headers={"Content-Type": "application/json"},
10-
body={
6+
resp = client.inference.put(
7+
task_type="rerank",
8+
inference_id="google_vertex_ai_rerank",
9+
inference_config={
1110
"service": "googlevertexai",
1211
"service_settings": {
1312
"service_account_json": "<service_account_json>",

Diff for: docs/examples/1b60ad542abb511cbd926ac8c55b609c.asciidoc

-22
This file was deleted.

Diff for: docs/examples/1dadb7efe27b6c0c231eb6535e413bd9.asciidoc

+4-5
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@
33

44
[source, python]
55
----
6-
resp = client.perform_request(
7-
"PUT",
8-
"/_inference/text_embedding/azure_ai_studio_embeddings",
9-
headers={"Content-Type": "application/json"},
10-
body={
6+
resp = client.inference.put(
7+
task_type="text_embedding",
8+
inference_id="azure_ai_studio_embeddings",
9+
inference_config={
1110
"service": "azureaistudio",
1211
"service_settings": {
1312
"api_key": "<api_key>",

Diff for: docs/examples/1e0b85750d4e63ebbc927d4627c44bf8.asciidoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This file is autogenerated, DO NOT EDIT
2-
// how-to/size-your-shards.asciidoc:601
2+
// how-to/size-your-shards.asciidoc:599
33

44
[source, python]
55
----

Diff for: docs/examples/1e26353d546d733634187b8c3a7837a7.asciidoc

+2-6
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,8 @@
33

44
[source, python]
55
----
6-
resp = client.perform_request(
7-
"GET",
8-
"/_connector",
9-
params={
10-
"service_type": "sharepoint_online"
11-
},
6+
resp = client.connector.list(
7+
service_type="sharepoint_online",
128
)
139
print(resp)
1410
----

Diff for: docs/examples/21cd01cb90d3ea1acd0ab22d7edd2c88.asciidoc

+4-5
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@
33

44
[source, python]
55
----
6-
resp = client.perform_request(
7-
"PUT",
8-
"/_inference/text_embedding/azure_ai_studio_embeddings",
9-
headers={"Content-Type": "application/json"},
10-
body={
6+
resp = client.inference.put(
7+
task_type="text_embedding",
8+
inference_id="azure_ai_studio_embeddings",
9+
inference_config={
1110
"service": "azureaistudio",
1211
"service_settings": {
1312
"api_key": "<api_key>",

Diff for: docs/examples/2577acb462b95bd4394523cf2f8a661f.asciidoc

-33
This file was deleted.

Diff for: docs/examples/2826510e4aeb1c0d8dc43d317ed7624a.asciidoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This file is autogenerated, DO NOT EDIT
2-
// mapping/types/boolean.asciidoc:249
2+
// mapping/types/boolean.asciidoc:242
33

44
[source, python]
55
----

Diff for: docs/examples/2e09666d3ad5ad9afc22763ee6e97a2b.asciidoc

-19
This file was deleted.

Diff for: docs/examples/2f98924c3d593ea2b60edb9cef5bee22.asciidoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This file is autogenerated, DO NOT EDIT
2-
// how-to/size-your-shards.asciidoc:483
2+
// how-to/size-your-shards.asciidoc:482
33

44
[source, python]
55
----

0 commit comments

Comments
 (0)