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

Updates catalog refresh API to refresh by its name #204

Merged
merged 1 commit into from
Mar 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Updates catalog refresh API to refresh catalog by its name
This updates the API to refresh a catalog by its name, previously
it use to fetch first catalog from db and refresh it. user will pass
name of catalog and that catalog will be refreshed if exists.

Signed-off-by: Shivam Mukhade <smukhade@redhat.com>
  • Loading branch information
SM43 committed Mar 23, 2021
commit 0b1bd021624b11fe54f4923a5f03f1c9c88b87ec
9 changes: 6 additions & 3 deletions api/design/catalog.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,21 @@ var _ = Service("catalog", func() {
Error("not-found", ErrorResult, "Resource Not Found Error")

Method("Refresh", func() {
Description("Refreshes Tekton Catalog")
Description("Refresh a Catalog by it's name")
Security(types.JWTAuth, func() {
Scope("catalog:refresh")
})
Payload(func() {
Attribute("catalogName", String, "Name of catalog", func() {
Example("catalogName", "tekton")
})
Token("token", String, "JWT")
Required("token")
Required("token", "catalogName")
})
Result(types.Job)

HTTP(func() {
POST("/catalog/refresh")
sm43 marked this conversation as resolved.
Show resolved Hide resolved
POST("/catalog/{catalogName}/refresh")
Header("token:Authorization")

Response(StatusOK)
Expand Down
3 changes: 2 additions & 1 deletion api/design/types/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,9 @@ var HubService = Type("HubService", func() {
var Job = ResultType("application/vnd.hub.job", "Job", func() {
Description("The Job type describes a catalog refresh job that is run asynchronously")
Attribute("id", UInt, "id of the job")
Attribute("catalogName", String, "Name of the catalog")
Attribute("status", String, "status of the job")
Required("id", "status")
Required("id", "catalogName", "status")
})

var Resources = ResultType("application/vnd.hub.resources", "Resources", func() {
Expand Down
14 changes: 11 additions & 3 deletions api/gen/catalog/service.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions api/gen/catalog/views/view.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/gen/http/admin/client/cli.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion api/gen/http/catalog/client/cli.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 11 additions & 1 deletion api/gen/http/catalog/client/encode_decode.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions api/gen/http/catalog/client/paths.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions api/gen/http/catalog/client/types.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions api/gen/http/catalog/server/encode_decode.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions api/gen/http/catalog/server/paths.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions api/gen/http/catalog/server/server.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions api/gen/http/catalog/server/types.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading