Last active
July 21, 2022 08:45
-
-
Save rugyoga/8687db4b2355dcc4d6ad39ce8f429646 to your computer and use it in GitHub Desktop.
Create an ES Point In Time ID
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@spec create(ES.index_t()) :: {:ok, pit_t()} | {:error, ES.response_t()} | |
def create(index) do | |
:post | |
|> HTTP.request(url(index), HTTP.no_payload(), HTTP.json_encoding()) | |
|> HTTP.on_200(& &1["id"]) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment