"Fossies" - the Fresh Open Source Software Archive 
Member "elasticsearch-6.8.23/x-pack/plugin/src/test/resources/rest-api-spec/test/roles/10_basic.yml" (29 Dec 2021, 1831 Bytes) of package /linux/www/elasticsearch-6.8.23-src.tar.gz:
As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Ansible YAML source code syntax highlighting (style:
standard) with prefixed line numbers.
Alternatively you can here
view or
download the uninterpreted source code file.
1 ---
2 setup:
3 - skip:
4 features: headers
5
6 - do:
7 cluster.health:
8 wait_for_status: yellow
9 - do:
10 xpack.security.put_user:
11 username: "joe"
12 body: >
13 {
14 "password": "s3krit",
15 "roles" : [ "admin_role" ]
16 }
17
18 ---
19 teardown:
20 - do:
21 xpack.security.delete_user:
22 username: "joe"
23 ignore: 404
24 - do:
25 xpack.security.delete_role:
26 name: "admin_role"
27 ignore: 404
28 - do:
29 xpack.security.delete_role:
30 name: "backwards_role"
31 ignore: 404
32
33 ---
34 "Test put role api":
35 - do:
36 xpack.security.put_role:
37 name: "admin_role"
38 body: >
39 {
40 "cluster": ["all"],
41 "metadata": {
42 "key1" : "val1",
43 "key2" : "val2"
44 },
45 "indices": [
46 {
47 "names": "*",
48 "privileges": ["all"]
49 }
50 ]
51 }
52 - match: { role: { created: true } }
53
54 - do:
55 xpack.security.put_role:
56 name: "backwards_role"
57 body: >
58 {
59 "cluster": ["all"],
60 "indices": [
61 {
62 "privileges": ["all"],
63 "names": "*"
64 }
65 ]
66 }
67 - match: { role: { created: true } }
68
69 - do:
70 headers:
71 Authorization: "Basic am9lOnMza3JpdA=="
72 cluster.health: {}
73 - match: { timed_out: false }
74
75 - do:
76 xpack.security.get_role:
77 name: "admin_role"
78 - match: { admin_role.cluster.0: "all" }
79 - match: { admin_role.metadata.key1: "val1" }
80 - match: { admin_role.metadata.key2: "val2" }
81 - match: { admin_role.indices.0.names.0: "*" }
82 - match: { admin_role.indices.0.privileges.0: "all" }