-
Notifications
You must be signed in to change notification settings - Fork 114
Add specification for query rule test API #3029
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"query_rules.test": { | ||
"documentation": { | ||
"url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/test-query-ruleset.html", | ||
"description": "Tests a query ruleset to identify the rules that would match input criteria" | ||
}, | ||
"stability": "experimental", | ||
"visibility": "public", | ||
"headers": { | ||
"accept": ["application/json"], | ||
"content_type": ["application/json"] | ||
}, | ||
"url": { | ||
"paths": [ | ||
{ | ||
"path": "/_query_rules/{ruleset_id}/_test", | ||
"methods": ["POST"], | ||
"parts": { | ||
"ruleset_id": { | ||
"type": "string", | ||
"description": "The unique identifier of the ruleset to test." | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
"body": { | ||
"description": "The match criteria to test against the ruleset", | ||
"required": true | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* Licensed to Elasticsearch B.V. under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch B.V. licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
import { RequestBase } from '@_types/Base' | ||
import { Id } from '@_types/common' | ||
import { Dictionary } from '@spec_utils/Dictionary' | ||
import { UserDefinedValue } from '@spec_utils/UserDefinedValue' | ||
|
||
/** | ||
* Creates or updates a query ruleset. | ||
* @rest_spec_name query_rules.put_ruleset | ||
* @availability stack since=8.10.0 stability=stable | ||
* @availability serverless stability=stable visibility=public | ||
*/ | ||
export interface Request extends RequestBase { | ||
path_parts: { | ||
/** | ||
* The unique identifier of the query ruleset to be created or updated | ||
*/ | ||
ruleset_id: Id | ||
} | ||
/** | ||
* The criteria we're testing for | ||
*/ | ||
/** @codegen_name match_criteria */ | ||
body: { | ||
match_criteria: Dictionary<string, UserDefinedValue> | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* Licensed to Elasticsearch B.V. under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch B.V. licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
import { integer } from '@_types/Numeric' | ||
import { QueryRulesetMatchedRule } from './types' | ||
|
||
|
||
export class Response { | ||
body: { | ||
total_matched_rules: integer, | ||
matched_rules: QueryRulesetMatchedRule[] | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* Licensed to Elasticsearch B.V. under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch B.V. licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
import { Dictionary } from '@spec_utils/Dictionary' | ||
import { Id } from '@_types/common' | ||
import { integer } from '@_types/Numeric' | ||
|
||
export class QueryRulesetMatchedRule { | ||
/** | ||
* Ruleset unique identifier | ||
*/ | ||
ruleset_id: Id | ||
/** | ||
* Rule unique identifier within that ruleset | ||
*/ | ||
rule_id: Id | ||
} |
Uh oh!
There was an error while loading. Please reload this page.