Skip to content

Commit 8003572

Browse files
committed
manual fixes
1 parent 4e35901 commit 8003572

File tree

12 files changed

+65
-70
lines changed

12 files changed

+65
-70
lines changed

specification/_global/reindex/examples/request/ReindexRequestExample9.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ alternative_java:
3434
)
3535
.script(s -> s
3636
.source(so -> so
37-
.scriptString("ctx._source.tag = ctx._source.remove("flag")")
37+
.scriptString("ctx._source.tag = ctx._source.remove(\"flag\")")
3838
)
3939
)
4040
.source(so -> so

specification/eql/search/examples/request/EqlSearchRequestExample1.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,8 @@ alternative_java:
1414
- language: java
1515
code: |
1616
client.eql().search(s -> s
17-
.index("my-data-stream")
18-
.query("
19-
process where (process.name == "cmd.exe" and process.pid != 2013)
20-
")
17+
.index("my-data-stream")
18+
.query(" process where (process.name == \"cmd.exe\" and process.pid != 2013) ")
2119
);
2220
alternatives:
2321
- language: Python

specification/eql/search/examples/request/EqlSearchRequestExample2.yaml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,8 @@ alternative_java:
1818
- language: java
1919
code: |
2020
client.eql().search(s -> s
21-
.index("my-data-stream")
22-
.query("
23-
sequence by process.pid
24-
[ file where file.name == "cmd.exe" and process.pid != 2013 ]
25-
[ process where stringContains(process.executable, "regsvr32") ]
26-
")
21+
.index("my-data-stream")
22+
.query(" sequence by process.pid [ file where file.name == \"cmd.exe\" and process.pid != 2013 ][ process where stringContains(process.executable, \"regsvr32\") ] ")
2723
);
2824
alternatives:
2925
- language: Python

specification/esql/query/examples/request/QueryRequestExample1.yaml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,8 @@ alternative_java:
1717
- language: java
1818
code: |
1919
client.esql().query(q -> q
20-
.includeCcsMetadata(true)
21-
.query("
22-
FROM library,remote-*:library
23-
| EVAL year = DATE_TRUNC(1 YEARS, release_date)
24-
| STATS MAX(page_count) BY year
25-
| SORT year
26-
| LIMIT 5
27-
")
20+
.includeCcsMetadata(true)
21+
.query(" FROM library,remote-*:library | EVAL year = DATE_TRUNC(1 YEARS, release_date) | STATS MAX(page_count) BY year | SORT year | LIMIT 5 ")
2822
);
2923
alternatives:
3024
- language: Python

specification/inference/chat_completion_unified/examples/request/PostChatCompletionRequestExample2.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ alternative_java:
4242
.toolCalls(t -> t
4343
.id("call_KcAjWtAww20AihPHphUh46Gd")
4444
.function(f -> f
45-
.arguments("{"location":"Boston, MA"}")
45+
.arguments("{\"location\":\"Boston, MA\"}")
4646
.name("get_current_weather")
4747
)
4848
.type("function")

specification/inference/chat_completion_unified/examples/request/PostChatCompletionRequestExample3.yaml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,9 @@ alternative_java:
4848
.inferenceId("openai-completion")
4949
.chatCompletionRequest(ch -> ch
5050
.messages(m -> m
51-
.content(co -> co
52-
.object(o -> o
53-
.text("What's the price of a scarf?")
54-
.type("text")
55-
)
56-
)
51+
.content(co -> co
52+
.string("What's the price of a scarf?")
53+
)
5754
.role("user")
5855
)
5956
.toolChoice(t -> t

specification/ml/infer_trained_model/examples/request/MlInferTrainedModelExample1.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ alternative_java:
88
- language: java
99
code: |
1010
client.ml().inferTrainedModel(i -> i
11-
.docs("text", JsonData.fromJson("\"The fool doth think he is wise, but the wise man knows himself to be a fool.\""))
12-
.modelId("lang_ident_model_1")
11+
.docs(Map.of("text", JsonData.fromJson("\"The fool doth think he is wise, but the wise man knows himself to be a fool.\"")))
12+
.modelId("lang_ident_model_1")
1313
);
1414
alternatives:
1515
- language: Python

specification/security/put_role_mapping/examples/request/SecurityPutRoleMappingRequestExample4.yaml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,18 @@ alternative_java:
2929
- language: java
3030
code: |
3131
client.security().putRoleMapping(p -> p
32-
.enabled(true)
33-
.name("mapping4")
34-
.roles("superuser")
35-
.rules(r -> r
36-
.any(List.of(RoleMappingRule.of(ro -> ro
37-
.field(NamedValue.of("username",List.of(FieldValue.of("esadmin"))
38-
)),RoleMappingRule.of(rol -> rol
39-
.field(NamedValue.of("groups",List.of(FieldValue.of("cn=admins,dc=example,dc=com"))
40-
))))
41-
)
32+
.enabled(true)
33+
.name("mapping4")
34+
.roles("superuser")
35+
.rules(r -> r
36+
.any(List.of(RoleMappingRule.of(ro -> ro
37+
.field(NamedValue.of("username",List.of(FieldValue.of("esadmin"))
38+
))), RoleMappingRule.of(rol -> rol
39+
.field(NamedValue.of("groups",List.of(FieldValue.of("cn=admins,dc=example,dc=com"))
40+
)))
41+
)
42+
)
43+
)
4244
);
4345
alternatives:
4446
- language: Python

specification/security/put_role_mapping/examples/request/SecurityPutRoleMappingRequestExample7.yaml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,18 @@ alternative_java:
1818
- language: java
1919
code: |
2020
client.security().putRoleMapping(p -> p
21-
.enabled(true)
22-
.name("mapping7")
23-
.roles("ldap-example-user")
24-
.rules(r -> r
25-
.all(List.of(RoleMappingRule.of(ro -> ro
26-
.field(NamedValue.of("dn",List.of(FieldValue.of("*,ou=subtree,dc=example,dc=com"))
27-
)),RoleMappingRule.of(rol -> rol
28-
.field(NamedValue.of("realm.name",List.of(FieldValue.of("ldap1"))
29-
))))
30-
)
21+
.enabled(true)
22+
.name("mapping7")
23+
.roles("ldap-example-user")
24+
.rules(r -> r
25+
.all(List.of(RoleMappingRule.of(ro -> ro
26+
.field(NamedValue.of("dn",List.of(FieldValue.of("*,ou=subtree,dc=example,dc=com"))
27+
))), RoleMappingRule.of(rol -> rol
28+
.field(NamedValue.of("realm.name",List.of(FieldValue.of("ldap1"))
29+
)))
30+
)
31+
)
32+
)
3133
);
3234
alternatives:
3335
- language: Python

specification/security/put_role_mapping/examples/request/SecurityPutRoleMappingRequestExample8.yaml

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -45,24 +45,32 @@ alternative_java:
4545
- language: java
4646
code: |
4747
client.security().putRoleMapping(p -> p
48-
.enabled(true)
49-
.name("mapping8")
50-
.roles("superuser")
51-
.rules(r -> r
52-
.all(List.of(RoleMappingRule.of(ro -> ro
53-
.any(List.of(RoleMappingRule.of(rol -> rol
54-
.field(NamedValue.of("dn",List.of(FieldValue.of("*,ou=admin,dc=example,dc=com"))
55-
)),RoleMappingRule.of(role -> role
56-
.field(NamedValue.of("username",List.of(FieldValue.of("es-admin"),FieldValue.of("es-system"))
57-
)))
58-
)),RoleMappingRule.of(roleM -> roleM
59-
.field(NamedValue.of("groups",List.of(FieldValue.of("cn=people,dc=example,dc=com"))
60-
)),RoleMappingRule.of(roleMa -> roleMa
61-
.except(e -> e
62-
.field(NamedValue.of("metadata.terminated_date",List.of(FieldValue.of(null))
63-
)
64-
))))
65-
)
48+
.enabled(true)
49+
.name("mapping8")
50+
.roles("superuser")
51+
.rules(r -> r
52+
.all(List.of(RoleMappingRule.of(ro -> ro
53+
.any(List.of(RoleMappingRule.of(rol -> rol
54+
.field(NamedValue.of("dn", List.of(FieldValue.of("*,ou=admin," +
55+
"dc=example,dc=com"))
56+
))
57+
), RoleMappingRule.of(role -> role
58+
.field(NamedValue.of("username", List.of(FieldValue.of("es-admin"),
59+
FieldValue.of("es-system"))
60+
)))), RoleMappingRule.of(roleM -> roleM
61+
.field(NamedValue.of("groups", List.of(FieldValue.of("cn=people," +
62+
"dc=example,dc=com"))
63+
)), RoleMappingRule.of(roleMa -> roleMa
64+
.except(e -> e
65+
.field(NamedValue.of("metadata.terminated_date",
66+
List.of(FieldValue.of(null))
67+
)
68+
))))
69+
)
70+
)
71+
)
72+
)
73+
)
6674
);
6775
alternatives:
6876
- language: Python

0 commit comments

Comments
 (0)