Skip to content
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

[DOCS] Adds descriptions for Enrich APIs #2215

Merged
merged 5 commits into from
Aug 2, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 21 additions & 15 deletions output/schema/schema.json

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
Expand Up @@ -21,12 +21,16 @@ import { RequestBase } from '@_types/Base'
import { Name } from '@_types/common'

/**
* Deletes an existing enrich policy and its enrich index.
* @rest_spec_name enrich.delete_policy
* @availability stack since=7.5.0 stability=stable
* @availability serverless stability=stable visibility=public
*/
export interface Request extends RequestBase {
path_parts: {
/**
* Enrich policy to delete.
*/
name: Name
}
}
19 changes: 19 additions & 0 deletions specification/enrich/execute_policy/ExecuteEnrichPolicyRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,34 @@ import { RequestBase } from '@_types/Base'
import { Name } from '@_types/common'

/**
* Creates the enrich index for an existing enrich policy.
* The enrich index contains documents from the policy’s source indices. Enrich
* indices always begin with `.enrich-*`, are read-only, and are force merged.
* Enrich indices should be used by the enrich processor only. Avoid using
* enrich indices for other purposes.
* Once created, you cannot update or index documents to an enrich index.
* Instead, update your source indices and execute the enrich policy again. This
* creates a new enrich index from your updated source indices. The previous
* enrich index will deleted with a delayed maintenance job. By default this is
* done every 15 minutes.
* Because this API request performs several operations, it may take a while to
* return a response.
szabosteve marked this conversation as resolved.
Show resolved Hide resolved
* @rest_spec_name enrich.execute_policy
* @availability stack since=7.5.0 stability=stable
* @availability serverless stability=stable visibility=public
*/
export interface Request extends RequestBase {
path_parts: {
/**
* Enrich policy to execute.
*/
name: Name
}
query_parameters: {
/**
* If `true`, the request blocks other enrich policy execution requests
* until complete. Defaults to `true`.
*/
wait_for_completion?: boolean
}
}
5 changes: 5 additions & 0 deletions specification/enrich/get_policy/GetEnrichPolicyRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,17 @@ import { RequestBase } from '@_types/Base'
import { Names } from '@_types/common'

/**
* Returns information about an enrich policy.
* @rest_spec_name enrich.get_policy
* @availability stack since=7.5.0 stability=stable
* @availability serverless stability=stable visibility=public
*/
export interface Request extends RequestBase {
path_parts: {
/**
* Comma-separated list of enrich policy names used to limit the request. To
* return information for all enrich policies, omit this parameter.
*/
name?: Names
}
}
21 changes: 21 additions & 0 deletions specification/enrich/put_policy/PutEnrichPolicyRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,38 @@ import { RequestBase } from '@_types/Base'
import { Name } from '@_types/common'

/**
* Creates an enrich policy.
* Once created, you can’t update or change an enrich policy.
* Instead, you can:
*
* 1. Create and execute a new enrich policy.
* 2. Replace the previous enrich policy with the new enrich policy in any
* in-use enrich processors.
* 3. Use the delete enrich policy API to delete the previous enrich policy.
szabosteve marked this conversation as resolved.
Show resolved Hide resolved
* @rest_spec_name enrich.put_policy
* @availability stack since=7.5.0 stability=stable
* @availability serverless stability=stable visibility=public
*/
export interface Request extends RequestBase {
path_parts: {
/**
* Name of the enrich policy to create or update.
*/
name: Name
}
body: {
/**
* Matches enrich data to incoming documents based on a `geo_shape` query.
*/
geo_match?: Policy
/**
* Matches enrich data to incoming documents based on a `term` query.
*/
match?: Policy
/**
* Matches a number, date, or IP address in incoming documents to a range in
* the enrich index based on a `term` query.
*/
range?: Policy
}
}
2 changes: 2 additions & 0 deletions specification/enrich/stats/EnrichStatsRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
import { RequestBase } from '@_types/Base'

/**
* Returns enrich coordinator statistics and information about enrich policies
* that are currently executing.
* @rest_spec_name enrich.stats
* @availability stack since=7.5.0 stability=stable
* @availability serverless stability=stable visibility=public
Expand Down
10 changes: 10 additions & 0 deletions specification/enrich/stats/EnrichStatsResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,19 @@ import { ExecutingPolicy, CoordinatorStats, CacheStats } from './types'

export class Response {
body: {
/**
* Objects containing information about each coordinating ingest node for
* configured enrich processors.
*/
coordinator_stats: CoordinatorStats[]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe that's on your radar already, but we shouldn't forget to add descriptions for ExecutingPolicy and CoordinatorStats too (here).

/**
* Objects containing information about each enrich policy that is currently
* executing.
*/
executing_policies: ExecutingPolicy[]
/**
* Objects containing information about the enrich cache stats on each
* ingest node.
* @availability stack since=7.16.0
* @availability serverless
*/
Expand Down
Loading