### Example: Explain Snapshot Management Policies with Wildcard Source: https://docs.lucenia.io/tuning-your-cluster/availability-and-recovery/snapshots/sm-api This example demonstrates how to use the _explain API to retrieve information for all snapshot management policies starting with 'daily'. ```http GET _plugins/_sm/policies/daily*/_explain ``` -------------------------------- ### Example Response for Get Tenant Source: https://docs.lucenia.io/security/access-control/api Shows the configuration details of a retrieved tenant. ```json { "human_resources": { "reserved": false, "hidden": false, "description": "A tenant for the human resources team.", "static": false } } ``` -------------------------------- ### Initialize and Use the Asynchronous Client Source: https://docs.lucenia.io/clients/python This example demonstrates setting up and using the `AsyncLucenia` client for asynchronous operations. Ensure `aiohttp` is installed. ```python import asyncio from lucenia import AsyncLucenia async def main(): client = AsyncLucenia( hosts=[{"host": "localhost", "port": 9200}], http_auth=("admin", "MyStrongPassword123!"), use_ssl=True, verify_certs=False, ) info = await client.info() print(info["version"]["number"]) await client.close() asyncio.run(main()) ``` -------------------------------- ### Example Response for Get Account Details Source: https://docs.lucenia.io/security/access-control/api Example JSON response detailing user information, roles, and tenant access. ```json { "user_name": "admin", "is_reserved": true, "is_hidden": false, "is_internal_user": true, "user_requested_tenant": null, "backend_roles": [ "admin" ], "custom_attribute_names": [], "tenants": { "global_tenant": true, "admin_tenant": true, "admin": true }, "roles": [ "all_access", "own_index" ] } ``` -------------------------------- ### Setup Python Virtual Environment and Install Neuron PyTorch on Ubuntu Source: https://docs.lucenia.io/ml-commons-plugin/gpu-acceleration Creates a Python virtual environment, configures pip to use the Neuron repository, and installs the Neuron PyTorch package. ```bash cd ~ python3.7 -m venv pytorch_venv source pytorch_venv/bin/activate pip install -U pip pip config set global.extra-index-url https://pip.repos.neuron.amazonaws.com pip install torch-neuron torchvision ``` -------------------------------- ### Example Connector Request Source: https://docs.lucenia.io/ml-commons-plugin/api/connector-apis/get-connector An example of a GET request to retrieve a connector by its ID. ```text GET /_plugins/_ml/connectors/N8AE1osB0jLkkocYjz7D ``` -------------------------------- ### Logstash Plugin Installation Output Source: https://docs.lucenia.io/tools/logstash Example output indicating successful installation of the Logstash OpenSearch plugin. ```text Validating logstash-output-opensearch Resolving mixin dependencies Updating mixin dependencies logstash-mixin-ecs_compatibility_support Bundler attempted to update logstash-mixin-ecs_compatibility_support but its version stayed the same Installing logstash-output-opensearch Installation successful ``` -------------------------------- ### Setup Python Virtual Environment and Install Neuron PyTorch on Amazon Linux 2 Source: https://docs.lucenia.io/ml-commons-plugin/gpu-acceleration Creates a Python virtual environment, configures pip to use the Neuron repository, and installs the Neuron PyTorch package on Amazon Linux 2. ```bash cd ~ sudo yum install -y python3.7-venv gcc-c++ python3.7 -m venv pytorch_venv source pytorch_venv/bin/activate pip install -U pip pip config set global.extra-index-url https://pip.repos.neuron.amazonaws.com pip install torch-neuron torchvision ``` -------------------------------- ### Example response for Get Settings API Source: https://docs.lucenia.io/api-reference/index-apis/get-settings This is an example of the JSON response you can expect when successfully retrieving index settings. It includes details about the index's configuration. ```json { "sample-index1": { "settings": { "index": { "creation_date": "1622672553417", "number_of_shards": "1", "number_of_replicas": "1", "uuid": "GMEA0_TkSaamrnJSzNLzwg", "version": { "created": "135217827", "upgraded": "135238227" }, "provided_name": "sample-index1" } } } } ``` -------------------------------- ### Example Response for Get All Roles Source: https://docs.lucenia.io/security/access-control/api Illustrates the response format for retrieving all roles, including details for predefined and custom roles. ```json { "manage_snapshots": { "reserved": true, "hidden": false, "description": "Provide the minimum permissions for managing snapshots", "cluster_permissions": [ "manage_snapshots" ], "index_permissions": [{ "index_patterns": [ "*" ], "fls": [], "masked_fields": [], "allowed_actions": [ "indices:data/write/index", "indices:admin/create" ] }], "tenant_permissions": [], "static": true }, ... } ``` -------------------------------- ### Load Initial Configuration with Keystore and Truststore Files Source: https://docs.lucenia.io/security/configuration/security-admin Configure the Security plugin using JKS keystore and truststore files. This example specifies the configuration directory, ignores cluster name, disables hostname verification, and provides paths and passwords for the truststore and keystore. ```bash ./securityadmin.sh -cd ../../../config/lucenia-security -icl -nhnv -ts -tspass -ks -kspass ``` -------------------------------- ### Get All Cluster Health Source: https://docs.lucenia.io/api-reference/cluster-api/cluster-health This example retrieves the health status for all indexes within the cluster. It's a common starting point for monitoring cluster-wide conditions. ```http GET _cluster/health ``` -------------------------------- ### Example Request to Get Controller Source: https://docs.lucenia.io/ml-commons-plugin/api/controller-apis/get-controller An example of a GET request to retrieve controller details for a specific model. ```text GET /_plugins/_ml/controllers/T_S-cY0BKCJ3ot9qr0aP ``` -------------------------------- ### Create Index with Settings, Mappings, and Aliases Source: https://docs.lucenia.io/api-reference/index-apis/create-index This example demonstrates creating an index named 'sample-index1' with custom settings for shards and replicas, a mapping for an 'age' property, and an alias 'sample-alias1'. ```HTTP PUT /sample-index1 { "settings": { "index": { "number_of_shards": 2, "number_of_replicas": 1 } }, "mappings": { "properties": { "age": { "type": "integer" } } }, "aliases": { "sample-alias1": {} } } ``` -------------------------------- ### Example Response for Get Document Source: https://docs.lucenia.io/api-reference/document-apis/get-documents This is an example of the JSON response when a document is successfully retrieved. ```json { "_index": "sample-index1", "_id": "1", "_version": 1, "_seq_no": 0, "_primary_term": 9, "found": true, "_source": { "text": "This is just some sample text." } } ``` -------------------------------- ### Example Settings in Lucenia Keystore Source: https://docs.lucenia.io/security/configuration/lucenia-keystore Shows an example output of settings stored in the Lucenia keystore, including 'keystore.seed' and a secure SSL password setting. ```bash keystore.seed plugins.security.ssl.http.pemkey_password_secure ``` -------------------------------- ### Install Multiple Plugins Source: https://docs.lucenia.io/install-and-configure/plugins Install several plugins simultaneously by listing their names separated by spaces. ```bash bin/lucenia-plugin install ... ``` ```bash $ sudo $ ./lucenia-plugin install analysis-nori repository-s3 ``` -------------------------------- ### Example GET Response Source: https://docs.lucenia.io/security/access-control/api A typical response from a GET request to retrieve audit configuration. ```json { "_readonly" : [ "/audit/exclude_sensitive_headers", "/compliance/internal_config", "/compliance/external_config" ], "config" : { "compliance" : { "enabled" : true, "write_log_diffs" : false, "read_watched_fields" : { }, "read_ignore_users" : [ ], "write_watched_indices" : [ ], "write_ignore_users" : [ ], "read_metadata_only" : true, "write_metadata_only" : true, "external_config" : false, "internal_config" : true }, "enabled" : true, "audit" : { "ignore_users" : [ ], "ignore_requests" : [ ], "disabled_rest_categories" : [ "AUTHENTICATED", "GRANTED_PRIVILEGES" ], "disabled_transport_categories" : [ "AUTHENTICATED", "GRANTED_PRIVILEGES" ], "log_request_body" : true, "resolve_indices" : true, "resolve_bulk_requests" : true, "exclude_sensitive_headers" : true, "enable_transport" : true, "enable_rest" : true } } } ``` -------------------------------- ### Start Lucenia Daemon Source: https://docs.lucenia.io/upgrade-to/upgrade-to Command to start Lucenia in daemon mode from the tarball installation. ```bash ./bin/lucenia -d ``` -------------------------------- ### GET _script_context Source: https://docs.lucenia.io/api-reference/script-apis/get-script-contexts This example shows how to make a GET request to retrieve all stored script contexts. ```http GET _script_context ``` -------------------------------- ### Register fs Repository Example Source: https://docs.lucenia.io/api-reference/snapshots/create-repository Example of registering a file system repository. Ensure the specified location is accessible by all nodes. ```json PUT /_snapshot/my-fs-repository { "type": "fs", "settings": { "location": "/mnt/snapshots" } } ``` -------------------------------- ### Example: Get Specific SM Policy Source: https://docs.lucenia.io/tuning-your-cluster/availability-and-recovery/snapshots/sm-api An example of how to retrieve a specific SM policy named 'daily-policy'. ```bash GET _plugins/_sm/policies/daily-policy ``` -------------------------------- ### Example Task ID Request Source: https://docs.lucenia.io/ml-commons-plugin/api/tasks-apis/get-task An example of a GET request to retrieve details for a specific task ID. ```text GET /_plugins/_ml/tasks/MsBi1YsB0jLkkocYjD5f ``` -------------------------------- ### Initialize Go Module Source: https://docs.lucenia.io/clients/go Initialize a Go module for a new project. ```bash go mod init example.com/myapp ``` -------------------------------- ### Python MCP Client Example Source: https://docs.lucenia.io/ml-commons-plugin/api/mcp-server-apis/mcp-server Demonstrates how to list available tools and call a tool using the fastmcp Python library. Ensure the client is initialized with the correct server endpoint. ```Python import asyncio from fastmcp import Client async def main(): async with Client("http://localhost:9200/_plugins/_ml/mcp") as client: # List available tools tools = await client.list_tools() for tool in tools: print(f"Tool: {tool.name}") # Call a tool result = await client.call_tool("ListIndexTool", {"indices": []}) print("Result:", result) asyncio.run(main()) ``` -------------------------------- ### Example Message Traces Request Source: https://docs.lucenia.io/ml-commons-plugin/api/memory-apis/get-message-traces An example of how to call the Get Traces API for a specific message ID. ```http GET /_plugins/_ml/memory/message/TAuCZY0BT2tRrkdmCPqZ/traces ``` -------------------------------- ### Example Model ID Request Source: https://docs.lucenia.io/ml-commons-plugin/api/model-apis/get-model An example of a GET request to retrieve a specific model using its ID. ```bash GET /_plugins/_ml/models/N8AE1osB0jLkkocYjz7D ``` -------------------------------- ### Navigate to Demo Folder Source: https://docs.lucenia.io/security/authentication-backends/saml Change the current directory to the `demo` folder within the downloaded SAML demo repository. ```bash $ cd /demo ``` -------------------------------- ### Install Plugin from Local ZIP File Source: https://docs.lucenia.io/install-and-configure/plugins Install a plugin using a local ZIP file by specifying its path prefixed with 'file:'. ```bash # Zip file in a local directory. $ sudo ./lucenia-plugin install file:/home/user/analysis-icu-0.11.0.zip -> Installing file:/home/user/analysis-icu-0.11.0.zip -> Downloading file:/home/user/analysis-icu-0.11.0.zip [=================================================] 100% -> Installed analysis-icu with folder name analysis-icu ``` -------------------------------- ### Get Policy Request Source: https://docs.lucenia.io/im-plugin/ism/api This is an example HTTP GET request to retrieve a specific ISM policy by its ID. ```http GET _plugins/_ism/policies/policy_1 ``` -------------------------------- ### MCP initialize Example Response Source: https://docs.lucenia.io/ml-commons-plugin/api/mcp-server-apis/mcp-server An example response from the initialize method, providing server information and capabilities. ```json { "jsonrpc": "2.0", "id": 0, "result": { "protocolVersion": "2024-11-05", "serverInfo": { "name": "Lucenia MCP Server", "version": "0.8.0" }, "capabilities": { "tools": {} } } } ``` -------------------------------- ### Lucenia Plugins Endpoint Response Example Source: https://docs.lucenia.io/install-and-configure/install-lucenia/windows This is an example of the response from the _cat/plugins endpoint, showing the installed plugins and their versions. ```text hostname lucenia-security 0.11.0 ``` -------------------------------- ### Get Script Language Request Source: https://docs.lucenia.io/api-reference/script-apis/get-script-language This is an example of a GET request to retrieve script language information. It does not require any parameters. ```http GET _script_language ``` -------------------------------- ### Apply All YAML Files with Keystore and Truststore Source: https://docs.lucenia.io/security/configuration/security-admin Apply all YAML configuration files from a directory using a keystore and truststore for authentication. Provide the correct paths and passwords for both. ```bash ./securityadmin.sh \ -cd /usr/share/lucenia/config/lucenia-security/ \ -ks /path/to/keystore.jks \ -kspass changeit \ -ts /path/to/truststore.jks \ -tspass changeit -nhnv \ -icl ``` -------------------------------- ### Register Multiple Tools Example Source: https://docs.lucenia.io/ml-commons-plugin/api/mcp-server-apis/register-mcp-tools Example demonstrating the registration of multiple tools, including 'text_analyzer' and 'data_transformer', with their respective parameters and metadata. ```HTTP POST /_plugins/_ml/mcp/tools { "tools": [ { "name": "text_analyzer", "description": "Analyze text sentiment and extract key topics", "parameters": { "text": { "type": "string", "description": "Text to analyze", "required": true }, "analysis_type": { "type": "string", "description": "Type of analysis to perform", "required": false, "default": "sentiment", "enum": ["sentiment", "topics", "entities", "all"] } }, "metadata": { "category": "analysis", "version": "2.1.0" } }, { "name": "data_transformer", "description": "Transform data from one format to another", "parameters": { "input_data": { "type": "object", "description": "Data to transform", "required": true }, "output_format": { "type": "string", "description": "Desired output format", "required": true, "enum": ["json", "xml", "csv", "yaml"] }, "options": { "type": "object", "description": "Additional transformation options", "required": false } }, "metadata": { "category": "utility", "version": "1.5.0" } } ] } ``` -------------------------------- ### Example Response for Getting Specific Cluster Distinguished Names Source: https://docs.lucenia.io/security/access-control/api Example response for retrieving distinguished names for a particular cluster. ```json { "cluster3": { "nodes_dn": [ "CN=cluster3.example.com" ] } } ``` -------------------------------- ### Example Response for Index Mappings and Settings Source: https://docs.lucenia.io/im-plugin/index-templates Shows the resulting mappings and settings for an index created using the 'daily_logs' index template, demonstrating the composition of component templates. ```json { "logs-2020-01-01": { "aliases": { "my_logs": {} }, "mappings": { "properties": { "@timestamp": { "type": "date" }, "ip_address": { "type": "ip" }, "timestamp": { "type": "date", "format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis" }, "value": { "type": "double" } } }, "settings": { "index": { "creation_date": "1625382479459", "number_of_shards": "2", "number_of_replicas": "1", "uuid": "rYUlpOXDSUSuZifQLPfa5A", "version": { "created": "7100299" }, "provided_name": "logs-2020-01-01" } } } } ``` -------------------------------- ### Start Elasticsearch OSS Daemon (Tarball) Source: https://docs.lucenia.io/upgrade-to/upgrade-to Command to start the Elasticsearch OSS service in the background for tarball installations after upgrading. ```bash ./bin/elasticsearch -d ``` -------------------------------- ### Curl Example: Get Single MCP Tool Source: https://docs.lucenia.io/ml-commons-plugin/api/mcp-server-apis/list-mcp-tools Example using curl to fetch a single MCP tool, including authentication. ```curl curl -X GET "https://localhost:9200/_plugins/_ml/mcp/tools/tool-abc123" \ -H "Authorization: Basic $(echo -n 'username:password' | base64)" ``` -------------------------------- ### Run Lucenia Startup Script (Security Enabled) Source: https://docs.lucenia.io/install-and-configure/install-lucenia/tar Execute the Lucenia startup script with the security demo configuration to begin the installation. ```bash ./lucenia-tar-install.sh ``` -------------------------------- ### Complete LDAP Authentication Configuration Example Source: https://docs.lucenia.io/security/authentication-backends/ldap A comprehensive example combining all LDAP authentication settings. ```yaml ldap: http_enabled: true transport_enabled: true order: 1 http_authenticator: type: basic challenge: true authentication_backend: type: ldap config: enable_ssl: true enable_start_tls: false enable_ssl_client_auth: false verify_hostnames: true hosts: - ldap.example.com:636 bind_dn: cn=admin,dc=example,dc=com password: password userbase: 'ou=people,dc=example,dc=com' usersearch: '(sAMAccountName={0})' username_attribute: uid ``` -------------------------------- ### Example Response for Getting All Distinguished Names Source: https://docs.lucenia.io/security/access-control/api An example response showing distinguished names for different clusters, including their respective nodes DNs. ```json { "cluster1": { "nodes_dn": [ "CN=cluster1.example.com" ] } } ``` -------------------------------- ### Example response for CAT indices operation Source: https://docs.lucenia.io/security/access-control/permissions This is an example response from the `GET /_cat/indices/.kibana*` call, showing system indexes associated with the `.kibana*` pattern. ```text health | status | index | uuid | pri | rep | docs.count | docs.deleted | store.size | pri.store.size green open .kibana_1 XmTePICFRoSNf5O5uLgwRw 1 1 220 0 468.3kb 232.1kb green open .kibana_2 XmTePICFRoSNf5O5uLgwRw 1 1 220 0 468.3kb 232.1kb green open .kibana_3 XmTePICFRoSNf5O5uLgwRw 1 1 220 0 468.3kb 232.1kb ``` -------------------------------- ### Register a Single Tool Example Source: https://docs.lucenia.io/ml-commons-plugin/api/mcp-server-apis/register-mcp-tools Example of registering a single tool named 'document_search' with its parameters and metadata. ```HTTP POST /_plugins/_ml/mcp/tools { "tools": [ { "name": "document_search", "description": "Search through document collections using semantic similarity", "parameters": { "query": { "type": "string", "description": "Search query text", "required": true }, "limit": { "type": "number", "description": "Maximum number of results to return", "required": false, "default": 10 }, "index": { "type": "string", "description": "Index to search in", "required": false, "default": "default" } }, "metadata": { "category": "search", "version": "1.0.0", "author": "Lucenia Team" } } ] } ``` -------------------------------- ### Example Response for Performing Configuration Upgrade Source: https://docs.lucenia.io/security/access-control/api This is an example response after performing a security configuration upgrade, detailing the status and any upgrades performed on resources like roles. ```json { "status" : "OK", "upgrades" : { "roles" : { "add" : [ "flow_framework_full_access" ] } } } ``` -------------------------------- ### Get Index Rollup Job Response Example Source: https://docs.lucenia.io/im-plugin/index-rollups/rollup-api This is an example response when retrieving an index rollup job. It includes metadata and the rollup configuration. ```json { "_id": "my_rollup", "_seqNo": 1, "_primaryTerm": 1, "rollup": { ... } } ``` -------------------------------- ### Example Search Connector Request Source: https://docs.lucenia.io/ml-commons-plugin/api/connector-apis/search-connector An example POST request to the _search endpoint to find connectors, using a match_all query and specifying the size. ```json POST /_plugins/_ml/connectors/_search { "query": { "match_all": {} }, "size": 1000 } ``` -------------------------------- ### Install Plugin by Name Source: https://docs.lucenia.io/install-and-configure/plugins Install a plugin by specifying its name. Ensure you have the correct plugin name from the list of available plugins. ```bash bin/lucenia-plugin install ``` ```bash $ sudo ./lucenia-plugin install repository-gcs -> Installing repository-gcs -> Downloading repository-gcs from lucenia [=================================================] 100% -> Installed repository-gcs with folder name repository-gcs ``` -------------------------------- ### Example Request: Searching for all agents Source: https://docs.lucenia.io/ml-commons-plugin/api/agent-apis/search-agent Use this example to retrieve all agents. It utilizes the 'match_all' query and specifies a size limit. ```json POST /_plugins/_ml/agents/_search { "query": { "match_all": {} }, "size": 1000 } ``` -------------------------------- ### Example Response for Get Message Traces Source: https://docs.lucenia.io/ml-commons-plugin/api/memory-apis/get-message-traces This JSON object represents a typical response from the Get Message Traces API, showing a conversation history with multiple turns. ```json { "traces": [ { "memory_id": "7Qt4ZY0BT2tRrkdmSPlo", "message_id": "TQuCZY0BT2tRrkdmEvpp", "create_time": "2024-02-01T16:30:39.719968032Z", "input": "Which index has most documents", "prompt_template": null, "response": "Let me check the document counts of each index", "origin": null, "additional_info": {}, "parent_message_id": "TAuCZY0BT2tRrkdmCPqZ", "trace_number": 1 }, { "memory_id": "7Qt4ZY0BT2tRrkdmSPlo", "message_id": "TguCZY0BT2tRrkdmEvp7", "create_time": "2024-02-01T16:30:39.732979687Z", "input": "", "prompt_template": null, "response": "health status index uuid pri rep docs.count docs.deleted store.size pri.store.size \ngreen open .plugins-ml-model-group lHgGEgJhT_mpADyOZoXl2g 1 1 9 2 33.4kb 16.7kb \ngreen open .plugins-ml-memory-meta b2LEpv0QS8K60QBjXtRm6g 1 1 13 0 117.5kb 58.7kb \ngreen open .ql-datasources 9NXm_tMXQc6s_4uRToSNkQ 1 1 0 0 416b 208b \ngreen open sample-ecommerce UPYOQcAfRGqFAlSxcZlRjw 1 1 40320 0 4.1mb 2mb \ngreen open .plugins-ml-task xYTlprYCQnaaYici69SOjA 1 1 117 0 115.5kb 57.6kb \ngreen open .opendistro_security 7DAqhm9QQmeEsQYhA40cJg 1 1 10 0 117kb 58.5kb \ngreen open sample-host-health Na5tq6UiTt6r_qYME1vV-w 1 1 40320 0 2.6mb 1.3mb \ngreen open .lucenia-observability 6PthtLluSKyYCdZR3Mw0iw 1 1 0 0 416b 208b \ngreen open .plugins-ml-model WYcjBHcnRuSDHeVWPVupoA 1 1 191 45 4.2gb 2.1gb \ngreen open index_for_neural_sparse GQswGabQRIazM_trnqaDrw 1 1 5 0 28.4kb 14.2kb \ngreen open security-auditlog-2024.01.30 BhXR7Nd3QVOVGxJNpR0-jw 1 1 27768 0 13.8mb 7mb \ngreen open sample-http-responses 0gmYYYdOTiCbVUvl_uDL0w 1 1 40320 0 2.5mb 1.2mb \ngreen open security-auditlog-2024.02.01 2VD1ieDGS5m-TfjIdfT8Eg 1 1 36386 0 37mb 18.2mb \ngreen open lucenia_dashboards_sample_data_ecommerce wnE6r7OvSPqc5YHj8wHSLA 1 1 4675 0 8.8mb 4.4mb \ngreen open security-auditlog-2024.01.31 cNRK5-2eTwes0SRlXTl0RQ 1 1 34520 0 20.5mb 9.8mb \ngreen open .plugins-ml-memory-message wTNBU4BBQWTFcFhNlUdfBQ 1 1 88 1 399.7kb 205kb \ngreen open .plugins-flow-framework-state dJUNDv9MSJ2jjwKbzXPlrw 1 1 39 0 114.1kb 57kb \ngreen open .plugins-ml-agent 7X1IzoLuSGmIujOh9i5mmg 1 1 27 0 146.6kb 73.3kb \ngreen open .plugins-flow-framework-templates _ecC0KahTlmG_3tFUst7Uw 1 1 18 0 175.8kb 87.9kb \ngreen open .plugins-ml-connector q45iJfVjQ5KgxeNC65DLSw 1 1 11 0 313.1kb 156.5kb \ngreen open .kibana_1 vRjXK4bHSUueB_4iXiQ8yw 1 1 257 0 264kb 132kb \ngreen open .plugins-ml-config G7gxGQB7TZeQzBasHd5PUg 1 1 1 0 7.8kb 3.9kb \ngreen open .plugins-ml-controller NQTZPREZRhWoDdjCglRLFg 1 1 0 0 50.1kb 49.9kb \ngreen open lucenia_dashboards_sample_data_logs 9gpOTB3rRgqBLvqis_k5LQ 1 1 14074 0 18mb 9mb \ngreen open .plugins-flow-framework-config JlKPsCh6SEq-Jh6rPL_x9Q 1 1 1 0 7.8kb 3.9kb \ngreen open lucenia_dashboards_sample_data_flights pJde0irnTce4-uobHwYmMQ 1 1 13059 0 11.9mb 5.9mb \ngreen open my_test_data T4hwNs7CTJGIfw2QpCqQ_Q 1 1 6 0 91.7kb 45.8kb \ngreen open .opendistro-job-scheduler-lock XjgmXAVKQ4e8Y-ac54VBzg 1 1 3 0 38.7kb 19.4kb \n", "origin": "CatIndexTool", "additional_info": {}, "parent_message_id": "TAuCZY0BT2tRrkdmCPqZ", "trace_number": 2 }, { "memory_id": "7Qt4ZY0BT2tRrkdmSPlo", "message_id": "UwuCZY0BT2tRrkdmHPos", "create_time": "2024-02-01T16:30:42.217897656Z", "input": "Which index has most documents", "prompt_template": null, "response": "Based on the cluster health information provided, the index with the most documents is .plugins-ml-model with 191 documents", "origin": null, "additional_info": {}, "parent_message_id": "TAuCZY0BT2tRrkdmCPqZ", "trace_number": 3 }, { "memory_id": "7Qt4ZY0BT2tRrkdmSPlo", "message_id": "UQuCZY0BT2tRrkdmHPos", "create_time": "2024-02-01T16:30:42.218120716Z", "input": "Which index has most documents", "prompt_template": null, "response": null, "origin": null, "additional_info": {}, "parent_message_id": "TAuCZY0BT2tRrkdmCPqZ", "trace_number": 4 } ] } ``` -------------------------------- ### Create Policy Response Source: https://docs.lucenia.io/im-plugin/ism/api This is an example response after successfully creating a policy. It confirms the policy ID, version, and its configuration. ```json { "_id": "policy_1", "_version": 1, "_primary_term": 1, "_seq_no": 7, "policy": { "policy": { "policy_id": "policy_1", "description": "ingesting logs", "last_updated_time": 1577990761311, "schema_version": 1, "error_notification": null, "default_state": "ingest", "states": [ { "name": "ingest", "actions": [ { "rollover": { "min_doc_count": 5 } } ], "transitions": [ { "state_name": "search" } ] }, { "name": "search", "actions": [], "transitions": [ { "state_name": "delete", "conditions": { "min_index_age": "5m" } } ] }, { "name": "delete", "actions": [ { "delete": {} } ], "transitions": [] } ] } } } ``` -------------------------------- ### Example Request: Search All Memories Source: https://docs.lucenia.io/ml-commons-plugin/api/memory-apis/search-memory Use this example to retrieve all memories. It utilizes a `match_all` query and specifies a size limit. ```json POST /_plugins/_ml/memory/_search { "query": { "match_all": {} }, "size": 1000 } ``` -------------------------------- ### Example Response for Executing Stored Script Source: https://docs.lucenia.io/api-reference/script-apis/exec-stored-script This is an example response from a GET books/_search request that executed a stored script. It shows the structure of the returned data, including the 'total_ratings' field. ```json { "took" : 2, "timed_out" : false, "_shards" : { "total" : 1, "successful" : 1, "skipped" : 0, "failed" : 0 }, "hits" : { "total" : { "value" : 3, "relation" : "eq" }, "max_score" : 1.0, "hits" : [ { "_index" : "books", "_id" : "1", "_score" : 1.0, "fields" : { "total_ratings" : [ 12 ] } }, { "_index" : "books", "_id" : "2", "_score" : 1.0, "fields" : { "total_ratings" : [ 15 ] } }, { "_index" : "books", "_id" : "3", "_score" : 1.0, "fields" : { "total_ratings" : [ 8 ] } } ] } } ``` -------------------------------- ### Create a New Lucenia Keystore Source: https://docs.lucenia.io/security/configuration/lucenia-keystore Initializes a new Lucenia keystore. If a keystore already exists, this command will prompt for confirmation to overwrite it. ```bash ./bin/lucenia-keystore create ``` -------------------------------- ### List MCP tools with pagination Source: https://docs.lucenia.io/ml-commons-plugin/api/mcp-server-apis/list-mcp-tools This example demonstrates how to paginate through the list of MCP tools by specifying the 'size' and 'from' query parameters. ```curl curl -X GET "https://localhost:9200/_plugins/_ml/mcp/tools?size=20&from=10" \ -H "Authorization: Basic $(echo -n 'username:password' | base64)" ``` -------------------------------- ### Test Lucenia Installation (Security Enabled) Source: https://docs.lucenia.io/install-and-configure/install-lucenia/windows Send a GET request to the Lucenia server on port 9200 to verify the installation. The --insecure flag is required due to self-signed TLS certificates. ```curl curl.exe -X GET https://localhost:9200 -u "admin:" --insecure ``` -------------------------------- ### Upload All Configuration Files in a Directory Source: https://docs.lucenia.io/security/configuration/security-admin Use this command to upload all security configuration files from a specified directory. This requires providing keystore and truststore details. ```bash ./securityadmin.sh -cd ../../../config/lucenia-security -ts ... -tspass ... -ks ... -kspass ... ``` -------------------------------- ### Example Error Response for Get Controller Source: https://docs.lucenia.io/ml-commons-plugin/api/controller-apis/get-controller An error response when no controller is defined for the specified model ID. ```json { "error": { "root_cause": [ { "type": "status_exception", "reason": "Failed to find model controller with the provided model ID: T_S-cY0BKCJ3ot9qr0aP" } ], "type": "status_exception", "reason": "Failed to find model controller with the provided model ID: T_S-cY0BKCJ3ot9qr0aP" }, "status": 404 } ``` -------------------------------- ### Run Lucenia Source: https://docs.lucenia.io/observing-your-data/trace/distributed-tracing Execute this command from the Lucenia installation directory to start the Lucenia process after modifying jvm.options. ```bash ./bin/lucenia ``` -------------------------------- ### Load Initial Configuration with PEM Files Source: https://docs.lucenia.io/security/configuration/security-admin Use the securityadmin.sh tool with PEM files to load the initial Security plugin configuration. This command specifies configuration directory, ignores cluster name, disables hostname verification, and provides paths to CA, admin certificate, and private key. ```bash ./securityadmin.sh -cd ../../../config/lucenia-security/ -icl -nhnv \ -cacert ../../../config/root-ca.pem \ -cert ../../../config/kirk.pem \ -key ../../../config/kirk-key.pem ``` -------------------------------- ### Request to Get Paginated Transform Jobs Source: https://docs.lucenia.io/im-plugin/index-transforms/transforms-apis This GET request demonstrates how to retrieve a specific subset of transform jobs using `size` and `from` query parameters for pagination. It fetches 2 results starting from the 8th transform. ```http GET _plugins/_transform?size=2&from=8 ``` -------------------------------- ### Example Response for Configuration Upgrade Check Source: https://docs.lucenia.io/security/access-control/api This is an example of the response received when checking for security configuration upgrade availability, indicating if an upgrade is available and potential actions. ```json { "status" : "OK", "upgradeAvailable" : true, "upgradeActions" : { "roles" : { "add" : [ "flow_framework_full_access" ] } } } ``` -------------------------------- ### Example SM Policy Creation Request Source: https://docs.lucenia.io/tuning-your-cluster/availability-and-recovery/snapshots/sm-api This example demonstrates the structure of a request to create a daily snapshot policy. It includes settings for creation, deletion, snapshot configuration, and notifications. ```json POST _plugins/_sm/policies/daily-policy { "description": "Daily snapshot policy", "creation": { "schedule": { "cron": { "expression": "0 8 * * *", "timezone": "UTC" } }, "time_limit": "1h" }, "deletion": { "schedule": { "cron": { "expression": "0 1 * * *", "timezone": "America/Los_Angeles" } }, "condition": { "max_age": "7d", "max_count": 21, "min_count": 7 }, "time_limit": "1h" }, "snapshot_config": { "date_format": "yyyy-MM-dd-HH:mm", "timezone": "America/Los_Angeles", "indices": "*", "repository": "s3-repo", "ignore_unavailable": "true", "include_global_state": "false", "partial": "true", "metadata": { "any_key": "any_value" } }, "notification": { "channel": { "id": "NC3OpoEBzEoHMX183R3f" }, "conditions": { "creation": true, "deletion": false, "failure": false, "time_limit_exceeded": false } } } ``` -------------------------------- ### Explain API - Single Document Source: https://docs.lucenia.io/api-reference/explain This example shows how to get an explanation for a specific document by providing its ID in the URL. ```APIDOC ## POST /_explain/ ### Description Provides a detailed explanation of the relevance score calculation for a specific document. ### Method POST ### Endpoint `//_explain/` ### Parameters #### Path Parameters - **``** (String) - Required - The name of the index. - **``** (String) - Required - The unique identifier of the document. #### Query Parameters - **analyzer** (String) - Optional - The analyzer to use in the query string. - **analyze_wildcard** (Boolean) - Optional - Specifies whether to analyze wildcard and prefix queries. Default is false. - **default_operator** (String) - Optional - Indicates whether the default operator for a string query should be AND or OR. Default is OR. - **df** (String) - Optional - The default field in case a field prefix is not provided in the query string. - **lenient** (Boolean) - Optional - Specifies whether Lucenia should ignore format-based query failures. Default is false. - **preference** (String) - Optional - Specifies a preference of which shard to retrieve results from. - **q** (String) - Optional - Query in the Lucene query string syntax. - **stored_fields** (Boolean) - Optional - If true, retrieves document fields stored in the index rather than the document’s `_source`. Default is false. - **routing** (String) - Optional - Value used to route the operation to a specific shard. - **`_source`** (String) - Optional - Whether to include the `_source` field in the response body. Default is true. - **`_source_excludes`** (String) - Optional - A comma-separated list of source fields to exclude in the query response. - **`_source_includes`** (String) - Optional - A comma-separated list of source fields to include in the query response. #### Request Body - **query** (Object) - Required - The search query definition. - **match** (Object) - Required - Specifies a field and the text to search for. - **customer_first_name** (String) - Required - The name to search for. ### Request Example ```json POST opensearch_dashboards_sample_data_ecommerce/_explain/EVz1Q3sBgg5eWQP6RSte { "query": { "match": { "customer_first_name": "Mary" } } } ``` ### Response #### Success Response (200) - **explanation** (Object) - An explanation of the relevance score calculation. - **_index** (String) - The index the document belongs to. - **_id** (String) - The ID of the document. - **_version** (Integer) - The version of the document. - **found** (Boolean) - Indicates if the document was found. - **_source** (Object) - The source fields of the document (if requested). #### Response Example ```json { "explanation": { "value": 1.50515, "description": "term frequency", "details": [ { "value": 1.50515, "description": "term in field", "details": [ { "value": 0.1, "description": "TF: term frequency", "details": [ { "value": 1.50515, "description": "IDF: Inverse document frequency" } ] } ] } ] }, "_index": "opensearch_dashboards_sample_data_ecommerce", "_id": "EVz1Q3sBgg5eWQP6RSte", "_version": 1, "found": true, "_source": { "customer_first_name": "Mary", "customer_last_name": "Smith", "email": "mary.smith@example.com" } } ``` ``` -------------------------------- ### Example Request: Search Memory by Name Source: https://docs.lucenia.io/ml-commons-plugin/api/memory-apis/search-memory This example demonstrates how to search for a specific memory by its name using a `term` query. ```json POST /_plugins/_ml/memory/_search { "query": { "term": { "name": { "value": "conversation" } } } } ```