Skip to content

Add shards_capacity to health_report #2146

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

Merged
merged 1 commit into from
Jun 23, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
147 changes: 125 additions & 22 deletions output/schema/schema.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions output/typescript/types.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions specification/_global/health_report/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export class Indicators {
repository_integrity?: RepositoryIntegrityIndicator
ilm?: IlmIndicator
slm?: SlmIndicator
shards_capacity?: ShardsCapacityIndicator
}

export class BaseIndicator {
Expand Down Expand Up @@ -166,3 +167,19 @@ export class SlmIndicatorUnhealthyPolicies {
count: long
invocations_since_last_success?: Dictionary<string, long>
}

/** SHARDS_CAPACITY */

export class ShardsCapacityIndicator extends BaseIndicator {
details?: ShardsCapacityIndicatorDetails
}

export class ShardsCapacityIndicatorDetails {
data: ShardsCapacityIndicatorTierDetail
frozen: ShardsCapacityIndicatorTierDetail
}
Comment on lines +177 to +180
Copy link
Member

Choose a reason for hiding this comment

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

This pattern where all fields are of the same type could also be a Dictionary<string, SomeType> to allow for future expansion, or also to account for values we haven't seen in the docs or tests.

In this particular case, looking at the ES code shows that these are hardcoded constants that are unlikely to have new members. So this approach works.


export class ShardsCapacityIndicatorTierDetail {
max_shards_in_cluster: integer
current_used_shards?: integer
}