A plugin for loading data into an OpenSearch-compatible instance.
During the development of this plugin it is useful to start a local Elasticsearch via:
docker compose -f docker-compose-dev.yaml up -d
and stop it again via:
docker compose -f docker-compose-dev.yaml down -v
The tests of this plugin are split up into unit
and integration
tests located in
Run all unit tests via:
# Run all unit tests
python -m unittest tests.unit.test_opensearch_plugin
Running all integration tests can be run either
- using a running a local Elasticsearch as described in Development and then execute the tests via
# Run all integration tests
python -m unittest tests.integration.test_opensearch_plugin
- using the docker-compose.yaml and run
# the --abort-on-container-exit ensures a `docker compose down` after the tests have run
docker compose -f docker-compose.yaml up --abort-on-container-exit
Note: Make sure to docker compose down
and remove the volume after one run as there is currently no cleanup done.
Load data into opensearch compatible instance
Type: | scope | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Root object: | DocumentRequest | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Properties | bulk_upload_list (
reference[BulkUploadObject] ] |
Name: | bulk upload list | ||||
---|---|---|---|---|---|
Description: | The list of objects for the bulk upload operation. | ||||
Required: | Yes | ||||
Type: | list[ | ||||
List items
|
default_index (string
)
Name: | index |
---|---|
Description: | Name of the default index that will receive the data. |
Required: | Yes |
Type: | string |
Minimum length: | 1 |
metadata (map[string
,any
]
)
string
,any
]Name: | metadata | ||
---|---|---|---|
Description: | Optional global metadata object that will be added to every document. | ||
Required: | No | ||
Type: | map[ | ||
Key type
| |||
Value type
|
password (string
)
Name: | password |
---|---|
Description: | The password for the given user. |
Required: | No |
Type: | string |
tls_verify (bool
)
Name: | TLS verify |
---|---|
Description: | For development and testing purposes, this can be set to False to disable TLS verification for connections to Opensearch-compatible services. |
Required: | No |
Default (JSON encoded): |
|
Type: | bool |
url (string
)
Name: | url |
---|---|
Description: | The URL for the Opensearch-compatible instance. |
Required: | Yes |
Type: | string |
username (string
)
Name: | username |
---|---|
Description: | A username for an authorized user for the given Opensearch-compatible instance. |
Required: | No |
Type: | string |
Minimum length: | 1 |
Objects
BulkUploadObject (object
)
Type: | object | ||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Properties | data (
string ,any ] |
Name: | data | ||
---|---|---|---|
Description: | The JSON data document to upload to your index. | ||
Required: | Yes | ||
Type: | map[ | ||
Key type
| |||
Value type
|
operation (map[string
,reference[OperationMeta]
]
)
string
,reference[OperationMeta]
]Name: | operation | ||||
---|---|---|---|---|---|
Description: | The operation type and associated operation metadata. | ||||
Required: | Yes | ||||
Type: | map[ | ||||
Key type
| |||||
Value type
|
DocumentRequest (object
)
Type: | object | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Properties | bulk_upload_list (
reference[BulkUploadObject] ] |
Name: | bulk upload list | ||||
---|---|---|---|---|---|
Description: | The list of objects for the bulk upload operation. | ||||
Required: | Yes | ||||
Type: | list[ | ||||
List items
|
default_index (string
)
Name: | index |
---|---|
Description: | Name of the default index that will receive the data. |
Required: | Yes |
Type: | string |
Minimum length: | 1 |
metadata (map[string
,any
]
)
string
,any
]Name: | metadata | ||
---|---|---|---|
Description: | Optional global metadata object that will be added to every document. | ||
Required: | No | ||
Type: | map[ | ||
Key type
| |||
Value type
|
password (string
)
Name: | password |
---|---|
Description: | The password for the given user. |
Required: | No |
Type: | string |
tls_verify (bool
)
Name: | TLS verify |
---|---|
Description: | For development and testing purposes, this can be set to False to disable TLS verification for connections to Opensearch-compatible services. |
Required: | No |
Default (JSON encoded): |
|
Type: | bool |
url (string
)
Name: | url |
---|---|
Description: | The URL for the Opensearch-compatible instance. |
Required: | Yes |
Type: | string |
username (string
)
Name: | username |
---|---|
Description: | A username for an authorized user for the given Opensearch-compatible instance. |
Required: | No |
Type: | string |
Minimum length: | 1 |
OperationMeta (object
)
Type: | object | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Properties | _id (
|
Name: | ID |
---|---|
Description: | Optional ID for the data document. |
Required: | No |
Type: | string |
_index (string
)
Name: | index |
---|---|
Description: | Optional name of the index that will receive the data. If none is provided, the default index will be used. |
Required: | No |
Type: | string |
Type: | scope | ||||||||
---|---|---|---|---|---|---|---|---|---|
Root object: | ErrorOutput | ||||||||
Properties | error (
|
Required: | Yes |
---|---|
Type: | string |
Objects
ErrorOutput (object
)
Type: | object | ||||
---|---|---|---|---|---|
Properties | error (
|
Required: | Yes |
---|---|
Type: | string |
Type: | scope | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Root object: | SuccessOutput | ||||||||||||||||
Properties | document_ids (
string ] |
Required: | Yes | ||
---|---|---|---|
Type: | list[ | ||
List items
|
message (string
)
Required: | Yes |
---|---|
Type: | string |
Objects
SuccessOutput (object
)
Type: | object | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Properties | document_ids (
string ] |
Required: | Yes | ||
---|---|---|---|
Type: | list[ | ||
List items
|
message (string
)
Required: | Yes |
---|---|
Type: | string |
Process list input into a bulk_upload_list
Type: | scope | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Root object: | DataList | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Properties | data_list (
any ] |
Name: | data list | ||
---|---|---|---|
Description: | List of data object to process into the bulk_upload_list. | ||
Required: | Yes | ||
Type: | list[ | ||
List items
|
operation (map[string
,reference[OperationMeta]
]
)
string
,reference[OperationMeta]
]Name: | operation | ||||
---|---|---|---|---|---|
Description: | The operation type and associated operation metadata. | ||||
Required: | Yes | ||||
Type: | map[ | ||||
Key type
| |||||
Value type
|
Objects
DataList (object
)
Type: | object | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Properties | data_list (
any ] |
Name: | data list | ||
---|---|---|---|
Description: | List of data object to process into the bulk_upload_list. | ||
Required: | Yes | ||
Type: | list[ | ||
List items
|
operation (map[string
,reference[OperationMeta]
]
)
string
,reference[OperationMeta]
]Name: | operation | ||||
---|---|---|---|---|---|
Description: | The operation type and associated operation metadata. | ||||
Required: | Yes | ||||
Type: | map[ | ||||
Key type
| |||||
Value type
|
OperationMeta (object
)
Type: | object | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Properties | _id (
|
Name: | ID |
---|---|
Description: | Optional ID for the data document. |
Required: | No |
Type: | string |
_index (string
)
Name: | index |
---|---|
Description: | Optional name of the index that will receive the data. If none is provided, the default index will be used. |
Required: | No |
Type: | string |
Type: | scope | ||||||||
---|---|---|---|---|---|---|---|---|---|
Root object: | ErrorOutput | ||||||||
Properties | error (
|
Required: | Yes |
---|---|
Type: | string |
Objects
ErrorOutput (object
)
Type: | object | ||||
---|---|---|---|---|---|
Properties | error (
|
Required: | Yes |
---|---|
Type: | string |
Type: | scope | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Root object: | BulkUploadList | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Properties | bulk_upload_list (
reference[BulkUploadObject] ] |
Name: | bulk upload list | ||||
---|---|---|---|---|---|
Description: | The list of objects for the bulk upload operation. | ||||
Required: | Yes | ||||
Type: | list[ | ||||
List items
|
Objects
BulkUploadList (object
)
Type: | object | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Properties | bulk_upload_list (
reference[BulkUploadObject] ] |
Name: | bulk upload list | ||||
---|---|---|---|---|---|
Description: | The list of objects for the bulk upload operation. | ||||
Required: | Yes | ||||
Type: | list[ | ||||
List items
|
BulkUploadObject (object
)
Type: | object | ||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Properties | data (
string ,any ] |
Name: | data | ||
---|---|---|---|
Description: | The JSON data document to upload to your index. | ||
Required: | Yes | ||
Type: | map[ | ||
Key type
| |||
Value type
|
operation (map[string
,reference[OperationMeta]
]
)
string
,reference[OperationMeta]
]Name: | operation | ||||
---|---|---|---|---|---|
Description: | The operation type and associated operation metadata. | ||||
Required: | Yes | ||||
Type: | map[ | ||||
Key type
| |||||
Value type
|
OperationMeta (object
)
Type: | object | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Properties | _id (
|
Name: | ID |
---|---|
Description: | Optional ID for the data document. |
Required: | No |
Type: | string |
_index (string
)
Name: | index |
---|---|
Description: | Optional name of the index that will receive the data. If none is provided, the default index will be used. |
Required: | No |
Type: | string |