29 lines
538 B
Plaintext
29 lines
538 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_analyst_role",
|
|
refresh: "true",
|
|
cluster: ["monitor"],
|
|
indices: [
|
|
{
|
|
names: ["index1", "index2"],
|
|
privileges: ["manage"],
|
|
},
|
|
],
|
|
applications: [
|
|
{
|
|
application: "myapp",
|
|
privileges: ["read"],
|
|
resources: ["*"],
|
|
},
|
|
],
|
|
metadata: {
|
|
version: 1,
|
|
},
|
|
});
|
|
console.log(response);
|
|
----
|