获取丰富策略 API
编辑获取丰富策略 API
编辑返回有关丰富策略的信息。
resp = client.enrich.get_policy( name="my-policy", ) print(resp)
response = client.enrich.get_policy( name: 'my-policy' ) puts response
const response = await client.enrich.getPolicy({ name: "my-policy", }); console.log(response);
GET /_enrich/policy/my-policy
路径参数
编辑-
<name>
-
(可选,字符串)用于限制请求的以逗号分隔的丰富策略名称列表。
要返回所有丰富策略的信息,请省略此参数。
示例
编辑获取单个策略
编辑resp = client.enrich.get_policy( name="my-policy", ) print(resp)
response = client.enrich.get_policy( name: 'my-policy' ) puts response
const response = await client.enrich.getPolicy({ name: "my-policy", }); console.log(response);
GET /_enrich/policy/my-policy
该 API 返回以下响应
{ "policies": [ { "config": { "match": { "name": "my-policy", "indices": [ "users" ], "match_field": "email", "enrich_fields": [ "first_name", "last_name", "city", "zip", "state" ] } } } ] }
获取多个策略
编辑resp = client.enrich.get_policy( name="my-policy,other-policy", ) print(resp)
response = client.enrich.get_policy( name: 'my-policy,other-policy' ) puts response
const response = await client.enrich.getPolicy({ name: "my-policy,other-policy", }); console.log(response);
GET /_enrich/policy/my-policy,other-policy
该 API 返回以下响应
{ "policies": [ { "config": { "match": { "name": "my-policy", "indices": [ "users" ], "match_field": "email", "enrich_fields": [ "first_name", "last_name", "city", "zip", "state" ] } } }, { "config": { "match": { "name": "other-policy", "indices": [ "users" ], "match_field": "email", "enrich_fields": [ "first_name", "last_name", "city", "zip", "state" ] } } } ] }
获取所有策略
编辑resp = client.enrich.get_policy() print(resp)
response = client.enrich.get_policy puts response
const response = await client.enrich.getPolicy(); console.log(response);
GET /_enrich/policy
该 API 返回以下响应
{ "policies": [ { "config": { "match": { "name": "my-policy", "indices": [ "users" ], "match_field": "email", "enrich_fields": [ "first_name", "last_name", "city", "zip", "state" ] } } }, { "config": { "match": { "name": "other-policy", "indices": [ "users" ], "match_field": "email", "enrich_fields": [ "first_name", "last_name", "city", "zip", "state" ] } } } ] }