Skip to content

Instantly share code, notes, and snippets.

@rugyoga
Last active July 21, 2022 08:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rugyoga/8687db4b2355dcc4d6ad39ce8f429646 to your computer and use it in GitHub Desktop.
Save rugyoga/8687db4b2355dcc4d6ad39ce8f429646 to your computer and use it in GitHub Desktop.
Create an ES Point In Time ID
@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