35 lines
744 B
Plaintext
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);
|
|
----
|