-
Notifications
You must be signed in to change notification settings - Fork 21
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
add resource bundle api. #106
add resource bundle api. #106
Conversation
2e8474d
to
991a08a
Compare
cmd/maestro/server/routes.go
Outdated
apiV1ResourceRouter.Use(authzMiddleware.AuthorizeApi) | ||
|
||
apiV1ResourceBundleRouter := apiV1Router.PathPrefix("/resourcebundles").Subrouter() |
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 recommend to separate words with hyphens. It is more user-friendly when it comes to long-path segmented URIs.
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.
updated to /resource-bundles
.
pkg/dao/mocks/resource.go
Outdated
@@ -70,3 +74,7 @@ func (d *resourceDaoMock) FindBySource(ctx context.Context, source string) (api. | |||
func (d *resourceDaoMock) All(ctx context.Context) (api.ResourceList, error) { | |||
return d.resources, nil | |||
} | |||
|
|||
func (d *resourceDaoMock) AllBundle(ctx context.Context) (api.ResourceList, error) { | |||
return api.ResourceList{}, nil |
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.
ResourceList or ResourceBundleList?
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.
Do we really need a new type? Currently, all resources (single and bundle) are stored in the resources table in the database. To simplify, I only converted the resource bundle before writing the HTTP response.
bad3965
to
2c6acf3
Compare
2c6acf3
to
c21f1d2
Compare
Signed-off-by: morvencao <[email protected]>
c21f1d2
to
90674e6
Compare
/assign @qiujian16 @clyang82 @skeeey |
Could you update the README to include the resource_bundles api? maybe in grpc.md file? |
Signed-off-by: morvencao <[email protected]>
013e605
to
4a1f619
Compare
Added document for how to create resource bundle with gRPC API, and how to get/list resource bundle with the new restful API. |
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
This PR add GET and List Resource Bundle API.
Get by Resource Bundle ID:
List All Resource Bundles:
List Search by Consumer Name:
List Search By Consumer Name and Resource Bundle Name:
ref: #103