Compare commits
277 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3942ed722c | |||
| 2e62e4ac58 | |||
| 060d4ae5fc | |||
| b0861fae0d | |||
| 0918df8e7d | |||
| e86a6371c5 | |||
| 53e326275b | |||
| 48e277fd07 | |||
| 40603cde72 | |||
| 896c742407 | |||
| 22880d4659 | |||
| 21a84654f6 | |||
| bb0ff22fd2 | |||
| 9897ba8831 | |||
| c922661fda | |||
| 597dd28340 | |||
| cc0dc10c64 | |||
| 9c5394ecdb | |||
| 96a103b305 | |||
| 3e9ae8b29c | |||
| 064807c5a9 | |||
| 72b67fe4d7 | |||
| 6f2767628c | |||
| 96137788db | |||
| 8136846a78 | |||
| 62e9805311 | |||
| 907f9d085c | |||
| 0c1fb22631 | |||
| 132072b8ab | |||
| 99ada00747 | |||
| b1458e3511 | |||
| 9dacd9d9ee | |||
| d6577b7fa1 | |||
| ddb72d6e50 | |||
| 9bb2d237e4 | |||
| 4099532617 | |||
| 37544399ce | |||
| 12e88d6f87 | |||
| dbfeb5d1a9 | |||
| 84a837ce11 | |||
| dc009dc3a5 | |||
| d4f4b47d7e | |||
| cfd4e70fb9 | |||
| 68f8b7bb5f | |||
| 777e438482 | |||
| 29beb44bf5 | |||
| ef3126b361 | |||
| 6cc2b21ce2 | |||
| 02c656c364 | |||
| 77fcca871f | |||
| ca0b33a2b0 | |||
| 74c37e5b2d | |||
| 0e47cb88eb | |||
| f97208214e | |||
| 6f4a8bbe6a | |||
| c0264393a1 | |||
| 92bcf46ab4 | |||
| af544e8a55 | |||
| fbf804869f | |||
| f3422a6f43 | |||
| f2c43a843b | |||
| 1f6c68df9c | |||
| c7675708de | |||
| e897d8f050 | |||
| 4537308c38 | |||
| 3a1bb9377a | |||
| 46bd14a36c | |||
| e185a0b08c | |||
| 7d1c660f4e | |||
| 9b111ee664 | |||
| 3c912d626c | |||
| 49b79922e2 | |||
| 367f16c0ba | |||
| 747a61c7f8 | |||
| 1c3541a740 | |||
| 1d61cba014 | |||
| 358474bca8 | |||
| c0027b3958 | |||
| 68c4dd29fb | |||
| 5c60d98180 | |||
| 3b41c555ae | |||
| 532ded5d5c | |||
| c53c798899 | |||
| a3e3d57247 | |||
| c3966cacab | |||
| 048933f106 | |||
| 91935905b6 | |||
| 851e839c70 | |||
| d6982d5152 | |||
| c446225f3c | |||
| 9f17f820de | |||
| 0f5ac8127c | |||
| 5aa8226a4c | |||
| 38157d634e | |||
| 925b758418 | |||
| 95acb31dfc | |||
| c4879203a7 | |||
| e901b89e35 | |||
| 99e1dc3b39 | |||
| e98cab1a34 | |||
| a90e9e1fe1 | |||
| 2ca3754d20 | |||
| 4663738cf4 | |||
| 6b69e17b21 | |||
| a713e28853 | |||
| 3396b5d818 | |||
| dc27cb11ed | |||
| 40023c53a7 | |||
| 69fd7768f2 | |||
| d4d7d0bef5 | |||
| 6eb4f874cc | |||
| 5c6c5dea78 | |||
| 45c31df5c1 | |||
| ae028b2ae2 | |||
| c990ed43d4 | |||
| 46df19fd7d | |||
| cae38e6b2b | |||
| 4f02fd5509 | |||
| f175f83d34 | |||
| ed3cca0fe6 | |||
| 36163f4822 | |||
| 945fe1f605 | |||
| fe3c48e83e | |||
| 8398ae2f4b | |||
| a56327058b | |||
| d9b2a969d6 | |||
| 7e318cb334 | |||
| 5b856cd4c2 | |||
| 66e8d61476 | |||
| 974bf0a819 | |||
| e9cc0324c2 | |||
| 8ff4cdc506 | |||
| f01ccf0ff3 | |||
| 36627e66da | |||
| 8fd0d49a03 | |||
| a8f861c4d4 | |||
| 665ea3999d | |||
| 0915c8c613 | |||
| 7616e88438 | |||
| b10ec1fa70 | |||
| bcf895294b | |||
| 98e8bbd63d | |||
| 59a84216b1 | |||
| 404ebff8a8 | |||
| aa9f5b6d41 | |||
| 709ee6fa30 | |||
| 92c23232a7 | |||
| 7e5bbad5c2 | |||
| c5bd8c6e61 | |||
| 51ac759167 | |||
| e98b3d4e89 | |||
| b4d6d036f5 | |||
| 96fe644eb2 | |||
| f704d4fcf3 | |||
| 1c2dbf6e76 | |||
| 9bbae42ccc | |||
| 6d68d22e32 | |||
| 5a18409a61 | |||
| 8cd8dd3410 | |||
| d4b2d4676b | |||
| 2dbf00e821 | |||
| e4669e656d | |||
| 0355322ef4 | |||
| 1b519671eb | |||
| 422409627a | |||
| d9a5f24e24 | |||
| ecb2ba47a8 | |||
| dbe4557848 | |||
| fa0ee6e6c4 | |||
| 4962e60484 | |||
| 3023e45661 | |||
| ca72e8b2f5 | |||
| b19d93fb1e | |||
| 8a14ede19f | |||
| 5e7ca876e4 | |||
| 7c63c2d9e2 | |||
| 140774128b | |||
| 95c4369f9b | |||
| 3bb4fda004 | |||
| fbfb9479b2 | |||
| 2f3e2a6c96 | |||
| 23cfe11e44 | |||
| 7acd2e3b07 | |||
| bd2755a302 | |||
| 55fc8d7388 | |||
| 8e26dc874f | |||
| 9936c0622a | |||
| 88c9fa8546 | |||
| f12424272f | |||
| ea3e54b255 | |||
| 32b13bcdfe | |||
| f56ae1a70d | |||
| 41109f0bc0 | |||
| dd9ce34079 | |||
| fc6d12ad3e | |||
| 7a181ff9ac | |||
| 32e674f26c | |||
| 7cbc887ea0 | |||
| 1cda67bcdb | |||
| 3c667d38e6 | |||
| 396686ee77 | |||
| e014e186f9 | |||
| 4bf9128cac | |||
| f6020e68a4 | |||
| a86a552a85 | |||
| b91b1ad1de | |||
| 7c1b58d703 | |||
| ab90797b65 | |||
| 230b08ab86 | |||
| a9e621721e | |||
| 4c8df2d4c0 | |||
| 3b737f8e2b | |||
| aa5977b153 | |||
| 7e35f6a903 | |||
| 18b8c32758 | |||
| 8fd49389f3 | |||
| 4b2df7504e | |||
| b60a716e00 | |||
| bf4adf0546 | |||
| fd738f8425 | |||
| ab1d7ba992 | |||
| db73802af9 | |||
| 4ea137db1f | |||
| e20961fb3a | |||
| 53329e48bc | |||
| 79b4187f30 | |||
| 4ad6c255d6 | |||
| 77f99e7761 | |||
| da710e26e1 | |||
| 020165168c | |||
| d259b82763 | |||
| 8475bc52fa | |||
| bd5ba19e17 | |||
| 11b0d50751 | |||
| e15546541e | |||
| 1d696ba0d6 | |||
| 95c7ca8427 | |||
| a57c8472c9 | |||
| 6284d71281 | |||
| ca5e9ca743 | |||
| 6f08079953 | |||
| 0701a795c2 | |||
| 9df4fcbbb6 | |||
| 3dd4f01370 | |||
| 2d7dfdd7a0 | |||
| 869b50fca9 | |||
| 08e9ff398f | |||
| e97f66b0c3 | |||
| c6b8665edd | |||
| 15e13b2190 | |||
| 40cb37b2e8 | |||
| d77d97d301 | |||
| 2d3701d7e9 | |||
| 49cff40e96 | |||
| 99e9568b58 | |||
| 42fd15d54c | |||
| 99fe53fbca | |||
| a60ac39aa6 | |||
| 3962e2c031 | |||
| 55c507c423 | |||
| ad9b68aea6 | |||
| 21a5c29aa8 | |||
| c9635c4a71 | |||
| 961b8224ef | |||
| 51e6c76511 | |||
| 8429ad28d9 | |||
| 8ce9f970f0 | |||
| 145e2ab5e5 | |||
| aca2712161 | |||
| 3c8aaaecd1 | |||
| b6b04f99d8 | |||
| cef4e2dfc1 | |||
| 68cca6069b | |||
| d0ac6b1f52 | |||
| 76fadd1466 | |||
| e1b80882af | |||
| 7dbb9214d2 |
@ -1,8 +0,0 @@
|
||||
{
|
||||
"upstream": "elastic/elasticsearch-js",
|
||||
"branches": [
|
||||
{ "name": "15.x", "checked": true },
|
||||
"14.x"
|
||||
],
|
||||
"labels": ["backport"]
|
||||
}
|
||||
11
.ci/Dockerfile
Normal file
11
.ci/Dockerfile
Normal file
@ -0,0 +1,11 @@
|
||||
ARG NODE_JS_VERSION=10
|
||||
FROM node:${NODE_JS_VERSION}
|
||||
|
||||
# Create app directory
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
# Install app dependencies
|
||||
COPY package*.json ./
|
||||
RUN npm install
|
||||
|
||||
COPY . .
|
||||
20
.ci/certs/ca.crt
Executable file
20
.ci/certs/ca.crt
Executable file
@ -0,0 +1,20 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIDSTCCAjGgAwIBAgIUIwN+0zglsexRKwE1RGHvlCcmrdwwDQYJKoZIhvcNAQEL
|
||||
BQAwNDEyMDAGA1UEAxMpRWxhc3RpYyBDZXJ0aWZpY2F0ZSBUb29sIEF1dG9nZW5l
|
||||
cmF0ZWQgQ0EwHhcNMTkwMjEzMDcyMjQwWhcNMjIwMjEyMDcyMjQwWjA0MTIwMAYD
|
||||
VQQDEylFbGFzdGljIENlcnRpZmljYXRlIFRvb2wgQXV0b2dlbmVyYXRlZCBDQTCC
|
||||
ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANILs0JO0e7x29zeVx21qalK
|
||||
XKdX+AMlGJPH75wWO/Jq6YHtxt1wYIg762krOBXfG6JsFSOIwIv5VrzGGRGjSPt9
|
||||
OXQyXrDDiQvsBT3rpzLNdDs7KMl2tZswwv7w9ujgud0cYnS1MOpn81rfPc73DvMg
|
||||
xuhplofDx6fn3++PjVRU2FNiIVWyEoaxRjCeGPMBubKZYaYbQA6vYM4Z+ByG727B
|
||||
AyAER3t7xmvYti/EoO2hv2HQk5zgcj/Oq3AJKhnt8LH8fnfm3TnYNM1htvXqhN05
|
||||
vsvhvm2PHfnA5qLlSr/3W0aI/U/PqfsFDCgyRV097sMIaKkmavb0Ue7aQ7lgtp0C
|
||||
AwEAAaNTMFEwHQYDVR0OBBYEFDRKlCMowWR1rwxE0d1lTEQe5O71MB8GA1UdIwQY
|
||||
MBaAFDRKlCMowWR1rwxE0d1lTEQe5O71MA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZI
|
||||
hvcNAQELBQADggEBAKbCJ95EBpeuvF70KEt6QU70k/SH1NRvM9YzKryV0D975Jvu
|
||||
HOSm9HgSTULeAUFZIa4oYyf3QUfVoI+2T/aQrfXA3gfrJWsHURkyNmiHOFAbYHqi
|
||||
xA6i249G2GTEjc1+le/M2N2CcDKAmurW6vSGK4upXQbPd6KmnhHREX74zkWjnOa+
|
||||
+tibbSSOCT4Tmja2DbBxAPuivU9IB1g/hIUmbYQqKffQrBJA0658tz6w63a/Q7xN
|
||||
pCvvbSgiMZ6qcVIcJkBT2IooYie+ax45pQECHthgIUcQAzfmIfqlU0Qfl8rDgAmn
|
||||
0c1o6HQjKGU2aVGgSRuaaiHaSZjbPIZVS51sOoI=
|
||||
-----END CERTIFICATE-----
|
||||
19
.ci/certs/testnode.crt
Executable file
19
.ci/certs/testnode.crt
Executable file
@ -0,0 +1,19 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIDIjCCAgqgAwIBAgIUI4QU6jA1dYSCbdIA6oAb2TBEluowDQYJKoZIhvcNAQEL
|
||||
BQAwNDEyMDAGA1UEAxMpRWxhc3RpYyBDZXJ0aWZpY2F0ZSBUb29sIEF1dG9nZW5l
|
||||
cmF0ZWQgQ0EwHhcNMTkwMjEzMDcyMzEzWhcNMjIwMjEyMDcyMzEzWjATMREwDwYD
|
||||
VQQDEwhpbnN0YW5jZTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJeT
|
||||
yOy6EAScZxrULKjHePciiz38grivCrhFFV+dThaRCcl3DhDzb9Eny5q5iEw3WvLQ
|
||||
Rqmf01jncNIhaocTt66VqveXaMubbE8O0LcG6e4kpFO+JtnVF8JTARTc+ux/1uD6
|
||||
hO1VG/HItM7WQrQxh4hfB2u1AX2YQtoqEtXXEC+UHWfl4QzuzXjBnKCkO/L9/6Tf
|
||||
yNFQWXxKnIiTs8Xm9sEhhSCBJPlLTQu+MX4vR2Uwj5XZmflDUr+ZTenl9qYxL6b3
|
||||
SWhh/qEl4GAj1+tS7ZZOxE0237mUh3IIFYSWSaMm8K2m/BYHkLNWL5B1dMic0lsv
|
||||
osSoYrQuCef4HQMCitsCAwEAAaNNMEswHQYDVR0OBBYEFFMg4l1GLW8lYbwASY+r
|
||||
YeWYRzIiMB8GA1UdIwQYMBaAFDRKlCMowWR1rwxE0d1lTEQe5O71MAkGA1UdEwQC
|
||||
MAAwDQYJKoZIhvcNAQELBQADggEBAEQrgh1xALpumQTzsjxFRGque/vlKTgRs5Kh
|
||||
xtgapr6wjIbdq7dagee+4yNOKzS5lGVXCgwrJlHESv9qY0uumT/33vK2uduJ7NAd
|
||||
fR2ZzyBnhMX+mkYhmGrGYCTUMUIwOIQYa4Evis4W+LHmCIDG03l7gLHfdIBe9VMO
|
||||
pDZum8f6ng0MM49s8/rXODNYKw8kFyUhnfChqMi/2yggb1uUIfKlJJIchkgYjE13
|
||||
zuC+fjo029Pq1jeMIdxugLf/7I/8NiW1Yj9aCXevUXG1qzHFEuKAinBXYOZO/vWS
|
||||
LaEqOhwrzNynwgGpYAr7Rfgv4AflltYIIav4PZT03P7fbyAAf8s=
|
||||
-----END CERTIFICATE-----
|
||||
27
.ci/certs/testnode.key
Executable file
27
.ci/certs/testnode.key
Executable file
@ -0,0 +1,27 @@
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIIEpQIBAAKCAQEAl5PI7LoQBJxnGtQsqMd49yKLPfyCuK8KuEUVX51OFpEJyXcO
|
||||
EPNv0SfLmrmITDda8tBGqZ/TWOdw0iFqhxO3rpWq95doy5tsTw7Qtwbp7iSkU74m
|
||||
2dUXwlMBFNz67H/W4PqE7VUb8ci0ztZCtDGHiF8Ha7UBfZhC2ioS1dcQL5QdZ+Xh
|
||||
DO7NeMGcoKQ78v3/pN/I0VBZfEqciJOzxeb2wSGFIIEk+UtNC74xfi9HZTCPldmZ
|
||||
+UNSv5lN6eX2pjEvpvdJaGH+oSXgYCPX61Ltlk7ETTbfuZSHcggVhJZJoybwrab8
|
||||
FgeQs1YvkHV0yJzSWy+ixKhitC4J5/gdAwKK2wIDAQABAoIBAQCRFTJna/xy/WUu
|
||||
59FLR4qAOj8++JgCwACpue4oU7/vl6nffSYokWoAr2+RzG4qTX2vFi3cpA8+dGCn
|
||||
sLZvTi8tWzKGxBTZdg2oakzaMzLr74SeZ052iCGyrZJGbvF6Ny7srr1XEXSq6+os
|
||||
ZCb6pMHOhO7saBdiKMAsY8MdjTl/33AduuE6ztqv+L92xTr2g4QlbT1KvWlEgppU
|
||||
k4Gy7zdETkPBTSH/17ZwyGJoJICIAhbL4IpmOM4dPIg8nFkVPPpy6p0z4uGjtgnK
|
||||
nreZ2EKMzCafBaHn7A77gpi0OrQdl6pe0fsGqv/323YjCJPbwwl5TsoNq44DzwiX
|
||||
3M7XiVJxAoGBAOCne56vdN4uZmCgLVGT2JSUNVPOu4bfjrxWH6cslzrPT2Zhp3lO
|
||||
M4axZ3gmcervV252YEZXntXDHHCSfrECllRN1WFD63XmyQ/CkhuvZkkeRHfzL1TE
|
||||
EdqHOTqs4sRETZ7+RITFC81DZQkWWOKeyXMjyPBqd7RnThQHijB1c8Y5AoGBAKy6
|
||||
CVKBx+zz5crVD0tz4UhOmz1wRNN0CL0l+FXRuFSgbzMIvwpfiqe25crgeLHe2M2/
|
||||
TogdWbjZ2nUZQTzoRsSkQ6cKHpj+G/gWurp/UcHHXFVwgLSPF7c3KHDtiYq7Vqw0
|
||||
bvmhM03LI6+ZIPRV7hLBr7WP7UmpAiREMF7tTnmzAoGBAIkx3w3WywFQxtblmyeB
|
||||
qbd7F2IaE23XoxyjX+tBEQ4qQqwcoSE0v8TXHIBEwjceeX+NLVhn9ClJYVniLRq+
|
||||
oL3VVqVyzB4RleJZCc98e3PV1yyFx/b1Uo3pHOsXX9lKeTjKwV9v0rhFGzPEgP3M
|
||||
yOvXA8TG0FnM6OLUg/D6GX0JAoGAMuHS4TVOGeV3ahr9mHKYiN5vKNgrzka+VEod
|
||||
L9rJ/FQOrfADpyCiDen5I5ygsXU+VM3oanyK88NpcVlxOGoMft0M+OYoQVWKE7lO
|
||||
ZKYhBX6fGqQ7pfUJPXXIOgwfmni5fZ0sm+j63g3bg10OsiumKGxaQJgXhL1+3gQg
|
||||
Y7ZwibUCgYEAlZoFFvkMLjpOSaHk1z5ZZnt19X0QUIultBwkumSqMPm+Ks7+uDrx
|
||||
thGUCoz4ecr/ci4bIUY7mB+zfAbqnBOMxreJqCRbAIuRypo1IlWkTp8DywoDOfMW
|
||||
NfzjVmzJ7EJu44nGmVAi1jw4Pbseivvi1ujMCoPgaE8I1uSh144bwN8=
|
||||
-----END RSA PRIVATE KEY-----
|
||||
94
.ci/docker-compose.yml
Normal file
94
.ci/docker-compose.yml
Normal file
@ -0,0 +1,94 @@
|
||||
version: '3.2'
|
||||
services:
|
||||
client-oss:
|
||||
image: docker.elastic.co/clients/elasticsearch-js:${NODE_JS_VERSION:-10}
|
||||
build:
|
||||
context: ..
|
||||
dockerfile: .ci/Dockerfile
|
||||
args:
|
||||
NODE_JS_VERSION: ${NODE_JS_VERSION:-10}
|
||||
CODECOV_TOKEN: ${CODECOV_TOKEN}
|
||||
environment:
|
||||
- "TEST_ES_SERVER=http://elasticsearch-oss:9200"
|
||||
volumes:
|
||||
- ..:/usr/src/app
|
||||
# This will mount the node_modules directory
|
||||
# to the host machine using the buildtime directory.
|
||||
- /usr/src/app/node_modules
|
||||
- esvol:/tmp
|
||||
networks:
|
||||
- esnet-oss
|
||||
depends_on:
|
||||
- elasticsearch-oss
|
||||
|
||||
elasticsearch-oss:
|
||||
image: docker.elastic.co/elasticsearch/elasticsearch:${ELASTICSEARCH_VERSION:-7.0.0-beta1}
|
||||
volumes:
|
||||
- esvol:/tmp
|
||||
networks:
|
||||
- esnet-oss
|
||||
environment:
|
||||
- path.repo=/tmp
|
||||
- "repositories.url.allowed_urls=http://snapshot.*"
|
||||
- node.attr.testattr=test
|
||||
- bootstrap.memory_lock=false
|
||||
- "discovery.type=single-node"
|
||||
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
|
||||
|
||||
client-platinum:
|
||||
image: docker.elastic.co/clients/elasticsearch-js:${NODE_JS_VERSION:-10}
|
||||
build:
|
||||
context: ..
|
||||
dockerfile: .ci/Dockerfile
|
||||
args:
|
||||
NODE_JS_VERSION: ${NODE_JS_VERSION:-10}
|
||||
environment:
|
||||
- "TEST_ES_SERVER=https://elastic:changeme@elasticsearch-platinum:9200"
|
||||
volumes:
|
||||
- ..:/usr/src/app
|
||||
# This will mount the node_modules directory
|
||||
# to the host machine using the buildtime directory.
|
||||
- /usr/src/app/node_modules
|
||||
- esvol:/tmp
|
||||
networks:
|
||||
- esnet-platinum
|
||||
depends_on:
|
||||
- elasticsearch-platinum
|
||||
# there is not need to run again also the unit test
|
||||
command: ["npm", "run", "test:integration"]
|
||||
|
||||
elasticsearch-platinum:
|
||||
image: docker.elastic.co/elasticsearch/elasticsearch:${ELASTICSEARCH_VERSION:-7.0.0-beta1}
|
||||
ports:
|
||||
- "9200:9200"
|
||||
networks:
|
||||
- esnet-platinum
|
||||
environment:
|
||||
- "node.attr.testattr=test"
|
||||
- "path.repo=/tmp"
|
||||
- "repositories.url.allowed_urls=http://snapshot.*"
|
||||
- "discovery.type=single-node"
|
||||
- "ES_JAVA_OPTS=-Xms1g -Xmx1g"
|
||||
- "ELASTIC_PASSWORD=changeme"
|
||||
- "xpack.security.enabled=true"
|
||||
- "xpack.license.self_generated.type=trial"
|
||||
- "xpack.security.http.ssl.enabled=true"
|
||||
- "xpack.security.http.ssl.verification_mode=certificate"
|
||||
- "xpack.security.http.ssl.key=certs/testnode.key"
|
||||
- "xpack.security.http.ssl.certificate=certs/testnode.crt"
|
||||
- "xpack.security.http.ssl.certificate_authorities=certs/ca.crt"
|
||||
- "xpack.security.transport.ssl.enabled=true"
|
||||
- "xpack.security.transport.ssl.key=certs/testnode.key"
|
||||
- "xpack.security.transport.ssl.certificate=certs/testnode.crt"
|
||||
- "xpack.security.transport.ssl.certificate_authorities=certs/ca.crt"
|
||||
volumes:
|
||||
- "./certs/testnode.crt:/usr/share/elasticsearch/config/certs/testnode.crt"
|
||||
- "./certs/testnode.key:/usr/share/elasticsearch/config/certs/testnode.key"
|
||||
- "./certs/ca.crt:/usr/share/elasticsearch/config/certs/ca.crt"
|
||||
|
||||
networks:
|
||||
# we need two networks otherwise the two ES instances will join each other
|
||||
esnet-oss:
|
||||
esnet-platinum:
|
||||
volumes:
|
||||
esvol:
|
||||
67
.ci/jobs/defaults.yml
Normal file
67
.ci/jobs/defaults.yml
Normal file
@ -0,0 +1,67 @@
|
||||
---
|
||||
|
||||
##### GLOBAL METADATA
|
||||
|
||||
- meta:
|
||||
cluster: clients-ci
|
||||
|
||||
##### JOB DEFAULTS
|
||||
|
||||
- job:
|
||||
project-type: matrix
|
||||
logrotate:
|
||||
daysToKeep: 30
|
||||
numToKeep: 100
|
||||
properties:
|
||||
- github:
|
||||
url: https://github.com/elastic/elasticsearch-js/
|
||||
- inject:
|
||||
properties-content: HOME=$JENKINS_HOME
|
||||
concurrent: true
|
||||
node: flyweight
|
||||
scm:
|
||||
- git:
|
||||
name: origin
|
||||
credentials-id: f6c7695a-671e-4f4f-a331-acdce44ff9ba
|
||||
reference-repo: /var/lib/jenkins/.git-references/elasticsearch-js.git
|
||||
branches:
|
||||
- ${branch_specifier}
|
||||
url: https://github.com/elastic/elasticsearch-js.git
|
||||
wipe-workspace: 'True'
|
||||
triggers:
|
||||
- github
|
||||
vault:
|
||||
# vault read auth/approle/role/clients-ci/role-id
|
||||
role_id: ddbd0d44-0e51-105b-177a-c8fdfd445126
|
||||
axes:
|
||||
- axis:
|
||||
type: slave
|
||||
name: label
|
||||
values:
|
||||
- linux
|
||||
- axis:
|
||||
type: yaml
|
||||
filename: .ci/test-matrix.yml
|
||||
name: ELASTICSEARCH_VERSION
|
||||
- axis:
|
||||
type: yaml
|
||||
filename: .ci/test-matrix.yml
|
||||
name: NODE_JS_VERSION
|
||||
yaml-strategy:
|
||||
exclude-key: exclude
|
||||
filename: .ci/test-matrix.yml
|
||||
wrappers:
|
||||
- ansicolor
|
||||
- timeout:
|
||||
type: absolute
|
||||
timeout: 120
|
||||
fail: true
|
||||
- timestamps
|
||||
- workspace-cleanup
|
||||
builders:
|
||||
- shell: |-
|
||||
#!/usr/local/bin/runbld
|
||||
.ci/run-tests
|
||||
publishers:
|
||||
- email:
|
||||
recipients: infra-root+build@elastic.co
|
||||
14
.ci/jobs/elastic+elasticsearch-js+5.x.yml
Normal file
14
.ci/jobs/elastic+elasticsearch-js+5.x.yml
Normal file
@ -0,0 +1,14 @@
|
||||
---
|
||||
- job:
|
||||
name: elastic+elasticsearch-js+5.x
|
||||
display-name: 'elastic / elasticsearch-js # 5.x'
|
||||
description: Testing the elasticsearch-js 5.x branch.
|
||||
parameters:
|
||||
- string:
|
||||
name: branch_specifier
|
||||
default: refs/heads/5.x
|
||||
description: the Git branch specifier to build (<branchName>, <tagName>,
|
||||
<commitId>, etc.)
|
||||
triggers:
|
||||
- github
|
||||
- timed: '@weekly'
|
||||
14
.ci/jobs/elastic+elasticsearch-js+6.x.yml
Normal file
14
.ci/jobs/elastic+elasticsearch-js+6.x.yml
Normal file
@ -0,0 +1,14 @@
|
||||
---
|
||||
- job:
|
||||
name: elastic+elasticsearch-js+6.x
|
||||
display-name: 'elastic / elasticsearch-js # 6.x'
|
||||
description: Testing the elasticsearch-js 6.x branch.
|
||||
parameters:
|
||||
- string:
|
||||
name: branch_specifier
|
||||
default: refs/heads/6.x
|
||||
description: the Git branch specifier to build (<branchName>, <tagName>,
|
||||
<commitId>, etc.)
|
||||
triggers:
|
||||
- github
|
||||
- timed: '@weekly'
|
||||
14
.ci/jobs/elastic+elasticsearch-js+7.x.yml
Normal file
14
.ci/jobs/elastic+elasticsearch-js+7.x.yml
Normal file
@ -0,0 +1,14 @@
|
||||
---
|
||||
- job:
|
||||
name: elastic+elasticsearch-js+7.x
|
||||
display-name: 'elastic / elasticsearch-js # 7.x'
|
||||
description: Testing the elasticsearch-js 7.x branch.
|
||||
parameters:
|
||||
- string:
|
||||
name: branch_specifier
|
||||
default: refs/heads/7.x
|
||||
description: the Git branch specifier to build (<branchName>, <tagName>,
|
||||
<commitId>, etc.)
|
||||
triggers:
|
||||
- github
|
||||
- timed: '@weekly'
|
||||
14
.ci/jobs/elastic+elasticsearch-js+master.yml
Normal file
14
.ci/jobs/elastic+elasticsearch-js+master.yml
Normal file
@ -0,0 +1,14 @@
|
||||
---
|
||||
- job:
|
||||
name: elastic+elasticsearch-js+master
|
||||
display-name: 'elastic / elasticsearch-js # master'
|
||||
description: Testing the elasticsearch-js master branch.
|
||||
parameters:
|
||||
- string:
|
||||
name: branch_specifier
|
||||
default: refs/heads/master
|
||||
description: the Git branch specifier to build (<branchName>, <tagName>,
|
||||
<commitId>, etc.)
|
||||
triggers:
|
||||
- github
|
||||
- timed: '@daily'
|
||||
19
.ci/jobs/elastic+elasticsearch-js+pull-request.yml
Normal file
19
.ci/jobs/elastic+elasticsearch-js+pull-request.yml
Normal file
@ -0,0 +1,19 @@
|
||||
---
|
||||
- job:
|
||||
name: elastic+elasticsearch-js+pull-request
|
||||
display-name: 'elastic / elasticsearch-js # pull-request'
|
||||
description: Testing of elasticsearch-js pull requests.
|
||||
scm:
|
||||
- git:
|
||||
branches:
|
||||
- ${ghprbActualCommit}
|
||||
refspec: +refs/pull/*:refs/remotes/origin/pr/*
|
||||
triggers:
|
||||
- github-pull-request:
|
||||
org-list:
|
||||
- elastic
|
||||
allow-whitelist-orgs-as-admins: true
|
||||
github-hooks: true
|
||||
status-context: clients-ci
|
||||
cancel-builds-on-update: true
|
||||
publishers: []
|
||||
100
.ci/run-tests
100
.ci/run-tests
@ -10,5 +10,101 @@
|
||||
# - $NODE_JS_VERSION
|
||||
#
|
||||
|
||||
# TODO: implement the docker-based testing
|
||||
echo docker-compose [...]
|
||||
set -eo pipefail
|
||||
|
||||
set +x
|
||||
export VAULT_TOKEN=$(vault write -field=token auth/approle/login role_id="$VAULT_ROLE_ID" secret_id="$VAULT_SECRET_ID")
|
||||
export CODECOV_TOKEN=$(vault read -field=token secret/clients-ci/elasticsearch-js/codecov)
|
||||
unset VAULT_ROLE_ID VAULT_SECRET_ID VAULT_TOKEN
|
||||
set -x
|
||||
|
||||
function cleanup {
|
||||
docker container rm --force --volumes elasticsearch-oss > /dev/null 2>&1 || true
|
||||
docker container rm --force --volumes elasticsearch-platinum > /dev/null 2>&1 || true
|
||||
docker container rm --force --volumes elasticsearch-js-oss > /dev/null 2>&1 || true
|
||||
docker container rm --force --volumes elasticsearch-js-platinum > /dev/null 2>&1 || true
|
||||
docker network rm esnet-oss > /dev/null
|
||||
docker network rm esnet-platinum > /dev/null
|
||||
}
|
||||
|
||||
trap cleanup EXIT
|
||||
|
||||
# create network and volume
|
||||
docker network create esnet-oss
|
||||
docker network create esnet-platinum
|
||||
|
||||
# create client image
|
||||
docker build \
|
||||
--file .ci/Dockerfile \
|
||||
--tag elastic/elasticsearch-js \
|
||||
--build-arg NODE_JS_VERSION=${NODE_JS_VERSION} \
|
||||
.
|
||||
|
||||
# run elasticsearch oss
|
||||
docker run \
|
||||
--rm \
|
||||
--env "node.attr.testattr=test" \
|
||||
--env "path.repo=/tmp" \
|
||||
--env "repositories.url.allowed_urls=http://snapshot.*" \
|
||||
--env "discovery.type=single-node" \
|
||||
--network=esnet-oss \
|
||||
--name=elasticsearch-oss \
|
||||
--detach \
|
||||
docker.elastic.co/elasticsearch/elasticsearch-oss:${ELASTICSEARCH_VERSION}
|
||||
|
||||
# run elasticsearch platinum
|
||||
repo=$(pwd)
|
||||
testnodecrt="/.ci/certs/testnode.crt"
|
||||
testnodekey="/.ci/certs/testnode.key"
|
||||
cacrt="/.ci/certs/ca.crt"
|
||||
|
||||
docker run \
|
||||
--rm \
|
||||
--env "node.attr.testattr=test" \
|
||||
--env "path.repo=/tmp" \
|
||||
--env "repositories.url.allowed_urls=http://snapshot.*" \
|
||||
--env "discovery.type=single-node" \
|
||||
--env "ES_JAVA_OPTS=-Xms1g -Xmx1g" \
|
||||
--env "ELASTIC_PASSWORD=changeme" \
|
||||
--env "xpack.security.enabled=true" \
|
||||
--env "xpack.license.self_generated.type=trial" \
|
||||
--env "xpack.security.http.ssl.enabled=true" \
|
||||
--env "xpack.security.http.ssl.verification_mode=certificate" \
|
||||
--env "xpack.security.http.ssl.key=certs/testnode.key" \
|
||||
--env "xpack.security.http.ssl.certificate=certs/testnode.crt" \
|
||||
--env "xpack.security.http.ssl.certificate_authorities=certs/ca.crt" \
|
||||
--env "xpack.security.transport.ssl.enabled=true" \
|
||||
--env "xpack.security.transport.ssl.key=certs/testnode.key" \
|
||||
--env "xpack.security.transport.ssl.certificate=certs/testnode.crt" \
|
||||
--env "xpack.security.transport.ssl.certificate_authorities=certs/ca.crt" \
|
||||
--volume "$repo$testnodecrt:/usr/share/elasticsearch/config/certs/testnode.crt" \
|
||||
--volume "$repo$testnodekey:/usr/share/elasticsearch/config/certs/testnode.key" \
|
||||
--volume "$repo$cacrt:/usr/share/elasticsearch/config/certs/ca.crt" \
|
||||
--network=esnet-platinum \
|
||||
--name=elasticsearch-platinum \
|
||||
--detach \
|
||||
docker.elastic.co/elasticsearch/elasticsearch:${ELASTICSEARCH_VERSION}
|
||||
|
||||
# run the client unit and oss integration test
|
||||
docker run \
|
||||
--network=esnet-oss \
|
||||
--env "TEST_ES_SERVER=http://elasticsearch-oss:9200" \
|
||||
--env "CODECOV_TOKEN" \
|
||||
--volume $repo:/usr/src/app \
|
||||
--volume /usr/src/app/node_modules \
|
||||
--name elasticsearch-js-oss \
|
||||
--rm \
|
||||
elastic/elasticsearch-js \
|
||||
npm run ci
|
||||
|
||||
# run the client platinium integration test
|
||||
docker run \
|
||||
--network=esnet-platinum \
|
||||
--env "TEST_ES_SERVER=https://elastic:changeme@elasticsearch-platinum:9200" \
|
||||
--volume $repo:/usr/src/app \
|
||||
--volume /usr/src/app/node_modules \
|
||||
--name elasticsearch-js-platinum \
|
||||
--rm \
|
||||
elastic/elasticsearch-js \
|
||||
npm run test:integration
|
||||
|
||||
|
||||
@ -1,10 +1,12 @@
|
||||
---
|
||||
ELASTICSEARCH_VERSION:
|
||||
- 6.4.0
|
||||
- 7.2.0
|
||||
- 7.1.0
|
||||
- 7.0.0
|
||||
|
||||
NODE_JS_VERSION:
|
||||
- 10
|
||||
- 8
|
||||
- 6
|
||||
- 12
|
||||
- 10
|
||||
- 8
|
||||
|
||||
exclude: ~
|
||||
|
||||
14
.codecov.yml
Normal file
14
.codecov.yml
Normal file
@ -0,0 +1,14 @@
|
||||
comment: off
|
||||
|
||||
coverage:
|
||||
precision: 2
|
||||
round: down
|
||||
range: "90...100"
|
||||
|
||||
status:
|
||||
project: yes
|
||||
patch: yes
|
||||
changes: no
|
||||
|
||||
ignore:
|
||||
- "api"
|
||||
5
.dockerignore
Normal file
5
.dockerignore
Normal file
@ -0,0 +1,5 @@
|
||||
node_modules
|
||||
npm-debug.log
|
||||
test/benchmarks
|
||||
elasticsearch
|
||||
.git
|
||||
@ -1,5 +0,0 @@
|
||||
src/_*
|
||||
src/bower_es_js
|
||||
src/lib/apis
|
||||
docs
|
||||
bower_components
|
||||
41
.eslintrc
41
.eslintrc
@ -1,41 +0,0 @@
|
||||
---
|
||||
extends: "@spalger/personal/es6"
|
||||
|
||||
env:
|
||||
node: true
|
||||
|
||||
rules:
|
||||
comma-dangle: off
|
||||
semi: off
|
||||
func-names: off
|
||||
no-var: off
|
||||
vars-on-top: off
|
||||
new-cap: off
|
||||
global-require: off
|
||||
no-param-reassign: off
|
||||
padded-blocks: off
|
||||
brace-style: off
|
||||
consistent-return: off
|
||||
default-case: off
|
||||
dot-notation: off
|
||||
eqeqeq: warn
|
||||
max-len: off
|
||||
no-cond-assign: off
|
||||
no-console: off
|
||||
no-else-return: off
|
||||
no-empty: off
|
||||
no-restricted-syntax: warn
|
||||
no-shadow: warn
|
||||
no-undef: warn
|
||||
no-underscore-dangle: off
|
||||
no-unused-expressions: error
|
||||
no-unused-vars: error
|
||||
no-use-before-define: off
|
||||
object-shorthand: off
|
||||
one-var: off
|
||||
one-var-declaration-per-line: off
|
||||
prefer-arrow-callback: off
|
||||
prefer-rest-params: off
|
||||
prefer-template: off
|
||||
quote-props: off
|
||||
yoda: off
|
||||
10
.github/ISSUE_TEMPLATE.md
vendored
Normal file
10
.github/ISSUE_TEMPLATE.md
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
## 👉 [Please follow one of these issue templates](https://github.com/elastic/elasticsearch-js/issues/new/choose) 👈
|
||||
|
||||
#### You have already researched for similar issues?
|
||||
It's not uncommon that somebody already opened an issue or in the best case it's already fixed but not merged. That's the reason why you should [search](https://github.com/elastic/elasticsearch-js/issues) at first before submitting a new one.
|
||||
|
||||
#### Are you sure this is an issue with @elastic/elasticsearch or are you just looking for some help?
|
||||
|
||||
Issues should only be posted in this repository after you have been able to reproduce them and confirm that they are a bug or incorrect/missing information in the [docs](https://github.com/elastic/elasticsearch-js/docs).
|
||||
|
||||
If you have a question related to Elasticsearch itself, please consider open a question on [discuss.elastic.co](https://discuss.elastic.co/).
|
||||
41
.github/ISSUE_TEMPLATE/bug.md
vendored
Normal file
41
.github/ISSUE_TEMPLATE/bug.md
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
---
|
||||
name: 🐛 Bug report
|
||||
about: Create a report to help us improve
|
||||
---
|
||||
|
||||
It's not uncommon that somebody already opened an issue or in the best case it's already fixed but not merged. That's the reason why you should [search](https://github.com/elastic/elasticsearch-js/issues) at first before submitting a new one.
|
||||
|
||||
**Please read this entire template before posting any issue. If you ignore these instructions
|
||||
and post an issue here that does not follow the instructions, your issue might be closed,
|
||||
locked, and assigned the `not reproducible` label.**
|
||||
|
||||
## 🐛 Bug Report
|
||||
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
## To Reproduce
|
||||
|
||||
Steps to reproduce the behavior:
|
||||
|
||||
Paste your code here:
|
||||
|
||||
```js
|
||||
|
||||
```
|
||||
|
||||
## Expected behavior
|
||||
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
Paste the results here:
|
||||
|
||||
```js
|
||||
|
||||
```
|
||||
|
||||
## Your Environment
|
||||
|
||||
- *node version*: 6,8,10
|
||||
- *@elastic/elasticsearch version*: >=7.0.0
|
||||
- *os*: Mac, Windows, Linux
|
||||
- *any other relevant information*
|
||||
22
.github/ISSUE_TEMPLATE/feature.md
vendored
Normal file
22
.github/ISSUE_TEMPLATE/feature.md
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
---
|
||||
name: 🚀 Feature Proposal
|
||||
about: Submit a proposal for a new feature
|
||||
---
|
||||
|
||||
It's not uncommon that somebody already opened an issue or in the best case it's already fixed but not merged. That's the reason why you should [search](https://github.com/elastic/elasticsearch-js/issues) at first before submitting a new one.
|
||||
|
||||
**Please read this entire template before posting any issue. If you ignore these instructions
|
||||
and post an issue here that does not follow the instructions, your issue might be closed,
|
||||
locked, and assigned the `invalid` label.**
|
||||
|
||||
## 🚀 Feature Proposal
|
||||
|
||||
A clear and concise description of what the feature is.
|
||||
|
||||
## Motivation
|
||||
|
||||
Please outline the motivation for the proposal.
|
||||
|
||||
## Example
|
||||
|
||||
Please provide an example for how this feature would be used.
|
||||
10
.github/ISSUE_TEMPLATE/question.md
vendored
Normal file
10
.github/ISSUE_TEMPLATE/question.md
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
---
|
||||
name: 💬 Questions / Help
|
||||
about: If you have questions, please check our Gitter or Help repo
|
||||
---
|
||||
|
||||
## 💬 Questions and Help
|
||||
|
||||
### Please note that this issue tracker is not a help forum and this issue may be closed.
|
||||
|
||||
It's not uncommon that somebody already opened an issue or in the best case it's already fixed but not merged. That's the reason why you should [search](https://github.com/elastic/elasticsearch-js/issues) at first before submitting a new one.
|
||||
47
.github/ISSUE_TEMPLATE/regression.md
vendored
Normal file
47
.github/ISSUE_TEMPLATE/regression.md
vendored
Normal file
@ -0,0 +1,47 @@
|
||||
---
|
||||
name: 💥 Regression Report
|
||||
about: Report unexpected behavior that worked in previous versions
|
||||
---
|
||||
|
||||
It's not uncommon that somebody already opened an issue or in the best case it's already fixed but not merged. That's the reason why you should [search](https://github.com/elastic/elasticsearch-js/issues) at first before submitting a new one.
|
||||
|
||||
**Please read this entire template before posting any issue. If you ignore these instructions
|
||||
and post an issue here that does not follow the instructions, your issue might be closed,
|
||||
locked, and assigned the `invalid` label.**
|
||||
|
||||
## 💥 Regression Report
|
||||
|
||||
A clear and concise description of what the regression is.
|
||||
|
||||
## Last working version
|
||||
|
||||
Worked up to version:
|
||||
|
||||
Stopped working in version:
|
||||
|
||||
## To Reproduce
|
||||
|
||||
Steps to reproduce the behavior:
|
||||
|
||||
Paste your code here:
|
||||
|
||||
```js
|
||||
|
||||
```
|
||||
|
||||
## Expected behavior
|
||||
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
Paste the results here:
|
||||
|
||||
```js
|
||||
|
||||
```
|
||||
|
||||
## Your Environment
|
||||
|
||||
- *node version*: 6,8,10
|
||||
- *@elastic/elasticsearch version*: >=7.0.0
|
||||
- *os*: Mac, Windows, Linux
|
||||
- *any other relevant information*
|
||||
6
.github/ISSUE_TEMPLATE/security.md
vendored
Normal file
6
.github/ISSUE_TEMPLATE/security.md
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
name: 👮 Security Issue
|
||||
about: Responsible Disclosure
|
||||
---
|
||||
|
||||
If you want to report a security issue, please take a look at [elastic/security](https://www.elastic.co/community/security).
|
||||
17
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
17
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
<!--
|
||||
|
||||
Hello there!
|
||||
|
||||
Thank you for opening a pull request!
|
||||
Please remember to always tag the relative issue (if any) and give a brief explanation on what your changes are doing.
|
||||
|
||||
If you are patching a security issue, please take a look at https://www.elastic.co/community/security
|
||||
|
||||
Finally, please make sure you have signed the Contributor License Agreement
|
||||
We are not asking you to assign copyright to us, but to give us the right to distribute your code without restriction.
|
||||
We ask this of all contributors in order to assure our users of the origin and continuing existence of the code. You only need to sign the CLA once.
|
||||
https://www.elastic.co/contributor-agreement/
|
||||
|
||||
Happy coding!
|
||||
|
||||
-->
|
||||
24
.github/stale.yml
vendored
Normal file
24
.github/stale.yml
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
# Number of days of inactivity before an issue becomes stale
|
||||
daysUntilStale: 15
|
||||
|
||||
# Number of days of inactivity before a stale issue is closed
|
||||
daysUntilClose: 7
|
||||
|
||||
# Issues with these labels will never be considered stale
|
||||
exemptLabels:
|
||||
- "discussion"
|
||||
- "feature request"
|
||||
- "bug"
|
||||
|
||||
# Label to use when marking an issue as stale
|
||||
staleLabel: stale
|
||||
|
||||
# Comment to post when marking an issue as stale. Set to `false` to disable
|
||||
markComment: |
|
||||
We understand that this might be important for you, but this issue has been automatically marked as stale because it has not had recent activity either from our end or yours.
|
||||
It will be closed if no further activity occurs, please write a comment if you would like to keep this going.
|
||||
|
||||
Note: in the past months we have built a new client, that has just landed in master. If you want to open an issue or a pr for the legacy client, you should do that in https://github.com/elastic/elasticsearch-js-legacy
|
||||
|
||||
# Comment to post when closing a stale issue. Set to `false` to disable
|
||||
closeComment: false
|
||||
78
.gitignore
vendored
78
.gitignore
vendored
@ -1,25 +1,57 @@
|
||||
.DS_Store
|
||||
dist
|
||||
npm-debug.log
|
||||
node_modules
|
||||
scripts/scratch*
|
||||
test/integration/yaml_suite/log
|
||||
.aws-config.json
|
||||
.idea
|
||||
esvm
|
||||
.es-snapshot-repos
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
|
||||
# Runtime data
|
||||
pids
|
||||
*.pid
|
||||
*.seed
|
||||
|
||||
# Directory for instrumented libs generated by jscoverage/JSCover
|
||||
lib-cov
|
||||
|
||||
# Coverage directory used by tools like istanbul
|
||||
coverage
|
||||
|
||||
# coverage output
|
||||
coverage.lcov
|
||||
|
||||
# nyc test coverage
|
||||
.nyc_output
|
||||
|
||||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
|
||||
.grunt
|
||||
|
||||
# node-waf configuration
|
||||
.lock-wscript
|
||||
|
||||
# Compiled binary addons (http://nodejs.org/api/addons.html)
|
||||
build/Release
|
||||
|
||||
# Dependency directories
|
||||
node_modules
|
||||
jspm_packages
|
||||
|
||||
# Optional npm cache directory
|
||||
.npm
|
||||
|
||||
# Optional REPL history
|
||||
.node_repl_history
|
||||
|
||||
# mac files
|
||||
.DS_Store
|
||||
|
||||
# vim swap files
|
||||
*.swp
|
||||
|
||||
## generated files
|
||||
test/integration/yaml_suite/yaml_tests*.json
|
||||
test/integration/yaml_suite/index*.js
|
||||
src/_elasticsearch*
|
||||
src/bower*/
|
||||
junit-*.xml
|
||||
elasticsearch*.log
|
||||
sauce_connect.lo*
|
||||
coverage.html
|
||||
.snapshots
|
||||
html_docs
|
||||
/elasticsearch-*.tgz
|
||||
yarn.lock
|
||||
package-lock.json
|
||||
|
||||
# elasticsearch repo or binary files
|
||||
elasticsearch*
|
||||
|
||||
# Generated typings, we don't commit them
|
||||
# because we should copy them in the main .d.ts file
|
||||
api/generated.d.ts
|
||||
|
||||
test/benchmarks/macro/fixtures/*
|
||||
|
||||
@ -1 +0,0 @@
|
||||
8
|
||||
99
.npmignore
99
.npmignore
@ -1,37 +1,72 @@
|
||||
dist
|
||||
bower_components
|
||||
npm-debug.log
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
|
||||
# Runtime data
|
||||
pids
|
||||
*.pid
|
||||
*.seed
|
||||
|
||||
# Directory for instrumented libs generated by jscoverage/JSCover
|
||||
lib-cov
|
||||
|
||||
# Coverage directory used by tools like istanbul
|
||||
coverage
|
||||
|
||||
# coverage output
|
||||
coverage.lcov
|
||||
|
||||
# nyc test coverage
|
||||
.nyc_output
|
||||
|
||||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
|
||||
.grunt
|
||||
|
||||
# node-waf configuration
|
||||
.lock-wscript
|
||||
|
||||
# Compiled binary addons (http://nodejs.org/api/addons.html)
|
||||
build/Release
|
||||
|
||||
# Dependency directories
|
||||
node_modules
|
||||
scripts/scratch*
|
||||
test/integration/yaml_suite/log
|
||||
.aws-config.json
|
||||
.idea
|
||||
esvm
|
||||
jspm_packages
|
||||
|
||||
## generated files
|
||||
test/integration/yaml_suite/yaml_tests*.json
|
||||
test/integration/yaml_suite/index*.js
|
||||
src/_elasticsearch*/
|
||||
src/bower*/
|
||||
junit-*.xml
|
||||
elasticsearch*.log
|
||||
sauce_connect.lo*
|
||||
coverage.html
|
||||
.snapshots
|
||||
html_docs
|
||||
/elasticsearch-*.tgz
|
||||
yarn.lock
|
||||
# Optional npm cache directory
|
||||
.npm
|
||||
|
||||
## just in .npmignore
|
||||
.eslintrc
|
||||
# Optional REPL history
|
||||
.node_repl_history
|
||||
|
||||
# mac files
|
||||
.DS_Store
|
||||
|
||||
# vim swap files
|
||||
*.swp
|
||||
|
||||
package-lock.json
|
||||
|
||||
# elasticsearch repo or binary files
|
||||
elasticsearch*
|
||||
|
||||
# Generated typings, we don't commit them
|
||||
# because we should copy them in the main .d.ts file
|
||||
api/generated.d.ts
|
||||
|
||||
# Ignore doc folder
|
||||
docs
|
||||
|
||||
# Ignore test folder
|
||||
test
|
||||
|
||||
# Ignore scripts folder
|
||||
scripts
|
||||
|
||||
# ci configuration
|
||||
.ci
|
||||
.travis.yml
|
||||
CHANGELOG.md
|
||||
certs
|
||||
.github
|
||||
CODE_OF_CONDUCT.md
|
||||
CONTRIBUTING.md
|
||||
docs/
|
||||
grunt/
|
||||
Gruntfile.js
|
||||
scripts/
|
||||
test/
|
||||
webpack_config/
|
||||
.eslintignore
|
||||
.node-version
|
||||
|
||||
21
.travis.yml
Normal file
21
.travis.yml
Normal file
@ -0,0 +1,21 @@
|
||||
dist: trusty
|
||||
|
||||
sudo: required
|
||||
|
||||
language: node_js
|
||||
|
||||
node_js:
|
||||
- "12"
|
||||
- "10"
|
||||
- "8"
|
||||
|
||||
install:
|
||||
- npm install
|
||||
|
||||
script:
|
||||
- npm run license-checker && npm run test
|
||||
|
||||
notifications:
|
||||
email:
|
||||
on_success: never
|
||||
on_failure: always
|
||||
@ -1 +0,0 @@
|
||||
The changelog has moved to https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/changelog.html
|
||||
3
CODE_OF_CONDUCT.md
Normal file
3
CODE_OF_CONDUCT.md
Normal file
@ -0,0 +1,3 @@
|
||||
303 See Other
|
||||
|
||||
Location: https://www.elastic.co/community/codeofconduct
|
||||
160
CONTRIBUTING.md
160
CONTRIBUTING.md
@ -1,116 +1,100 @@
|
||||
If you have a bugfix or new feature that you would like to contribute to elasticsearch.js please feel free to submit a pull request, or open an issue for discussion. If your change is adding new functionality, you should open an issue ***before*** writing any code.
|
||||
# Contributing to the Elasticsearch Node.js client
|
||||
|
||||
The process for contributing to any of the Elasticsearch repositories is similar.
|
||||
The Elasticsearch Node.js client is open source and we love to receive contributions from our community — you!
|
||||
|
||||
### 1. Lint your codes
|
||||
There are many ways to contribute,
|
||||
from writing tutorials or blog posts,
|
||||
improving the documentation,
|
||||
submitting bug reports and feature requests or writing code.
|
||||
|
||||
While developing, be sure to run eslint on the files you modify.
|
||||
## Repository structure
|
||||
The `master` branch is considered unstable, and it's compatible with Elasticsearch master. Unless you are patching an issue, new features should always be sent to the `master` branch, in case of a bugfix, it depends if the bug affects all the release lines.<br/>
|
||||
There is a branch for every supported release line, such as `7.x` or `6.x`. We release bugfixes as soon as possible, while minor and major releases are published at the same time of the Elastic Stack.
|
||||
|
||||
### 2. Write tests
|
||||
Usually for every release line there will be a *published* version and a *next* version. Eg: the `7.x` branch contains the version published on npm, and bugfixes should be sent there, while `7.2` *(assuming that 7.1.x is released)* contains the next version, and new features should be sent there.
|
||||
|
||||
Please write test cases to exercise your changes.
|
||||
## Code contributions
|
||||
|
||||
### 3. When you are ready, run the test suite
|
||||
If you have a bugfix or new feature that you would like to contribute,
|
||||
please find or open an issue about it first.
|
||||
Talk about what you would like to do.
|
||||
It may be that somebody is already working on it,
|
||||
or that there are particular issues that you should know about before implementing the change.
|
||||
|
||||
1. Install dev dependencies.
|
||||
Note that we strictly follow the [Elastic EOL schedule](https://www.elastic.co/support/eol).
|
||||
|
||||
```sh
|
||||
npm install
|
||||
```
|
||||
### Submitting your changes
|
||||
|
||||
2. Install Grunt.
|
||||
Generally, we require that you test any code you are adding or modifying.
|
||||
Once your changes are ready to submit for review:
|
||||
|
||||
```sh
|
||||
npm install -g grunt-cli
|
||||
```
|
||||
1. Test your changes
|
||||
|
||||
3. Run the tests. Testing the code will lint the project, run the unit tests, install local versions of elasticsearch, and run the integration tests using those installations.
|
||||
Run the test suite to make sure that nothing is broken.
|
||||
Usually run `npm test` is enough, our CI will take care of running the integration test. If you want to run the integration test yourself, see the *Testing* section below.
|
||||
|
||||
```sh
|
||||
grunt test
|
||||
```
|
||||
2. Submit a pull request
|
||||
|
||||
Or to skip the integration tests:
|
||||
Push your local changes to your forked copy of the repository and [submit a pull request](https://help.github.com/articles/using-pull-requests).
|
||||
In the pull request,
|
||||
choose a title which sums up the changes that you have made,
|
||||
and in the body provide more details about what your changes do.
|
||||
Also mention the number of the issue where discussion has taken place,
|
||||
eg "Closes #123".
|
||||
|
||||
```sh
|
||||
grunt unit_test
|
||||
```
|
||||
4. Optionally, run the browser tests. While this step is automated and simple, it can take several minutes for the tests to complete. Unless you are making changes to browser specific portions of the code you can probably let Travis run the browser tests for you.
|
||||
3. Sign the Contributor License Agreement
|
||||
|
||||
Quick Option: Run them locally in your browser
|
||||
```sh
|
||||
grunt browser_clients:build
|
||||
node ./test/utils/server
|
||||
# open http://127.0.0.1:8000/unit.html
|
||||
# open http://127.0.0.1:8000/builds.html
|
||||
```
|
||||
Please make sure you have signed our [Contributor License Agreement](https://www.elastic.co/contributor-agreement/).
|
||||
We are not asking you to assign copyright to us,
|
||||
but to give us the right to distribute your code without restriction.
|
||||
We ask this of all contributors in order to assure our users of the origin and continuing existence of the code.
|
||||
You only need to sign the CLA once.
|
||||
|
||||
Run them on Sauce Labs across several browsers, operating systems, and browser versions
|
||||
```sh
|
||||
grunt browser_clients:test
|
||||
```
|
||||
4. Be patient
|
||||
|
||||
We might not be able to review your code as fast as we would like to,
|
||||
but we'll do our best to dedicate it the attention it deserves.
|
||||
Your effort is much appreciated!
|
||||
|
||||
### 4. Submit a pull request
|
||||
|
||||
Push your local changes a forked copy of the repository and submit a pull request. In the pull request, describe what your changes do and be sure to link to any conversations regarding this implementation, eg "Closes #123".
|
||||
|
||||
### 5. Sign the CLA
|
||||
|
||||
Please make sure you have signed the [Contributor License Agreement](https://www.elastic.co/contributor-agreement/). We are not asking you to assign copyright to us, but to give us the right to distribute your code without restriction. We ask this of all contributors in order to assure our users of the origin and continuing existence of the code. You only need to sign the CLA once.
|
||||
|
||||
### 6. Grab a beer
|
||||
|
||||
There will probably be discussion about the pull request and we will work with you if any changes are needed.
|
||||
|
||||
### 7. Know that we greatly appreciate your help!! :D
|
||||
|
||||
## Generate
|
||||
|
||||
To automatically regenerate elasticsearch-js from elasticsearch master, run the following command:
|
||||
### Code generation
|
||||
|
||||
The entire content of the API folder is generated as well as the `docs/reference.asciidoc` file.<br/>
|
||||
If you want to run the code generation you should run the following command:
|
||||
```sh
|
||||
npm run generate
|
||||
node scripts/generate --tag <tag name>
|
||||
# or
|
||||
node scripts/generate --branch <branch name>
|
||||
```
|
||||
Then you should copy the content of `api/generated.d.ts` into the `index.d.ts` file *(automate this step would be a nice pr!)*.
|
||||
|
||||
## Release
|
||||
### Testing
|
||||
There are different test scripts, usually during development you only need to run `npm test`, but if you want you can run just a part of the suite, following you will find all the testing scripts and what they do.
|
||||
|
||||
Before you attempt to release a new version, make sure you have AWS credentials in the root of this project in the following format:
|
||||
| Script | Description |
|
||||
|---|---|
|
||||
| `npm run test:unit` | Runs the content of the `test/unit` folder. |
|
||||
| `npm run test:behavior` | Runs the content of the `test/behavior` folder. |
|
||||
| `npm run test:types` | Runs the content of the `test/types` folder. |
|
||||
| `npm run test:unit -- --cov --coverage-report=html` | Runs the content of the `test/unit` folder and calculates the code coverage. |
|
||||
| `npm run test:integration` | Runs the integration test runner.<br/>*Note: it requires a living instance of Elasticsearch.* |
|
||||
| `npm run lint` | Run the [linter](https://standardjs.com/). |
|
||||
| `npm run lint:fix` | Fixes the lint errors. |
|
||||
| `npm test` | Runs lint, unit, behavior, and types test. |
|
||||
|
||||
```json
|
||||
{
|
||||
"key": "YOUR_AWS_ACCESS_KEY_ID",
|
||||
"secret": "YOUR_AWS_SECRET_ACCESS_KEY"
|
||||
}
|
||||
```
|
||||
#### Integration test
|
||||
The integration test are generated on the fly by the runner you will find inside `test/integration`, once you execute it, it will clone the Elasticsearch repository and checkout the correct version to grab the [OSS yaml files](https://github.com/elastic/elasticsearch/tree/master/rest-api-spec/src/main/resources/rest-api-spec/test) and the [Elastic licensed yaml files](https://github.com/elastic/elasticsearch/tree/master/x-pack/plugin/src/test/resources/rest-api-spec/test) that will be used for generating the test.
|
||||
|
||||
Also, make sure you have been added as a contributor on npm for both [elasticsearch](https://www.npmjs.com/package/elasticsearch) and [elasticsearch-browser](https://www.npmjs.com/package/elasticsearch-browser).
|
||||
Usually this step is executed by CI since it takes some time, but you can easily run this yourself! Just follow this steps:
|
||||
1. Boot an Elasticsearch instance, you can do that by running `./scripts/es-docker.sh` or `./scripts/es-docker-platinum.sh`, the first one will work only with the OSS APIs, while the second will work also with the Elastic licensed APIs;
|
||||
1. If you are running the OSS test, you should use `npm run test:integration`, otherwise use `TEST_ES_SERVER=https://elastic:changeme@localhost:9200 npm run test:integration`. You can also pass a `-b` parameter if you want the test to bail out at the first failure: `npm run test:integration -- -b`;
|
||||
1. Grab a coffee, it will take some time ;)
|
||||
|
||||
### 1. Bump the package version
|
||||
### Releasing
|
||||
|
||||
```sh
|
||||
grunt version:12.0.0-rc4
|
||||
```
|
||||
If you have access to make releases, the process is as follows:
|
||||
|
||||
After bumping the version, commit and push the changed files.
|
||||
|
||||
### 2. Publish to npm and tag as needed
|
||||
|
||||
```sh
|
||||
npm publish [--tag prerelease]
|
||||
```
|
||||
|
||||
### 3. Release the new builds
|
||||
|
||||
```sh
|
||||
grunt browser_clients:release
|
||||
```
|
||||
|
||||
If this is a prerelease, you will need to modify the `elasticsearch-browser` npm tags
|
||||
|
||||
```sh
|
||||
npm dist-tag add elasticsearch-browser@11.0.1 latest
|
||||
npm dist-tag add elasticsearch-browser@12.0.0-rc4 prerelease
|
||||
```
|
||||
|
||||
Voila! You're all finished.
|
||||
1. Update the version in `package.json` according to the scale of the change. (major, minor or patch)
|
||||
1. Commit changes with message `Bumped vx.y.z` where `x.y.z` is the version in `package.json`
|
||||
1. Create a release via the GitHub UI.
|
||||
1. Wait for CI to finish running the test.
|
||||
1. Publish to npm with `npm publish` *(see [publish](https://docs.npmjs.com/cli/publish) and [dist-tag](https://docs.npmjs.com/cli/dist-tag) docs)*
|
||||
|
||||
21
Gruntfile.js
21
Gruntfile.js
@ -1,21 +0,0 @@
|
||||
module.exports = function (grunt) {
|
||||
// load plugins
|
||||
require('load-grunt-config')(grunt, {
|
||||
configPath: __dirname + '/grunt/config',
|
||||
init: true,
|
||||
config: {
|
||||
distDir: __dirname + '/dist',
|
||||
bowerSubmodule: __dirname + '/src/bower_es_js',
|
||||
meta: {
|
||||
banner: '/*! <%= package.name %> - v<%= package.version %> - ' +
|
||||
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
|
||||
'<%= package.homepage ? " * " + package.homepage + "\\n" : "" %>' +
|
||||
' * Copyright (c) <%= grunt.template.today("yyyy") %> <%= package.author.company %>;' +
|
||||
' Licensed <%= package.license %> */\n'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// load task definitions
|
||||
grunt.loadTasks('grunt');
|
||||
};
|
||||
209
LICENSE
209
LICENSE
@ -1,13 +1,202 @@
|
||||
Copyright 2013 Elasticsearch BV
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License"); you
|
||||
may not use this file except in compliance with the License. You may
|
||||
obtain a copy of the License at
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied. See the License for the specific language governing
|
||||
permissions and limitations under the License.
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
262
README.md
262
README.md
@ -1,120 +1,194 @@
|
||||
# elasticsearch.js 15.4.1
|
||||
<img align="right" width="auto" height="auto" src="https://www.elastic.co/static-res/images/elastic-logo-200.png">
|
||||
|
||||
The official low-level Elasticsearch client for Node.js and the browser.
|
||||
# @elastic/elasticsearch
|
||||
|
||||
[](https://coveralls.io/r/elastic/elasticsearch-js?branch=master)
|
||||
[](https://david-dm.org/elastic/elasticsearch-js)
|
||||
[](http://standardjs.com/) [](https://clients-ci.elastic.co/job/elastic+elasticsearch-js+master/) [](https://codecov.io/gh/elastic/elasticsearch-js) [](https://www.npmjs.com/package/@elastic/elasticsearch)
|
||||
|
||||
---
|
||||
|
||||
**Note:** In the past months we have worked on the new Elasticsearch Node.js client, and if you want you can already try it by following the instructions below, while if you're going to use the legacy one or report an issue, please check out [elastic/elasticsearch-js-legacy](https://github.com/elastic/elasticsearch-js-legacy).
|
||||
|
||||
---
|
||||
|
||||
The official Node.js client for Elasticsearch.
|
||||
|
||||
## Features
|
||||
- One-to-one mapping with REST API.
|
||||
- Generalized, pluggable architecture.
|
||||
- Configurable, automatic discovery of cluster nodes.
|
||||
- Persistent, Keep-Alive connections.
|
||||
- Load balancing (with pluggable selection strategy) across all available nodes.
|
||||
- TypeScript support out of the box.
|
||||
|
||||
- One-to-one mapping with REST API and the other official clients
|
||||
- Generalized, pluggable architecture. See [Extending Core Components](http://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/extending_core_components.html)
|
||||
- Configurable, automatic discovery of cluster nodes
|
||||
- Persistent, Keep-Alive connections
|
||||
- Load balancing (with pluggable selection strategy) across all available nodes.
|
||||
|
||||
## Use in Node.js
|
||||
|
||||
## Install
|
||||
```
|
||||
npm install elasticsearch
|
||||
npm install @elastic/elasticsearch
|
||||
```
|
||||
|
||||
[](https://npmjs.org/package/elasticsearch)
|
||||
### Compatibility
|
||||
|
||||
## Use in the Browser
|
||||
The minimum supported version of Node.js is `v8`.
|
||||
|
||||
Check out the [Browser Builds](http://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/browser-builds.html) doc page for help downloading and setting up the client for use in the browser.
|
||||
The library is compatible with all Elasticsearch versions since 5.x, but you should use the same major version of the Elasticsearch instance that you are using.
|
||||
```
|
||||
# Elasticsearch 7.x
|
||||
@elastic/elasticsearch@7
|
||||
|
||||
## Docs
|
||||
- [Quick Start](http://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/quick-start.html)
|
||||
- [Browser Builds](http://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/browser-builds.html)
|
||||
- [API](http://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html)
|
||||
- [Configuration](http://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/configuration.html)
|
||||
- [Development/Contributing](https://github.com/elastic/elasticsearch-js/blob/master/CONTRIBUTING.md)
|
||||
- [Extending Core Components](http://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/extending_core_components.html)
|
||||
- [Logging](http://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/logging.html)
|
||||
# Elasticsearch 6.x
|
||||
@elastic/elasticsearch@6
|
||||
|
||||
|
||||
## Questions?
|
||||
You can probably find help in [#kibana](https://kiwiirc.com/client/irc.freenode.net/?#kibana) on freenode.
|
||||
|
||||
|
||||
## Supported Elasticsearch Versions
|
||||
|
||||
Elasticsearch.js provides support for, and is regularly tested against, Elasticsearch releases 0.90.12 and greater. We also test against the latest changes in several branches in the Elasticsearch repository. To tell the client which version of Elastisearch you are using, and therefore the API it should provide, set the `apiVersion` config param. [More info](http://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/configuration.html#config-options)
|
||||
|
||||
## Examples
|
||||
|
||||
Create a client instance
|
||||
```js
|
||||
var elasticsearch = require('elasticsearch');
|
||||
var client = new elasticsearch.Client({
|
||||
host: 'localhost:9200',
|
||||
log: 'trace'
|
||||
});
|
||||
# Elasticsearch 5.x
|
||||
@elastic/elasticsearch@5
|
||||
```
|
||||
|
||||
Send a HEAD request to `/` and allow up to 1 second for it to complete.
|
||||
```js
|
||||
client.ping({
|
||||
// ping usually has a 3000ms timeout
|
||||
requestTimeout: 1000
|
||||
}, function (error) {
|
||||
if (error) {
|
||||
console.trace('elasticsearch cluster is down!');
|
||||
} else {
|
||||
console.log('All is well');
|
||||
}
|
||||
});
|
||||
```
|
||||
#### Install multiple versions
|
||||
If you are using multiple versions of Elasticsearch, you need to use multiple versions of the client. In the past, install multiple versions of the same package was not possible, but with `npm v6.9`, you can do that via aliasing.
|
||||
|
||||
Skip the callback to get a promise back
|
||||
```js
|
||||
try {
|
||||
const response = await client.search({
|
||||
q: 'pants'
|
||||
});
|
||||
console.log(response.hits.hits)
|
||||
} catch (error) {
|
||||
console.trace(error.message)
|
||||
The command you must run to install different version of the client is:
|
||||
```sh
|
||||
npm install <alias>@npm:@elastic/elasticsearch@<version>
|
||||
```
|
||||
So for example if you need to install `7.x` and `6.x`, you will run
|
||||
```sh
|
||||
npm install es6@npm:@elastic/elasticsearch@6
|
||||
npm install es7@npm:@elastic/elasticsearch@7
|
||||
```
|
||||
And your `package.json` will look like the following:
|
||||
```json
|
||||
"dependencies": {
|
||||
"es6": "npm:@elastic/elasticsearch@^6.7.0",
|
||||
"es7": "npm:@elastic/elasticsearch@^7.0.0"
|
||||
}
|
||||
```
|
||||
|
||||
Find tweets that have "elasticsearch" in their body field
|
||||
And finally, you will require the packages from your code by using the alias you have defined.
|
||||
```js
|
||||
const response = await client.search({
|
||||
index: 'twitter',
|
||||
type: 'tweets',
|
||||
body: {
|
||||
query: {
|
||||
match: {
|
||||
body: 'elasticsearch'
|
||||
}
|
||||
}
|
||||
}
|
||||
const { Client: Client6 } = require('es6')
|
||||
const { Client: Client7 } = require('es7')
|
||||
|
||||
const client6 = new Client6({ node: 'http://localhost:9200' })
|
||||
const client7 = new Client7({ node: 'http://localhost:9201' })
|
||||
|
||||
client6.info(console.log)
|
||||
client7.info(console.log)
|
||||
```
|
||||
|
||||
Finally, if you want to install the client for the next version of Elasticsearch *(the one that lives in Elasticsearch’s master branch)*, you can use the following command:
|
||||
```sh
|
||||
npm install esmaster@github:elastic/elasticsearch-js
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
You can find the full documentation in our [docs](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/index.html) website.
|
||||
|
||||
```js
|
||||
const { Client } = require('@elastic/elasticsearch')
|
||||
const client = new Client({ node: 'http://localhost:9200' })
|
||||
|
||||
// promise API
|
||||
const result = await client.search({
|
||||
index: 'my-index',
|
||||
body: { foo: 'bar' }
|
||||
})
|
||||
|
||||
for (const tweet of response.hits.hits) {
|
||||
console.log('tweet:', tweet);
|
||||
// callback API
|
||||
client.search({
|
||||
index: 'my-index',
|
||||
body: { foo: 'bar' }
|
||||
}, (err, result) => {
|
||||
if (err) console.log(err)
|
||||
})
|
||||
```
|
||||
The returned value of **every** API call is formed as follows:
|
||||
```ts
|
||||
{
|
||||
body: object | boolean
|
||||
statusCode: number
|
||||
headers: object
|
||||
warnings: [string]
|
||||
meta: object
|
||||
}
|
||||
```
|
||||
### Client options
|
||||
|
||||
The client is designed to be easily configured as you see fit for your needs, following you can see all the possible options that you can use to configure it.
|
||||
|
||||
```ts
|
||||
{
|
||||
// the Elasticsearch endpoint to use
|
||||
node: string | string[];
|
||||
// alias of above
|
||||
nodes: string | string[];
|
||||
// custom connection class
|
||||
Connection: typeof Connection;
|
||||
// custom connection pool class
|
||||
ConnectionPool: typeof ConnectionPool;
|
||||
// custom transport class
|
||||
Transport: typeof Transport;
|
||||
// custom serializer class
|
||||
Serializer: typeof Serializer;
|
||||
// max number of retries for each request
|
||||
maxRetries: number;
|
||||
// max request timeout for each request
|
||||
requestTimeout: number;
|
||||
// max ping timeout for each request
|
||||
pingTimeout: number;
|
||||
// perform a sniff operation every `n` milliseconds
|
||||
sniffInterval: number;
|
||||
// perform a sniff once the client is started
|
||||
sniffOnStart: boolean;
|
||||
// custom sniff endpoint, defaults `_nodes/_all/http`
|
||||
sniffEndpoint: string;
|
||||
// perform a sniff on connection fault
|
||||
sniffOnConnectionFault: boolean;
|
||||
// configurethe node resurrection strategy, default `ping`
|
||||
resurrectStrategy: 'ping' | 'optimistic' | 'none';
|
||||
// adds `accept-encoding` header to every request
|
||||
suggestCompression: boolean;
|
||||
// enable gzip request body compression
|
||||
compression: 'gzip';
|
||||
// ssl configuraton
|
||||
ssl: http.SecureContextOptions;
|
||||
// http agent options
|
||||
agent: http.AgentOptions;
|
||||
// filters which node not to use for a request
|
||||
nodeFilter: nodeFilterFn;
|
||||
// custom selection strategy, defaults `round-robin`
|
||||
nodeSelector: nodeSelectorFn | string;
|
||||
// function to generate the request id for every request
|
||||
generateRequestId: generateRequestIdFn;
|
||||
// name to identify the client instance in the events
|
||||
name: string;
|
||||
}
|
||||
```
|
||||
|
||||
More examples and detailed information about each method are available [here](http://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/index.html)
|
||||
### Request specific options
|
||||
If needed you can pass request specific options in a second object:
|
||||
```js
|
||||
// promise API
|
||||
const result = await client.search({
|
||||
index: 'my-index',
|
||||
body: { foo: 'bar' }
|
||||
}, {
|
||||
ignore: [404],
|
||||
maxRetries: 3
|
||||
})
|
||||
```
|
||||
The supported *request specific options* are:
|
||||
```ts
|
||||
{
|
||||
ignore: [number], // default `null`
|
||||
requestTimeout: number, // client default
|
||||
maxRetries: number, // default `5`
|
||||
asStream: boolean, // default `false`
|
||||
compression: string, // default `false`
|
||||
headers: object, // default `null`
|
||||
querystring: object // default `null`,
|
||||
context: object // default `null`,
|
||||
id: any // default incr. integer
|
||||
}
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
This software is licensed under the Apache 2 license, quoted below.
|
||||
|
||||
Copyright (c) 2014 Elasticsearch <http://www.elasticsearch.org>
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
This software is licensed under the [Apache 2 license](./LICENSE).
|
||||
|
||||
140
api/api/bulk.js
Normal file
140
api/api/bulk.js
Normal file
@ -0,0 +1,140 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildBulk (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [bulk](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-bulk.html) request
|
||||
*
|
||||
* @param {string} index - Default index for items which don't provide one
|
||||
* @param {string} type - Default document type for items which don't provide one
|
||||
* @param {string} wait_for_active_shards - Sets the number of shard copies that must be active before proceeding with the bulk operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)
|
||||
* @param {enum} refresh - If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes.
|
||||
* @param {string} routing - Specific routing value
|
||||
* @param {time} timeout - Explicit operation timeout
|
||||
* @param {string} type - Default document type for items which don't provide one
|
||||
* @param {list} _source - True or false to return the _source field or not, or default list of fields to return, can be overridden on each sub-request
|
||||
* @param {list} _source_excludes - Default list of fields to exclude from the returned _source field, can be overridden on each sub-request
|
||||
* @param {list} _source_includes - Default list of fields to extract and return from the _source field, can be overridden on each sub-request
|
||||
* @param {string} pipeline - The pipeline id to preprocess incoming documents with
|
||||
* @param {object} body - The operation definition and data (action-data pairs), separated by newlines
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
'wait_for_active_shards',
|
||||
'refresh',
|
||||
'routing',
|
||||
'timeout',
|
||||
'type',
|
||||
'_source',
|
||||
'_source_excludes',
|
||||
'_source_exclude',
|
||||
'_source_includes',
|
||||
'_source_include',
|
||||
'pipeline',
|
||||
'pretty',
|
||||
'human',
|
||||
'error_trace',
|
||||
'source',
|
||||
'filter_path'
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
waitForActiveShards: 'wait_for_active_shards',
|
||||
_sourceExcludes: '_source_excludes',
|
||||
_sourceExclude: '_source_exclude',
|
||||
_sourceIncludes: '_source_includes',
|
||||
_sourceInclude: '_source_include',
|
||||
errorTrace: 'error_trace',
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
return function bulk (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params['body'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// check required url components
|
||||
if (params['type'] != null && (params['index'] == null)) {
|
||||
const err = new ConfigurationError('Missing required parameter of the url: index')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, index, type, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'POST'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
if ((index) != null && (type) != null) {
|
||||
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_bulk'
|
||||
} else if ((index) != null) {
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_bulk'
|
||||
} else {
|
||||
path = '/' + '_bulk'
|
||||
}
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
bulkBody: body,
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildBulk
|
||||
120
api/api/cat.aliases.js
Normal file
120
api/api/cat.aliases.js
Normal file
@ -0,0 +1,120 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildCatAliases (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [cat.aliases](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-alias.html) request
|
||||
*
|
||||
* @param {list} name - A comma-separated list of alias names to return
|
||||
* @param {string} format - a short version of the Accept header, e.g. json, yaml
|
||||
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
|
||||
* @param {time} master_timeout - Explicit operation timeout for connection to master node
|
||||
* @param {list} h - Comma-separated list of column names to display
|
||||
* @param {boolean} help - Return help information
|
||||
* @param {list} s - Comma-separated list of column names or column aliases to sort by
|
||||
* @param {boolean} v - Verbose mode. Display column headers
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
'format',
|
||||
'local',
|
||||
'master_timeout',
|
||||
'h',
|
||||
'help',
|
||||
's',
|
||||
'v',
|
||||
'pretty',
|
||||
'human',
|
||||
'error_trace',
|
||||
'source',
|
||||
'filter_path'
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
masterTimeout: 'master_timeout',
|
||||
errorTrace: 'error_trace',
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
return function catAliases (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, name, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
if ((name) != null) {
|
||||
path = '/' + '_cat' + '/' + 'aliases' + '/' + encodeURIComponent(name)
|
||||
} else {
|
||||
path = '/' + '_cat' + '/' + 'aliases'
|
||||
}
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildCatAliases
|
||||
122
api/api/cat.allocation.js
Normal file
122
api/api/cat.allocation.js
Normal file
@ -0,0 +1,122 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildCatAllocation (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [cat.allocation](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-allocation.html) request
|
||||
*
|
||||
* @param {list} node_id - A comma-separated list of node IDs or names to limit the returned information
|
||||
* @param {string} format - a short version of the Accept header, e.g. json, yaml
|
||||
* @param {enum} bytes - The unit in which to display byte values
|
||||
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
|
||||
* @param {time} master_timeout - Explicit operation timeout for connection to master node
|
||||
* @param {list} h - Comma-separated list of column names to display
|
||||
* @param {boolean} help - Return help information
|
||||
* @param {list} s - Comma-separated list of column names or column aliases to sort by
|
||||
* @param {boolean} v - Verbose mode. Display column headers
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
'format',
|
||||
'bytes',
|
||||
'local',
|
||||
'master_timeout',
|
||||
'h',
|
||||
'help',
|
||||
's',
|
||||
'v',
|
||||
'pretty',
|
||||
'human',
|
||||
'error_trace',
|
||||
'source',
|
||||
'filter_path'
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
masterTimeout: 'master_timeout',
|
||||
errorTrace: 'error_trace',
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
return function catAllocation (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, nodeId, node_id, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
if ((node_id || nodeId) != null) {
|
||||
path = '/' + '_cat' + '/' + 'allocation' + '/' + encodeURIComponent(node_id || nodeId)
|
||||
} else {
|
||||
path = '/' + '_cat' + '/' + 'allocation'
|
||||
}
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildCatAllocation
|
||||
120
api/api/cat.count.js
Normal file
120
api/api/cat.count.js
Normal file
@ -0,0 +1,120 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildCatCount (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [cat.count](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-count.html) request
|
||||
*
|
||||
* @param {list} index - A comma-separated list of index names to limit the returned information
|
||||
* @param {string} format - a short version of the Accept header, e.g. json, yaml
|
||||
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
|
||||
* @param {time} master_timeout - Explicit operation timeout for connection to master node
|
||||
* @param {list} h - Comma-separated list of column names to display
|
||||
* @param {boolean} help - Return help information
|
||||
* @param {list} s - Comma-separated list of column names or column aliases to sort by
|
||||
* @param {boolean} v - Verbose mode. Display column headers
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
'format',
|
||||
'local',
|
||||
'master_timeout',
|
||||
'h',
|
||||
'help',
|
||||
's',
|
||||
'v',
|
||||
'pretty',
|
||||
'human',
|
||||
'error_trace',
|
||||
'source',
|
||||
'filter_path'
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
masterTimeout: 'master_timeout',
|
||||
errorTrace: 'error_trace',
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
return function catCount (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, index, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
if ((index) != null) {
|
||||
path = '/' + '_cat' + '/' + 'count' + '/' + encodeURIComponent(index)
|
||||
} else {
|
||||
path = '/' + '_cat' + '/' + 'count'
|
||||
}
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildCatCount
|
||||
124
api/api/cat.fielddata.js
Normal file
124
api/api/cat.fielddata.js
Normal file
@ -0,0 +1,124 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildCatFielddata (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [cat.fielddata](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-fielddata.html) request
|
||||
*
|
||||
* @param {list} fields - A comma-separated list of fields to return the fielddata size
|
||||
* @param {string} format - a short version of the Accept header, e.g. json, yaml
|
||||
* @param {enum} bytes - The unit in which to display byte values
|
||||
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
|
||||
* @param {time} master_timeout - Explicit operation timeout for connection to master node
|
||||
* @param {list} h - Comma-separated list of column names to display
|
||||
* @param {boolean} help - Return help information
|
||||
* @param {list} s - Comma-separated list of column names or column aliases to sort by
|
||||
* @param {boolean} v - Verbose mode. Display column headers
|
||||
* @param {list} fields - A comma-separated list of fields to return in the output
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
'format',
|
||||
'bytes',
|
||||
'local',
|
||||
'master_timeout',
|
||||
'h',
|
||||
'help',
|
||||
's',
|
||||
'v',
|
||||
'fields',
|
||||
'pretty',
|
||||
'human',
|
||||
'error_trace',
|
||||
'source',
|
||||
'filter_path'
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
masterTimeout: 'master_timeout',
|
||||
errorTrace: 'error_trace',
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
return function catFielddata (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, fields, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
if ((fields) != null) {
|
||||
path = '/' + '_cat' + '/' + 'fielddata' + '/' + encodeURIComponent(fields)
|
||||
} else {
|
||||
path = '/' + '_cat' + '/' + 'fielddata'
|
||||
}
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildCatFielddata
|
||||
117
api/api/cat.health.js
Normal file
117
api/api/cat.health.js
Normal file
@ -0,0 +1,117 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildCatHealth (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [cat.health](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-health.html) request
|
||||
*
|
||||
* @param {string} format - a short version of the Accept header, e.g. json, yaml
|
||||
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
|
||||
* @param {time} master_timeout - Explicit operation timeout for connection to master node
|
||||
* @param {list} h - Comma-separated list of column names to display
|
||||
* @param {boolean} help - Return help information
|
||||
* @param {list} s - Comma-separated list of column names or column aliases to sort by
|
||||
* @param {boolean} ts - Set to false to disable timestamping
|
||||
* @param {boolean} v - Verbose mode. Display column headers
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
'format',
|
||||
'local',
|
||||
'master_timeout',
|
||||
'h',
|
||||
'help',
|
||||
's',
|
||||
'ts',
|
||||
'v',
|
||||
'pretty',
|
||||
'human',
|
||||
'error_trace',
|
||||
'source',
|
||||
'filter_path'
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
masterTimeout: 'master_timeout',
|
||||
errorTrace: 'error_trace',
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
return function catHealth (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
path = '/' + '_cat' + '/' + 'health'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildCatHealth
|
||||
104
api/api/cat.help.js
Normal file
104
api/api/cat.help.js
Normal file
@ -0,0 +1,104 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildCatHelp (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [cat.help](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat.html) request
|
||||
*
|
||||
* @param {boolean} help - Return help information
|
||||
* @param {list} s - Comma-separated list of column names or column aliases to sort by
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
'help',
|
||||
's',
|
||||
'pretty',
|
||||
'human',
|
||||
'error_trace',
|
||||
'source',
|
||||
'filter_path'
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
errorTrace: 'error_trace',
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
return function catHelp (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
path = '/' + '_cat'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildCatHelp
|
||||
129
api/api/cat.indices.js
Normal file
129
api/api/cat.indices.js
Normal file
@ -0,0 +1,129 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildCatIndices (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [cat.indices](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-indices.html) request
|
||||
*
|
||||
* @param {list} index - A comma-separated list of index names to limit the returned information
|
||||
* @param {string} format - a short version of the Accept header, e.g. json, yaml
|
||||
* @param {enum} bytes - The unit in which to display byte values
|
||||
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
|
||||
* @param {time} master_timeout - Explicit operation timeout for connection to master node
|
||||
* @param {list} h - Comma-separated list of column names to display
|
||||
* @param {enum} health - A health status ("green", "yellow", or "red" to filter only indices matching the specified health status
|
||||
* @param {boolean} help - Return help information
|
||||
* @param {boolean} pri - Set to true to return stats only for primary shards
|
||||
* @param {list} s - Comma-separated list of column names or column aliases to sort by
|
||||
* @param {boolean} v - Verbose mode. Display column headers
|
||||
* @param {boolean} include_unloaded_segments - If set to true segment stats will include stats for segments that are not currently loaded into memory
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
'format',
|
||||
'bytes',
|
||||
'local',
|
||||
'master_timeout',
|
||||
'h',
|
||||
'health',
|
||||
'help',
|
||||
'pri',
|
||||
's',
|
||||
'v',
|
||||
'include_unloaded_segments',
|
||||
'pretty',
|
||||
'human',
|
||||
'error_trace',
|
||||
'source',
|
||||
'filter_path'
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
masterTimeout: 'master_timeout',
|
||||
includeUnloadedSegments: 'include_unloaded_segments',
|
||||
errorTrace: 'error_trace',
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
return function catIndices (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, index, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
if ((index) != null) {
|
||||
path = '/' + '_cat' + '/' + 'indices' + '/' + encodeURIComponent(index)
|
||||
} else {
|
||||
path = '/' + '_cat' + '/' + 'indices'
|
||||
}
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildCatIndices
|
||||
115
api/api/cat.master.js
Normal file
115
api/api/cat.master.js
Normal file
@ -0,0 +1,115 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildCatMaster (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [cat.master](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-master.html) request
|
||||
*
|
||||
* @param {string} format - a short version of the Accept header, e.g. json, yaml
|
||||
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
|
||||
* @param {time} master_timeout - Explicit operation timeout for connection to master node
|
||||
* @param {list} h - Comma-separated list of column names to display
|
||||
* @param {boolean} help - Return help information
|
||||
* @param {list} s - Comma-separated list of column names or column aliases to sort by
|
||||
* @param {boolean} v - Verbose mode. Display column headers
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
'format',
|
||||
'local',
|
||||
'master_timeout',
|
||||
'h',
|
||||
'help',
|
||||
's',
|
||||
'v',
|
||||
'pretty',
|
||||
'human',
|
||||
'error_trace',
|
||||
'source',
|
||||
'filter_path'
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
masterTimeout: 'master_timeout',
|
||||
errorTrace: 'error_trace',
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
return function catMaster (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
path = '/' + '_cat' + '/' + 'master'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildCatMaster
|
||||
115
api/api/cat.nodeattrs.js
Normal file
115
api/api/cat.nodeattrs.js
Normal file
@ -0,0 +1,115 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildCatNodeattrs (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [cat.nodeattrs](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodeattrs.html) request
|
||||
*
|
||||
* @param {string} format - a short version of the Accept header, e.g. json, yaml
|
||||
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
|
||||
* @param {time} master_timeout - Explicit operation timeout for connection to master node
|
||||
* @param {list} h - Comma-separated list of column names to display
|
||||
* @param {boolean} help - Return help information
|
||||
* @param {list} s - Comma-separated list of column names or column aliases to sort by
|
||||
* @param {boolean} v - Verbose mode. Display column headers
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
'format',
|
||||
'local',
|
||||
'master_timeout',
|
||||
'h',
|
||||
'help',
|
||||
's',
|
||||
'v',
|
||||
'pretty',
|
||||
'human',
|
||||
'error_trace',
|
||||
'source',
|
||||
'filter_path'
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
masterTimeout: 'master_timeout',
|
||||
errorTrace: 'error_trace',
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
return function catNodeattrs (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
path = '/' + '_cat' + '/' + 'nodeattrs'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildCatNodeattrs
|
||||
118
api/api/cat.nodes.js
Normal file
118
api/api/cat.nodes.js
Normal file
@ -0,0 +1,118 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildCatNodes (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [cat.nodes](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodes.html) request
|
||||
*
|
||||
* @param {string} format - a short version of the Accept header, e.g. json, yaml
|
||||
* @param {boolean} full_id - Return the full node ID instead of the shortened version (default: false)
|
||||
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
|
||||
* @param {time} master_timeout - Explicit operation timeout for connection to master node
|
||||
* @param {list} h - Comma-separated list of column names to display
|
||||
* @param {boolean} help - Return help information
|
||||
* @param {list} s - Comma-separated list of column names or column aliases to sort by
|
||||
* @param {boolean} v - Verbose mode. Display column headers
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
'format',
|
||||
'full_id',
|
||||
'local',
|
||||
'master_timeout',
|
||||
'h',
|
||||
'help',
|
||||
's',
|
||||
'v',
|
||||
'pretty',
|
||||
'human',
|
||||
'error_trace',
|
||||
'source',
|
||||
'filter_path'
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
fullId: 'full_id',
|
||||
masterTimeout: 'master_timeout',
|
||||
errorTrace: 'error_trace',
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
return function catNodes (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
path = '/' + '_cat' + '/' + 'nodes'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildCatNodes
|
||||
115
api/api/cat.pending_tasks.js
Normal file
115
api/api/cat.pending_tasks.js
Normal file
@ -0,0 +1,115 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildCatPendingTasks (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [cat.pending_tasks](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-pending-tasks.html) request
|
||||
*
|
||||
* @param {string} format - a short version of the Accept header, e.g. json, yaml
|
||||
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
|
||||
* @param {time} master_timeout - Explicit operation timeout for connection to master node
|
||||
* @param {list} h - Comma-separated list of column names to display
|
||||
* @param {boolean} help - Return help information
|
||||
* @param {list} s - Comma-separated list of column names or column aliases to sort by
|
||||
* @param {boolean} v - Verbose mode. Display column headers
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
'format',
|
||||
'local',
|
||||
'master_timeout',
|
||||
'h',
|
||||
'help',
|
||||
's',
|
||||
'v',
|
||||
'pretty',
|
||||
'human',
|
||||
'error_trace',
|
||||
'source',
|
||||
'filter_path'
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
masterTimeout: 'master_timeout',
|
||||
errorTrace: 'error_trace',
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
return function catPendingTasks (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
path = '/' + '_cat' + '/' + 'pending_tasks'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildCatPendingTasks
|
||||
115
api/api/cat.plugins.js
Normal file
115
api/api/cat.plugins.js
Normal file
@ -0,0 +1,115 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildCatPlugins (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [cat.plugins](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-plugins.html) request
|
||||
*
|
||||
* @param {string} format - a short version of the Accept header, e.g. json, yaml
|
||||
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
|
||||
* @param {time} master_timeout - Explicit operation timeout for connection to master node
|
||||
* @param {list} h - Comma-separated list of column names to display
|
||||
* @param {boolean} help - Return help information
|
||||
* @param {list} s - Comma-separated list of column names or column aliases to sort by
|
||||
* @param {boolean} v - Verbose mode. Display column headers
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
'format',
|
||||
'local',
|
||||
'master_timeout',
|
||||
'h',
|
||||
'help',
|
||||
's',
|
||||
'v',
|
||||
'pretty',
|
||||
'human',
|
||||
'error_trace',
|
||||
'source',
|
||||
'filter_path'
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
masterTimeout: 'master_timeout',
|
||||
errorTrace: 'error_trace',
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
return function catPlugins (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
path = '/' + '_cat' + '/' + 'plugins'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildCatPlugins
|
||||
120
api/api/cat.recovery.js
Normal file
120
api/api/cat.recovery.js
Normal file
@ -0,0 +1,120 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildCatRecovery (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [cat.recovery](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-recovery.html) request
|
||||
*
|
||||
* @param {list} index - A comma-separated list of index names to limit the returned information
|
||||
* @param {string} format - a short version of the Accept header, e.g. json, yaml
|
||||
* @param {enum} bytes - The unit in which to display byte values
|
||||
* @param {time} master_timeout - Explicit operation timeout for connection to master node
|
||||
* @param {list} h - Comma-separated list of column names to display
|
||||
* @param {boolean} help - Return help information
|
||||
* @param {list} s - Comma-separated list of column names or column aliases to sort by
|
||||
* @param {boolean} v - Verbose mode. Display column headers
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
'format',
|
||||
'bytes',
|
||||
'master_timeout',
|
||||
'h',
|
||||
'help',
|
||||
's',
|
||||
'v',
|
||||
'pretty',
|
||||
'human',
|
||||
'error_trace',
|
||||
'source',
|
||||
'filter_path'
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
masterTimeout: 'master_timeout',
|
||||
errorTrace: 'error_trace',
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
return function catRecovery (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, index, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
if ((index) != null) {
|
||||
path = '/' + '_cat' + '/' + 'recovery' + '/' + encodeURIComponent(index)
|
||||
} else {
|
||||
path = '/' + '_cat' + '/' + 'recovery'
|
||||
}
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildCatRecovery
|
||||
115
api/api/cat.repositories.js
Normal file
115
api/api/cat.repositories.js
Normal file
@ -0,0 +1,115 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildCatRepositories (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [cat.repositories](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-repositories.html) request
|
||||
*
|
||||
* @param {string} format - a short version of the Accept header, e.g. json, yaml
|
||||
* @param {boolean} local - Return local information, do not retrieve the state from master node
|
||||
* @param {time} master_timeout - Explicit operation timeout for connection to master node
|
||||
* @param {list} h - Comma-separated list of column names to display
|
||||
* @param {boolean} help - Return help information
|
||||
* @param {list} s - Comma-separated list of column names or column aliases to sort by
|
||||
* @param {boolean} v - Verbose mode. Display column headers
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
'format',
|
||||
'local',
|
||||
'master_timeout',
|
||||
'h',
|
||||
'help',
|
||||
's',
|
||||
'v',
|
||||
'pretty',
|
||||
'human',
|
||||
'error_trace',
|
||||
'source',
|
||||
'filter_path'
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
masterTimeout: 'master_timeout',
|
||||
errorTrace: 'error_trace',
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
return function catRepositories (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
path = '/' + '_cat' + '/' + 'repositories'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildCatRepositories
|
||||
117
api/api/cat.segments.js
Normal file
117
api/api/cat.segments.js
Normal file
@ -0,0 +1,117 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildCatSegments (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [cat.segments](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-segments.html) request
|
||||
*
|
||||
* @param {list} index - A comma-separated list of index names to limit the returned information
|
||||
* @param {string} format - a short version of the Accept header, e.g. json, yaml
|
||||
* @param {enum} bytes - The unit in which to display byte values
|
||||
* @param {list} h - Comma-separated list of column names to display
|
||||
* @param {boolean} help - Return help information
|
||||
* @param {list} s - Comma-separated list of column names or column aliases to sort by
|
||||
* @param {boolean} v - Verbose mode. Display column headers
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
'format',
|
||||
'bytes',
|
||||
'h',
|
||||
'help',
|
||||
's',
|
||||
'v',
|
||||
'pretty',
|
||||
'human',
|
||||
'error_trace',
|
||||
'source',
|
||||
'filter_path'
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
errorTrace: 'error_trace',
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
return function catSegments (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, index, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
if ((index) != null) {
|
||||
path = '/' + '_cat' + '/' + 'segments' + '/' + encodeURIComponent(index)
|
||||
} else {
|
||||
path = '/' + '_cat' + '/' + 'segments'
|
||||
}
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildCatSegments
|
||||
122
api/api/cat.shards.js
Normal file
122
api/api/cat.shards.js
Normal file
@ -0,0 +1,122 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildCatShards (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [cat.shards](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-shards.html) request
|
||||
*
|
||||
* @param {list} index - A comma-separated list of index names to limit the returned information
|
||||
* @param {string} format - a short version of the Accept header, e.g. json, yaml
|
||||
* @param {enum} bytes - The unit in which to display byte values
|
||||
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
|
||||
* @param {time} master_timeout - Explicit operation timeout for connection to master node
|
||||
* @param {list} h - Comma-separated list of column names to display
|
||||
* @param {boolean} help - Return help information
|
||||
* @param {list} s - Comma-separated list of column names or column aliases to sort by
|
||||
* @param {boolean} v - Verbose mode. Display column headers
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
'format',
|
||||
'bytes',
|
||||
'local',
|
||||
'master_timeout',
|
||||
'h',
|
||||
'help',
|
||||
's',
|
||||
'v',
|
||||
'pretty',
|
||||
'human',
|
||||
'error_trace',
|
||||
'source',
|
||||
'filter_path'
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
masterTimeout: 'master_timeout',
|
||||
errorTrace: 'error_trace',
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
return function catShards (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, index, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
if ((index) != null) {
|
||||
path = '/' + '_cat' + '/' + 'shards' + '/' + encodeURIComponent(index)
|
||||
} else {
|
||||
path = '/' + '_cat' + '/' + 'shards'
|
||||
}
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildCatShards
|
||||
121
api/api/cat.snapshots.js
Normal file
121
api/api/cat.snapshots.js
Normal file
@ -0,0 +1,121 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildCatSnapshots (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [cat.snapshots](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-snapshots.html) request
|
||||
*
|
||||
* @param {list} repository - Name of repository from which to fetch the snapshot information
|
||||
* @param {string} format - a short version of the Accept header, e.g. json, yaml
|
||||
* @param {boolean} ignore_unavailable - Set to true to ignore unavailable snapshots
|
||||
* @param {time} master_timeout - Explicit operation timeout for connection to master node
|
||||
* @param {list} h - Comma-separated list of column names to display
|
||||
* @param {boolean} help - Return help information
|
||||
* @param {list} s - Comma-separated list of column names or column aliases to sort by
|
||||
* @param {boolean} v - Verbose mode. Display column headers
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
'format',
|
||||
'ignore_unavailable',
|
||||
'master_timeout',
|
||||
'h',
|
||||
'help',
|
||||
's',
|
||||
'v',
|
||||
'pretty',
|
||||
'human',
|
||||
'error_trace',
|
||||
'source',
|
||||
'filter_path'
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
ignoreUnavailable: 'ignore_unavailable',
|
||||
masterTimeout: 'master_timeout',
|
||||
errorTrace: 'error_trace',
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
return function catSnapshots (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, repository, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
if ((repository) != null) {
|
||||
path = '/' + '_cat' + '/' + 'snapshots' + '/' + encodeURIComponent(repository)
|
||||
} else {
|
||||
path = '/' + '_cat' + '/' + 'snapshots'
|
||||
}
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildCatSnapshots
|
||||
120
api/api/cat.tasks.js
Normal file
120
api/api/cat.tasks.js
Normal file
@ -0,0 +1,120 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildCatTasks (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [cat.tasks](http://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html) request
|
||||
*
|
||||
* @param {string} format - a short version of the Accept header, e.g. json, yaml
|
||||
* @param {list} node_id - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes
|
||||
* @param {list} actions - A comma-separated list of actions that should be returned. Leave empty to return all.
|
||||
* @param {boolean} detailed - Return detailed task information (default: false)
|
||||
* @param {number} parent_task - Return tasks with specified parent task id. Set to -1 to return all.
|
||||
* @param {list} h - Comma-separated list of column names to display
|
||||
* @param {boolean} help - Return help information
|
||||
* @param {list} s - Comma-separated list of column names or column aliases to sort by
|
||||
* @param {boolean} v - Verbose mode. Display column headers
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
'format',
|
||||
'node_id',
|
||||
'actions',
|
||||
'detailed',
|
||||
'parent_task',
|
||||
'h',
|
||||
'help',
|
||||
's',
|
||||
'v',
|
||||
'pretty',
|
||||
'human',
|
||||
'error_trace',
|
||||
'source',
|
||||
'filter_path'
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
nodeId: 'node_id',
|
||||
parentTask: 'parent_task',
|
||||
errorTrace: 'error_trace',
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
return function catTasks (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
path = '/' + '_cat' + '/' + 'tasks'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildCatTasks
|
||||
120
api/api/cat.templates.js
Normal file
120
api/api/cat.templates.js
Normal file
@ -0,0 +1,120 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildCatTemplates (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [cat.templates](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-templates.html) request
|
||||
*
|
||||
* @param {string} name - A pattern that returned template names must match
|
||||
* @param {string} format - a short version of the Accept header, e.g. json, yaml
|
||||
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
|
||||
* @param {time} master_timeout - Explicit operation timeout for connection to master node
|
||||
* @param {list} h - Comma-separated list of column names to display
|
||||
* @param {boolean} help - Return help information
|
||||
* @param {list} s - Comma-separated list of column names or column aliases to sort by
|
||||
* @param {boolean} v - Verbose mode. Display column headers
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
'format',
|
||||
'local',
|
||||
'master_timeout',
|
||||
'h',
|
||||
'help',
|
||||
's',
|
||||
'v',
|
||||
'pretty',
|
||||
'human',
|
||||
'error_trace',
|
||||
'source',
|
||||
'filter_path'
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
masterTimeout: 'master_timeout',
|
||||
errorTrace: 'error_trace',
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
return function catTemplates (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, name, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
if ((name) != null) {
|
||||
path = '/' + '_cat' + '/' + 'templates' + '/' + encodeURIComponent(name)
|
||||
} else {
|
||||
path = '/' + '_cat' + '/' + 'templates'
|
||||
}
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildCatTemplates
|
||||
122
api/api/cat.thread_pool.js
Normal file
122
api/api/cat.thread_pool.js
Normal file
@ -0,0 +1,122 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildCatThreadPool (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [cat.thread_pool](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-thread-pool.html) request
|
||||
*
|
||||
* @param {list} thread_pool_patterns - A comma-separated list of regular-expressions to filter the thread pools in the output
|
||||
* @param {string} format - a short version of the Accept header, e.g. json, yaml
|
||||
* @param {enum} size - The multiplier in which to display values
|
||||
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
|
||||
* @param {time} master_timeout - Explicit operation timeout for connection to master node
|
||||
* @param {list} h - Comma-separated list of column names to display
|
||||
* @param {boolean} help - Return help information
|
||||
* @param {list} s - Comma-separated list of column names or column aliases to sort by
|
||||
* @param {boolean} v - Verbose mode. Display column headers
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
'format',
|
||||
'size',
|
||||
'local',
|
||||
'master_timeout',
|
||||
'h',
|
||||
'help',
|
||||
's',
|
||||
'v',
|
||||
'pretty',
|
||||
'human',
|
||||
'error_trace',
|
||||
'source',
|
||||
'filter_path'
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
masterTimeout: 'master_timeout',
|
||||
errorTrace: 'error_trace',
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
return function catThreadPool (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, threadPoolPatterns, thread_pool_patterns, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
if ((thread_pool_patterns || threadPoolPatterns) != null) {
|
||||
path = '/' + '_cat' + '/' + 'thread_pool' + '/' + encodeURIComponent(thread_pool_patterns || threadPoolPatterns)
|
||||
} else {
|
||||
path = '/' + '_cat' + '/' + 'thread_pool'
|
||||
}
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildCatThreadPool
|
||||
96
api/api/ccr.delete_auto_follow_pattern.js
Normal file
96
api/api/ccr.delete_auto_follow_pattern.js
Normal file
@ -0,0 +1,96 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildCcrDeleteAutoFollowPattern (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [ccr.delete_auto_follow_pattern](https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-delete-auto-follow-pattern.html) request
|
||||
*
|
||||
* @param {string} name - The name of the auto follow pattern.
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
|
||||
}
|
||||
|
||||
return function ccrDeleteAutoFollowPattern (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params['name'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: name')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, name, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'DELETE'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
path = '/' + '_ccr' + '/' + 'auto_follow' + '/' + encodeURIComponent(name)
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildCcrDeleteAutoFollowPattern
|
||||
102
api/api/ccr.follow.js
Normal file
102
api/api/ccr.follow.js
Normal file
@ -0,0 +1,102 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildCcrFollow (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [ccr.follow](https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-follow.html) request
|
||||
*
|
||||
* @param {string} index - The name of the follower index
|
||||
* @param {string} wait_for_active_shards - Sets the number of shard copies that must be active before returning. Defaults to 0. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)
|
||||
* @param {object} body - The name of the leader index and other optional ccr related parameters
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
'wait_for_active_shards'
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
waitForActiveShards: 'wait_for_active_shards'
|
||||
}
|
||||
|
||||
return function ccrFollow (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params['index'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: index')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params['body'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, index, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'PUT'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'follow'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildCcrFollow
|
||||
90
api/api/ccr.follow_info.js
Normal file
90
api/api/ccr.follow_info.js
Normal file
@ -0,0 +1,90 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildCcrFollowInfo (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [ccr.follow_info](https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-info.html) request
|
||||
*
|
||||
* @param {list} index - A comma-separated list of index patterns; use `_all` to perform the operation on all indices
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
|
||||
}
|
||||
|
||||
return function ccrFollowInfo (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, index, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'info'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildCcrFollowInfo
|
||||
96
api/api/ccr.follow_stats.js
Normal file
96
api/api/ccr.follow_stats.js
Normal file
@ -0,0 +1,96 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildCcrFollowStats (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [ccr.follow_stats](https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-stats.html) request
|
||||
*
|
||||
* @param {list} index - A comma-separated list of index patterns; use `_all` to perform the operation on all indices
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
|
||||
}
|
||||
|
||||
return function ccrFollowStats (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params['index'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: index')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, index, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'stats'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildCcrFollowStats
|
||||
101
api/api/ccr.forget_follower.js
Normal file
101
api/api/ccr.forget_follower.js
Normal file
@ -0,0 +1,101 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildCcrForgetFollower (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [ccr.forget_follower](http://www.elastic.co/guide/en/elasticsearch/reference/current) request
|
||||
*
|
||||
* @param {string} index - the name of the leader index for which specified follower retention leases should be removed
|
||||
* @param {object} body - the name and UUID of the follower index, the name of the cluster containing the follower index, and the alias from the perspective of that cluster for the remote cluster containing the leader index
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
|
||||
}
|
||||
|
||||
return function ccrForgetFollower (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params['index'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: index')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params['body'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, index, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'POST'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'forget_follower'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildCcrForgetFollower
|
||||
94
api/api/ccr.get_auto_follow_pattern.js
Normal file
94
api/api/ccr.get_auto_follow_pattern.js
Normal file
@ -0,0 +1,94 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildCcrGetAutoFollowPattern (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [ccr.get_auto_follow_pattern](https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-auto-follow-pattern.html) request
|
||||
*
|
||||
* @param {string} name - The name of the auto follow pattern.
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
|
||||
}
|
||||
|
||||
return function ccrGetAutoFollowPattern (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, name, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
if ((name) != null) {
|
||||
path = '/' + '_ccr' + '/' + 'auto_follow' + '/' + encodeURIComponent(name)
|
||||
} else {
|
||||
path = '/' + '_ccr' + '/' + 'auto_follow'
|
||||
}
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildCcrGetAutoFollowPattern
|
||||
96
api/api/ccr.pause_follow.js
Normal file
96
api/api/ccr.pause_follow.js
Normal file
@ -0,0 +1,96 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildCcrPauseFollow (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [ccr.pause_follow](https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-pause-follow.html) request
|
||||
*
|
||||
* @param {string} index - The name of the follower index that should pause following its leader index.
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
|
||||
}
|
||||
|
||||
return function ccrPauseFollow (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params['index'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: index')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, index, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'POST'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'pause_follow'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildCcrPauseFollow
|
||||
101
api/api/ccr.put_auto_follow_pattern.js
Normal file
101
api/api/ccr.put_auto_follow_pattern.js
Normal file
@ -0,0 +1,101 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildCcrPutAutoFollowPattern (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [ccr.put_auto_follow_pattern](https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-auto-follow-pattern.html) request
|
||||
*
|
||||
* @param {string} name - The name of the auto follow pattern.
|
||||
* @param {object} body - The specification of the auto follow pattern
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
|
||||
}
|
||||
|
||||
return function ccrPutAutoFollowPattern (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params['name'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: name')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params['body'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, name, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'PUT'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
path = '/' + '_ccr' + '/' + 'auto_follow' + '/' + encodeURIComponent(name)
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildCcrPutAutoFollowPattern
|
||||
97
api/api/ccr.resume_follow.js
Normal file
97
api/api/ccr.resume_follow.js
Normal file
@ -0,0 +1,97 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildCcrResumeFollow (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [ccr.resume_follow](https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-resume-follow.html) request
|
||||
*
|
||||
* @param {string} index - The name of the follow index to resume following.
|
||||
* @param {object} body - The name of the leader index and other optional ccr related parameters
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
|
||||
}
|
||||
|
||||
return function ccrResumeFollow (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params['index'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: index')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, index, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'POST'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'resume_follow'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildCcrResumeFollow
|
||||
89
api/api/ccr.stats.js
Normal file
89
api/api/ccr.stats.js
Normal file
@ -0,0 +1,89 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildCcrStats (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [ccr.stats](https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-stats.html) request
|
||||
*
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
|
||||
}
|
||||
|
||||
return function ccrStats (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
path = '/' + '_ccr' + '/' + 'stats'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildCcrStats
|
||||
96
api/api/ccr.unfollow.js
Normal file
96
api/api/ccr.unfollow.js
Normal file
@ -0,0 +1,96 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildCcrUnfollow (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [ccr.unfollow](http://www.elastic.co/guide/en/elasticsearch/reference/current) request
|
||||
*
|
||||
* @param {string} index - The name of the follower index that should be turned into a regular index.
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
|
||||
}
|
||||
|
||||
return function ccrUnfollow (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params['index'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: index')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, index, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'POST'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'unfollow'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildCcrUnfollow
|
||||
100
api/api/clear_scroll.js
Normal file
100
api/api/clear_scroll.js
Normal file
@ -0,0 +1,100 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildClearScroll (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [clear_scroll](http://www.elastic.co/guide/en/elasticsearch/reference/master/search-request-scroll.html) request
|
||||
*
|
||||
* @param {list} scroll_id - A comma-separated list of scroll IDs to clear
|
||||
* @param {object} body - A comma-separated list of scroll IDs to clear if none was specified via the scroll_id parameter
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
'pretty',
|
||||
'human',
|
||||
'error_trace',
|
||||
'source',
|
||||
'filter_path'
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
errorTrace: 'error_trace',
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
return function clearScroll (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, scrollId, scroll_id, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'DELETE'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
if ((scroll_id || scrollId) != null) {
|
||||
path = '/' + '_search' + '/' + 'scroll' + '/' + encodeURIComponent(scroll_id || scrollId)
|
||||
} else {
|
||||
path = '/' + '_search' + '/' + 'scroll'
|
||||
}
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildClearScroll
|
||||
101
api/api/cluster.allocation_explain.js
Normal file
101
api/api/cluster.allocation_explain.js
Normal file
@ -0,0 +1,101 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildClusterAllocationExplain (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [cluster.allocation_explain](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-allocation-explain.html) request
|
||||
*
|
||||
* @param {boolean} include_yes_decisions - Return 'YES' decisions in explanation (default: false)
|
||||
* @param {boolean} include_disk_info - Return information about disk usage and shard sizes (default: false)
|
||||
* @param {object} body - The index, shard, and primary flag to explain. Empty means 'explain the first unassigned shard'
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
'include_yes_decisions',
|
||||
'include_disk_info',
|
||||
'pretty',
|
||||
'human',
|
||||
'error_trace',
|
||||
'source',
|
||||
'filter_path'
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
includeYesDecisions: 'include_yes_decisions',
|
||||
includeDiskInfo: 'include_disk_info',
|
||||
errorTrace: 'error_trace',
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
return function clusterAllocationExplain (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = body == null ? 'GET' : 'POST'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
path = '/' + '_cluster' + '/' + 'allocation' + '/' + 'explain'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildClusterAllocationExplain
|
||||
111
api/api/cluster.get_settings.js
Normal file
111
api/api/cluster.get_settings.js
Normal file
@ -0,0 +1,111 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildClusterGetSettings (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [cluster.get_settings](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-update-settings.html) request
|
||||
*
|
||||
* @param {boolean} flat_settings - Return settings in flat format (default: false)
|
||||
* @param {time} master_timeout - Explicit operation timeout for connection to master node
|
||||
* @param {time} timeout - Explicit operation timeout
|
||||
* @param {boolean} include_defaults - Whether to return all default clusters setting.
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
'flat_settings',
|
||||
'master_timeout',
|
||||
'timeout',
|
||||
'include_defaults',
|
||||
'pretty',
|
||||
'human',
|
||||
'error_trace',
|
||||
'source',
|
||||
'filter_path'
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
flatSettings: 'flat_settings',
|
||||
masterTimeout: 'master_timeout',
|
||||
includeDefaults: 'include_defaults',
|
||||
errorTrace: 'error_trace',
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
return function clusterGetSettings (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
path = '/' + '_cluster' + '/' + 'settings'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildClusterGetSettings
|
||||
135
api/api/cluster.health.js
Normal file
135
api/api/cluster.health.js
Normal file
@ -0,0 +1,135 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildClusterHealth (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [cluster.health](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-health.html) request
|
||||
*
|
||||
* @param {list} index - Limit the information returned to a specific index
|
||||
* @param {enum} expand_wildcards - Whether to expand wildcard expression to concrete indices that are open, closed or both.
|
||||
* @param {enum} level - Specify the level of detail for returned information
|
||||
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
|
||||
* @param {time} master_timeout - Explicit operation timeout for connection to master node
|
||||
* @param {time} timeout - Explicit operation timeout
|
||||
* @param {string} wait_for_active_shards - Wait until the specified number of shards is active
|
||||
* @param {string} wait_for_nodes - Wait until the specified number of nodes is available
|
||||
* @param {enum} wait_for_events - Wait until all currently queued events with the given priority are processed
|
||||
* @param {boolean} wait_for_no_relocating_shards - Whether to wait until there are no relocating shards in the cluster
|
||||
* @param {boolean} wait_for_no_initializing_shards - Whether to wait until there are no initializing shards in the cluster
|
||||
* @param {enum} wait_for_status - Wait until cluster is in a specific state
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
'expand_wildcards',
|
||||
'level',
|
||||
'local',
|
||||
'master_timeout',
|
||||
'timeout',
|
||||
'wait_for_active_shards',
|
||||
'wait_for_nodes',
|
||||
'wait_for_events',
|
||||
'wait_for_no_relocating_shards',
|
||||
'wait_for_no_initializing_shards',
|
||||
'wait_for_status',
|
||||
'pretty',
|
||||
'human',
|
||||
'error_trace',
|
||||
'source',
|
||||
'filter_path'
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
expandWildcards: 'expand_wildcards',
|
||||
masterTimeout: 'master_timeout',
|
||||
waitForActiveShards: 'wait_for_active_shards',
|
||||
waitForNodes: 'wait_for_nodes',
|
||||
waitForEvents: 'wait_for_events',
|
||||
waitForNoRelocatingShards: 'wait_for_no_relocating_shards',
|
||||
waitForNoInitializingShards: 'wait_for_no_initializing_shards',
|
||||
waitForStatus: 'wait_for_status',
|
||||
errorTrace: 'error_trace',
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
return function clusterHealth (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, index, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
if ((index) != null) {
|
||||
path = '/' + '_cluster' + '/' + 'health' + '/' + encodeURIComponent(index)
|
||||
} else {
|
||||
path = '/' + '_cluster' + '/' + 'health'
|
||||
}
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildClusterHealth
|
||||
105
api/api/cluster.pending_tasks.js
Normal file
105
api/api/cluster.pending_tasks.js
Normal file
@ -0,0 +1,105 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildClusterPendingTasks (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [cluster.pending_tasks](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-pending.html) request
|
||||
*
|
||||
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
|
||||
* @param {time} master_timeout - Specify timeout for connection to master
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
'local',
|
||||
'master_timeout',
|
||||
'pretty',
|
||||
'human',
|
||||
'error_trace',
|
||||
'source',
|
||||
'filter_path'
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
masterTimeout: 'master_timeout',
|
||||
errorTrace: 'error_trace',
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
return function clusterPendingTasks (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
path = '/' + '_cluster' + '/' + 'pending_tasks'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildClusterPendingTasks
|
||||
109
api/api/cluster.put_settings.js
Normal file
109
api/api/cluster.put_settings.js
Normal file
@ -0,0 +1,109 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildClusterPutSettings (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [cluster.put_settings](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-update-settings.html) request
|
||||
*
|
||||
* @param {boolean} flat_settings - Return settings in flat format (default: false)
|
||||
* @param {time} master_timeout - Explicit operation timeout for connection to master node
|
||||
* @param {time} timeout - Explicit operation timeout
|
||||
* @param {object} body - The settings to be updated. Can be either `transient` or `persistent` (survives cluster restart).
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
'flat_settings',
|
||||
'master_timeout',
|
||||
'timeout',
|
||||
'pretty',
|
||||
'human',
|
||||
'error_trace',
|
||||
'source',
|
||||
'filter_path'
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
flatSettings: 'flat_settings',
|
||||
masterTimeout: 'master_timeout',
|
||||
errorTrace: 'error_trace',
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
return function clusterPutSettings (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params['body'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'PUT'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
path = '/' + '_cluster' + '/' + 'settings'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildClusterPutSettings
|
||||
100
api/api/cluster.remote_info.js
Normal file
100
api/api/cluster.remote_info.js
Normal file
@ -0,0 +1,100 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildClusterRemoteInfo (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [cluster.remote_info](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-remote-info.html) request
|
||||
*
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
'pretty',
|
||||
'human',
|
||||
'error_trace',
|
||||
'source',
|
||||
'filter_path'
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
errorTrace: 'error_trace',
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
return function clusterRemoteInfo (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
path = '/' + '_remote' + '/' + 'info'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildClusterRemoteInfo
|
||||
110
api/api/cluster.reroute.js
Normal file
110
api/api/cluster.reroute.js
Normal file
@ -0,0 +1,110 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildClusterReroute (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [cluster.reroute](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-reroute.html) request
|
||||
*
|
||||
* @param {boolean} dry_run - Simulate the operation only and return the resulting state
|
||||
* @param {boolean} explain - Return an explanation of why the commands can or cannot be executed
|
||||
* @param {boolean} retry_failed - Retries allocation of shards that are blocked due to too many subsequent allocation failures
|
||||
* @param {list} metric - Limit the information returned to the specified metrics. Defaults to all but metadata
|
||||
* @param {time} master_timeout - Explicit operation timeout for connection to master node
|
||||
* @param {time} timeout - Explicit operation timeout
|
||||
* @param {object} body - The definition of `commands` to perform (`move`, `cancel`, `allocate`)
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
'dry_run',
|
||||
'explain',
|
||||
'retry_failed',
|
||||
'metric',
|
||||
'master_timeout',
|
||||
'timeout',
|
||||
'pretty',
|
||||
'human',
|
||||
'error_trace',
|
||||
'source',
|
||||
'filter_path'
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
dryRun: 'dry_run',
|
||||
retryFailed: 'retry_failed',
|
||||
masterTimeout: 'master_timeout',
|
||||
errorTrace: 'error_trace',
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
return function clusterReroute (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'POST'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
path = '/' + '_cluster' + '/' + 'reroute'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildClusterReroute
|
||||
137
api/api/cluster.state.js
Normal file
137
api/api/cluster.state.js
Normal file
@ -0,0 +1,137 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildClusterState (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [cluster.state](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-state.html) request
|
||||
*
|
||||
* @param {list} index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
|
||||
* @param {list} metric - Limit the information returned to the specified metrics
|
||||
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
|
||||
* @param {time} master_timeout - Specify timeout for connection to master
|
||||
* @param {boolean} flat_settings - Return settings in flat format (default: false)
|
||||
* @param {number} wait_for_metadata_version - Wait for the metadata version to be equal or greater than the specified metadata version
|
||||
* @param {time} wait_for_timeout - The maximum time to wait for wait_for_metadata_version before timing out
|
||||
* @param {boolean} ignore_unavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed)
|
||||
* @param {boolean} allow_no_indices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
|
||||
* @param {enum} expand_wildcards - Whether to expand wildcard expression to concrete indices that are open, closed or both.
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
'local',
|
||||
'master_timeout',
|
||||
'flat_settings',
|
||||
'wait_for_metadata_version',
|
||||
'wait_for_timeout',
|
||||
'ignore_unavailable',
|
||||
'allow_no_indices',
|
||||
'expand_wildcards',
|
||||
'pretty',
|
||||
'human',
|
||||
'error_trace',
|
||||
'source',
|
||||
'filter_path'
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
masterTimeout: 'master_timeout',
|
||||
flatSettings: 'flat_settings',
|
||||
waitForMetadataVersion: 'wait_for_metadata_version',
|
||||
waitForTimeout: 'wait_for_timeout',
|
||||
ignoreUnavailable: 'ignore_unavailable',
|
||||
allowNoIndices: 'allow_no_indices',
|
||||
expandWildcards: 'expand_wildcards',
|
||||
errorTrace: 'error_trace',
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
return function clusterState (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// check required url components
|
||||
if (params['index'] != null && (params['metric'] == null)) {
|
||||
const err = new ConfigurationError('Missing required parameter of the url: metric')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, index, metric, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
if ((metric) != null && (index) != null) {
|
||||
path = '/' + '_cluster' + '/' + 'state' + '/' + encodeURIComponent(metric) + '/' + encodeURIComponent(index)
|
||||
} else if ((metric) != null) {
|
||||
path = '/' + '_cluster' + '/' + 'state' + '/' + encodeURIComponent(metric)
|
||||
} else {
|
||||
path = '/' + '_cluster' + '/' + 'state'
|
||||
}
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildClusterState
|
||||
110
api/api/cluster.stats.js
Normal file
110
api/api/cluster.stats.js
Normal file
@ -0,0 +1,110 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildClusterStats (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [cluster.stats](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-stats.html) request
|
||||
*
|
||||
* @param {list} node_id - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes
|
||||
* @param {boolean} flat_settings - Return settings in flat format (default: false)
|
||||
* @param {time} timeout - Explicit operation timeout
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
'flat_settings',
|
||||
'timeout',
|
||||
'pretty',
|
||||
'human',
|
||||
'error_trace',
|
||||
'source',
|
||||
'filter_path'
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
flatSettings: 'flat_settings',
|
||||
errorTrace: 'error_trace',
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
return function clusterStats (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, nodeId, node_id, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
if ((node_id || nodeId) != null) {
|
||||
path = '/' + '_cluster' + '/' + 'stats' + '/' + 'nodes' + '/' + encodeURIComponent(node_id || nodeId)
|
||||
} else {
|
||||
path = '/' + '_cluster' + '/' + 'stats'
|
||||
}
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildClusterStats
|
||||
145
api/api/count.js
Normal file
145
api/api/count.js
Normal file
@ -0,0 +1,145 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildCount (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [count](http://www.elastic.co/guide/en/elasticsearch/reference/master/search-count.html) request
|
||||
*
|
||||
* @param {list} index - A comma-separated list of indices to restrict the results
|
||||
* @param {list} type - A comma-separated list of types to restrict the results
|
||||
* @param {boolean} ignore_unavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed)
|
||||
* @param {boolean} ignore_throttled - Whether specified concrete, expanded or aliased indices should be ignored when throttled
|
||||
* @param {boolean} allow_no_indices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
|
||||
* @param {enum} expand_wildcards - Whether to expand wildcard expression to concrete indices that are open, closed or both.
|
||||
* @param {number} min_score - Include only documents with a specific `_score` value in the result
|
||||
* @param {string} preference - Specify the node or shard the operation should be performed on (default: random)
|
||||
* @param {list} routing - A comma-separated list of specific routing values
|
||||
* @param {string} q - Query in the Lucene query string syntax
|
||||
* @param {string} analyzer - The analyzer to use for the query string
|
||||
* @param {boolean} analyze_wildcard - Specify whether wildcard and prefix queries should be analyzed (default: false)
|
||||
* @param {enum} default_operator - The default operator for query string query (AND or OR)
|
||||
* @param {string} df - The field to use as default where no field prefix is given in the query string
|
||||
* @param {boolean} lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored
|
||||
* @param {number} terminate_after - The maximum count for each shard, upon reaching which the query execution will terminate early
|
||||
* @param {object} body - A query to restrict the results specified with the Query DSL (optional)
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
'ignore_unavailable',
|
||||
'ignore_throttled',
|
||||
'allow_no_indices',
|
||||
'expand_wildcards',
|
||||
'min_score',
|
||||
'preference',
|
||||
'routing',
|
||||
'q',
|
||||
'analyzer',
|
||||
'analyze_wildcard',
|
||||
'default_operator',
|
||||
'df',
|
||||
'lenient',
|
||||
'terminate_after',
|
||||
'pretty',
|
||||
'human',
|
||||
'error_trace',
|
||||
'source',
|
||||
'filter_path'
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
ignoreUnavailable: 'ignore_unavailable',
|
||||
ignoreThrottled: 'ignore_throttled',
|
||||
allowNoIndices: 'allow_no_indices',
|
||||
expandWildcards: 'expand_wildcards',
|
||||
minScore: 'min_score',
|
||||
analyzeWildcard: 'analyze_wildcard',
|
||||
defaultOperator: 'default_operator',
|
||||
terminateAfter: 'terminate_after',
|
||||
errorTrace: 'error_trace',
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
return function count (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required url components
|
||||
if (params['type'] != null && (params['index'] == null)) {
|
||||
const err = new ConfigurationError('Missing required parameter of the url: index')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, index, type, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = body == null ? 'GET' : 'POST'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
if ((index) != null && (type) != null) {
|
||||
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_count'
|
||||
} else if ((index) != null) {
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_count'
|
||||
} else {
|
||||
path = '/' + '_count'
|
||||
}
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildCount
|
||||
132
api/api/create.js
Normal file
132
api/api/create.js
Normal file
@ -0,0 +1,132 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildCreate (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [create](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html) request
|
||||
*
|
||||
* @param {string} id - Document ID
|
||||
* @param {string} index - The name of the index
|
||||
* @param {string} type - The type of the document
|
||||
* @param {string} wait_for_active_shards - Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)
|
||||
* @param {enum} refresh - If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes.
|
||||
* @param {string} routing - Specific routing value
|
||||
* @param {time} timeout - Explicit operation timeout
|
||||
* @param {number} version - Explicit version number for concurrency control
|
||||
* @param {enum} version_type - Specific version type
|
||||
* @param {string} pipeline - The pipeline id to preprocess incoming documents with
|
||||
* @param {object} body - The document
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
'wait_for_active_shards',
|
||||
'refresh',
|
||||
'routing',
|
||||
'timeout',
|
||||
'version',
|
||||
'version_type',
|
||||
'pipeline',
|
||||
'pretty',
|
||||
'human',
|
||||
'error_trace',
|
||||
'source',
|
||||
'filter_path'
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
waitForActiveShards: 'wait_for_active_shards',
|
||||
versionType: 'version_type',
|
||||
errorTrace: 'error_trace',
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
return function create (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params['id'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: id')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params['index'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: index')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params['body'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, id, index, type, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'PUT'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
if ((index) != null && (type) != null && (id) != null) {
|
||||
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_create'
|
||||
} else {
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_create' + '/' + encodeURIComponent(id)
|
||||
}
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildCreate
|
||||
100
api/api/data_frame.delete_data_frame_transform.js
Normal file
100
api/api/data_frame.delete_data_frame_transform.js
Normal file
@ -0,0 +1,100 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildDataFrameDeleteDataFrameTransform (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [data_frame.delete_data_frame_transform](https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-data-frame-transform.html) request
|
||||
*
|
||||
* @param {string} transform_id - The id of the transform to delete
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
|
||||
}
|
||||
|
||||
return function dataFrameDeleteDataFrameTransform (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params['transform_id'] == null && params['transformId'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: transform_id or transformId')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, transformId, transform_id, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'DELETE'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
path = '/' + '_data_frame' + '/' + 'transforms' + '/' + encodeURIComponent(transform_id || transformId)
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: '',
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildDataFrameDeleteDataFrameTransform
|
||||
103
api/api/data_frame.get_data_frame_transform.js
Normal file
103
api/api/data_frame.get_data_frame_transform.js
Normal file
@ -0,0 +1,103 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildDataFrameGetDataFrameTransform (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [data_frame.get_data_frame_transform](https://www.elastic.co/guide/en/elasticsearch/reference/current/get-data-frame-transform.html) request
|
||||
*
|
||||
* @param {string} transform_id - The id or comma delimited list of id expressions of the transforms to get, '_all' or '*' implies get all transforms
|
||||
* @param {int} from - skips a number of transform configs, defaults to 0
|
||||
* @param {int} size - specifies a max number of transforms to get, defaults to 100
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
'from',
|
||||
'size'
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
|
||||
}
|
||||
|
||||
return function dataFrameGetDataFrameTransform (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, transformId, transform_id, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
if ((transform_id || transformId) != null) {
|
||||
path = '/' + '_data_frame' + '/' + 'transforms' + '/' + encodeURIComponent(transform_id || transformId)
|
||||
} else {
|
||||
path = '/' + '_data_frame' + '/' + 'transforms'
|
||||
}
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildDataFrameGetDataFrameTransform
|
||||
99
api/api/data_frame.get_data_frame_transform_stats.js
Normal file
99
api/api/data_frame.get_data_frame_transform_stats.js
Normal file
@ -0,0 +1,99 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildDataFrameGetDataFrameTransformStats (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [data_frame.get_data_frame_transform_stats](https://www.elastic.co/guide/en/elasticsearch/reference/current/get-data-frame-transform-stats.html) request
|
||||
*
|
||||
* @param {string} transform_id - The id of the transform for which to get stats. '_all' or '*' implies all transforms
|
||||
* @param {number} from - skips a number of transform stats, defaults to 0
|
||||
* @param {number} size - specifies a max number of transform stats to get, defaults to 100
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
'from',
|
||||
'size'
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
|
||||
}
|
||||
|
||||
return function dataFrameGetDataFrameTransformStats (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, transformId, transform_id, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
path = '/' + '_data_frame' + '/' + 'transforms' + '/' + encodeURIComponent(transform_id || transformId) + '/' + '_stats'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildDataFrameGetDataFrameTransformStats
|
||||
96
api/api/data_frame.preview_data_frame_transform.js
Normal file
96
api/api/data_frame.preview_data_frame_transform.js
Normal file
@ -0,0 +1,96 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildDataFramePreviewDataFrameTransform (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [data_frame.preview_data_frame_transform](https://www.elastic.co/guide/en/elasticsearch/reference/current/preview-data-frame-transform.html) request
|
||||
*
|
||||
* @param {object} body - The definition for the data_frame transform to preview
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
|
||||
}
|
||||
|
||||
return function dataFramePreviewDataFrameTransform (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params['body'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'POST'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
path = '/' + '_data_frame' + '/' + 'transforms' + '/' + '_preview'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildDataFramePreviewDataFrameTransform
|
||||
101
api/api/data_frame.put_data_frame_transform.js
Normal file
101
api/api/data_frame.put_data_frame_transform.js
Normal file
@ -0,0 +1,101 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildDataFramePutDataFrameTransform (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [data_frame.put_data_frame_transform](https://www.elastic.co/guide/en/elasticsearch/reference/current/put-data-frame-transform.html) request
|
||||
*
|
||||
* @param {string} transform_id - The id of the new transform.
|
||||
* @param {object} body - The data frame transform definition
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
|
||||
}
|
||||
|
||||
return function dataFramePutDataFrameTransform (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params['transform_id'] == null && params['transformId'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: transform_id or transformId')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params['body'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, transformId, transform_id, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'PUT'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
path = '/' + '_data_frame' + '/' + 'transforms' + '/' + encodeURIComponent(transform_id || transformId)
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildDataFramePutDataFrameTransform
|
||||
101
api/api/data_frame.start_data_frame_transform.js
Normal file
101
api/api/data_frame.start_data_frame_transform.js
Normal file
@ -0,0 +1,101 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildDataFrameStartDataFrameTransform (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [data_frame.start_data_frame_transform](https://www.elastic.co/guide/en/elasticsearch/reference/current/start-data-frame-transform.html) request
|
||||
*
|
||||
* @param {string} transform_id - The id of the transform to start
|
||||
* @param {time} timeout - Controls the time to wait for the transform to start
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
'timeout'
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
|
||||
}
|
||||
|
||||
return function dataFrameStartDataFrameTransform (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params['transform_id'] == null && params['transformId'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: transform_id or transformId')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, transformId, transform_id, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'POST'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
path = '/' + '_data_frame' + '/' + 'transforms' + '/' + encodeURIComponent(transform_id || transformId) + '/' + '_start'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: '',
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildDataFrameStartDataFrameTransform
|
||||
104
api/api/data_frame.stop_data_frame_transform.js
Normal file
104
api/api/data_frame.stop_data_frame_transform.js
Normal file
@ -0,0 +1,104 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildDataFrameStopDataFrameTransform (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [data_frame.stop_data_frame_transform](https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-data-frame-transform.html) request
|
||||
*
|
||||
* @param {string} transform_id - The id of the transform to stop
|
||||
* @param {boolean} wait_for_completion - Whether to wait for the transform to fully stop before returning or not. Default to false
|
||||
* @param {time} timeout - Controls the time to wait until the transform has stopped. Default to 30 seconds
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
'wait_for_completion',
|
||||
'timeout'
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
waitForCompletion: 'wait_for_completion'
|
||||
|
||||
}
|
||||
|
||||
return function dataFrameStopDataFrameTransform (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params['transform_id'] == null && params['transformId'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: transform_id or transformId')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, transformId, transform_id, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'POST'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
path = '/' + '_data_frame' + '/' + 'transforms' + '/' + encodeURIComponent(transform_id || transformId) + '/' + '_stop'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: '',
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildDataFrameStopDataFrameTransform
|
||||
135
api/api/delete.js
Normal file
135
api/api/delete.js
Normal file
@ -0,0 +1,135 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildDelete (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [delete](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete.html) request
|
||||
*
|
||||
* @param {string} id - The document ID
|
||||
* @param {string} index - The name of the index
|
||||
* @param {string} type - The type of the document
|
||||
* @param {string} wait_for_active_shards - Sets the number of shard copies that must be active before proceeding with the delete operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)
|
||||
* @param {enum} refresh - If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes.
|
||||
* @param {string} routing - Specific routing value
|
||||
* @param {time} timeout - Explicit operation timeout
|
||||
* @param {number} if_seq_no - only perform the delete operation if the last operation that has changed the document has the specified sequence number
|
||||
* @param {number} if_primary_term - only perform the delete operation if the last operation that has changed the document has the specified primary term
|
||||
* @param {number} version - Explicit version number for concurrency control
|
||||
* @param {enum} version_type - Specific version type
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
'wait_for_active_shards',
|
||||
'refresh',
|
||||
'routing',
|
||||
'timeout',
|
||||
'if_seq_no',
|
||||
'if_primary_term',
|
||||
'version',
|
||||
'version_type',
|
||||
'pretty',
|
||||
'human',
|
||||
'error_trace',
|
||||
'source',
|
||||
'filter_path'
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
waitForActiveShards: 'wait_for_active_shards',
|
||||
ifSeqNo: 'if_seq_no',
|
||||
ifPrimaryTerm: 'if_primary_term',
|
||||
versionType: 'version_type',
|
||||
errorTrace: 'error_trace',
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
return function _delete (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params['id'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: id')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params['index'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: index')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, id, index, type, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'DELETE'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
if ((index) != null && (type) != null && (id) != null) {
|
||||
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id)
|
||||
} else {
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_doc' + '/' + encodeURIComponent(id)
|
||||
}
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: '',
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildDelete
|
||||
200
api/api/delete_by_query.js
Normal file
200
api/api/delete_by_query.js
Normal file
@ -0,0 +1,200 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildDeleteByQuery (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [delete_by_query](https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete-by-query.html) request
|
||||
*
|
||||
* @param {list} index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices
|
||||
* @param {list} type - A comma-separated list of document types to search; leave empty to perform the operation on all types
|
||||
* @param {string} analyzer - The analyzer to use for the query string
|
||||
* @param {boolean} analyze_wildcard - Specify whether wildcard and prefix queries should be analyzed (default: false)
|
||||
* @param {enum} default_operator - The default operator for query string query (AND or OR)
|
||||
* @param {string} df - The field to use as default where no field prefix is given in the query string
|
||||
* @param {number} from - Starting offset (default: 0)
|
||||
* @param {boolean} ignore_unavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed)
|
||||
* @param {boolean} allow_no_indices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
|
||||
* @param {enum} conflicts - What to do when the delete by query hits version conflicts?
|
||||
* @param {enum} expand_wildcards - Whether to expand wildcard expression to concrete indices that are open, closed or both.
|
||||
* @param {boolean} lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored
|
||||
* @param {string} preference - Specify the node or shard the operation should be performed on (default: random)
|
||||
* @param {string} q - Query in the Lucene query string syntax
|
||||
* @param {list} routing - A comma-separated list of specific routing values
|
||||
* @param {time} scroll - Specify how long a consistent view of the index should be maintained for scrolled search
|
||||
* @param {enum} search_type - Search operation type
|
||||
* @param {time} search_timeout - Explicit timeout for each search request. Defaults to no timeout.
|
||||
* @param {number} size - Number of hits to return (default: 10)
|
||||
* @param {list} sort - A comma-separated list of <field>:<direction> pairs
|
||||
* @param {list} _source - True or false to return the _source field or not, or a list of fields to return
|
||||
* @param {list} _source_excludes - A list of fields to exclude from the returned _source field
|
||||
* @param {list} _source_includes - A list of fields to extract and return from the _source field
|
||||
* @param {number} terminate_after - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.
|
||||
* @param {list} stats - Specific 'tag' of the request for logging and statistical purposes
|
||||
* @param {boolean} version - Specify whether to return document version as part of a hit
|
||||
* @param {boolean} request_cache - Specify if request cache should be used for this request or not, defaults to index level setting
|
||||
* @param {boolean} refresh - Should the effected indexes be refreshed?
|
||||
* @param {time} timeout - Time each individual bulk request should wait for shards that are unavailable.
|
||||
* @param {string} wait_for_active_shards - Sets the number of shard copies that must be active before proceeding with the delete by query operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)
|
||||
* @param {number} scroll_size - Size on the scroll request powering the delete by query
|
||||
* @param {boolean} wait_for_completion - Should the request should block until the delete by query is complete.
|
||||
* @param {number} requests_per_second - The throttle for this request in sub-requests per second. -1 means no throttle.
|
||||
* @param {number} slices - The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks.
|
||||
* @param {object} body - The search definition using the Query DSL
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
'analyzer',
|
||||
'analyze_wildcard',
|
||||
'default_operator',
|
||||
'df',
|
||||
'from',
|
||||
'ignore_unavailable',
|
||||
'allow_no_indices',
|
||||
'conflicts',
|
||||
'expand_wildcards',
|
||||
'lenient',
|
||||
'preference',
|
||||
'q',
|
||||
'routing',
|
||||
'scroll',
|
||||
'search_type',
|
||||
'search_timeout',
|
||||
'size',
|
||||
'sort',
|
||||
'_source',
|
||||
'_source_excludes',
|
||||
'_source_exclude',
|
||||
'_source_includes',
|
||||
'_source_include',
|
||||
'terminate_after',
|
||||
'stats',
|
||||
'version',
|
||||
'request_cache',
|
||||
'refresh',
|
||||
'timeout',
|
||||
'wait_for_active_shards',
|
||||
'scroll_size',
|
||||
'wait_for_completion',
|
||||
'requests_per_second',
|
||||
'slices',
|
||||
'pretty',
|
||||
'human',
|
||||
'error_trace',
|
||||
'source',
|
||||
'filter_path'
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
analyzeWildcard: 'analyze_wildcard',
|
||||
defaultOperator: 'default_operator',
|
||||
ignoreUnavailable: 'ignore_unavailable',
|
||||
allowNoIndices: 'allow_no_indices',
|
||||
expandWildcards: 'expand_wildcards',
|
||||
searchType: 'search_type',
|
||||
searchTimeout: 'search_timeout',
|
||||
_sourceExcludes: '_source_excludes',
|
||||
_sourceExclude: '_source_exclude',
|
||||
_sourceIncludes: '_source_includes',
|
||||
_sourceInclude: '_source_include',
|
||||
terminateAfter: 'terminate_after',
|
||||
requestCache: 'request_cache',
|
||||
waitForActiveShards: 'wait_for_active_shards',
|
||||
scrollSize: 'scroll_size',
|
||||
waitForCompletion: 'wait_for_completion',
|
||||
requestsPerSecond: 'requests_per_second',
|
||||
errorTrace: 'error_trace',
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
return function deleteByQuery (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params['index'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: index')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params['body'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// check required url components
|
||||
if (params['type'] != null && (params['index'] == null)) {
|
||||
const err = new ConfigurationError('Missing required parameter of the url: index')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, index, type, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'POST'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
if ((index) != null && (type) != null) {
|
||||
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_delete_by_query'
|
||||
} else {
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_delete_by_query'
|
||||
}
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildDeleteByQuery
|
||||
112
api/api/delete_by_query_rethrottle.js
Normal file
112
api/api/delete_by_query_rethrottle.js
Normal file
@ -0,0 +1,112 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildDeleteByQueryRethrottle (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [delete_by_query_rethrottle](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete-by-query.html) request
|
||||
*
|
||||
* @param {string} task_id - The task id to rethrottle
|
||||
* @param {number} requests_per_second - The throttle to set on this request in floating sub-requests per second. -1 means set no throttle.
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
'requests_per_second',
|
||||
'pretty',
|
||||
'human',
|
||||
'error_trace',
|
||||
'source',
|
||||
'filter_path'
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
requestsPerSecond: 'requests_per_second',
|
||||
errorTrace: 'error_trace',
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
return function deleteByQueryRethrottle (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params['task_id'] == null && params['taskId'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: task_id or taskId')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params['requests_per_second'] == null && params['requestsPerSecond'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: requests_per_second or requestsPerSecond')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, taskId, task_id, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'POST'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
path = '/' + '_delete_by_query' + '/' + encodeURIComponent(task_id || taskId) + '/' + '_rethrottle'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: '',
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildDeleteByQueryRethrottle
|
||||
110
api/api/delete_script.js
Normal file
110
api/api/delete_script.js
Normal file
@ -0,0 +1,110 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildDeleteScript (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [delete_script](http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html) request
|
||||
*
|
||||
* @param {string} id - Script ID
|
||||
* @param {time} timeout - Explicit operation timeout
|
||||
* @param {time} master_timeout - Specify timeout for connection to master
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
'timeout',
|
||||
'master_timeout',
|
||||
'pretty',
|
||||
'human',
|
||||
'error_trace',
|
||||
'source',
|
||||
'filter_path'
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
masterTimeout: 'master_timeout',
|
||||
errorTrace: 'error_trace',
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
return function deleteScript (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params['id'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: id')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, id, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'DELETE'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
path = '/' + '_scripts' + '/' + encodeURIComponent(id)
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: '',
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildDeleteScript
|
||||
143
api/api/exists.js
Normal file
143
api/api/exists.js
Normal file
@ -0,0 +1,143 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildExists (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [exists](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html) request
|
||||
*
|
||||
* @param {string} id - The document ID
|
||||
* @param {string} index - The name of the index
|
||||
* @param {string} type - The type of the document (use `_all` to fetch the first document matching the ID across all types)
|
||||
* @param {list} stored_fields - A comma-separated list of stored fields to return in the response
|
||||
* @param {string} preference - Specify the node or shard the operation should be performed on (default: random)
|
||||
* @param {boolean} realtime - Specify whether to perform the operation in realtime or search mode
|
||||
* @param {boolean} refresh - Refresh the shard containing the document before performing the operation
|
||||
* @param {string} routing - Specific routing value
|
||||
* @param {list} _source - True or false to return the _source field or not, or a list of fields to return
|
||||
* @param {list} _source_excludes - A list of fields to exclude from the returned _source field
|
||||
* @param {list} _source_includes - A list of fields to extract and return from the _source field
|
||||
* @param {number} version - Explicit version number for concurrency control
|
||||
* @param {enum} version_type - Specific version type
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
'stored_fields',
|
||||
'preference',
|
||||
'realtime',
|
||||
'refresh',
|
||||
'routing',
|
||||
'_source',
|
||||
'_source_excludes',
|
||||
'_source_exclude',
|
||||
'_source_includes',
|
||||
'_source_include',
|
||||
'version',
|
||||
'version_type',
|
||||
'pretty',
|
||||
'human',
|
||||
'error_trace',
|
||||
'source',
|
||||
'filter_path'
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
storedFields: 'stored_fields',
|
||||
_sourceExcludes: '_source_excludes',
|
||||
_sourceExclude: '_source_exclude',
|
||||
_sourceIncludes: '_source_includes',
|
||||
_sourceInclude: '_source_include',
|
||||
versionType: 'version_type',
|
||||
errorTrace: 'error_trace',
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
return function exists (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params['id'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: id')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params['index'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: index')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, id, index, type, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'HEAD'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
if ((index) != null && (type) != null && (id) != null) {
|
||||
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id)
|
||||
} else {
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_doc' + '/' + encodeURIComponent(id)
|
||||
}
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildExists
|
||||
149
api/api/exists_source.js
Normal file
149
api/api/exists_source.js
Normal file
@ -0,0 +1,149 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildExistsSource (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [exists_source](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html) request
|
||||
*
|
||||
* @param {string} id - The document ID
|
||||
* @param {string} index - The name of the index
|
||||
* @param {string} type - The type of the document; deprecated and optional starting with 7.0
|
||||
* @param {string} preference - Specify the node or shard the operation should be performed on (default: random)
|
||||
* @param {boolean} realtime - Specify whether to perform the operation in realtime or search mode
|
||||
* @param {boolean} refresh - Refresh the shard containing the document before performing the operation
|
||||
* @param {string} routing - Specific routing value
|
||||
* @param {list} _source - True or false to return the _source field or not, or a list of fields to return
|
||||
* @param {list} _source_excludes - A list of fields to exclude from the returned _source field
|
||||
* @param {list} _source_includes - A list of fields to extract and return from the _source field
|
||||
* @param {number} version - Explicit version number for concurrency control
|
||||
* @param {enum} version_type - Specific version type
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
'preference',
|
||||
'realtime',
|
||||
'refresh',
|
||||
'routing',
|
||||
'_source',
|
||||
'_source_excludes',
|
||||
'_source_exclude',
|
||||
'_source_includes',
|
||||
'_source_include',
|
||||
'version',
|
||||
'version_type',
|
||||
'pretty',
|
||||
'human',
|
||||
'error_trace',
|
||||
'source',
|
||||
'filter_path'
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
_sourceExcludes: '_source_excludes',
|
||||
_sourceExclude: '_source_exclude',
|
||||
_sourceIncludes: '_source_includes',
|
||||
_sourceInclude: '_source_include',
|
||||
versionType: 'version_type',
|
||||
errorTrace: 'error_trace',
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
return function existsSource (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params['id'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: id')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params['index'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: index')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// check required url components
|
||||
if (params['id'] != null && (params['type'] == null || params['index'] == null)) {
|
||||
const err = new ConfigurationError('Missing required parameter of the url: type, index')
|
||||
return handleError(err, callback)
|
||||
} else if (params['type'] != null && (params['index'] == null)) {
|
||||
const err = new ConfigurationError('Missing required parameter of the url: index')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, id, index, type, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'HEAD'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
if ((index) != null && (type) != null && (id) != null) {
|
||||
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_source'
|
||||
} else {
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_source' + '/' + encodeURIComponent(id)
|
||||
}
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildExistsSource
|
||||
145
api/api/explain.js
Normal file
145
api/api/explain.js
Normal file
@ -0,0 +1,145 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildExplain (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [explain](http://www.elastic.co/guide/en/elasticsearch/reference/master/search-explain.html) request
|
||||
*
|
||||
* @param {string} id - The document ID
|
||||
* @param {string} index - The name of the index
|
||||
* @param {string} type - The type of the document
|
||||
* @param {boolean} analyze_wildcard - Specify whether wildcards and prefix queries in the query string query should be analyzed (default: false)
|
||||
* @param {string} analyzer - The analyzer for the query string query
|
||||
* @param {enum} default_operator - The default operator for query string query (AND or OR)
|
||||
* @param {string} df - The default field for query string query (default: _all)
|
||||
* @param {list} stored_fields - A comma-separated list of stored fields to return in the response
|
||||
* @param {boolean} lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored
|
||||
* @param {string} preference - Specify the node or shard the operation should be performed on (default: random)
|
||||
* @param {string} q - Query in the Lucene query string syntax
|
||||
* @param {string} routing - Specific routing value
|
||||
* @param {list} _source - True or false to return the _source field or not, or a list of fields to return
|
||||
* @param {list} _source_excludes - A list of fields to exclude from the returned _source field
|
||||
* @param {list} _source_includes - A list of fields to extract and return from the _source field
|
||||
* @param {object} body - The query definition using the Query DSL
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
'analyze_wildcard',
|
||||
'analyzer',
|
||||
'default_operator',
|
||||
'df',
|
||||
'stored_fields',
|
||||
'lenient',
|
||||
'preference',
|
||||
'q',
|
||||
'routing',
|
||||
'_source',
|
||||
'_source_excludes',
|
||||
'_source_exclude',
|
||||
'_source_includes',
|
||||
'_source_include',
|
||||
'pretty',
|
||||
'human',
|
||||
'error_trace',
|
||||
'source',
|
||||
'filter_path'
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
analyzeWildcard: 'analyze_wildcard',
|
||||
defaultOperator: 'default_operator',
|
||||
storedFields: 'stored_fields',
|
||||
_sourceExcludes: '_source_excludes',
|
||||
_sourceExclude: '_source_exclude',
|
||||
_sourceIncludes: '_source_includes',
|
||||
_sourceInclude: '_source_include',
|
||||
errorTrace: 'error_trace',
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
return function explain (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params['id'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: id')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params['index'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: index')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, id, index, type, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = body == null ? 'GET' : 'POST'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
if ((index) != null && (type) != null && (id) != null) {
|
||||
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_explain'
|
||||
} else {
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_explain' + '/' + encodeURIComponent(id)
|
||||
}
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildExplain
|
||||
119
api/api/field_caps.js
Normal file
119
api/api/field_caps.js
Normal file
@ -0,0 +1,119 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildFieldCaps (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [field_caps](http://www.elastic.co/guide/en/elasticsearch/reference/master/search-field-caps.html) request
|
||||
*
|
||||
* @param {list} index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
|
||||
* @param {list} fields - A comma-separated list of field names
|
||||
* @param {boolean} ignore_unavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed)
|
||||
* @param {boolean} allow_no_indices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
|
||||
* @param {enum} expand_wildcards - Whether to expand wildcard expression to concrete indices that are open, closed or both.
|
||||
* @param {boolean} include_unmapped - Indicates whether unmapped fields should be included in the response.
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
'fields',
|
||||
'ignore_unavailable',
|
||||
'allow_no_indices',
|
||||
'expand_wildcards',
|
||||
'include_unmapped',
|
||||
'pretty',
|
||||
'human',
|
||||
'error_trace',
|
||||
'source',
|
||||
'filter_path'
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
ignoreUnavailable: 'ignore_unavailable',
|
||||
allowNoIndices: 'allow_no_indices',
|
||||
expandWildcards: 'expand_wildcards',
|
||||
includeUnmapped: 'include_unmapped',
|
||||
errorTrace: 'error_trace',
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
return function fieldCaps (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, index, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = body == null ? 'GET' : 'POST'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
if ((index) != null) {
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_field_caps'
|
||||
} else {
|
||||
path = '/' + '_field_caps'
|
||||
}
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: '',
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildFieldCaps
|
||||
143
api/api/get.js
Normal file
143
api/api/get.js
Normal file
@ -0,0 +1,143 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildGet (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [get](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html) request
|
||||
*
|
||||
* @param {string} id - The document ID
|
||||
* @param {string} index - The name of the index
|
||||
* @param {string} type - The type of the document (use `_all` to fetch the first document matching the ID across all types)
|
||||
* @param {list} stored_fields - A comma-separated list of stored fields to return in the response
|
||||
* @param {string} preference - Specify the node or shard the operation should be performed on (default: random)
|
||||
* @param {boolean} realtime - Specify whether to perform the operation in realtime or search mode
|
||||
* @param {boolean} refresh - Refresh the shard containing the document before performing the operation
|
||||
* @param {string} routing - Specific routing value
|
||||
* @param {list} _source - True or false to return the _source field or not, or a list of fields to return
|
||||
* @param {list} _source_excludes - A list of fields to exclude from the returned _source field
|
||||
* @param {list} _source_includes - A list of fields to extract and return from the _source field
|
||||
* @param {number} version - Explicit version number for concurrency control
|
||||
* @param {enum} version_type - Specific version type
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
'stored_fields',
|
||||
'preference',
|
||||
'realtime',
|
||||
'refresh',
|
||||
'routing',
|
||||
'_source',
|
||||
'_source_excludes',
|
||||
'_source_exclude',
|
||||
'_source_includes',
|
||||
'_source_include',
|
||||
'version',
|
||||
'version_type',
|
||||
'pretty',
|
||||
'human',
|
||||
'error_trace',
|
||||
'source',
|
||||
'filter_path'
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
storedFields: 'stored_fields',
|
||||
_sourceExcludes: '_source_excludes',
|
||||
_sourceExclude: '_source_exclude',
|
||||
_sourceIncludes: '_source_includes',
|
||||
_sourceInclude: '_source_include',
|
||||
versionType: 'version_type',
|
||||
errorTrace: 'error_trace',
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
return function get (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params['id'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: id')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params['index'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: index')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, id, index, type, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
if ((index) != null && (type) != null && (id) != null) {
|
||||
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id)
|
||||
} else {
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_doc' + '/' + encodeURIComponent(id)
|
||||
}
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildGet
|
||||
108
api/api/get_script.js
Normal file
108
api/api/get_script.js
Normal file
@ -0,0 +1,108 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildGetScript (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [get_script](http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html) request
|
||||
*
|
||||
* @param {string} id - Script ID
|
||||
* @param {time} master_timeout - Specify timeout for connection to master
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
'master_timeout',
|
||||
'pretty',
|
||||
'human',
|
||||
'error_trace',
|
||||
'source',
|
||||
'filter_path'
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
masterTimeout: 'master_timeout',
|
||||
errorTrace: 'error_trace',
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
return function getScript (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params['id'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: id')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, id, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
path = '/' + '_scripts' + '/' + encodeURIComponent(id)
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildGetScript
|
||||
140
api/api/get_source.js
Normal file
140
api/api/get_source.js
Normal file
@ -0,0 +1,140 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildGetSource (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [get_source](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html) request
|
||||
*
|
||||
* @param {string} id - The document ID
|
||||
* @param {string} index - The name of the index
|
||||
* @param {string} type - The type of the document; deprecated and optional starting with 7.0
|
||||
* @param {string} preference - Specify the node or shard the operation should be performed on (default: random)
|
||||
* @param {boolean} realtime - Specify whether to perform the operation in realtime or search mode
|
||||
* @param {boolean} refresh - Refresh the shard containing the document before performing the operation
|
||||
* @param {string} routing - Specific routing value
|
||||
* @param {list} _source - True or false to return the _source field or not, or a list of fields to return
|
||||
* @param {list} _source_excludes - A list of fields to exclude from the returned _source field
|
||||
* @param {list} _source_includes - A list of fields to extract and return from the _source field
|
||||
* @param {number} version - Explicit version number for concurrency control
|
||||
* @param {enum} version_type - Specific version type
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
'preference',
|
||||
'realtime',
|
||||
'refresh',
|
||||
'routing',
|
||||
'_source',
|
||||
'_source_excludes',
|
||||
'_source_exclude',
|
||||
'_source_includes',
|
||||
'_source_include',
|
||||
'version',
|
||||
'version_type',
|
||||
'pretty',
|
||||
'human',
|
||||
'error_trace',
|
||||
'source',
|
||||
'filter_path'
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
_sourceExcludes: '_source_excludes',
|
||||
_sourceExclude: '_source_exclude',
|
||||
_sourceIncludes: '_source_includes',
|
||||
_sourceInclude: '_source_include',
|
||||
versionType: 'version_type',
|
||||
errorTrace: 'error_trace',
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
return function getSource (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params['id'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: id')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params['index'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: index')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, id, index, type, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
if ((index) != null && (type) != null && (id) != null) {
|
||||
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_source'
|
||||
} else {
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_source' + '/' + encodeURIComponent(id)
|
||||
}
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildGetSource
|
||||
105
api/api/graph.explore.js
Normal file
105
api/api/graph.explore.js
Normal file
@ -0,0 +1,105 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildGraphExplore (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [graph.explore](https://www.elastic.co/guide/en/elasticsearch/reference/current/graph-explore-api.html) request
|
||||
*
|
||||
* @param {list} index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices
|
||||
* @param {list} type - A comma-separated list of document types to search; leave empty to perform the operation on all types
|
||||
* @param {string} routing - Specific routing value
|
||||
* @param {time} timeout - Explicit operation timeout
|
||||
* @param {object} body - Graph Query DSL
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
'routing',
|
||||
'timeout'
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
|
||||
}
|
||||
|
||||
return function graphExplore (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required url components
|
||||
if (params['type'] != null && (params['index'] == null)) {
|
||||
const err = new ConfigurationError('Missing required parameter of the url: index')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, index, type, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = body == null ? 'GET' : 'POST'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
if ((index) != null && (type) != null) {
|
||||
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_graph' + '/' + 'explore'
|
||||
} else {
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_graph' + '/' + 'explore'
|
||||
}
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildGraphExplore
|
||||
96
api/api/ilm.delete_lifecycle.js
Normal file
96
api/api/ilm.delete_lifecycle.js
Normal file
@ -0,0 +1,96 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildIlmDeleteLifecycle (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [ilm.delete_lifecycle](https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-delete-lifecycle.html) request
|
||||
*
|
||||
* @param {string} policy - The name of the index lifecycle policy
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
|
||||
}
|
||||
|
||||
return function ilmDeleteLifecycle (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, policy, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'DELETE'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
path = '/' + '_ilm' + '/' + 'policy' + '/' + encodeURIComponent(policy)
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: '',
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildIlmDeleteLifecycle
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user