Added/updated snippets for docs (#2318)
This commit is contained in:
44
docs/doc_examples/249bf48252c8cea47ef872541c8a884c.asciidoc
Normal file
44
docs/doc_examples/249bf48252c8cea47ef872541c8a884c.asciidoc
Normal file
@ -0,0 +1,44 @@
|
||||
// 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.grantApiKey({
|
||||
grant_type: "password",
|
||||
username: "test_admin",
|
||||
password: "x-pack-test-password",
|
||||
api_key: {
|
||||
name: "my-api-key",
|
||||
expiration: "1d",
|
||||
role_descriptors: {
|
||||
"role-a": {
|
||||
cluster: ["all"],
|
||||
indices: [
|
||||
{
|
||||
names: ["index-a*"],
|
||||
privileges: ["read"],
|
||||
},
|
||||
],
|
||||
},
|
||||
"role-b": {
|
||||
cluster: ["all"],
|
||||
indices: [
|
||||
{
|
||||
names: ["index-b*"],
|
||||
privileges: ["all"],
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
metadata: {
|
||||
application: "my-application",
|
||||
environment: {
|
||||
level: 1,
|
||||
trusted: true,
|
||||
tags: ["dev", "staging"],
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
Reference in New Issue
Block a user