elasticsearch
An Elasticsearch module designed for development and CI purposes only.
Installation
dagger install github.com/mgreau/daggerverse/elasticsearch@v0.3.0
Entrypoint
Return Type
Elasticsearch !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
version | String ! | "8.13.2" | No description provided |
javaOpts | String ! | "-Xms4g -Xms4g" | No description provided |
port | Integer ! | 9200 | No description provided |
mode | String ! | "dev" | No description provided |
curl | Container | - | An OCI-compatible container, also known as a Docker container. |
Example
dagger -m github.com/mgreau/daggerverse/elasticsearch@b7342b4f4f3b49a0ea6036d7bea58dc7749c4839 call \
--version string --java-opts string --port integer --mode string
func (m *myModule) example(version string, javaOpts string, port int, mode string) *Elasticsearch {
return dag.
Elasticsearch(version, javaOpts, port, mode)
}
@function
def example(version: str, java_opts: str, port: int, mode: str, ) -> dag.Elasticsearch:
return (
dag.elasticsearch(version, java_opts, port, mode)
)
@func()
example(version: string, javaOpts: string, port: number, mode: string, ): Elasticsearch {
return dag
.elasticsearch(version, javaOpts, port, mode)
}
Types
Elasticsearch 🔗
port() 🔗
Return Type
Integer !
Example
dagger -m github.com/mgreau/daggerverse/elasticsearch@b7342b4f4f3b49a0ea6036d7bea58dc7749c4839 call \
--version string --java-opts string --port integer --mode string port
func (m *myModule) example(ctx context.Context, version string, javaOpts string, port int, mode string) int {
return dag.
Elasticsearch(version, javaOpts, port, mode).
Port(ctx)
}
@function
async def example(version: str, java_opts: str, port: int, mode: str, ) -> int:
return await (
dag.elasticsearch(version, java_opts, port, mode)
.port()
)
@func()
async example(version: string, javaOpts: string, port: number, mode: string, ): Promise<number> {
return dag
.elasticsearch(version, javaOpts, port, mode)
.port()
}
mode() 🔗
Return Type
String !
Example
dagger -m github.com/mgreau/daggerverse/elasticsearch@b7342b4f4f3b49a0ea6036d7bea58dc7749c4839 call \
--version string --java-opts string --port integer --mode string mode
func (m *myModule) example(ctx context.Context, version string, javaOpts string, port int, mode string) string {
return dag.
Elasticsearch(version, javaOpts, port, mode).
Mode(ctx)
}
@function
async def example(version: str, java_opts: str, port: int, mode: str, ) -> str:
return await (
dag.elasticsearch(version, java_opts, port, mode)
.mode()
)
@func()
async example(version: string, javaOpts: string, port: number, mode: string, ): Promise<string> {
return dag
.elasticsearch(version, javaOpts, port, mode)
.mode()
}
service() 🔗
Create an Elasticsearch service in dev mode by default
Return Type
Service !
Example
dagger -m github.com/mgreau/daggerverse/elasticsearch@b7342b4f4f3b49a0ea6036d7bea58dc7749c4839 call \
--version string --java-opts string --port integer --mode string service
func (m *myModule) example(version string, javaOpts string, port int, mode string) *Service {
return dag.
Elasticsearch(version, javaOpts, port, mode).
Service()
}
@function
def example(version: str, java_opts: str, port: int, mode: str, ) -> dagger.Service:
return (
dag.elasticsearch(version, java_opts, port, mode)
.service()
)
@func()
example(version: string, javaOpts: string, port: number, mode: string, ): Service {
return dag
.elasticsearch(version, javaOpts, port, mode)
.service()
}
get() 🔗
Sends a GET request to the ES service and returns the response.
dagger call –version 8.13.2 get –path=“_cat/indices?v”
Return Type
String !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
path | String ! | "" | No description provided |
Example
dagger -m github.com/mgreau/daggerverse/elasticsearch@b7342b4f4f3b49a0ea6036d7bea58dc7749c4839 call \
--version string --java-opts string --port integer --mode string get --path string
func (m *myModule) example(ctx context.Context, version string, javaOpts string, port int, mode string, path string) string {
return dag.
Elasticsearch(version, javaOpts, port, mode).
Get(ctx, path)
}
@function
async def example(version: str, java_opts: str, port: int, mode: str, path: str) -> str:
return await (
dag.elasticsearch(version, java_opts, port, mode)
.get(path)
)
@func()
async example(version: string, javaOpts: string, port: number, mode: string, path: string): Promise<string> {
return dag
.elasticsearch(version, javaOpts, port, mode)
.get(path)
}
delete() 🔗
Delete an Elasticsearch index.
example: dagger call delete –index=“movies”
Return Type
String !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
index | String ! | "" | No description provided |
Example
dagger -m github.com/mgreau/daggerverse/elasticsearch@b7342b4f4f3b49a0ea6036d7bea58dc7749c4839 call \
--version string --java-opts string --port integer --mode string delete --index string
func (m *myModule) example(ctx context.Context, version string, javaOpts string, port int, mode string, index string) string {
return dag.
Elasticsearch(version, javaOpts, port, mode).
Delete(ctx, index)
}
@function
async def example(version: str, java_opts: str, port: int, mode: str, index: str) -> str:
return await (
dag.elasticsearch(version, java_opts, port, mode)
.delete(index)
)
@func()
async example(version: string, javaOpts: string, port: number, mode: string, index: string): Promise<string> {
return dag
.elasticsearch(version, javaOpts, port, mode)
.delete(index)
}
indexData() 🔗
Index documents into Elasticsearch.
exampple: dagger call index-data –index=“movies” –data ./datasets/movies.json
It automatically formats the JSON data into the ES bulk format. Doc: https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html#docs-bulk
Return Type
String !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
data | File ! | - | A file. |
index | String ! | "my-index" | No description provided |
Example
dagger -m github.com/mgreau/daggerverse/elasticsearch@b7342b4f4f3b49a0ea6036d7bea58dc7749c4839 call \
--version string --java-opts string --port integer --mode string index-data --data file:path --index string
func (m *myModule) example(ctx context.Context, version string, javaOpts string, port int, mode string, data *File, index string) string {
return dag.
Elasticsearch(version, javaOpts, port, mode).
IndexData(ctx, data, index)
}
@function
async def example(version: str, java_opts: str, port: int, mode: str, data: dagger.File, index: str) -> str:
return await (
dag.elasticsearch(version, java_opts, port, mode)
.index_data(data, index)
)
@func()
async example(version: string, javaOpts: string, port: number, mode: string, data: File, index: string): Promise<string> {
return dag
.elasticsearch(version, javaOpts, port, mode)
.indexData(data, index)
}
search() 🔗
Returns search hits that match the query defined in the request.
example: dagger call search –index=“movies” –field=“title” –query=“Inception”
Return Type
String !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
index | String ! | "" | No description provided |
field | String ! | "" | No description provided |
query | String ! | "" | No description provided |
Example
dagger -m github.com/mgreau/daggerverse/elasticsearch@b7342b4f4f3b49a0ea6036d7bea58dc7749c4839 call \
--version string --java-opts string --port integer --mode string search --index string --field string --query string
func (m *myModule) example(ctx context.Context, version string, javaOpts string, port int, mode string, index string, field string, query string) string {
return dag.
Elasticsearch(version, javaOpts, port, mode).
Search(ctx, index, field, query)
}
@function
async def example(version: str, java_opts: str, port: int, mode: str, index: str, field: str, query: str) -> str:
return await (
dag.elasticsearch(version, java_opts, port, mode)
.search(index, field, query)
)
@func()
async example(version: string, javaOpts: string, port: number, mode: string, index: string, field: string, query: string): Promise<string> {
return dag
.elasticsearch(version, javaOpts, port, mode)
.search(index, field, query)
}