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

[Ingest Manager][EPM] Expose way(s) to get latest package #66777

Open
jfsiii opened this issue May 15, 2020 · 11 comments
Open

[Ingest Manager][EPM] Expose way(s) to get latest package #66777

jfsiii opened this issue May 15, 2020 · 11 comments
Labels
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 May 15, 2020

Endpoint needed this info but couldn't get it from EPM. EPM has a service method

export async function fetchFindLatestPackage(
which does this, but doesn't export it and doesn't have an HTTP route.

Should EPM add the route and/or function to the public contract?

@jfsiii jfsiii added Feature:EPM Fleet team's Elastic Package Manager (aka Integrations) project Team:Fleet Team label for Observability Data Collection Fleet team labels May 15, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/ingest-management (Team:Ingest Management)

@paul-tavares
Copy link
Contributor

Hi All,
I wanted to document here the use case we have in Endpoint for this change. We're looking to include a link to Ingest's Integration view - specifically to the "Create Data Source" view of the Endpoint package. The Route for that view is something like #/integrations/endpoint-0.1.0/add-datasource. In order to efficiently create this route, we would like to have an API that would allows us to provide it the package name, and have it return package information for the latest version.

@jfsiii
Copy link
Contributor Author

jfsiii commented May 18, 2020

@paul-tavares thanks for the context. For that case, I'd love Ingest Manager to expose a way to get/create those links. It already has those functions so I think it's just about exporting them. Or maybe adding a variant for latest version.

I still think EPR should answer this question of latest available, though.

@paul-tavares
Copy link
Contributor

Agreed @jfsiii that having a common lib/service to build the route/URLs would be an even better way to ensure we don't break should Ingest change the UI routes. 👍 And being that it seems the Kibana arch. allows for common libs/services to be imported by other plugins (as long as they are exported at the root of /public or a /common dir), this would work nicely for consumers of ingest functionality.

When we (endpoint) get around to implementing the pivot to Ingest for creating a datasource, I can pickup this item and implement the EPM API route to get a package latest info. - if not yet implemented by then.

@neptunian
Copy link
Contributor

@paul-tavares what is the reason for not wanting to call the registry api to get the latest package?

@paul-tavares
Copy link
Contributor

@neptunian Not sure that it would be a good idea to call the registry directly being that we're really only dependent on Ingest (EPM in this case). Also, we would need to get plugged into whatever mechanism is in place (Kibana configuration?) that provides the URL to the registry. All of this is already handled via EPM, thus If at all possible, I feel it would be best for us to not call an external service directly but rather interact with Kibana's EPM instead.

@jfsiii
Copy link
Contributor Author

jfsiii commented May 19, 2020

@paul-tavares @neptunian Yes, EPM is considered the interface for the registry. The registry is publicly accessible but its contract (for now) is with EPM. Perhaps this will change as we expand what it means to host your own registry & packages but for now only EPM should interact with the registry.

@neptunian
Copy link
Contributor

neptunian commented May 19, 2020

Makes sense.
I'm thinking to change
http://localhost:5603/ssg/api/ingest_manager/epm/packages/nginx-0.0.1 to
http://localhost:5603/ssg/api/ingest_manager/epm/packages/nginx/0.0.1 and was going to use
http://localhost:5603/ssg/api/ingest_manager/epm/packages/nginx to get the package that the user currently has installed as that is how the UI works though we are still calling explicit versions right now. Perhaps we can create something similar to EPR's /search?package=nginx, if we don't want to mess with the package routes atm.

@paul-tavares
Copy link
Contributor

@neptunian I like the change split out the package name from the version in the API route 👍 😃 . api/ingest_manager/epm/package/endpoint would then meet our needs in Endpoint,

@jfsiii
Copy link
Contributor Author

jfsiii commented May 19, 2020

@paul-tavares if you want a client-side link, EPM can give you a function which takes one or two params and returns the correct value. Let's try for this over calling sharing any knowledge of EPMs route format

@paul-tavares
Copy link
Contributor

Sounds good @jfsiii . Perhaps we should also use the Ingest constants for these API routes here as well 🤔 :

const INGEST_API_ROOT = `/api/ingest_manager`;
export const INGEST_API_DATASOURCES = `${INGEST_API_ROOT}/datasources`;
const INGEST_API_FLEET = `${INGEST_API_ROOT}/fleet`;
const INGEST_API_FLEET_AGENT_STATUS = `${INGEST_API_FLEET}/agent-status`;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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