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
[APM] Extracting serviceGroupApiMethods to avoid duplication of code #149026
Conversation
💚 Build Succeeded
Metrics [docs]
To update your PR or re-run it, just comment with: |
apmApiClient: ApmApiClient; | ||
serviceGroupId?: string; | ||
groupName: string; | ||
kuery: string; | ||
description?: string; | ||
color?: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about using the ServiceGroup
type that already exist, and use a similar interface to this:
kibana/x-pack/plugins/apm/server/routes/service_groups/save_service_group.ts
Lines 15 to 19 in 8e12174
interface Options { | |
savedObjectsClient: SavedObjectsClientContract; | |
serviceGroupId?: string; | |
serviceGroup: ServiceGroup; | |
} |
apmApiClient: ApmApiClient; | |
serviceGroupId?: string; | |
groupName: string; | |
kuery: string; | |
description?: string; | |
color?: string; | |
apmApiClient: ApmApiClient; | |
serviceGroupId?: string; | |
serviceGroup: ServiceGroup |
body: { | ||
groupName, | ||
kuery, | ||
description, | ||
color, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would then be:
body: { | |
groupName, | |
kuery, | |
description, | |
color, | |
}, | |
body: serviceGroup, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm. Just a nit
…lastic#149026) Closes elastic#148280. ### Changes - Created `ApmApiClient` type. - Extracted service groups api methods to reuse in `save_service_groups` and `service_group_count` tests.
Closes #148280.
Changes
ApmApiClient
type.save_service_groups
andservice_group_count
tests.