Files
elasticsearch-js/docs/doc_examples/dcfa7f479a33f459a2d222a92e651451.asciidoc
2024-07-29 17:10:05 -05:00

35 lines
744 B
Plaintext

// 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.putRole({
name: "my_admin_role",
description:
"Grants full access to all management features within the cluster.",
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,
},
});
console.log(response);
----