Skip to content

Commit 12d0d7a

Browse files
update connector API documentation examples
1 parent f253f1b commit 12d0d7a

File tree

131 files changed

+408
-746
lines changed

Some content is hidden

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

131 files changed

+408
-746
lines changed

docs/examples/00fea15cbca83be9d5f1a024ff2ec708.asciidoc

Lines changed: 5 additions & 6 deletions
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,

docs/examples/04412d11783dac25b5fd2ec5407078a3.asciidoc

Lines changed: 4 additions & 8 deletions
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
----

docs/examples/04de2e3a9c00c2056b07bf9cf9e63a99.asciidoc

Lines changed: 4 additions & 5 deletions
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>",

docs/examples/09769561f082b50558fb7d8707719963.asciidoc

Lines changed: 1 addition & 1 deletion
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
----

docs/examples/09cb1b18bf4033b4afafb25bd3dab12c.asciidoc

Lines changed: 1 addition & 1 deletion
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
----

docs/examples/0ad8edd10542ec2c4d5d8700d7e2ba97.asciidoc

Lines changed: 4 additions & 5 deletions
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>",

docs/examples/0ade87c8cb0e3c188d2e3dce279d5cc2.asciidoc

Lines changed: 20 additions & 24 deletions
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
----

docs/examples/0e5d25c7bb738c42d471020d678e2966.asciidoc

Lines changed: 1 addition & 1 deletion
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
----

docs/examples/10f0c8fed98455c460c374b50ffbb204.asciidoc

Lines changed: 1 addition & 1 deletion
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
----

docs/examples/13ebcb01ebf1b5d2b5c52739db47e30c.asciidoc

Lines changed: 1 addition & 1 deletion
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
----

0 commit comments

Comments
 (0)