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

[EPM] Use NP server route handler #43269

Closed
5 tasks
jfsiii opened this issue Aug 14, 2019 · 7 comments
Closed
5 tasks

[EPM] Use NP server route handler #43269

jfsiii opened this issue Aug 14, 2019 · 7 comments
Labels
blocked Feature:EPM Fleet team's Elastic Package Manager (aka Integrations) project Team:Fleet Team label for Observability Data Collection Fleet team

Comments

@jfsiii
Copy link
Contributor

jfsiii commented Aug 14, 2019

Edit: Don't work on this until #44170 #44174 server.route from #44620, and #44143 is resolved

Swap hapi implementation out for NP. Letters added to make it easy to refer to, not because the order matters.

From #41894

import { schema, TypeOf } from '@kbn/config-schema';
const router = httpSetup.createRouter();

router.get({
  path: 'path/{id}',
  validate: false // or see B
},
async (context, request, response) => {
  const data = await findObject(request.params.id);
  if (!data) return response.notFound();
  return response.ok({
    body: data,
    headers: {
      'content-type': 'application/json'
    }
  });
});

A: Avoid router.get, router.post, etc. in favor of server.route coming as part of #44620

B: We don't do options.query or options.params right now, but will need to update (remove) types in handlers and switch to @kbn/config-schema-based approach.

C: elasticsearch is available now under context.core.elasticsearch. @rudolf is [currently migrating the Saved Objects client](ES is ready. SO PR is #44143) and will also expose them under context.core.

D: related to B Blocked on C (getting ES & SO from context)

@jfsiii jfsiii added the Feature:EPM Fleet team's Elastic Package Manager (aka Integrations) project label Aug 14, 2019
@jfsiii jfsiii self-assigned this Aug 14, 2019
@jfsiii jfsiii added the Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services label Aug 23, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/infra-logs-ui

@jfsiii
Copy link
Contributor Author

jfsiii commented Sep 6, 2019

Did a quick POC in jfsiii@6aab980 (see commit message for more info)

@jfsiii jfsiii added the blocked label Sep 16, 2019
@sgrodzicki
Copy link
Contributor

@jfsiii are you still investigating? What does the blocked label imply?

@jfsiii
Copy link
Contributor Author

jfsiii commented Sep 19, 2019

@sgrodzicki No, I'm not investigating it. blocked is that it's unable to be worked on until some other issues are resolved.

I didn't know how to classify it since it's neither Investigating nor Ready. Back to Backlog, perhaps?

@sgrodzicki
Copy link
Contributor

Back to backlog sounds reasonable. Thanks for the clarification!

@jfsiii jfsiii changed the title Use NP server route handler [IM] Use NP server route handler Oct 9, 2019
@jfsiii jfsiii changed the title [IM] Use NP server route handler [EPM] Use NP server route handler Oct 21, 2019
@ruflin
Copy link
Member

ruflin commented Feb 18, 2020

@jfsiii With the recent changes and merge to master, can this be closed?

@jfsiii jfsiii closed this as completed Feb 18, 2020
@jfsiii
Copy link
Contributor Author

jfsiii commented Feb 18, 2020

@ruflin yes. Just closed it

@jen-huang jen-huang added Team:Fleet Team label for Observability Data Collection Fleet team and removed Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services labels Mar 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Feature:EPM Fleet team's Elastic Package Manager (aka Integrations) project Team:Fleet Team label for Observability Data Collection Fleet team
Projects
None yet
Development

No branches or pull requests

5 participants