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

Create a restful API to retrieve resource bundle #96

Closed
machi1990 opened this issue May 22, 2024 · 10 comments
Closed

Create a restful API to retrieve resource bundle #96

machi1990 opened this issue May 22, 2024 · 10 comments

Comments

@machi1990
Copy link
Contributor

Currently, it is not possible to retrieve resources whose type is Bundle via the rest API.
It's a perfect use case for someone to create a resource with type Bundle via the grpc client on one component and on the other component using the rest API wanting to list all resources (Single and Bundle resources) or even filtering by bundle resource
e.g

ocm get /api/maestro/v1/resources -p search="type='Bundle'"

At the moment, the above query returns an empty list all the time even if there are resources with type Bundle in the database.

The reason is that the query performed by the backend is

SELECT * FROM "resources" WHERE ((resources.type = 'Bundle' AND resources.type = 'Single')) AND "resources"."deleted_at" IS NULL LIMIT 100  

notice the (resources.type = 'Bundle' AND resources.type = 'Single')

@qiujian16 @clyang82

@clyang82
Copy link
Contributor

Thanks @machi1990 for reporting this. The current design is

  1. restful api supports CRUD for Single resource only
  2. gRPC supports CRUD for Bundle resource.

In order to support your case, it may introduce the trouble that one resource can have multiple operators (restful and gRPC).

@clyang82
Copy link
Contributor

It is also related with setting manifestbundle and manifest as supported codecs in maestro agent by default.

@machi1990
Copy link
Contributor Author

In order to support your case, it may introduce the trouble that one resource can have multiple operators (restful and gRPC).

I fail to see an issue with this; can you elaborate what's the issue with a resource being operated by multiple operators?

@machi1990
Copy link
Contributor Author

It is also related with setting manifestbundle and manifest as supported codecs in maestro agent by default.

I think exposing the codecs config as done in #94 is fine

@clyang82
Copy link
Contributor

image
  1. the green boxes what we have today.
  2. the gray boxes we do not have today.

Thoughts?

@machi1990
Copy link
Contributor Author

@clyang82 apologies, I missed the ping in this card.

the green boxes what we have today.

I've tested all the green boxes succesful; except for the WATCH (subscribe API) which I've opened a discussion thread on.

the gray boxes we do not have today.

Correct, the /api/maestro/v1/manifests is what is missing today. How do you envision its design - the API schema, and its list capabilities?

@machi1990
Copy link
Contributor Author

Correct, the /api/maestro/v1/manifests is what is missing today. How do you envision its design - the API schema, and its list capabilities?

To expand on this, will there also be a /api/maestro/v1/manifests/<id> ?

@qiujian16
Copy link
Contributor

I think so, we should have both list and get.

@clyang82
Copy link
Contributor

link this issue together #103

@machi1990
Copy link
Contributor Author

I am happy for this issue to be closed in favor of #103

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants