...
If Elastic is installed and runs correctly, you should see something like this
...
Generate an API key in Postman
In order to actually use Elastic, you must generate an API key. This is done using their API.
...
Using Postman this can be done using the following steps
Make a new POST request with the following url http://localhost:9200/_security/api_key
In the Authorization Params tab, chose Basic Auth in the Type dropdown.
Put in the Elastic username and password used the previous steps
In the Body Params tab, chose Rawi in the selection and JSON in the dropdown
Put in the following body
Code Block { "name": "my-api-key" }
Execute the request
This should give you the following response
...
Info |
---|
The API key to use is the encoded key in the response |
Generate an API key in Powershell
Code Block | ||
---|---|---|
| ||
$body = @{
"name" = "my-api-key"
}
$username = "elastic"
$password = ""
$securePwd = ConvertTo-SecureString $password -AsPlainText -Force
$cred = New-Object System.Management.Automation.PSCredential ($username, $securePwd)
$url ="http://localhost:9200/_security/api_key"
Invoke-RestMethod -Method 'Post' -Uri $url -Body ($body|ConvertTo-Json) -ContentType "application/json" -Credential $cred |
...
Insert the API key in the appsettings.json
...