Skip to content

Adding specification for the new data stream mappings API #4751

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

masseyke
Copy link
Member

@masseyke masseyke commented Jul 1, 2025

This adds specifications for the new data stream mappings APIs.

@masseyke masseyke added specification compiler skip-backport This pull request should not be backported labels Jul 1, 2025
Copy link
Contributor

github-actions bot commented Jul 1, 2025

Following you can find the validation changes for the APIs you have modified.

API Status Request Response
indices.get_data_stream 🔴 117/117 17/117 → 73/117
indices.get_data_stream_mappings 🟠 → 🟢 Missing type → 2/2 Missing type → 2/2
indices.put_data_stream_mappings 🟠 → 🟢 Missing type → 1/1 Missing type → 1/1

You can validate these APIs yourself by using the make validate target.

Copy link
Member

@pquentin pquentin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The API themselves look great, thank you! I do have questions about examples, but am not sure of the answers.

Comment on lines +2 to +24
alternatives:
- language: Python
code: |-
resp = client.indices.get_data_stream_mappings(
name="my-data-stream",
)
- language: JavaScript
code: |-
const response = await client.indices.getDataStreamSettings({
name: "my-data-stream",
});
- language: Ruby
code: |-
response = client.indices.get_data_stream_mappings(
name: "my-data-stream"
)
- language: PHP
code: |-
$resp = $client->indices()->getDataStreamSettings([
"name" => "my-data-stream",
]);
- language: curl
code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_data_stream/my-data-stream/_mappings"'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the alternatives are generated. However a summary (and description if needed) would help.

Comment on lines +17 to +82
alternatives:
- language: Python
code: |-
resp = client.indices.put_data_stream_mappings(
name="my-data-stream",
mappings={
"properties":{
"field1":{
"type":"ip"
},
"field3":{
"type":"text"
}
}
},
)
- language: JavaScript
code: |-
const response = await client.indices.putDataStreamSettings({
name: "my-data-stream",
mappings: {
"properties":{
"field1":{
"type":"ip"
},
"field3":{
"type":"text"
}
}
},
});
- language: Ruby
code: |-
response = client.indices.put_data_stream_mappings(
name: "my-data-stream",
body: {
"properties":{
"field1":{
"type":"ip"
},
"field3":{
"type":"text"
}
}
}
)
- language: PHP
code: |-
$resp = $client->indices()->putDataStreamSettings([
"name" => "my-data-stream",
"body" => [
"properties" => [
"field1" => [
"type" => "ip"
],
"field3" => [
"type" => "text"
]
]
],
]);
- language: curl
code:
'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d
''{"index.lifecycle.name":"new-test-policy","index.number_of_shards":11}''
"$ELASTICSEARCH_URL/_data_stream/my-data-stream/_mappings"'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry that you took the time to do this, but it's generated.

Comment on lines +5 to +6
# type: response
# response_code: 200
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this can be uncommented. Not too familiar with examples to be honest. (I do appreciate that you worked on them!)

Suggested change
# type: response
# response_code: 200
type: response
response_code: 200

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler skip-backport This pull request should not be backported specification
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants