-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add new component template APIs #1458
Add new component template APIs #1458
Conversation
ShardsAcknowledged bool `json:"shards_acknowledged"` | ||
Index string `json:"index,omitempty"` |
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 copied this from indices_delete_index_template.go but I didn't know where to check if these fields can appear in a response (they don't when I do a simple request to the API).
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 guess only theacknowledged
field is filled here, since we do not change something on indices here
ShardsAcknowledged bool `json:"shards_acknowledged"` | ||
Index string `json:"index,omitempty"` |
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.
Same comment as above.
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.
see above
This commit implements the new Component Template APIs which come with the new Index Template APIs as described in https://www.elastic.co/guide/en/elasticsearch/reference/7.9/index-templates.html. Close olivere#1414 Signed-off-by: Yann Soubeyrand <yann.soubeyrand@camptocamp.com>
ae41d53
to
e3d81ff
Compare
@olivere This would be a really nice feature for the terraform provider, could you take a look on this PR, please :) |
} | ||
} | ||
|
||
// Get the component template |
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.
A Test Case for a missing template would be nice :)
ShardsAcknowledged bool `json:"shards_acknowledged"` | ||
Index string `json:"index,omitempty"` |
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 guess only theacknowledged
field is filled here, since we do not change something on indices here
ShardsAcknowledged bool `json:"shards_acknowledged"` | ||
Index string `json:"index,omitempty"` |
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.
see above
@olivere any thoughts on this? |
This is looking really good. Thank you for working on it. Did you check that the request parameters are the ones specified by the REST API? I've seen that contributors often start by copying an existing service but then leave a lot of fields that are actually not allowed for the new service, or miss some that are. It's pretty hard to figure out because some fields are allowed on every service, and are still not specified in the REST API spec for that specific service. It's also worth checking the Java code as the ultimate source of truth, when in doubt. E.g. those |
Hi @olivere, sorry for the delayed answer… I think I did some mistakes on the parameters, since, as you mentioned, it’s hard to find the ultimate source of truth. I’m wondering what’s the status of this project compared to the official Go client for Elasticsearch (https://github.com/elastic/go-elasticsearch)? |
Hi @yann-soubeyrand! The source of trust the the REST API spec. However, they don't spec out the body of the request/response. That's when I look into the Java source. Those With regards to the official Elasticsearch client, I've pinned an issue with my perspective on that. See here. |
This commit implements the Component Template APIs which come with the new Index Template APIs as described in https://www.elastic.co/guide/en/elasticsearch/reference/7.9/index-templates.html. Close olivere#1414
This is an attempt to add the new component template APIs based on the code for the new index template APIs.