Elasticsearch Connection
General Information
Connection Type
elasticsearch
UI Documentation
Endpoints
List Connections
GET /apiops/projects/{projectName}/connections/?type=elasticsearch
Get Connection
GET /apiops/projects/{projectName}/connections/{connectionName}/
Create Connection
POST /apiops/projects/{projectName}/connections/{connectionName}/
Update Connection
PUT /apiops/projects/{projectName}/connections/{connectionName}/
Delete Connection
DELETE /apiops/projects/{projectName}/connections/{connectionName}/
List Connections
Endpoint
GET /apiops/projects/{projectName}/connections/?type=elasticsearch
Request
Headers
| Header | Value |
|---|---|
| Authorization | Bearer {token} |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| projectName | string | Yes | Project name |
Note: The type query parameter is required to filter connections by type.
cURL Example
curl -X GET \
"https://demo.apinizer.com/apiops/projects/MyProject/connections/?type=elasticsearch" \
-H "Authorization: Bearer YOUR_TOKEN"
Get Connection
Endpoint
GET /apiops/projects/{projectName}/connections/{connectionName}/
Request
Headers
| Header | Value |
|---|---|
| Authorization | Bearer {token} |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| projectName | string | Yes | Project name |
| connectionName | string | Yes | Connection name |
Response
Success Response (200 OK)
{
"success": true,
"resultList": [
{
"type": "elasticsearch",
"name": "my-elasticsearch-connection",
"description": "Elasticsearch connection for logging",
"enabled": true,
"administrate": true,
"elasticHostList": [
{
"scheme": "http",
"host": "localhost",
"port": 9200
},
{
"scheme": "https",
"host": "elasticsearch.example.com",
"port": 9200
}
],
"authenticate": true,
"elasticUsername": "elastic",
"elasticPassword": null,
"encryptCommunication": true,
"encryptCommunicationType": "CA_CERTIFICATE_IN_PKCS_12",
"caCertInPkcs12File": null,
"caCertInPkcs12FileContentType": "application/x-pkcs12",
"caInPemFile": null,
"caInPemFileContentType": null,
"caTruststoreFile": null,
"caTruststoreFileContentType": null,
"caTruststoreFilePass": null,
"caKeystoreFile": null,
"caKeystoreFileContentType": null,
"caKeystoreFilePass": null,
"disableHostnameVerification": false,
"indexLifecyclePolicyCreated": true,
"indexLifecyclePolicy": {
"policyName": "apinizer-log-ilm-policy-default",
"enableHotPhase": true,
"maxAgeOfRollover": 30,
"maxIndexSizeOfRollover": 30,
"maxDocCountOfRollover": 15000000,
"enableWarmPhase": true,
"numberOfReplicasForWarm": 0,
"maxNumShardsForShrink": 1,
"maxNumSegmentsForForceMerge": 1,
"enableColdPhase": true,
"minAgeOfCold": 90,
"numberOfReplicasForCold": 0,
"enableDeletePhase": true,
"minAgeOfDelete": 365
},
"indexTemplateCreated": true,
"lastStatusCheckFailed": false,
"indexTemplateName": "apinizer-log-template",
"indexName": "apinizer-logs",
"indexTemplateNumberOfShards": 1,
"indexTemplateNumberOfReplicas": 1,
"indexTemplateRefreshInterval": "1s",
"connectionTimeoutInMs": 5000,
"bulkBufferCapacity": 50000,
"bulkFlushIntervalMs": 100,
"bulkMaxBatchSize": 2500,
"elasticsearchType": "READ_WRITE",
"elasticsearchMajorVersion": "AUTO_DETECT"
}
],
"resultCount": 1
}
Note: Secret fields are masked in get operations.
cURL Example
curl -X GET \
"https://demo.apinizer.com/apiops/projects/MyProject/connections/my-elasticsearch-connection/" \
-H "Authorization: Bearer YOUR_TOKEN"
Create Connection
Endpoint
POST /apiops/projects/{projectName}/connections/{connectionName}/