-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Get the assetClient ready for building inventory prototype #167692
Get the assetClient ready for building inventory prototype #167692
Conversation
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
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.
ftr_configs.yml
minimum_should_match: 1, | ||
}, | ||
}); | ||
const { kind, id } = parseEan(options.parent); |
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.
should we validate kind
value as part of parseEan
(caller can pass the supported types to the function), or here, maybe with a switch ? thinking the api consumer should know if the parameter was ignored
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.
Good point. I think I'll explore this more as I develop the UI built on top of it, and see what makes the most sense.
x-pack/plugins/asset_manager/server/lib/validators/validate_es_date.ts
Outdated
Show resolved
Hide resolved
'asset.ean': string; | ||
'asset.id': string; | ||
'asset.name'?: string; | ||
export function validateGetHostsOptions(options: GetHostsOptions) { |
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.
function can also verify that from
is before to
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.
Good idea
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.
I simplified things a bit since there is only one version of each function now, which also simplified validation. 34c6d1a
export class AssetsValidationError extends Error { | ||
public statusCode: number; | ||
|
||
constructor(message: string, { statusCode = 500 }: ErrorOptions = {}) { |
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.
(http semantics intensifies) should this default to 400 ?
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.
lol, I was thinking about this like a ResponseError but specifically as a ValidationError, I think you're right.
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.
Looks great!
💚 Build Succeeded
Metrics [docs]Public APIs missing comments
Page load bundle
History
To update your PR or re-run it, just comment with: |
Closes #167342
Summary
This PR adds to the asset manager's asset client so that it's ready to demo a new inventory prototype. Current updates include: