-
Notifications
You must be signed in to change notification settings - Fork 103
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
base: main
Are you sure you want to change the base?
Conversation
Following you can find the validation changes for the APIs you have modified.
You can validate these APIs yourself by using the |
There was a problem hiding this 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.
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"' |
There was a problem hiding this comment.
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.
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"' |
There was a problem hiding this comment.
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.
# type: response | ||
# response_code: 200 |
There was a problem hiding this comment.
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!)
# type: response | |
# response_code: 200 | |
type: response | |
response_code: 200 |
This adds specifications for the new data stream mappings APIs.