Skip to content

Commit 9d40112

Browse files
Update transform example update (#4998)
Co-authored-by: lcawl <[email protected]>
1 parent fc0c299 commit 9d40112

File tree

6 files changed

+85
-45
lines changed

6 files changed

+85
-45
lines changed

docs/examples/languageExamples.json

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15956,23 +15956,23 @@
1595615956
"specification/transform/update_transform/examples/request/UpdateTransformRequestExample1.yaml": [
1595715957
{
1595815958
"language": "Python",
15959-
"code": "resp = client.transform.update_transform(\n transform_id=\"simple-kibana-ecomm-pivot\",\n source={\n \"index\": \"kibana_sample_data_ecommerce\",\n \"query\": {\n \"term\": {\n \"geoip.continent_name\": {\n \"value\": \"Asia\"\n }\n }\n }\n },\n pivot={\n \"group_by\": {\n \"customer_id\": {\n \"terms\": {\n \"field\": \"customer_id\",\n \"missing_bucket\": True\n }\n }\n },\n \"aggregations\": {\n \"max_price\": {\n \"max\": {\n \"field\": \"taxful_total_price\"\n }\n }\n }\n },\n description=\"Maximum priced ecommerce data by customer_id in Asia\",\n dest={\n \"index\": \"kibana_sample_data_ecommerce_transform1\",\n \"pipeline\": \"add_timestamp_pipeline\"\n },\n frequency=\"5m\",\n sync={\n \"time\": {\n \"field\": \"order_date\",\n \"delay\": \"60s\"\n }\n },\n retention_policy={\n \"time\": {\n \"field\": \"order_date\",\n \"max_age\": \"30d\"\n }\n },\n)"
15959+
"code": "resp = client.transform.update_transform(\n transform_id=\"simple-kibana-ecomm-pivot\",\n source={\n \"index\": \"kibana_sample_data_ecommerce\",\n \"query\": {\n \"term\": {\n \"geoip.continent_name\": {\n \"value\": \"Asia\"\n }\n }\n }\n },\n description=\"Maximum priced ecommerce data by customer_id in Asia\",\n dest={\n \"index\": \"kibana_sample_data_ecommerce_transform_v2\",\n \"pipeline\": \"add_timestamp_pipeline\"\n },\n frequency=\"15m\",\n sync={\n \"time\": {\n \"field\": \"order_date\",\n \"delay\": \"120s\"\n }\n },\n)"
1596015960
},
1596115961
{
1596215962
"language": "JavaScript",
15963-
"code": "const response = await client.transform.updateTransform({\n transform_id: \"simple-kibana-ecomm-pivot\",\n source: {\n index: \"kibana_sample_data_ecommerce\",\n query: {\n term: {\n \"geoip.continent_name\": {\n value: \"Asia\",\n },\n },\n },\n },\n pivot: {\n group_by: {\n customer_id: {\n terms: {\n field: \"customer_id\",\n missing_bucket: true,\n },\n },\n },\n aggregations: {\n max_price: {\n max: {\n field: \"taxful_total_price\",\n },\n },\n },\n },\n description: \"Maximum priced ecommerce data by customer_id in Asia\",\n dest: {\n index: \"kibana_sample_data_ecommerce_transform1\",\n pipeline: \"add_timestamp_pipeline\",\n },\n frequency: \"5m\",\n sync: {\n time: {\n field: \"order_date\",\n delay: \"60s\",\n },\n },\n retention_policy: {\n time: {\n field: \"order_date\",\n max_age: \"30d\",\n },\n },\n});"
15963+
"code": "const response = await client.transform.updateTransform({\n transform_id: \"simple-kibana-ecomm-pivot\",\n source: {\n index: \"kibana_sample_data_ecommerce\",\n query: {\n term: {\n \"geoip.continent_name\": {\n value: \"Asia\",\n },\n },\n },\n },\n description: \"Maximum priced ecommerce data by customer_id in Asia\",\n dest: {\n index: \"kibana_sample_data_ecommerce_transform_v2\",\n pipeline: \"add_timestamp_pipeline\",\n },\n frequency: \"15m\",\n sync: {\n time: {\n field: \"order_date\",\n delay: \"120s\",\n },\n },\n});"
1596415964
},
1596515965
{
1596615966
"language": "Ruby",
15967-
"code": "response = client.transform.update_transform(\n transform_id: \"simple-kibana-ecomm-pivot\",\n body: {\n \"source\": {\n \"index\": \"kibana_sample_data_ecommerce\",\n \"query\": {\n \"term\": {\n \"geoip.continent_name\": {\n \"value\": \"Asia\"\n }\n }\n }\n },\n \"pivot\": {\n \"group_by\": {\n \"customer_id\": {\n \"terms\": {\n \"field\": \"customer_id\",\n \"missing_bucket\": true\n }\n }\n },\n \"aggregations\": {\n \"max_price\": {\n \"max\": {\n \"field\": \"taxful_total_price\"\n }\n }\n }\n },\n \"description\": \"Maximum priced ecommerce data by customer_id in Asia\",\n \"dest\": {\n \"index\": \"kibana_sample_data_ecommerce_transform1\",\n \"pipeline\": \"add_timestamp_pipeline\"\n },\n \"frequency\": \"5m\",\n \"sync\": {\n \"time\": {\n \"field\": \"order_date\",\n \"delay\": \"60s\"\n }\n },\n \"retention_policy\": {\n \"time\": {\n \"field\": \"order_date\",\n \"max_age\": \"30d\"\n }\n }\n }\n)"
15967+
"code": "response = client.transform.update_transform(\n transform_id: \"simple-kibana-ecomm-pivot\",\n body: {\n \"source\": {\n \"index\": \"kibana_sample_data_ecommerce\",\n \"query\": {\n \"term\": {\n \"geoip.continent_name\": {\n \"value\": \"Asia\"\n }\n }\n }\n },\n \"description\": \"Maximum priced ecommerce data by customer_id in Asia\",\n \"dest\": {\n \"index\": \"kibana_sample_data_ecommerce_transform_v2\",\n \"pipeline\": \"add_timestamp_pipeline\"\n },\n \"frequency\": \"15m\",\n \"sync\": {\n \"time\": {\n \"field\": \"order_date\",\n \"delay\": \"120s\"\n }\n }\n }\n)"
1596815968
},
1596915969
{
1597015970
"language": "PHP",
15971-
"code": "$resp = $client->transform()->updateTransform([\n \"transform_id\" => \"simple-kibana-ecomm-pivot\",\n \"body\" => [\n \"source\" => [\n \"index\" => \"kibana_sample_data_ecommerce\",\n \"query\" => [\n \"term\" => [\n \"geoip.continent_name\" => [\n \"value\" => \"Asia\",\n ],\n ],\n ],\n ],\n \"pivot\" => [\n \"group_by\" => [\n \"customer_id\" => [\n \"terms\" => [\n \"field\" => \"customer_id\",\n \"missing_bucket\" => true,\n ],\n ],\n ],\n \"aggregations\" => [\n \"max_price\" => [\n \"max\" => [\n \"field\" => \"taxful_total_price\",\n ],\n ],\n ],\n ],\n \"description\" => \"Maximum priced ecommerce data by customer_id in Asia\",\n \"dest\" => [\n \"index\" => \"kibana_sample_data_ecommerce_transform1\",\n \"pipeline\" => \"add_timestamp_pipeline\",\n ],\n \"frequency\" => \"5m\",\n \"sync\" => [\n \"time\" => [\n \"field\" => \"order_date\",\n \"delay\" => \"60s\",\n ],\n ],\n \"retention_policy\" => [\n \"time\" => [\n \"field\" => \"order_date\",\n \"max_age\" => \"30d\",\n ],\n ],\n ],\n]);"
15971+
"code": "$resp = $client->transform()->updateTransform([\n \"transform_id\" => \"simple-kibana-ecomm-pivot\",\n \"body\" => [\n \"source\" => [\n \"index\" => \"kibana_sample_data_ecommerce\",\n \"query\" => [\n \"term\" => [\n \"geoip.continent_name\" => [\n \"value\" => \"Asia\",\n ],\n ],\n ],\n ],\n \"description\" => \"Maximum priced ecommerce data by customer_id in Asia\",\n \"dest\" => [\n \"index\" => \"kibana_sample_data_ecommerce_transform_v2\",\n \"pipeline\" => \"add_timestamp_pipeline\",\n ],\n \"frequency\" => \"15m\",\n \"sync\" => [\n \"time\" => [\n \"field\" => \"order_date\",\n \"delay\" => \"120s\",\n ],\n ],\n ],\n]);"
1597215972
},
1597315973
{
1597415974
"language": "curl",
15975-
"code": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"source\":{\"index\":\"kibana_sample_data_ecommerce\",\"query\":{\"term\":{\"geoip.continent_name\":{\"value\":\"Asia\"}}}},\"pivot\":{\"group_by\":{\"customer_id\":{\"terms\":{\"field\":\"customer_id\",\"missing_bucket\":true}}},\"aggregations\":{\"max_price\":{\"max\":{\"field\":\"taxful_total_price\"}}}},\"description\":\"Maximum priced ecommerce data by customer_id in Asia\",\"dest\":{\"index\":\"kibana_sample_data_ecommerce_transform1\",\"pipeline\":\"add_timestamp_pipeline\"},\"frequency\":\"5m\",\"sync\":{\"time\":{\"field\":\"order_date\",\"delay\":\"60s\"}},\"retention_policy\":{\"time\":{\"field\":\"order_date\",\"max_age\":\"30d\"}}}' \"$ELASTICSEARCH_URL/_transform/simple-kibana-ecomm-pivot/_update\""
15975+
"code": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"source\":{\"index\":\"kibana_sample_data_ecommerce\",\"query\":{\"term\":{\"geoip.continent_name\":{\"value\":\"Asia\"}}}},\"description\":\"Maximum priced ecommerce data by customer_id in Asia\",\"dest\":{\"index\":\"kibana_sample_data_ecommerce_transform_v2\",\"pipeline\":\"add_timestamp_pipeline\"},\"frequency\":\"15m\",\"sync\":{\"time\":{\"field\":\"order_date\",\"delay\":\"120s\"}}}' \"$ELASTICSEARCH_URL/_transform/simple-kibana-ecomm-pivot/_update\""
1597615976
},
1597715977
{
1597815978
"language": "Java",
@@ -16914,5 +16914,27 @@
1691416914
"language": "Java",
1691516915
"code": "client.cluster().allocationExplain(a -> a\n .currentNode(\"my-node\")\n .index(\"my-index-000001\")\n .primary(false)\n .shard(0)\n);\n"
1691616916
}
16917+
],
16918+
"specification/inference/put_cohere/examples/request/PutCohereRequestExample3.yaml": [
16919+
{
16920+
"language": "Python",
16921+
"code": "resp = client.inference.put(\n task_type=\"completion\",\n inference_id=\"cohere-completion\",\n inference_config={\n \"service\": \"cohere\",\n \"service_settings\": {\n \"api_key\": \"Cohere-API-key\",\n \"model_id\": \"command-a-03-2025\"\n }\n },\n)"
16922+
},
16923+
{
16924+
"language": "JavaScript",
16925+
"code": "const response = await client.inference.put({\n task_type: \"completion\",\n inference_id: \"cohere-completion\",\n inference_config: {\n service: \"cohere\",\n service_settings: {\n api_key: \"Cohere-API-key\",\n model_id: \"command-a-03-2025\",\n },\n },\n});"
16926+
},
16927+
{
16928+
"language": "Ruby",
16929+
"code": "response = client.inference.put(\n task_type: \"completion\",\n inference_id: \"cohere-completion\",\n body: {\n \"service\": \"cohere\",\n \"service_settings\": {\n \"api_key\": \"Cohere-API-key\",\n \"model_id\": \"command-a-03-2025\"\n }\n }\n)"
16930+
},
16931+
{
16932+
"language": "PHP",
16933+
"code": "$resp = $client->inference()->put([\n \"task_type\" => \"completion\",\n \"inference_id\" => \"cohere-completion\",\n \"body\" => [\n \"service\" => \"cohere\",\n \"service_settings\" => [\n \"api_key\" => \"Cohere-API-key\",\n \"model_id\" => \"command-a-03-2025\",\n ],\n ],\n]);"
16934+
},
16935+
{
16936+
"language": "curl",
16937+
"code": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"service\":\"cohere\",\"service_settings\":{\"api_key\":\"Cohere-API-key\",\"model_id\":\"command-a-03-2025\"}}' \"$ELASTICSEARCH_URL/_inference/completion/cohere-completion\""
16938+
}
1691716939
]
1691816940
}

output/openapi/elasticsearch-openapi.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

output/openapi/elasticsearch-serverless-openapi.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)