Auto-generated code for 8.15 (#2342)

This commit is contained in:
Elastic Machine
2024-08-20 01:52:15 +10:00
committed by GitHub
parent 78332da539
commit 242b4227ee
58 changed files with 813 additions and 158 deletions

View File

@ -5,6 +5,21 @@
----
const response = await client.searchApplication.renderQuery({
name: "my-app",
body: {
params: {
query_string: "my first query",
text_fields: [
{
name: "title",
boost: 5,
},
{
name: "description",
boost: 1,
},
],
},
},
});
console.log(response);
----

View File

@ -0,0 +1,20 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.indices.create({
index: "elser-embeddings",
mappings: {
properties: {
content_embedding: {
type: "sparse_vector",
},
content: {
type: "text",
},
},
},
});
console.log(response);
----

View File

@ -5,6 +5,11 @@
----
const response = await client.security.queryUser({
with_profile_uid: "true",
query: {
prefix: {
roles: "other",
},
},
});
console.log(response);
----

View File

@ -3,6 +3,25 @@
[source, js]
----
const response = await client.simulate.ingest({});
const response = await client.simulate.ingest({
body: {
docs: [
{
_index: "my-index",
_id: "123",
_source: {
foo: "bar",
},
},
{
_index: "my-index",
_id: "456",
_source: {
foo: "rab",
},
},
],
},
});
console.log(response);
----

View File

@ -0,0 +1,11 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.ingest.deleteGeoipDatabase({
id: "my-database-id",
body: null,
});
console.log(response);
----

View File

@ -0,0 +1,21 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.transport.request({
method: "PUT",
path: "/_inference/sparse_embedding/my-elser-model",
body: {
service: "elser",
service_settings: {
adaptive_allocations: {
enabled: true,
min_number_of_allocations: 3,
max_number_of_allocations: 10,
},
},
},
});
console.log(response);
----

View File

@ -3,6 +3,12 @@
[source, js]
----
const response = await client.security.oidcLogout({});
const response = await client.security.oidcLogout({
body: {
token:
"dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==",
refresh_token: "vLBPvmAB6KvwvJZr27cS",
},
});
console.log(response);
----

View File

@ -0,0 +1,10 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.security.bulkDeleteRole({
names: ["my_admin_role", "superuser"],
});
console.log(response);
----

View File

@ -6,6 +6,7 @@
const response = await client.esql.asyncQueryGet({
id: "FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=",
wait_for_completion_timeout: "30s",
body: null,
});
console.log(response);
----

View File

@ -0,0 +1,25 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.indices.create({
index: "bad_example_index",
mappings: {
properties: {
field_1: {
type: "text",
copy_to: "field_2",
},
field_2: {
type: "text",
copy_to: "field_3",
},
field_3: {
type: "text",
},
},
},
});
console.log(response);
----

View File

@ -0,0 +1,21 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.transport.request({
method: "PUT",
path: "/_inference/completion/anthropic_completion",
body: {
service: "anthropic",
service_settings: {
api_key: "<api_key>",
model_id: "<model_id>",
},
task_settings: {
max_tokens: 1024,
},
},
});
console.log(response);
----

View File

@ -0,0 +1,11 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.ingest.getGeoipDatabase({
id: "my-database-id",
body: null,
});
console.log(response);
----

View File

@ -3,6 +3,12 @@
[source, js]
----
const response = await client.esql.asyncQuery({});
const response = await client.esql.asyncQuery({
body: {
query:
"\n FROM library\n | EVAL year = DATE_TRUNC(1 YEARS, release_date)\n | STATS MAX(page_count) BY year\n | SORT year\n | LIMIT 5\n ",
wait_for_completion_timeout: "2s",
},
});
console.log(response);
----

View File

@ -5,6 +5,7 @@
----
const response = await client.esql.asyncQueryGet({
id: "FkpMRkJGS1gzVDRlM3g4ZzMyRGlLbkEaTXlJZHdNT09TU2VTZVBoNDM3cFZMUToxMDM=",
body: null,
});
console.log(response);
----

View File

@ -0,0 +1,10 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.security.bulkDeleteRole({
names: ["my_admin_role", "my_user_role"],
});
console.log(response);
----

View File

@ -0,0 +1,11 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.ml.startTrainedModelDeployment({
model_id: "my_model",
deployment_id: "my_model_for_search",
});
console.log(response);
----

View File

@ -0,0 +1,21 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.ingest.putPipeline({
id: "elser_embeddings",
processors: [
{
inference: {
model_id: "elser_embeddings",
input_output: {
input_field: "content",
output_field: "content_embedding",
},
},
},
],
});
console.log(response);
----

View File

@ -0,0 +1,11 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.ingest.deleteGeoipDatabase({
id: "example-database-id",
body: null,
});
console.log(response);
----

View File

@ -3,6 +3,12 @@
[source, js]
----
const response = await client.security.oidcPrepareAuthentication({});
const response = await client.security.oidcPrepareAuthentication({
body: {
realm: "oidc1",
state: "lGYK0EcSLjqH6pkT5EVZjC6eIW5YCGgywj2sxROO",
nonce: "zOBXLJGUooRrbLbQk5YCcyC8AXw3iloynvluYhZ5",
},
});
console.log(response);
----

View File

@ -0,0 +1,28 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.indices.create({
index: "test_index",
mappings: {
dynamic: "strict",
properties: {
description: {
properties: {
notes: {
type: "text",
copy_to: ["description.notes_raw"],
analyzer: "standard",
search_analyzer: "standard",
},
notes_raw: {
type: "keyword",
},
},
},
},
},
});
console.log(response);
----

View File

@ -0,0 +1,10 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.security.bulkDeleteRole({
names: ["my_admin_role", "not_an_existing_role"],
});
console.log(response);
----

View File

@ -1,47 +0,0 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.search({
query: {
intervals: {
my_text: {
all_of: {
intervals: [
{
match: {
query: "the",
},
},
{
any_of: {
intervals: [
{
match: {
query: "big",
},
},
{
match: {
query: "big bad",
},
},
],
},
},
{
match: {
query: "wolf",
},
},
],
max_gaps: 0,
ordered: true,
},
},
},
},
});
console.log(response);
----

View File

@ -29,7 +29,7 @@ const response = await client.transport.request({
},
{
rule_id: "rule2",
type: "pinned",
type: "exclude",
criteria: [
{
type: "contains",

View File

@ -0,0 +1,59 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.security.bulkPutRole({
roles: {
my_admin_role: {
cluster: ["all"],
indices: [
{
names: ["index1", "index2"],
privileges: ["all"],
field_security: {
grant: ["title", "body"],
},
query: '{"match": {"title": "foo"}}',
},
],
applications: [
{
application: "myapp",
privileges: ["admin", "read"],
resources: ["*"],
},
],
run_as: ["other_user"],
metadata: {
version: 1,
},
},
my_user_role: {
cluster: ["all"],
indices: [
{
names: ["index1"],
privileges: ["read"],
field_security: {
grant: ["title", "body"],
},
query: '{"match": {"title": "foo"}}',
},
],
applications: [
{
application: "myapp",
privileges: ["admin", "read"],
resources: ["*"],
},
],
run_as: ["other_user"],
metadata: {
version: 1,
},
},
},
});
console.log(response);
----

View File

@ -29,7 +29,7 @@ const response = await client.transport.request({
},
{
rule_id: "my-rule2",
type: "pinned",
type: "exclude",
criteria: [
{
type: "fuzzy",

View File

@ -3,6 +3,10 @@
[source, js]
----
const response = await client.security.bulkUpdateApiKeys({});
const response = await client.security.bulkUpdateApiKeys({
body: {
ids: ["VuaCfGcBCdbkQm-e5aOx", "H3_AhoIBA9hmeQJdg7ij"],
},
});
console.log(response);
----

View File

@ -3,6 +3,33 @@
[source, js]
----
const response = await client.textStructure.findMessageStructure({});
const response = await client.textStructure.findMessageStructure({
body: {
messages: [
"[2024-03-05T10:52:36,256][INFO ][o.a.l.u.VectorUtilPanamaProvider] [laptop] Java vector incubator API enabled; uses preferredBitSize=128",
"[2024-03-05T10:52:41,038][INFO ][o.e.p.PluginsService ] [laptop] loaded module [repository-url]",
"[2024-03-05T10:52:41,042][INFO ][o.e.p.PluginsService ] [laptop] loaded module [rest-root]",
"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-core]",
"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-redact]",
"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [ingest-user-agent]",
"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-monitoring]",
"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [repository-s3]",
"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-analytics]",
"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-ent-search]",
"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-autoscaling]",
"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [lang-painless]]",
"[2024-03-05T10:52:41,059][INFO ][o.e.p.PluginsService ] [laptop] loaded module [lang-expression]",
"[2024-03-05T10:52:41,059][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-eql]",
"[2024-03-05T10:52:43,291][INFO ][o.e.e.NodeEnvironment ] [laptop] heap size [16gb], compressed ordinary object pointers [true]",
"[2024-03-05T10:52:46,098][INFO ][o.e.x.s.Security ] [laptop] Security is enabled",
"[2024-03-05T10:52:47,227][INFO ][o.e.x.p.ProfilingPlugin ] [laptop] Profiling is enabled",
"[2024-03-05T10:52:47,259][INFO ][o.e.x.p.ProfilingPlugin ] [laptop] profiling index templates will not be installed or reinstalled",
"[2024-03-05T10:52:47,755][INFO ][o.e.i.r.RecoverySettings ] [laptop] using rate limit [40mb] with [default=40mb, read=0b, write=0b, max=0b]",
"[2024-03-05T10:52:47,787][INFO ][o.e.d.DiscoveryModule ] [laptop] using discovery type [multi-node] and seed hosts providers [settings]",
"[2024-03-05T10:52:49,188][INFO ][o.e.n.Node ] [laptop] initialized",
"[2024-03-05T10:52:49,199][INFO ][o.e.n.Node ] [laptop] starting ...",
],
},
});
console.log(response);
----

View File

@ -3,6 +3,37 @@
[source, js]
----
const response = await client.simulate.ingest({});
const response = await client.simulate.ingest({
body: {
docs: [
{
_index: "my-index",
_id: "id",
_source: {
foo: "bar",
},
},
{
_index: "my-index",
_id: "id",
_source: {
foo: "rab",
},
},
],
pipeline_substitutions: {
"my-pipeline": {
processors: [
{
set: {
field: "field3",
value: "value3",
},
},
],
},
},
},
});
console.log(response);
----

View File

@ -19,6 +19,12 @@ const response = await client.security.putRole({
clusters: ["my_remote_cluster"],
},
],
remote_cluster: [
{
privileges: ["monitor_enrich"],
clusters: ["my_remote_cluster"],
},
],
});
console.log(response);
----

View File

@ -3,6 +3,28 @@
[source, js]
----
const response = await client.security.bulkUpdateApiKeys({});
const response = await client.security.bulkUpdateApiKeys({
body: {
ids: ["VuaCfGcBCdbkQm-e5aOx", "H3_AhoIBA9hmeQJdg7ij"],
role_descriptors: {
"role-a": {
indices: [
{
names: ["*"],
privileges: ["write"],
},
],
},
},
metadata: {
environment: {
level: 2,
trusted: true,
tags: ["production"],
},
},
expiration: "30d",
},
});
console.log(response);
----

View File

@ -0,0 +1,16 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.cat.shards({
v: "true",
});
console.log(response);
const response1 = await client.cat.recovery({
v: "true",
active_only: "true",
});
console.log(response1);
----

View File

@ -0,0 +1,22 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.transport.request({
method: "PUT",
path: "/_inference/text_embedding/my-e5-model",
body: {
service: "elasticsearch",
service_settings: {
adaptive_allocations: {
enabled: true,
min_number_of_allocations: 3,
max_number_of_allocations: 10,
},
model_id: ".multilingual-e5-small",
},
},
});
console.log(response);
----

View File

@ -3,8 +3,8 @@
[source, js]
----
const response = await client.indices.delete({
index: "my-index",
const response = await client.security.queryRole({
sort: ["name"],
});
console.log(response);
----

View File

@ -0,0 +1,17 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.security.queryRole({
query: {
match: {
description: {
query: "user access",
},
},
},
size: 1,
});
console.log(response);
----

View File

@ -0,0 +1,16 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.ingest.putGeoipDatabase({
id: "my-database-id",
body: {
name: "GeoIP2-Domain",
maxmind: {
account_id: "1025402",
},
},
});
console.log(response);
----

View File

@ -6,6 +6,36 @@
const response = await client.searchApplication.postBehavioralAnalyticsEvent({
collection_name: "my_analytics_collection",
event_type: "search_click",
body: {
session: {
id: "1797ca95-91c9-4e2e-b1bd-9c38e6f386a9",
},
user: {
id: "5f26f01a-bbee-4202-9298-81261067abbd",
},
search: {
query: "search term",
results: {
items: [
{
document: {
id: "123",
index: "products",
},
},
],
total_results: 10,
},
sort: {
name: "relevance",
},
search_application: "website",
},
document: {
id: "123",
index: "products",
},
},
});
console.log(response);
----

View File

@ -3,6 +3,14 @@
[source, js]
----
const response = await client.security.oidcAuthenticate({});
const response = await client.security.oidcAuthenticate({
body: {
redirect_uri:
"https://oidc-kibana.elastic.co:5603/api/security/oidc/callback?code=jtI3Ntt8v3_XvcLzCFGq&state=4dbrihtIAt3wBTwo6DxK-vdk-sSyDBV8Yf0AjdkdT5I",
state: "4dbrihtIAt3wBTwo6DxK-vdk-sSyDBV8Yf0AjdkdT5I",
nonce: "WaBPH0KqPVdG5HHdSxPRjfoZbXMCicm5v1OiAj0DUFM",
realm: "oidc1",
},
});
console.log(response);
----

View File

@ -5,6 +5,11 @@
----
const response = await client.searchApplication.renderQuery({
name: "my_search_application",
body: {
params: {
query_string: "rock climbing",
},
},
});
console.log(response);
----

View File

@ -0,0 +1,18 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.transport.request({
method: "PUT",
path: "/_inference/sparse_embedding/elser_embeddings",
body: {
service: "elser",
service_settings: {
num_allocations: 1,
num_threads: 1,
},
},
});
console.log(response);
----

View File

@ -0,0 +1,18 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.snapshot.createRepository({
name: "my_backup",
repository: {
type: "azure",
settings: {
client: "secondary",
container: "my_container",
base_path: "snapshots_prefix",
},
},
});
console.log(response);
----

View File

@ -5,6 +5,7 @@
----
const response = await client.searchApplication.renderQuery({
name: "my_search_application",
body: null,
});
console.log(response);
----

View File

@ -211,6 +211,7 @@ console.log(response);
const response1 = await client.textStructure.findFieldStructure({
index: "test-logs",
field: "message",
body: null,
});
console.log(response1);
----

View File

@ -3,6 +3,36 @@
[source, js]
----
const response = await client.simulate.ingest({});
const response = await client.simulate.ingest({
body: {
docs: [
{
_index: "my-index",
_id: "123",
_source: {
foo: "bar",
},
},
{
_index: "my-index",
_id: "456",
_source: {
foo: "rab",
},
},
],
pipeline_substitutions: {
"my-pipeline": {
processors: [
{
uppercase: {
field: "foo",
},
},
],
},
},
},
});
console.log(response);
----

View File

@ -0,0 +1,18 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.search({
index: "elser-embeddings",
query: {
sparse_vector: {
field: "content_embedding",
inference_id: "elser_embeddings",
query: "How to avoid muscle soreness after running?",
},
},
_source: ["id", "content"],
});
console.log(response);
----

View File

@ -3,6 +3,11 @@
[source, js]
----
const response = await client.security.bulkUpdateApiKeys({});
const response = await client.security.bulkUpdateApiKeys({
body: {
ids: ["VuaCfGcBCdbkQm-e5aOx", "H3_AhoIBA9hmeQJdg7ij"],
role_descriptors: {},
},
});
console.log(response);
----

View File

@ -1,50 +0,0 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.snapshot.createRepository({
name: "my_backup1",
repository: {
type: "azure",
},
});
console.log(response);
const response1 = await client.snapshot.createRepository({
name: "my_backup2",
repository: {
type: "azure",
settings: {
container: "backup-container",
base_path: "backups",
chunk_size: "32MB",
compress: true,
},
},
});
console.log(response1);
const response2 = await client.snapshot.createRepository({
name: "my_backup3",
repository: {
type: "azure",
settings: {
client: "secondary",
},
},
});
console.log(response2);
const response3 = await client.snapshot.createRepository({
name: "my_backup4",
repository: {
type: "azure",
settings: {
client: "secondary",
location_mode: "primary_only",
},
},
});
console.log(response3);
----

View File

@ -0,0 +1,18 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.reindex({
wait_for_completion: "false",
source: {
index: "test-data",
size: 50,
},
dest: {
index: "elser-embeddings",
pipeline: "elser_embeddings",
},
});
console.log(response);
----

View File

@ -0,0 +1,13 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.snapshot.createRepository({
name: "my_backup",
repository: {
type: "azure",
},
});
console.log(response);
----

View File

@ -3,6 +3,11 @@
[source, js]
----
const response = await client.security.oidcPrepareAuthentication({});
const response = await client.security.oidcPrepareAuthentication({
body: {
iss: "http://127.0.0.1:8080",
login_hint: "this_is_an_opaque_string",
},
});
console.log(response);
----

View File

@ -0,0 +1,15 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.ml.updateTrainedModelDeployment({
model_id: "elastic__distilbert-base-uncased-finetuned-conll03-english",
adaptive_allocations: {
enabled: true,
min_number_of_allocations: 3,
max_number_of_allocations: 10,
},
});
console.log(response);
----

View File

@ -3,6 +3,10 @@
[source, js]
----
const response = await client.security.oidcPrepareAuthentication({});
const response = await client.security.oidcPrepareAuthentication({
body: {
realm: "oidc1",
},
});
console.log(response);
----

View File

@ -3,6 +3,12 @@
[source, js]
----
const response = await client.security.queryUser({});
const response = await client.security.queryUser({
query: {
prefix: {
roles: "other",
},
},
});
console.log(response);
----

View File

@ -1,33 +0,0 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.search({
query: {
intervals: {
my_text: {
any_of: {
intervals: [
{
match: {
query: "the big bad wolf",
ordered: true,
max_gaps: 0,
},
},
{
match: {
query: "the big wolf",
ordered: true,
max_gaps: 0,
},
},
],
},
},
},
},
});
console.log(response);
----

View File

@ -0,0 +1,24 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.indices.create({
index: "good_example_index",
mappings: {
properties: {
field_1: {
type: "text",
copy_to: ["field_2", "field_3"],
},
field_2: {
type: "text",
},
field_3: {
type: "text",
},
},
},
});
console.log(response);
----

View File

@ -0,0 +1,59 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.security.bulkPutRole({
roles: {
my_admin_role: {
cluster: ["bad_cluster_privilege"],
indices: [
{
names: ["index1", "index2"],
privileges: ["all"],
field_security: {
grant: ["title", "body"],
},
query: '{"match": {"title": "foo"}}',
},
],
applications: [
{
application: "myapp",
privileges: ["admin", "read"],
resources: ["*"],
},
],
run_as: ["other_user"],
metadata: {
version: 1,
},
},
my_user_role: {
cluster: ["all"],
indices: [
{
names: ["index1"],
privileges: ["read"],
field_security: {
grant: ["title", "body"],
},
query: '{"match": {"title": "foo"}}',
},
],
applications: [
{
application: "myapp",
privileges: ["admin", "read"],
resources: ["*"],
},
],
run_as: ["other_user"],
metadata: {
version: 1,
},
},
},
});
console.log(response);
----