diff --git a/api/Dockerfile b/api/Dockerfile index 12e94c4ad8..abce4bdccc 100644 --- a/api/Dockerfile +++ b/api/Dockerfile @@ -11,8 +11,13 @@ RUN apk --no-cache add git ca-certificates && addgroup -S hub && adduser -S hub USER hub WORKDIR /app + COPY --from=builder /go/src/github.com/tektoncd/hub/api/api-server /app/api-server -COPY --from=builder /go/src/github.com/tektoncd/hub/api/gen/http/openapi3.yaml /app/gen/http/openapi3.yaml + +# For each new version, doc has to be copied +COPY gen/http/openapi3.yaml /app/gen/http/openapi3.yaml +COPY v1/gen/http/openapi3.yaml /app/v1/gen/http/openapi3.yaml + EXPOSE 8000 CMD [ "/app/api-server" ] \ No newline at end of file diff --git a/api/cmd/api/http.go b/api/cmd/api/http.go index 3ccc28e6b4..89b9657068 100644 --- a/api/cmd/api/http.go +++ b/api/cmd/api/http.go @@ -42,6 +42,9 @@ import ( rating "github.com/tektoncd/hub/api/gen/rating" resource "github.com/tektoncd/hub/api/gen/resource" status "github.com/tektoncd/hub/api/gen/status" + v1resourcesvr "github.com/tektoncd/hub/api/v1/gen/http/resource/server" + v1swaggersvr "github.com/tektoncd/hub/api/v1/gen/http/swagger/server" + v1resource "github.com/tektoncd/hub/api/v1/gen/resource" ) // handleHTTPServer starts configures and starts a HTTP server on the given @@ -54,6 +57,7 @@ func handleHTTPServer( categoryEndpoints *category.Endpoints, ratingEndpoints *rating.Endpoints, resourceEndpoints *resource.Endpoints, + v1resourceEndpoints *v1resource.Endpoints, statusEndpoints *status.Endpoints, wg *sync.WaitGroup, errc chan error, logger *log.Logger, debug bool) { @@ -86,14 +90,16 @@ func handleHTTPServer( // the service input and output data structures to HTTP requests and // responses. var ( - adminServer *adminsvr.Server - authServer *authsvr.Server - catalogServer *catalogsvr.Server - categoryServer *categorysvr.Server - ratingServer *ratingsvr.Server - resourceServer *resourcesvr.Server - statusServer *statussvr.Server - swaggerServer *swaggersvr.Server + adminServer *adminsvr.Server + authServer *authsvr.Server + catalogServer *catalogsvr.Server + categoryServer *categorysvr.Server + ratingServer *ratingsvr.Server + resourceServer *resourcesvr.Server + v1resourceServer *v1resourcesvr.Server + statusServer *statussvr.Server + swaggerServer *swaggersvr.Server + v1swaggerServer *v1swaggersvr.Server ) { eh := errorHandler(logger) @@ -103,8 +109,10 @@ func handleHTTPServer( categoryServer = categorysvr.New(categoryEndpoints, mux, dec, enc, eh, nil) ratingServer = ratingsvr.New(ratingEndpoints, mux, dec, enc, eh, nil) resourceServer = resourcesvr.New(resourceEndpoints, mux, dec, enc, eh, nil) + v1resourceServer = v1resourcesvr.New(v1resourceEndpoints, mux, dec, enc, eh, nil) statusServer = statussvr.New(statusEndpoints, mux, dec, enc, eh, nil) swaggerServer = swaggersvr.New(nil, mux, dec, enc, eh, nil) + v1swaggerServer = v1swaggersvr.New(nil, mux, dec, enc, eh, nil) if debug { servers := goahttp.Servers{ @@ -114,8 +122,10 @@ func handleHTTPServer( categoryServer, ratingServer, resourceServer, + v1resourceServer, statusServer, swaggerServer, + v1swaggerServer, } servers.Use(httpmdlwr.Debug(mux, os.Stdout)) } @@ -127,8 +137,10 @@ func handleHTTPServer( categorysvr.Mount(mux, categoryServer) ratingsvr.Mount(mux, ratingServer) resourcesvr.Mount(mux, resourceServer) + v1resourcesvr.Mount(mux, v1resourceServer) statussvr.Mount(mux, statusServer) swaggersvr.Mount(mux, swaggerServer) + v1swaggersvr.Mount(mux, v1swaggerServer) // Wrap the multiplexer with additional middlewares. Middlewares mounted // here apply to all the service endpoints. @@ -159,12 +171,18 @@ func handleHTTPServer( for _, m := range resourceServer.Mounts { logger.Infof("HTTP %q mounted on %s %s", m.Method, m.Verb, m.Pattern) } + for _, m := range v1resourceServer.Mounts { + logger.Infof("HTTP %q mounted on %s %s", m.Method, m.Verb, m.Pattern) + } for _, m := range statusServer.Mounts { logger.Infof("HTTP %q mounted on %s %s", m.Method, m.Verb, m.Pattern) } for _, m := range swaggerServer.Mounts { logger.Infof("HTTP %q mounted on %s %s", m.Method, m.Verb, m.Pattern) } + for _, m := range v1swaggerServer.Mounts { + logger.Infof("HTTP %q mounted on %s %s", m.Method, m.Verb, m.Pattern) + } (*wg).Add(1) go func() { diff --git a/api/cmd/api/main.go b/api/cmd/api/main.go index 5713b24132..06268a0d2a 100644 --- a/api/cmd/api/main.go +++ b/api/cmd/api/main.go @@ -41,6 +41,8 @@ import ( ratingsvc "github.com/tektoncd/hub/api/pkg/service/rating" resourcesvc "github.com/tektoncd/hub/api/pkg/service/resource" statussvc "github.com/tektoncd/hub/api/pkg/service/status" + v1resource "github.com/tektoncd/hub/api/v1/gen/resource" + v1resourcesvc "github.com/tektoncd/hub/api/v1/service/resource" ) func main() { @@ -79,13 +81,14 @@ func main() { // Initialize the services. var ( - adminSvc admin.Service - authSvc auth.Service - catalogSvc catalog.Service - categorySvc category.Service - ratingSvc rating.Service - resourceSvc resource.Service - statusSvc status.Service + adminSvc admin.Service + authSvc auth.Service + catalogSvc catalog.Service + categorySvc category.Service + ratingSvc rating.Service + resourceSvc resource.Service + v1resourceSvc v1resource.Service + statusSvc status.Service ) { adminSvc = adminsvc.New(api) @@ -94,19 +97,21 @@ func main() { categorySvc = categorysvc.New(api) ratingSvc = ratingsvc.New(api) resourceSvc = resourcesvc.New(api) + v1resourceSvc = v1resourcesvc.New(api) statusSvc = statussvc.New(api) } // Wrap the services in endpoints that can be invoked from other services // potentially running in different processes. var ( - adminEndpoints *admin.Endpoints - authEndpoints *auth.Endpoints - catalogEndpoints *catalog.Endpoints - categoryEndpoints *category.Endpoints - ratingEndpoints *rating.Endpoints - resourceEndpoints *resource.Endpoints - statusEndpoints *status.Endpoints + adminEndpoints *admin.Endpoints + authEndpoints *auth.Endpoints + catalogEndpoints *catalog.Endpoints + categoryEndpoints *category.Endpoints + ratingEndpoints *rating.Endpoints + resourceEndpoints *resource.Endpoints + v1resourceEndpoints *v1resource.Endpoints + statusEndpoints *status.Endpoints ) { adminEndpoints = admin.NewEndpoints(adminSvc) @@ -115,6 +120,7 @@ func main() { categoryEndpoints = category.NewEndpoints(categorySvc) ratingEndpoints = rating.NewEndpoints(ratingSvc) resourceEndpoints = resource.NewEndpoints(resourceSvc) + v1resourceEndpoints = v1resource.NewEndpoints(v1resourceSvc) statusEndpoints = status.NewEndpoints(statusSvc) } @@ -163,6 +169,7 @@ func main() { categoryEndpoints, ratingEndpoints, resourceEndpoints, + v1resourceEndpoints, statusEndpoints, &wg, errc, api.Logger("http"), *dbgF, ) diff --git a/api/design/admin.go b/api/design/admin.go index a18ff262b6..7eb5b757b0 100644 --- a/api/design/admin.go +++ b/api/design/admin.go @@ -15,6 +15,7 @@ package design import ( + "github.com/tektoncd/hub/api/design/types" . "goa.design/goa/v3/dsl" ) @@ -28,7 +29,7 @@ var _ = Service("admin", func() { Method("UpdateAgent", func() { Description("Create or Update an agent user with required scopes") - Security(JWTAuth, func() { + Security(types.JWTAuth, func() { Scope("agent:create") }) Payload(func() { @@ -56,7 +57,7 @@ var _ = Service("admin", func() { Method("RefreshConfig", func() { Description("Refresh the changes in config file") - Security(JWTAuth, func() { + Security(types.JWTAuth, func() { Scope("config:refresh") }) Payload(func() { diff --git a/api/design/auth.go b/api/design/auth.go index dbcd0c09f5..24c3465db1 100644 --- a/api/design/auth.go +++ b/api/design/auth.go @@ -15,6 +15,7 @@ package design import ( + "github.com/tektoncd/hub/api/design/types" . "goa.design/goa/v3/dsl" ) @@ -35,7 +36,7 @@ var _ = Service("auth", func() { Required("code") }) Result(func() { - Attribute("data", AuthTokens, "User Tokens") + Attribute("data", types.AuthTokens, "User Tokens") Required("data") }) diff --git a/api/design/catalog.go b/api/design/catalog.go index f72db06f97..07f185ea4f 100644 --- a/api/design/catalog.go +++ b/api/design/catalog.go @@ -15,6 +15,7 @@ package design import ( + "github.com/tektoncd/hub/api/design/types" . "goa.design/goa/v3/dsl" ) @@ -26,14 +27,14 @@ var _ = Service("catalog", func() { Method("Refresh", func() { Description("Refreshes Tekton Catalog") - Security(JWTAuth, func() { + Security(types.JWTAuth, func() { Scope("catalog:refresh") }) Payload(func() { Token("token", String, "JWT") Required("token") }) - Result(Job) + Result(types.Job) HTTP(func() { POST("/catalog/refresh") diff --git a/api/design/category.go b/api/design/category.go index dc75ee2a08..bd65326a3f 100644 --- a/api/design/category.go +++ b/api/design/category.go @@ -15,6 +15,7 @@ package design import ( + "github.com/tektoncd/hub/api/design/types" . "goa.design/goa/v3/dsl" ) @@ -26,12 +27,11 @@ var _ = Service("category", func() { Method("list", func() { Description("List all categories along with their tags sorted by name") Result(func() { - Attribute("data", ArrayOf(Category)) + Attribute("data", ArrayOf(types.Category)) }) HTTP(func() { GET("/categories") - GET("/v1/categories") Response(StatusOK) Response("internal-error", StatusInternalServerError) diff --git a/api/design/rating.go b/api/design/rating.go index b37f36499d..08f48aeb4b 100644 --- a/api/design/rating.go +++ b/api/design/rating.go @@ -15,6 +15,7 @@ package design import ( + "github.com/tektoncd/hub/api/design/types" . "goa.design/goa/v3/dsl" ) @@ -28,7 +29,7 @@ var _ = Service("rating", func() { Method("Get", func() { Description("Find user's rating for a resource") - Security(JWTAuth, func() { + Security(types.JWTAuth, func() { Scope("rating:read") }) Payload(func() { @@ -57,7 +58,7 @@ var _ = Service("rating", func() { Method("Update", func() { Description("Update user's rating for a resource") - Security(JWTAuth, func() { + Security(types.JWTAuth, func() { Scope("rating:write") }) Payload(func() { diff --git a/api/design/resource.go b/api/design/resource.go index bf4213eacb..fa6df89051 100644 --- a/api/design/resource.go +++ b/api/design/resource.go @@ -15,9 +15,12 @@ package design import ( + "github.com/tektoncd/hub/api/design/types" . "goa.design/goa/v3/dsl" ) +// NOTE: APIs in the service are moved to v1. This APIs will be deprecated in the next release. + var _ = Service("resource", func() { Description("The resource service provides details about all kind of resources") @@ -27,6 +30,7 @@ var _ = Service("resource", func() { // NOTE: Supported Tekton Resource kind by APIs are defined in /pkg/parser/kind.go + // Will be deprecated, moved to v1 Method("Query", func() { Description("Find resources by a combination of name, kind and tags") Payload(func() { @@ -50,11 +54,10 @@ var _ = Service("resource", func() { Default("contains") }) }) - Result(Resources) + Result(types.Resources) HTTP(func() { GET("/query") - GET("/v1/query") Param("name") Param("kinds") @@ -69,6 +72,7 @@ var _ = Service("resource", func() { }) }) + // Will be deprecated, moved to v1 Method("List", func() { Description("List all resources sorted by rating and name") Payload(func() { @@ -77,11 +81,10 @@ var _ = Service("resource", func() { Example("limit", 100) }) }) - Result(Resources) + Result(types.Resources) HTTP(func() { GET("/resources") - GET("/v1/resources") Param("limit") @@ -90,6 +93,7 @@ var _ = Service("resource", func() { }) }) + // Will be deprecated, moved to v1 Method("VersionsByID", func() { Description("Find all versions of a resource by its id") Payload(func() { @@ -98,11 +102,10 @@ var _ = Service("resource", func() { }) Required("id") }) - Result(ResourceVersions) + Result(types.ResourceVersions) HTTP(func() { GET("/resource/{id}/versions") - GET("/v1/resource/{id}/versions") Response(StatusOK) Response("internal-error", StatusInternalServerError) @@ -110,6 +113,7 @@ var _ = Service("resource", func() { }) }) + // Will be deprecated, moved to v1 Method("ByCatalogKindNameVersion", func() { Description("Find resource using name of catalog & name, kind and version of resource") Payload(func() { @@ -128,11 +132,10 @@ var _ = Service("resource", func() { Required("catalog", "kind", "name", "version") }) - Result(ResourceVersion) + Result(types.ResourceVersion) HTTP(func() { GET("/resource/{catalog}/{kind}/{name}/{version}") - GET("/v1/resource/{catalog}/{kind}/{name}/{version}") Response(StatusOK) Response("internal-error", StatusInternalServerError) @@ -140,6 +143,7 @@ var _ = Service("resource", func() { }) }) + // Will be deprecated, moved to v1 Method("ByVersionId", func() { Description("Find a resource using its version's id") Payload(func() { @@ -148,11 +152,10 @@ var _ = Service("resource", func() { }) Required("versionID") }) - Result(ResourceVersion) + Result(types.ResourceVersion) HTTP(func() { GET("/resource/version/{versionID}") - GET("/v1/resource/version/{versionID}") Response(StatusOK) Response("internal-error", StatusInternalServerError) @@ -160,6 +163,7 @@ var _ = Service("resource", func() { }) }) + // Will be deprecated, moved to v1 Method("ByCatalogKindName", func() { Description("Find resources using name of catalog, resource name and kind of resource") Payload(func() { @@ -174,11 +178,10 @@ var _ = Service("resource", func() { }) Required("catalog", "kind", "name") }) - Result(Resource) + Result(types.Resource) HTTP(func() { GET("/resource/{catalog}/{kind}/{name}") - GET("/v1/resource/{catalog}/{kind}/{name}") Response(StatusOK) Response("internal-error", StatusInternalServerError) @@ -186,6 +189,7 @@ var _ = Service("resource", func() { }) }) + // Will be deprecated, moved to v1 Method("ById", func() { Description("Find a resource using it's id") Payload(func() { @@ -194,11 +198,10 @@ var _ = Service("resource", func() { }) Required("id") }) - Result(Resource) + Result(types.Resource) HTTP(func() { GET("/resource/{id}") - GET("/v1/resource/{id}") Response(StatusOK) Response("internal-error", StatusInternalServerError) diff --git a/api/design/status.go b/api/design/status.go index 8672a58de9..7f0507ec84 100644 --- a/api/design/status.go +++ b/api/design/status.go @@ -15,6 +15,7 @@ package design import ( + "github.com/tektoncd/hub/api/design/types" . "goa.design/goa/v3/dsl" ) @@ -24,11 +25,12 @@ var _ = Service("status", func() { Method("Status", func() { Description("Return status of the services") Result(func() { - Attribute("services", ArrayOf(HubService), "List of services and their status") + Attribute("services", ArrayOf(types.HubService), "List of services and their status") }) HTTP(func() { GET("/") + GET("/v1") Response(StatusOK) }) }) diff --git a/api/design/type.go b/api/design/types/type.go similarity index 99% rename from api/design/type.go rename to api/design/types/type.go index eef13c4b70..b34e94caca 100644 --- a/api/design/type.go +++ b/api/design/types/type.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package design +package types import ( . "goa.design/goa/v3/dsl" diff --git a/api/gen/http/admin/client/cli.go b/api/gen/http/admin/client/cli.go index 7eee537cc1..15c7f5d83a 100644 --- a/api/gen/http/admin/client/cli.go +++ b/api/gen/http/admin/client/cli.go @@ -23,7 +23,7 @@ func BuildUpdateAgentPayload(adminUpdateAgentBody string, adminUpdateAgentToken { err = json.Unmarshal([]byte(adminUpdateAgentBody), &body) if err != nil { - return nil, fmt.Errorf("invalid JSON for body, example of valid JSON:\n%s", "'{\n \"name\": \"Pariatur occaecati voluptas assumenda maiores quaerat consequatur.\",\n \"scopes\": [\n \"Nihil officia itaque non.\",\n \"Qui dolor consequatur assumenda.\"\n ]\n }'") + return nil, fmt.Errorf("invalid JSON for body, example of valid JSON:\n%s", "'{\n \"name\": \"Non omnis quas deserunt.\",\n \"scopes\": [\n \"Pariatur occaecati voluptas assumenda maiores quaerat consequatur.\",\n \"Quia nihil officia itaque.\"\n ]\n }'") } if body.Scopes == nil { err = goa.MergeErrors(err, goa.MissingFieldError("scopes", "body")) diff --git a/api/gen/http/category/client/paths.go b/api/gen/http/category/client/paths.go index 00f32c188e..cf97b6cb16 100644 --- a/api/gen/http/category/client/paths.go +++ b/api/gen/http/category/client/paths.go @@ -11,8 +11,3 @@ package client func ListCategoryPath() string { return "/categories" } - -// ListCategoryPath2 returns the URL path to the category service list HTTP endpoint. -func ListCategoryPath2() string { - return "/v1/categories" -} diff --git a/api/gen/http/category/server/paths.go b/api/gen/http/category/server/paths.go index cf7c17ab1c..bd4eaac64e 100644 --- a/api/gen/http/category/server/paths.go +++ b/api/gen/http/category/server/paths.go @@ -11,8 +11,3 @@ package server func ListCategoryPath() string { return "/categories" } - -// ListCategoryPath2 returns the URL path to the category service list HTTP endpoint. -func ListCategoryPath2() string { - return "/v1/categories" -} diff --git a/api/gen/http/category/server/server.go b/api/gen/http/category/server/server.go index 66cd9ffb99..244e3658e1 100644 --- a/api/gen/http/category/server/server.go +++ b/api/gen/http/category/server/server.go @@ -58,9 +58,7 @@ func New( return &Server{ Mounts: []*MountPoint{ {"List", "GET", "/categories"}, - {"List", "GET", "/v1/categories"}, {"CORS", "OPTIONS", "/categories"}, - {"CORS", "OPTIONS", "/v1/categories"}, }, List: NewListHandler(e.List, mux, decoder, encoder, errhandler, formatter), CORS: NewCORSHandler(), @@ -92,7 +90,6 @@ func MountListHandler(mux goahttp.Muxer, h http.Handler) { } } mux.Handle("GET", "/categories", f) - mux.Handle("GET", "/v1/categories", f) } // NewListHandler creates a HTTP handler which loads the HTTP request and calls @@ -138,7 +135,6 @@ func MountCORSHandler(mux goahttp.Muxer, h http.Handler) { } } mux.Handle("OPTIONS", "/categories", f) - mux.Handle("OPTIONS", "/v1/categories", f) } // NewCORSHandler creates a HTTP handler which returns a simple 200 response. diff --git a/api/gen/http/cli/hub/cli.go b/api/gen/http/cli/hub/cli.go index f6a11da4ac..736af20a82 100644 --- a/api/gen/http/cli/hub/cli.go +++ b/api/gen/http/cli/hub/cli.go @@ -29,29 +29,29 @@ import ( // command (subcommand1|subcommand2|...) // func UsageCommands() string { - return `category list -admin (update-agent|refresh-config) -rating (get|update) -status status + return `admin (update-agent|refresh-config) +auth authenticate catalog refresh +category list +rating (get|update) resource (query|list|versions-by-id|by-catalog-kind-name-version|by-version-id|by-catalog-kind-name|by-id) -auth authenticate +status status ` } // UsageExamples produces an example of a valid invocation of the CLI tool. func UsageExamples() string { - return os.Args[0] + ` category list` + "\n" + - os.Args[0] + ` admin update-agent --body '{ - "name": "Pariatur occaecati voluptas assumenda maiores quaerat consequatur.", + return os.Args[0] + ` admin update-agent --body '{ + "name": "Non omnis quas deserunt.", "scopes": [ - "Nihil officia itaque non.", - "Qui dolor consequatur assumenda." + "Pariatur occaecati voluptas assumenda maiores quaerat consequatur.", + "Quia nihil officia itaque." ] - }' --token "Aut minima autem ut est error eaque."` + "\n" + - os.Args[0] + ` rating get --id 14411076152978990455 --token "Rerum repellat aut."` + "\n" + - os.Args[0] + ` status status` + "\n" + - os.Args[0] + ` catalog refresh --token "Animi sit nulla."` + "\n" + + }' --token "Aut qui dolor consequatur assumenda suscipit aut."` + "\n" + + os.Args[0] + ` auth authenticate --code "5628b69ec09c09512eef"` + "\n" + + os.Args[0] + ` catalog refresh --token "Aut eos qui fugiat."` + "\n" + + os.Args[0] + ` category list` + "\n" + + os.Args[0] + ` rating get --id 4565160072724169842 --token "Non quo velit vitae aut porro."` + "\n" + "" } @@ -65,10 +65,6 @@ func ParseEndpoint( restore bool, ) (goa.Endpoint, interface{}, error) { var ( - categoryFlags = flag.NewFlagSet("category", flag.ContinueOnError) - - categoryListFlags = flag.NewFlagSet("list", flag.ExitOnError) - adminFlags = flag.NewFlagSet("admin", flag.ContinueOnError) adminUpdateAgentFlags = flag.NewFlagSet("update-agent", flag.ExitOnError) @@ -79,6 +75,20 @@ func ParseEndpoint( adminRefreshConfigBodyFlag = adminRefreshConfigFlags.String("body", "REQUIRED", "") adminRefreshConfigTokenFlag = adminRefreshConfigFlags.String("token", "REQUIRED", "") + authFlags = flag.NewFlagSet("auth", flag.ContinueOnError) + + authAuthenticateFlags = flag.NewFlagSet("authenticate", flag.ExitOnError) + authAuthenticateCodeFlag = authAuthenticateFlags.String("code", "REQUIRED", "") + + catalogFlags = flag.NewFlagSet("catalog", flag.ContinueOnError) + + catalogRefreshFlags = flag.NewFlagSet("refresh", flag.ExitOnError) + catalogRefreshTokenFlag = catalogRefreshFlags.String("token", "REQUIRED", "") + + categoryFlags = flag.NewFlagSet("category", flag.ContinueOnError) + + categoryListFlags = flag.NewFlagSet("list", flag.ExitOnError) + ratingFlags = flag.NewFlagSet("rating", flag.ContinueOnError) ratingGetFlags = flag.NewFlagSet("get", flag.ExitOnError) @@ -90,15 +100,6 @@ func ParseEndpoint( ratingUpdateIDFlag = ratingUpdateFlags.String("id", "REQUIRED", "ID of a resource") ratingUpdateTokenFlag = ratingUpdateFlags.String("token", "REQUIRED", "") - statusFlags = flag.NewFlagSet("status", flag.ContinueOnError) - - statusStatusFlags = flag.NewFlagSet("status", flag.ExitOnError) - - catalogFlags = flag.NewFlagSet("catalog", flag.ContinueOnError) - - catalogRefreshFlags = flag.NewFlagSet("refresh", flag.ExitOnError) - catalogRefreshTokenFlag = catalogRefreshFlags.String("token", "REQUIRED", "") - resourceFlags = flag.NewFlagSet("resource", flag.ContinueOnError) resourceQueryFlags = flag.NewFlagSet("query", flag.ExitOnError) @@ -131,28 +132,27 @@ func ParseEndpoint( resourceByIDFlags = flag.NewFlagSet("by-id", flag.ExitOnError) resourceByIDIDFlag = resourceByIDFlags.String("id", "REQUIRED", "ID of a resource") - authFlags = flag.NewFlagSet("auth", flag.ContinueOnError) + statusFlags = flag.NewFlagSet("status", flag.ContinueOnError) - authAuthenticateFlags = flag.NewFlagSet("authenticate", flag.ExitOnError) - authAuthenticateCodeFlag = authAuthenticateFlags.String("code", "REQUIRED", "") + statusStatusFlags = flag.NewFlagSet("status", flag.ExitOnError) ) - categoryFlags.Usage = categoryUsage - categoryListFlags.Usage = categoryListUsage - adminFlags.Usage = adminUsage adminUpdateAgentFlags.Usage = adminUpdateAgentUsage adminRefreshConfigFlags.Usage = adminRefreshConfigUsage - ratingFlags.Usage = ratingUsage - ratingGetFlags.Usage = ratingGetUsage - ratingUpdateFlags.Usage = ratingUpdateUsage - - statusFlags.Usage = statusUsage - statusStatusFlags.Usage = statusStatusUsage + authFlags.Usage = authUsage + authAuthenticateFlags.Usage = authAuthenticateUsage catalogFlags.Usage = catalogUsage catalogRefreshFlags.Usage = catalogRefreshUsage + categoryFlags.Usage = categoryUsage + categoryListFlags.Usage = categoryListUsage + + ratingFlags.Usage = ratingUsage + ratingGetFlags.Usage = ratingGetUsage + ratingUpdateFlags.Usage = ratingUpdateUsage + resourceFlags.Usage = resourceUsage resourceQueryFlags.Usage = resourceQueryUsage resourceListFlags.Usage = resourceListUsage @@ -162,8 +162,8 @@ func ParseEndpoint( resourceByCatalogKindNameFlags.Usage = resourceByCatalogKindNameUsage resourceByIDFlags.Usage = resourceByIDUsage - authFlags.Usage = authUsage - authAuthenticateFlags.Usage = authAuthenticateUsage + statusFlags.Usage = statusUsage + statusStatusFlags.Usage = statusStatusUsage if err := flag.CommandLine.Parse(os.Args[1:]); err != nil { return nil, nil, err @@ -180,20 +180,20 @@ func ParseEndpoint( { svcn = flag.Arg(0) switch svcn { - case "category": - svcf = categoryFlags case "admin": svcf = adminFlags - case "rating": - svcf = ratingFlags - case "status": - svcf = statusFlags + case "auth": + svcf = authFlags case "catalog": svcf = catalogFlags + case "category": + svcf = categoryFlags + case "rating": + svcf = ratingFlags case "resource": svcf = resourceFlags - case "auth": - svcf = authFlags + case "status": + svcf = statusFlags default: return nil, nil, fmt.Errorf("unknown service %q", svcn) } @@ -209,13 +209,6 @@ func ParseEndpoint( { epn = svcf.Arg(0) switch svcn { - case "category": - switch epn { - case "list": - epf = categoryListFlags - - } - case "admin": switch epn { case "update-agent": @@ -226,27 +219,34 @@ func ParseEndpoint( } - case "rating": + case "auth": switch epn { - case "get": - epf = ratingGetFlags + case "authenticate": + epf = authAuthenticateFlags - case "update": - epf = ratingUpdateFlags + } + + case "catalog": + switch epn { + case "refresh": + epf = catalogRefreshFlags } - case "status": + case "category": switch epn { - case "status": - epf = statusStatusFlags + case "list": + epf = categoryListFlags } - case "catalog": + case "rating": switch epn { - case "refresh": - epf = catalogRefreshFlags + case "get": + epf = ratingGetFlags + + case "update": + epf = ratingUpdateFlags } @@ -275,10 +275,10 @@ func ParseEndpoint( } - case "auth": + case "status": switch epn { - case "authenticate": - epf = authAuthenticateFlags + case "status": + epf = statusStatusFlags } @@ -302,13 +302,6 @@ func ParseEndpoint( ) { switch svcn { - case "category": - c := categoryc.NewClient(scheme, host, doer, enc, dec, restore) - switch epn { - case "list": - endpoint = c.List() - data = nil - } case "admin": c := adminc.NewClient(scheme, host, doer, enc, dec, restore) switch epn { @@ -319,6 +312,27 @@ func ParseEndpoint( endpoint = c.RefreshConfig() data, err = adminc.BuildRefreshConfigPayload(*adminRefreshConfigBodyFlag, *adminRefreshConfigTokenFlag) } + case "auth": + c := authc.NewClient(scheme, host, doer, enc, dec, restore) + switch epn { + case "authenticate": + endpoint = c.Authenticate() + data, err = authc.BuildAuthenticatePayload(*authAuthenticateCodeFlag) + } + case "catalog": + c := catalogc.NewClient(scheme, host, doer, enc, dec, restore) + switch epn { + case "refresh": + endpoint = c.Refresh() + data, err = catalogc.BuildRefreshPayload(*catalogRefreshTokenFlag) + } + case "category": + c := categoryc.NewClient(scheme, host, doer, enc, dec, restore) + switch epn { + case "list": + endpoint = c.List() + data = nil + } case "rating": c := ratingc.NewClient(scheme, host, doer, enc, dec, restore) switch epn { @@ -329,20 +343,6 @@ func ParseEndpoint( endpoint = c.Update() data, err = ratingc.BuildUpdatePayload(*ratingUpdateBodyFlag, *ratingUpdateIDFlag, *ratingUpdateTokenFlag) } - case "status": - c := statusc.NewClient(scheme, host, doer, enc, dec, restore) - switch epn { - case "status": - endpoint = c.Status() - data = nil - } - case "catalog": - c := catalogc.NewClient(scheme, host, doer, enc, dec, restore) - switch epn { - case "refresh": - endpoint = c.Refresh() - data, err = catalogc.BuildRefreshPayload(*catalogRefreshTokenFlag) - } case "resource": c := resourcec.NewClient(scheme, host, doer, enc, dec, restore) switch epn { @@ -368,12 +368,12 @@ func ParseEndpoint( endpoint = c.ByID() data, err = resourcec.BuildByIDPayload(*resourceByIDIDFlag) } - case "auth": - c := authc.NewClient(scheme, host, doer, enc, dec, restore) + case "status": + c := statusc.NewClient(scheme, host, doer, enc, dec, restore) switch epn { - case "authenticate": - endpoint = c.Authenticate() - data, err = authc.BuildAuthenticatePayload(*authAuthenticateCodeFlag) + case "status": + endpoint = c.Status() + data = nil } } } @@ -384,29 +384,6 @@ func ParseEndpoint( return endpoint, data, nil } -// categoryUsage displays the usage of the category command and its subcommands. -func categoryUsage() { - fmt.Fprintf(os.Stderr, `The category service provides details about category -Usage: - %s [globalflags] category COMMAND [flags] - -COMMAND: - list: List all categories along with their tags sorted by name - -Additional help: - %s category COMMAND --help -`, os.Args[0], os.Args[0]) -} -func categoryListUsage() { - fmt.Fprintf(os.Stderr, `%s [flags] category list - -List all categories along with their tags sorted by name - -Example: - `+os.Args[0]+` category list -`, os.Args[0]) -} - // adminUsage displays the usage of the admin command and its subcommands. func adminUsage() { fmt.Fprintf(os.Stderr, `Admin service @@ -430,12 +407,12 @@ Create or Update an agent user with required scopes Example: `+os.Args[0]+` admin update-agent --body '{ - "name": "Pariatur occaecati voluptas assumenda maiores quaerat consequatur.", + "name": "Non omnis quas deserunt.", "scopes": [ - "Nihil officia itaque non.", - "Qui dolor consequatur assumenda." + "Pariatur occaecati voluptas assumenda maiores quaerat consequatur.", + "Quia nihil officia itaque." ] - }' --token "Aut minima autem ut est error eaque." + }' --token "Aut qui dolor consequatur assumenda suscipit aut." `, os.Args[0]) } @@ -449,95 +426,119 @@ Refresh the changes in config file Example: `+os.Args[0]+` admin refresh-config --body '{ "force": true - }' --token "Omnis non ut aut quos." + }' --token "Non iure modi." `, os.Args[0]) } -// ratingUsage displays the usage of the rating command and its subcommands. -func ratingUsage() { - fmt.Fprintf(os.Stderr, `The rating service exposes endpoints to read and write user's rating for resources +// authUsage displays the usage of the auth command and its subcommands. +func authUsage() { + fmt.Fprintf(os.Stderr, `The auth service exposes endpoint to authenticate User against GitHub OAuth Usage: - %s [globalflags] rating COMMAND [flags] + %s [globalflags] auth COMMAND [flags] COMMAND: - get: Find user's rating for a resource - update: Update user's rating for a resource + authenticate: Authenticates users against GitHub OAuth Additional help: - %s rating COMMAND --help + %s auth COMMAND --help `, os.Args[0], os.Args[0]) } -func ratingGetUsage() { - fmt.Fprintf(os.Stderr, `%s [flags] rating get -id UINT -token STRING +func authAuthenticateUsage() { + fmt.Fprintf(os.Stderr, `%s [flags] auth authenticate -code STRING -Find user's rating for a resource - -id UINT: ID of a resource - -token STRING: +Authenticates users against GitHub OAuth + -code STRING: Example: - `+os.Args[0]+` rating get --id 14411076152978990455 --token "Rerum repellat aut." + `+os.Args[0]+` auth authenticate --code "5628b69ec09c09512eef" `, os.Args[0]) } -func ratingUpdateUsage() { - fmt.Fprintf(os.Stderr, `%s [flags] rating update -body JSON -id UINT -token STRING +// catalogUsage displays the usage of the catalog command and its subcommands. +func catalogUsage() { + fmt.Fprintf(os.Stderr, `The Catalog Service exposes endpoints to interact with catalogs +Usage: + %s [globalflags] catalog COMMAND [flags] -Update user's rating for a resource - -body JSON: - -id UINT: ID of a resource +COMMAND: + refresh: Refreshes Tekton Catalog + +Additional help: + %s catalog COMMAND --help +`, os.Args[0], os.Args[0]) +} +func catalogRefreshUsage() { + fmt.Fprintf(os.Stderr, `%s [flags] catalog refresh -token STRING + +Refreshes Tekton Catalog -token STRING: Example: - `+os.Args[0]+` rating update --body '{ - "rating": 0 - }' --id 9364450849613805321 --token "Beatae reiciendis accusantium distinctio qui." + `+os.Args[0]+` catalog refresh --token "Aut eos qui fugiat." `, os.Args[0]) } -// statusUsage displays the usage of the status command and its subcommands. -func statusUsage() { - fmt.Fprintf(os.Stderr, `Describes the status of each service +// categoryUsage displays the usage of the category command and its subcommands. +func categoryUsage() { + fmt.Fprintf(os.Stderr, `The category service provides details about category Usage: - %s [globalflags] status COMMAND [flags] + %s [globalflags] category COMMAND [flags] COMMAND: - status: Return status of the services + list: List all categories along with their tags sorted by name Additional help: - %s status COMMAND --help + %s category COMMAND --help `, os.Args[0], os.Args[0]) } -func statusStatusUsage() { - fmt.Fprintf(os.Stderr, `%s [flags] status status +func categoryListUsage() { + fmt.Fprintf(os.Stderr, `%s [flags] category list -Return status of the services +List all categories along with their tags sorted by name Example: - `+os.Args[0]+` status status + `+os.Args[0]+` category list `, os.Args[0]) } -// catalogUsage displays the usage of the catalog command and its subcommands. -func catalogUsage() { - fmt.Fprintf(os.Stderr, `The Catalog Service exposes endpoints to interact with catalogs +// ratingUsage displays the usage of the rating command and its subcommands. +func ratingUsage() { + fmt.Fprintf(os.Stderr, `The rating service exposes endpoints to read and write user's rating for resources Usage: - %s [globalflags] catalog COMMAND [flags] + %s [globalflags] rating COMMAND [flags] COMMAND: - refresh: Refreshes Tekton Catalog + get: Find user's rating for a resource + update: Update user's rating for a resource Additional help: - %s catalog COMMAND --help + %s rating COMMAND --help `, os.Args[0], os.Args[0]) } -func catalogRefreshUsage() { - fmt.Fprintf(os.Stderr, `%s [flags] catalog refresh -token STRING +func ratingGetUsage() { + fmt.Fprintf(os.Stderr, `%s [flags] rating get -id UINT -token STRING -Refreshes Tekton Catalog +Find user's rating for a resource + -id UINT: ID of a resource + -token STRING: + +Example: + `+os.Args[0]+` rating get --id 4565160072724169842 --token "Non quo velit vitae aut porro." +`, os.Args[0]) +} + +func ratingUpdateUsage() { + fmt.Fprintf(os.Stderr, `%s [flags] rating update -body JSON -id UINT -token STRING + +Update user's rating for a resource + -body JSON: + -id UINT: ID of a resource -token STRING: Example: - `+os.Args[0]+` catalog refresh --token "Animi sit nulla." + `+os.Args[0]+` rating update --body '{ + "rating": 0 + }' --id 1454725131016771342 --token "Soluta sapiente deleniti voluptatem distinctio distinctio." `, os.Args[0]) } @@ -613,7 +614,7 @@ Find resource using name of catalog & name, kind and version of resource -version STRING: version of resource Example: - `+os.Args[0]+` resource by-catalog-kind-name-version --catalog "tektoncd" --kind "pipeline" --name "buildah" --version "0.1" + `+os.Args[0]+` resource by-catalog-kind-name-version --catalog "tektoncd" --kind "task" --name "buildah" --version "0.1" `, os.Args[0]) } @@ -652,26 +653,25 @@ Example: `, os.Args[0]) } -// authUsage displays the usage of the auth command and its subcommands. -func authUsage() { - fmt.Fprintf(os.Stderr, `The auth service exposes endpoint to authenticate User against GitHub OAuth +// statusUsage displays the usage of the status command and its subcommands. +func statusUsage() { + fmt.Fprintf(os.Stderr, `Describes the status of each service Usage: - %s [globalflags] auth COMMAND [flags] + %s [globalflags] status COMMAND [flags] COMMAND: - authenticate: Authenticates users against GitHub OAuth + status: Return status of the services Additional help: - %s auth COMMAND --help + %s status COMMAND --help `, os.Args[0], os.Args[0]) } -func authAuthenticateUsage() { - fmt.Fprintf(os.Stderr, `%s [flags] auth authenticate -code STRING +func statusStatusUsage() { + fmt.Fprintf(os.Stderr, `%s [flags] status status -Authenticates users against GitHub OAuth - -code STRING: +Return status of the services Example: - `+os.Args[0]+` auth authenticate --code "5628b69ec09c09512eef" + `+os.Args[0]+` status status `, os.Args[0]) } diff --git a/api/gen/http/openapi.json b/api/gen/http/openapi.json index 6fb80d1f03..c3f6df1424 100644 --- a/api/gen/http/openapi.json +++ b/api/gen/http/openapi.json @@ -1 +1 @@ -{"swagger":"2.0","info":{"title":"Tekton Hub","description":"HTTP services for managing Tekton Hub","version":"1.0"},"host":"api.hub.tekton.dev","consumes":["application/json","application/xml","application/gob"],"produces":["application/json","application/xml","application/gob"],"paths":{"/":{"get":{"tags":["status"],"summary":"Status status","description":"Return status of the services","operationId":"status#Status","responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/StatusStatusResponseBody"}}},"schemes":["http"]}},"/auth/login":{"post":{"tags":["auth"],"summary":"Authenticate auth","description":"Authenticates users against GitHub OAuth","operationId":"auth#Authenticate","parameters":[{"name":"code","in":"query","description":"OAuth Authorization code of User","required":true,"type":"string"}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/AuthAuthenticateResponseBody","required":["data"]}},"400":{"description":"Bad Request response.","schema":{"$ref":"#/definitions/AuthAuthenticateInvalidCodeResponseBody"}},"401":{"description":"Unauthorized response.","schema":{"$ref":"#/definitions/AuthAuthenticateInvalidTokenResponseBody"}},"403":{"description":"Forbidden response.","schema":{"$ref":"#/definitions/AuthAuthenticateInvalidScopesResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/AuthAuthenticateInternalErrorResponseBody"}}},"schemes":["http"]}},"/catalog/refresh":{"post":{"tags":["catalog"],"summary":"Refresh catalog","description":"Refreshes Tekton Catalog\n\n**Required security scopes for jwt**:\n * `catalog:refresh`","operationId":"catalog#Refresh","parameters":[{"name":"Authorization","in":"header","description":"JWT","required":true,"type":"string"}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/CatalogRefreshResponseBody"}},"404":{"description":"Not Found response.","schema":{"$ref":"#/definitions/CatalogRefreshNotFoundResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/CatalogRefreshInternalErrorResponseBody"}}},"schemes":["http"],"security":[{"jwt_header_Authorization":[]}]}},"/categories":{"get":{"tags":["category"],"summary":"list category","description":"List all categories along with their tags sorted by name","operationId":"category#list","responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/CategoryListResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/CategoryListInternalErrorResponseBody"}}},"schemes":["http"]}},"/query":{"get":{"tags":["resource"],"summary":"Query resource","description":"Find resources by a combination of name, kind and tags","operationId":"resource#Query","parameters":[{"name":"name","in":"query","description":"Name of resource","required":false,"type":"string","default":""},{"name":"kinds","in":"query","description":"Kinds of resource to filter by","required":false,"type":"array","items":{"type":"string"},"collectionFormat":"multi"},{"name":"tags","in":"query","description":"Tags associated with a resource to filter by","required":false,"type":"array","items":{"type":"string"},"collectionFormat":"multi"},{"name":"limit","in":"query","description":"Maximum number of resources to be returned","required":false,"type":"integer","default":1000},{"name":"match","in":"query","description":"Strategy used to find matching resources","required":false,"type":"string","default":"contains","enum":["exact","contains"]}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/ResourceQueryResponseBody"}},"400":{"description":"Bad Request response.","schema":{"$ref":"#/definitions/ResourceQueryInvalidKindResponseBody"}},"404":{"description":"Not Found response.","schema":{"$ref":"#/definitions/ResourceQueryNotFoundResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/ResourceQueryInternalErrorResponseBody"}}},"schemes":["http"]}},"/resource/version/{versionID}":{"get":{"tags":["resource"],"summary":"ByVersionId resource","description":"Find a resource using its version's id","operationId":"resource#ByVersionId","parameters":[{"name":"versionID","in":"path","description":"Version ID of a resource's version","required":true,"type":"integer"}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/ResourceByVersionIDResponseBody"}},"404":{"description":"Not Found response.","schema":{"$ref":"#/definitions/ResourceByVersionIDNotFoundResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/ResourceByVersionIDInternalErrorResponseBody"}}},"schemes":["http"]}},"/resource/{catalog}/{kind}/{name}":{"get":{"tags":["resource"],"summary":"ByCatalogKindName resource","description":"Find resources using name of catalog, resource name and kind of resource","operationId":"resource#ByCatalogKindName","parameters":[{"name":"catalog","in":"path","description":"name of catalog","required":true,"type":"string"},{"name":"kind","in":"path","description":"kind of resource","required":true,"type":"string","enum":["task","pipeline"]},{"name":"name","in":"path","description":"Name of resource","required":true,"type":"string"}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/ResourceByCatalogKindNameResponseBody"}},"404":{"description":"Not Found response.","schema":{"$ref":"#/definitions/ResourceByCatalogKindNameNotFoundResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/ResourceByCatalogKindNameInternalErrorResponseBody"}}},"schemes":["http"]}},"/resource/{catalog}/{kind}/{name}/{version}":{"get":{"tags":["resource"],"summary":"ByCatalogKindNameVersion resource","description":"Find resource using name of catalog \u0026 name, kind and version of resource","operationId":"resource#ByCatalogKindNameVersion","parameters":[{"name":"catalog","in":"path","description":"name of catalog","required":true,"type":"string"},{"name":"kind","in":"path","description":"kind of resource","required":true,"type":"string","enum":["task","pipeline"]},{"name":"name","in":"path","description":"name of resource","required":true,"type":"string"},{"name":"version","in":"path","description":"version of resource","required":true,"type":"string"}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/ResourceByCatalogKindNameVersionResponseBody"}},"404":{"description":"Not Found response.","schema":{"$ref":"#/definitions/ResourceByCatalogKindNameVersionNotFoundResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/ResourceByCatalogKindNameVersionInternalErrorResponseBody"}}},"schemes":["http"]}},"/resource/{id}":{"get":{"tags":["resource"],"summary":"ById resource","description":"Find a resource using it's id","operationId":"resource#ById","parameters":[{"name":"id","in":"path","description":"ID of a resource","required":true,"type":"integer"}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/ResourceByIDResponseBody"}},"404":{"description":"Not Found response.","schema":{"$ref":"#/definitions/ResourceByIDNotFoundResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/ResourceByIDInternalErrorResponseBody"}}},"schemes":["http"]}},"/resource/{id}/rating":{"get":{"tags":["rating"],"summary":"Get rating","description":"Find user's rating for a resource\n\n**Required security scopes for jwt**:\n * `rating:read`","operationId":"rating#Get","parameters":[{"name":"id","in":"path","description":"ID of a resource","required":true,"type":"integer"},{"name":"Authorization","in":"header","description":"JWT","required":true,"type":"string"}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/RatingGetResponseBody","required":["rating"]}},"401":{"description":"Unauthorized response.","schema":{"$ref":"#/definitions/RatingGetInvalidTokenResponseBody"}},"403":{"description":"Forbidden response.","schema":{"$ref":"#/definitions/RatingGetInvalidScopesResponseBody"}},"404":{"description":"Not Found response.","schema":{"$ref":"#/definitions/RatingGetNotFoundResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/RatingGetInternalErrorResponseBody"}}},"schemes":["http"],"security":[{"jwt_header_Authorization":[]}]},"put":{"tags":["rating"],"summary":"Update rating","description":"Update user's rating for a resource\n\n**Required security scopes for jwt**:\n * `rating:write`","operationId":"rating#Update","parameters":[{"name":"id","in":"path","description":"ID of a resource","required":true,"type":"integer"},{"name":"Authorization","in":"header","description":"JWT","required":true,"type":"string"},{"name":"UpdateRequestBody","in":"body","required":true,"schema":{"$ref":"#/definitions/RatingUpdateRequestBody","required":["rating"]}}],"responses":{"200":{"description":"OK response."},"401":{"description":"Unauthorized response.","schema":{"$ref":"#/definitions/RatingUpdateInvalidTokenResponseBody"}},"403":{"description":"Forbidden response.","schema":{"$ref":"#/definitions/RatingUpdateInvalidScopesResponseBody"}},"404":{"description":"Not Found response.","schema":{"$ref":"#/definitions/RatingUpdateNotFoundResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/RatingUpdateInternalErrorResponseBody"}}},"schemes":["http"],"security":[{"jwt_header_Authorization":[]}]}},"/resource/{id}/versions":{"get":{"tags":["resource"],"summary":"VersionsByID resource","description":"Find all versions of a resource by its id","operationId":"resource#VersionsByID","parameters":[{"name":"id","in":"path","description":"ID of a resource","required":true,"type":"integer"}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/ResourceVersionsByIDResponseBody"}},"404":{"description":"Not Found response.","schema":{"$ref":"#/definitions/ResourceVersionsByIDNotFoundResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/ResourceVersionsByIDInternalErrorResponseBody"}}},"schemes":["http"]}},"/resources":{"get":{"tags":["resource"],"summary":"List resource","description":"List all resources sorted by rating and name","operationId":"resource#List","parameters":[{"name":"limit","in":"query","description":"Maximum number of resources to be returned","required":false,"type":"integer","default":1000}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/ResourceListResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/ResourceListInternalErrorResponseBody"}}},"schemes":["http"]}},"/schema/swagger.json":{"get":{"tags":["swagger"],"summary":"Download gen/http/openapi3.yaml","description":"JSON document containing the API swagger definition","operationId":"swagger#/schema/swagger.json","responses":{"200":{"description":"File downloaded","schema":{"type":"file"}}},"schemes":["http"]}},"/system/config/refresh":{"post":{"tags":["admin"],"summary":"RefreshConfig admin","description":"Refresh the changes in config file\n\n**Required security scopes for jwt**:\n * `config:refresh`","operationId":"admin#RefreshConfig","parameters":[{"name":"Authorization","in":"header","description":"User JWT","required":true,"type":"string"},{"name":"RefreshConfigRequestBody","in":"body","required":true,"schema":{"$ref":"#/definitions/AdminRefreshConfigRequestBody","required":["force"]}}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/AdminRefreshConfigResponseBody","required":["checksum"]}},"401":{"description":"Unauthorized response.","schema":{"$ref":"#/definitions/AdminRefreshConfigInvalidTokenResponseBody"}},"403":{"description":"Forbidden response.","schema":{"$ref":"#/definitions/AdminRefreshConfigInvalidScopesResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/AdminRefreshConfigInternalErrorResponseBody"}}},"schemes":["http"],"security":[{"jwt_header_Authorization":[]}]}},"/system/user/agent":{"put":{"tags":["admin"],"summary":"UpdateAgent admin","description":"Create or Update an agent user with required scopes\n\n**Required security scopes for jwt**:\n * `agent:create`","operationId":"admin#UpdateAgent","parameters":[{"name":"Authorization","in":"header","description":"User JWT","required":true,"type":"string"},{"name":"UpdateAgentRequestBody","in":"body","required":true,"schema":{"$ref":"#/definitions/AdminUpdateAgentRequestBody","required":["name","scopes"]}}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/AdminUpdateAgentResponseBody","required":["token"]}},"400":{"description":"Bad Request response.","schema":{"$ref":"#/definitions/AdminUpdateAgentInvalidPayloadResponseBody"}},"401":{"description":"Unauthorized response.","schema":{"$ref":"#/definitions/AdminUpdateAgentInvalidTokenResponseBody"}},"403":{"description":"Forbidden response.","schema":{"$ref":"#/definitions/AdminUpdateAgentInvalidScopesResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/AdminUpdateAgentInternalErrorResponseBody"}}},"schemes":["http"],"security":[{"jwt_header_Authorization":[]}]}},"/v1/categories":{"get":{"tags":["category"],"summary":"list category","description":"List all categories along with their tags sorted by name","operationId":"category#list#1","responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/CategoryListResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/CategoryListInternalErrorResponseBody"}}},"schemes":["http"]}},"/v1/query":{"get":{"tags":["resource"],"summary":"Query resource","description":"Find resources by a combination of name, kind and tags","operationId":"resource#Query#1","parameters":[{"name":"name","in":"query","description":"Name of resource","required":false,"type":"string","default":""},{"name":"kinds","in":"query","description":"Kinds of resource to filter by","required":false,"type":"array","items":{"type":"string"},"collectionFormat":"multi"},{"name":"tags","in":"query","description":"Tags associated with a resource to filter by","required":false,"type":"array","items":{"type":"string"},"collectionFormat":"multi"},{"name":"limit","in":"query","description":"Maximum number of resources to be returned","required":false,"type":"integer","default":1000},{"name":"match","in":"query","description":"Strategy used to find matching resources","required":false,"type":"string","default":"contains","enum":["exact","contains"]}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/ResourceQueryResponseBody"}},"400":{"description":"Bad Request response.","schema":{"$ref":"#/definitions/ResourceQueryInvalidKindResponseBody"}},"404":{"description":"Not Found response.","schema":{"$ref":"#/definitions/ResourceQueryNotFoundResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/ResourceQueryInternalErrorResponseBody"}}},"schemes":["http"]}},"/v1/resource/version/{versionID}":{"get":{"tags":["resource"],"summary":"ByVersionId resource","description":"Find a resource using its version's id","operationId":"resource#ByVersionId#1","parameters":[{"name":"versionID","in":"path","description":"Version ID of a resource's version","required":true,"type":"integer"}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/ResourceByVersionIDResponseBody"}},"404":{"description":"Not Found response.","schema":{"$ref":"#/definitions/ResourceByVersionIDNotFoundResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/ResourceByVersionIDInternalErrorResponseBody"}}},"schemes":["http"]}},"/v1/resource/{catalog}/{kind}/{name}":{"get":{"tags":["resource"],"summary":"ByCatalogKindName resource","description":"Find resources using name of catalog, resource name and kind of resource","operationId":"resource#ByCatalogKindName#1","parameters":[{"name":"catalog","in":"path","description":"name of catalog","required":true,"type":"string"},{"name":"kind","in":"path","description":"kind of resource","required":true,"type":"string","enum":["task","pipeline"]},{"name":"name","in":"path","description":"Name of resource","required":true,"type":"string"}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/ResourceByCatalogKindNameResponseBody"}},"404":{"description":"Not Found response.","schema":{"$ref":"#/definitions/ResourceByCatalogKindNameNotFoundResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/ResourceByCatalogKindNameInternalErrorResponseBody"}}},"schemes":["http"]}},"/v1/resource/{catalog}/{kind}/{name}/{version}":{"get":{"tags":["resource"],"summary":"ByCatalogKindNameVersion resource","description":"Find resource using name of catalog \u0026 name, kind and version of resource","operationId":"resource#ByCatalogKindNameVersion#1","parameters":[{"name":"catalog","in":"path","description":"name of catalog","required":true,"type":"string"},{"name":"kind","in":"path","description":"kind of resource","required":true,"type":"string","enum":["task","pipeline"]},{"name":"name","in":"path","description":"name of resource","required":true,"type":"string"},{"name":"version","in":"path","description":"version of resource","required":true,"type":"string"}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/ResourceByCatalogKindNameVersionResponseBody"}},"404":{"description":"Not Found response.","schema":{"$ref":"#/definitions/ResourceByCatalogKindNameVersionNotFoundResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/ResourceByCatalogKindNameVersionInternalErrorResponseBody"}}},"schemes":["http"]}},"/v1/resource/{id}":{"get":{"tags":["resource"],"summary":"ById resource","description":"Find a resource using it's id","operationId":"resource#ById#1","parameters":[{"name":"id","in":"path","description":"ID of a resource","required":true,"type":"integer"}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/ResourceByIDResponseBody"}},"404":{"description":"Not Found response.","schema":{"$ref":"#/definitions/ResourceByIDNotFoundResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/ResourceByIDInternalErrorResponseBody"}}},"schemes":["http"]}},"/v1/resource/{id}/versions":{"get":{"tags":["resource"],"summary":"VersionsByID resource","description":"Find all versions of a resource by its id","operationId":"resource#VersionsByID#1","parameters":[{"name":"id","in":"path","description":"ID of a resource","required":true,"type":"integer"}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/ResourceVersionsByIDResponseBody"}},"404":{"description":"Not Found response.","schema":{"$ref":"#/definitions/ResourceVersionsByIDNotFoundResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/ResourceVersionsByIDInternalErrorResponseBody"}}},"schemes":["http"]}},"/v1/resources":{"get":{"tags":["resource"],"summary":"List resource","description":"List all resources sorted by rating and name","operationId":"resource#List#1","parameters":[{"name":"limit","in":"query","description":"Maximum number of resources to be returned","required":false,"type":"integer","default":1000}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/ResourceListResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/ResourceListInternalErrorResponseBody"}}},"schemes":["http"]}}},"definitions":{"AdminRefreshConfigInternalErrorResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Internal server error (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"AdminRefreshConfigInvalidScopesResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Invalid Token scopes (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"AdminRefreshConfigInvalidTokenResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Invalid User token (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"AdminRefreshConfigRequestBody":{"title":"AdminRefreshConfigRequestBody","type":"object","properties":{"force":{"type":"boolean","description":"Force Refresh the config file","example":true}},"example":{"force":false},"required":["force"]},"AdminRefreshConfigResponseBody":{"title":"AdminRefreshConfigResponseBody","type":"object","properties":{"checksum":{"type":"string","description":"Config file checksum","example":"Voluptas voluptas deserunt non molestiae illo."}},"example":{"checksum":"Numquam eaque sunt voluptas eius non illo."},"required":["checksum"]},"AdminUpdateAgentInternalErrorResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Internal server error (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"AdminUpdateAgentInvalidPayloadResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Invalid request body (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"AdminUpdateAgentInvalidScopesResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Invalid Token scopes (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"AdminUpdateAgentInvalidTokenResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Invalid User token (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"AdminUpdateAgentRequestBody":{"title":"AdminUpdateAgentRequestBody","type":"object","properties":{"name":{"type":"string","description":"Name of Agent","example":"Quia molestiae eaque necessitatibus magni quia illum."},"scopes":{"type":"array","items":{"type":"string","example":"Suscipit voluptatem."},"description":"Scopes required for Agent","example":["Rerum autem dolores at.","Aliquam voluptates illo.","Illum et ut pariatur similique.","Laudantium nostrum quia totam magni reprehenderit maxime."]}},"example":{"name":"Velit itaque dolores dolor esse.","scopes":["Aliquid praesentium saepe sed optio ab.","Est magnam eveniet nihil et beatae."]},"required":["name","scopes"]},"AdminUpdateAgentResponseBody":{"title":"AdminUpdateAgentResponseBody","type":"object","properties":{"token":{"type":"string","description":"Agent JWT","example":"Eum minus reiciendis nulla."}},"example":{"token":"Natus aut assumenda aut."},"required":["token"]},"AuthAuthenticateInternalErrorResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Internal Server Error (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"AuthAuthenticateInvalidCodeResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Invalid Authorization code (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"AuthAuthenticateInvalidScopesResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Invalid User scope (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"AuthAuthenticateInvalidTokenResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Invalid User token (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"AuthAuthenticateResponseBody":{"title":"AuthAuthenticateResponseBody","type":"object","properties":{"data":{"$ref":"#/definitions/AuthTokensResponseBody"}},"example":{"data":{"access":{"expiresAt":0,"refreshInterval":"1h30m","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"},"refresh":{"expiresAt":0,"refreshInterval":"1h30m","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"}}},"required":["data"]},"AuthTokensResponseBody":{"title":"AuthTokensResponseBody","type":"object","properties":{"access":{"$ref":"#/definitions/TokenResponseBody"},"refresh":{"$ref":"#/definitions/TokenResponseBody"}},"description":"Auth tokens have access and refresh token for user","example":{"access":{"expiresAt":0,"refreshInterval":"1h30m","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"},"refresh":{"expiresAt":0,"refreshInterval":"1h30m","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"}}},"CatalogRefreshInternalErrorResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Internal Server Error (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"CatalogRefreshNotFoundResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Resource Not Found Error (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"CatalogRefreshResponseBody":{"title":"Mediatype identifier: application/vnd.hub.job; view=default","type":"object","properties":{"id":{"type":"integer","description":"id of the job","example":14575660200349537009,"format":"int64"},"status":{"type":"string","description":"status of the job","example":"Magnam tempore consequatur fugiat quae."}},"description":"RefreshResponseBody result type (default view)","example":{"id":13506291968005789499,"status":"Ea itaque nam rerum aut officia a."},"required":["id","status"]},"CatalogResponseBody":{"title":"CatalogResponseBody","type":"object","properties":{"id":{"type":"integer","description":"ID is the unique id of the catalog","example":1,"format":"int64"},"name":{"type":"string","description":"Name of catalog","example":"Tekton"},"type":{"type":"string","description":"Type of catalog","example":"community","enum":["official","community"]}},"example":{"id":1,"name":"Tekton","type":"community"},"required":["id","name","type"]},"CategoryListInternalErrorResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Internal Server Error (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"CategoryListResponseBody":{"title":"CategoryListResponseBody","type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/definitions/CategoryResponseBody"},"example":[{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]},{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]}]}},"example":{"data":[{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]},{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]},{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]}]}},"CategoryResponseBody":{"title":"CategoryResponseBody","type":"object","properties":{"id":{"type":"integer","description":"ID is the unique id of the category","example":1,"format":"int64"},"name":{"type":"string","description":"Name of category","example":"Image Builder"},"tags":{"type":"array","items":{"$ref":"#/definitions/TagResponseBody"},"description":"List of tags associated with the category","example":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]}},"example":{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]},"required":["id","name","tags"]},"HubServiceResponseBody":{"title":"HubServiceResponseBody","type":"object","properties":{"error":{"type":"string","description":"Details of the error if any","example":"unable to reach db"},"name":{"type":"string","description":"Name of the service","example":"api"},"status":{"type":"string","description":"Status of the service","example":"ok","enum":["ok","error"]}},"description":"Describes the services and their status","example":{"error":"unable to reach db","name":"api","status":"ok"},"required":["name","status"]},"RatingGetInternalErrorResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Internal server error (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"RatingGetInvalidScopesResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Invalid User scope (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"RatingGetInvalidTokenResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Invalid User token (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"RatingGetNotFoundResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Resource Not Found Error (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"RatingGetResponseBody":{"title":"RatingGetResponseBody","type":"object","properties":{"rating":{"type":"integer","description":"User rating for resource","example":4,"format":"int64"}},"example":{"rating":4},"required":["rating"]},"RatingUpdateInternalErrorResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Internal server error (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"RatingUpdateInvalidScopesResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Invalid User scope (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"RatingUpdateInvalidTokenResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Invalid User token (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"RatingUpdateNotFoundResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Resource Not Found Error (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"RatingUpdateRequestBody":{"title":"RatingUpdateRequestBody","type":"object","properties":{"rating":{"type":"integer","description":"User rating for resource","example":3,"minimum":0,"maximum":5}},"example":{"rating":1},"required":["rating"]},"ResourceByCatalogKindNameInternalErrorResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Internal Server Error (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"ResourceByCatalogKindNameNotFoundResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Resource Not Found Error (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"ResourceByCatalogKindNameResponseBody":{"title":"Mediatype identifier: application/vnd.hub.resource; view=default","type":"object","properties":{"data":{"$ref":"#/definitions/ResourceDataResponseBody"}},"description":"ByCatalogKindNameResponseBody result type (default view)","example":{"data":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]}},"required":["data"]},"ResourceByCatalogKindNameVersionInternalErrorResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Internal Server Error (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"ResourceByCatalogKindNameVersionNotFoundResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Resource Not Found Error (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"ResourceByCatalogKindNameVersionResponseBody":{"title":"Mediatype identifier: application/vnd.hub.resource.version; view=default","type":"object","properties":{"data":{"$ref":"#/definitions/ResourceVersionDataResponseBody"}},"description":"ByCatalogKindNameVersionResponseBody result type (default view)","example":{"data":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","resource":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]},"updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"}},"required":["data"]},"ResourceByIDInternalErrorResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Internal Server Error (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"ResourceByIDNotFoundResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Resource Not Found Error (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"ResourceByIDResponseBody":{"title":"Mediatype identifier: application/vnd.hub.resource; view=default","type":"object","properties":{"data":{"$ref":"#/definitions/ResourceDataResponseBody"}},"description":"ByIdResponseBody result type (default view)","example":{"data":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]}},"required":["data"]},"ResourceByVersionIDInternalErrorResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Internal Server Error (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"ResourceByVersionIDNotFoundResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Resource Not Found Error (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"ResourceByVersionIDResponseBody":{"title":"Mediatype identifier: application/vnd.hub.resource.version; view=default","type":"object","properties":{"data":{"$ref":"#/definitions/ResourceVersionDataResponseBody"}},"description":"ByVersionIdResponseBody result type (default view)","example":{"data":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","resource":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]},"updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"}},"required":["data"]},"ResourceDataResponseBody":{"title":"Mediatype identifier: application/vnd.hub.resource.data; view=default","type":"object","properties":{"catalog":{"$ref":"#/definitions/CatalogResponseBody"},"id":{"type":"integer","description":"ID is the unique id of the resource","example":1,"format":"int64"},"kind":{"type":"string","description":"Kind of resource","example":"task"},"latestVersion":{"$ref":"#/definitions/ResourceVersionDataResponseBodyWithoutResource"},"name":{"type":"string","description":"Name of resource","example":"buildah"},"rating":{"type":"number","description":"Rating of resource","example":4.3,"format":"double"},"tags":{"type":"array","items":{"$ref":"#/definitions/TagResponseBody"},"description":"Tags related to resource","example":[{"id":1,"name":"image-build"}]},"versions":{"type":"array","items":{"$ref":"#/definitions/ResourceVersionDataResponseBodyTiny"},"description":"List of all versions of a resource","example":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]}},"description":"The resource type describes resource information.","example":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},"required":["id","name","catalog","kind","latestVersion","tags","rating","versions"]},"ResourceDataResponseBodyInfo":{"title":"Mediatype identifier: application/vnd.hub.resource.data; view=default","type":"object","properties":{"catalog":{"$ref":"#/definitions/CatalogResponseBody"},"id":{"type":"integer","description":"ID is the unique id of the resource","example":1,"format":"int64"},"kind":{"type":"string","description":"Kind of resource","example":"task"},"name":{"type":"string","description":"Name of resource","example":"buildah"},"rating":{"type":"number","description":"Rating of resource","example":4.3,"format":"double"},"tags":{"type":"array","items":{"$ref":"#/definitions/TagResponseBody"},"description":"Tags related to resource","example":[{"id":1,"name":"image-build"}]}},"description":"The resource type describes resource information. (default view)","example":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]},"required":["id","name","catalog","kind","tags","rating"]},"ResourceDataResponseBodyWithoutVersion":{"title":"Mediatype identifier: application/vnd.hub.resource.data; view=default","type":"object","properties":{"catalog":{"$ref":"#/definitions/CatalogResponseBody"},"id":{"type":"integer","description":"ID is the unique id of the resource","example":1,"format":"int64"},"kind":{"type":"string","description":"Kind of resource","example":"task"},"latestVersion":{"$ref":"#/definitions/ResourceVersionDataResponseBodyWithoutResource"},"name":{"type":"string","description":"Name of resource","example":"buildah"},"rating":{"type":"number","description":"Rating of resource","example":4.3,"format":"double"},"tags":{"type":"array","items":{"$ref":"#/definitions/TagResponseBody"},"description":"Tags related to resource","example":[{"id":1,"name":"image-build"}]}},"description":"The resource type describes resource information. (withoutVersion view) (default view)","example":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]},"required":["id","name","catalog","kind","latestVersion","tags","rating"]},"ResourceDataResponseBodyWithoutVersionCollection":{"title":"Mediatype identifier: application/vnd.hub.resource.data; type=collection; view=default","type":"array","items":{"$ref":"#/definitions/ResourceDataResponseBodyWithoutVersion"},"description":"ResourceDataResponseBodyWithoutVersionCollection is the result type for an array of ResourceDataResponseBodyWithoutVersion (default view)","example":[{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]}]},"ResourceListInternalErrorResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Internal Server Error (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"ResourceListResponseBody":{"title":"Mediatype identifier: application/vnd.hub.resources; view=default","type":"object","properties":{"data":{"$ref":"#/definitions/ResourceDataResponseBodyWithoutVersionCollection"}},"description":"ListResponseBody result type (default view)","example":{"data":[{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]}]},"required":["data"]},"ResourceQueryInternalErrorResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Internal Server Error (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"ResourceQueryInvalidKindResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Invalid Resource Kind (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"ResourceQueryNotFoundResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Resource Not Found Error (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"ResourceQueryResponseBody":{"title":"Mediatype identifier: application/vnd.hub.resources; view=default","type":"object","properties":{"data":{"$ref":"#/definitions/ResourceDataResponseBodyWithoutVersionCollection"}},"description":"QueryResponseBody result type (default view)","example":{"data":[{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]}]},"required":["data"]},"ResourceVersionDataResponseBody":{"title":"Mediatype identifier: application/vnd.hub.resource.version.data; view=default","type":"object","properties":{"description":{"type":"string","description":"Description of version","example":"Buildah task builds source into a container image and then pushes it to a container registry."},"displayName":{"type":"string","description":"Display name of version","example":"Buildah"},"id":{"type":"integer","description":"ID is the unique id of resource's version","example":1,"format":"int64"},"minPipelinesVersion":{"type":"string","description":"Minimum pipelines version the resource's version is compatible with","example":"0.12.1"},"rawURL":{"type":"string","description":"Raw URL of resource's yaml file of the version","example":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","format":"uri"},"resource":{"$ref":"#/definitions/ResourceDataResponseBodyInfo"},"updatedAt":{"type":"string","description":"Timestamp when version was last updated","example":"2020-01-01 12:00:00 +0000 UTC","format":"date-time"},"version":{"type":"string","description":"Version of resource","example":"0.1"},"webURL":{"type":"string","description":"Web URL of resource's yaml file of the version","example":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml","format":"uri"}},"description":"The Version result type describes resource's version information.","example":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","resource":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]},"updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"required":["id","version","displayName","description","minPipelinesVersion","rawURL","webURL","updatedAt","resource"]},"ResourceVersionDataResponseBodyMin":{"title":"Mediatype identifier: application/vnd.hub.resource.version.data; view=default","type":"object","properties":{"id":{"type":"integer","description":"ID is the unique id of resource's version","example":1,"format":"int64"},"rawURL":{"type":"string","description":"Raw URL of resource's yaml file of the version","example":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","format":"uri"},"version":{"type":"string","description":"Version of resource","example":"0.1"},"webURL":{"type":"string","description":"Web URL of resource's yaml file of the version","example":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml","format":"uri"}},"description":"The Version result type describes resource's version information. (default view)","example":{"id":1,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"required":["id","version","rawURL","webURL"]},"ResourceVersionDataResponseBodyTiny":{"title":"Mediatype identifier: application/vnd.hub.resource.version.data; view=default","type":"object","properties":{"id":{"type":"integer","description":"ID is the unique id of resource's version","example":1,"format":"int64"},"version":{"type":"string","description":"Version of resource","example":"0.1"}},"description":"The Version result type describes resource's version information. (default view)","example":{"id":1,"version":"0.1"},"required":["id","version"]},"ResourceVersionDataResponseBodyWithoutResource":{"title":"Mediatype identifier: application/vnd.hub.resource.version.data; view=default","type":"object","properties":{"description":{"type":"string","description":"Description of version","example":"Buildah task builds source into a container image and then pushes it to a container registry."},"displayName":{"type":"string","description":"Display name of version","example":"Buildah"},"id":{"type":"integer","description":"ID is the unique id of resource's version","example":1,"format":"int64"},"minPipelinesVersion":{"type":"string","description":"Minimum pipelines version the resource's version is compatible with","example":"0.12.1"},"rawURL":{"type":"string","description":"Raw URL of resource's yaml file of the version","example":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","format":"uri"},"updatedAt":{"type":"string","description":"Timestamp when version was last updated","example":"2020-01-01 12:00:00 +0000 UTC","format":"date-time"},"version":{"type":"string","description":"Version of resource","example":"0.1"},"webURL":{"type":"string","description":"Web URL of resource's yaml file of the version","example":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml","format":"uri"}},"description":"The Version result type describes resource's version information. (default view)","example":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"required":["id","version","displayName","description","minPipelinesVersion","rawURL","webURL","updatedAt"]},"ResourceVersionsByIDInternalErrorResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Internal Server Error (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"ResourceVersionsByIDNotFoundResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Resource Not Found Error (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"ResourceVersionsByIDResponseBody":{"title":"Mediatype identifier: application/vnd.hub.resource.versions; view=default","type":"object","properties":{"data":{"$ref":"#/definitions/VersionsResponseBody"}},"description":"VersionsByIDResponseBody result type (default view)","example":{"data":{"latest":{"id":2,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml","version":"0.2","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml"},"versions":[{"id":1,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},{"id":2,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml","version":"0.2","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml"}]}},"required":["data"]},"StatusStatusResponseBody":{"title":"StatusStatusResponseBody","type":"object","properties":{"services":{"type":"array","items":{"$ref":"#/definitions/HubServiceResponseBody"},"description":"List of services and their status","example":[{"error":"unable to reach db","name":"api","status":"ok"},{"error":"unable to reach db","name":"api","status":"ok"}]}},"example":{"services":[{"error":"unable to reach db","name":"api","status":"ok"},{"error":"unable to reach db","name":"api","status":"ok"},{"error":"unable to reach db","name":"api","status":"ok"}]}},"TagResponseBody":{"title":"TagResponseBody","type":"object","properties":{"id":{"type":"integer","description":"ID is the unique id of tag","example":1,"format":"int64"},"name":{"type":"string","description":"Name of tag","example":"image-build"}},"example":{"id":1,"name":"image-build"},"required":["id","name"]},"TokenResponseBody":{"title":"TokenResponseBody","type":"object","properties":{"expiresAt":{"type":"integer","description":"Time the token will expires at","example":0,"format":"int64"},"refreshInterval":{"type":"string","description":"Duration the token will Expire In","example":"1h30m"},"token":{"type":"string","description":"JWT","example":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"}},"description":"Token includes the JWT, Expire Duration \u0026 Time","example":{"expiresAt":0,"refreshInterval":"1h30m","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"},"required":["token","refreshInterval","expiresAt"]},"VersionsResponseBody":{"title":"Mediatype identifier: application/vnd.hub.versions; view=default","type":"object","properties":{"latest":{"$ref":"#/definitions/ResourceVersionDataResponseBodyMin"},"versions":{"type":"array","items":{"$ref":"#/definitions/ResourceVersionDataResponseBodyMin"},"description":"List of all versions of resource","example":[{"id":1,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},{"id":2,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml","version":"0.2","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml"}]}},"description":"The Versions type describes response for versions by resource id API.","example":{"latest":{"id":2,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml","version":"0.2","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml"},"versions":[{"id":1,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},{"id":2,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml","version":"0.2","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml"}]},"required":["latest","versions"]}},"securityDefinitions":{"jwt_header_Authorization":{"type":"apiKey","description":"Secures endpoint by requiring a valid JWT retrieved via the /auth/login endpoint.\n\n**Security Scopes**:\n * `rating:read`: Read-only access to rating\n * `rating:write`: Read and write access to rating\n * `agent:create`: Access to create or update an agent\n * `catalog:refresh`: Access to refresh catalog\n * `config:refresh`: Access to refresh config file","name":"Authorization","in":"header"}}} \ No newline at end of file +{"swagger":"2.0","info":{"title":"Tekton Hub","description":"HTTP services for managing Tekton Hub","version":"1.0"},"host":"api.hub.tekton.dev","consumes":["application/json","application/xml","application/gob"],"produces":["application/json","application/xml","application/gob"],"paths":{"/":{"get":{"tags":["status"],"summary":"Status status","description":"Return status of the services","operationId":"status#Status","responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/StatusStatusResponseBody"}}},"schemes":["http"]}},"/auth/login":{"post":{"tags":["auth"],"summary":"Authenticate auth","description":"Authenticates users against GitHub OAuth","operationId":"auth#Authenticate","parameters":[{"name":"code","in":"query","description":"OAuth Authorization code of User","required":true,"type":"string"}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/AuthAuthenticateResponseBody","required":["data"]}},"400":{"description":"Bad Request response.","schema":{"$ref":"#/definitions/AuthAuthenticateInvalidCodeResponseBody"}},"401":{"description":"Unauthorized response.","schema":{"$ref":"#/definitions/AuthAuthenticateInvalidTokenResponseBody"}},"403":{"description":"Forbidden response.","schema":{"$ref":"#/definitions/AuthAuthenticateInvalidScopesResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/AuthAuthenticateInternalErrorResponseBody"}}},"schemes":["http"]}},"/catalog/refresh":{"post":{"tags":["catalog"],"summary":"Refresh catalog","description":"Refreshes Tekton Catalog\n\n**Required security scopes for jwt**:\n * `catalog:refresh`","operationId":"catalog#Refresh","parameters":[{"name":"Authorization","in":"header","description":"JWT","required":true,"type":"string"}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/CatalogRefreshResponseBody"}},"404":{"description":"Not Found response.","schema":{"$ref":"#/definitions/CatalogRefreshNotFoundResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/CatalogRefreshInternalErrorResponseBody"}}},"schemes":["http"],"security":[{"jwt_header_Authorization":[]}]}},"/categories":{"get":{"tags":["category"],"summary":"list category","description":"List all categories along with their tags sorted by name","operationId":"category#list","responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/CategoryListResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/CategoryListInternalErrorResponseBody"}}},"schemes":["http"]}},"/query":{"get":{"tags":["resource"],"summary":"Query resource","description":"Find resources by a combination of name, kind and tags","operationId":"resource#Query","parameters":[{"name":"name","in":"query","description":"Name of resource","required":false,"type":"string","default":""},{"name":"kinds","in":"query","description":"Kinds of resource to filter by","required":false,"type":"array","items":{"type":"string"},"collectionFormat":"multi"},{"name":"tags","in":"query","description":"Tags associated with a resource to filter by","required":false,"type":"array","items":{"type":"string"},"collectionFormat":"multi"},{"name":"limit","in":"query","description":"Maximum number of resources to be returned","required":false,"type":"integer","default":1000},{"name":"match","in":"query","description":"Strategy used to find matching resources","required":false,"type":"string","default":"contains","enum":["exact","contains"]}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/ResourceQueryResponseBody"}},"400":{"description":"Bad Request response.","schema":{"$ref":"#/definitions/ResourceQueryInvalidKindResponseBody"}},"404":{"description":"Not Found response.","schema":{"$ref":"#/definitions/ResourceQueryNotFoundResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/ResourceQueryInternalErrorResponseBody"}}},"schemes":["http"]}},"/resource/version/{versionID}":{"get":{"tags":["resource"],"summary":"ByVersionId resource","description":"Find a resource using its version's id","operationId":"resource#ByVersionId","parameters":[{"name":"versionID","in":"path","description":"Version ID of a resource's version","required":true,"type":"integer"}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/ResourceByVersionIDResponseBody"}},"404":{"description":"Not Found response.","schema":{"$ref":"#/definitions/ResourceByVersionIDNotFoundResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/ResourceByVersionIDInternalErrorResponseBody"}}},"schemes":["http"]}},"/resource/{catalog}/{kind}/{name}":{"get":{"tags":["resource"],"summary":"ByCatalogKindName resource","description":"Find resources using name of catalog, resource name and kind of resource","operationId":"resource#ByCatalogKindName","parameters":[{"name":"catalog","in":"path","description":"name of catalog","required":true,"type":"string"},{"name":"kind","in":"path","description":"kind of resource","required":true,"type":"string","enum":["task","pipeline"]},{"name":"name","in":"path","description":"Name of resource","required":true,"type":"string"}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/ResourceByCatalogKindNameResponseBody"}},"404":{"description":"Not Found response.","schema":{"$ref":"#/definitions/ResourceByCatalogKindNameNotFoundResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/ResourceByCatalogKindNameInternalErrorResponseBody"}}},"schemes":["http"]}},"/resource/{catalog}/{kind}/{name}/{version}":{"get":{"tags":["resource"],"summary":"ByCatalogKindNameVersion resource","description":"Find resource using name of catalog \u0026 name, kind and version of resource","operationId":"resource#ByCatalogKindNameVersion","parameters":[{"name":"catalog","in":"path","description":"name of catalog","required":true,"type":"string"},{"name":"kind","in":"path","description":"kind of resource","required":true,"type":"string","enum":["task","pipeline"]},{"name":"name","in":"path","description":"name of resource","required":true,"type":"string"},{"name":"version","in":"path","description":"version of resource","required":true,"type":"string"}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/ResourceByCatalogKindNameVersionResponseBody"}},"404":{"description":"Not Found response.","schema":{"$ref":"#/definitions/ResourceByCatalogKindNameVersionNotFoundResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/ResourceByCatalogKindNameVersionInternalErrorResponseBody"}}},"schemes":["http"]}},"/resource/{id}":{"get":{"tags":["resource"],"summary":"ById resource","description":"Find a resource using it's id","operationId":"resource#ById","parameters":[{"name":"id","in":"path","description":"ID of a resource","required":true,"type":"integer"}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/ResourceByIDResponseBody"}},"404":{"description":"Not Found response.","schema":{"$ref":"#/definitions/ResourceByIDNotFoundResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/ResourceByIDInternalErrorResponseBody"}}},"schemes":["http"]}},"/resource/{id}/rating":{"get":{"tags":["rating"],"summary":"Get rating","description":"Find user's rating for a resource\n\n**Required security scopes for jwt**:\n * `rating:read`","operationId":"rating#Get","parameters":[{"name":"id","in":"path","description":"ID of a resource","required":true,"type":"integer"},{"name":"Authorization","in":"header","description":"JWT","required":true,"type":"string"}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/RatingGetResponseBody","required":["rating"]}},"401":{"description":"Unauthorized response.","schema":{"$ref":"#/definitions/RatingGetInvalidTokenResponseBody"}},"403":{"description":"Forbidden response.","schema":{"$ref":"#/definitions/RatingGetInvalidScopesResponseBody"}},"404":{"description":"Not Found response.","schema":{"$ref":"#/definitions/RatingGetNotFoundResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/RatingGetInternalErrorResponseBody"}}},"schemes":["http"],"security":[{"jwt_header_Authorization":[]}]},"put":{"tags":["rating"],"summary":"Update rating","description":"Update user's rating for a resource\n\n**Required security scopes for jwt**:\n * `rating:write`","operationId":"rating#Update","parameters":[{"name":"id","in":"path","description":"ID of a resource","required":true,"type":"integer"},{"name":"Authorization","in":"header","description":"JWT","required":true,"type":"string"},{"name":"UpdateRequestBody","in":"body","required":true,"schema":{"$ref":"#/definitions/RatingUpdateRequestBody","required":["rating"]}}],"responses":{"200":{"description":"OK response."},"401":{"description":"Unauthorized response.","schema":{"$ref":"#/definitions/RatingUpdateInvalidTokenResponseBody"}},"403":{"description":"Forbidden response.","schema":{"$ref":"#/definitions/RatingUpdateInvalidScopesResponseBody"}},"404":{"description":"Not Found response.","schema":{"$ref":"#/definitions/RatingUpdateNotFoundResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/RatingUpdateInternalErrorResponseBody"}}},"schemes":["http"],"security":[{"jwt_header_Authorization":[]}]}},"/resource/{id}/versions":{"get":{"tags":["resource"],"summary":"VersionsByID resource","description":"Find all versions of a resource by its id","operationId":"resource#VersionsByID","parameters":[{"name":"id","in":"path","description":"ID of a resource","required":true,"type":"integer"}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/ResourceVersionsByIDResponseBody"}},"404":{"description":"Not Found response.","schema":{"$ref":"#/definitions/ResourceVersionsByIDNotFoundResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/ResourceVersionsByIDInternalErrorResponseBody"}}},"schemes":["http"]}},"/resources":{"get":{"tags":["resource"],"summary":"List resource","description":"List all resources sorted by rating and name","operationId":"resource#List","parameters":[{"name":"limit","in":"query","description":"Maximum number of resources to be returned","required":false,"type":"integer","default":1000}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/ResourceListResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/ResourceListInternalErrorResponseBody"}}},"schemes":["http"]}},"/schema/swagger.json":{"get":{"tags":["swagger"],"summary":"Download gen/http/openapi3.yaml","description":"JSON document containing the API swagger definition","operationId":"swagger#/schema/swagger.json","responses":{"200":{"description":"File downloaded","schema":{"type":"file"}}},"schemes":["http"]}},"/system/config/refresh":{"post":{"tags":["admin"],"summary":"RefreshConfig admin","description":"Refresh the changes in config file\n\n**Required security scopes for jwt**:\n * `config:refresh`","operationId":"admin#RefreshConfig","parameters":[{"name":"Authorization","in":"header","description":"User JWT","required":true,"type":"string"},{"name":"RefreshConfigRequestBody","in":"body","required":true,"schema":{"$ref":"#/definitions/AdminRefreshConfigRequestBody","required":["force"]}}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/AdminRefreshConfigResponseBody","required":["checksum"]}},"401":{"description":"Unauthorized response.","schema":{"$ref":"#/definitions/AdminRefreshConfigInvalidTokenResponseBody"}},"403":{"description":"Forbidden response.","schema":{"$ref":"#/definitions/AdminRefreshConfigInvalidScopesResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/AdminRefreshConfigInternalErrorResponseBody"}}},"schemes":["http"],"security":[{"jwt_header_Authorization":[]}]}},"/system/user/agent":{"put":{"tags":["admin"],"summary":"UpdateAgent admin","description":"Create or Update an agent user with required scopes\n\n**Required security scopes for jwt**:\n * `agent:create`","operationId":"admin#UpdateAgent","parameters":[{"name":"Authorization","in":"header","description":"User JWT","required":true,"type":"string"},{"name":"UpdateAgentRequestBody","in":"body","required":true,"schema":{"$ref":"#/definitions/AdminUpdateAgentRequestBody","required":["name","scopes"]}}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/AdminUpdateAgentResponseBody","required":["token"]}},"400":{"description":"Bad Request response.","schema":{"$ref":"#/definitions/AdminUpdateAgentInvalidPayloadResponseBody"}},"401":{"description":"Unauthorized response.","schema":{"$ref":"#/definitions/AdminUpdateAgentInvalidTokenResponseBody"}},"403":{"description":"Forbidden response.","schema":{"$ref":"#/definitions/AdminUpdateAgentInvalidScopesResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/AdminUpdateAgentInternalErrorResponseBody"}}},"schemes":["http"],"security":[{"jwt_header_Authorization":[]}]}},"/v1":{"get":{"tags":["status"],"summary":"Status status","description":"Return status of the services","operationId":"status#Status#1","responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/StatusStatusResponseBody"}}},"schemes":["http"]}}},"definitions":{"AdminRefreshConfigInternalErrorResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Internal server error (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"AdminRefreshConfigInvalidScopesResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Invalid Token scopes (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"AdminRefreshConfigInvalidTokenResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Invalid User token (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"AdminRefreshConfigRequestBody":{"title":"AdminRefreshConfigRequestBody","type":"object","properties":{"force":{"type":"boolean","description":"Force Refresh the config file","example":false}},"example":{"force":true},"required":["force"]},"AdminRefreshConfigResponseBody":{"title":"AdminRefreshConfigResponseBody","type":"object","properties":{"checksum":{"type":"string","description":"Config file checksum","example":"Eveniet nihil et beatae ex voluptas voluptas."}},"example":{"checksum":"Non molestiae illo aut numquam."},"required":["checksum"]},"AdminUpdateAgentInternalErrorResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Internal server error (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"AdminUpdateAgentInvalidPayloadResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Invalid request body (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"AdminUpdateAgentInvalidScopesResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Invalid Token scopes (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"AdminUpdateAgentInvalidTokenResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Invalid User token (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"AdminUpdateAgentRequestBody":{"title":"AdminUpdateAgentRequestBody","type":"object","properties":{"name":{"type":"string","description":"Name of Agent","example":"Sed voluptatem nulla laborum ut."},"scopes":{"type":"array","items":{"type":"string","example":"Architecto rerum id quia."},"description":"Scopes required for Agent","example":["Eaque necessitatibus magni quia.","Perferendis suscipit voluptatem est.","Rerum autem dolores at."]}},"example":{"name":"Aliquam voluptates illo.","scopes":["Et ut pariatur similique ullam laudantium nostrum.","Totam magni reprehenderit maxime et velit.","Dolores dolor esse officia velit aliquid praesentium.","Sed optio ab beatae est."]},"required":["name","scopes"]},"AdminUpdateAgentResponseBody":{"title":"AdminUpdateAgentResponseBody","type":"object","properties":{"token":{"type":"string","description":"Agent JWT","example":"Quis nostrum et ab placeat facere."}},"example":{"token":"Ipsum iusto et dolor vitae voluptatem."},"required":["token"]},"AuthAuthenticateInternalErrorResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Internal Server Error (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"AuthAuthenticateInvalidCodeResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Invalid Authorization code (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"AuthAuthenticateInvalidScopesResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Invalid User scope (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"AuthAuthenticateInvalidTokenResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Invalid User token (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"AuthAuthenticateResponseBody":{"title":"AuthAuthenticateResponseBody","type":"object","properties":{"data":{"$ref":"#/definitions/AuthTokensResponseBody"}},"example":{"data":{"access":{"expiresAt":0,"refreshInterval":"1h30m","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"},"refresh":{"expiresAt":0,"refreshInterval":"1h30m","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"}}},"required":["data"]},"AuthTokensResponseBody":{"title":"AuthTokensResponseBody","type":"object","properties":{"access":{"$ref":"#/definitions/TokenResponseBody"},"refresh":{"$ref":"#/definitions/TokenResponseBody"}},"description":"Auth tokens have access and refresh token for user","example":{"access":{"expiresAt":0,"refreshInterval":"1h30m","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"},"refresh":{"expiresAt":0,"refreshInterval":"1h30m","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"}}},"CatalogRefreshInternalErrorResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Internal Server Error (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"CatalogRefreshNotFoundResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Resource Not Found Error (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"CatalogRefreshResponseBody":{"title":"Mediatype identifier: application/vnd.hub.job; view=default","type":"object","properties":{"id":{"type":"integer","description":"id of the job","example":8951834590360407852,"format":"int64"},"status":{"type":"string","description":"status of the job","example":"Perspiciatis ut ut."}},"description":"RefreshResponseBody result type (default view)","example":{"id":10863881996075796435,"status":"Sed ipsa velit dolorem."},"required":["id","status"]},"CatalogResponseBody":{"title":"CatalogResponseBody","type":"object","properties":{"id":{"type":"integer","description":"ID is the unique id of the catalog","example":1,"format":"int64"},"name":{"type":"string","description":"Name of catalog","example":"Tekton"},"type":{"type":"string","description":"Type of catalog","example":"community","enum":["official","community"]}},"example":{"id":1,"name":"Tekton","type":"community"},"required":["id","name","type"]},"CategoryListInternalErrorResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Internal Server Error (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"CategoryListResponseBody":{"title":"CategoryListResponseBody","type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/definitions/CategoryResponseBody"},"example":[{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]},{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]}]}},"example":{"data":[{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]},{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]},{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]},{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]}]}},"CategoryResponseBody":{"title":"CategoryResponseBody","type":"object","properties":{"id":{"type":"integer","description":"ID is the unique id of the category","example":1,"format":"int64"},"name":{"type":"string","description":"Name of category","example":"Image Builder"},"tags":{"type":"array","items":{"$ref":"#/definitions/TagResponseBody"},"description":"List of tags associated with the category","example":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]}},"example":{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]},"required":["id","name","tags"]},"HubServiceResponseBody":{"title":"HubServiceResponseBody","type":"object","properties":{"error":{"type":"string","description":"Details of the error if any","example":"unable to reach db"},"name":{"type":"string","description":"Name of the service","example":"api"},"status":{"type":"string","description":"Status of the service","example":"ok","enum":["ok","error"]}},"description":"Describes the services and their status","example":{"error":"unable to reach db","name":"api","status":"ok"},"required":["name","status"]},"RatingGetInternalErrorResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Internal server error (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"RatingGetInvalidScopesResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Invalid User scope (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"RatingGetInvalidTokenResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Invalid User token (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"RatingGetNotFoundResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Resource Not Found Error (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"RatingGetResponseBody":{"title":"RatingGetResponseBody","type":"object","properties":{"rating":{"type":"integer","description":"User rating for resource","example":4,"format":"int64"}},"example":{"rating":4},"required":["rating"]},"RatingUpdateInternalErrorResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Internal server error (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"RatingUpdateInvalidScopesResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Invalid User scope (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"RatingUpdateInvalidTokenResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Invalid User token (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"RatingUpdateNotFoundResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Resource Not Found Error (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"RatingUpdateRequestBody":{"title":"RatingUpdateRequestBody","type":"object","properties":{"rating":{"type":"integer","description":"User rating for resource","example":0,"minimum":0,"maximum":5}},"example":{"rating":1},"required":["rating"]},"ResourceByCatalogKindNameInternalErrorResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Internal Server Error (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"ResourceByCatalogKindNameNotFoundResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Resource Not Found Error (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"ResourceByCatalogKindNameResponseBody":{"title":"Mediatype identifier: application/vnd.hub.resource; view=default","type":"object","properties":{"data":{"$ref":"#/definitions/ResourceDataResponseBody"}},"description":"ByCatalogKindNameResponseBody result type (default view)","example":{"data":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]}},"required":["data"]},"ResourceByCatalogKindNameVersionInternalErrorResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Internal Server Error (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"ResourceByCatalogKindNameVersionNotFoundResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Resource Not Found Error (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"ResourceByCatalogKindNameVersionResponseBody":{"title":"Mediatype identifier: application/vnd.hub.resource.version; view=default","type":"object","properties":{"data":{"$ref":"#/definitions/ResourceVersionDataResponseBody"}},"description":"ByCatalogKindNameVersionResponseBody result type (default view)","example":{"data":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","resource":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]},"updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"}},"required":["data"]},"ResourceByIDInternalErrorResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Internal Server Error (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"ResourceByIDNotFoundResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Resource Not Found Error (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"ResourceByIDResponseBody":{"title":"Mediatype identifier: application/vnd.hub.resource; view=default","type":"object","properties":{"data":{"$ref":"#/definitions/ResourceDataResponseBody"}},"description":"ByIdResponseBody result type (default view)","example":{"data":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]}},"required":["data"]},"ResourceByVersionIDInternalErrorResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Internal Server Error (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"ResourceByVersionIDNotFoundResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Resource Not Found Error (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"ResourceByVersionIDResponseBody":{"title":"Mediatype identifier: application/vnd.hub.resource.version; view=default","type":"object","properties":{"data":{"$ref":"#/definitions/ResourceVersionDataResponseBody"}},"description":"ByVersionIdResponseBody result type (default view)","example":{"data":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","resource":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]},"updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"}},"required":["data"]},"ResourceDataResponseBody":{"title":"Mediatype identifier: application/vnd.hub.resource.data; view=default","type":"object","properties":{"catalog":{"$ref":"#/definitions/CatalogResponseBody"},"id":{"type":"integer","description":"ID is the unique id of the resource","example":1,"format":"int64"},"kind":{"type":"string","description":"Kind of resource","example":"task"},"latestVersion":{"$ref":"#/definitions/ResourceVersionDataResponseBodyWithoutResource"},"name":{"type":"string","description":"Name of resource","example":"buildah"},"rating":{"type":"number","description":"Rating of resource","example":4.3,"format":"double"},"tags":{"type":"array","items":{"$ref":"#/definitions/TagResponseBody"},"description":"Tags related to resource","example":[{"id":1,"name":"image-build"}]},"versions":{"type":"array","items":{"$ref":"#/definitions/ResourceVersionDataResponseBodyTiny"},"description":"List of all versions of a resource","example":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]}},"description":"The resource type describes resource information.","example":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},"required":["id","name","catalog","kind","latestVersion","tags","rating","versions"]},"ResourceDataResponseBodyInfo":{"title":"Mediatype identifier: application/vnd.hub.resource.data; view=default","type":"object","properties":{"catalog":{"$ref":"#/definitions/CatalogResponseBody"},"id":{"type":"integer","description":"ID is the unique id of the resource","example":1,"format":"int64"},"kind":{"type":"string","description":"Kind of resource","example":"task"},"name":{"type":"string","description":"Name of resource","example":"buildah"},"rating":{"type":"number","description":"Rating of resource","example":4.3,"format":"double"},"tags":{"type":"array","items":{"$ref":"#/definitions/TagResponseBody"},"description":"Tags related to resource","example":[{"id":1,"name":"image-build"}]}},"description":"The resource type describes resource information. (default view)","example":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]},"required":["id","name","catalog","kind","tags","rating"]},"ResourceDataResponseBodyWithoutVersion":{"title":"Mediatype identifier: application/vnd.hub.resource.data; view=default","type":"object","properties":{"catalog":{"$ref":"#/definitions/CatalogResponseBody"},"id":{"type":"integer","description":"ID is the unique id of the resource","example":1,"format":"int64"},"kind":{"type":"string","description":"Kind of resource","example":"task"},"latestVersion":{"$ref":"#/definitions/ResourceVersionDataResponseBodyWithoutResource"},"name":{"type":"string","description":"Name of resource","example":"buildah"},"rating":{"type":"number","description":"Rating of resource","example":4.3,"format":"double"},"tags":{"type":"array","items":{"$ref":"#/definitions/TagResponseBody"},"description":"Tags related to resource","example":[{"id":1,"name":"image-build"}]}},"description":"The resource type describes resource information. (withoutVersion view) (default view)","example":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]},"required":["id","name","catalog","kind","latestVersion","tags","rating"]},"ResourceDataResponseBodyWithoutVersionCollection":{"title":"Mediatype identifier: application/vnd.hub.resource.data; type=collection; view=default","type":"array","items":{"$ref":"#/definitions/ResourceDataResponseBodyWithoutVersion"},"description":"ResourceDataResponseBodyWithoutVersionCollection is the result type for an array of ResourceDataResponseBodyWithoutVersion (default view)","example":[{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]}]},"ResourceListInternalErrorResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Internal Server Error (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"ResourceListResponseBody":{"title":"Mediatype identifier: application/vnd.hub.resources; view=default","type":"object","properties":{"data":{"$ref":"#/definitions/ResourceDataResponseBodyWithoutVersionCollection"}},"description":"ListResponseBody result type (default view)","example":{"data":[{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]}]},"required":["data"]},"ResourceQueryInternalErrorResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Internal Server Error (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"ResourceQueryInvalidKindResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Invalid Resource Kind (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"ResourceQueryNotFoundResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Resource Not Found Error (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"ResourceQueryResponseBody":{"title":"Mediatype identifier: application/vnd.hub.resources; view=default","type":"object","properties":{"data":{"$ref":"#/definitions/ResourceDataResponseBodyWithoutVersionCollection"}},"description":"QueryResponseBody result type (default view)","example":{"data":[{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]}]},"required":["data"]},"ResourceVersionDataResponseBody":{"title":"Mediatype identifier: application/vnd.hub.resource.version.data; view=default","type":"object","properties":{"description":{"type":"string","description":"Description of version","example":"Buildah task builds source into a container image and then pushes it to a container registry."},"displayName":{"type":"string","description":"Display name of version","example":"Buildah"},"id":{"type":"integer","description":"ID is the unique id of resource's version","example":1,"format":"int64"},"minPipelinesVersion":{"type":"string","description":"Minimum pipelines version the resource's version is compatible with","example":"0.12.1"},"rawURL":{"type":"string","description":"Raw URL of resource's yaml file of the version","example":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","format":"uri"},"resource":{"$ref":"#/definitions/ResourceDataResponseBodyInfo"},"updatedAt":{"type":"string","description":"Timestamp when version was last updated","example":"2020-01-01 12:00:00 +0000 UTC","format":"date-time"},"version":{"type":"string","description":"Version of resource","example":"0.1"},"webURL":{"type":"string","description":"Web URL of resource's yaml file of the version","example":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml","format":"uri"}},"description":"The Version result type describes resource's version information.","example":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","resource":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]},"updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"required":["id","version","displayName","description","minPipelinesVersion","rawURL","webURL","updatedAt","resource"]},"ResourceVersionDataResponseBodyMin":{"title":"Mediatype identifier: application/vnd.hub.resource.version.data; view=default","type":"object","properties":{"id":{"type":"integer","description":"ID is the unique id of resource's version","example":1,"format":"int64"},"rawURL":{"type":"string","description":"Raw URL of resource's yaml file of the version","example":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","format":"uri"},"version":{"type":"string","description":"Version of resource","example":"0.1"},"webURL":{"type":"string","description":"Web URL of resource's yaml file of the version","example":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml","format":"uri"}},"description":"The Version result type describes resource's version information. (default view)","example":{"id":1,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"required":["id","version","rawURL","webURL"]},"ResourceVersionDataResponseBodyTiny":{"title":"Mediatype identifier: application/vnd.hub.resource.version.data; view=default","type":"object","properties":{"id":{"type":"integer","description":"ID is the unique id of resource's version","example":1,"format":"int64"},"version":{"type":"string","description":"Version of resource","example":"0.1"}},"description":"The Version result type describes resource's version information. (default view)","example":{"id":1,"version":"0.1"},"required":["id","version"]},"ResourceVersionDataResponseBodyWithoutResource":{"title":"Mediatype identifier: application/vnd.hub.resource.version.data; view=default","type":"object","properties":{"description":{"type":"string","description":"Description of version","example":"Buildah task builds source into a container image and then pushes it to a container registry."},"displayName":{"type":"string","description":"Display name of version","example":"Buildah"},"id":{"type":"integer","description":"ID is the unique id of resource's version","example":1,"format":"int64"},"minPipelinesVersion":{"type":"string","description":"Minimum pipelines version the resource's version is compatible with","example":"0.12.1"},"rawURL":{"type":"string","description":"Raw URL of resource's yaml file of the version","example":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","format":"uri"},"updatedAt":{"type":"string","description":"Timestamp when version was last updated","example":"2020-01-01 12:00:00 +0000 UTC","format":"date-time"},"version":{"type":"string","description":"Version of resource","example":"0.1"},"webURL":{"type":"string","description":"Web URL of resource's yaml file of the version","example":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml","format":"uri"}},"description":"The Version result type describes resource's version information. (default view)","example":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"required":["id","version","displayName","description","minPipelinesVersion","rawURL","webURL","updatedAt"]},"ResourceVersionsByIDInternalErrorResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Internal Server Error (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"ResourceVersionsByIDNotFoundResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Resource Not Found Error (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"ResourceVersionsByIDResponseBody":{"title":"Mediatype identifier: application/vnd.hub.resource.versions; view=default","type":"object","properties":{"data":{"$ref":"#/definitions/VersionsResponseBody"}},"description":"VersionsByIDResponseBody result type (default view)","example":{"data":{"latest":{"id":2,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml","version":"0.2","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml"},"versions":[{"id":1,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},{"id":2,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml","version":"0.2","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml"}]}},"required":["data"]},"StatusStatusResponseBody":{"title":"StatusStatusResponseBody","type":"object","properties":{"services":{"type":"array","items":{"$ref":"#/definitions/HubServiceResponseBody"},"description":"List of services and their status","example":[{"error":"unable to reach db","name":"api","status":"ok"},{"error":"unable to reach db","name":"api","status":"ok"},{"error":"unable to reach db","name":"api","status":"ok"}]}},"example":{"services":[{"error":"unable to reach db","name":"api","status":"ok"},{"error":"unable to reach db","name":"api","status":"ok"}]}},"TagResponseBody":{"title":"TagResponseBody","type":"object","properties":{"id":{"type":"integer","description":"ID is the unique id of tag","example":1,"format":"int64"},"name":{"type":"string","description":"Name of tag","example":"image-build"}},"example":{"id":1,"name":"image-build"},"required":["id","name"]},"TokenResponseBody":{"title":"TokenResponseBody","type":"object","properties":{"expiresAt":{"type":"integer","description":"Time the token will expires at","example":0,"format":"int64"},"refreshInterval":{"type":"string","description":"Duration the token will Expire In","example":"1h30m"},"token":{"type":"string","description":"JWT","example":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"}},"description":"Token includes the JWT, Expire Duration \u0026 Time","example":{"expiresAt":0,"refreshInterval":"1h30m","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"},"required":["token","refreshInterval","expiresAt"]},"VersionsResponseBody":{"title":"Mediatype identifier: application/vnd.hub.versions; view=default","type":"object","properties":{"latest":{"$ref":"#/definitions/ResourceVersionDataResponseBodyMin"},"versions":{"type":"array","items":{"$ref":"#/definitions/ResourceVersionDataResponseBodyMin"},"description":"List of all versions of resource","example":[{"id":1,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},{"id":2,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml","version":"0.2","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml"}]}},"description":"The Versions type describes response for versions by resource id API.","example":{"latest":{"id":2,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml","version":"0.2","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml"},"versions":[{"id":1,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},{"id":2,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml","version":"0.2","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml"}]},"required":["latest","versions"]}},"securityDefinitions":{"jwt_header_Authorization":{"type":"apiKey","description":"Secures endpoint by requiring a valid JWT retrieved via the /auth/login endpoint.\n\n**Security Scopes**:\n * `rating:read`: Read-only access to rating\n * `rating:write`: Read and write access to rating\n * `agent:create`: Access to create or update an agent\n * `catalog:refresh`: Access to refresh catalog\n * `config:refresh`: Access to refresh config file","name":"Authorization","in":"header"}}} \ No newline at end of file diff --git a/api/gen/http/openapi.yaml b/api/gen/http/openapi.yaml index 378664a29c..a26340d757 100644 --- a/api/gen/http/openapi.yaml +++ b/api/gen/http/openapi.yaml @@ -186,7 +186,8 @@ paths: tags: - resource summary: ByCatalogKindName resource - description: Find resources using name of catalog, resource name and kind of resource + description: Find resources using name of catalog, resource name and kind of + resource operationId: resource#ByCatalogKindName parameters: - name: catalog @@ -227,7 +228,8 @@ paths: tags: - resource summary: ByCatalogKindNameVersion resource - description: Find resource using name of catalog & name, kind and version of resource + description: Find resource using name of catalog & name, kind and version of + resource operationId: resource#ByCatalogKindNameVersion parameters: - name: catalog @@ -590,282 +592,18 @@ paths: - http security: - jwt_header_Authorization: [] - /v1/categories: + /v1: get: tags: - - category - summary: list category - description: List all categories along with their tags sorted by name - operationId: category#list#1 - responses: - "200": - description: OK response. - schema: - $ref: '#/definitions/CategoryListResponseBody' - "500": - description: Internal Server Error response. - schema: - $ref: '#/definitions/CategoryListInternalErrorResponseBody' - schemes: - - http - /v1/query: - get: - tags: - - resource - summary: Query resource - description: Find resources by a combination of name, kind and tags - operationId: resource#Query#1 - parameters: - - name: name - in: query - description: Name of resource - required: false - type: string - default: "" - - name: kinds - in: query - description: Kinds of resource to filter by - required: false - type: array - items: - type: string - collectionFormat: multi - - name: tags - in: query - description: Tags associated with a resource to filter by - required: false - type: array - items: - type: string - collectionFormat: multi - - name: limit - in: query - description: Maximum number of resources to be returned - required: false - type: integer - default: 1000 - - name: match - in: query - description: Strategy used to find matching resources - required: false - type: string - default: contains - enum: - - exact - - contains - responses: - "200": - description: OK response. - schema: - $ref: '#/definitions/ResourceQueryResponseBody' - "400": - description: Bad Request response. - schema: - $ref: '#/definitions/ResourceQueryInvalidKindResponseBody' - "404": - description: Not Found response. - schema: - $ref: '#/definitions/ResourceQueryNotFoundResponseBody' - "500": - description: Internal Server Error response. - schema: - $ref: '#/definitions/ResourceQueryInternalErrorResponseBody' - schemes: - - http - /v1/resource/{catalog}/{kind}/{name}: - get: - tags: - - resource - summary: ByCatalogKindName resource - description: Find resources using name of catalog, resource name and kind of resource - operationId: resource#ByCatalogKindName#1 - parameters: - - name: catalog - in: path - description: name of catalog - required: true - type: string - - name: kind - in: path - description: kind of resource - required: true - type: string - enum: - - task - - pipeline - - name: name - in: path - description: Name of resource - required: true - type: string - responses: - "200": - description: OK response. - schema: - $ref: '#/definitions/ResourceByCatalogKindNameResponseBody' - "404": - description: Not Found response. - schema: - $ref: '#/definitions/ResourceByCatalogKindNameNotFoundResponseBody' - "500": - description: Internal Server Error response. - schema: - $ref: '#/definitions/ResourceByCatalogKindNameInternalErrorResponseBody' - schemes: - - http - /v1/resource/{catalog}/{kind}/{name}/{version}: - get: - tags: - - resource - summary: ByCatalogKindNameVersion resource - description: Find resource using name of catalog & name, kind and version of resource - operationId: resource#ByCatalogKindNameVersion#1 - parameters: - - name: catalog - in: path - description: name of catalog - required: true - type: string - - name: kind - in: path - description: kind of resource - required: true - type: string - enum: - - task - - pipeline - - name: name - in: path - description: name of resource - required: true - type: string - - name: version - in: path - description: version of resource - required: true - type: string - responses: - "200": - description: OK response. - schema: - $ref: '#/definitions/ResourceByCatalogKindNameVersionResponseBody' - "404": - description: Not Found response. - schema: - $ref: '#/definitions/ResourceByCatalogKindNameVersionNotFoundResponseBody' - "500": - description: Internal Server Error response. - schema: - $ref: '#/definitions/ResourceByCatalogKindNameVersionInternalErrorResponseBody' - schemes: - - http - /v1/resource/{id}: - get: - tags: - - resource - summary: ById resource - description: Find a resource using it's id - operationId: resource#ById#1 - parameters: - - name: id - in: path - description: ID of a resource - required: true - type: integer - responses: - "200": - description: OK response. - schema: - $ref: '#/definitions/ResourceByIDResponseBody' - "404": - description: Not Found response. - schema: - $ref: '#/definitions/ResourceByIDNotFoundResponseBody' - "500": - description: Internal Server Error response. - schema: - $ref: '#/definitions/ResourceByIDInternalErrorResponseBody' - schemes: - - http - /v1/resource/{id}/versions: - get: - tags: - - resource - summary: VersionsByID resource - description: Find all versions of a resource by its id - operationId: resource#VersionsByID#1 - parameters: - - name: id - in: path - description: ID of a resource - required: true - type: integer - responses: - "200": - description: OK response. - schema: - $ref: '#/definitions/ResourceVersionsByIDResponseBody' - "404": - description: Not Found response. - schema: - $ref: '#/definitions/ResourceVersionsByIDNotFoundResponseBody' - "500": - description: Internal Server Error response. - schema: - $ref: '#/definitions/ResourceVersionsByIDInternalErrorResponseBody' - schemes: - - http - /v1/resource/version/{versionID}: - get: - tags: - - resource - summary: ByVersionId resource - description: Find a resource using its version's id - operationId: resource#ByVersionId#1 - parameters: - - name: versionID - in: path - description: Version ID of a resource's version - required: true - type: integer - responses: - "200": - description: OK response. - schema: - $ref: '#/definitions/ResourceByVersionIDResponseBody' - "404": - description: Not Found response. - schema: - $ref: '#/definitions/ResourceByVersionIDNotFoundResponseBody' - "500": - description: Internal Server Error response. - schema: - $ref: '#/definitions/ResourceByVersionIDInternalErrorResponseBody' - schemes: - - http - /v1/resources: - get: - tags: - - resource - summary: List resource - description: List all resources sorted by rating and name - operationId: resource#List#1 - parameters: - - name: limit - in: query - description: Maximum number of resources to be returned - required: false - type: integer - default: 1000 + - status + summary: Status status + description: Return status of the services + operationId: status#Status#1 responses: "200": description: OK response. schema: - $ref: '#/definitions/ResourceListResponseBody' - "500": - description: Internal Server Error response. - schema: - $ref: '#/definitions/ResourceListInternalErrorResponseBody' + $ref: '#/definitions/StatusStatusResponseBody' schemes: - http definitions: @@ -876,14 +614,16 @@ definitions: fault: type: boolean description: Is the error a server-side fault? - example: false + example: true id: type: string - description: ID is a unique identifier for this particular occurrence of the problem. + description: ID is a unique identifier for this particular occurrence of the + problem. example: 123abc message: type: string - description: Message is a human-readable explanation specific to this occurrence of the problem. + description: Message is a human-readable explanation specific to this occurrence + of the problem. example: parameter 'p' must be an integer name: type: string @@ -896,14 +636,14 @@ definitions: timeout: type: boolean description: Is the error a timeout? - example: true + example: false description: Internal server error (default view) example: fault: true id: 123abc message: parameter 'p' must be an integer name: bad_request - temporary: true + temporary: false timeout: true required: - name @@ -919,14 +659,16 @@ definitions: fault: type: boolean description: Is the error a server-side fault? - example: true + example: false id: type: string - description: ID is a unique identifier for this particular occurrence of the problem. + description: ID is a unique identifier for this particular occurrence of the + problem. example: 123abc message: type: string - description: Message is a human-readable explanation specific to this occurrence of the problem. + description: Message is a human-readable explanation specific to this occurrence + of the problem. example: parameter 'p' must be an integer name: type: string @@ -935,19 +677,19 @@ definitions: temporary: type: boolean description: Is the error temporary? - example: false + example: true timeout: type: boolean description: Is the error a timeout? - example: false + example: true description: Invalid Token scopes (default view) example: - fault: true + fault: false id: 123abc message: parameter 'p' must be an integer name: bad_request - temporary: false - timeout: true + temporary: true + timeout: false required: - name - id @@ -962,14 +704,16 @@ definitions: fault: type: boolean description: Is the error a server-side fault? - example: false + example: true id: type: string - description: ID is a unique identifier for this particular occurrence of the problem. + description: ID is a unique identifier for this particular occurrence of the + problem. example: 123abc message: type: string - description: Message is a human-readable explanation specific to this occurrence of the problem. + description: Message is a human-readable explanation specific to this occurrence + of the problem. example: parameter 'p' must be an integer name: type: string @@ -978,19 +722,19 @@ definitions: temporary: type: boolean description: Is the error temporary? - example: true + example: false timeout: type: boolean description: Is the error a timeout? example: true description: Invalid User token (default view) example: - fault: false + fault: true id: 123abc message: parameter 'p' must be an integer name: bad_request temporary: true - timeout: false + timeout: true required: - name - id @@ -1005,9 +749,9 @@ definitions: force: type: boolean description: Force Refresh the config file - example: true + example: false example: - force: false + force: true required: - force AdminRefreshConfigResponseBody: @@ -1017,9 +761,9 @@ definitions: checksum: type: string description: Config file checksum - example: Voluptas voluptas deserunt non molestiae illo. + example: Eveniet nihil et beatae ex voluptas voluptas. example: - checksum: Numquam eaque sunt voluptas eius non illo. + checksum: Non molestiae illo aut numquam. required: - checksum AdminUpdateAgentInternalErrorResponseBody: @@ -1032,11 +776,13 @@ definitions: example: false id: type: string - description: ID is a unique identifier for this particular occurrence of the problem. + description: ID is a unique identifier for this particular occurrence of the + problem. example: 123abc message: type: string - description: Message is a human-readable explanation specific to this occurrence of the problem. + description: Message is a human-readable explanation specific to this occurrence + of the problem. example: parameter 'p' must be an integer name: type: string @@ -1045,7 +791,7 @@ definitions: temporary: type: boolean description: Is the error temporary? - example: false + example: true timeout: type: boolean description: Is the error a timeout? @@ -1056,8 +802,8 @@ definitions: id: 123abc message: parameter 'p' must be an integer name: bad_request - temporary: false - timeout: false + temporary: true + timeout: true required: - name - id @@ -1072,14 +818,16 @@ definitions: fault: type: boolean description: Is the error a server-side fault? - example: false + example: true id: type: string - description: ID is a unique identifier for this particular occurrence of the problem. + description: ID is a unique identifier for this particular occurrence of the + problem. example: 123abc message: type: string - description: Message is a human-readable explanation specific to this occurrence of the problem. + description: Message is a human-readable explanation specific to this occurrence + of the problem. example: parameter 'p' must be an integer name: type: string @@ -1092,15 +840,15 @@ definitions: timeout: type: boolean description: Is the error a timeout? - example: false + example: true description: Invalid request body (default view) example: fault: true id: 123abc message: parameter 'p' must be an integer name: bad_request - temporary: true - timeout: false + temporary: false + timeout: true required: - name - id @@ -1115,14 +863,16 @@ definitions: fault: type: boolean description: Is the error a server-side fault? - example: true + example: false id: type: string - description: ID is a unique identifier for this particular occurrence of the problem. + description: ID is a unique identifier for this particular occurrence of the + problem. example: 123abc message: type: string - description: Message is a human-readable explanation specific to this occurrence of the problem. + description: Message is a human-readable explanation specific to this occurrence + of the problem. example: parameter 'p' must be an integer name: type: string @@ -1131,14 +881,14 @@ definitions: temporary: type: boolean description: Is the error temporary? - example: true + example: false timeout: type: boolean description: Is the error a timeout? example: true description: Invalid Token scopes (default view) example: - fault: true + fault: false id: 123abc message: parameter 'p' must be an integer name: bad_request @@ -1161,11 +911,13 @@ definitions: example: true id: type: string - description: ID is a unique identifier for this particular occurrence of the problem. + description: ID is a unique identifier for this particular occurrence of the + problem. example: 123abc message: type: string - description: Message is a human-readable explanation specific to this occurrence of the problem. + description: Message is a human-readable explanation specific to this occurrence + of the problem. example: parameter 'p' must be an integer name: type: string @@ -1174,14 +926,14 @@ definitions: temporary: type: boolean description: Is the error temporary? - example: true + example: false timeout: type: boolean description: Is the error a timeout? example: false description: Invalid User token (default view) example: - fault: true + fault: false id: 123abc message: parameter 'p' must be an integer name: bad_request @@ -1201,23 +953,24 @@ definitions: name: type: string description: Name of Agent - example: Quia molestiae eaque necessitatibus magni quia illum. + example: Sed voluptatem nulla laborum ut. scopes: type: array items: type: string - example: Suscipit voluptatem. + example: Architecto rerum id quia. description: Scopes required for Agent example: + - Eaque necessitatibus magni quia. + - Perferendis suscipit voluptatem est. - Rerum autem dolores at. - - Aliquam voluptates illo. - - Illum et ut pariatur similique. - - Laudantium nostrum quia totam magni reprehenderit maxime. example: - name: Velit itaque dolores dolor esse. + name: Aliquam voluptates illo. scopes: - - Aliquid praesentium saepe sed optio ab. - - Est magnam eveniet nihil et beatae. + - Et ut pariatur similique ullam laudantium nostrum. + - Totam magni reprehenderit maxime et velit. + - Dolores dolor esse officia velit aliquid praesentium. + - Sed optio ab beatae est. required: - name - scopes @@ -1228,9 +981,9 @@ definitions: token: type: string description: Agent JWT - example: Eum minus reiciendis nulla. + example: Quis nostrum et ab placeat facere. example: - token: Natus aut assumenda aut. + token: Ipsum iusto et dolor vitae voluptatem. required: - token AuthAuthenticateInternalErrorResponseBody: @@ -1240,14 +993,16 @@ definitions: fault: type: boolean description: Is the error a server-side fault? - example: true + example: false id: type: string - description: ID is a unique identifier for this particular occurrence of the problem. + description: ID is a unique identifier for this particular occurrence of the + problem. example: 123abc message: type: string - description: Message is a human-readable explanation specific to this occurrence of the problem. + description: Message is a human-readable explanation specific to this occurrence + of the problem. example: parameter 'p' must be an integer name: type: string @@ -1260,7 +1015,7 @@ definitions: timeout: type: boolean description: Is the error a timeout? - example: true + example: false description: Internal Server Error (default view) example: fault: false @@ -1286,11 +1041,13 @@ definitions: example: true id: type: string - description: ID is a unique identifier for this particular occurrence of the problem. + description: ID is a unique identifier for this particular occurrence of the + problem. example: 123abc message: type: string - description: Message is a human-readable explanation specific to this occurrence of the problem. + description: Message is a human-readable explanation specific to this occurrence + of the problem. example: parameter 'p' must be an integer name: type: string @@ -1299,19 +1056,19 @@ definitions: temporary: type: boolean description: Is the error temporary? - example: true + example: false timeout: type: boolean description: Is the error a timeout? - example: false + example: true description: Invalid Authorization code (default view) example: fault: false id: 123abc message: parameter 'p' must be an integer name: bad_request - temporary: false - timeout: false + temporary: true + timeout: true required: - name - id @@ -1329,11 +1086,13 @@ definitions: example: true id: type: string - description: ID is a unique identifier for this particular occurrence of the problem. + description: ID is a unique identifier for this particular occurrence of the + problem. example: 123abc message: type: string - description: Message is a human-readable explanation specific to this occurrence of the problem. + description: Message is a human-readable explanation specific to this occurrence + of the problem. example: parameter 'p' must be an integer name: type: string @@ -1372,11 +1131,13 @@ definitions: example: true id: type: string - description: ID is a unique identifier for this particular occurrence of the problem. + description: ID is a unique identifier for this particular occurrence of the + problem. example: 123abc message: type: string - description: Message is a human-readable explanation specific to this occurrence of the problem. + description: Message is a human-readable explanation specific to this occurrence + of the problem. example: parameter 'p' must be an integer name: type: string @@ -1385,14 +1146,14 @@ definitions: temporary: type: boolean description: Is the error temporary? - example: false + example: true timeout: type: boolean description: Is the error a timeout? example: false description: Invalid User token (default view) example: - fault: true + fault: false id: 123abc message: parameter 'p' must be an integer name: bad_request @@ -1448,14 +1209,16 @@ definitions: fault: type: boolean description: Is the error a server-side fault? - example: true + example: false id: type: string - description: ID is a unique identifier for this particular occurrence of the problem. + description: ID is a unique identifier for this particular occurrence of the + problem. example: 123abc message: type: string - description: Message is a human-readable explanation specific to this occurrence of the problem. + description: Message is a human-readable explanation specific to this occurrence + of the problem. example: parameter 'p' must be an integer name: type: string @@ -1464,11 +1227,11 @@ definitions: temporary: type: boolean description: Is the error temporary? - example: true + example: false timeout: type: boolean description: Is the error a timeout? - example: false + example: true description: Internal Server Error (default view) example: fault: true @@ -1494,11 +1257,13 @@ definitions: example: false id: type: string - description: ID is a unique identifier for this particular occurrence of the problem. + description: ID is a unique identifier for this particular occurrence of the + problem. example: 123abc message: type: string - description: Message is a human-readable explanation specific to this occurrence of the problem. + description: Message is a human-readable explanation specific to this occurrence + of the problem. example: parameter 'p' must be an integer name: type: string @@ -1534,16 +1299,16 @@ definitions: id: type: integer description: id of the job - example: 14575660200349537009 + example: 8951834590360407852 format: int64 status: type: string description: status of the job - example: Magnam tempore consequatur fugiat quae. + example: Perspiciatis ut ut. description: RefreshResponseBody result type (default view) example: - id: 13506291968005789499 - status: Ea itaque nam rerum aut officia a. + id: 10863881996075796435 + status: Sed ipsa velit dolorem. required: - id - status @@ -1582,14 +1347,16 @@ definitions: fault: type: boolean description: Is the error a server-side fault? - example: false + example: true id: type: string - description: ID is a unique identifier for this particular occurrence of the problem. + description: ID is a unique identifier for this particular occurrence of the + problem. example: 123abc message: type: string - description: Message is a human-readable explanation specific to this occurrence of the problem. + description: Message is a human-readable explanation specific to this occurrence + of the problem. example: parameter 'p' must be an integer name: type: string @@ -1598,11 +1365,11 @@ definitions: temporary: type: boolean description: Is the error temporary? - example: false + example: true timeout: type: boolean description: Is the error a timeout? - example: false + example: true description: Internal Server Error (default view) example: fault: false @@ -1664,6 +1431,13 @@ definitions: name: image-build - id: 2 name: kaniko + - id: 1 + name: Image Builder + tags: + - id: 1 + name: image-build + - id: 2 + name: kaniko CategoryResponseBody: title: CategoryResponseBody type: object @@ -1733,14 +1507,16 @@ definitions: fault: type: boolean description: Is the error a server-side fault? - example: true + example: false id: type: string - description: ID is a unique identifier for this particular occurrence of the problem. + description: ID is a unique identifier for this particular occurrence of the + problem. example: 123abc message: type: string - description: Message is a human-readable explanation specific to this occurrence of the problem. + description: Message is a human-readable explanation specific to this occurrence + of the problem. example: parameter 'p' must be an integer name: type: string @@ -1749,14 +1525,14 @@ definitions: temporary: type: boolean description: Is the error temporary? - example: true + example: false timeout: type: boolean description: Is the error a timeout? - example: false + example: true description: Internal server error (default view) example: - fault: false + fault: true id: 123abc message: parameter 'p' must be an integer name: bad_request @@ -1776,14 +1552,16 @@ definitions: fault: type: boolean description: Is the error a server-side fault? - example: false + example: true id: type: string - description: ID is a unique identifier for this particular occurrence of the problem. + description: ID is a unique identifier for this particular occurrence of the + problem. example: 123abc message: type: string - description: Message is a human-readable explanation specific to this occurrence of the problem. + description: Message is a human-readable explanation specific to this occurrence + of the problem. example: parameter 'p' must be an integer name: type: string @@ -1803,7 +1581,7 @@ definitions: id: 123abc message: parameter 'p' must be an integer name: bad_request - temporary: true + temporary: false timeout: false required: - name @@ -1822,11 +1600,13 @@ definitions: example: true id: type: string - description: ID is a unique identifier for this particular occurrence of the problem. + description: ID is a unique identifier for this particular occurrence of the + problem. example: 123abc message: type: string - description: Message is a human-readable explanation specific to this occurrence of the problem. + description: Message is a human-readable explanation specific to this occurrence + of the problem. example: parameter 'p' must be an integer name: type: string @@ -1835,19 +1615,19 @@ definitions: temporary: type: boolean description: Is the error temporary? - example: false + example: true timeout: type: boolean description: Is the error a timeout? - example: false + example: true description: Invalid User token (default view) example: - fault: false + fault: true id: 123abc message: parameter 'p' must be an integer name: bad_request temporary: true - timeout: false + timeout: true required: - name - id @@ -1865,11 +1645,13 @@ definitions: example: false id: type: string - description: ID is a unique identifier for this particular occurrence of the problem. + description: ID is a unique identifier for this particular occurrence of the + problem. example: 123abc message: type: string - description: Message is a human-readable explanation specific to this occurrence of the problem. + description: Message is a human-readable explanation specific to this occurrence + of the problem. example: parameter 'p' must be an integer name: type: string @@ -1882,15 +1664,15 @@ definitions: timeout: type: boolean description: Is the error a timeout? - example: false + example: true description: Resource Not Found Error (default view) example: - fault: false + fault: true id: 123abc message: parameter 'p' must be an integer name: bad_request - temporary: true - timeout: false + temporary: false + timeout: true required: - name - id @@ -1921,11 +1703,13 @@ definitions: example: false id: type: string - description: ID is a unique identifier for this particular occurrence of the problem. + description: ID is a unique identifier for this particular occurrence of the + problem. example: 123abc message: type: string - description: Message is a human-readable explanation specific to this occurrence of the problem. + description: Message is a human-readable explanation specific to this occurrence + of the problem. example: parameter 'p' must be an integer name: type: string @@ -1938,15 +1722,15 @@ definitions: timeout: type: boolean description: Is the error a timeout? - example: false + example: true description: Internal server error (default view) example: fault: false id: 123abc message: parameter 'p' must be an integer name: bad_request - temporary: false - timeout: false + temporary: true + timeout: true required: - name - id @@ -1964,11 +1748,13 @@ definitions: example: true id: type: string - description: ID is a unique identifier for this particular occurrence of the problem. + description: ID is a unique identifier for this particular occurrence of the + problem. example: 123abc message: type: string - description: Message is a human-readable explanation specific to this occurrence of the problem. + description: Message is a human-readable explanation specific to this occurrence + of the problem. example: parameter 'p' must be an integer name: type: string @@ -1977,18 +1763,18 @@ definitions: temporary: type: boolean description: Is the error temporary? - example: false + example: true timeout: type: boolean description: Is the error a timeout? example: true description: Invalid User scope (default view) example: - fault: true + fault: false id: 123abc message: parameter 'p' must be an integer name: bad_request - temporary: true + temporary: false timeout: true required: - name @@ -2007,11 +1793,13 @@ definitions: example: false id: type: string - description: ID is a unique identifier for this particular occurrence of the problem. + description: ID is a unique identifier for this particular occurrence of the + problem. example: 123abc message: type: string - description: Message is a human-readable explanation specific to this occurrence of the problem. + description: Message is a human-readable explanation specific to this occurrence + of the problem. example: parameter 'p' must be an integer name: type: string @@ -2024,14 +1812,14 @@ definitions: timeout: type: boolean description: Is the error a timeout? - example: false + example: true description: Invalid User token (default view) example: - fault: true + fault: false id: 123abc message: parameter 'p' must be an integer name: bad_request - temporary: false + temporary: true timeout: true required: - name @@ -2050,11 +1838,13 @@ definitions: example: false id: type: string - description: ID is a unique identifier for this particular occurrence of the problem. + description: ID is a unique identifier for this particular occurrence of the + problem. example: 123abc message: type: string - description: Message is a human-readable explanation specific to this occurrence of the problem. + description: Message is a human-readable explanation specific to this occurrence + of the problem. example: parameter 'p' must be an integer name: type: string @@ -2070,7 +1860,7 @@ definitions: example: true description: Resource Not Found Error (default view) example: - fault: true + fault: false id: 123abc message: parameter 'p' must be an integer name: bad_request @@ -2090,7 +1880,7 @@ definitions: rating: type: integer description: User rating for resource - example: 3 + example: 0 minimum: 0 maximum: 5 example: @@ -2107,11 +1897,13 @@ definitions: example: false id: type: string - description: ID is a unique identifier for this particular occurrence of the problem. + description: ID is a unique identifier for this particular occurrence of the + problem. example: 123abc message: type: string - description: Message is a human-readable explanation specific to this occurrence of the problem. + description: Message is a human-readable explanation specific to this occurrence + of the problem. example: parameter 'p' must be an integer name: type: string @@ -2120,19 +1912,19 @@ definitions: temporary: type: boolean description: Is the error temporary? - example: true + example: false timeout: type: boolean description: Is the error a timeout? - example: true + example: false description: Internal Server Error (default view) example: fault: true id: 123abc message: parameter 'p' must be an integer name: bad_request - temporary: false - timeout: false + temporary: true + timeout: true required: - name - id @@ -2147,14 +1939,16 @@ definitions: fault: type: boolean description: Is the error a server-side fault? - example: true + example: false id: type: string - description: ID is a unique identifier for this particular occurrence of the problem. + description: ID is a unique identifier for this particular occurrence of the + problem. example: 123abc message: type: string - description: Message is a human-readable explanation specific to this occurrence of the problem. + description: Message is a human-readable explanation specific to this occurrence + of the problem. example: parameter 'p' must be an integer name: type: string @@ -2170,7 +1964,7 @@ definitions: example: true description: Resource Not Found Error (default view) example: - fault: false + fault: true id: 123abc message: parameter 'p' must be an integer name: bad_request @@ -2198,7 +1992,8 @@ definitions: id: 1 kind: task latestVersion: - description: Buildah task builds source into a container image and then pushes it to a container registry. + description: Buildah task builds source into a container image and then + pushes it to a container registry. displayName: Buildah id: 1 minPipelinesVersion: 0.12.1 @@ -2228,11 +2023,13 @@ definitions: example: false id: type: string - description: ID is a unique identifier for this particular occurrence of the problem. + description: ID is a unique identifier for this particular occurrence of the + problem. example: 123abc message: type: string - description: Message is a human-readable explanation specific to this occurrence of the problem. + description: Message is a human-readable explanation specific to this occurrence + of the problem. example: parameter 'p' must be an integer name: type: string @@ -2241,19 +2038,19 @@ definitions: temporary: type: boolean description: Is the error temporary? - example: true + example: false timeout: type: boolean description: Is the error a timeout? - example: false + example: true description: Internal Server Error (default view) example: - fault: false + fault: true id: 123abc message: parameter 'p' must be an integer name: bad_request temporary: false - timeout: false + timeout: true required: - name - id @@ -2271,11 +2068,13 @@ definitions: example: false id: type: string - description: ID is a unique identifier for this particular occurrence of the problem. + description: ID is a unique identifier for this particular occurrence of the + problem. example: 123abc message: type: string - description: Message is a human-readable explanation specific to this occurrence of the problem. + description: Message is a human-readable explanation specific to this occurrence + of the problem. example: parameter 'p' must be an integer name: type: string @@ -2291,11 +2090,11 @@ definitions: example: false description: Resource Not Found Error (default view) example: - fault: true + fault: false id: 123abc message: parameter 'p' must be an integer name: bad_request - temporary: true + temporary: false timeout: true required: - name @@ -2313,7 +2112,8 @@ definitions: description: ByCatalogKindNameVersionResponseBody result type (default view) example: data: - description: Buildah task builds source into a container image and then pushes it to a container registry. + description: Buildah task builds source into a container image and then pushes + it to a container registry. displayName: Buildah id: 1 minPipelinesVersion: 0.12.1 @@ -2341,14 +2141,16 @@ definitions: fault: type: boolean description: Is the error a server-side fault? - example: false + example: true id: type: string - description: ID is a unique identifier for this particular occurrence of the problem. + description: ID is a unique identifier for this particular occurrence of the + problem. example: 123abc message: type: string - description: Message is a human-readable explanation specific to this occurrence of the problem. + description: Message is a human-readable explanation specific to this occurrence + of the problem. example: parameter 'p' must be an integer name: type: string @@ -2357,11 +2159,11 @@ definitions: temporary: type: boolean description: Is the error temporary? - example: false + example: true timeout: type: boolean description: Is the error a timeout? - example: false + example: true description: Internal Server Error (default view) example: fault: false @@ -2387,11 +2189,13 @@ definitions: example: false id: type: string - description: ID is a unique identifier for this particular occurrence of the problem. + description: ID is a unique identifier for this particular occurrence of the + problem. example: 123abc message: type: string - description: Message is a human-readable explanation specific to this occurrence of the problem. + description: Message is a human-readable explanation specific to this occurrence + of the problem. example: parameter 'p' must be an integer name: type: string @@ -2404,10 +2208,10 @@ definitions: timeout: type: boolean description: Is the error a timeout? - example: false + example: true description: Resource Not Found Error (default view) example: - fault: true + fault: false id: 123abc message: parameter 'p' must be an integer name: bad_request @@ -2435,7 +2239,8 @@ definitions: id: 1 kind: task latestVersion: - description: Buildah task builds source into a container image and then pushes it to a container registry. + description: Buildah task builds source into a container image and then + pushes it to a container registry. displayName: Buildah id: 1 minPipelinesVersion: 0.12.1 @@ -2465,11 +2270,13 @@ definitions: example: false id: type: string - description: ID is a unique identifier for this particular occurrence of the problem. + description: ID is a unique identifier for this particular occurrence of the + problem. example: 123abc message: type: string - description: Message is a human-readable explanation specific to this occurrence of the problem. + description: Message is a human-readable explanation specific to this occurrence + of the problem. example: parameter 'p' must be an integer name: type: string @@ -2489,8 +2296,8 @@ definitions: id: 123abc message: parameter 'p' must be an integer name: bad_request - temporary: true - timeout: true + temporary: false + timeout: false required: - name - id @@ -2505,14 +2312,16 @@ definitions: fault: type: boolean description: Is the error a server-side fault? - example: true + example: false id: type: string - description: ID is a unique identifier for this particular occurrence of the problem. + description: ID is a unique identifier for this particular occurrence of the + problem. example: 123abc message: type: string - description: Message is a human-readable explanation specific to this occurrence of the problem. + description: Message is a human-readable explanation specific to this occurrence + of the problem. example: parameter 'p' must be an integer name: type: string @@ -2528,7 +2337,7 @@ definitions: example: false description: Resource Not Found Error (default view) example: - fault: true + fault: false id: 123abc message: parameter 'p' must be an integer name: bad_request @@ -2550,7 +2359,8 @@ definitions: description: ByVersionIdResponseBody result type (default view) example: data: - description: Buildah task builds source into a container image and then pushes it to a container registry. + description: Buildah task builds source into a container image and then pushes + it to a container registry. displayName: Buildah id: 1 minPipelinesVersion: 0.12.1 @@ -2623,7 +2433,8 @@ definitions: id: 1 kind: task latestVersion: - description: Buildah task builds source into a container image and then pushes it to a container registry. + description: Buildah task builds source into a container image and then pushes + it to a container registry. displayName: Buildah id: 1 minPipelinesVersion: 0.12.1 @@ -2735,7 +2546,8 @@ definitions: example: - id: 1 name: image-build - description: The resource type describes resource information. (withoutVersion view) (default view) + description: The resource type describes resource information. (withoutVersion + view) (default view) example: catalog: id: 1 @@ -2743,7 +2555,8 @@ definitions: id: 1 kind: task latestVersion: - description: Buildah task builds source into a container image and then pushes it to a container registry. + description: Buildah task builds source into a container image and then pushes + it to a container registry. displayName: Buildah id: 1 minPipelinesVersion: 0.12.1 @@ -2765,11 +2578,13 @@ definitions: - tags - rating ResourceDataResponseBodyWithoutVersionCollection: - title: 'Mediatype identifier: application/vnd.hub.resource.data; type=collection; view=default' + title: 'Mediatype identifier: application/vnd.hub.resource.data; type=collection; + view=default' type: array items: $ref: '#/definitions/ResourceDataResponseBodyWithoutVersion' - description: ResourceDataResponseBodyWithoutVersionCollection is the result type for an array of ResourceDataResponseBodyWithoutVersion (default view) + description: ResourceDataResponseBodyWithoutVersionCollection is the result type + for an array of ResourceDataResponseBodyWithoutVersion (default view) example: - catalog: id: 1 @@ -2777,7 +2592,8 @@ definitions: id: 1 kind: task latestVersion: - description: Buildah task builds source into a container image and then pushes it to a container registry. + description: Buildah task builds source into a container image and then pushes + it to a container registry. displayName: Buildah id: 1 minPipelinesVersion: 0.12.1 @@ -2801,7 +2617,8 @@ definitions: id: 1 kind: task latestVersion: - description: Buildah task builds source into a container image and then pushes it to a container registry. + description: Buildah task builds source into a container image and then pushes + it to a container registry. displayName: Buildah id: 1 minPipelinesVersion: 0.12.1 @@ -2829,11 +2646,13 @@ definitions: example: false id: type: string - description: ID is a unique identifier for this particular occurrence of the problem. + description: ID is a unique identifier for this particular occurrence of the + problem. example: 123abc message: type: string - description: Message is a human-readable explanation specific to this occurrence of the problem. + description: Message is a human-readable explanation specific to this occurrence + of the problem. example: parameter 'p' must be an integer name: type: string @@ -2846,10 +2665,10 @@ definitions: timeout: type: boolean description: Is the error a timeout? - example: true + example: false description: Internal Server Error (default view) example: - fault: false + fault: true id: 123abc message: parameter 'p' must be an integer name: bad_request @@ -2877,45 +2696,8 @@ definitions: id: 1 kind: task latestVersion: - description: Buildah task builds source into a container image and then pushes it to a container registry. - displayName: Buildah - id: 1 - minPipelinesVersion: 0.12.1 - rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml - updatedAt: 2020-01-01 12:00:00 +0000 UTC - version: "0.1" - webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml - name: buildah - rating: 4.3 - tags: - - id: 1 - name: image-build - - catalog: - id: 1 - type: community - id: 1 - kind: task - latestVersion: - description: Buildah task builds source into a container image and then pushes it to a container registry. - displayName: Buildah - id: 1 - minPipelinesVersion: 0.12.1 - rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml - updatedAt: 2020-01-01 12:00:00 +0000 UTC - version: "0.1" - webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml - name: buildah - rating: 4.3 - tags: - - id: 1 - name: image-build - - catalog: - id: 1 - type: community - id: 1 - kind: task - latestVersion: - description: Buildah task builds source into a container image and then pushes it to a container registry. + description: Buildah task builds source into a container image and then + pushes it to a container registry. displayName: Buildah id: 1 minPipelinesVersion: 0.12.1 @@ -2934,7 +2716,8 @@ definitions: id: 1 kind: task latestVersion: - description: Buildah task builds source into a container image and then pushes it to a container registry. + description: Buildah task builds source into a container image and then + pushes it to a container registry. displayName: Buildah id: 1 minPipelinesVersion: 0.12.1 @@ -2956,14 +2739,16 @@ definitions: fault: type: boolean description: Is the error a server-side fault? - example: true + example: false id: type: string - description: ID is a unique identifier for this particular occurrence of the problem. + description: ID is a unique identifier for this particular occurrence of the + problem. example: 123abc message: type: string - description: Message is a human-readable explanation specific to this occurrence of the problem. + description: Message is a human-readable explanation specific to this occurrence + of the problem. example: parameter 'p' must be an integer name: type: string @@ -2972,19 +2757,19 @@ definitions: temporary: type: boolean description: Is the error temporary? - example: false + example: true timeout: type: boolean description: Is the error a timeout? - example: true + example: false description: Internal Server Error (default view) example: - fault: true + fault: false id: 123abc message: parameter 'p' must be an integer name: bad_request temporary: false - timeout: true + timeout: false required: - name - id @@ -3002,11 +2787,13 @@ definitions: example: true id: type: string - description: ID is a unique identifier for this particular occurrence of the problem. + description: ID is a unique identifier for this particular occurrence of the + problem. example: 123abc message: type: string - description: Message is a human-readable explanation specific to this occurrence of the problem. + description: Message is a human-readable explanation specific to this occurrence + of the problem. example: parameter 'p' must be an integer name: type: string @@ -3019,14 +2806,14 @@ definitions: timeout: type: boolean description: Is the error a timeout? - example: true + example: false description: Invalid Resource Kind (default view) example: - fault: true + fault: false id: 123abc message: parameter 'p' must be an integer name: bad_request - temporary: false + temporary: true timeout: true required: - name @@ -3045,11 +2832,13 @@ definitions: example: true id: type: string - description: ID is a unique identifier for this particular occurrence of the problem. + description: ID is a unique identifier for this particular occurrence of the + problem. example: 123abc message: type: string - description: Message is a human-readable explanation specific to this occurrence of the problem. + description: Message is a human-readable explanation specific to this occurrence + of the problem. example: parameter 'p' must be an integer name: type: string @@ -3058,14 +2847,14 @@ definitions: temporary: type: boolean description: Is the error temporary? - example: true + example: false timeout: type: boolean description: Is the error a timeout? - example: false + example: true description: Resource Not Found Error (default view) example: - fault: false + fault: true id: 123abc message: parameter 'p' must be an integer name: bad_request @@ -3093,45 +2882,8 @@ definitions: id: 1 kind: task latestVersion: - description: Buildah task builds source into a container image and then pushes it to a container registry. - displayName: Buildah - id: 1 - minPipelinesVersion: 0.12.1 - rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml - updatedAt: 2020-01-01 12:00:00 +0000 UTC - version: "0.1" - webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml - name: buildah - rating: 4.3 - tags: - - id: 1 - name: image-build - - catalog: - id: 1 - type: community - id: 1 - kind: task - latestVersion: - description: Buildah task builds source into a container image and then pushes it to a container registry. - displayName: Buildah - id: 1 - minPipelinesVersion: 0.12.1 - rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml - updatedAt: 2020-01-01 12:00:00 +0000 UTC - version: "0.1" - webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml - name: buildah - rating: 4.3 - tags: - - id: 1 - name: image-build - - catalog: - id: 1 - type: community - id: 1 - kind: task - latestVersion: - description: Buildah task builds source into a container image and then pushes it to a container registry. + description: Buildah task builds source into a container image and then + pushes it to a container registry. displayName: Buildah id: 1 minPipelinesVersion: 0.12.1 @@ -3150,7 +2902,8 @@ definitions: id: 1 kind: task latestVersion: - description: Buildah task builds source into a container image and then pushes it to a container registry. + description: Buildah task builds source into a container image and then + pushes it to a container registry. displayName: Buildah id: 1 minPipelinesVersion: 0.12.1 @@ -3172,7 +2925,8 @@ definitions: description: type: string description: Description of version - example: Buildah task builds source into a container image and then pushes it to a container registry. + example: Buildah task builds source into a container image and then pushes + it to a container registry. displayName: type: string description: Display name of version @@ -3184,7 +2938,8 @@ definitions: format: int64 minPipelinesVersion: type: string - description: Minimum pipelines version the resource's version is compatible with + description: Minimum pipelines version the resource's version is compatible + with example: 0.12.1 rawURL: type: string @@ -3209,7 +2964,8 @@ definitions: format: uri description: The Version result type describes resource's version information. example: - description: Buildah task builds source into a container image and then pushes it to a container registry. + description: Buildah task builds source into a container image and then pushes + it to a container registry. displayName: Buildah id: 1 minPipelinesVersion: 0.12.1 @@ -3261,7 +3017,8 @@ definitions: description: Web URL of resource's yaml file of the version example: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml format: uri - description: The Version result type describes resource's version information. (default view) + description: The Version result type describes resource's version information. + (default view) example: id: 1 rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml @@ -3285,7 +3042,8 @@ definitions: type: string description: Version of resource example: "0.1" - description: The Version result type describes resource's version information. (default view) + description: The Version result type describes resource's version information. + (default view) example: id: 1 version: "0.1" @@ -3299,7 +3057,8 @@ definitions: description: type: string description: Description of version - example: Buildah task builds source into a container image and then pushes it to a container registry. + example: Buildah task builds source into a container image and then pushes + it to a container registry. displayName: type: string description: Display name of version @@ -3311,7 +3070,8 @@ definitions: format: int64 minPipelinesVersion: type: string - description: Minimum pipelines version the resource's version is compatible with + description: Minimum pipelines version the resource's version is compatible + with example: 0.12.1 rawURL: type: string @@ -3332,9 +3092,11 @@ definitions: description: Web URL of resource's yaml file of the version example: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml format: uri - description: The Version result type describes resource's version information. (default view) + description: The Version result type describes resource's version information. + (default view) example: - description: Buildah task builds source into a container image and then pushes it to a container registry. + description: Buildah task builds source into a container image and then pushes + it to a container registry. displayName: Buildah id: 1 minPipelinesVersion: 0.12.1 @@ -3358,14 +3120,16 @@ definitions: fault: type: boolean description: Is the error a server-side fault? - example: false + example: true id: type: string - description: ID is a unique identifier for this particular occurrence of the problem. + description: ID is a unique identifier for this particular occurrence of the + problem. example: 123abc message: type: string - description: Message is a human-readable explanation specific to this occurrence of the problem. + description: Message is a human-readable explanation specific to this occurrence + of the problem. example: parameter 'p' must be an integer name: type: string @@ -3404,11 +3168,13 @@ definitions: example: true id: type: string - description: ID is a unique identifier for this particular occurrence of the problem. + description: ID is a unique identifier for this particular occurrence of the + problem. example: 123abc message: type: string - description: Message is a human-readable explanation specific to this occurrence of the problem. + description: Message is a human-readable explanation specific to this occurrence + of the problem. example: parameter 'p' must be an integer name: type: string @@ -3417,7 +3183,7 @@ definitions: temporary: type: boolean description: Is the error temporary? - example: false + example: true timeout: type: boolean description: Is the error a timeout? @@ -3478,6 +3244,9 @@ definitions: - error: unable to reach db name: api status: ok + - error: unable to reach db + name: api + status: ok example: services: - error: unable to reach db @@ -3486,9 +3255,6 @@ definitions: - error: unable to reach db name: api status: ok - - error: unable to reach db - name: api - status: ok TagResponseBody: title: TagResponseBody type: object @@ -3554,7 +3320,8 @@ definitions: rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml version: "0.2" webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml - description: The Versions type describes response for versions by resource id API. + description: The Versions type describes response for versions by resource id + API. example: latest: id: 2 diff --git a/api/gen/http/openapi3.json b/api/gen/http/openapi3.json index b6569b67d2..579aab7a98 100644 --- a/api/gen/http/openapi3.json +++ b/api/gen/http/openapi3.json @@ -1 +1 @@ -{"openapi":"3.0.3","info":{"title":"Tekton Hub","description":"HTTP services for managing Tekton Hub","version":"1.0"},"servers":[{"url":"http://api.hub.tekton.dev"}],"paths":{"/":{"get":{"tags":["status"],"summary":"Status status","description":"Return status of the services","operationId":"status#Status","responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusResponseBody"},"example":{"services":[{"error":"unable to reach db","name":"api","status":"ok"},{"error":"unable to reach db","name":"api","status":"ok"}]}}}}}}},"/auth/login":{"post":{"tags":["auth"],"summary":"Authenticate auth","description":"Authenticates users against GitHub OAuth","operationId":"auth#Authenticate","parameters":[{"name":"code","in":"query","description":"OAuth Authorization code of User","allowEmptyValue":true,"required":true,"schema":{"type":"string","description":"OAuth Authorization code of User","example":"5628b69ec09c09512eef"},"example":"5628b69ec09c09512eef"}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthenticateResponseBody"},"example":{"data":{"access":{"expiresAt":0,"refreshInterval":"1h30m","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"},"refresh":{"expiresAt":0,"refreshInterval":"1h30m","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"}}}}}},"400":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false}}}},"401":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true}}}},"403":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false}}}}}}},"/catalog/refresh":{"post":{"tags":["catalog"],"summary":"Refresh catalog","description":"Refreshes Tekton Catalog","operationId":"catalog#Refresh","responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"},"example":{"id":1029125940089474859,"status":"Reprehenderit libero soluta sapiente deleniti voluptatem distinctio."}}}},"404":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false}}}}},"security":[{"jwt_header_Authorization":["rating:read","rating:write","agent:create","catalog:refresh","config:refresh"]}]}},"/categories":{"get":{"tags":["category"],"summary":"list category","description":"List all categories along with their tags sorted by name","operationId":"category#list","responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListResponseBody"},"example":{"data":[{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]},{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]}]}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false}}}}}}},"/query":{"get":{"tags":["resource"],"summary":"Query resource","description":"Find resources by a combination of name, kind and tags","operationId":"resource#Query","parameters":[{"name":"name","in":"query","description":"Name of resource","allowEmptyValue":true,"schema":{"type":"string","description":"Name of resource","default":"","example":"buildah"},"example":"buildah"},{"name":"kinds","in":"query","description":"Kinds of resource to filter by","allowEmptyValue":true,"schema":{"type":"array","items":{"type":"string","example":"Placeat et et."},"description":"Kinds of resource to filter by","example":["task","pipelines"]},"example":["task","pipelines"]},{"name":"tags","in":"query","description":"Tags associated with a resource to filter by","allowEmptyValue":true,"schema":{"type":"array","items":{"type":"string","example":"Itaque aperiam tempore animi iure eum et."},"description":"Tags associated with a resource to filter by","example":["image","build"]},"example":["image","build"]},{"name":"limit","in":"query","description":"Maximum number of resources to be returned","allowEmptyValue":true,"schema":{"type":"integer","description":"Maximum number of resources to be returned","default":1000,"example":100},"example":100},{"name":"match","in":"query","description":"Strategy used to find matching resources","allowEmptyValue":true,"schema":{"type":"string","description":"Strategy used to find matching resources","default":"contains","example":"contains","enum":["exact","contains"]},"example":"exact"}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Resources"},"example":{"data":[{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]}]}}}},"400":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true}}}},"404":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true}}}}}}},"/resource/version/{versionID}":{"get":{"tags":["resource"],"summary":"ByVersionId resource","description":"Find a resource using its version's id","operationId":"resource#ByVersionId","parameters":[{"name":"versionID","in":"path","description":"Version ID of a resource's version","required":true,"schema":{"type":"integer","description":"Version ID of a resource's version","example":1},"example":1}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceVersion"},"example":{"data":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","resource":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]},"updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"}}}}},"404":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true}}}}}}},"/resource/{catalog}/{kind}/{name}":{"get":{"tags":["resource"],"summary":"ByCatalogKindName resource","description":"Find resources using name of catalog, resource name and kind of resource","operationId":"resource#ByCatalogKindName","parameters":[{"name":"catalog","in":"path","description":"name of catalog","required":true,"schema":{"type":"string","description":"name of catalog","example":"tektoncd"},"example":"tektoncd"},{"name":"kind","in":"path","description":"kind of resource","required":true,"schema":{"type":"string","description":"kind of resource","example":"task","enum":["task","pipeline"]},"example":"pipeline"},{"name":"name","in":"path","description":"Name of resource","required":true,"schema":{"type":"string","description":"Name of resource","example":"buildah"},"example":"buildah"}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Resource"},"example":{"data":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]}}}}},"404":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false}}}}}}},"/resource/{catalog}/{kind}/{name}/{version}":{"get":{"tags":["resource"],"summary":"ByCatalogKindNameVersion resource","description":"Find resource using name of catalog \u0026 name, kind and version of resource","operationId":"resource#ByCatalogKindNameVersion","parameters":[{"name":"catalog","in":"path","description":"name of catalog","required":true,"schema":{"type":"string","description":"name of catalog","example":"tektoncd"},"example":"tektoncd"},{"name":"kind","in":"path","description":"kind of resource","required":true,"schema":{"type":"string","description":"kind of resource","example":"pipeline","enum":["task","pipeline"]},"example":"task"},{"name":"name","in":"path","description":"name of resource","required":true,"schema":{"type":"string","description":"name of resource","example":"buildah"},"example":"buildah"},{"name":"version","in":"path","description":"version of resource","required":true,"schema":{"type":"string","description":"version of resource","example":"0.1"},"example":"0.1"}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceVersion"},"example":{"data":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","resource":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]},"updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"}}}}},"404":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true}}}}}}},"/resource/{id}":{"get":{"tags":["resource"],"summary":"ById resource","description":"Find a resource using it's id","operationId":"resource#ById","parameters":[{"name":"id","in":"path","description":"ID of a resource","required":true,"schema":{"type":"integer","description":"ID of a resource","example":1},"example":1}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Resource"},"example":{"data":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]}}}}},"404":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true}}}}}}},"/resource/{id}/rating":{"get":{"tags":["rating"],"summary":"Get rating","description":"Find user's rating for a resource","operationId":"rating#Get","parameters":[{"name":"id","in":"path","description":"ID of a resource","required":true,"schema":{"type":"integer","description":"ID of a resource","example":11620657542064230955},"example":11665674017405905075}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetResponseBody"},"example":{"rating":4}}}},"401":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false}}}},"403":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false}}}},"404":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true}}}}},"security":[{"jwt_header_Authorization":["rating:read","rating:write","agent:create","catalog:refresh","config:refresh"]}]},"put":{"tags":["rating"],"summary":"Update rating","description":"Update user's rating for a resource","operationId":"rating#Update","parameters":[{"name":"id","in":"path","description":"ID of a resource","required":true,"schema":{"type":"integer","description":"ID of a resource","example":4869966896348576719},"example":6109420220413662287}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRequestBody"},"example":{"rating":0}}}},"responses":{"200":{"description":"","content":{"application/json":{"example":{}}}},"401":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false}}}},"403":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false}}}},"404":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false}}}}},"security":[{"jwt_header_Authorization":["rating:read","rating:write","agent:create","catalog:refresh","config:refresh"]}]}},"/resource/{id}/versions":{"get":{"tags":["resource"],"summary":"VersionsByID resource","description":"Find all versions of a resource by its id","operationId":"resource#VersionsByID","parameters":[{"name":"id","in":"path","description":"ID of a resource","required":true,"schema":{"type":"integer","description":"ID of a resource","example":1},"example":1}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceVersions"},"example":{"data":{"latest":{"id":2,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml","version":"0.2","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml"},"versions":[{"id":1,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},{"id":2,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml","version":"0.2","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml"}]}}}}},"404":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true}}}}}}},"/resources":{"get":{"tags":["resource"],"summary":"List resource","description":"List all resources sorted by rating and name","operationId":"resource#List","parameters":[{"name":"limit","in":"query","description":"Maximum number of resources to be returned","allowEmptyValue":true,"schema":{"type":"integer","description":"Maximum number of resources to be returned","default":1000,"example":100},"example":100}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Resources"},"example":{"data":[{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]}]}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false}}}}}}},"/schema/swagger.json":{"get":{"tags":["swagger"],"summary":"Download gen/http/openapi3.yaml","description":"JSON document containing the API swagger definition","operationId":"swagger#/schema/swagger.json","responses":{"200":{"description":"File downloaded"}}}},"/system/config/refresh":{"post":{"tags":["admin"],"summary":"RefreshConfig admin","description":"Refresh the changes in config file","operationId":"admin#RefreshConfig","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefreshConfigRequestBody"},"example":{"force":true}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefreshConfigResponseBody"},"example":{"checksum":"Ipsam eos aut magnam."}}}},"401":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true}}}},"403":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true}}}}},"security":[{"jwt_header_Authorization":["rating:read","rating:write","agent:create","catalog:refresh","config:refresh"]}]}},"/system/user/agent":{"put":{"tags":["admin"],"summary":"UpdateAgent admin","description":"Create or Update an agent user with required scopes","operationId":"admin#UpdateAgent","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAgentRequestBody"},"example":{"name":"Pariatur occaecati voluptas assumenda maiores quaerat consequatur.","scopes":["Nihil officia itaque non.","Qui dolor consequatur assumenda."]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAgentResponseBody"},"example":{"token":"Commodi rerum harum ut tenetur laborum tempore."}}}},"400":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false}}}},"401":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true}}}},"403":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false}}}}},"security":[{"jwt_header_Authorization":["rating:read","rating:write","agent:create","catalog:refresh","config:refresh"]}]}},"/v1/categories":{"get":{"tags":["category"],"summary":"list category","description":"List all categories along with their tags sorted by name","operationId":"category#list#1","responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListResponseBody"},"example":{"data":[{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]},{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]}]}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false}}}}}}},"/v1/query":{"get":{"tags":["resource"],"summary":"Query resource","description":"Find resources by a combination of name, kind and tags","operationId":"resource#Query#1","parameters":[{"name":"name","in":"query","description":"Name of resource","allowEmptyValue":true,"schema":{"type":"string","description":"Name of resource","default":"","example":"buildah"},"example":"buildah"},{"name":"kinds","in":"query","description":"Kinds of resource to filter by","allowEmptyValue":true,"schema":{"type":"array","items":{"type":"string","example":"Corrupti atque odit expedita sit repellendus."},"description":"Kinds of resource to filter by","example":["task","pipelines"]},"example":["task","pipelines"]},{"name":"tags","in":"query","description":"Tags associated with a resource to filter by","allowEmptyValue":true,"schema":{"type":"array","items":{"type":"string","example":"Consequatur numquam id aut illum ut rerum."},"description":"Tags associated with a resource to filter by","example":["image","build"]},"example":["image","build"]},{"name":"limit","in":"query","description":"Maximum number of resources to be returned","allowEmptyValue":true,"schema":{"type":"integer","description":"Maximum number of resources to be returned","default":1000,"example":100},"example":100},{"name":"match","in":"query","description":"Strategy used to find matching resources","allowEmptyValue":true,"schema":{"type":"string","description":"Strategy used to find matching resources","default":"contains","example":"contains","enum":["exact","contains"]},"example":"exact"}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Resources"},"example":{"data":[{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]}]}}}},"400":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true}}}},"404":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true}}}}}}},"/v1/resource/version/{versionID}":{"get":{"tags":["resource"],"summary":"ByVersionId resource","description":"Find a resource using its version's id","operationId":"resource#ByVersionId#1","parameters":[{"name":"versionID","in":"path","description":"Version ID of a resource's version","required":true,"schema":{"type":"integer","description":"Version ID of a resource's version","example":1},"example":1}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceVersion"},"example":{"data":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","resource":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]},"updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"}}}}},"404":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true}}}}}}},"/v1/resource/{catalog}/{kind}/{name}":{"get":{"tags":["resource"],"summary":"ByCatalogKindName resource","description":"Find resources using name of catalog, resource name and kind of resource","operationId":"resource#ByCatalogKindName#1","parameters":[{"name":"catalog","in":"path","description":"name of catalog","required":true,"schema":{"type":"string","description":"name of catalog","example":"tektoncd"},"example":"tektoncd"},{"name":"kind","in":"path","description":"kind of resource","required":true,"schema":{"type":"string","description":"kind of resource","example":"pipeline","enum":["task","pipeline"]},"example":"pipeline"},{"name":"name","in":"path","description":"Name of resource","required":true,"schema":{"type":"string","description":"Name of resource","example":"buildah"},"example":"buildah"}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Resource"},"example":{"data":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]}}}}},"404":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false}}}}}}},"/v1/resource/{catalog}/{kind}/{name}/{version}":{"get":{"tags":["resource"],"summary":"ByCatalogKindNameVersion resource","description":"Find resource using name of catalog \u0026 name, kind and version of resource","operationId":"resource#ByCatalogKindNameVersion#1","parameters":[{"name":"catalog","in":"path","description":"name of catalog","required":true,"schema":{"type":"string","description":"name of catalog","example":"tektoncd"},"example":"tektoncd"},{"name":"kind","in":"path","description":"kind of resource","required":true,"schema":{"type":"string","description":"kind of resource","example":"pipeline","enum":["task","pipeline"]},"example":"pipeline"},{"name":"name","in":"path","description":"name of resource","required":true,"schema":{"type":"string","description":"name of resource","example":"buildah"},"example":"buildah"},{"name":"version","in":"path","description":"version of resource","required":true,"schema":{"type":"string","description":"version of resource","example":"0.1"},"example":"0.1"}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceVersion"},"example":{"data":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","resource":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]},"updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"}}}}},"404":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true}}}}}}},"/v1/resource/{id}":{"get":{"tags":["resource"],"summary":"ById resource","description":"Find a resource using it's id","operationId":"resource#ById#1","parameters":[{"name":"id","in":"path","description":"ID of a resource","required":true,"schema":{"type":"integer","description":"ID of a resource","example":1},"example":1}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Resource"},"example":{"data":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]}}}}},"404":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true}}}}}}},"/v1/resource/{id}/versions":{"get":{"tags":["resource"],"summary":"VersionsByID resource","description":"Find all versions of a resource by its id","operationId":"resource#VersionsByID#1","parameters":[{"name":"id","in":"path","description":"ID of a resource","required":true,"schema":{"type":"integer","description":"ID of a resource","example":1},"example":1}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceVersions"},"example":{"data":{"latest":{"id":2,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml","version":"0.2","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml"},"versions":[{"id":1,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},{"id":2,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml","version":"0.2","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml"}]}}}}},"404":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true}}}}}}},"/v1/resources":{"get":{"tags":["resource"],"summary":"List resource","description":"List all resources sorted by rating and name","operationId":"resource#List#1","parameters":[{"name":"limit","in":"query","description":"Maximum number of resources to be returned","allowEmptyValue":true,"schema":{"type":"integer","description":"Maximum number of resources to be returned","default":1000,"example":100},"example":100}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Resources"},"example":{"data":[{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]}]}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false}}}}}}}},"components":{"schemas":{"AuthTokens":{"type":"object","properties":{"access":{"$ref":"#/components/schemas/Token"},"refresh":{"$ref":"#/components/schemas/Token"}},"description":"Auth tokens have access and refresh token for user","example":{"access":{"expiresAt":0,"refreshInterval":"1h30m","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"},"refresh":{"expiresAt":0,"refreshInterval":"1h30m","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"}}},"AuthenticateResponseBody":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AuthTokens"}},"example":{"data":{"access":{"expiresAt":0,"refreshInterval":"1h30m","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"},"refresh":{"expiresAt":0,"refreshInterval":"1h30m","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"}}},"required":["data"]},"Catalog":{"type":"object","properties":{"id":{"type":"integer","description":"ID is the unique id of the catalog","example":1},"name":{"type":"string","description":"Name of catalog","example":"Tekton"},"type":{"type":"string","description":"Type of catalog","example":"community","enum":["official","community"]}},"example":{"id":1,"name":"Tekton","type":"community"},"required":["id","name","type"]},"Category":{"type":"object","properties":{"id":{"type":"integer","description":"ID is the unique id of the category","example":1},"name":{"type":"string","description":"Name of category","example":"Image Builder"},"tags":{"type":"array","items":{"$ref":"#/components/schemas/Tag"},"description":"List of tags associated with the category","example":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]}},"example":{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]},"required":["id","name","tags"]},"Error":{"type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Internal Server Error","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"GetResponseBody":{"type":"object","properties":{"rating":{"type":"integer","description":"User rating for resource","example":4,"format":"int64"}},"example":{"rating":4},"required":["rating"]},"HubService":{"type":"object","properties":{"error":{"type":"string","description":"Details of the error if any","example":"unable to reach db"},"name":{"type":"string","description":"Name of the service","example":"api"},"status":{"type":"string","description":"Status of the service","example":"ok","enum":["ok","error"]}},"description":"Describes the services and their status","example":{"error":"unable to reach db","name":"api","status":"ok"},"required":["name","status"]},"Job":{"type":"object","properties":{"id":{"type":"integer","description":"id of the job","example":1775143685620788290},"status":{"type":"string","description":"status of the job","example":"Dolorum sapiente."}},"example":{"id":8451480480088601963,"status":"Vitae ducimus."},"required":["id","status"]},"ListResponseBody":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Category"},"example":[{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]},{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]}]}},"example":{"data":[{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]},{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]},{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]},{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]}]}},"RefreshConfigRequestBody":{"type":"object","properties":{"force":{"type":"boolean","description":"Force Refresh the config file","example":true}},"example":{"force":false},"required":["force"]},"RefreshConfigResponseBody":{"type":"object","properties":{"checksum":{"type":"string","description":"Config file checksum","example":"Sint omnis consequatur."}},"example":{"checksum":"Qui aut sed voluptas animi molestiae."},"required":["checksum"]},"Resource":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ResourceData"}},"example":{"data":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]}},"required":["data"]},"ResourceData":{"type":"object","properties":{"catalog":{"$ref":"#/components/schemas/Catalog"},"id":{"type":"integer","description":"ID is the unique id of the resource","example":1},"kind":{"type":"string","description":"Kind of resource","example":"task"},"latestVersion":{"$ref":"#/components/schemas/ResourceVersionData"},"name":{"type":"string","description":"Name of resource","example":"buildah"},"rating":{"type":"number","description":"Rating of resource","example":4.3,"format":"double"},"tags":{"type":"array","items":{"$ref":"#/components/schemas/Tag"},"description":"Tags related to resource","example":[{"id":1,"name":"image-build"}]},"versions":{"type":"array","items":{"$ref":"#/components/schemas/ResourceVersionData"},"description":"List of all versions of a resource","example":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]}},"description":"The resource type describes resource information.","example":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},"required":["id","name","catalog","kind","latestVersion","tags","rating","versions"]},"ResourceDataCollection":{"type":"array","items":{"$ref":"#/components/schemas/ResourceData"},"example":[{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]}]},"ResourceVersion":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ResourceVersionData"}},"example":{"data":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","resource":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]},"updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"}},"required":["data"]},"ResourceVersionData":{"type":"object","properties":{"description":{"type":"string","description":"Description of version","example":"Buildah task builds source into a container image and then pushes it to a container registry."},"displayName":{"type":"string","description":"Display name of version","example":"Buildah"},"id":{"type":"integer","description":"ID is the unique id of resource's version","example":1},"minPipelinesVersion":{"type":"string","description":"Minimum pipelines version the resource's version is compatible with","example":"0.12.1"},"rawURL":{"type":"string","description":"Raw URL of resource's yaml file of the version","example":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","format":"uri"},"resource":{"$ref":"#/components/schemas/ResourceData"},"updatedAt":{"type":"string","description":"Timestamp when version was last updated","example":"2020-01-01 12:00:00 +0000 UTC","format":"date-time"},"version":{"type":"string","description":"Version of resource","example":"0.1"},"webURL":{"type":"string","description":"Web URL of resource's yaml file of the version","example":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml","format":"uri"}},"description":"The Version result type describes resource's version information.","example":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","resource":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]},"updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"required":["id","version","displayName","description","minPipelinesVersion","rawURL","webURL","updatedAt","resource"]},"ResourceVersions":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Versions"}},"example":{"data":{"latest":{"id":2,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml","version":"0.2","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml"},"versions":[{"id":1,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},{"id":2,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml","version":"0.2","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml"}]}},"required":["data"]},"Resources":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ResourceDataCollection"}},"example":{"data":[{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]}]},"required":["data"]},"StatusResponseBody":{"type":"object","properties":{"services":{"type":"array","items":{"$ref":"#/components/schemas/HubService"},"description":"List of services and their status","example":[{"error":"unable to reach db","name":"api","status":"ok"},{"error":"unable to reach db","name":"api","status":"ok"},{"error":"unable to reach db","name":"api","status":"ok"},{"error":"unable to reach db","name":"api","status":"ok"}]}},"example":{"services":[{"error":"unable to reach db","name":"api","status":"ok"},{"error":"unable to reach db","name":"api","status":"ok"},{"error":"unable to reach db","name":"api","status":"ok"}]}},"Tag":{"type":"object","properties":{"id":{"type":"integer","description":"ID is the unique id of tag","example":1},"name":{"type":"string","description":"Name of tag","example":"image-build"}},"example":{"id":1,"name":"image-build"},"required":["id","name"]},"Token":{"type":"object","properties":{"expiresAt":{"type":"integer","description":"Time the token will expires at","example":0,"format":"int64"},"refreshInterval":{"type":"string","description":"Duration the token will Expire In","example":"1h30m"},"token":{"type":"string","description":"JWT","example":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"}},"description":"Token includes the JWT, Expire Duration \u0026 Time","example":{"expiresAt":0,"refreshInterval":"1h30m","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"},"required":["token","refreshInterval","expiresAt"]},"UpdateAgentRequestBody":{"type":"object","properties":{"name":{"type":"string","description":"Name of Agent","example":"Qui nam eos esse enim sint tempora."},"scopes":{"type":"array","items":{"type":"string","example":"Neque maxime nesciunt."},"description":"Scopes required for Agent","example":["Laboriosam incidunt neque asperiores.","Hic molestiae beatae dicta itaque."]}},"example":{"name":"Reiciendis aut repellat veritatis.","scopes":["Nulla ea.","Aperiam ipsam sapiente labore assumenda."]},"required":["name","scopes"]},"UpdateAgentResponseBody":{"type":"object","properties":{"token":{"type":"string","description":"Agent JWT","example":"Sequi officiis mollitia."}},"example":{"token":"Laudantium quidem amet suscipit fuga nam."},"required":["token"]},"UpdateRequestBody":{"type":"object","properties":{"rating":{"type":"integer","description":"User rating for resource","example":2,"minimum":0,"maximum":5}},"example":{"rating":4},"required":["rating"]},"Versions":{"type":"object","properties":{"latest":{"$ref":"#/components/schemas/ResourceVersionData"},"versions":{"type":"array","items":{"$ref":"#/components/schemas/ResourceVersionData"},"description":"List of all versions of resource","example":[{"id":1,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},{"id":2,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml","version":"0.2","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml"}]}},"description":"The Versions type describes response for versions by resource id API.","example":{"latest":{"id":2,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml","version":"0.2","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml"},"versions":[{"id":1,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},{"id":2,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml","version":"0.2","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml"}]},"required":["latest","versions"]}},"securitySchemes":{"jwt_header_Authorization":{"type":"http","description":"Secures endpoint by requiring a valid JWT retrieved via the /auth/login endpoint.","scheme":"bearer"}}}} \ No newline at end of file +{"openapi":"3.0.3","info":{"title":"Tekton Hub","description":"HTTP services for managing Tekton Hub","version":"1.0"},"servers":[{"url":"http://api.hub.tekton.dev"}],"paths":{"/":{"get":{"tags":["status"],"summary":"Status status","description":"Return status of the services","operationId":"status#Status","responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusResponseBody"},"example":{"services":[{"error":"unable to reach db","name":"api","status":"ok"},{"error":"unable to reach db","name":"api","status":"ok"},{"error":"unable to reach db","name":"api","status":"ok"},{"error":"unable to reach db","name":"api","status":"ok"}]}}}}}}},"/auth/login":{"post":{"tags":["auth"],"summary":"Authenticate auth","description":"Authenticates users against GitHub OAuth","operationId":"auth#Authenticate","parameters":[{"name":"code","in":"query","description":"OAuth Authorization code of User","allowEmptyValue":true,"required":true,"schema":{"type":"string","description":"OAuth Authorization code of User","example":"5628b69ec09c09512eef"},"example":"5628b69ec09c09512eef"}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthenticateResponseBody"},"example":{"data":{"access":{"expiresAt":0,"refreshInterval":"1h30m","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"},"refresh":{"expiresAt":0,"refreshInterval":"1h30m","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"}}}}}},"400":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true}}}},"401":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false}}}},"403":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false}}}}}}},"/catalog/refresh":{"post":{"tags":["catalog"],"summary":"Refresh catalog","description":"Refreshes Tekton Catalog","operationId":"catalog#Refresh","responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"},"example":{"id":13680623773748373161,"status":"Pariatur quasi."}}}},"404":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true}}}}},"security":[{"jwt_header_Authorization":["rating:read","rating:write","agent:create","catalog:refresh","config:refresh"]}]}},"/categories":{"get":{"tags":["category"],"summary":"list category","description":"List all categories along with their tags sorted by name","operationId":"category#list","responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListResponseBody"},"example":{"data":[{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]},{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]},{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]},{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]}]}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true}}}}}}},"/query":{"get":{"tags":["resource"],"summary":"Query resource","description":"Find resources by a combination of name, kind and tags","operationId":"resource#Query","parameters":[{"name":"name","in":"query","description":"Name of resource","allowEmptyValue":true,"schema":{"type":"string","description":"Name of resource","default":"","example":"buildah"},"example":"buildah"},{"name":"kinds","in":"query","description":"Kinds of resource to filter by","allowEmptyValue":true,"schema":{"type":"array","items":{"type":"string","example":"Et nam pariatur corrupti atque."},"description":"Kinds of resource to filter by","example":["task","pipelines"]},"example":["task","pipelines"]},{"name":"tags","in":"query","description":"Tags associated with a resource to filter by","allowEmptyValue":true,"schema":{"type":"array","items":{"type":"string","example":"Expedita sit repellendus magnam."},"description":"Tags associated with a resource to filter by","example":["image","build"]},"example":["image","build"]},{"name":"limit","in":"query","description":"Maximum number of resources to be returned","allowEmptyValue":true,"schema":{"type":"integer","description":"Maximum number of resources to be returned","default":1000,"example":100},"example":100},{"name":"match","in":"query","description":"Strategy used to find matching resources","allowEmptyValue":true,"schema":{"type":"string","description":"Strategy used to find matching resources","default":"contains","example":"contains","enum":["exact","contains"]},"example":"exact"}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Resources"},"example":{"data":[{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]}]}}}},"400":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false}}}},"404":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true}}}}}}},"/resource/version/{versionID}":{"get":{"tags":["resource"],"summary":"ByVersionId resource","description":"Find a resource using its version's id","operationId":"resource#ByVersionId","parameters":[{"name":"versionID","in":"path","description":"Version ID of a resource's version","required":true,"schema":{"type":"integer","description":"Version ID of a resource's version","example":1},"example":1}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceVersion"},"example":{"data":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","resource":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]},"updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"}}}}},"404":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false}}}}}}},"/resource/{catalog}/{kind}/{name}":{"get":{"tags":["resource"],"summary":"ByCatalogKindName resource","description":"Find resources using name of catalog, resource name and kind of resource","operationId":"resource#ByCatalogKindName","parameters":[{"name":"catalog","in":"path","description":"name of catalog","required":true,"schema":{"type":"string","description":"name of catalog","example":"tektoncd"},"example":"tektoncd"},{"name":"kind","in":"path","description":"kind of resource","required":true,"schema":{"type":"string","description":"kind of resource","example":"task","enum":["task","pipeline"]},"example":"task"},{"name":"name","in":"path","description":"Name of resource","required":true,"schema":{"type":"string","description":"Name of resource","example":"buildah"},"example":"buildah"}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Resource"},"example":{"data":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]}}}}},"404":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false}}}}}}},"/resource/{catalog}/{kind}/{name}/{version}":{"get":{"tags":["resource"],"summary":"ByCatalogKindNameVersion resource","description":"Find resource using name of catalog \u0026 name, kind and version of resource","operationId":"resource#ByCatalogKindNameVersion","parameters":[{"name":"catalog","in":"path","description":"name of catalog","required":true,"schema":{"type":"string","description":"name of catalog","example":"tektoncd"},"example":"tektoncd"},{"name":"kind","in":"path","description":"kind of resource","required":true,"schema":{"type":"string","description":"kind of resource","example":"pipeline","enum":["task","pipeline"]},"example":"task"},{"name":"name","in":"path","description":"name of resource","required":true,"schema":{"type":"string","description":"name of resource","example":"buildah"},"example":"buildah"},{"name":"version","in":"path","description":"version of resource","required":true,"schema":{"type":"string","description":"version of resource","example":"0.1"},"example":"0.1"}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceVersion"},"example":{"data":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","resource":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]},"updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"}}}}},"404":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true}}}}}}},"/resource/{id}":{"get":{"tags":["resource"],"summary":"ById resource","description":"Find a resource using it's id","operationId":"resource#ById","parameters":[{"name":"id","in":"path","description":"ID of a resource","required":true,"schema":{"type":"integer","description":"ID of a resource","example":1},"example":1}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Resource"},"example":{"data":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]}}}}},"404":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false}}}}}}},"/resource/{id}/rating":{"get":{"tags":["rating"],"summary":"Get rating","description":"Find user's rating for a resource","operationId":"rating#Get","parameters":[{"name":"id","in":"path","description":"ID of a resource","required":true,"schema":{"type":"integer","description":"ID of a resource","example":9293410832204462916},"example":15595973357138799589}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetResponseBody"},"example":{"rating":4}}}},"401":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false}}}},"403":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false}}}},"404":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false}}}}},"security":[{"jwt_header_Authorization":["rating:read","rating:write","agent:create","catalog:refresh","config:refresh"]}]},"put":{"tags":["rating"],"summary":"Update rating","description":"Update user's rating for a resource","operationId":"rating#Update","parameters":[{"name":"id","in":"path","description":"ID of a resource","required":true,"schema":{"type":"integer","description":"ID of a resource","example":5038586986718798316},"example":12822747110185372831}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRequestBody"},"example":{"rating":0}}}},"responses":{"200":{"description":"","content":{"application/json":{"example":{}}}},"401":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false}}}},"403":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true}}}},"404":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false}}}}},"security":[{"jwt_header_Authorization":["rating:read","rating:write","agent:create","catalog:refresh","config:refresh"]}]}},"/resource/{id}/versions":{"get":{"tags":["resource"],"summary":"VersionsByID resource","description":"Find all versions of a resource by its id","operationId":"resource#VersionsByID","parameters":[{"name":"id","in":"path","description":"ID of a resource","required":true,"schema":{"type":"integer","description":"ID of a resource","example":1},"example":1}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceVersions"},"example":{"data":{"latest":{"id":2,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml","version":"0.2","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml"},"versions":[{"id":1,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},{"id":2,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml","version":"0.2","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml"}]}}}}},"404":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false}}}}}}},"/resources":{"get":{"tags":["resource"],"summary":"List resource","description":"List all resources sorted by rating and name","operationId":"resource#List","parameters":[{"name":"limit","in":"query","description":"Maximum number of resources to be returned","allowEmptyValue":true,"schema":{"type":"integer","description":"Maximum number of resources to be returned","default":1000,"example":100},"example":100}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Resources"},"example":{"data":[{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]}]}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false}}}}}}},"/schema/swagger.json":{"get":{"tags":["swagger"],"summary":"Download gen/http/openapi3.yaml","description":"JSON document containing the API swagger definition","operationId":"swagger#/schema/swagger.json","responses":{"200":{"description":"File downloaded"}}}},"/system/config/refresh":{"post":{"tags":["admin"],"summary":"RefreshConfig admin","description":"Refresh the changes in config file","operationId":"admin#RefreshConfig","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefreshConfigRequestBody"},"example":{"force":true}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefreshConfigResponseBody"},"example":{"checksum":"Cumque omnis non."}}}},"401":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true}}}},"403":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false}}}}},"security":[{"jwt_header_Authorization":["rating:read","rating:write","agent:create","catalog:refresh","config:refresh"]}]}},"/system/user/agent":{"put":{"tags":["admin"],"summary":"UpdateAgent admin","description":"Create or Update an agent user with required scopes","operationId":"admin#UpdateAgent","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAgentRequestBody"},"example":{"name":"Non omnis quas deserunt.","scopes":["Pariatur occaecati voluptas assumenda maiores quaerat consequatur.","Quia nihil officia itaque."]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAgentResponseBody"},"example":{"token":"Autem ut est error eaque."}}}},"400":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false}}}},"401":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true}}}},"403":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true}}}}},"security":[{"jwt_header_Authorization":["rating:read","rating:write","agent:create","catalog:refresh","config:refresh"]}]}},"/v1":{"get":{"tags":["status"],"summary":"Status status","description":"Return status of the services","operationId":"status#Status#1","responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusResponseBody"},"example":{"services":[{"error":"unable to reach db","name":"api","status":"ok"},{"error":"unable to reach db","name":"api","status":"ok"},{"error":"unable to reach db","name":"api","status":"ok"},{"error":"unable to reach db","name":"api","status":"ok"}]}}}}}}}},"components":{"schemas":{"AuthTokens":{"type":"object","properties":{"access":{"$ref":"#/components/schemas/Token"},"refresh":{"$ref":"#/components/schemas/Token"}},"description":"Auth tokens have access and refresh token for user","example":{"access":{"expiresAt":0,"refreshInterval":"1h30m","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"},"refresh":{"expiresAt":0,"refreshInterval":"1h30m","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"}}},"AuthenticateResponseBody":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AuthTokens"}},"example":{"data":{"access":{"expiresAt":0,"refreshInterval":"1h30m","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"},"refresh":{"expiresAt":0,"refreshInterval":"1h30m","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"}}},"required":["data"]},"Catalog":{"type":"object","properties":{"id":{"type":"integer","description":"ID is the unique id of the catalog","example":1},"name":{"type":"string","description":"Name of catalog","example":"Tekton"},"type":{"type":"string","description":"Type of catalog","example":"community","enum":["official","community"]}},"example":{"id":1,"name":"Tekton","type":"community"},"required":["id","name","type"]},"Category":{"type":"object","properties":{"id":{"type":"integer","description":"ID is the unique id of the category","example":1},"name":{"type":"string","description":"Name of category","example":"Image Builder"},"tags":{"type":"array","items":{"$ref":"#/components/schemas/Tag"},"description":"List of tags associated with the category","example":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]}},"example":{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]},"required":["id","name","tags"]},"Error":{"type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Invalid request body","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"GetResponseBody":{"type":"object","properties":{"rating":{"type":"integer","description":"User rating for resource","example":4,"format":"int64"}},"example":{"rating":4},"required":["rating"]},"HubService":{"type":"object","properties":{"error":{"type":"string","description":"Details of the error if any","example":"unable to reach db"},"name":{"type":"string","description":"Name of the service","example":"api"},"status":{"type":"string","description":"Status of the service","example":"ok","enum":["ok","error"]}},"description":"Describes the services and their status","example":{"error":"unable to reach db","name":"api","status":"ok"},"required":["name","status"]},"Job":{"type":"object","properties":{"id":{"type":"integer","description":"id of the job","example":8451480480088601963},"status":{"type":"string","description":"status of the job","example":"Vitae ducimus."}},"example":{"id":3463136335453028454,"status":"Autem aut id."},"required":["id","status"]},"ListResponseBody":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Category"},"example":[{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]},{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]}]}},"example":{"data":[{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]},{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]}]}},"RefreshConfigRequestBody":{"type":"object","properties":{"force":{"type":"boolean","description":"Force Refresh the config file","example":true}},"example":{"force":false},"required":["force"]},"RefreshConfigResponseBody":{"type":"object","properties":{"checksum":{"type":"string","description":"Config file checksum","example":"Quas veniam."}},"example":{"checksum":"Accusamus ut dolorum sapiente."},"required":["checksum"]},"Resource":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ResourceData"}},"example":{"data":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]}},"required":["data"]},"ResourceData":{"type":"object","properties":{"catalog":{"$ref":"#/components/schemas/Catalog"},"id":{"type":"integer","description":"ID is the unique id of the resource","example":1},"kind":{"type":"string","description":"Kind of resource","example":"task"},"latestVersion":{"$ref":"#/components/schemas/ResourceVersionData"},"name":{"type":"string","description":"Name of resource","example":"buildah"},"rating":{"type":"number","description":"Rating of resource","example":4.3,"format":"double"},"tags":{"type":"array","items":{"$ref":"#/components/schemas/Tag"},"description":"Tags related to resource","example":[{"id":1,"name":"image-build"}]},"versions":{"type":"array","items":{"$ref":"#/components/schemas/ResourceVersionData"},"description":"List of all versions of a resource","example":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]}},"description":"The resource type describes resource information.","example":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},"required":["id","name","catalog","kind","latestVersion","tags","rating","versions"]},"ResourceDataCollection":{"type":"array","items":{"$ref":"#/components/schemas/ResourceData"},"example":[{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]}]},"ResourceVersion":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ResourceVersionData"}},"example":{"data":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","resource":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]},"updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"}},"required":["data"]},"ResourceVersionData":{"type":"object","properties":{"description":{"type":"string","description":"Description of version","example":"Buildah task builds source into a container image and then pushes it to a container registry."},"displayName":{"type":"string","description":"Display name of version","example":"Buildah"},"id":{"type":"integer","description":"ID is the unique id of resource's version","example":1},"minPipelinesVersion":{"type":"string","description":"Minimum pipelines version the resource's version is compatible with","example":"0.12.1"},"rawURL":{"type":"string","description":"Raw URL of resource's yaml file of the version","example":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","format":"uri"},"resource":{"$ref":"#/components/schemas/ResourceData"},"updatedAt":{"type":"string","description":"Timestamp when version was last updated","example":"2020-01-01 12:00:00 +0000 UTC","format":"date-time"},"version":{"type":"string","description":"Version of resource","example":"0.1"},"webURL":{"type":"string","description":"Web URL of resource's yaml file of the version","example":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml","format":"uri"}},"description":"The Version result type describes resource's version information.","example":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","resource":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]},"updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"required":["id","version","displayName","description","minPipelinesVersion","rawURL","webURL","updatedAt","resource"]},"ResourceVersions":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Versions"}},"example":{"data":{"latest":{"id":2,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml","version":"0.2","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml"},"versions":[{"id":1,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},{"id":2,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml","version":"0.2","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml"}]}},"required":["data"]},"Resources":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ResourceDataCollection"}},"example":{"data":[{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]}]},"required":["data"]},"StatusResponseBody":{"type":"object","properties":{"services":{"type":"array","items":{"$ref":"#/components/schemas/HubService"},"description":"List of services and their status","example":[{"error":"unable to reach db","name":"api","status":"ok"},{"error":"unable to reach db","name":"api","status":"ok"}]}},"example":{"services":[{"error":"unable to reach db","name":"api","status":"ok"},{"error":"unable to reach db","name":"api","status":"ok"},{"error":"unable to reach db","name":"api","status":"ok"},{"error":"unable to reach db","name":"api","status":"ok"}]}},"Tag":{"type":"object","properties":{"id":{"type":"integer","description":"ID is the unique id of tag","example":1},"name":{"type":"string","description":"Name of tag","example":"image-build"}},"example":{"id":1,"name":"image-build"},"required":["id","name"]},"Token":{"type":"object","properties":{"expiresAt":{"type":"integer","description":"Time the token will expires at","example":0,"format":"int64"},"refreshInterval":{"type":"string","description":"Duration the token will Expire In","example":"1h30m"},"token":{"type":"string","description":"JWT","example":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"}},"description":"Token includes the JWT, Expire Duration \u0026 Time","example":{"expiresAt":0,"refreshInterval":"1h30m","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"},"required":["token","refreshInterval","expiresAt"]},"UpdateAgentRequestBody":{"type":"object","properties":{"name":{"type":"string","description":"Name of Agent","example":"Et nam quia incidunt accusamus."},"scopes":{"type":"array","items":{"type":"string","example":"Non eum praesentium corrupti et qui nam."},"description":"Scopes required for Agent","example":["Enim sint tempora.","Neque maxime nesciunt."]}},"example":{"name":"Debitis laboriosam incidunt neque asperiores reiciendis hic.","scopes":["Dicta itaque possimus.","Aut repellat.","Qui accusantium nulla ea rem.","Ipsam sapiente labore assumenda qui sequi officiis."]},"required":["name","scopes"]},"UpdateAgentResponseBody":{"type":"object","properties":{"token":{"type":"string","description":"Agent JWT","example":"Dolorem laudantium quidem amet suscipit fuga."}},"example":{"token":"Dolorem eveniet qui sint omnis."},"required":["token"]},"UpdateRequestBody":{"type":"object","properties":{"rating":{"type":"integer","description":"User rating for resource","example":1,"minimum":0,"maximum":5}},"example":{"rating":0},"required":["rating"]},"Versions":{"type":"object","properties":{"latest":{"$ref":"#/components/schemas/ResourceVersionData"},"versions":{"type":"array","items":{"$ref":"#/components/schemas/ResourceVersionData"},"description":"List of all versions of resource","example":[{"id":1,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},{"id":2,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml","version":"0.2","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml"}]}},"description":"The Versions type describes response for versions by resource id API.","example":{"latest":{"id":2,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml","version":"0.2","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml"},"versions":[{"id":1,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},{"id":2,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml","version":"0.2","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml"}]},"required":["latest","versions"]}},"securitySchemes":{"jwt_header_Authorization":{"type":"http","description":"Secures endpoint by requiring a valid JWT retrieved via the /auth/login endpoint.","scheme":"bearer"}}}} \ No newline at end of file diff --git a/api/gen/http/openapi3.yaml b/api/gen/http/openapi3.yaml index 020deaccc7..702ecf3cd4 100644 --- a/api/gen/http/openapi3.yaml +++ b/api/gen/http/openapi3.yaml @@ -28,6 +28,12 @@ paths: - error: unable to reach db name: api status: ok + - error: unable to reach db + name: api + status: ok + - error: unable to reach db + name: api + status: ok /auth/login: post: tags: @@ -74,8 +80,8 @@ paths: id: 123abc message: parameter 'p' must be an integer name: bad_request - temporary: false - timeout: false + temporary: true + timeout: true "401": description: "" content: @@ -87,8 +93,8 @@ paths: id: 123abc message: parameter 'p' must be an integer name: bad_request - temporary: false - timeout: true + temporary: true + timeout: false "403": description: "" content: @@ -101,7 +107,7 @@ paths: message: parameter 'p' must be an integer name: bad_request temporary: false - timeout: false + timeout: true "500": description: "" content: @@ -130,8 +136,8 @@ paths: schema: $ref: '#/components/schemas/Job' example: - id: 1029125940089474859 - status: Reprehenderit libero soluta sapiente deleniti voluptatem distinctio. + id: 13680623773748373161 + status: Pariatur quasi. "404": description: "" content: @@ -143,8 +149,8 @@ paths: id: 123abc message: parameter 'p' must be an integer name: bad_request - temporary: true - timeout: true + temporary: false + timeout: false "500": description: "" content: @@ -152,12 +158,12 @@ paths: schema: $ref: '#/components/schemas/Error' example: - fault: false + fault: true id: 123abc message: parameter 'p' must be an integer name: bad_request - temporary: true - timeout: false + temporary: false + timeout: true security: - jwt_header_Authorization: - rating:read @@ -195,6 +201,20 @@ paths: name: image-build - id: 2 name: kaniko + - id: 1 + name: Image Builder + tags: + - id: 1 + name: image-build + - id: 2 + name: kaniko + - id: 1 + name: Image Builder + tags: + - id: 1 + name: image-build + - id: 2 + name: kaniko "500": description: "" content: @@ -202,12 +222,12 @@ paths: schema: $ref: '#/components/schemas/Error' example: - fault: false + fault: true id: 123abc message: parameter 'p' must be an integer name: bad_request temporary: false - timeout: false + timeout: true /query: get: tags: @@ -234,7 +254,7 @@ paths: type: array items: type: string - example: Placeat et et. + example: Et nam pariatur corrupti atque. description: Kinds of resource to filter by example: - task @@ -250,7 +270,7 @@ paths: type: array items: type: string - example: Itaque aperiam tempore animi iure eum et. + example: Expedita sit repellendus magnam. description: Tags associated with a resource to filter by example: - image @@ -296,7 +316,8 @@ paths: id: 1 kind: task latestVersion: - description: Buildah task builds source into a container image and then pushes it to a container registry. + description: Buildah task builds source into a container image + and then pushes it to a container registry. displayName: Buildah id: 1 minPipelinesVersion: 0.12.1 @@ -320,7 +341,8 @@ paths: id: 1 kind: task latestVersion: - description: Buildah task builds source into a container image and then pushes it to a container registry. + description: Buildah task builds source into a container image + and then pushes it to a container registry. displayName: Buildah id: 1 minPipelinesVersion: 0.12.1 @@ -344,7 +366,8 @@ paths: id: 1 kind: task latestVersion: - description: Buildah task builds source into a container image and then pushes it to a container registry. + description: Buildah task builds source into a container image + and then pushes it to a container registry. displayName: Buildah id: 1 minPipelinesVersion: 0.12.1 @@ -373,8 +396,8 @@ paths: id: 123abc message: parameter 'p' must be an integer name: bad_request - temporary: true - timeout: true + temporary: false + timeout: false "404": description: "" content: @@ -387,7 +410,7 @@ paths: message: parameter 'p' must be an integer name: bad_request temporary: true - timeout: false + timeout: true "500": description: "" content: @@ -406,7 +429,8 @@ paths: tags: - resource summary: ByCatalogKindName resource - description: Find resources using name of catalog, resource name and kind of resource + description: Find resources using name of catalog, resource name and kind of + resource operationId: resource#ByCatalogKindName parameters: - name: catalog @@ -429,7 +453,7 @@ paths: enum: - task - pipeline - example: pipeline + example: task - name: name in: path description: Name of resource @@ -454,7 +478,8 @@ paths: id: 1 kind: task latestVersion: - description: Buildah task builds source into a container image and then pushes it to a container registry. + description: Buildah task builds source into a container image + and then pushes it to a container registry. displayName: Buildah id: 1 minPipelinesVersion: 0.12.1 @@ -503,7 +528,8 @@ paths: tags: - resource summary: ByCatalogKindNameVersion resource - description: Find resource using name of catalog & name, kind and version of resource + description: Find resource using name of catalog & name, kind and version of + resource operationId: resource#ByCatalogKindNameVersion parameters: - name: catalog @@ -554,7 +580,8 @@ paths: $ref: '#/components/schemas/ResourceVersion' example: data: - description: Buildah task builds source into a container image and then pushes it to a container registry. + description: Buildah task builds source into a container image and + then pushes it to a container registry. displayName: Buildah id: 1 minPipelinesVersion: 0.12.1 @@ -584,7 +611,7 @@ paths: id: 123abc message: parameter 'p' must be an integer name: bad_request - temporary: true + temporary: false timeout: true "500": description: "" @@ -593,7 +620,7 @@ paths: schema: $ref: '#/components/schemas/Error' example: - fault: true + fault: false id: 123abc message: parameter 'p' must be an integer name: bad_request @@ -631,7 +658,8 @@ paths: id: 1 kind: task latestVersion: - description: Buildah task builds source into a container image and then pushes it to a container registry. + description: Buildah task builds source into a container image + and then pushes it to a container registry. displayName: Buildah id: 1 minPipelinesVersion: 0.12.1 @@ -656,12 +684,12 @@ paths: schema: $ref: '#/components/schemas/Error' example: - fault: true + fault: false id: 123abc message: parameter 'p' must be an integer name: bad_request - temporary: false - timeout: true + temporary: true + timeout: false "500": description: "" content: @@ -673,8 +701,8 @@ paths: id: 123abc message: parameter 'p' must be an integer name: bad_request - temporary: false - timeout: true + temporary: true + timeout: false /resource/{id}/rating: get: tags: @@ -690,8 +718,8 @@ paths: schema: type: integer description: ID of a resource - example: 11620657542064230955 - example: 11665674017405905075 + example: 9293410832204462916 + example: 15595973357138799589 responses: "200": description: "" @@ -708,7 +736,7 @@ paths: schema: $ref: '#/components/schemas/Error' example: - fault: false + fault: true id: 123abc message: parameter 'p' must be an integer name: bad_request @@ -725,7 +753,7 @@ paths: id: 123abc message: parameter 'p' must be an integer name: bad_request - temporary: true + temporary: false timeout: false "404": description: "" @@ -734,12 +762,12 @@ paths: schema: $ref: '#/components/schemas/Error' example: - fault: true + fault: false id: 123abc message: parameter 'p' must be an integer name: bad_request temporary: false - timeout: true + timeout: false "500": description: "" content: @@ -752,7 +780,7 @@ paths: message: parameter 'p' must be an integer name: bad_request temporary: false - timeout: true + timeout: false security: - jwt_header_Authorization: - rating:read @@ -774,8 +802,8 @@ paths: schema: type: integer description: ID of a resource - example: 4869966896348576719 - example: 6109420220413662287 + example: 5038586986718798316 + example: 12822747110185372831 requestBody: required: true content: @@ -810,12 +838,12 @@ paths: schema: $ref: '#/components/schemas/Error' example: - fault: false + fault: true id: 123abc message: parameter 'p' must be an integer name: bad_request - temporary: false - timeout: false + temporary: true + timeout: true "404": description: "" content: @@ -823,12 +851,12 @@ paths: schema: $ref: '#/components/schemas/Error' example: - fault: false + fault: true id: 123abc message: parameter 'p' must be an integer name: bad_request - temporary: false - timeout: true + temporary: true + timeout: false "500": description: "" content: @@ -836,11 +864,11 @@ paths: schema: $ref: '#/components/schemas/Error' example: - fault: false + fault: true id: 123abc message: parameter 'p' must be an integer name: bad_request - temporary: true + temporary: false timeout: false security: - jwt_header_Authorization: @@ -896,12 +924,12 @@ paths: schema: $ref: '#/components/schemas/Error' example: - fault: false + fault: true id: 123abc message: parameter 'p' must be an integer name: bad_request temporary: true - timeout: false + timeout: true "500": description: "" content: @@ -909,12 +937,12 @@ paths: schema: $ref: '#/components/schemas/Error' example: - fault: true + fault: false id: 123abc message: parameter 'p' must be an integer name: bad_request - temporary: true - timeout: true + temporary: false + timeout: false /resource/version/{versionID}: get: tags: @@ -941,7 +969,8 @@ paths: $ref: '#/components/schemas/ResourceVersion' example: data: - description: Buildah task builds source into a container image and then pushes it to a container registry. + description: Buildah task builds source into a container image and + then pushes it to a container registry. displayName: Buildah id: 1 minPipelinesVersion: 0.12.1 @@ -971,8 +1000,8 @@ paths: id: 123abc message: parameter 'p' must be an integer name: bad_request - temporary: false - timeout: true + temporary: true + timeout: false "500": description: "" content: @@ -984,8 +1013,8 @@ paths: id: 123abc message: parameter 'p' must be an integer name: bad_request - temporary: false - timeout: true + temporary: true + timeout: false /resources: get: tags: @@ -1019,7 +1048,8 @@ paths: id: 1 kind: task latestVersion: - description: Buildah task builds source into a container image and then pushes it to a container registry. + description: Buildah task builds source into a container image + and then pushes it to a container registry. displayName: Buildah id: 1 minPipelinesVersion: 0.12.1 @@ -1043,7 +1073,8 @@ paths: id: 1 kind: task latestVersion: - description: Buildah task builds source into a container image and then pushes it to a container registry. + description: Buildah task builds source into a container image + and then pushes it to a container registry. displayName: Buildah id: 1 minPipelinesVersion: 0.12.1 @@ -1067,7 +1098,8 @@ paths: id: 1 kind: task latestVersion: - description: Buildah task builds source into a container image and then pushes it to a container registry. + description: Buildah task builds source into a container image + and then pushes it to a container registry. displayName: Buildah id: 1 minPipelinesVersion: 0.12.1 @@ -1096,7 +1128,7 @@ paths: id: 123abc message: parameter 'p' must be an integer name: bad_request - temporary: true + temporary: false timeout: false /schema/swagger.json: get: @@ -1131,7 +1163,7 @@ paths: schema: $ref: '#/components/schemas/RefreshConfigResponseBody' example: - checksum: Ipsam eos aut magnam. + checksum: Cumque omnis non. "401": description: "" content: @@ -1143,7 +1175,7 @@ paths: id: 123abc message: parameter 'p' must be an integer name: bad_request - temporary: true + temporary: false timeout: true "403": description: "" @@ -1152,7 +1184,7 @@ paths: schema: $ref: '#/components/schemas/Error' example: - fault: false + fault: true id: 123abc message: parameter 'p' must be an integer name: bad_request @@ -1165,12 +1197,12 @@ paths: schema: $ref: '#/components/schemas/Error' example: - fault: false + fault: true id: 123abc message: parameter 'p' must be an integer name: bad_request - temporary: true - timeout: true + temporary: false + timeout: false security: - jwt_header_Authorization: - rating:read @@ -1192,10 +1224,10 @@ paths: schema: $ref: '#/components/schemas/UpdateAgentRequestBody' example: - name: Pariatur occaecati voluptas assumenda maiores quaerat consequatur. + name: Non omnis quas deserunt. scopes: - - Nihil officia itaque non. - - Qui dolor consequatur assumenda. + - Pariatur occaecati voluptas assumenda maiores quaerat consequatur. + - Quia nihil officia itaque. responses: "200": description: "" @@ -1204,7 +1236,7 @@ paths: schema: $ref: '#/components/schemas/UpdateAgentResponseBody' example: - token: Commodi rerum harum ut tenetur laborum tempore. + token: Autem ut est error eaque. "400": description: "" content: @@ -1238,12 +1270,12 @@ paths: schema: $ref: '#/components/schemas/Error' example: - fault: true + fault: false id: 123abc message: parameter 'p' must be an integer name: bad_request temporary: false - timeout: true + timeout: false "500": description: "" content: @@ -1251,12 +1283,12 @@ paths: schema: $ref: '#/components/schemas/Error' example: - fault: true + fault: false id: 123abc message: parameter 'p' must be an integer name: bad_request temporary: true - timeout: false + timeout: true security: - jwt_header_Authorization: - rating:read @@ -1264,809 +1296,78 @@ paths: - agent:create - catalog:refresh - config:refresh - /v1/categories: + /v1: get: tags: - - category - summary: list category - description: List all categories along with their tags sorted by name - operationId: category#list#1 + - status + summary: Status status + description: Return status of the services + operationId: status#Status#1 responses: "200": description: "" content: application/json: schema: - $ref: '#/components/schemas/ListResponseBody' - example: - data: - - id: 1 - name: Image Builder - tags: - - id: 1 - name: image-build - - id: 2 - name: kaniko - - id: 1 - name: Image Builder - tags: - - id: 1 - name: image-build - - id: 2 - name: kaniko - "500": - description: "" - content: - application/vnd.goa.error: - schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/schemas/StatusResponseBody' example: - fault: false - id: 123abc - message: parameter 'p' must be an integer - name: bad_request - temporary: false - timeout: false - /v1/query: - get: - tags: - - resource - summary: Query resource - description: Find resources by a combination of name, kind and tags - operationId: resource#Query#1 - parameters: - - name: name - in: query - description: Name of resource - allowEmptyValue: true - schema: - type: string - description: Name of resource - default: "" - example: buildah - example: buildah - - name: kinds - in: query - description: Kinds of resource to filter by - allowEmptyValue: true - schema: - type: array - items: - type: string - example: Corrupti atque odit expedita sit repellendus. - description: Kinds of resource to filter by - example: - - task - - pipelines - example: - - task - - pipelines - - name: tags - in: query - description: Tags associated with a resource to filter by - allowEmptyValue: true - schema: - type: array - items: - type: string - example: Consequatur numquam id aut illum ut rerum. - description: Tags associated with a resource to filter by - example: - - image - - build - example: - - image - - build - - name: limit - in: query - description: Maximum number of resources to be returned - allowEmptyValue: true - schema: - type: integer - description: Maximum number of resources to be returned - default: 1000 - example: 100 - example: 100 - - name: match - in: query - description: Strategy used to find matching resources - allowEmptyValue: true - schema: - type: string - description: Strategy used to find matching resources - default: contains - example: contains - enum: - - exact - - contains - example: exact - responses: - "200": - description: "" - content: - application/json: - schema: - $ref: '#/components/schemas/Resources' - example: - data: - - catalog: - id: 1 - type: community - id: 1 - kind: task - latestVersion: - description: Buildah task builds source into a container image and then pushes it to a container registry. - displayName: Buildah - id: 1 - minPipelinesVersion: 0.12.1 - rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml - updatedAt: 2020-01-01 12:00:00 +0000 UTC - version: "0.1" - webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml - name: buildah - rating: 4.3 - tags: - - id: 1 - name: image-build - versions: - - id: 1 - version: "0.1" - - id: 2 - version: "0.2" - - catalog: - id: 1 - type: community - id: 1 - kind: task - latestVersion: - description: Buildah task builds source into a container image and then pushes it to a container registry. - displayName: Buildah - id: 1 - minPipelinesVersion: 0.12.1 - rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml - updatedAt: 2020-01-01 12:00:00 +0000 UTC - version: "0.1" - webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml - name: buildah - rating: 4.3 - tags: - - id: 1 - name: image-build - versions: - - id: 1 - version: "0.1" - - id: 2 - version: "0.2" - - catalog: - id: 1 - type: community - id: 1 - kind: task - latestVersion: - description: Buildah task builds source into a container image and then pushes it to a container registry. - displayName: Buildah - id: 1 - minPipelinesVersion: 0.12.1 - rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml - updatedAt: 2020-01-01 12:00:00 +0000 UTC - version: "0.1" - webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml - name: buildah - rating: 4.3 - tags: - - id: 1 - name: image-build - versions: - - id: 1 - version: "0.1" - - id: 2 - version: "0.2" - "400": - description: "" - content: - application/vnd.goa.error: - schema: - $ref: '#/components/schemas/Error' - example: - fault: true - id: 123abc - message: parameter 'p' must be an integer - name: bad_request - temporary: true - timeout: true - "404": - description: "" - content: - application/vnd.goa.error: - schema: - $ref: '#/components/schemas/Error' - example: - fault: true - id: 123abc - message: parameter 'p' must be an integer - name: bad_request - temporary: true - timeout: false - "500": - description: "" - content: - application/vnd.goa.error: - schema: - $ref: '#/components/schemas/Error' - example: - fault: true - id: 123abc - message: parameter 'p' must be an integer - name: bad_request - temporary: false - timeout: true - /v1/resource/{catalog}/{kind}/{name}: - get: - tags: - - resource - summary: ByCatalogKindName resource - description: Find resources using name of catalog, resource name and kind of resource - operationId: resource#ByCatalogKindName#1 - parameters: - - name: catalog - in: path - description: name of catalog - required: true - schema: - type: string - description: name of catalog - example: tektoncd - example: tektoncd - - name: kind - in: path - description: kind of resource - required: true - schema: - type: string - description: kind of resource - example: pipeline - enum: - - task - - pipeline - example: pipeline - - name: name - in: path - description: Name of resource - required: true - schema: - type: string - description: Name of resource - example: buildah - example: buildah - responses: - "200": - description: "" - content: - application/json: - schema: - $ref: '#/components/schemas/Resource' - example: - data: - catalog: - id: 1 - type: community - id: 1 - kind: task - latestVersion: - description: Buildah task builds source into a container image and then pushes it to a container registry. - displayName: Buildah - id: 1 - minPipelinesVersion: 0.12.1 - rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml - updatedAt: 2020-01-01 12:00:00 +0000 UTC - version: "0.1" - webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml - name: buildah - rating: 4.3 - tags: - - id: 1 - name: image-build - versions: - - id: 1 - version: "0.1" - - id: 2 - version: "0.2" - "404": - description: "" - content: - application/vnd.goa.error: - schema: - $ref: '#/components/schemas/Error' - example: - fault: true - id: 123abc - message: parameter 'p' must be an integer - name: bad_request - temporary: false - timeout: false - "500": - description: "" - content: - application/vnd.goa.error: - schema: - $ref: '#/components/schemas/Error' - example: - fault: true - id: 123abc - message: parameter 'p' must be an integer - name: bad_request - temporary: true - timeout: false - /v1/resource/{catalog}/{kind}/{name}/{version}: - get: - tags: - - resource - summary: ByCatalogKindNameVersion resource - description: Find resource using name of catalog & name, kind and version of resource - operationId: resource#ByCatalogKindNameVersion#1 - parameters: - - name: catalog - in: path - description: name of catalog - required: true - schema: - type: string - description: name of catalog - example: tektoncd - example: tektoncd - - name: kind - in: path - description: kind of resource - required: true - schema: - type: string - description: kind of resource - example: pipeline - enum: - - task - - pipeline - example: pipeline - - name: name - in: path - description: name of resource - required: true - schema: - type: string - description: name of resource - example: buildah - example: buildah - - name: version - in: path - description: version of resource - required: true - schema: - type: string - description: version of resource - example: "0.1" - example: "0.1" - responses: - "200": - description: "" - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceVersion' - example: - data: - description: Buildah task builds source into a container image and then pushes it to a container registry. - displayName: Buildah - id: 1 - minPipelinesVersion: 0.12.1 - rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml - resource: - catalog: - id: 1 - type: community - id: 1 - kind: task - name: buildah - rating: 4.3 - tags: - - id: 1 - name: image-build - updatedAt: 2020-01-01 12:00:00 +0000 UTC - version: "0.1" - webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml - "404": - description: "" - content: - application/vnd.goa.error: - schema: - $ref: '#/components/schemas/Error' - example: - fault: true - id: 123abc - message: parameter 'p' must be an integer - name: bad_request - temporary: true - timeout: true - "500": - description: "" - content: - application/vnd.goa.error: - schema: - $ref: '#/components/schemas/Error' - example: - fault: true - id: 123abc - message: parameter 'p' must be an integer - name: bad_request - temporary: false - timeout: true - /v1/resource/{id}: - get: - tags: - - resource - summary: ById resource - description: Find a resource using it's id - operationId: resource#ById#1 - parameters: - - name: id - in: path - description: ID of a resource - required: true - schema: - type: integer - description: ID of a resource - example: 1 - example: 1 - responses: - "200": - description: "" - content: - application/json: - schema: - $ref: '#/components/schemas/Resource' - example: - data: - catalog: - id: 1 - type: community - id: 1 - kind: task - latestVersion: - description: Buildah task builds source into a container image and then pushes it to a container registry. - displayName: Buildah - id: 1 - minPipelinesVersion: 0.12.1 - rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml - updatedAt: 2020-01-01 12:00:00 +0000 UTC - version: "0.1" - webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml - name: buildah - rating: 4.3 - tags: - - id: 1 - name: image-build - versions: - - id: 1 - version: "0.1" - - id: 2 - version: "0.2" - "404": - description: "" - content: - application/vnd.goa.error: - schema: - $ref: '#/components/schemas/Error' - example: - fault: true - id: 123abc - message: parameter 'p' must be an integer - name: bad_request - temporary: false - timeout: true - "500": - description: "" - content: - application/vnd.goa.error: - schema: - $ref: '#/components/schemas/Error' - example: - fault: false - id: 123abc - message: parameter 'p' must be an integer - name: bad_request - temporary: false - timeout: true - /v1/resource/{id}/versions: - get: - tags: - - resource - summary: VersionsByID resource - description: Find all versions of a resource by its id - operationId: resource#VersionsByID#1 - parameters: - - name: id - in: path - description: ID of a resource - required: true - schema: - type: integer - description: ID of a resource - example: 1 - example: 1 - responses: - "200": - description: "" - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceVersions' - example: - data: - latest: - id: 2 - rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml - version: "0.2" - webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml - versions: - - id: 1 - rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml - version: "0.1" - webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml - - id: 2 - rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml - version: "0.2" - webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml - "404": - description: "" - content: - application/vnd.goa.error: - schema: - $ref: '#/components/schemas/Error' - example: - fault: false - id: 123abc - message: parameter 'p' must be an integer - name: bad_request - temporary: true - timeout: false - "500": - description: "" - content: - application/vnd.goa.error: - schema: - $ref: '#/components/schemas/Error' - example: - fault: true - id: 123abc - message: parameter 'p' must be an integer - name: bad_request - temporary: true - timeout: true - /v1/resource/version/{versionID}: - get: - tags: - - resource - summary: ByVersionId resource - description: Find a resource using its version's id - operationId: resource#ByVersionId#1 - parameters: - - name: versionID - in: path - description: Version ID of a resource's version - required: true - schema: - type: integer - description: Version ID of a resource's version - example: 1 - example: 1 - responses: - "200": - description: "" - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceVersion' - example: - data: - description: Buildah task builds source into a container image and then pushes it to a container registry. - displayName: Buildah - id: 1 - minPipelinesVersion: 0.12.1 - rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml - resource: - catalog: - id: 1 - type: community - id: 1 - kind: task - name: buildah - rating: 4.3 - tags: - - id: 1 - name: image-build - updatedAt: 2020-01-01 12:00:00 +0000 UTC - version: "0.1" - webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml - "404": - description: "" - content: - application/vnd.goa.error: - schema: - $ref: '#/components/schemas/Error' - example: - fault: true - id: 123abc - message: parameter 'p' must be an integer - name: bad_request - temporary: false - timeout: true - "500": - description: "" - content: - application/vnd.goa.error: - schema: - $ref: '#/components/schemas/Error' - example: - fault: false - id: 123abc - message: parameter 'p' must be an integer - name: bad_request - temporary: false - timeout: true - /v1/resources: - get: - tags: - - resource - summary: List resource - description: List all resources sorted by rating and name - operationId: resource#List#1 - parameters: - - name: limit - in: query - description: Maximum number of resources to be returned - allowEmptyValue: true - schema: - type: integer - description: Maximum number of resources to be returned - default: 1000 - example: 100 - example: 100 - responses: - "200": - description: "" - content: - application/json: - schema: - $ref: '#/components/schemas/Resources' - example: - data: - - catalog: - id: 1 - type: community - id: 1 - kind: task - latestVersion: - description: Buildah task builds source into a container image and then pushes it to a container registry. - displayName: Buildah - id: 1 - minPipelinesVersion: 0.12.1 - rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml - updatedAt: 2020-01-01 12:00:00 +0000 UTC - version: "0.1" - webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml - name: buildah - rating: 4.3 - tags: - - id: 1 - name: image-build - versions: - - id: 1 - version: "0.1" - - id: 2 - version: "0.2" - - catalog: - id: 1 - type: community - id: 1 - kind: task - latestVersion: - description: Buildah task builds source into a container image and then pushes it to a container registry. - displayName: Buildah - id: 1 - minPipelinesVersion: 0.12.1 - rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml - updatedAt: 2020-01-01 12:00:00 +0000 UTC - version: "0.1" - webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml - name: buildah - rating: 4.3 - tags: - - id: 1 - name: image-build - versions: - - id: 1 - version: "0.1" - - id: 2 - version: "0.2" - - catalog: - id: 1 - type: community - id: 1 - kind: task - latestVersion: - description: Buildah task builds source into a container image and then pushes it to a container registry. - displayName: Buildah - id: 1 - minPipelinesVersion: 0.12.1 - rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml - updatedAt: 2020-01-01 12:00:00 +0000 UTC - version: "0.1" - webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml - name: buildah - rating: 4.3 - tags: - - id: 1 - name: image-build - versions: - - id: 1 - version: "0.1" - - id: 2 - version: "0.2" - "500": - description: "" - content: - application/vnd.goa.error: - schema: - $ref: '#/components/schemas/Error' - example: - fault: false - id: 123abc - message: parameter 'p' must be an integer - name: bad_request - temporary: true - timeout: false -components: - schemas: - AuthTokens: - type: object - properties: - access: - $ref: '#/components/schemas/Token' - refresh: - $ref: '#/components/schemas/Token' - description: Auth tokens have access and refresh token for user - example: - access: - expiresAt: 0 - refreshInterval: 1h30m - token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM - refresh: - expiresAt: 0 - refreshInterval: 1h30m - token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM - AuthenticateResponseBody: - type: object - properties: - data: - $ref: '#/components/schemas/AuthTokens' - example: - data: - access: - expiresAt: 0 - refreshInterval: 1h30m - token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM - refresh: - expiresAt: 0 - refreshInterval: 1h30m - token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM - required: - - data - Catalog: - type: object - properties: - id: - type: integer - description: ID is the unique id of the catalog - example: 1 - name: + services: + - error: unable to reach db + name: api + status: ok + - error: unable to reach db + name: api + status: ok + - error: unable to reach db + name: api + status: ok + - error: unable to reach db + name: api + status: ok +components: + schemas: + AuthTokens: + type: object + properties: + access: + $ref: '#/components/schemas/Token' + refresh: + $ref: '#/components/schemas/Token' + description: Auth tokens have access and refresh token for user + example: + access: + expiresAt: 0 + refreshInterval: 1h30m + token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM + refresh: + expiresAt: 0 + refreshInterval: 1h30m + token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM + AuthenticateResponseBody: + type: object + properties: + data: + $ref: '#/components/schemas/AuthTokens' + example: + data: + access: + expiresAt: 0 + refreshInterval: 1h30m + token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM + refresh: + expiresAt: 0 + refreshInterval: 1h30m + token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM + required: + - data + Catalog: + type: object + properties: + id: + type: integer + description: ID is the unique id of the catalog + example: 1 + name: type: string description: Name of catalog example: Tekton @@ -2127,11 +1428,13 @@ components: example: true id: type: string - description: ID is a unique identifier for this particular occurrence of the problem. + description: ID is a unique identifier for this particular occurrence of + the problem. example: 123abc message: type: string - description: Message is a human-readable explanation specific to this occurrence of the problem. + description: Message is a human-readable explanation specific to this occurrence + of the problem. example: parameter 'p' must be an integer name: type: string @@ -2140,12 +1443,12 @@ components: temporary: type: boolean description: Is the error temporary? - example: true + example: false timeout: type: boolean description: Is the error a timeout? example: true - description: Internal Server Error + description: Invalid request body example: fault: true id: 123abc @@ -2204,14 +1507,14 @@ components: id: type: integer description: id of the job - example: 1775143685620788290 + example: 8451480480088601963 status: type: string description: status of the job - example: Dolorum sapiente. + example: Vitae ducimus. example: - id: 8451480480088601963 - status: Vitae ducimus. + id: 3463136335453028454 + status: Autem aut id. required: - id - status @@ -2253,20 +1556,6 @@ components: name: image-build - id: 2 name: kaniko - - id: 1 - name: Image Builder - tags: - - id: 1 - name: image-build - - id: 2 - name: kaniko - - id: 1 - name: Image Builder - tags: - - id: 1 - name: image-build - - id: 2 - name: kaniko RefreshConfigRequestBody: type: object properties: @@ -2284,9 +1573,9 @@ components: checksum: type: string description: Config file checksum - example: Sint omnis consequatur. + example: Quas veniam. example: - checksum: Qui aut sed voluptas animi molestiae. + checksum: Accusamus ut dolorum sapiente. required: - checksum Resource: @@ -2302,7 +1591,8 @@ components: id: 1 kind: task latestVersion: - description: Buildah task builds source into a container image and then pushes it to a container registry. + description: Buildah task builds source into a container image and then + pushes it to a container registry. displayName: Buildah id: 1 minPipelinesVersion: 0.12.1 @@ -2372,7 +1662,8 @@ components: id: 1 kind: task latestVersion: - description: Buildah task builds source into a container image and then pushes it to a container registry. + description: Buildah task builds source into a container image and then + pushes it to a container registry. displayName: Buildah id: 1 minPipelinesVersion: 0.12.1 @@ -2410,7 +1701,58 @@ components: id: 1 kind: task latestVersion: - description: Buildah task builds source into a container image and then pushes it to a container registry. + description: Buildah task builds source into a container image and then + pushes it to a container registry. + displayName: Buildah + id: 1 + minPipelinesVersion: 0.12.1 + rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml + updatedAt: 2020-01-01 12:00:00 +0000 UTC + version: "0.1" + webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml + name: buildah + rating: 4.3 + tags: + - id: 1 + name: image-build + versions: + - id: 1 + version: "0.1" + - id: 2 + version: "0.2" + - catalog: + id: 1 + type: community + id: 1 + kind: task + latestVersion: + description: Buildah task builds source into a container image and then + pushes it to a container registry. + displayName: Buildah + id: 1 + minPipelinesVersion: 0.12.1 + rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml + updatedAt: 2020-01-01 12:00:00 +0000 UTC + version: "0.1" + webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml + name: buildah + rating: 4.3 + tags: + - id: 1 + name: image-build + versions: + - id: 1 + version: "0.1" + - id: 2 + version: "0.2" + - catalog: + id: 1 + type: community + id: 1 + kind: task + latestVersion: + description: Buildah task builds source into a container image and then + pushes it to a container registry. displayName: Buildah id: 1 minPipelinesVersion: 0.12.1 @@ -2434,7 +1776,8 @@ components: id: 1 kind: task latestVersion: - description: Buildah task builds source into a container image and then pushes it to a container registry. + description: Buildah task builds source into a container image and then + pushes it to a container registry. displayName: Buildah id: 1 minPipelinesVersion: 0.12.1 @@ -2459,7 +1802,8 @@ components: $ref: '#/components/schemas/ResourceVersionData' example: data: - description: Buildah task builds source into a container image and then pushes it to a container registry. + description: Buildah task builds source into a container image and then + pushes it to a container registry. displayName: Buildah id: 1 minPipelinesVersion: 0.12.1 @@ -2486,7 +1830,8 @@ components: description: type: string description: Description of version - example: Buildah task builds source into a container image and then pushes it to a container registry. + example: Buildah task builds source into a container image and then pushes + it to a container registry. displayName: type: string description: Display name of version @@ -2497,7 +1842,8 @@ components: example: 1 minPipelinesVersion: type: string - description: Minimum pipelines version the resource's version is compatible with + description: Minimum pipelines version the resource's version is compatible + with example: 0.12.1 rawURL: type: string @@ -2522,7 +1868,8 @@ components: format: uri description: The Version result type describes resource's version information. example: - description: Buildah task builds source into a container image and then pushes it to a container registry. + description: Buildah task builds source into a container image and then pushes + it to a container registry. displayName: Buildah id: 1 minPipelinesVersion: 0.12.1 @@ -2587,7 +1934,8 @@ components: id: 1 kind: task latestVersion: - description: Buildah task builds source into a container image and then pushes it to a container registry. + description: Buildah task builds source into a container image and then + pushes it to a container registry. displayName: Buildah id: 1 minPipelinesVersion: 0.12.1 @@ -2611,7 +1959,8 @@ components: id: 1 kind: task latestVersion: - description: Buildah task builds source into a container image and then pushes it to a container registry. + description: Buildah task builds source into a container image and then + pushes it to a container registry. displayName: Buildah id: 1 minPipelinesVersion: 0.12.1 @@ -2635,7 +1984,8 @@ components: id: 1 kind: task latestVersion: - description: Buildah task builds source into a container image and then pushes it to a container registry. + description: Buildah task builds source into a container image and then + pushes it to a container registry. displayName: Buildah id: 1 minPipelinesVersion: 0.12.1 @@ -2670,12 +2020,6 @@ components: - error: unable to reach db name: api status: ok - - error: unable to reach db - name: api - status: ok - - error: unable to reach db - name: api - status: ok example: services: - error: unable to reach db @@ -2687,6 +2031,9 @@ components: - error: unable to reach db name: api status: ok + - error: unable to reach db + name: api + status: ok Tag: type: object properties: @@ -2735,21 +2082,23 @@ components: name: type: string description: Name of Agent - example: Qui nam eos esse enim sint tempora. + example: Et nam quia incidunt accusamus. scopes: type: array items: type: string - example: Neque maxime nesciunt. + example: Non eum praesentium corrupti et qui nam. description: Scopes required for Agent example: - - Laboriosam incidunt neque asperiores. - - Hic molestiae beatae dicta itaque. + - Enim sint tempora. + - Neque maxime nesciunt. example: - name: Reiciendis aut repellat veritatis. + name: Debitis laboriosam incidunt neque asperiores reiciendis hic. scopes: - - Nulla ea. - - Aperiam ipsam sapiente labore assumenda. + - Dicta itaque possimus. + - Aut repellat. + - Qui accusantium nulla ea rem. + - Ipsam sapiente labore assumenda qui sequi officiis. required: - name - scopes @@ -2759,9 +2108,9 @@ components: token: type: string description: Agent JWT - example: Sequi officiis mollitia. + example: Dolorem laudantium quidem amet suscipit fuga. example: - token: Laudantium quidem amet suscipit fuga nam. + token: Dolorem eveniet qui sint omnis. required: - token UpdateRequestBody: @@ -2770,11 +2119,11 @@ components: rating: type: integer description: User rating for resource - example: 2 + example: 1 minimum: 0 maximum: 5 example: - rating: 4 + rating: 0 required: - rating Versions: @@ -2796,7 +2145,8 @@ components: rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml version: "0.2" webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml - description: The Versions type describes response for versions by resource id API. + description: The Versions type describes response for versions by resource id + API. example: latest: id: 2 @@ -2818,5 +2168,6 @@ components: securitySchemes: jwt_header_Authorization: type: http - description: Secures endpoint by requiring a valid JWT retrieved via the /auth/login endpoint. + description: Secures endpoint by requiring a valid JWT retrieved via the /auth/login + endpoint. scheme: bearer diff --git a/api/gen/http/resource/client/paths.go b/api/gen/http/resource/client/paths.go index 1ffd8b3fa8..b7a6151793 100644 --- a/api/gen/http/resource/client/paths.go +++ b/api/gen/http/resource/client/paths.go @@ -16,67 +16,32 @@ func QueryResourcePath() string { return "/query" } -// QueryResourcePath2 returns the URL path to the resource service Query HTTP endpoint. -func QueryResourcePath2() string { - return "/v1/query" -} - // ListResourcePath returns the URL path to the resource service List HTTP endpoint. func ListResourcePath() string { return "/resources" } -// ListResourcePath2 returns the URL path to the resource service List HTTP endpoint. -func ListResourcePath2() string { - return "/v1/resources" -} - // VersionsByIDResourcePath returns the URL path to the resource service VersionsByID HTTP endpoint. func VersionsByIDResourcePath(id uint) string { return fmt.Sprintf("/resource/%v/versions", id) } -// VersionsByIDResourcePath2 returns the URL path to the resource service VersionsByID HTTP endpoint. -func VersionsByIDResourcePath2(id uint) string { - return fmt.Sprintf("/v1/resource/%v/versions", id) -} - // ByCatalogKindNameVersionResourcePath returns the URL path to the resource service ByCatalogKindNameVersion HTTP endpoint. func ByCatalogKindNameVersionResourcePath(catalog string, kind string, name string, version string) string { return fmt.Sprintf("/resource/%v/%v/%v/%v", catalog, kind, name, version) } -// ByCatalogKindNameVersionResourcePath2 returns the URL path to the resource service ByCatalogKindNameVersion HTTP endpoint. -func ByCatalogKindNameVersionResourcePath2(catalog string, kind string, name string, version string) string { - return fmt.Sprintf("/v1/resource/%v/%v/%v/%v", catalog, kind, name, version) -} - // ByVersionIDResourcePath returns the URL path to the resource service ByVersionId HTTP endpoint. func ByVersionIDResourcePath(versionID uint) string { return fmt.Sprintf("/resource/version/%v", versionID) } -// ByVersionIDResourcePath2 returns the URL path to the resource service ByVersionId HTTP endpoint. -func ByVersionIDResourcePath2(versionID uint) string { - return fmt.Sprintf("/v1/resource/version/%v", versionID) -} - // ByCatalogKindNameResourcePath returns the URL path to the resource service ByCatalogKindName HTTP endpoint. func ByCatalogKindNameResourcePath(catalog string, kind string, name string) string { return fmt.Sprintf("/resource/%v/%v/%v", catalog, kind, name) } -// ByCatalogKindNameResourcePath2 returns the URL path to the resource service ByCatalogKindName HTTP endpoint. -func ByCatalogKindNameResourcePath2(catalog string, kind string, name string) string { - return fmt.Sprintf("/v1/resource/%v/%v/%v", catalog, kind, name) -} - // ByIDResourcePath returns the URL path to the resource service ById HTTP endpoint. func ByIDResourcePath(id uint) string { return fmt.Sprintf("/resource/%v", id) } - -// ByIDResourcePath2 returns the URL path to the resource service ById HTTP endpoint. -func ByIDResourcePath2(id uint) string { - return fmt.Sprintf("/v1/resource/%v", id) -} diff --git a/api/gen/http/resource/server/paths.go b/api/gen/http/resource/server/paths.go index 46d77aa881..31d9931d1d 100644 --- a/api/gen/http/resource/server/paths.go +++ b/api/gen/http/resource/server/paths.go @@ -16,67 +16,32 @@ func QueryResourcePath() string { return "/query" } -// QueryResourcePath2 returns the URL path to the resource service Query HTTP endpoint. -func QueryResourcePath2() string { - return "/v1/query" -} - // ListResourcePath returns the URL path to the resource service List HTTP endpoint. func ListResourcePath() string { return "/resources" } -// ListResourcePath2 returns the URL path to the resource service List HTTP endpoint. -func ListResourcePath2() string { - return "/v1/resources" -} - // VersionsByIDResourcePath returns the URL path to the resource service VersionsByID HTTP endpoint. func VersionsByIDResourcePath(id uint) string { return fmt.Sprintf("/resource/%v/versions", id) } -// VersionsByIDResourcePath2 returns the URL path to the resource service VersionsByID HTTP endpoint. -func VersionsByIDResourcePath2(id uint) string { - return fmt.Sprintf("/v1/resource/%v/versions", id) -} - // ByCatalogKindNameVersionResourcePath returns the URL path to the resource service ByCatalogKindNameVersion HTTP endpoint. func ByCatalogKindNameVersionResourcePath(catalog string, kind string, name string, version string) string { return fmt.Sprintf("/resource/%v/%v/%v/%v", catalog, kind, name, version) } -// ByCatalogKindNameVersionResourcePath2 returns the URL path to the resource service ByCatalogKindNameVersion HTTP endpoint. -func ByCatalogKindNameVersionResourcePath2(catalog string, kind string, name string, version string) string { - return fmt.Sprintf("/v1/resource/%v/%v/%v/%v", catalog, kind, name, version) -} - // ByVersionIDResourcePath returns the URL path to the resource service ByVersionId HTTP endpoint. func ByVersionIDResourcePath(versionID uint) string { return fmt.Sprintf("/resource/version/%v", versionID) } -// ByVersionIDResourcePath2 returns the URL path to the resource service ByVersionId HTTP endpoint. -func ByVersionIDResourcePath2(versionID uint) string { - return fmt.Sprintf("/v1/resource/version/%v", versionID) -} - // ByCatalogKindNameResourcePath returns the URL path to the resource service ByCatalogKindName HTTP endpoint. func ByCatalogKindNameResourcePath(catalog string, kind string, name string) string { return fmt.Sprintf("/resource/%v/%v/%v", catalog, kind, name) } -// ByCatalogKindNameResourcePath2 returns the URL path to the resource service ByCatalogKindName HTTP endpoint. -func ByCatalogKindNameResourcePath2(catalog string, kind string, name string) string { - return fmt.Sprintf("/v1/resource/%v/%v/%v", catalog, kind, name) -} - // ByIDResourcePath returns the URL path to the resource service ById HTTP endpoint. func ByIDResourcePath(id uint) string { return fmt.Sprintf("/resource/%v", id) } - -// ByIDResourcePath2 returns the URL path to the resource service ById HTTP endpoint. -func ByIDResourcePath2(id uint) string { - return fmt.Sprintf("/v1/resource/%v", id) -} diff --git a/api/gen/http/resource/server/server.go b/api/gen/http/resource/server/server.go index 1ad2964b5e..03101a9b59 100644 --- a/api/gen/http/resource/server/server.go +++ b/api/gen/http/resource/server/server.go @@ -64,33 +64,19 @@ func New( return &Server{ Mounts: []*MountPoint{ {"Query", "GET", "/query"}, - {"Query", "GET", "/v1/query"}, {"List", "GET", "/resources"}, - {"List", "GET", "/v1/resources"}, {"VersionsByID", "GET", "/resource/{id}/versions"}, - {"VersionsByID", "GET", "/v1/resource/{id}/versions"}, {"ByCatalogKindNameVersion", "GET", "/resource/{catalog}/{kind}/{name}/{version}"}, - {"ByCatalogKindNameVersion", "GET", "/v1/resource/{catalog}/{kind}/{name}/{version}"}, {"ByVersionID", "GET", "/resource/version/{versionID}"}, - {"ByVersionID", "GET", "/v1/resource/version/{versionID}"}, {"ByCatalogKindName", "GET", "/resource/{catalog}/{kind}/{name}"}, - {"ByCatalogKindName", "GET", "/v1/resource/{catalog}/{kind}/{name}"}, {"ByID", "GET", "/resource/{id}"}, - {"ByID", "GET", "/v1/resource/{id}"}, {"CORS", "OPTIONS", "/query"}, - {"CORS", "OPTIONS", "/v1/query"}, {"CORS", "OPTIONS", "/resources"}, - {"CORS", "OPTIONS", "/v1/resources"}, {"CORS", "OPTIONS", "/resource/{id}/versions"}, - {"CORS", "OPTIONS", "/v1/resource/{id}/versions"}, {"CORS", "OPTIONS", "/resource/{catalog}/{kind}/{name}/{version}"}, - {"CORS", "OPTIONS", "/v1/resource/{catalog}/{kind}/{name}/{version}"}, {"CORS", "OPTIONS", "/resource/version/{versionID}"}, - {"CORS", "OPTIONS", "/v1/resource/version/{versionID}"}, {"CORS", "OPTIONS", "/resource/{catalog}/{kind}/{name}"}, - {"CORS", "OPTIONS", "/v1/resource/{catalog}/{kind}/{name}"}, {"CORS", "OPTIONS", "/resource/{id}"}, - {"CORS", "OPTIONS", "/v1/resource/{id}"}, }, Query: NewQueryHandler(e.Query, mux, decoder, encoder, errhandler, formatter), List: NewListHandler(e.List, mux, decoder, encoder, errhandler, formatter), @@ -140,7 +126,6 @@ func MountQueryHandler(mux goahttp.Muxer, h http.Handler) { } } mux.Handle("GET", "/query", f) - mux.Handle("GET", "/v1/query", f) } // NewQueryHandler creates a HTTP handler which loads the HTTP request and @@ -192,7 +177,6 @@ func MountListHandler(mux goahttp.Muxer, h http.Handler) { } } mux.Handle("GET", "/resources", f) - mux.Handle("GET", "/v1/resources", f) } // NewListHandler creates a HTTP handler which loads the HTTP request and calls @@ -244,7 +228,6 @@ func MountVersionsByIDHandler(mux goahttp.Muxer, h http.Handler) { } } mux.Handle("GET", "/resource/{id}/versions", f) - mux.Handle("GET", "/v1/resource/{id}/versions", f) } // NewVersionsByIDHandler creates a HTTP handler which loads the HTTP request @@ -296,7 +279,6 @@ func MountByCatalogKindNameVersionHandler(mux goahttp.Muxer, h http.Handler) { } } mux.Handle("GET", "/resource/{catalog}/{kind}/{name}/{version}", f) - mux.Handle("GET", "/v1/resource/{catalog}/{kind}/{name}/{version}", f) } // NewByCatalogKindNameVersionHandler creates a HTTP handler which loads the @@ -349,7 +331,6 @@ func MountByVersionIDHandler(mux goahttp.Muxer, h http.Handler) { } } mux.Handle("GET", "/resource/version/{versionID}", f) - mux.Handle("GET", "/v1/resource/version/{versionID}", f) } // NewByVersionIDHandler creates a HTTP handler which loads the HTTP request @@ -401,7 +382,6 @@ func MountByCatalogKindNameHandler(mux goahttp.Muxer, h http.Handler) { } } mux.Handle("GET", "/resource/{catalog}/{kind}/{name}", f) - mux.Handle("GET", "/v1/resource/{catalog}/{kind}/{name}", f) } // NewByCatalogKindNameHandler creates a HTTP handler which loads the HTTP @@ -453,7 +433,6 @@ func MountByIDHandler(mux goahttp.Muxer, h http.Handler) { } } mux.Handle("GET", "/resource/{id}", f) - mux.Handle("GET", "/v1/resource/{id}", f) } // NewByIDHandler creates a HTTP handler which loads the HTTP request and calls @@ -506,19 +485,12 @@ func MountCORSHandler(mux goahttp.Muxer, h http.Handler) { } } mux.Handle("OPTIONS", "/query", f) - mux.Handle("OPTIONS", "/v1/query", f) mux.Handle("OPTIONS", "/resources", f) - mux.Handle("OPTIONS", "/v1/resources", f) mux.Handle("OPTIONS", "/resource/{id}/versions", f) - mux.Handle("OPTIONS", "/v1/resource/{id}/versions", f) mux.Handle("OPTIONS", "/resource/{catalog}/{kind}/{name}/{version}", f) - mux.Handle("OPTIONS", "/v1/resource/{catalog}/{kind}/{name}/{version}", f) mux.Handle("OPTIONS", "/resource/version/{versionID}", f) - mux.Handle("OPTIONS", "/v1/resource/version/{versionID}", f) mux.Handle("OPTIONS", "/resource/{catalog}/{kind}/{name}", f) - mux.Handle("OPTIONS", "/v1/resource/{catalog}/{kind}/{name}", f) mux.Handle("OPTIONS", "/resource/{id}", f) - mux.Handle("OPTIONS", "/v1/resource/{id}", f) } // NewCORSHandler creates a HTTP handler which returns a simple 200 response. diff --git a/api/gen/http/status/client/paths.go b/api/gen/http/status/client/paths.go index f055333359..967a85d45f 100644 --- a/api/gen/http/status/client/paths.go +++ b/api/gen/http/status/client/paths.go @@ -11,3 +11,8 @@ package client func StatusStatusPath() string { return "/" } + +// StatusStatusPath2 returns the URL path to the status service Status HTTP endpoint. +func StatusStatusPath2() string { + return "/v1" +} diff --git a/api/gen/http/status/server/paths.go b/api/gen/http/status/server/paths.go index e0e9ce9027..f3549c0dff 100644 --- a/api/gen/http/status/server/paths.go +++ b/api/gen/http/status/server/paths.go @@ -11,3 +11,8 @@ package server func StatusStatusPath() string { return "/" } + +// StatusStatusPath2 returns the URL path to the status service Status HTTP endpoint. +func StatusStatusPath2() string { + return "/v1" +} diff --git a/api/gen/http/status/server/server.go b/api/gen/http/status/server/server.go index 37f9842353..11aaaa970d 100644 --- a/api/gen/http/status/server/server.go +++ b/api/gen/http/status/server/server.go @@ -58,7 +58,9 @@ func New( return &Server{ Mounts: []*MountPoint{ {"Status", "GET", "/"}, + {"Status", "GET", "/v1"}, {"CORS", "OPTIONS", "/"}, + {"CORS", "OPTIONS", "/v1"}, }, Status: NewStatusHandler(e.Status, mux, decoder, encoder, errhandler, formatter), CORS: NewCORSHandler(), @@ -90,6 +92,7 @@ func MountStatusHandler(mux goahttp.Muxer, h http.Handler) { } } mux.Handle("GET", "/", f) + mux.Handle("GET", "/v1", f) } // NewStatusHandler creates a HTTP handler which loads the HTTP request and @@ -135,6 +138,7 @@ func MountCORSHandler(mux goahttp.Muxer, h http.Handler) { } } mux.Handle("OPTIONS", "/", f) + mux.Handle("OPTIONS", "/v1", f) } // NewCORSHandler creates a HTTP handler which returns a simple 200 response. diff --git a/api/pkg/service/category/category_http_test.go b/api/pkg/service/category/category_http_test.go index 8a5852f6d9..c58f7cf9a6 100644 --- a/api/pkg/service/category/category_http_test.go +++ b/api/pkg/service/category/category_http_test.go @@ -49,27 +49,4 @@ func TestCategories_List_Http(t *testing.T) { golden.Assert(t, res, fmt.Sprintf("%s.golden", t.Name())) }) -} - -func TestCategories_List_V1_Http(t *testing.T) { - tc := testutils.Setup(t) - testutils.LoadFixtures(t, tc.FixturePath()) - - checker := goahttpcheck.New() - checker.Mount( - server.NewListHandler, - server.MountListHandler, - category.NewListEndpoint(New(tc))) - - checker.Test(t, http.MethodGet, "/v1/categories").Check(). - HasStatus(http.StatusOK).Cb(func(r *http.Response) { - b, readErr := ioutil.ReadAll(r.Body) - assert.NoError(t, readErr) - defer r.Body.Close() - - res, err := testutils.FormatJSON(b) - assert.NoError(t, err) - - golden.Assert(t, res, fmt.Sprintf("%s.golden", t.Name())) - }) -} +} \ No newline at end of file diff --git a/api/pkg/service/category/testdata/TestCategories_List_V1_Http.golden b/api/pkg/service/category/testdata/TestCategories_List_V1_Http.golden deleted file mode 100644 index 046f48d123..0000000000 --- a/api/pkg/service/category/testdata/TestCategories_List_V1_Http.golden +++ /dev/null @@ -1,38 +0,0 @@ -{ - "data": [ - { - "id": 2, - "name": "abc", - "tags": [ - { - "id": 4, - "name": "atag" - }, - { - "id": 2, - "name": "rtag" - } - ] - }, - { - "id": 3, - "name": "pqr", - "tags": [ - { - "id": 3, - "name": "ptag" - } - ] - }, - { - "id": 1, - "name": "xyz", - "tags": [ - { - "id": 1, - "name": "ztag" - } - ] - } - ] -} diff --git a/api/pkg/service/resource/resource.go b/api/pkg/service/resource/resource.go index 271a8c04f2..393b27038d 100644 --- a/api/pkg/service/resource/resource.go +++ b/api/pkg/service/resource/resource.go @@ -20,31 +20,18 @@ import ( "strings" "time" - "github.com/tektoncd/hub/api/gen/log" "github.com/tektoncd/hub/api/gen/resource" "github.com/tektoncd/hub/api/pkg/app" "github.com/tektoncd/hub/api/pkg/db/model" - "github.com/tektoncd/hub/api/pkg/parser" - "gorm.io/gorm" + res "github.com/tektoncd/hub/api/pkg/shared/resource" ) type service struct { app.Service } -type request struct { - db *gorm.DB - log *log.Logger -} - var replaceGHtoRaw = strings.NewReplacer("github.com", "raw.githubusercontent.com", "/tree/", "/") -// Errors -var ( - fetchError = resource.MakeInternalError(fmt.Errorf("failed to fetch resources")) - notFoundError = resource.MakeNotFound(fmt.Errorf("resource not found")) -) - // New returns the resource service implementation. func New(api app.BaseConfig) resource.Service { return &service{api.Service("resource")} @@ -53,95 +40,122 @@ func New(api app.BaseConfig) resource.Service { // Find resources based on name, kind or both func (s *service) Query(ctx context.Context, p *resource.QueryPayload) (*resource.Resources, error) { - // Validate the kinds passed are supported by Hub - for _, k := range p.Kinds { - if !parser.IsSupportedKind(k) { - return nil, invalidKindError(k) - } + req := res.Request{ + Db: s.DB(ctx), + Log: s.Logger(ctx), + Name: p.Name, + Kinds: p.Kinds, + Tags: p.Tags, + Limit: p.Limit, + Match: p.Match, } - db := s.DB(ctx) - - // DISTINCT(resources.id) and resources.id is required as the - // INNER JOIN of tags and resources returns duplicate records of - // resources as a resource may have multiple tags, thus we have to - // find DISTINCT on resource.id + rArr, err := req.Query() + if err != nil { + if strings.Contains(err.Error(), "not supported") { + return nil, resource.MakeInvalidKind(err) + } + if err == res.NotFoundError { + return nil, resource.MakeNotFound(err) + } + if err == res.FetchError { + return nil, resource.MakeInternalError(err) + } + } - q := db.Select("DISTINCT(resources.id), resources.*").Scopes( - filterByTags(p.Tags), - filterByKinds(p.Kinds), - filterResourceName(p.Match, p.Name), - withResourceDetails, - ).Limit(int(p.Limit)) + var rd []*resource.ResourceData + for _, r := range rArr { + rd = append(rd, initResource(r)) + } - req := request{db: q, log: s.Logger(ctx)} - return req.findAllResources() + return &resource.Resources{Data: rd}, nil } // List all resources sorted by rating and name func (s *service) List(ctx context.Context, p *resource.ListPayload) (*resource.Resources, error) { - db := s.DB(ctx) + req := res.Request{ + Db: s.DB(ctx), + Log: s.Logger(ctx), + Limit: p.Limit, + } - q := db.Scopes(withResourceDetails). - Limit(int(p.Limit)) + rArr, err := req.AllResources() + if err != nil { + if err == res.NotFoundError { + return nil, resource.MakeNotFound(err) + } + if err == res.FetchError { + return nil, resource.MakeInternalError(err) + } + } + + var rd []*resource.ResourceData + for _, r := range rArr { + rd = append(rd, initResource(r)) + } - req := request{db: q, log: s.Logger(ctx)} - return req.findAllResources() + return &resource.Resources{Data: rd}, nil } // VersionsByID returns all versions of a resource given its resource id func (s *service) VersionsByID(ctx context.Context, p *resource.VersionsByIDPayload) (*resource.ResourceVersions, error) { - log := s.Logger(ctx) - db := s.DB(ctx) - - q := db.Scopes(orderByVersion, filterByResourceID(p.ID)) - - var all []model.ResourceVersion - if err := q.Find(&all).Error; err != nil { - log.Error(err) - return nil, fetchError + req := res.Request{ + Db: s.DB(ctx), + Log: s.Logger(ctx), + ID: p.ID, } - if len(all) == 0 { - return nil, notFoundError + versions, err := req.AllVersions() + if err != nil { + if err == res.FetchError { + return nil, resource.MakeInternalError(err) + } + if err == res.NotFoundError { + return nil, resource.MakeNotFound(err) + } } - res := &resource.Versions{} - res.Versions = []*resource.ResourceVersionData{} - for _, r := range all { - res.Versions = append(res.Versions, minVersionInfo(r)) + var rv resource.Versions + rv.Versions = []*resource.ResourceVersionData{} + for _, r := range versions { + rv.Versions = append(rv.Versions, minVersionInfo(r)) } - res.Latest = minVersionInfo(all[len(all)-1]) + rv.Latest = minVersionInfo(versions[len(versions)-1]) - return &resource.ResourceVersions{Data: res}, nil + return &resource.ResourceVersions{Data: &rv}, nil } // find resource using name of catalog & name, kind and version of resource func (s *service) ByCatalogKindNameVersion(ctx context.Context, p *resource.ByCatalogKindNameVersionPayload) (*resource.ResourceVersion, error) { - log := s.Logger(ctx) - db := s.DB(ctx) - - q := db.Scopes( - withVersionInfo(p.Version), - filterByCatalog(p.Catalog), - filterByKind(p.Kind), - filterResourceName("exact", p.Name)) + req := res.Request{ + Db: s.DB(ctx), + Log: s.Logger(ctx), + Catalog: p.Catalog, + Kind: p.Kind, + Name: p.Name, + Version: p.Version, + } - var r model.Resource - if err := findOne(q, log, &r); err != nil { - return nil, err + r, err := req.ByCatalogKindNameVersion() + if err != nil { + if err == res.FetchError { + return nil, resource.MakeInternalError(err) + } + if err == res.NotFoundError { + return nil, resource.MakeNotFound(err) + } } switch count := len(r.Versions); { case count == 1: return versionInfoFromResource(r), nil case count == 0: - return nil, notFoundError + return nil, resource.MakeNotFound(fmt.Errorf("resource not found")) default: - log.Warnf("expected to find one version but found %d", count) + s.Logger(ctx).Warnf("expected to find one version but found %d", count) r.Versions = []model.ResourceVersion{r.Versions[0]} return versionInfoFromResource(r), nil } @@ -150,12 +164,20 @@ func (s *service) ByCatalogKindNameVersion(ctx context.Context, p *resource.ByCa // find a resource using its version's id func (s *service) ByVersionID(ctx context.Context, p *resource.ByVersionIDPayload) (*resource.ResourceVersion, error) { - db := s.DB(ctx) - q := db.Scopes(withResourceVersionDetails, filterByVersionID(p.VersionID)) + req := res.Request{ + Db: s.DB(ctx), + Log: s.Logger(ctx), + VersionID: p.VersionID, + } - var v model.ResourceVersion - if err := findOne(q, s.Logger(ctx), &v); err != nil { - return nil, err + v, err := req.ByVersionID() + if err != nil { + if err == res.FetchError { + return nil, resource.MakeInternalError(err) + } + if err == res.NotFoundError { + return nil, resource.MakeNotFound(err) + } } return versionInfoFromVersion(v), nil @@ -164,62 +186,57 @@ func (s *service) ByVersionID(ctx context.Context, p *resource.ByVersionIDPayloa // find resources using name of catalog, resource name and kind of resource func (s *service) ByCatalogKindName(ctx context.Context, p *resource.ByCatalogKindNamePayload) (*resource.Resource, error) { - db := s.DB(ctx) - - q := db.Scopes( - withResourceDetails, - filterByCatalog(p.Catalog), - filterByKind(p.Kind), - filterResourceName("exact", p.Name)) - - req := &request{db: q, log: s.Logger(ctx)} - return req.findSingleResource() -} - -// Find a resource using it's id -func (s *service) ByID(ctx context.Context, p *resource.ByIDPayload) (*resource.Resource, error) { - - db := s.DB(ctx) - - q := db.Scopes(withResourceDetails, filterByID(p.ID)) - - req := &request{db: q, log: s.Logger(ctx)} - return req.findSingleResource() -} - -func (r *request) findSingleResource() (*resource.Resource, error) { + req := res.Request{ + Db: s.DB(ctx), + Log: s.Logger(ctx), + Catalog: p.Catalog, + Kind: p.Kind, + Name: p.Name, + } - var dbRes model.Resource - if err := findOne(r.db, r.log, &dbRes); err != nil { - return nil, err + r, err := req.ByCatalogKindName() + if err != nil { + if err == res.FetchError { + return nil, resource.MakeInternalError(err) + } + if err == res.NotFoundError { + return nil, resource.MakeNotFound(err) + } } - res := initResource(dbRes) - for _, v := range dbRes.Versions { + res := initResource(r) + for _, v := range r.Versions { res.Versions = append(res.Versions, tinyVersionInfo(v)) } return &resource.Resource{Data: res}, nil } -func (r *request) findAllResources() (*resource.Resources, error) { +// Find a resource using it's id +func (s *service) ByID(ctx context.Context, p *resource.ByIDPayload) (*resource.Resource, error) { - var rs []model.Resource - if err := r.db.Find(&rs).Error; err != nil { - r.log.Error(err) - return nil, fetchError + req := res.Request{ + Db: s.DB(ctx), + Log: s.Logger(ctx), + ID: p.ID, } - if len(rs) == 0 { - return nil, notFoundError + r, err := req.ByID() + if err != nil { + if err == res.FetchError { + return nil, resource.MakeInternalError(err) + } + if err == res.NotFoundError { + return nil, resource.MakeNotFound(err) + } } - res := []*resource.ResourceData{} - for _, r := range rs { - res = append(res, initResource(r)) + res := initResource(r) + for _, v := range r.Versions { + res.Versions = append(res.Versions, tinyVersionInfo(v)) } - return &resource.Resources{Data: res}, nil + return &resource.Resource{Data: res}, nil } func initResource(r model.Resource) *resource.ResourceData { @@ -278,7 +295,7 @@ func minVersionInfo(r model.ResourceVersion) *resource.ResourceVersionData { func versionInfoFromResource(r model.Resource) *resource.ResourceVersion { - tags := []*resource.Tag{} + var tags []*resource.Tag for _, tag := range r.Tags { tags = append(tags, &resource.Tag{ ID: tag.ID, @@ -317,159 +334,8 @@ func versionInfoFromResource(r model.Resource) *resource.ResourceVersion { func versionInfoFromVersion(v model.ResourceVersion) *resource.ResourceVersion { // NOTE: we are not preloading all versions (optimisation) and we only - // need to return version detials of v, thus manually populating only + // need to return version details of v, thus manually populating only // the required info v.Resource.Versions = []model.ResourceVersion{v} return versionInfoFromResource(v.Resource) } - -func withCatalogAndTags(db *gorm.DB) *gorm.DB { - return db. - Preload("Catalog"). - Preload("Tags", orderByTags) -} - -// withResourceDetails defines a gorm scope to include all details of resource. -func withResourceDetails(db *gorm.DB) *gorm.DB { - return db. - Order("rating DESC, resources.name"). - Scopes(withCatalogAndTags). - Preload("Versions", orderByVersion) -} - -// withVersionInfo defines a gorm scope to include all details of resource -// and filtering a particular version of the resource. -func withVersionInfo(version string) func(db *gorm.DB) *gorm.DB { - return func(db *gorm.DB) *gorm.DB { - return db. - Scopes(withResourceDetails). - Preload("Versions", "version = ?", version) - } -} - -// withResourceVersionDetails defines a gorm scope to include all details of -// resource in resource version. -func withResourceVersionDetails(db *gorm.DB) *gorm.DB { - return db. - Preload("Resource"). - Preload("Resource.Catalog"). - Preload("Resource.Tags", orderByTags) -} - -func orderByTags(db *gorm.DB) *gorm.DB { - return db.Order("tags.name ASC") -} - -func orderByVersion(db *gorm.DB) *gorm.DB { - return db.Order("string_to_array(version, '.')::int[]") -} - -func findOne(db *gorm.DB, log *log.Logger, result interface{}) error { - - err := db.First(result).Error - if err != nil { - if err == gorm.ErrRecordNotFound { - return notFoundError - } - log.Error(err) - return fetchError - } - return nil -} - -func filterByID(id uint) func(db *gorm.DB) *gorm.DB { - return func(db *gorm.DB) *gorm.DB { - return db.Where("id = ?", id) - } -} - -func filterByCatalog(catalog string) func(db *gorm.DB) *gorm.DB { - return func(db *gorm.DB) *gorm.DB { - return db.Model(&model.Resource{}). - Joins("JOIN catalogs as c on c.id = resources.catalog_id"). - Where("lower(c.name) = ?", strings.ToLower(catalog)) - } -} - -func filterByKind(t string) func(db *gorm.DB) *gorm.DB { - if t == "" { - return noop - } - - t = strings.ToLower(t) - return func(db *gorm.DB) *gorm.DB { - return db.Where("LOWER(kind) = ?", t) - } -} - -func filterByKinds(t []string) func(db *gorm.DB) *gorm.DB { - if len(t) == 0 { - return noop - } - - return func(db *gorm.DB) *gorm.DB { - t = lower(t) - return db.Where("LOWER(kind) IN (?)", t) - } -} - -func filterByTags(tags []string) func(db *gorm.DB) *gorm.DB { - if tags == nil { - return noop - } - - tags = lower(tags) - return func(db *gorm.DB) *gorm.DB { - return db.Model(&model.Resource{}). - Joins("JOIN resource_tags as rt on rt.resource_id = resources.id"). - Joins("JOIN tags on tags.id = rt.tag_id"). - Where("lower(tags.name) in (?)", tags) - } -} - -func filterByResourceID(id uint) func(db *gorm.DB) *gorm.DB { - return func(db *gorm.DB) *gorm.DB { - return db.Where("resource_id = ?", id) - } -} - -func filterByVersionID(versionID uint) func(db *gorm.DB) *gorm.DB { - return func(db *gorm.DB) *gorm.DB { - return db.Where("id = ?", versionID) - } -} - -func filterResourceName(match, name string) func(db *gorm.DB) *gorm.DB { - if name == "" { - return noop - } - name = strings.ToLower(name) - switch match { - case "exact": - return func(db *gorm.DB) *gorm.DB { - return db.Where("LOWER(resources.name) = ?", name) - } - default: - likeName := "%" + name + "%" - return func(db *gorm.DB) *gorm.DB { - return db.Where("LOWER(resources.name) LIKE ?", likeName) - } - } -} - -func noop(db *gorm.DB) *gorm.DB { - return db -} - -// This function lowercase all the elements of an array -func lower(t []string) []string { - for i := range t { - t[i] = strings.ToLower(t[i]) - } - return t -} - -func invalidKindError(kind string) error { - return resource.MakeInvalidKind(fmt.Errorf("resource kind '%s' not supported. Supported kinds are %v", - kind, parser.SupportedKinds())) -} diff --git a/api/pkg/service/resource/resource_http_test.go b/api/pkg/service/resource/resource_http_test.go index e6d952fdf3..071888b667 100644 --- a/api/pkg/service/resource/resource_http_test.go +++ b/api/pkg/service/resource/resource_http_test.go @@ -55,23 +55,6 @@ func TestQuery_Http(t *testing.T) { }) } -func TestQuery_V1_Http(t *testing.T) { - tc := testutils.Setup(t) - testutils.LoadFixtures(t, tc.FixturePath()) - - QueryChecker(tc).Test(t, http.MethodGet, "/v1/query?name=build&kinds=pipeline&limit=1").Check(). - HasStatus(200).Cb(func(r *http.Response) { - b, readErr := ioutil.ReadAll(r.Body) - assert.NoError(t, readErr) - defer r.Body.Close() - - res, err := testutils.FormatJSON(b) - assert.NoError(t, err) - - golden.Assert(t, res, fmt.Sprintf("%s.golden", t.Name())) - }) -} - func TestQueryWithKinds_Http(t *testing.T) { tc := testutils.Setup(t) testutils.LoadFixtures(t, tc.FixturePath()) @@ -271,23 +254,6 @@ func TestList_Http_NoLimit(t *testing.T) { }) } -func TestList_V1_Http(t *testing.T) { - tc := testutils.Setup(t) - testutils.LoadFixtures(t, tc.FixturePath()) - - ListChecker(tc).Test(t, http.MethodGet, "/v1/resources").Check(). - HasStatus(200).Cb(func(r *http.Response) { - b, readErr := ioutil.ReadAll(r.Body) - assert.NoError(t, readErr) - defer r.Body.Close() - - res, err := testutils.FormatJSON(b) - assert.NoError(t, err) - - golden.Assert(t, res, fmt.Sprintf("%s.golden", t.Name())) - }) -} - func VersionsByIDChecker(tc *testutils.TestConfig) *goahttpcheck.APIChecker { checker := goahttpcheck.New() checker.Mount( @@ -314,23 +280,6 @@ func TestVersionsByID_Http(t *testing.T) { }) } -func TestVersionsByID_V1_Http(t *testing.T) { - tc := testutils.Setup(t) - testutils.LoadFixtures(t, tc.FixturePath()) - - VersionsByIDChecker(tc).Test(t, http.MethodGet, "/v1/resource/1/versions").Check(). - HasStatus(200).Cb(func(r *http.Response) { - b, readErr := ioutil.ReadAll(r.Body) - assert.NoError(t, readErr) - defer r.Body.Close() - - res, err := testutils.FormatJSON(b) - assert.NoError(t, err) - - golden.Assert(t, res, fmt.Sprintf("%s.golden", t.Name())) - }) -} - func TestVersionsByID_Http_ErrorCase(t *testing.T) { tc := testutils.Setup(t) testutils.LoadFixtures(t, tc.FixturePath()) @@ -375,23 +324,6 @@ func TestByCatalogKindNameVersion_Http(t *testing.T) { }) } -func TestByCatalogKindNameVersion_V1_Http(t *testing.T) { - tc := testutils.Setup(t) - testutils.LoadFixtures(t, tc.FixturePath()) - - ByCatalogKindNameVersionChecker(tc).Test(t, http.MethodGet, "/v1/resource/catalog-official/task/tkn/0.1").Check(). - HasStatus(200).Cb(func(r *http.Response) { - b, readErr := ioutil.ReadAll(r.Body) - assert.NoError(t, readErr) - defer r.Body.Close() - - res, err := testutils.FormatJSON(b) - assert.NoError(t, err) - - golden.Assert(t, res, fmt.Sprintf("%s.golden", t.Name())) - }) -} - func TestByCatalogKindNameVersion_Http_ErrorCase(t *testing.T) { tc := testutils.Setup(t) testutils.LoadFixtures(t, tc.FixturePath()) @@ -436,23 +368,6 @@ func TestByVersionID_Http(t *testing.T) { }) } -func TestByVersionID_V1_Http(t *testing.T) { - tc := testutils.Setup(t) - testutils.LoadFixtures(t, tc.FixturePath()) - - ByVersionIDChecker(tc).Test(t, http.MethodGet, "/v1/resource/version/4").Check(). - HasStatus(200).Cb(func(r *http.Response) { - b, readErr := ioutil.ReadAll(r.Body) - assert.NoError(t, readErr) - defer r.Body.Close() - - res, err := testutils.FormatJSON(b) - assert.NoError(t, err) - - golden.Assert(t, res, fmt.Sprintf("%s.golden", t.Name())) - }) -} - func TestByVersionID_Http_ErrorCase(t *testing.T) { tc := testutils.Setup(t) testutils.LoadFixtures(t, tc.FixturePath()) @@ -497,23 +412,6 @@ func TestByCatalogKindName_Http(t *testing.T) { }) } -func TestByCatalogKindName_V1_Http(t *testing.T) { - tc := testutils.Setup(t) - testutils.LoadFixtures(t, tc.FixturePath()) - - ByCatalogKindNameChecker(tc).Test(t, http.MethodGet, "/v1/resource/catalog-official/task/tekton").Check(). - HasStatus(200).Cb(func(r *http.Response) { - b, readErr := ioutil.ReadAll(r.Body) - assert.NoError(t, readErr) - defer r.Body.Close() - - res, err := testutils.FormatJSON(b) - assert.NoError(t, err) - - golden.Assert(t, res, fmt.Sprintf("%s.golden", t.Name())) - }) -} - func TestByCatalogKindName_Http_ErrorCase(t *testing.T) { tc := testutils.Setup(t) testutils.LoadFixtures(t, tc.FixturePath()) @@ -558,23 +456,6 @@ func TestByID_Http(t *testing.T) { }) } -func TestByID_V1_Http(t *testing.T) { - tc := testutils.Setup(t) - testutils.LoadFixtures(t, tc.FixturePath()) - - ByIDChecker(tc).Test(t, http.MethodGet, "/v1/resource/1").Check(). - HasStatus(200).Cb(func(r *http.Response) { - b, readErr := ioutil.ReadAll(r.Body) - assert.NoError(t, readErr) - defer r.Body.Close() - - res, err := testutils.FormatJSON(b) - assert.NoError(t, err) - - golden.Assert(t, res, fmt.Sprintf("%s.golden", t.Name())) - }) -} - func TestByID_Http_ErrorCase(t *testing.T) { tc := testutils.Setup(t) testutils.LoadFixtures(t, tc.FixturePath()) diff --git a/api/pkg/service/resource/resource_test.go b/api/pkg/service/resource/resource_test.go index 692abdb5cc..d69cec3826 100644 --- a/api/pkg/service/resource/resource_test.go +++ b/api/pkg/service/resource/resource_test.go @@ -23,74 +23,6 @@ import ( "github.com/tektoncd/hub/api/pkg/testutils" ) -func TestQuery_DefaultLimit(t *testing.T) { - tc := testutils.Setup(t) - testutils.LoadFixtures(t, tc.FixturePath()) - - resourceSvc := New(tc) - payload := &resource.QueryPayload{Name: "", Kinds: []string{}, Limit: 100} - all, err := resourceSvc.Query(context.Background(), payload) - assert.NoError(t, err) - assert.Equal(t, 7, len(all.Data)) -} - -func TestQuery_ByLimit(t *testing.T) { - tc := testutils.Setup(t) - testutils.LoadFixtures(t, tc.FixturePath()) - - resourceSvc := New(tc) - payload := &resource.QueryPayload{Name: "", Limit: 2} - all, err := resourceSvc.Query(context.Background(), payload) - assert.NoError(t, err) - assert.Equal(t, 2, len(all.Data)) - assert.Equal(t, "tekton", all.Data[0].Name) -} - -func TestQuery_ByName(t *testing.T) { - tc := testutils.Setup(t) - testutils.LoadFixtures(t, tc.FixturePath()) - - resourceSvc := New(tc) - payload := &resource.QueryPayload{Name: "tekton", Kinds: []string{}, Limit: 100} - all, err := resourceSvc.Query(context.Background(), payload) - assert.NoError(t, err) - assert.Equal(t, 1, len(all.Data)) - assert.Equal(t, "0.2", all.Data[0].LatestVersion.Version) -} - -func TestQuery_ByPartialName(t *testing.T) { - tc := testutils.Setup(t) - testutils.LoadFixtures(t, tc.FixturePath()) - - resourceSvc := New(tc) - payload := &resource.QueryPayload{Name: "build", Kinds: []string{}, Limit: 100} - all, err := resourceSvc.Query(context.Background(), payload) - assert.NoError(t, err) - assert.Equal(t, 2, len(all.Data)) -} - -func TestQuery_ByKind(t *testing.T) { - tc := testutils.Setup(t) - testutils.LoadFixtures(t, tc.FixturePath()) - - resourceSvc := New(tc) - payload := &resource.QueryPayload{Name: "", Kinds: []string{"pipeline"}, Limit: 100} - all, err := resourceSvc.Query(context.Background(), payload) - assert.NoError(t, err) - assert.Equal(t, 1, len(all.Data)) -} - -func TestQuery_ByMultipleKinds(t *testing.T) { - tc := testutils.Setup(t) - testutils.LoadFixtures(t, tc.FixturePath()) - - resourceSvc := New(tc) - payload := &resource.QueryPayload{Name: "", Kinds: []string{"task", "pipeline"}, Limit: 100} - all, err := resourceSvc.Query(context.Background(), payload) - assert.NoError(t, err) - assert.Equal(t, 7, len(all.Data)) -} - func TestQuery_ByTags(t *testing.T) { tc := testutils.Setup(t) testutils.LoadFixtures(t, tc.FixturePath()) @@ -114,39 +46,6 @@ func TestQuery_ByNameAndKind(t *testing.T) { assert.Equal(t, "build-pipeline", all.Data[0].Name) } -func TestQuery_ByNameTagsAndMultipleType(t *testing.T) { - tc := testutils.Setup(t) - testutils.LoadFixtures(t, tc.FixturePath()) - - resourceSvc := New(tc) - payload := &resource.QueryPayload{Name: "build", Kinds: []string{"task", "pipeline"}, Tags: []string{"atag", "ztag"}, Match: "contains", Limit: 100} - all, err := resourceSvc.Query(context.Background(), payload) - assert.NoError(t, err) - assert.Equal(t, 2, len(all.Data)) -} - -func TestQuery_ByExactNameAndMultipleType(t *testing.T) { - tc := testutils.Setup(t) - testutils.LoadFixtures(t, tc.FixturePath()) - - resourceSvc := New(tc) - payload := &resource.QueryPayload{Name: "buildah", Kinds: []string{"task", "pipeline"}, Match: "exact", Limit: 100} - all, err := resourceSvc.Query(context.Background(), payload) - assert.NoError(t, err) - assert.Equal(t, 1, len(all.Data)) -} - -func TestQuery_ExactNameNotFoundError(t *testing.T) { - tc := testutils.Setup(t) - testutils.LoadFixtures(t, tc.FixturePath()) - - resourceSvc := New(tc) - payload := &resource.QueryPayload{Name: "build", Kinds: []string{}, Match: "exact", Limit: 100} - _, err := resourceSvc.Query(context.Background(), payload) - assert.Error(t, err) - assert.EqualError(t, err, "resource not found") -} - func TestQuery_NotFoundError(t *testing.T) { tc := testutils.Setup(t) testutils.LoadFixtures(t, tc.FixturePath()) @@ -215,28 +114,6 @@ func TestByCatalogKindNameVersion_NoResourceWithName(t *testing.T) { assert.EqualError(t, err, "resource not found") } -func TestByCatalogKindNameVersion_NoCatalogWithName(t *testing.T) { - tc := testutils.Setup(t) - testutils.LoadFixtures(t, tc.FixturePath()) - - resourceSvc := New(tc) - payload := &resource.ByCatalogKindNameVersionPayload{Catalog: "Abc", Kind: "task", Name: "foo", Version: "0.1"} - _, err := resourceSvc.ByCatalogKindNameVersion(context.Background(), payload) - assert.Error(t, err) - assert.EqualError(t, err, "resource not found") -} - -func TestByCatalogKindNameVersion_ResourceVersionNotFound(t *testing.T) { - tc := testutils.Setup(t) - testutils.LoadFixtures(t, tc.FixturePath()) - - resourceSvc := New(tc) - payload := &resource.ByCatalogKindNameVersionPayload{Catalog: "catalog-official", Kind: "task", Name: "tekton", Version: "0.9"} - _, err := resourceSvc.ByCatalogKindNameVersion(context.Background(), payload) - assert.Error(t, err) - assert.EqualError(t, err, "resource not found") -} - func TestByVersionID(t *testing.T) { tc := testutils.Setup(t) testutils.LoadFixtures(t, tc.FixturePath()) @@ -270,17 +147,6 @@ func TestByCatalogKindName(t *testing.T) { assert.Equal(t, "img", res.Data.Name) } -func TestByCatalogKindName_NoCatalogWithName(t *testing.T) { - tc := testutils.Setup(t) - testutils.LoadFixtures(t, tc.FixturePath()) - - resourceSvc := New(tc) - payload := &resource.ByCatalogKindNamePayload{Catalog: "abc", Kind: "task", Name: "foo"} - _, err := resourceSvc.ByCatalogKindName(context.Background(), payload) - assert.Error(t, err) - assert.EqualError(t, err, "resource not found") -} - func TestByCatalogKindName_ResourceNotFoundError(t *testing.T) { tc := testutils.Setup(t) testutils.LoadFixtures(t, tc.FixturePath()) diff --git a/api/pkg/service/status/status.go b/api/pkg/service/status/status.go index e959ef2950..34aff1c65d 100644 --- a/api/pkg/service/status/status.go +++ b/api/pkg/service/status/status.go @@ -35,7 +35,7 @@ func New(api app.BaseConfig) status.Service { func (s *service) Status(ctx context.Context) (*status.StatusResult, error) { service := []*status.HubService{ - &status.HubService{Name: "api", Status: "ok"}, + {Name: "api", Status: "ok"}, } db, err := s.DB(ctx).DB() diff --git a/api/pkg/shared/resource/resource.go b/api/pkg/shared/resource/resource.go new file mode 100644 index 0000000000..98b596ea7f --- /dev/null +++ b/api/pkg/shared/resource/resource.go @@ -0,0 +1,332 @@ +// Copyright © 2020 The Tekton Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package resource + +import ( + "fmt" + "strings" + + "github.com/tektoncd/hub/api/gen/log" + "github.com/tektoncd/hub/api/pkg/db/model" + "github.com/tektoncd/hub/api/pkg/parser" + "gorm.io/gorm" +) + +type Request struct { + Db *gorm.DB + Log *log.Logger + ID uint + Name string + Match string + Kinds []string + Tags []string + Limit uint + Version string + Kind string + Catalog string + VersionID uint +} + +var ( + FetchError = fmt.Errorf("failed to fetch resources") + NotFoundError = fmt.Errorf("resource not found") +) + +//Query resources based on name, kind, tags. +//Match is the type of search: 'exact' or 'contains' +//Fields: name, []kinds, []Tags, Match, Limit +func (r *Request) Query() ([]model.Resource, error) { + + // Validate the kinds passed are supported by Hub + for _, k := range r.Kinds { + if !parser.IsSupportedKind(k) { + return nil, invalidKindError(k) + } + } + + // DISTINCT(resources.id) and resources.id is required as the + // INNER JOIN of tags and resources returns duplicate records of + // resources as a resource may have multiple tags, thus we have to + // find DISTINCT on resource.id + + r.Db = r.Db.Select("DISTINCT(resources.id), resources.*").Scopes( + filterByTags(r.Tags), + filterByKinds(r.Kinds), + filterResourceName(r.Match, r.Name), + withResourceDetails, + ).Limit(int(r.Limit)) + + return r.findAllResources() +} + +//AllResources returns all resources in db sorted by rating and name +//Limit can be passed for limiting number of resources +//Field: Limit +func (r *Request) AllResources() ([]model.Resource, error) { + + r.Db = r.Db.Scopes(withResourceDetails). + Limit(int(r.Limit)) + + return r.findAllResources() +} + +//AllVersions returns all versions of a resource +//Fields: ID (Resource ID) +func (r *Request) AllVersions() ([]model.ResourceVersion, error) { + + q := r.Db.Scopes(orderByVersion, filterByResourceID(r.ID)) + + var all []model.ResourceVersion + if err := q.Find(&all).Error; err != nil { + r.Log.Error(err) + return nil, FetchError + } + + if len(all) == 0 { + return nil, NotFoundError + } + + return all, nil +} + +//ByCatalogKindNameVersion searches resource by catalog name, kind, resource name, and version +//Fields: Catalog, Kind, Name, Version +func (r *Request) ByCatalogKindNameVersion() (model.Resource, error) { + + q := r.Db.Scopes( + withVersionInfo(r.Version), + filterByCatalog(r.Catalog), + filterByKind(r.Kind), + filterResourceName("exact", r.Name)) + + var res model.Resource + if err := findOne(q, r.Log, &res); err != nil { + return model.Resource{}, err + } + + return res, nil +} + +//ByVersionID searches resource version by its ID +//Field: VersionID +func (r *Request) ByVersionID() (model.ResourceVersion, error) { + + q := r.Db.Scopes(withResourceVersionDetails, filterByVersionID(r.VersionID)) + + var v model.ResourceVersion + if err := findOne(q, r.Log, &v); err != nil { + return model.ResourceVersion{}, err + } + + return v, nil +} + +//ByCatalogKindName searches resource by catalog name, kind and resource name +//Fields: Catalog, Kind, Name +func (r *Request) ByCatalogKindName() (model.Resource, error) { + + q := r.Db.Scopes( + withResourceDetails, + filterByCatalog(r.Catalog), + filterByKind(r.Kind), + filterResourceName("exact", r.Name)) + + var res model.Resource + if err := findOne(q, r.Log, &res); err != nil { + return model.Resource{}, err + } + + return res, nil +} + +//ByID searches resource by its ID +//Field: ID +func (r *Request) ByID() (model.Resource, error) { + + q := r.Db.Scopes(withResourceDetails, filterByID(r.ID)) + + var res model.Resource + if err := findOne(q, r.Log, &res); err != nil { + return model.Resource{}, err + } + + return res, nil +} + +func (r *Request) findAllResources() ([]model.Resource, error) { + + var rs []model.Resource + if err := r.Db.Find(&rs).Error; err != nil { + r.Log.Error(err) + return nil, FetchError + } + + if len(rs) == 0 { + return nil, NotFoundError + } + + return rs, nil +} + +func withCatalogAndTags(db *gorm.DB) *gorm.DB { + return db. + Preload("Catalog"). + Preload("Tags", orderByTags) +} + +// withResourceDetails defines a gorm scope to include all details of resource. +func withResourceDetails(db *gorm.DB) *gorm.DB { + return db. + Order("rating DESC, resources.name"). + Scopes(withCatalogAndTags). + Preload("Versions", orderByVersion) +} + +// withVersionInfo defines a gorm scope to include all details of resource +// and filtering a particular version of the resource. +func withVersionInfo(version string) func(db *gorm.DB) *gorm.DB { + return func(db *gorm.DB) *gorm.DB { + return db. + Scopes(withResourceDetails). + Preload("Versions", "version = ?", version) + } +} + +// withResourceVersionDetails defines a gorm scope to include all details of +// resource in resource version. +func withResourceVersionDetails(db *gorm.DB) *gorm.DB { + return db. + Preload("Resource"). + Preload("Resource.Catalog"). + Preload("Resource.Tags", orderByTags) +} + +func orderByTags(db *gorm.DB) *gorm.DB { + return db.Order("tags.name ASC") +} + +func orderByVersion(db *gorm.DB) *gorm.DB { + return db.Order("string_to_array(version, '.')::int[]") +} + +func findOne(db *gorm.DB, log *log.Logger, result interface{}) error { + + err := db.First(result).Error + if err != nil { + if err == gorm.ErrRecordNotFound { + return NotFoundError + } + log.Error(err) + return FetchError + } + return nil +} + +func filterByID(id uint) func(db *gorm.DB) *gorm.DB { + return func(db *gorm.DB) *gorm.DB { + return db.Where("id = ?", id) + } +} + +func filterByCatalog(catalog string) func(db *gorm.DB) *gorm.DB { + return func(db *gorm.DB) *gorm.DB { + return db.Model(&model.Resource{}). + Joins("JOIN catalogs as c on c.id = resources.catalog_id"). + Where("lower(c.name) = ?", strings.ToLower(catalog)) + } +} + +func filterByKind(t string) func(db *gorm.DB) *gorm.DB { + if t == "" { + return noop + } + + t = strings.ToLower(t) + return func(db *gorm.DB) *gorm.DB { + return db.Where("LOWER(kind) = ?", t) + } +} + +func filterByKinds(t []string) func(db *gorm.DB) *gorm.DB { + if len(t) == 0 { + return noop + } + + return func(db *gorm.DB) *gorm.DB { + t = lower(t) + return db.Where("LOWER(kind) IN (?)", t) + } +} + +func filterByTags(tags []string) func(db *gorm.DB) *gorm.DB { + if tags == nil { + return noop + } + + tags = lower(tags) + return func(db *gorm.DB) *gorm.DB { + return db.Model(&model.Resource{}). + Joins("JOIN resource_tags as rt on rt.resource_id = resources.id"). + Joins("JOIN tags on tags.id = rt.tag_id"). + Where("lower(tags.name) in (?)", tags) + } +} + +func filterByResourceID(id uint) func(db *gorm.DB) *gorm.DB { + return func(db *gorm.DB) *gorm.DB { + return db.Where("resource_id = ?", id) + } +} + +func filterByVersionID(versionID uint) func(db *gorm.DB) *gorm.DB { + return func(db *gorm.DB) *gorm.DB { + return db.Where("id = ?", versionID) + } +} + +func filterResourceName(match, name string) func(db *gorm.DB) *gorm.DB { + if name == "" { + return noop + } + name = strings.ToLower(name) + switch match { + case "exact": + return func(db *gorm.DB) *gorm.DB { + return db.Where("LOWER(resources.name) = ?", name) + } + default: + likeName := "%" + name + "%" + return func(db *gorm.DB) *gorm.DB { + return db.Where("LOWER(resources.name) LIKE ?", likeName) + } + } +} + +func noop(db *gorm.DB) *gorm.DB { + return db +} + +// This function lowercase all the elements of an array +func lower(t []string) []string { + for i := range t { + t[i] = strings.ToLower(t[i]) + } + return t +} + +func invalidKindError(kind string) error { + return fmt.Errorf("resource kind '%s' not supported. Supported kinds are %v", + kind, parser.SupportedKinds()) +} diff --git a/api/pkg/shared/resource/resource_test.go b/api/pkg/shared/resource/resource_test.go new file mode 100644 index 0000000000..6e730f3c3a --- /dev/null +++ b/api/pkg/shared/resource/resource_test.go @@ -0,0 +1,467 @@ +// Copyright © 2020 The Tekton Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package resource + +import ( + "testing" + + "github.com/stretchr/testify/assert" + "github.com/tektoncd/hub/api/pkg/testutils" +) + +func TestQuery_DefaultLimit(t *testing.T) { + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + req := Request{ + Db: tc.DB(), + Log: tc.Logger("resource"), + Name: "", + Kinds: []string{}, + Limit: 100, + } + + res, err := req.Query() + assert.NoError(t, err) + assert.Equal(t, 7, len(res)) +} + +func TestQuery_ByLimit(t *testing.T) { + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + req := Request{ + Db: tc.DB(), + Log: tc.Logger("resource"), + Name: "", + Limit: 2, + } + + res, err := req.Query() + assert.NoError(t, err) + assert.Equal(t, 2, len(res)) + assert.Equal(t, "tekton", res[0].Name) +} + +func TestQuery_ByName(t *testing.T) { + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + req := Request{ + Db: tc.DB(), + Log: tc.Logger("resource"), + Name: "tekton", + Kinds: []string{}, + Limit: 100, + } + + res, err := req.Query() + assert.NoError(t, err) + assert.Equal(t, 1, len(res)) + assert.Equal(t, 3, len(res[0].Versions)) +} + +func TestQuery_ByPartialName(t *testing.T) { + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + req := Request{ + Db: tc.DB(), + Log: tc.Logger("resource"), + Name: "build", + Kinds: []string{}, + Limit: 100, + } + + res, err := req.Query() + assert.NoError(t, err) + assert.Equal(t, 2, len(res)) +} + +func TestQuery_ByKind(t *testing.T) { + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + req := Request{ + Db: tc.DB(), + Log: tc.Logger("resource"), + Name: "", + Kinds: []string{"pipeline"}, + Limit: 100, + } + + res, err := req.Query() + assert.NoError(t, err) + assert.Equal(t, 1, len(res)) +} + +func TestQuery_ByMultipleKinds(t *testing.T) { + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + req := Request{ + Db: tc.DB(), + Log: tc.Logger("resource"), + Name: "", + Kinds: []string{"task", "pipeline"}, + Limit: 100, + } + + res, err := req.Query() + assert.NoError(t, err) + assert.Equal(t, 7, len(res)) +} + +func TestQuery_ByTags(t *testing.T) { + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + req := Request{ + Db: tc.DB(), + Log: tc.Logger("resource"), + Name: "", + Kinds: []string{}, + Tags: []string{"atag"}, + Limit: 100, + } + + res, err := req.Query() + assert.NoError(t, err) + assert.Equal(t, 1, len(res)) +} + +func TestQuery_ByNameAndKind(t *testing.T) { + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + req := Request{ + Db: tc.DB(), + Log: tc.Logger("resource"), + Name: "build", + Kinds: []string{"pipeline"}, + Limit: 100, + } + + res, err := req.Query() + assert.NoError(t, err) + assert.Equal(t, 1, len(res)) + assert.Equal(t, "build-pipeline", res[0].Name) +} + +func TestQuery_ByNameTagsAndMultipleType(t *testing.T) { + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + req := Request{ + Db: tc.DB(), + Log: tc.Logger("resource"), + Name: "build", + Kinds: []string{"task", "pipeline"}, + Tags: []string{"atag", "ztag"}, + Match: "contains", + Limit: 100, + } + + res, err := req.Query() + assert.NoError(t, err) + assert.Equal(t, 2, len(res)) +} + +func TestQuery_ByExactNameAndMultipleType(t *testing.T) { + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + req := Request{ + Db: tc.DB(), + Log: tc.Logger("resource"), + Name: "buildah", + Kinds: []string{"task", "pipeline"}, + Match: "exact", + Limit: 100, + } + + res, err := req.Query() + assert.NoError(t, err) + assert.Equal(t, 1, len(res)) +} + +func TestQuery_ExactNameNotFoundError(t *testing.T) { + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + req := Request{ + Db: tc.DB(), + Log: tc.Logger("resource"), + Name: "build", + Kinds: []string{}, + Match: "exact", + Limit: 100, + } + + _, err := req.Query() + assert.Error(t, err) + assert.EqualError(t, err, "resource not found") +} + +func TestQuery_NotFoundError(t *testing.T) { + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + req := Request{ + Db: tc.DB(), + Log: tc.Logger("resource"), + Name: "foo", + Kinds: []string{}, + Limit: 100, + } + + _, err := req.Query() + assert.Error(t, err) + assert.EqualError(t, err, "resource not found") +} + +func TestList_ByLimit(t *testing.T) { + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + req := Request{ + Db: tc.DB(), + Log: tc.Logger("resource"), + Limit: 3, + } + + res, err := req.AllResources() + assert.NoError(t, err) + assert.Equal(t, 3, len(res)) + assert.Equal(t, "tekton", res[0].Name) +} + +func TestVersionsByID(t *testing.T) { + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + req := Request{ + Db: tc.DB(), + Log: tc.Logger("resource"), + ID: 1, + } + + res, err := req.AllVersions() + assert.NoError(t, err) + assert.Equal(t, 3, len(res)) + assert.Equal(t, "0.2", res[2].Version) +} + +func TestVersionsByID_NotFoundError(t *testing.T) { + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + req := Request{ + Db: tc.DB(), + Log: tc.Logger("resource"), + ID: 111, + } + + _, err := req.AllVersions() + assert.Error(t, err) + assert.EqualError(t, err, "resource not found") +} + +func TestByCatalogKindNameVersion(t *testing.T) { + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + req := Request{ + Db: tc.DB(), + Log: tc.Logger("resource"), + Catalog: "catalog-official", + Kind: "task", + Name: "tkn", + Version: "0.1", + } + + res, err := req.ByCatalogKindNameVersion() + assert.NoError(t, err) + assert.Equal(t, "tkn", res.Name) + assert.Equal(t, "0.1", res.Versions[0].Version) +} + +func TestByCatalogKindNameVersion_NoResourceWithName(t *testing.T) { + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + req := Request{ + Db: tc.DB(), + Log: tc.Logger("resource"), + Catalog: "catalog-official", + Kind: "task", + Name: "foo", + Version: "0.1", + } + + _, err := req.ByCatalogKindNameVersion() + assert.Error(t, err) + assert.EqualError(t, err, "resource not found") +} + +func TestByCatalogKindNameVersion_NoCatalogWithName(t *testing.T) { + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + req := Request{ + Db: tc.DB(), + Log: tc.Logger("resource"), + Catalog: "Abc", + Kind: "task", + Name: "foo", + Version: "0.1", + } + + _, err := req.ByCatalogKindNameVersion() + assert.Error(t, err) + assert.EqualError(t, err, "resource not found") +} + +func TestByCatalogKindNameVersion_ResourceVersionNotFound(t *testing.T) { + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + req := Request{ + Db: tc.DB(), + Log: tc.Logger("resource"), + Catalog: "catalog-official", + Kind: "task", + Name: "tekton", + Version: "0.9", + } + + res, err := req.ByCatalogKindNameVersion() + assert.NoError(t, err) + assert.Equal(t, "tekton", res.Name) + assert.Equal(t, 0, len(res.Versions)) + //assert.Error(t, err) + //assert.EqualError(t, err, "resource not found") +} + +func TestByVersionID(t *testing.T) { + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + req := Request{ + Db: tc.DB(), + Log: tc.Logger("resource"), + VersionID: 6, + } + + res, err := req.ByVersionID() + assert.NoError(t, err) + assert.Equal(t, "0.1.1", res.Version) +} + +func TestByVersionID_NotFoundError(t *testing.T) { + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + req := Request{ + Db: tc.DB(), + Log: tc.Logger("resource"), + VersionID: 111, + } + + _, err := req.ByVersionID() + assert.Error(t, err) + assert.EqualError(t, err, "resource not found") +} + +func TestByCatalogKindName(t *testing.T) { + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + req := Request{ + Db: tc.DB(), + Log: tc.Logger("resource"), + Catalog: "catalog-community", + Kind: "task", + Name: "img", + } + + res, err := req.ByCatalogKindName() + assert.NoError(t, err) + assert.Equal(t, "img", res.Name) +} + +func TestByCatalogKindName_NoCatalogWithName(t *testing.T) { + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + req := Request{ + Db: tc.DB(), + Log: tc.Logger("resource"), + Catalog: "abc", + Kind: "task", + Name: "foo", + } + + _, err := req.ByCatalogKindName() + assert.Error(t, err) + assert.EqualError(t, err, "resource not found") +} + +func TestByCatalogKindName_ResourceNotFoundError(t *testing.T) { + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + req := Request{ + Db: tc.DB(), + Log: tc.Logger("resource"), + Catalog: "catalog-community", + Kind: "task", + Name: "foo", + } + + _, err := req.ByCatalogKindName() + assert.Error(t, err) + assert.EqualError(t, err, "resource not found") +} + +func TestByID(t *testing.T) { + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + req := Request{ + Db: tc.DB(), + Log: tc.Logger("resource"), + ID: 1, + } + + res, err := req.ByID() + assert.NoError(t, err) + assert.Equal(t, "tekton", res.Name) +} + +func TestByID_NotFoundError(t *testing.T) { + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + req := Request{ + Db: tc.DB(), + Log: tc.Logger("resource"), + ID: 77, + } + + _, err := req.ByID() + assert.Error(t, err) + assert.EqualError(t, err, "resource not found") +} diff --git a/api/v1/design/api.go b/api/v1/design/api.go new file mode 100644 index 0000000000..11a40aceea --- /dev/null +++ b/api/v1/design/api.go @@ -0,0 +1,44 @@ +// Copyright © 2020 The Tekton Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package design + +import ( + . "goa.design/goa/v3/dsl" + cors "goa.design/plugins/v3/cors/dsl" + + // Enables the zaplogger plugin + _ "goa.design/plugins/v3/zaplogger" +) + +var _ = API("v1", func() { + Title("Tekton Hub") + Description("HTTP services for managing Tekton Hub") + Version("1.0") + Meta("swagger:example", "false") + Server("hub", func() { + Host("production", func() { + URI("http://api.hub.tekton.dev") + }) + + Services( + "resource", + "swagger", + ) + }) + + cors.Origin("*", func() { + cors.Methods("GET") + }) +}) diff --git a/api/v1/design/resource.go b/api/v1/design/resource.go new file mode 100644 index 0000000000..0634453da9 --- /dev/null +++ b/api/v1/design/resource.go @@ -0,0 +1,207 @@ +// Copyright © 2020 The Tekton Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package design + +import ( + types "github.com/tektoncd/hub/api/design/types" + . "goa.design/goa/v3/dsl" +) + +var _ = Service("resource", func() { + Description("The resource service provides details about all kind of resources") + + HTTP(func() { + Path("/v1") + }) + + Error("internal-error", ErrorResult, "Internal Server Error") + Error("not-found", ErrorResult, "Resource Not Found Error") + Error("invalid-kind", ErrorResult, "Invalid Resource Kind") + + // NOTE: Supported Tekton Resource kind by APIs are defined in /pkg/parser/kind.go + + Method("Query", func() { + Description("Find resources by a combination of name, kind and tags") + Payload(func() { + Attribute("name", String, "Name of resource", func() { + Default("") + Example("name", "buildah") + }) + Attribute("kinds", ArrayOf(String), "Kinds of resource to filter by", func() { + Example([]string{"task", "pipelines"}) + }) + Attribute("tags", ArrayOf(String), "Tags associated with a resource to filter by", func() { + Example([]string{"image", "build"}) + }) + Attribute("limit", UInt, "Maximum number of resources to be returned", func() { + Default(1000) + Example("limit", 100) + }) + + Attribute("match", String, "Strategy used to find matching resources", func() { + Enum("exact", "contains") + Default("contains") + }) + }) + Result(types.Resources) + + HTTP(func() { + GET("/query") + + Param("name") + Param("kinds") + Param("tags") + Param("limit") + Param("match") + + Response(StatusOK) + Response("internal-error", StatusInternalServerError) + Response("invalid-kind", StatusBadRequest) + Response("not-found", StatusNotFound) + }) + }) + + Method("List", func() { + Description("List all resources sorted by rating and name") + Payload(func() { + Attribute("limit", UInt, "Maximum number of resources to be returned", func() { + Default(1000) + Example("limit", 100) + }) + }) + Result(types.Resources) + + HTTP(func() { + GET("/resources") + + Param("limit") + + Response(StatusOK) + Response("internal-error", StatusInternalServerError) + }) + }) + + Method("VersionsByID", func() { + Description("Find all versions of a resource by its id") + Payload(func() { + Attribute("id", UInt, "ID of a resource", func() { + Example("id", 1) + }) + Required("id") + }) + Result(types.ResourceVersions) + + HTTP(func() { + GET("/resource/{id}/versions") + + Response(StatusOK) + Response("internal-error", StatusInternalServerError) + Response("not-found", StatusNotFound) + }) + }) + + Method("ByCatalogKindNameVersion", func() { + Description("Find resource using name of catalog & name, kind and version of resource") + Payload(func() { + Attribute("catalog", String, "name of catalog", func() { + Example("catalog", "tektoncd") + }) + Attribute("kind", String, "kind of resource", func() { + Enum("task", "pipeline") + }) + Attribute("name", String, "name of resource", func() { + Example("name", "buildah") + }) + Attribute("version", String, "version of resource", func() { + Example("version", "0.1") + }) + + Required("catalog", "kind", "name", "version") + }) + Result(types.ResourceVersion) + + HTTP(func() { + GET("/resource/{catalog}/{kind}/{name}/{version}") + + Response(StatusOK) + Response("internal-error", StatusInternalServerError) + Response("not-found", StatusNotFound) + }) + }) + + Method("ByVersionId", func() { + Description("Find a resource using its version's id") + Payload(func() { + Attribute("versionID", UInt, "Version ID of a resource's version", func() { + Example("versionID", 1) + }) + Required("versionID") + }) + Result(types.ResourceVersion) + + HTTP(func() { + GET("/resource/version/{versionID}") + + Response(StatusOK) + Response("internal-error", StatusInternalServerError) + Response("not-found", StatusNotFound) + }) + }) + + Method("ByCatalogKindName", func() { + Description("Find resources using name of catalog, resource name and kind of resource") + Payload(func() { + Attribute("catalog", String, "name of catalog", func() { + Example("catalog", "tektoncd") + }) + Attribute("kind", String, "kind of resource", func() { + Enum("task", "pipeline") + }) + Attribute("name", String, "Name of resource", func() { + Example("name", "buildah") + }) + Required("catalog", "kind", "name") + }) + Result(types.Resource) + + HTTP(func() { + GET("/resource/{catalog}/{kind}/{name}") + + Response(StatusOK) + Response("internal-error", StatusInternalServerError) + Response("not-found", StatusNotFound) + }) + }) + + Method("ById", func() { + Description("Find a resource using it's id") + Payload(func() { + Attribute("id", UInt, "ID of a resource", func() { + Example("id", 1) + }) + Required("id") + }) + Result(types.Resource) + + HTTP(func() { + GET("/resource/{id}") + + Response(StatusOK) + Response("internal-error", StatusInternalServerError) + Response("not-found", StatusNotFound) + }) + }) + +}) diff --git a/api/v1/design/swagger.go b/api/v1/design/swagger.go new file mode 100644 index 0000000000..3b30b0d67f --- /dev/null +++ b/api/v1/design/swagger.go @@ -0,0 +1,29 @@ +// Copyright © 2020 The Tekton Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package design + +import . "goa.design/goa/v3/dsl" + +var _ = Service("swagger", func() { + Description("The swagger service serves the API swagger definition.") + + HTTP(func() { + Path("/v1/schema") + }) + + Files("/swagger.json", "v1/gen/http/openapi3.yaml", func() { + Description("JSON document containing the API swagger definition") + }) +}) diff --git a/api/v1/gen/http/cli/hub/cli.go b/api/v1/gen/http/cli/hub/cli.go new file mode 100644 index 0000000000..b976cba101 --- /dev/null +++ b/api/v1/gen/http/cli/hub/cli.go @@ -0,0 +1,313 @@ +// Code generated by goa v3.2.2, DO NOT EDIT. +// +// hub HTTP client CLI support package +// +// Command: +// $ goa gen github.com/tektoncd/hub/api/v1/design + +package cli + +import ( + "flag" + "fmt" + "net/http" + "os" + + resourcec "github.com/tektoncd/hub/api/v1/gen/http/resource/client" + goahttp "goa.design/goa/v3/http" + goa "goa.design/goa/v3/pkg" +) + +// UsageCommands returns the set of commands and sub-commands using the format +// +// command (subcommand1|subcommand2|...) +// +func UsageCommands() string { + return `resource (query|list|versions-by-id|by-catalog-kind-name-version|by-version-id|by-catalog-kind-name|by-id) +` +} + +// UsageExamples produces an example of a valid invocation of the CLI tool. +func UsageExamples() string { + return os.Args[0] + ` resource query --name "buildah" --kinds '[ + "task", + "pipelines" + ]' --tags '[ + "image", + "build" + ]' --limit 100 --match "exact"` + "\n" + + "" +} + +// ParseEndpoint returns the endpoint and payload as specified on the command +// line. +func ParseEndpoint( + scheme, host string, + doer goahttp.Doer, + enc func(*http.Request) goahttp.Encoder, + dec func(*http.Response) goahttp.Decoder, + restore bool, +) (goa.Endpoint, interface{}, error) { + var ( + resourceFlags = flag.NewFlagSet("resource", flag.ContinueOnError) + + resourceQueryFlags = flag.NewFlagSet("query", flag.ExitOnError) + resourceQueryNameFlag = resourceQueryFlags.String("name", "", "") + resourceQueryKindsFlag = resourceQueryFlags.String("kinds", "", "") + resourceQueryTagsFlag = resourceQueryFlags.String("tags", "", "") + resourceQueryLimitFlag = resourceQueryFlags.String("limit", "1000", "") + resourceQueryMatchFlag = resourceQueryFlags.String("match", "contains", "") + + resourceListFlags = flag.NewFlagSet("list", flag.ExitOnError) + resourceListLimitFlag = resourceListFlags.String("limit", "1000", "") + + resourceVersionsByIDFlags = flag.NewFlagSet("versions-by-id", flag.ExitOnError) + resourceVersionsByIDIDFlag = resourceVersionsByIDFlags.String("id", "REQUIRED", "ID of a resource") + + resourceByCatalogKindNameVersionFlags = flag.NewFlagSet("by-catalog-kind-name-version", flag.ExitOnError) + resourceByCatalogKindNameVersionCatalogFlag = resourceByCatalogKindNameVersionFlags.String("catalog", "REQUIRED", "name of catalog") + resourceByCatalogKindNameVersionKindFlag = resourceByCatalogKindNameVersionFlags.String("kind", "REQUIRED", "kind of resource") + resourceByCatalogKindNameVersionNameFlag = resourceByCatalogKindNameVersionFlags.String("name", "REQUIRED", "name of resource") + resourceByCatalogKindNameVersionVersionFlag = resourceByCatalogKindNameVersionFlags.String("version", "REQUIRED", "version of resource") + + resourceByVersionIDFlags = flag.NewFlagSet("by-version-id", flag.ExitOnError) + resourceByVersionIDVersionIDFlag = resourceByVersionIDFlags.String("version-id", "REQUIRED", "Version ID of a resource's version") + + resourceByCatalogKindNameFlags = flag.NewFlagSet("by-catalog-kind-name", flag.ExitOnError) + resourceByCatalogKindNameCatalogFlag = resourceByCatalogKindNameFlags.String("catalog", "REQUIRED", "name of catalog") + resourceByCatalogKindNameKindFlag = resourceByCatalogKindNameFlags.String("kind", "REQUIRED", "kind of resource") + resourceByCatalogKindNameNameFlag = resourceByCatalogKindNameFlags.String("name", "REQUIRED", "Name of resource") + + resourceByIDFlags = flag.NewFlagSet("by-id", flag.ExitOnError) + resourceByIDIDFlag = resourceByIDFlags.String("id", "REQUIRED", "ID of a resource") + ) + resourceFlags.Usage = resourceUsage + resourceQueryFlags.Usage = resourceQueryUsage + resourceListFlags.Usage = resourceListUsage + resourceVersionsByIDFlags.Usage = resourceVersionsByIDUsage + resourceByCatalogKindNameVersionFlags.Usage = resourceByCatalogKindNameVersionUsage + resourceByVersionIDFlags.Usage = resourceByVersionIDUsage + resourceByCatalogKindNameFlags.Usage = resourceByCatalogKindNameUsage + resourceByIDFlags.Usage = resourceByIDUsage + + if err := flag.CommandLine.Parse(os.Args[1:]); err != nil { + return nil, nil, err + } + + if flag.NArg() < 2 { // two non flag args are required: SERVICE and ENDPOINT (aka COMMAND) + return nil, nil, fmt.Errorf("not enough arguments") + } + + var ( + svcn string + svcf *flag.FlagSet + ) + { + svcn = flag.Arg(0) + switch svcn { + case "resource": + svcf = resourceFlags + default: + return nil, nil, fmt.Errorf("unknown service %q", svcn) + } + } + if err := svcf.Parse(flag.Args()[1:]); err != nil { + return nil, nil, err + } + + var ( + epn string + epf *flag.FlagSet + ) + { + epn = svcf.Arg(0) + switch svcn { + case "resource": + switch epn { + case "query": + epf = resourceQueryFlags + + case "list": + epf = resourceListFlags + + case "versions-by-id": + epf = resourceVersionsByIDFlags + + case "by-catalog-kind-name-version": + epf = resourceByCatalogKindNameVersionFlags + + case "by-version-id": + epf = resourceByVersionIDFlags + + case "by-catalog-kind-name": + epf = resourceByCatalogKindNameFlags + + case "by-id": + epf = resourceByIDFlags + + } + + } + } + if epf == nil { + return nil, nil, fmt.Errorf("unknown %q endpoint %q", svcn, epn) + } + + // Parse endpoint flags if any + if svcf.NArg() > 1 { + if err := epf.Parse(svcf.Args()[1:]); err != nil { + return nil, nil, err + } + } + + var ( + data interface{} + endpoint goa.Endpoint + err error + ) + { + switch svcn { + case "resource": + c := resourcec.NewClient(scheme, host, doer, enc, dec, restore) + switch epn { + case "query": + endpoint = c.Query() + data, err = resourcec.BuildQueryPayload(*resourceQueryNameFlag, *resourceQueryKindsFlag, *resourceQueryTagsFlag, *resourceQueryLimitFlag, *resourceQueryMatchFlag) + case "list": + endpoint = c.List() + data, err = resourcec.BuildListPayload(*resourceListLimitFlag) + case "versions-by-id": + endpoint = c.VersionsByID() + data, err = resourcec.BuildVersionsByIDPayload(*resourceVersionsByIDIDFlag) + case "by-catalog-kind-name-version": + endpoint = c.ByCatalogKindNameVersion() + data, err = resourcec.BuildByCatalogKindNameVersionPayload(*resourceByCatalogKindNameVersionCatalogFlag, *resourceByCatalogKindNameVersionKindFlag, *resourceByCatalogKindNameVersionNameFlag, *resourceByCatalogKindNameVersionVersionFlag) + case "by-version-id": + endpoint = c.ByVersionID() + data, err = resourcec.BuildByVersionIDPayload(*resourceByVersionIDVersionIDFlag) + case "by-catalog-kind-name": + endpoint = c.ByCatalogKindName() + data, err = resourcec.BuildByCatalogKindNamePayload(*resourceByCatalogKindNameCatalogFlag, *resourceByCatalogKindNameKindFlag, *resourceByCatalogKindNameNameFlag) + case "by-id": + endpoint = c.ByID() + data, err = resourcec.BuildByIDPayload(*resourceByIDIDFlag) + } + } + } + if err != nil { + return nil, nil, err + } + + return endpoint, data, nil +} + +// resourceUsage displays the usage of the resource command and its subcommands. +func resourceUsage() { + fmt.Fprintf(os.Stderr, `The resource service provides details about all kind of resources +Usage: + %s [globalflags] resource COMMAND [flags] + +COMMAND: + query: Find resources by a combination of name, kind and tags + list: List all resources sorted by rating and name + versions-by-id: Find all versions of a resource by its id + by-catalog-kind-name-version: Find resource using name of catalog & name, kind and version of resource + by-version-id: Find a resource using its version's id + by-catalog-kind-name: Find resources using name of catalog, resource name and kind of resource + by-id: Find a resource using it's id + +Additional help: + %s resource COMMAND --help +`, os.Args[0], os.Args[0]) +} +func resourceQueryUsage() { + fmt.Fprintf(os.Stderr, `%s [flags] resource query -name STRING -kinds JSON -tags JSON -limit UINT -match STRING + +Find resources by a combination of name, kind and tags + -name STRING: + -kinds JSON: + -tags JSON: + -limit UINT: + -match STRING: + +Example: + `+os.Args[0]+` resource query --name "buildah" --kinds '[ + "task", + "pipelines" + ]' --tags '[ + "image", + "build" + ]' --limit 100 --match "exact" +`, os.Args[0]) +} + +func resourceListUsage() { + fmt.Fprintf(os.Stderr, `%s [flags] resource list -limit UINT + +List all resources sorted by rating and name + -limit UINT: + +Example: + `+os.Args[0]+` resource list --limit 100 +`, os.Args[0]) +} + +func resourceVersionsByIDUsage() { + fmt.Fprintf(os.Stderr, `%s [flags] resource versions-by-id -id UINT + +Find all versions of a resource by its id + -id UINT: ID of a resource + +Example: + `+os.Args[0]+` resource versions-by-id --id 1 +`, os.Args[0]) +} + +func resourceByCatalogKindNameVersionUsage() { + fmt.Fprintf(os.Stderr, `%s [flags] resource by-catalog-kind-name-version -catalog STRING -kind STRING -name STRING -version STRING + +Find resource using name of catalog & name, kind and version of resource + -catalog STRING: name of catalog + -kind STRING: kind of resource + -name STRING: name of resource + -version STRING: version of resource + +Example: + `+os.Args[0]+` resource by-catalog-kind-name-version --catalog "tektoncd" --kind "pipeline" --name "buildah" --version "0.1" +`, os.Args[0]) +} + +func resourceByVersionIDUsage() { + fmt.Fprintf(os.Stderr, `%s [flags] resource by-version-id -version-id UINT + +Find a resource using its version's id + -version-id UINT: Version ID of a resource's version + +Example: + `+os.Args[0]+` resource by-version-id --version-id 1 +`, os.Args[0]) +} + +func resourceByCatalogKindNameUsage() { + fmt.Fprintf(os.Stderr, `%s [flags] resource by-catalog-kind-name -catalog STRING -kind STRING -name STRING + +Find resources using name of catalog, resource name and kind of resource + -catalog STRING: name of catalog + -kind STRING: kind of resource + -name STRING: Name of resource + +Example: + `+os.Args[0]+` resource by-catalog-kind-name --catalog "tektoncd" --kind "pipeline" --name "buildah" +`, os.Args[0]) +} + +func resourceByIDUsage() { + fmt.Fprintf(os.Stderr, `%s [flags] resource by-id -id UINT + +Find a resource using it's id + -id UINT: ID of a resource + +Example: + `+os.Args[0]+` resource by-id --id 1 +`, os.Args[0]) +} diff --git a/api/v1/gen/http/openapi.json b/api/v1/gen/http/openapi.json new file mode 100644 index 0000000000..eee7b70c57 --- /dev/null +++ b/api/v1/gen/http/openapi.json @@ -0,0 +1 @@ +{"swagger":"2.0","info":{"title":"Tekton Hub","description":"HTTP services for managing Tekton Hub","version":"1.0"},"host":"api.hub.tekton.dev","consumes":["application/json","application/xml","application/gob"],"produces":["application/json","application/xml","application/gob"],"paths":{"/v1/query":{"get":{"tags":["resource"],"summary":"Query resource","description":"Find resources by a combination of name, kind and tags","operationId":"resource#Query","parameters":[{"name":"name","in":"query","description":"Name of resource","required":false,"type":"string","default":""},{"name":"kinds","in":"query","description":"Kinds of resource to filter by","required":false,"type":"array","items":{"type":"string"},"collectionFormat":"multi"},{"name":"tags","in":"query","description":"Tags associated with a resource to filter by","required":false,"type":"array","items":{"type":"string"},"collectionFormat":"multi"},{"name":"limit","in":"query","description":"Maximum number of resources to be returned","required":false,"type":"integer","default":1000},{"name":"match","in":"query","description":"Strategy used to find matching resources","required":false,"type":"string","default":"contains","enum":["exact","contains"]}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/ResourceQueryResponseBody"}},"400":{"description":"Bad Request response.","schema":{"$ref":"#/definitions/ResourceQueryInvalidKindResponseBody"}},"404":{"description":"Not Found response.","schema":{"$ref":"#/definitions/ResourceQueryNotFoundResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/ResourceQueryInternalErrorResponseBody"}}},"schemes":["http"]}},"/v1/resource/version/{versionID}":{"get":{"tags":["resource"],"summary":"ByVersionId resource","description":"Find a resource using its version's id","operationId":"resource#ByVersionId","parameters":[{"name":"versionID","in":"path","description":"Version ID of a resource's version","required":true,"type":"integer"}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/ResourceByVersionIDResponseBody"}},"404":{"description":"Not Found response.","schema":{"$ref":"#/definitions/ResourceByVersionIDNotFoundResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/ResourceByVersionIDInternalErrorResponseBody"}}},"schemes":["http"]}},"/v1/resource/{catalog}/{kind}/{name}":{"get":{"tags":["resource"],"summary":"ByCatalogKindName resource","description":"Find resources using name of catalog, resource name and kind of resource","operationId":"resource#ByCatalogKindName","parameters":[{"name":"catalog","in":"path","description":"name of catalog","required":true,"type":"string"},{"name":"kind","in":"path","description":"kind of resource","required":true,"type":"string","enum":["task","pipeline"]},{"name":"name","in":"path","description":"Name of resource","required":true,"type":"string"}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/ResourceByCatalogKindNameResponseBody"}},"404":{"description":"Not Found response.","schema":{"$ref":"#/definitions/ResourceByCatalogKindNameNotFoundResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/ResourceByCatalogKindNameInternalErrorResponseBody"}}},"schemes":["http"]}},"/v1/resource/{catalog}/{kind}/{name}/{version}":{"get":{"tags":["resource"],"summary":"ByCatalogKindNameVersion resource","description":"Find resource using name of catalog \u0026 name, kind and version of resource","operationId":"resource#ByCatalogKindNameVersion","parameters":[{"name":"catalog","in":"path","description":"name of catalog","required":true,"type":"string"},{"name":"kind","in":"path","description":"kind of resource","required":true,"type":"string","enum":["task","pipeline"]},{"name":"name","in":"path","description":"name of resource","required":true,"type":"string"},{"name":"version","in":"path","description":"version of resource","required":true,"type":"string"}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/ResourceByCatalogKindNameVersionResponseBody"}},"404":{"description":"Not Found response.","schema":{"$ref":"#/definitions/ResourceByCatalogKindNameVersionNotFoundResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/ResourceByCatalogKindNameVersionInternalErrorResponseBody"}}},"schemes":["http"]}},"/v1/resource/{id}":{"get":{"tags":["resource"],"summary":"ById resource","description":"Find a resource using it's id","operationId":"resource#ById","parameters":[{"name":"id","in":"path","description":"ID of a resource","required":true,"type":"integer"}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/ResourceByIDResponseBody"}},"404":{"description":"Not Found response.","schema":{"$ref":"#/definitions/ResourceByIDNotFoundResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/ResourceByIDInternalErrorResponseBody"}}},"schemes":["http"]}},"/v1/resource/{id}/versions":{"get":{"tags":["resource"],"summary":"VersionsByID resource","description":"Find all versions of a resource by its id","operationId":"resource#VersionsByID","parameters":[{"name":"id","in":"path","description":"ID of a resource","required":true,"type":"integer"}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/ResourceVersionsByIDResponseBody"}},"404":{"description":"Not Found response.","schema":{"$ref":"#/definitions/ResourceVersionsByIDNotFoundResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/ResourceVersionsByIDInternalErrorResponseBody"}}},"schemes":["http"]}},"/v1/resources":{"get":{"tags":["resource"],"summary":"List resource","description":"List all resources sorted by rating and name","operationId":"resource#List","parameters":[{"name":"limit","in":"query","description":"Maximum number of resources to be returned","required":false,"type":"integer","default":1000}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/ResourceListResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/ResourceListInternalErrorResponseBody"}}},"schemes":["http"]}},"/v1/schema/swagger.json":{"get":{"tags":["swagger"],"summary":"Download v1/gen/http/openapi3.yaml","description":"JSON document containing the API swagger definition","operationId":"swagger#/v1/schema/swagger.json","responses":{"200":{"description":"File downloaded","schema":{"type":"file"}}},"schemes":["http"]}}},"definitions":{"CatalogResponseBody":{"title":"CatalogResponseBody","type":"object","properties":{"id":{"type":"integer","description":"ID is the unique id of the catalog","example":1,"format":"int64"},"name":{"type":"string","description":"Name of catalog","example":"Tekton"},"type":{"type":"string","description":"Type of catalog","example":"community","enum":["official","community"]}},"example":{"id":1,"name":"Tekton","type":"community"},"required":["id","name","type"]},"ResourceByCatalogKindNameInternalErrorResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Internal Server Error (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"ResourceByCatalogKindNameNotFoundResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Resource Not Found Error (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"ResourceByCatalogKindNameResponseBody":{"title":"Mediatype identifier: application/vnd.hub.resource; view=default","type":"object","properties":{"data":{"$ref":"#/definitions/ResourceDataResponseBody"}},"description":"ByCatalogKindNameResponseBody result type (default view)","example":{"data":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]}},"required":["data"]},"ResourceByCatalogKindNameVersionInternalErrorResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Internal Server Error (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"ResourceByCatalogKindNameVersionNotFoundResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Resource Not Found Error (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"ResourceByCatalogKindNameVersionResponseBody":{"title":"Mediatype identifier: application/vnd.hub.resource.version; view=default","type":"object","properties":{"data":{"$ref":"#/definitions/ResourceVersionDataResponseBody"}},"description":"ByCatalogKindNameVersionResponseBody result type (default view)","example":{"data":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","resource":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]},"updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"}},"required":["data"]},"ResourceByIDInternalErrorResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Internal Server Error (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"ResourceByIDNotFoundResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Resource Not Found Error (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"ResourceByIDResponseBody":{"title":"Mediatype identifier: application/vnd.hub.resource; view=default","type":"object","properties":{"data":{"$ref":"#/definitions/ResourceDataResponseBody"}},"description":"ByIdResponseBody result type (default view)","example":{"data":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]}},"required":["data"]},"ResourceByVersionIDInternalErrorResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Internal Server Error (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"ResourceByVersionIDNotFoundResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Resource Not Found Error (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"ResourceByVersionIDResponseBody":{"title":"Mediatype identifier: application/vnd.hub.resource.version; view=default","type":"object","properties":{"data":{"$ref":"#/definitions/ResourceVersionDataResponseBody"}},"description":"ByVersionIdResponseBody result type (default view)","example":{"data":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","resource":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]},"updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"}},"required":["data"]},"ResourceDataResponseBody":{"title":"Mediatype identifier: application/vnd.hub.resource.data; view=default","type":"object","properties":{"catalog":{"$ref":"#/definitions/CatalogResponseBody"},"id":{"type":"integer","description":"ID is the unique id of the resource","example":1,"format":"int64"},"kind":{"type":"string","description":"Kind of resource","example":"task"},"latestVersion":{"$ref":"#/definitions/ResourceVersionDataResponseBodyWithoutResource"},"name":{"type":"string","description":"Name of resource","example":"buildah"},"rating":{"type":"number","description":"Rating of resource","example":4.3,"format":"double"},"tags":{"type":"array","items":{"$ref":"#/definitions/TagResponseBody"},"description":"Tags related to resource","example":[{"id":1,"name":"image-build"}]},"versions":{"type":"array","items":{"$ref":"#/definitions/ResourceVersionDataResponseBodyTiny"},"description":"List of all versions of a resource","example":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]}},"description":"The resource type describes resource information.","example":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},"required":["id","name","catalog","kind","latestVersion","tags","rating","versions"]},"ResourceDataResponseBodyInfo":{"title":"Mediatype identifier: application/vnd.hub.resource.data; view=default","type":"object","properties":{"catalog":{"$ref":"#/definitions/CatalogResponseBody"},"id":{"type":"integer","description":"ID is the unique id of the resource","example":1,"format":"int64"},"kind":{"type":"string","description":"Kind of resource","example":"task"},"name":{"type":"string","description":"Name of resource","example":"buildah"},"rating":{"type":"number","description":"Rating of resource","example":4.3,"format":"double"},"tags":{"type":"array","items":{"$ref":"#/definitions/TagResponseBody"},"description":"Tags related to resource","example":[{"id":1,"name":"image-build"}]}},"description":"The resource type describes resource information. (default view)","example":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]},"required":["id","name","catalog","kind","tags","rating"]},"ResourceDataResponseBodyWithoutVersion":{"title":"Mediatype identifier: application/vnd.hub.resource.data; view=default","type":"object","properties":{"catalog":{"$ref":"#/definitions/CatalogResponseBody"},"id":{"type":"integer","description":"ID is the unique id of the resource","example":1,"format":"int64"},"kind":{"type":"string","description":"Kind of resource","example":"task"},"latestVersion":{"$ref":"#/definitions/ResourceVersionDataResponseBodyWithoutResource"},"name":{"type":"string","description":"Name of resource","example":"buildah"},"rating":{"type":"number","description":"Rating of resource","example":4.3,"format":"double"},"tags":{"type":"array","items":{"$ref":"#/definitions/TagResponseBody"},"description":"Tags related to resource","example":[{"id":1,"name":"image-build"}]}},"description":"The resource type describes resource information. (withoutVersion view) (default view)","example":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]},"required":["id","name","catalog","kind","latestVersion","tags","rating"]},"ResourceDataResponseBodyWithoutVersionCollection":{"title":"Mediatype identifier: application/vnd.hub.resource.data; type=collection; view=default","type":"array","items":{"$ref":"#/definitions/ResourceDataResponseBodyWithoutVersion"},"description":"ResourceDataResponseBodyWithoutVersionCollection is the result type for an array of ResourceDataResponseBodyWithoutVersion (default view)","example":[{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]}]},"ResourceListInternalErrorResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Internal Server Error (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"ResourceListResponseBody":{"title":"Mediatype identifier: application/vnd.hub.resources; view=default","type":"object","properties":{"data":{"$ref":"#/definitions/ResourceDataResponseBodyWithoutVersionCollection"}},"description":"ListResponseBody result type (default view)","example":{"data":[{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]}]},"required":["data"]},"ResourceQueryInternalErrorResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Internal Server Error (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"ResourceQueryInvalidKindResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Invalid Resource Kind (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"ResourceQueryNotFoundResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Resource Not Found Error (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"ResourceQueryResponseBody":{"title":"Mediatype identifier: application/vnd.hub.resources; view=default","type":"object","properties":{"data":{"$ref":"#/definitions/ResourceDataResponseBodyWithoutVersionCollection"}},"description":"QueryResponseBody result type (default view)","example":{"data":[{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]}]},"required":["data"]},"ResourceVersionDataResponseBody":{"title":"Mediatype identifier: application/vnd.hub.resource.version.data; view=default","type":"object","properties":{"description":{"type":"string","description":"Description of version","example":"Buildah task builds source into a container image and then pushes it to a container registry."},"displayName":{"type":"string","description":"Display name of version","example":"Buildah"},"id":{"type":"integer","description":"ID is the unique id of resource's version","example":1,"format":"int64"},"minPipelinesVersion":{"type":"string","description":"Minimum pipelines version the resource's version is compatible with","example":"0.12.1"},"rawURL":{"type":"string","description":"Raw URL of resource's yaml file of the version","example":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","format":"uri"},"resource":{"$ref":"#/definitions/ResourceDataResponseBodyInfo"},"updatedAt":{"type":"string","description":"Timestamp when version was last updated","example":"2020-01-01 12:00:00 +0000 UTC","format":"date-time"},"version":{"type":"string","description":"Version of resource","example":"0.1"},"webURL":{"type":"string","description":"Web URL of resource's yaml file of the version","example":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml","format":"uri"}},"description":"The Version result type describes resource's version information.","example":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","resource":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]},"updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"required":["id","version","displayName","description","minPipelinesVersion","rawURL","webURL","updatedAt","resource"]},"ResourceVersionDataResponseBodyMin":{"title":"Mediatype identifier: application/vnd.hub.resource.version.data; view=default","type":"object","properties":{"id":{"type":"integer","description":"ID is the unique id of resource's version","example":1,"format":"int64"},"rawURL":{"type":"string","description":"Raw URL of resource's yaml file of the version","example":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","format":"uri"},"version":{"type":"string","description":"Version of resource","example":"0.1"},"webURL":{"type":"string","description":"Web URL of resource's yaml file of the version","example":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml","format":"uri"}},"description":"The Version result type describes resource's version information. (default view)","example":{"id":1,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"required":["id","version","rawURL","webURL"]},"ResourceVersionDataResponseBodyTiny":{"title":"Mediatype identifier: application/vnd.hub.resource.version.data; view=default","type":"object","properties":{"id":{"type":"integer","description":"ID is the unique id of resource's version","example":1,"format":"int64"},"version":{"type":"string","description":"Version of resource","example":"0.1"}},"description":"The Version result type describes resource's version information. (default view)","example":{"id":1,"version":"0.1"},"required":["id","version"]},"ResourceVersionDataResponseBodyWithoutResource":{"title":"Mediatype identifier: application/vnd.hub.resource.version.data; view=default","type":"object","properties":{"description":{"type":"string","description":"Description of version","example":"Buildah task builds source into a container image and then pushes it to a container registry."},"displayName":{"type":"string","description":"Display name of version","example":"Buildah"},"id":{"type":"integer","description":"ID is the unique id of resource's version","example":1,"format":"int64"},"minPipelinesVersion":{"type":"string","description":"Minimum pipelines version the resource's version is compatible with","example":"0.12.1"},"rawURL":{"type":"string","description":"Raw URL of resource's yaml file of the version","example":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","format":"uri"},"updatedAt":{"type":"string","description":"Timestamp when version was last updated","example":"2020-01-01 12:00:00 +0000 UTC","format":"date-time"},"version":{"type":"string","description":"Version of resource","example":"0.1"},"webURL":{"type":"string","description":"Web URL of resource's yaml file of the version","example":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml","format":"uri"}},"description":"The Version result type describes resource's version information. (default view)","example":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"required":["id","version","displayName","description","minPipelinesVersion","rawURL","webURL","updatedAt"]},"ResourceVersionsByIDInternalErrorResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Internal Server Error (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"ResourceVersionsByIDNotFoundResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Resource Not Found Error (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"ResourceVersionsByIDResponseBody":{"title":"Mediatype identifier: application/vnd.hub.resource.versions; view=default","type":"object","properties":{"data":{"$ref":"#/definitions/VersionsResponseBody"}},"description":"VersionsByIDResponseBody result type (default view)","example":{"data":{"latest":{"id":2,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml","version":"0.2","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml"},"versions":[{"id":1,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},{"id":2,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml","version":"0.2","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml"}]}},"required":["data"]},"TagResponseBody":{"title":"TagResponseBody","type":"object","properties":{"id":{"type":"integer","description":"ID is the unique id of tag","example":1,"format":"int64"},"name":{"type":"string","description":"Name of tag","example":"image-build"}},"example":{"id":1,"name":"image-build"},"required":["id","name"]},"VersionsResponseBody":{"title":"Mediatype identifier: application/vnd.hub.versions; view=default","type":"object","properties":{"latest":{"$ref":"#/definitions/ResourceVersionDataResponseBodyMin"},"versions":{"type":"array","items":{"$ref":"#/definitions/ResourceVersionDataResponseBodyMin"},"description":"List of all versions of resource","example":[{"id":1,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},{"id":2,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml","version":"0.2","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml"}]}},"description":"The Versions type describes response for versions by resource id API.","example":{"latest":{"id":2,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml","version":"0.2","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml"},"versions":[{"id":1,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},{"id":2,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml","version":"0.2","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml"}]},"required":["latest","versions"]}}} \ No newline at end of file diff --git a/api/v1/gen/http/openapi.yaml b/api/v1/gen/http/openapi.yaml new file mode 100644 index 0000000000..ae23e8d421 --- /dev/null +++ b/api/v1/gen/http/openapi.yaml @@ -0,0 +1,1800 @@ +swagger: "2.0" +info: + title: Tekton Hub + description: HTTP services for managing Tekton Hub + version: "1.0" +host: api.hub.tekton.dev +consumes: +- application/json +- application/xml +- application/gob +produces: +- application/json +- application/xml +- application/gob +paths: + /v1/query: + get: + tags: + - resource + summary: Query resource + description: Find resources by a combination of name, kind and tags + operationId: resource#Query + parameters: + - name: name + in: query + description: Name of resource + required: false + type: string + default: "" + - name: kinds + in: query + description: Kinds of resource to filter by + required: false + type: array + items: + type: string + collectionFormat: multi + - name: tags + in: query + description: Tags associated with a resource to filter by + required: false + type: array + items: + type: string + collectionFormat: multi + - name: limit + in: query + description: Maximum number of resources to be returned + required: false + type: integer + default: 1000 + - name: match + in: query + description: Strategy used to find matching resources + required: false + type: string + default: contains + enum: + - exact + - contains + responses: + "200": + description: OK response. + schema: + $ref: '#/definitions/ResourceQueryResponseBody' + "400": + description: Bad Request response. + schema: + $ref: '#/definitions/ResourceQueryInvalidKindResponseBody' + "404": + description: Not Found response. + schema: + $ref: '#/definitions/ResourceQueryNotFoundResponseBody' + "500": + description: Internal Server Error response. + schema: + $ref: '#/definitions/ResourceQueryInternalErrorResponseBody' + schemes: + - http + /v1/resource/{catalog}/{kind}/{name}: + get: + tags: + - resource + summary: ByCatalogKindName resource + description: Find resources using name of catalog, resource name and kind of + resource + operationId: resource#ByCatalogKindName + parameters: + - name: catalog + in: path + description: name of catalog + required: true + type: string + - name: kind + in: path + description: kind of resource + required: true + type: string + enum: + - task + - pipeline + - name: name + in: path + description: Name of resource + required: true + type: string + responses: + "200": + description: OK response. + schema: + $ref: '#/definitions/ResourceByCatalogKindNameResponseBody' + "404": + description: Not Found response. + schema: + $ref: '#/definitions/ResourceByCatalogKindNameNotFoundResponseBody' + "500": + description: Internal Server Error response. + schema: + $ref: '#/definitions/ResourceByCatalogKindNameInternalErrorResponseBody' + schemes: + - http + /v1/resource/{catalog}/{kind}/{name}/{version}: + get: + tags: + - resource + summary: ByCatalogKindNameVersion resource + description: Find resource using name of catalog & name, kind and version of + resource + operationId: resource#ByCatalogKindNameVersion + parameters: + - name: catalog + in: path + description: name of catalog + required: true + type: string + - name: kind + in: path + description: kind of resource + required: true + type: string + enum: + - task + - pipeline + - name: name + in: path + description: name of resource + required: true + type: string + - name: version + in: path + description: version of resource + required: true + type: string + responses: + "200": + description: OK response. + schema: + $ref: '#/definitions/ResourceByCatalogKindNameVersionResponseBody' + "404": + description: Not Found response. + schema: + $ref: '#/definitions/ResourceByCatalogKindNameVersionNotFoundResponseBody' + "500": + description: Internal Server Error response. + schema: + $ref: '#/definitions/ResourceByCatalogKindNameVersionInternalErrorResponseBody' + schemes: + - http + /v1/resource/{id}: + get: + tags: + - resource + summary: ById resource + description: Find a resource using it's id + operationId: resource#ById + parameters: + - name: id + in: path + description: ID of a resource + required: true + type: integer + responses: + "200": + description: OK response. + schema: + $ref: '#/definitions/ResourceByIDResponseBody' + "404": + description: Not Found response. + schema: + $ref: '#/definitions/ResourceByIDNotFoundResponseBody' + "500": + description: Internal Server Error response. + schema: + $ref: '#/definitions/ResourceByIDInternalErrorResponseBody' + schemes: + - http + /v1/resource/{id}/versions: + get: + tags: + - resource + summary: VersionsByID resource + description: Find all versions of a resource by its id + operationId: resource#VersionsByID + parameters: + - name: id + in: path + description: ID of a resource + required: true + type: integer + responses: + "200": + description: OK response. + schema: + $ref: '#/definitions/ResourceVersionsByIDResponseBody' + "404": + description: Not Found response. + schema: + $ref: '#/definitions/ResourceVersionsByIDNotFoundResponseBody' + "500": + description: Internal Server Error response. + schema: + $ref: '#/definitions/ResourceVersionsByIDInternalErrorResponseBody' + schemes: + - http + /v1/resource/version/{versionID}: + get: + tags: + - resource + summary: ByVersionId resource + description: Find a resource using its version's id + operationId: resource#ByVersionId + parameters: + - name: versionID + in: path + description: Version ID of a resource's version + required: true + type: integer + responses: + "200": + description: OK response. + schema: + $ref: '#/definitions/ResourceByVersionIDResponseBody' + "404": + description: Not Found response. + schema: + $ref: '#/definitions/ResourceByVersionIDNotFoundResponseBody' + "500": + description: Internal Server Error response. + schema: + $ref: '#/definitions/ResourceByVersionIDInternalErrorResponseBody' + schemes: + - http + /v1/resources: + get: + tags: + - resource + summary: List resource + description: List all resources sorted by rating and name + operationId: resource#List + parameters: + - name: limit + in: query + description: Maximum number of resources to be returned + required: false + type: integer + default: 1000 + responses: + "200": + description: OK response. + schema: + $ref: '#/definitions/ResourceListResponseBody' + "500": + description: Internal Server Error response. + schema: + $ref: '#/definitions/ResourceListInternalErrorResponseBody' + schemes: + - http + /v1/schema/swagger.json: + get: + tags: + - swagger + summary: Download v1/gen/http/openapi3.yaml + description: JSON document containing the API swagger definition + operationId: swagger#/v1/schema/swagger.json + responses: + "200": + description: File downloaded + schema: + type: file + schemes: + - http +definitions: + CatalogResponseBody: + title: CatalogResponseBody + type: object + properties: + id: + type: integer + description: ID is the unique id of the catalog + example: 1 + format: int64 + name: + type: string + description: Name of catalog + example: Tekton + type: + type: string + description: Type of catalog + example: community + enum: + - official + - community + example: + id: 1 + name: Tekton + type: community + required: + - id + - name + - type + ResourceByCatalogKindNameInternalErrorResponseBody: + title: 'Mediatype identifier: application/vnd.goa.error; view=default' + type: object + properties: + fault: + type: boolean + description: Is the error a server-side fault? + example: false + id: + type: string + description: ID is a unique identifier for this particular occurrence of the + problem. + example: 123abc + message: + type: string + description: Message is a human-readable explanation specific to this occurrence + of the problem. + example: parameter 'p' must be an integer + name: + type: string + description: Name is the name of this class of errors. + example: bad_request + temporary: + type: boolean + description: Is the error temporary? + example: true + timeout: + type: boolean + description: Is the error a timeout? + example: false + description: Internal Server Error (default view) + example: + fault: false + id: 123abc + message: parameter 'p' must be an integer + name: bad_request + temporary: false + timeout: true + required: + - name + - id + - message + - temporary + - timeout + - fault + ResourceByCatalogKindNameNotFoundResponseBody: + title: 'Mediatype identifier: application/vnd.goa.error; view=default' + type: object + properties: + fault: + type: boolean + description: Is the error a server-side fault? + example: true + id: + type: string + description: ID is a unique identifier for this particular occurrence of the + problem. + example: 123abc + message: + type: string + description: Message is a human-readable explanation specific to this occurrence + of the problem. + example: parameter 'p' must be an integer + name: + type: string + description: Name is the name of this class of errors. + example: bad_request + temporary: + type: boolean + description: Is the error temporary? + example: false + timeout: + type: boolean + description: Is the error a timeout? + example: false + description: Resource Not Found Error (default view) + example: + fault: false + id: 123abc + message: parameter 'p' must be an integer + name: bad_request + temporary: true + timeout: false + required: + - name + - id + - message + - temporary + - timeout + - fault + ResourceByCatalogKindNameResponseBody: + title: 'Mediatype identifier: application/vnd.hub.resource; view=default' + type: object + properties: + data: + $ref: '#/definitions/ResourceDataResponseBody' + description: ByCatalogKindNameResponseBody result type (default view) + example: + data: + catalog: + id: 1 + type: community + id: 1 + kind: task + latestVersion: + description: Buildah task builds source into a container image and then + pushes it to a container registry. + displayName: Buildah + id: 1 + minPipelinesVersion: 0.12.1 + rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml + updatedAt: 2020-01-01 12:00:00 +0000 UTC + version: "0.1" + webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml + name: buildah + rating: 4.3 + tags: + - id: 1 + name: image-build + versions: + - id: 1 + version: "0.1" + - id: 2 + version: "0.2" + required: + - data + ResourceByCatalogKindNameVersionInternalErrorResponseBody: + title: 'Mediatype identifier: application/vnd.goa.error; view=default' + type: object + properties: + fault: + type: boolean + description: Is the error a server-side fault? + example: false + id: + type: string + description: ID is a unique identifier for this particular occurrence of the + problem. + example: 123abc + message: + type: string + description: Message is a human-readable explanation specific to this occurrence + of the problem. + example: parameter 'p' must be an integer + name: + type: string + description: Name is the name of this class of errors. + example: bad_request + temporary: + type: boolean + description: Is the error temporary? + example: false + timeout: + type: boolean + description: Is the error a timeout? + example: true + description: Internal Server Error (default view) + example: + fault: false + id: 123abc + message: parameter 'p' must be an integer + name: bad_request + temporary: false + timeout: true + required: + - name + - id + - message + - temporary + - timeout + - fault + ResourceByCatalogKindNameVersionNotFoundResponseBody: + title: 'Mediatype identifier: application/vnd.goa.error; view=default' + type: object + properties: + fault: + type: boolean + description: Is the error a server-side fault? + example: true + id: + type: string + description: ID is a unique identifier for this particular occurrence of the + problem. + example: 123abc + message: + type: string + description: Message is a human-readable explanation specific to this occurrence + of the problem. + example: parameter 'p' must be an integer + name: + type: string + description: Name is the name of this class of errors. + example: bad_request + temporary: + type: boolean + description: Is the error temporary? + example: true + timeout: + type: boolean + description: Is the error a timeout? + example: true + description: Resource Not Found Error (default view) + example: + fault: false + id: 123abc + message: parameter 'p' must be an integer + name: bad_request + temporary: true + timeout: false + required: + - name + - id + - message + - temporary + - timeout + - fault + ResourceByCatalogKindNameVersionResponseBody: + title: 'Mediatype identifier: application/vnd.hub.resource.version; view=default' + type: object + properties: + data: + $ref: '#/definitions/ResourceVersionDataResponseBody' + description: ByCatalogKindNameVersionResponseBody result type (default view) + example: + data: + description: Buildah task builds source into a container image and then pushes + it to a container registry. + displayName: Buildah + id: 1 + minPipelinesVersion: 0.12.1 + rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml + resource: + catalog: + id: 1 + type: community + id: 1 + kind: task + name: buildah + rating: 4.3 + tags: + - id: 1 + name: image-build + updatedAt: 2020-01-01 12:00:00 +0000 UTC + version: "0.1" + webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml + required: + - data + ResourceByIDInternalErrorResponseBody: + title: 'Mediatype identifier: application/vnd.goa.error; view=default' + type: object + properties: + fault: + type: boolean + description: Is the error a server-side fault? + example: false + id: + type: string + description: ID is a unique identifier for this particular occurrence of the + problem. + example: 123abc + message: + type: string + description: Message is a human-readable explanation specific to this occurrence + of the problem. + example: parameter 'p' must be an integer + name: + type: string + description: Name is the name of this class of errors. + example: bad_request + temporary: + type: boolean + description: Is the error temporary? + example: false + timeout: + type: boolean + description: Is the error a timeout? + example: true + description: Internal Server Error (default view) + example: + fault: true + id: 123abc + message: parameter 'p' must be an integer + name: bad_request + temporary: false + timeout: false + required: + - name + - id + - message + - temporary + - timeout + - fault + ResourceByIDNotFoundResponseBody: + title: 'Mediatype identifier: application/vnd.goa.error; view=default' + type: object + properties: + fault: + type: boolean + description: Is the error a server-side fault? + example: false + id: + type: string + description: ID is a unique identifier for this particular occurrence of the + problem. + example: 123abc + message: + type: string + description: Message is a human-readable explanation specific to this occurrence + of the problem. + example: parameter 'p' must be an integer + name: + type: string + description: Name is the name of this class of errors. + example: bad_request + temporary: + type: boolean + description: Is the error temporary? + example: false + timeout: + type: boolean + description: Is the error a timeout? + example: true + description: Resource Not Found Error (default view) + example: + fault: true + id: 123abc + message: parameter 'p' must be an integer + name: bad_request + temporary: false + timeout: true + required: + - name + - id + - message + - temporary + - timeout + - fault + ResourceByIDResponseBody: + title: 'Mediatype identifier: application/vnd.hub.resource; view=default' + type: object + properties: + data: + $ref: '#/definitions/ResourceDataResponseBody' + description: ByIdResponseBody result type (default view) + example: + data: + catalog: + id: 1 + type: community + id: 1 + kind: task + latestVersion: + description: Buildah task builds source into a container image and then + pushes it to a container registry. + displayName: Buildah + id: 1 + minPipelinesVersion: 0.12.1 + rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml + updatedAt: 2020-01-01 12:00:00 +0000 UTC + version: "0.1" + webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml + name: buildah + rating: 4.3 + tags: + - id: 1 + name: image-build + versions: + - id: 1 + version: "0.1" + - id: 2 + version: "0.2" + required: + - data + ResourceByVersionIDInternalErrorResponseBody: + title: 'Mediatype identifier: application/vnd.goa.error; view=default' + type: object + properties: + fault: + type: boolean + description: Is the error a server-side fault? + example: false + id: + type: string + description: ID is a unique identifier for this particular occurrence of the + problem. + example: 123abc + message: + type: string + description: Message is a human-readable explanation specific to this occurrence + of the problem. + example: parameter 'p' must be an integer + name: + type: string + description: Name is the name of this class of errors. + example: bad_request + temporary: + type: boolean + description: Is the error temporary? + example: true + timeout: + type: boolean + description: Is the error a timeout? + example: false + description: Internal Server Error (default view) + example: + fault: true + id: 123abc + message: parameter 'p' must be an integer + name: bad_request + temporary: false + timeout: true + required: + - name + - id + - message + - temporary + - timeout + - fault + ResourceByVersionIDNotFoundResponseBody: + title: 'Mediatype identifier: application/vnd.goa.error; view=default' + type: object + properties: + fault: + type: boolean + description: Is the error a server-side fault? + example: false + id: + type: string + description: ID is a unique identifier for this particular occurrence of the + problem. + example: 123abc + message: + type: string + description: Message is a human-readable explanation specific to this occurrence + of the problem. + example: parameter 'p' must be an integer + name: + type: string + description: Name is the name of this class of errors. + example: bad_request + temporary: + type: boolean + description: Is the error temporary? + example: true + timeout: + type: boolean + description: Is the error a timeout? + example: false + description: Resource Not Found Error (default view) + example: + fault: true + id: 123abc + message: parameter 'p' must be an integer + name: bad_request + temporary: false + timeout: false + required: + - name + - id + - message + - temporary + - timeout + - fault + ResourceByVersionIDResponseBody: + title: 'Mediatype identifier: application/vnd.hub.resource.version; view=default' + type: object + properties: + data: + $ref: '#/definitions/ResourceVersionDataResponseBody' + description: ByVersionIdResponseBody result type (default view) + example: + data: + description: Buildah task builds source into a container image and then pushes + it to a container registry. + displayName: Buildah + id: 1 + minPipelinesVersion: 0.12.1 + rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml + resource: + catalog: + id: 1 + type: community + id: 1 + kind: task + name: buildah + rating: 4.3 + tags: + - id: 1 + name: image-build + updatedAt: 2020-01-01 12:00:00 +0000 UTC + version: "0.1" + webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml + required: + - data + ResourceDataResponseBody: + title: 'Mediatype identifier: application/vnd.hub.resource.data; view=default' + type: object + properties: + catalog: + $ref: '#/definitions/CatalogResponseBody' + id: + type: integer + description: ID is the unique id of the resource + example: 1 + format: int64 + kind: + type: string + description: Kind of resource + example: task + latestVersion: + $ref: '#/definitions/ResourceVersionDataResponseBodyWithoutResource' + name: + type: string + description: Name of resource + example: buildah + rating: + type: number + description: Rating of resource + example: 4.3 + format: double + tags: + type: array + items: + $ref: '#/definitions/TagResponseBody' + description: Tags related to resource + example: + - id: 1 + name: image-build + versions: + type: array + items: + $ref: '#/definitions/ResourceVersionDataResponseBodyTiny' + description: List of all versions of a resource + example: + - id: 1 + version: "0.1" + - id: 2 + version: "0.2" + description: The resource type describes resource information. + example: + catalog: + id: 1 + type: community + id: 1 + kind: task + latestVersion: + description: Buildah task builds source into a container image and then pushes + it to a container registry. + displayName: Buildah + id: 1 + minPipelinesVersion: 0.12.1 + rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml + updatedAt: 2020-01-01 12:00:00 +0000 UTC + version: "0.1" + webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml + name: buildah + rating: 4.3 + tags: + - id: 1 + name: image-build + versions: + - id: 1 + version: "0.1" + - id: 2 + version: "0.2" + required: + - id + - name + - catalog + - kind + - latestVersion + - tags + - rating + - versions + ResourceDataResponseBodyInfo: + title: 'Mediatype identifier: application/vnd.hub.resource.data; view=default' + type: object + properties: + catalog: + $ref: '#/definitions/CatalogResponseBody' + id: + type: integer + description: ID is the unique id of the resource + example: 1 + format: int64 + kind: + type: string + description: Kind of resource + example: task + name: + type: string + description: Name of resource + example: buildah + rating: + type: number + description: Rating of resource + example: 4.3 + format: double + tags: + type: array + items: + $ref: '#/definitions/TagResponseBody' + description: Tags related to resource + example: + - id: 1 + name: image-build + description: The resource type describes resource information. (default view) + example: + catalog: + id: 1 + type: community + id: 1 + kind: task + name: buildah + rating: 4.3 + tags: + - id: 1 + name: image-build + required: + - id + - name + - catalog + - kind + - tags + - rating + ResourceDataResponseBodyWithoutVersion: + title: 'Mediatype identifier: application/vnd.hub.resource.data; view=default' + type: object + properties: + catalog: + $ref: '#/definitions/CatalogResponseBody' + id: + type: integer + description: ID is the unique id of the resource + example: 1 + format: int64 + kind: + type: string + description: Kind of resource + example: task + latestVersion: + $ref: '#/definitions/ResourceVersionDataResponseBodyWithoutResource' + name: + type: string + description: Name of resource + example: buildah + rating: + type: number + description: Rating of resource + example: 4.3 + format: double + tags: + type: array + items: + $ref: '#/definitions/TagResponseBody' + description: Tags related to resource + example: + - id: 1 + name: image-build + description: The resource type describes resource information. (withoutVersion + view) (default view) + example: + catalog: + id: 1 + type: community + id: 1 + kind: task + latestVersion: + description: Buildah task builds source into a container image and then pushes + it to a container registry. + displayName: Buildah + id: 1 + minPipelinesVersion: 0.12.1 + rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml + updatedAt: 2020-01-01 12:00:00 +0000 UTC + version: "0.1" + webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml + name: buildah + rating: 4.3 + tags: + - id: 1 + name: image-build + required: + - id + - name + - catalog + - kind + - latestVersion + - tags + - rating + ResourceDataResponseBodyWithoutVersionCollection: + title: 'Mediatype identifier: application/vnd.hub.resource.data; type=collection; + view=default' + type: array + items: + $ref: '#/definitions/ResourceDataResponseBodyWithoutVersion' + description: ResourceDataResponseBodyWithoutVersionCollection is the result type + for an array of ResourceDataResponseBodyWithoutVersion (default view) + example: + - catalog: + id: 1 + type: community + id: 1 + kind: task + latestVersion: + description: Buildah task builds source into a container image and then pushes + it to a container registry. + displayName: Buildah + id: 1 + minPipelinesVersion: 0.12.1 + rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml + updatedAt: 2020-01-01 12:00:00 +0000 UTC + version: "0.1" + webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml + name: buildah + rating: 4.3 + tags: + - id: 1 + name: image-build + versions: + - id: 1 + version: "0.1" + - id: 2 + version: "0.2" + - catalog: + id: 1 + type: community + id: 1 + kind: task + latestVersion: + description: Buildah task builds source into a container image and then pushes + it to a container registry. + displayName: Buildah + id: 1 + minPipelinesVersion: 0.12.1 + rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml + updatedAt: 2020-01-01 12:00:00 +0000 UTC + version: "0.1" + webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml + name: buildah + rating: 4.3 + tags: + - id: 1 + name: image-build + versions: + - id: 1 + version: "0.1" + - id: 2 + version: "0.2" + ResourceListInternalErrorResponseBody: + title: 'Mediatype identifier: application/vnd.goa.error; view=default' + type: object + properties: + fault: + type: boolean + description: Is the error a server-side fault? + example: true + id: + type: string + description: ID is a unique identifier for this particular occurrence of the + problem. + example: 123abc + message: + type: string + description: Message is a human-readable explanation specific to this occurrence + of the problem. + example: parameter 'p' must be an integer + name: + type: string + description: Name is the name of this class of errors. + example: bad_request + temporary: + type: boolean + description: Is the error temporary? + example: true + timeout: + type: boolean + description: Is the error a timeout? + example: false + description: Internal Server Error (default view) + example: + fault: true + id: 123abc + message: parameter 'p' must be an integer + name: bad_request + temporary: false + timeout: true + required: + - name + - id + - message + - temporary + - timeout + - fault + ResourceListResponseBody: + title: 'Mediatype identifier: application/vnd.hub.resources; view=default' + type: object + properties: + data: + $ref: '#/definitions/ResourceDataResponseBodyWithoutVersionCollection' + description: ListResponseBody result type (default view) + example: + data: + - catalog: + id: 1 + type: community + id: 1 + kind: task + latestVersion: + description: Buildah task builds source into a container image and then + pushes it to a container registry. + displayName: Buildah + id: 1 + minPipelinesVersion: 0.12.1 + rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml + updatedAt: 2020-01-01 12:00:00 +0000 UTC + version: "0.1" + webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml + name: buildah + rating: 4.3 + tags: + - id: 1 + name: image-build + - catalog: + id: 1 + type: community + id: 1 + kind: task + latestVersion: + description: Buildah task builds source into a container image and then + pushes it to a container registry. + displayName: Buildah + id: 1 + minPipelinesVersion: 0.12.1 + rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml + updatedAt: 2020-01-01 12:00:00 +0000 UTC + version: "0.1" + webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml + name: buildah + rating: 4.3 + tags: + - id: 1 + name: image-build + - catalog: + id: 1 + type: community + id: 1 + kind: task + latestVersion: + description: Buildah task builds source into a container image and then + pushes it to a container registry. + displayName: Buildah + id: 1 + minPipelinesVersion: 0.12.1 + rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml + updatedAt: 2020-01-01 12:00:00 +0000 UTC + version: "0.1" + webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml + name: buildah + rating: 4.3 + tags: + - id: 1 + name: image-build + - catalog: + id: 1 + type: community + id: 1 + kind: task + latestVersion: + description: Buildah task builds source into a container image and then + pushes it to a container registry. + displayName: Buildah + id: 1 + minPipelinesVersion: 0.12.1 + rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml + updatedAt: 2020-01-01 12:00:00 +0000 UTC + version: "0.1" + webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml + name: buildah + rating: 4.3 + tags: + - id: 1 + name: image-build + required: + - data + ResourceQueryInternalErrorResponseBody: + title: 'Mediatype identifier: application/vnd.goa.error; view=default' + type: object + properties: + fault: + type: boolean + description: Is the error a server-side fault? + example: true + id: + type: string + description: ID is a unique identifier for this particular occurrence of the + problem. + example: 123abc + message: + type: string + description: Message is a human-readable explanation specific to this occurrence + of the problem. + example: parameter 'p' must be an integer + name: + type: string + description: Name is the name of this class of errors. + example: bad_request + temporary: + type: boolean + description: Is the error temporary? + example: false + timeout: + type: boolean + description: Is the error a timeout? + example: false + description: Internal Server Error (default view) + example: + fault: true + id: 123abc + message: parameter 'p' must be an integer + name: bad_request + temporary: true + timeout: true + required: + - name + - id + - message + - temporary + - timeout + - fault + ResourceQueryInvalidKindResponseBody: + title: 'Mediatype identifier: application/vnd.goa.error; view=default' + type: object + properties: + fault: + type: boolean + description: Is the error a server-side fault? + example: false + id: + type: string + description: ID is a unique identifier for this particular occurrence of the + problem. + example: 123abc + message: + type: string + description: Message is a human-readable explanation specific to this occurrence + of the problem. + example: parameter 'p' must be an integer + name: + type: string + description: Name is the name of this class of errors. + example: bad_request + temporary: + type: boolean + description: Is the error temporary? + example: true + timeout: + type: boolean + description: Is the error a timeout? + example: true + description: Invalid Resource Kind (default view) + example: + fault: false + id: 123abc + message: parameter 'p' must be an integer + name: bad_request + temporary: false + timeout: true + required: + - name + - id + - message + - temporary + - timeout + - fault + ResourceQueryNotFoundResponseBody: + title: 'Mediatype identifier: application/vnd.goa.error; view=default' + type: object + properties: + fault: + type: boolean + description: Is the error a server-side fault? + example: true + id: + type: string + description: ID is a unique identifier for this particular occurrence of the + problem. + example: 123abc + message: + type: string + description: Message is a human-readable explanation specific to this occurrence + of the problem. + example: parameter 'p' must be an integer + name: + type: string + description: Name is the name of this class of errors. + example: bad_request + temporary: + type: boolean + description: Is the error temporary? + example: true + timeout: + type: boolean + description: Is the error a timeout? + example: true + description: Resource Not Found Error (default view) + example: + fault: true + id: 123abc + message: parameter 'p' must be an integer + name: bad_request + temporary: true + timeout: false + required: + - name + - id + - message + - temporary + - timeout + - fault + ResourceQueryResponseBody: + title: 'Mediatype identifier: application/vnd.hub.resources; view=default' + type: object + properties: + data: + $ref: '#/definitions/ResourceDataResponseBodyWithoutVersionCollection' + description: QueryResponseBody result type (default view) + example: + data: + - catalog: + id: 1 + type: community + id: 1 + kind: task + latestVersion: + description: Buildah task builds source into a container image and then + pushes it to a container registry. + displayName: Buildah + id: 1 + minPipelinesVersion: 0.12.1 + rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml + updatedAt: 2020-01-01 12:00:00 +0000 UTC + version: "0.1" + webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml + name: buildah + rating: 4.3 + tags: + - id: 1 + name: image-build + - catalog: + id: 1 + type: community + id: 1 + kind: task + latestVersion: + description: Buildah task builds source into a container image and then + pushes it to a container registry. + displayName: Buildah + id: 1 + minPipelinesVersion: 0.12.1 + rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml + updatedAt: 2020-01-01 12:00:00 +0000 UTC + version: "0.1" + webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml + name: buildah + rating: 4.3 + tags: + - id: 1 + name: image-build + - catalog: + id: 1 + type: community + id: 1 + kind: task + latestVersion: + description: Buildah task builds source into a container image and then + pushes it to a container registry. + displayName: Buildah + id: 1 + minPipelinesVersion: 0.12.1 + rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml + updatedAt: 2020-01-01 12:00:00 +0000 UTC + version: "0.1" + webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml + name: buildah + rating: 4.3 + tags: + - id: 1 + name: image-build + - catalog: + id: 1 + type: community + id: 1 + kind: task + latestVersion: + description: Buildah task builds source into a container image and then + pushes it to a container registry. + displayName: Buildah + id: 1 + minPipelinesVersion: 0.12.1 + rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml + updatedAt: 2020-01-01 12:00:00 +0000 UTC + version: "0.1" + webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml + name: buildah + rating: 4.3 + tags: + - id: 1 + name: image-build + required: + - data + ResourceVersionDataResponseBody: + title: 'Mediatype identifier: application/vnd.hub.resource.version.data; view=default' + type: object + properties: + description: + type: string + description: Description of version + example: Buildah task builds source into a container image and then pushes + it to a container registry. + displayName: + type: string + description: Display name of version + example: Buildah + id: + type: integer + description: ID is the unique id of resource's version + example: 1 + format: int64 + minPipelinesVersion: + type: string + description: Minimum pipelines version the resource's version is compatible + with + example: 0.12.1 + rawURL: + type: string + description: Raw URL of resource's yaml file of the version + example: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml + format: uri + resource: + $ref: '#/definitions/ResourceDataResponseBodyInfo' + updatedAt: + type: string + description: Timestamp when version was last updated + example: 2020-01-01 12:00:00 +0000 UTC + format: date-time + version: + type: string + description: Version of resource + example: "0.1" + webURL: + type: string + description: Web URL of resource's yaml file of the version + example: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml + format: uri + description: The Version result type describes resource's version information. + example: + description: Buildah task builds source into a container image and then pushes + it to a container registry. + displayName: Buildah + id: 1 + minPipelinesVersion: 0.12.1 + rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml + resource: + catalog: + id: 1 + type: community + id: 1 + kind: task + name: buildah + rating: 4.3 + tags: + - id: 1 + name: image-build + updatedAt: 2020-01-01 12:00:00 +0000 UTC + version: "0.1" + webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml + required: + - id + - version + - displayName + - description + - minPipelinesVersion + - rawURL + - webURL + - updatedAt + - resource + ResourceVersionDataResponseBodyMin: + title: 'Mediatype identifier: application/vnd.hub.resource.version.data; view=default' + type: object + properties: + id: + type: integer + description: ID is the unique id of resource's version + example: 1 + format: int64 + rawURL: + type: string + description: Raw URL of resource's yaml file of the version + example: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml + format: uri + version: + type: string + description: Version of resource + example: "0.1" + webURL: + type: string + description: Web URL of resource's yaml file of the version + example: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml + format: uri + description: The Version result type describes resource's version information. + (default view) + example: + id: 1 + rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml + version: "0.1" + webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml + required: + - id + - version + - rawURL + - webURL + ResourceVersionDataResponseBodyTiny: + title: 'Mediatype identifier: application/vnd.hub.resource.version.data; view=default' + type: object + properties: + id: + type: integer + description: ID is the unique id of resource's version + example: 1 + format: int64 + version: + type: string + description: Version of resource + example: "0.1" + description: The Version result type describes resource's version information. + (default view) + example: + id: 1 + version: "0.1" + required: + - id + - version + ResourceVersionDataResponseBodyWithoutResource: + title: 'Mediatype identifier: application/vnd.hub.resource.version.data; view=default' + type: object + properties: + description: + type: string + description: Description of version + example: Buildah task builds source into a container image and then pushes + it to a container registry. + displayName: + type: string + description: Display name of version + example: Buildah + id: + type: integer + description: ID is the unique id of resource's version + example: 1 + format: int64 + minPipelinesVersion: + type: string + description: Minimum pipelines version the resource's version is compatible + with + example: 0.12.1 + rawURL: + type: string + description: Raw URL of resource's yaml file of the version + example: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml + format: uri + updatedAt: + type: string + description: Timestamp when version was last updated + example: 2020-01-01 12:00:00 +0000 UTC + format: date-time + version: + type: string + description: Version of resource + example: "0.1" + webURL: + type: string + description: Web URL of resource's yaml file of the version + example: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml + format: uri + description: The Version result type describes resource's version information. + (default view) + example: + description: Buildah task builds source into a container image and then pushes + it to a container registry. + displayName: Buildah + id: 1 + minPipelinesVersion: 0.12.1 + rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml + updatedAt: 2020-01-01 12:00:00 +0000 UTC + version: "0.1" + webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml + required: + - id + - version + - displayName + - description + - minPipelinesVersion + - rawURL + - webURL + - updatedAt + ResourceVersionsByIDInternalErrorResponseBody: + title: 'Mediatype identifier: application/vnd.goa.error; view=default' + type: object + properties: + fault: + type: boolean + description: Is the error a server-side fault? + example: true + id: + type: string + description: ID is a unique identifier for this particular occurrence of the + problem. + example: 123abc + message: + type: string + description: Message is a human-readable explanation specific to this occurrence + of the problem. + example: parameter 'p' must be an integer + name: + type: string + description: Name is the name of this class of errors. + example: bad_request + temporary: + type: boolean + description: Is the error temporary? + example: true + timeout: + type: boolean + description: Is the error a timeout? + example: false + description: Internal Server Error (default view) + example: + fault: true + id: 123abc + message: parameter 'p' must be an integer + name: bad_request + temporary: true + timeout: false + required: + - name + - id + - message + - temporary + - timeout + - fault + ResourceVersionsByIDNotFoundResponseBody: + title: 'Mediatype identifier: application/vnd.goa.error; view=default' + type: object + properties: + fault: + type: boolean + description: Is the error a server-side fault? + example: true + id: + type: string + description: ID is a unique identifier for this particular occurrence of the + problem. + example: 123abc + message: + type: string + description: Message is a human-readable explanation specific to this occurrence + of the problem. + example: parameter 'p' must be an integer + name: + type: string + description: Name is the name of this class of errors. + example: bad_request + temporary: + type: boolean + description: Is the error temporary? + example: true + timeout: + type: boolean + description: Is the error a timeout? + example: false + description: Resource Not Found Error (default view) + example: + fault: false + id: 123abc + message: parameter 'p' must be an integer + name: bad_request + temporary: false + timeout: false + required: + - name + - id + - message + - temporary + - timeout + - fault + ResourceVersionsByIDResponseBody: + title: 'Mediatype identifier: application/vnd.hub.resource.versions; view=default' + type: object + properties: + data: + $ref: '#/definitions/VersionsResponseBody' + description: VersionsByIDResponseBody result type (default view) + example: + data: + latest: + id: 2 + rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml + version: "0.2" + webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml + versions: + - id: 1 + rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml + version: "0.1" + webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml + - id: 2 + rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml + version: "0.2" + webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml + required: + - data + TagResponseBody: + title: TagResponseBody + type: object + properties: + id: + type: integer + description: ID is the unique id of tag + example: 1 + format: int64 + name: + type: string + description: Name of tag + example: image-build + example: + id: 1 + name: image-build + required: + - id + - name + VersionsResponseBody: + title: 'Mediatype identifier: application/vnd.hub.versions; view=default' + type: object + properties: + latest: + $ref: '#/definitions/ResourceVersionDataResponseBodyMin' + versions: + type: array + items: + $ref: '#/definitions/ResourceVersionDataResponseBodyMin' + description: List of all versions of resource + example: + - id: 1 + rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml + version: "0.1" + webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml + - id: 2 + rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml + version: "0.2" + webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml + description: The Versions type describes response for versions by resource id + API. + example: + latest: + id: 2 + rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml + version: "0.2" + webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml + versions: + - id: 1 + rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml + version: "0.1" + webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml + - id: 2 + rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml + version: "0.2" + webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml + required: + - latest + - versions diff --git a/api/v1/gen/http/openapi3.json b/api/v1/gen/http/openapi3.json new file mode 100644 index 0000000000..524aff591e --- /dev/null +++ b/api/v1/gen/http/openapi3.json @@ -0,0 +1 @@ +{"openapi":"3.0.3","info":{"title":"Tekton Hub","description":"HTTP services for managing Tekton Hub","version":"1.0"},"servers":[{"url":"http://api.hub.tekton.dev"}],"paths":{"/v1/query":{"get":{"tags":["resource"],"summary":"Query resource","description":"Find resources by a combination of name, kind and tags","operationId":"resource#Query","parameters":[{"name":"name","in":"query","description":"Name of resource","allowEmptyValue":true,"schema":{"type":"string","description":"Name of resource","default":"","example":"buildah"},"example":"buildah"},{"name":"kinds","in":"query","description":"Kinds of resource to filter by","allowEmptyValue":true,"schema":{"type":"array","items":{"type":"string","example":"Non sint assumenda non facere ratione eos."},"description":"Kinds of resource to filter by","example":["task","pipelines"]},"example":["task","pipelines"]},{"name":"tags","in":"query","description":"Tags associated with a resource to filter by","allowEmptyValue":true,"schema":{"type":"array","items":{"type":"string","example":"Quis sed dolorem."},"description":"Tags associated with a resource to filter by","example":["image","build"]},"example":["image","build"]},{"name":"limit","in":"query","description":"Maximum number of resources to be returned","allowEmptyValue":true,"schema":{"type":"integer","description":"Maximum number of resources to be returned","default":1000,"example":100},"example":100},{"name":"match","in":"query","description":"Strategy used to find matching resources","allowEmptyValue":true,"schema":{"type":"string","description":"Strategy used to find matching resources","default":"contains","example":"contains","enum":["exact","contains"]},"example":"exact"}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Resources"},"example":{"data":[{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]}]}}}},"400":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true}}}},"404":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true}}}}}}},"/v1/resource/version/{versionID}":{"get":{"tags":["resource"],"summary":"ByVersionId resource","description":"Find a resource using its version's id","operationId":"resource#ByVersionId","parameters":[{"name":"versionID","in":"path","description":"Version ID of a resource's version","required":true,"schema":{"type":"integer","description":"Version ID of a resource's version","example":1},"example":1}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceVersion"},"example":{"data":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","resource":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]},"updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"}}}}},"404":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true}}}}}}},"/v1/resource/{catalog}/{kind}/{name}":{"get":{"tags":["resource"],"summary":"ByCatalogKindName resource","description":"Find resources using name of catalog, resource name and kind of resource","operationId":"resource#ByCatalogKindName","parameters":[{"name":"catalog","in":"path","description":"name of catalog","required":true,"schema":{"type":"string","description":"name of catalog","example":"tektoncd"},"example":"tektoncd"},{"name":"kind","in":"path","description":"kind of resource","required":true,"schema":{"type":"string","description":"kind of resource","example":"pipeline","enum":["task","pipeline"]},"example":"task"},{"name":"name","in":"path","description":"Name of resource","required":true,"schema":{"type":"string","description":"Name of resource","example":"buildah"},"example":"buildah"}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Resource"},"example":{"data":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]}}}}},"404":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true}}}}}}},"/v1/resource/{catalog}/{kind}/{name}/{version}":{"get":{"tags":["resource"],"summary":"ByCatalogKindNameVersion resource","description":"Find resource using name of catalog \u0026 name, kind and version of resource","operationId":"resource#ByCatalogKindNameVersion","parameters":[{"name":"catalog","in":"path","description":"name of catalog","required":true,"schema":{"type":"string","description":"name of catalog","example":"tektoncd"},"example":"tektoncd"},{"name":"kind","in":"path","description":"kind of resource","required":true,"schema":{"type":"string","description":"kind of resource","example":"pipeline","enum":["task","pipeline"]},"example":"task"},{"name":"name","in":"path","description":"name of resource","required":true,"schema":{"type":"string","description":"name of resource","example":"buildah"},"example":"buildah"},{"name":"version","in":"path","description":"version of resource","required":true,"schema":{"type":"string","description":"version of resource","example":"0.1"},"example":"0.1"}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceVersion"},"example":{"data":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","resource":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]},"updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"}}}}},"404":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false}}}}}}},"/v1/resource/{id}":{"get":{"tags":["resource"],"summary":"ById resource","description":"Find a resource using it's id","operationId":"resource#ById","parameters":[{"name":"id","in":"path","description":"ID of a resource","required":true,"schema":{"type":"integer","description":"ID of a resource","example":1},"example":1}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Resource"},"example":{"data":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]}}}}},"404":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true}}}}}}},"/v1/resource/{id}/versions":{"get":{"tags":["resource"],"summary":"VersionsByID resource","description":"Find all versions of a resource by its id","operationId":"resource#VersionsByID","parameters":[{"name":"id","in":"path","description":"ID of a resource","required":true,"schema":{"type":"integer","description":"ID of a resource","example":1},"example":1}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceVersions"},"example":{"data":{"latest":{"id":2,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml","version":"0.2","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml"},"versions":[{"id":1,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},{"id":2,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml","version":"0.2","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml"}]}}}}},"404":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false}}}}}}},"/v1/resources":{"get":{"tags":["resource"],"summary":"List resource","description":"List all resources sorted by rating and name","operationId":"resource#List","parameters":[{"name":"limit","in":"query","description":"Maximum number of resources to be returned","allowEmptyValue":true,"schema":{"type":"integer","description":"Maximum number of resources to be returned","default":1000,"example":100},"example":100}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Resources"},"example":{"data":[{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]}]}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false}}}}}}},"/v1/schema/swagger.json":{"get":{"tags":["swagger"],"summary":"Download v1/gen/http/openapi3.yaml","description":"JSON document containing the API swagger definition","operationId":"swagger#/v1/schema/swagger.json","responses":{"200":{"description":"File downloaded"}}}}},"components":{"schemas":{"Catalog":{"type":"object","properties":{"id":{"type":"integer","description":"ID is the unique id of the catalog","example":1},"name":{"type":"string","description":"Name of catalog","example":"Tekton"},"type":{"type":"string","description":"Type of catalog","example":"community","enum":["official","community"]}},"example":{"id":1,"name":"Tekton","type":"community"},"required":["id","name","type"]},"Error":{"type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Internal Server Error","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"Resource":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ResourceData"}},"example":{"data":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]}},"required":["data"]},"ResourceData":{"type":"object","properties":{"catalog":{"$ref":"#/components/schemas/Catalog"},"id":{"type":"integer","description":"ID is the unique id of the resource","example":1},"kind":{"type":"string","description":"Kind of resource","example":"task"},"latestVersion":{"$ref":"#/components/schemas/ResourceVersionData"},"name":{"type":"string","description":"Name of resource","example":"buildah"},"rating":{"type":"number","description":"Rating of resource","example":4.3,"format":"double"},"tags":{"type":"array","items":{"$ref":"#/components/schemas/Tag"},"description":"Tags related to resource","example":[{"id":1,"name":"image-build"}]},"versions":{"type":"array","items":{"$ref":"#/components/schemas/ResourceVersionData"},"description":"List of all versions of a resource","example":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]}},"description":"The resource type describes resource information.","example":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},"required":["id","name","catalog","kind","latestVersion","tags","rating","versions"]},"ResourceDataCollection":{"type":"array","items":{"$ref":"#/components/schemas/ResourceData"},"example":[{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]}]},"ResourceVersion":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ResourceVersionData"}},"example":{"data":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","resource":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]},"updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"}},"required":["data"]},"ResourceVersionData":{"type":"object","properties":{"description":{"type":"string","description":"Description of version","example":"Buildah task builds source into a container image and then pushes it to a container registry."},"displayName":{"type":"string","description":"Display name of version","example":"Buildah"},"id":{"type":"integer","description":"ID is the unique id of resource's version","example":1},"minPipelinesVersion":{"type":"string","description":"Minimum pipelines version the resource's version is compatible with","example":"0.12.1"},"rawURL":{"type":"string","description":"Raw URL of resource's yaml file of the version","example":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","format":"uri"},"resource":{"$ref":"#/components/schemas/ResourceData"},"updatedAt":{"type":"string","description":"Timestamp when version was last updated","example":"2020-01-01 12:00:00 +0000 UTC","format":"date-time"},"version":{"type":"string","description":"Version of resource","example":"0.1"},"webURL":{"type":"string","description":"Web URL of resource's yaml file of the version","example":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml","format":"uri"}},"description":"The Version result type describes resource's version information.","example":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","resource":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]},"updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"required":["id","version","displayName","description","minPipelinesVersion","rawURL","webURL","updatedAt","resource"]},"ResourceVersions":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Versions"}},"example":{"data":{"latest":{"id":2,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml","version":"0.2","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml"},"versions":[{"id":1,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},{"id":2,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml","version":"0.2","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml"}]}},"required":["data"]},"Resources":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ResourceDataCollection"}},"example":{"data":[{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]}]},"required":["data"]},"Tag":{"type":"object","properties":{"id":{"type":"integer","description":"ID is the unique id of tag","example":1},"name":{"type":"string","description":"Name of tag","example":"image-build"}},"example":{"id":1,"name":"image-build"},"required":["id","name"]},"Versions":{"type":"object","properties":{"latest":{"$ref":"#/components/schemas/ResourceVersionData"},"versions":{"type":"array","items":{"$ref":"#/components/schemas/ResourceVersionData"},"description":"List of all versions of resource","example":[{"id":1,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},{"id":2,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml","version":"0.2","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml"}]}},"description":"The Versions type describes response for versions by resource id API.","example":{"latest":{"id":2,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml","version":"0.2","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml"},"versions":[{"id":1,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},{"id":2,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml","version":"0.2","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml"}]},"required":["latest","versions"]}}}} \ No newline at end of file diff --git a/api/v1/gen/http/openapi3.yaml b/api/v1/gen/http/openapi3.yaml new file mode 100644 index 0000000000..568dc3a389 --- /dev/null +++ b/api/v1/gen/http/openapi3.yaml @@ -0,0 +1,1376 @@ +openapi: 3.0.3 +info: + title: Tekton Hub + description: HTTP services for managing Tekton Hub + version: "1.0" +servers: +- url: http://api.hub.tekton.dev +paths: + /v1/query: + get: + tags: + - resource + summary: Query resource + description: Find resources by a combination of name, kind and tags + operationId: resource#Query + parameters: + - name: name + in: query + description: Name of resource + allowEmptyValue: true + schema: + type: string + description: Name of resource + default: "" + example: buildah + example: buildah + - name: kinds + in: query + description: Kinds of resource to filter by + allowEmptyValue: true + schema: + type: array + items: + type: string + example: Non sint assumenda non facere ratione eos. + description: Kinds of resource to filter by + example: + - task + - pipelines + example: + - task + - pipelines + - name: tags + in: query + description: Tags associated with a resource to filter by + allowEmptyValue: true + schema: + type: array + items: + type: string + example: Quis sed dolorem. + description: Tags associated with a resource to filter by + example: + - image + - build + example: + - image + - build + - name: limit + in: query + description: Maximum number of resources to be returned + allowEmptyValue: true + schema: + type: integer + description: Maximum number of resources to be returned + default: 1000 + example: 100 + example: 100 + - name: match + in: query + description: Strategy used to find matching resources + allowEmptyValue: true + schema: + type: string + description: Strategy used to find matching resources + default: contains + example: contains + enum: + - exact + - contains + example: exact + responses: + "200": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Resources' + example: + data: + - catalog: + id: 1 + type: community + id: 1 + kind: task + latestVersion: + description: Buildah task builds source into a container image + and then pushes it to a container registry. + displayName: Buildah + id: 1 + minPipelinesVersion: 0.12.1 + rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml + updatedAt: 2020-01-01 12:00:00 +0000 UTC + version: "0.1" + webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml + name: buildah + rating: 4.3 + tags: + - id: 1 + name: image-build + versions: + - id: 1 + version: "0.1" + - id: 2 + version: "0.2" + - catalog: + id: 1 + type: community + id: 1 + kind: task + latestVersion: + description: Buildah task builds source into a container image + and then pushes it to a container registry. + displayName: Buildah + id: 1 + minPipelinesVersion: 0.12.1 + rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml + updatedAt: 2020-01-01 12:00:00 +0000 UTC + version: "0.1" + webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml + name: buildah + rating: 4.3 + tags: + - id: 1 + name: image-build + versions: + - id: 1 + version: "0.1" + - id: 2 + version: "0.2" + - catalog: + id: 1 + type: community + id: 1 + kind: task + latestVersion: + description: Buildah task builds source into a container image + and then pushes it to a container registry. + displayName: Buildah + id: 1 + minPipelinesVersion: 0.12.1 + rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml + updatedAt: 2020-01-01 12:00:00 +0000 UTC + version: "0.1" + webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml + name: buildah + rating: 4.3 + tags: + - id: 1 + name: image-build + versions: + - id: 1 + version: "0.1" + - id: 2 + version: "0.2" + - catalog: + id: 1 + type: community + id: 1 + kind: task + latestVersion: + description: Buildah task builds source into a container image + and then pushes it to a container registry. + displayName: Buildah + id: 1 + minPipelinesVersion: 0.12.1 + rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml + updatedAt: 2020-01-01 12:00:00 +0000 UTC + version: "0.1" + webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml + name: buildah + rating: 4.3 + tags: + - id: 1 + name: image-build + versions: + - id: 1 + version: "0.1" + - id: 2 + version: "0.2" + "400": + description: "" + content: + application/vnd.goa.error: + schema: + $ref: '#/components/schemas/Error' + example: + fault: true + id: 123abc + message: parameter 'p' must be an integer + name: bad_request + temporary: true + timeout: true + "404": + description: "" + content: + application/vnd.goa.error: + schema: + $ref: '#/components/schemas/Error' + example: + fault: true + id: 123abc + message: parameter 'p' must be an integer + name: bad_request + temporary: false + timeout: true + "500": + description: "" + content: + application/vnd.goa.error: + schema: + $ref: '#/components/schemas/Error' + example: + fault: false + id: 123abc + message: parameter 'p' must be an integer + name: bad_request + temporary: true + timeout: true + /v1/resource/{catalog}/{kind}/{name}: + get: + tags: + - resource + summary: ByCatalogKindName resource + description: Find resources using name of catalog, resource name and kind of + resource + operationId: resource#ByCatalogKindName + parameters: + - name: catalog + in: path + description: name of catalog + required: true + schema: + type: string + description: name of catalog + example: tektoncd + example: tektoncd + - name: kind + in: path + description: kind of resource + required: true + schema: + type: string + description: kind of resource + example: pipeline + enum: + - task + - pipeline + example: task + - name: name + in: path + description: Name of resource + required: true + schema: + type: string + description: Name of resource + example: buildah + example: buildah + responses: + "200": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Resource' + example: + data: + catalog: + id: 1 + type: community + id: 1 + kind: task + latestVersion: + description: Buildah task builds source into a container image + and then pushes it to a container registry. + displayName: Buildah + id: 1 + minPipelinesVersion: 0.12.1 + rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml + updatedAt: 2020-01-01 12:00:00 +0000 UTC + version: "0.1" + webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml + name: buildah + rating: 4.3 + tags: + - id: 1 + name: image-build + versions: + - id: 1 + version: "0.1" + - id: 2 + version: "0.2" + "404": + description: "" + content: + application/vnd.goa.error: + schema: + $ref: '#/components/schemas/Error' + example: + fault: true + id: 123abc + message: parameter 'p' must be an integer + name: bad_request + temporary: false + timeout: true + "500": + description: "" + content: + application/vnd.goa.error: + schema: + $ref: '#/components/schemas/Error' + example: + fault: false + id: 123abc + message: parameter 'p' must be an integer + name: bad_request + temporary: true + timeout: true + /v1/resource/{catalog}/{kind}/{name}/{version}: + get: + tags: + - resource + summary: ByCatalogKindNameVersion resource + description: Find resource using name of catalog & name, kind and version of + resource + operationId: resource#ByCatalogKindNameVersion + parameters: + - name: catalog + in: path + description: name of catalog + required: true + schema: + type: string + description: name of catalog + example: tektoncd + example: tektoncd + - name: kind + in: path + description: kind of resource + required: true + schema: + type: string + description: kind of resource + example: pipeline + enum: + - task + - pipeline + example: task + - name: name + in: path + description: name of resource + required: true + schema: + type: string + description: name of resource + example: buildah + example: buildah + - name: version + in: path + description: version of resource + required: true + schema: + type: string + description: version of resource + example: "0.1" + example: "0.1" + responses: + "200": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ResourceVersion' + example: + data: + description: Buildah task builds source into a container image and + then pushes it to a container registry. + displayName: Buildah + id: 1 + minPipelinesVersion: 0.12.1 + rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml + resource: + catalog: + id: 1 + type: community + id: 1 + kind: task + name: buildah + rating: 4.3 + tags: + - id: 1 + name: image-build + updatedAt: 2020-01-01 12:00:00 +0000 UTC + version: "0.1" + webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml + "404": + description: "" + content: + application/vnd.goa.error: + schema: + $ref: '#/components/schemas/Error' + example: + fault: true + id: 123abc + message: parameter 'p' must be an integer + name: bad_request + temporary: true + timeout: false + "500": + description: "" + content: + application/vnd.goa.error: + schema: + $ref: '#/components/schemas/Error' + example: + fault: false + id: 123abc + message: parameter 'p' must be an integer + name: bad_request + temporary: false + timeout: false + /v1/resource/{id}: + get: + tags: + - resource + summary: ById resource + description: Find a resource using it's id + operationId: resource#ById + parameters: + - name: id + in: path + description: ID of a resource + required: true + schema: + type: integer + description: ID of a resource + example: 1 + example: 1 + responses: + "200": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Resource' + example: + data: + catalog: + id: 1 + type: community + id: 1 + kind: task + latestVersion: + description: Buildah task builds source into a container image + and then pushes it to a container registry. + displayName: Buildah + id: 1 + minPipelinesVersion: 0.12.1 + rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml + updatedAt: 2020-01-01 12:00:00 +0000 UTC + version: "0.1" + webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml + name: buildah + rating: 4.3 + tags: + - id: 1 + name: image-build + versions: + - id: 1 + version: "0.1" + - id: 2 + version: "0.2" + "404": + description: "" + content: + application/vnd.goa.error: + schema: + $ref: '#/components/schemas/Error' + example: + fault: false + id: 123abc + message: parameter 'p' must be an integer + name: bad_request + temporary: false + timeout: false + "500": + description: "" + content: + application/vnd.goa.error: + schema: + $ref: '#/components/schemas/Error' + example: + fault: true + id: 123abc + message: parameter 'p' must be an integer + name: bad_request + temporary: true + timeout: true + /v1/resource/{id}/versions: + get: + tags: + - resource + summary: VersionsByID resource + description: Find all versions of a resource by its id + operationId: resource#VersionsByID + parameters: + - name: id + in: path + description: ID of a resource + required: true + schema: + type: integer + description: ID of a resource + example: 1 + example: 1 + responses: + "200": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ResourceVersions' + example: + data: + latest: + id: 2 + rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml + version: "0.2" + webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml + versions: + - id: 1 + rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml + version: "0.1" + webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml + - id: 2 + rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml + version: "0.2" + webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml + "404": + description: "" + content: + application/vnd.goa.error: + schema: + $ref: '#/components/schemas/Error' + example: + fault: false + id: 123abc + message: parameter 'p' must be an integer + name: bad_request + temporary: false + timeout: true + "500": + description: "" + content: + application/vnd.goa.error: + schema: + $ref: '#/components/schemas/Error' + example: + fault: true + id: 123abc + message: parameter 'p' must be an integer + name: bad_request + temporary: false + timeout: false + /v1/resource/version/{versionID}: + get: + tags: + - resource + summary: ByVersionId resource + description: Find a resource using its version's id + operationId: resource#ByVersionId + parameters: + - name: versionID + in: path + description: Version ID of a resource's version + required: true + schema: + type: integer + description: Version ID of a resource's version + example: 1 + example: 1 + responses: + "200": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ResourceVersion' + example: + data: + description: Buildah task builds source into a container image and + then pushes it to a container registry. + displayName: Buildah + id: 1 + minPipelinesVersion: 0.12.1 + rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml + resource: + catalog: + id: 1 + type: community + id: 1 + kind: task + name: buildah + rating: 4.3 + tags: + - id: 1 + name: image-build + updatedAt: 2020-01-01 12:00:00 +0000 UTC + version: "0.1" + webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml + "404": + description: "" + content: + application/vnd.goa.error: + schema: + $ref: '#/components/schemas/Error' + example: + fault: true + id: 123abc + message: parameter 'p' must be an integer + name: bad_request + temporary: false + timeout: false + "500": + description: "" + content: + application/vnd.goa.error: + schema: + $ref: '#/components/schemas/Error' + example: + fault: false + id: 123abc + message: parameter 'p' must be an integer + name: bad_request + temporary: false + timeout: true + /v1/resources: + get: + tags: + - resource + summary: List resource + description: List all resources sorted by rating and name + operationId: resource#List + parameters: + - name: limit + in: query + description: Maximum number of resources to be returned + allowEmptyValue: true + schema: + type: integer + description: Maximum number of resources to be returned + default: 1000 + example: 100 + example: 100 + responses: + "200": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Resources' + example: + data: + - catalog: + id: 1 + type: community + id: 1 + kind: task + latestVersion: + description: Buildah task builds source into a container image + and then pushes it to a container registry. + displayName: Buildah + id: 1 + minPipelinesVersion: 0.12.1 + rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml + updatedAt: 2020-01-01 12:00:00 +0000 UTC + version: "0.1" + webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml + name: buildah + rating: 4.3 + tags: + - id: 1 + name: image-build + versions: + - id: 1 + version: "0.1" + - id: 2 + version: "0.2" + - catalog: + id: 1 + type: community + id: 1 + kind: task + latestVersion: + description: Buildah task builds source into a container image + and then pushes it to a container registry. + displayName: Buildah + id: 1 + minPipelinesVersion: 0.12.1 + rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml + updatedAt: 2020-01-01 12:00:00 +0000 UTC + version: "0.1" + webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml + name: buildah + rating: 4.3 + tags: + - id: 1 + name: image-build + versions: + - id: 1 + version: "0.1" + - id: 2 + version: "0.2" + - catalog: + id: 1 + type: community + id: 1 + kind: task + latestVersion: + description: Buildah task builds source into a container image + and then pushes it to a container registry. + displayName: Buildah + id: 1 + minPipelinesVersion: 0.12.1 + rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml + updatedAt: 2020-01-01 12:00:00 +0000 UTC + version: "0.1" + webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml + name: buildah + rating: 4.3 + tags: + - id: 1 + name: image-build + versions: + - id: 1 + version: "0.1" + - id: 2 + version: "0.2" + - catalog: + id: 1 + type: community + id: 1 + kind: task + latestVersion: + description: Buildah task builds source into a container image + and then pushes it to a container registry. + displayName: Buildah + id: 1 + minPipelinesVersion: 0.12.1 + rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml + updatedAt: 2020-01-01 12:00:00 +0000 UTC + version: "0.1" + webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml + name: buildah + rating: 4.3 + tags: + - id: 1 + name: image-build + versions: + - id: 1 + version: "0.1" + - id: 2 + version: "0.2" + "500": + description: "" + content: + application/vnd.goa.error: + schema: + $ref: '#/components/schemas/Error' + example: + fault: true + id: 123abc + message: parameter 'p' must be an integer + name: bad_request + temporary: false + timeout: false + /v1/schema/swagger.json: + get: + tags: + - swagger + summary: Download v1/gen/http/openapi3.yaml + description: JSON document containing the API swagger definition + operationId: swagger#/v1/schema/swagger.json + responses: + "200": + description: File downloaded +components: + schemas: + Catalog: + type: object + properties: + id: + type: integer + description: ID is the unique id of the catalog + example: 1 + name: + type: string + description: Name of catalog + example: Tekton + type: + type: string + description: Type of catalog + example: community + enum: + - official + - community + example: + id: 1 + name: Tekton + type: community + required: + - id + - name + - type + Error: + type: object + properties: + fault: + type: boolean + description: Is the error a server-side fault? + example: true + id: + type: string + description: ID is a unique identifier for this particular occurrence of + the problem. + example: 123abc + message: + type: string + description: Message is a human-readable explanation specific to this occurrence + of the problem. + example: parameter 'p' must be an integer + name: + type: string + description: Name is the name of this class of errors. + example: bad_request + temporary: + type: boolean + description: Is the error temporary? + example: true + timeout: + type: boolean + description: Is the error a timeout? + example: false + description: Internal Server Error + example: + fault: true + id: 123abc + message: parameter 'p' must be an integer + name: bad_request + temporary: true + timeout: true + required: + - name + - id + - message + - temporary + - timeout + - fault + Resource: + type: object + properties: + data: + $ref: '#/components/schemas/ResourceData' + example: + data: + catalog: + id: 1 + type: community + id: 1 + kind: task + latestVersion: + description: Buildah task builds source into a container image and then + pushes it to a container registry. + displayName: Buildah + id: 1 + minPipelinesVersion: 0.12.1 + rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml + updatedAt: 2020-01-01 12:00:00 +0000 UTC + version: "0.1" + webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml + name: buildah + rating: 4.3 + tags: + - id: 1 + name: image-build + versions: + - id: 1 + version: "0.1" + - id: 2 + version: "0.2" + required: + - data + ResourceData: + type: object + properties: + catalog: + $ref: '#/components/schemas/Catalog' + id: + type: integer + description: ID is the unique id of the resource + example: 1 + kind: + type: string + description: Kind of resource + example: task + latestVersion: + $ref: '#/components/schemas/ResourceVersionData' + name: + type: string + description: Name of resource + example: buildah + rating: + type: number + description: Rating of resource + example: 4.3 + format: double + tags: + type: array + items: + $ref: '#/components/schemas/Tag' + description: Tags related to resource + example: + - id: 1 + name: image-build + versions: + type: array + items: + $ref: '#/components/schemas/ResourceVersionData' + description: List of all versions of a resource + example: + - id: 1 + version: "0.1" + - id: 2 + version: "0.2" + description: The resource type describes resource information. + example: + catalog: + id: 1 + type: community + id: 1 + kind: task + latestVersion: + description: Buildah task builds source into a container image and then + pushes it to a container registry. + displayName: Buildah + id: 1 + minPipelinesVersion: 0.12.1 + rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml + updatedAt: 2020-01-01 12:00:00 +0000 UTC + version: "0.1" + webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml + name: buildah + rating: 4.3 + tags: + - id: 1 + name: image-build + versions: + - id: 1 + version: "0.1" + - id: 2 + version: "0.2" + required: + - id + - name + - catalog + - kind + - latestVersion + - tags + - rating + - versions + ResourceDataCollection: + type: array + items: + $ref: '#/components/schemas/ResourceData' + example: + - catalog: + id: 1 + type: community + id: 1 + kind: task + latestVersion: + description: Buildah task builds source into a container image and then + pushes it to a container registry. + displayName: Buildah + id: 1 + minPipelinesVersion: 0.12.1 + rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml + updatedAt: 2020-01-01 12:00:00 +0000 UTC + version: "0.1" + webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml + name: buildah + rating: 4.3 + tags: + - id: 1 + name: image-build + versions: + - id: 1 + version: "0.1" + - id: 2 + version: "0.2" + - catalog: + id: 1 + type: community + id: 1 + kind: task + latestVersion: + description: Buildah task builds source into a container image and then + pushes it to a container registry. + displayName: Buildah + id: 1 + minPipelinesVersion: 0.12.1 + rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml + updatedAt: 2020-01-01 12:00:00 +0000 UTC + version: "0.1" + webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml + name: buildah + rating: 4.3 + tags: + - id: 1 + name: image-build + versions: + - id: 1 + version: "0.1" + - id: 2 + version: "0.2" + - catalog: + id: 1 + type: community + id: 1 + kind: task + latestVersion: + description: Buildah task builds source into a container image and then + pushes it to a container registry. + displayName: Buildah + id: 1 + minPipelinesVersion: 0.12.1 + rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml + updatedAt: 2020-01-01 12:00:00 +0000 UTC + version: "0.1" + webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml + name: buildah + rating: 4.3 + tags: + - id: 1 + name: image-build + versions: + - id: 1 + version: "0.1" + - id: 2 + version: "0.2" + - catalog: + id: 1 + type: community + id: 1 + kind: task + latestVersion: + description: Buildah task builds source into a container image and then + pushes it to a container registry. + displayName: Buildah + id: 1 + minPipelinesVersion: 0.12.1 + rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml + updatedAt: 2020-01-01 12:00:00 +0000 UTC + version: "0.1" + webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml + name: buildah + rating: 4.3 + tags: + - id: 1 + name: image-build + versions: + - id: 1 + version: "0.1" + - id: 2 + version: "0.2" + ResourceVersion: + type: object + properties: + data: + $ref: '#/components/schemas/ResourceVersionData' + example: + data: + description: Buildah task builds source into a container image and then + pushes it to a container registry. + displayName: Buildah + id: 1 + minPipelinesVersion: 0.12.1 + rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml + resource: + catalog: + id: 1 + type: community + id: 1 + kind: task + name: buildah + rating: 4.3 + tags: + - id: 1 + name: image-build + updatedAt: 2020-01-01 12:00:00 +0000 UTC + version: "0.1" + webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml + required: + - data + ResourceVersionData: + type: object + properties: + description: + type: string + description: Description of version + example: Buildah task builds source into a container image and then pushes + it to a container registry. + displayName: + type: string + description: Display name of version + example: Buildah + id: + type: integer + description: ID is the unique id of resource's version + example: 1 + minPipelinesVersion: + type: string + description: Minimum pipelines version the resource's version is compatible + with + example: 0.12.1 + rawURL: + type: string + description: Raw URL of resource's yaml file of the version + example: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml + format: uri + resource: + $ref: '#/components/schemas/ResourceData' + updatedAt: + type: string + description: Timestamp when version was last updated + example: 2020-01-01 12:00:00 +0000 UTC + format: date-time + version: + type: string + description: Version of resource + example: "0.1" + webURL: + type: string + description: Web URL of resource's yaml file of the version + example: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml + format: uri + description: The Version result type describes resource's version information. + example: + description: Buildah task builds source into a container image and then pushes + it to a container registry. + displayName: Buildah + id: 1 + minPipelinesVersion: 0.12.1 + rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml + resource: + catalog: + id: 1 + type: community + id: 1 + kind: task + name: buildah + rating: 4.3 + tags: + - id: 1 + name: image-build + updatedAt: 2020-01-01 12:00:00 +0000 UTC + version: "0.1" + webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml + required: + - id + - version + - displayName + - description + - minPipelinesVersion + - rawURL + - webURL + - updatedAt + - resource + ResourceVersions: + type: object + properties: + data: + $ref: '#/components/schemas/Versions' + example: + data: + latest: + id: 2 + rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml + version: "0.2" + webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml + versions: + - id: 1 + rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml + version: "0.1" + webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml + - id: 2 + rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml + version: "0.2" + webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml + required: + - data + Resources: + type: object + properties: + data: + $ref: '#/components/schemas/ResourceDataCollection' + example: + data: + - catalog: + id: 1 + type: community + id: 1 + kind: task + latestVersion: + description: Buildah task builds source into a container image and then + pushes it to a container registry. + displayName: Buildah + id: 1 + minPipelinesVersion: 0.12.1 + rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml + updatedAt: 2020-01-01 12:00:00 +0000 UTC + version: "0.1" + webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml + name: buildah + rating: 4.3 + tags: + - id: 1 + name: image-build + versions: + - id: 1 + version: "0.1" + - id: 2 + version: "0.2" + - catalog: + id: 1 + type: community + id: 1 + kind: task + latestVersion: + description: Buildah task builds source into a container image and then + pushes it to a container registry. + displayName: Buildah + id: 1 + minPipelinesVersion: 0.12.1 + rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml + updatedAt: 2020-01-01 12:00:00 +0000 UTC + version: "0.1" + webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml + name: buildah + rating: 4.3 + tags: + - id: 1 + name: image-build + versions: + - id: 1 + version: "0.1" + - id: 2 + version: "0.2" + - catalog: + id: 1 + type: community + id: 1 + kind: task + latestVersion: + description: Buildah task builds source into a container image and then + pushes it to a container registry. + displayName: Buildah + id: 1 + minPipelinesVersion: 0.12.1 + rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml + updatedAt: 2020-01-01 12:00:00 +0000 UTC + version: "0.1" + webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml + name: buildah + rating: 4.3 + tags: + - id: 1 + name: image-build + versions: + - id: 1 + version: "0.1" + - id: 2 + version: "0.2" + - catalog: + id: 1 + type: community + id: 1 + kind: task + latestVersion: + description: Buildah task builds source into a container image and then + pushes it to a container registry. + displayName: Buildah + id: 1 + minPipelinesVersion: 0.12.1 + rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml + updatedAt: 2020-01-01 12:00:00 +0000 UTC + version: "0.1" + webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml + name: buildah + rating: 4.3 + tags: + - id: 1 + name: image-build + versions: + - id: 1 + version: "0.1" + - id: 2 + version: "0.2" + required: + - data + Tag: + type: object + properties: + id: + type: integer + description: ID is the unique id of tag + example: 1 + name: + type: string + description: Name of tag + example: image-build + example: + id: 1 + name: image-build + required: + - id + - name + Versions: + type: object + properties: + latest: + $ref: '#/components/schemas/ResourceVersionData' + versions: + type: array + items: + $ref: '#/components/schemas/ResourceVersionData' + description: List of all versions of resource + example: + - id: 1 + rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml + version: "0.1" + webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml + - id: 2 + rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml + version: "0.2" + webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml + description: The Versions type describes response for versions by resource id + API. + example: + latest: + id: 2 + rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml + version: "0.2" + webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml + versions: + - id: 1 + rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml + version: "0.1" + webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml + - id: 2 + rawURL: https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml + version: "0.2" + webURL: https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml + required: + - latest + - versions diff --git a/api/v1/gen/http/resource/client/cli.go b/api/v1/gen/http/resource/client/cli.go new file mode 100644 index 0000000000..91d30e8893 --- /dev/null +++ b/api/v1/gen/http/resource/client/cli.go @@ -0,0 +1,221 @@ +// Code generated by goa v3.2.2, DO NOT EDIT. +// +// resource HTTP client CLI support package +// +// Command: +// $ goa gen github.com/tektoncd/hub/api/v1/design + +package client + +import ( + "encoding/json" + "fmt" + "strconv" + + resource "github.com/tektoncd/hub/api/v1/gen/resource" + goa "goa.design/goa/v3/pkg" +) + +// BuildQueryPayload builds the payload for the resource Query endpoint from +// CLI flags. +func BuildQueryPayload(resourceQueryName string, resourceQueryKinds string, resourceQueryTags string, resourceQueryLimit string, resourceQueryMatch string) (*resource.QueryPayload, error) { + var err error + var name string + { + if resourceQueryName != "" { + name = resourceQueryName + } + } + var kinds []string + { + if resourceQueryKinds != "" { + err = json.Unmarshal([]byte(resourceQueryKinds), &kinds) + if err != nil { + return nil, fmt.Errorf("invalid JSON for kinds, example of valid JSON:\n%s", "'[\n \"task\",\n \"pipelines\"\n ]'") + } + } + } + var tags []string + { + if resourceQueryTags != "" { + err = json.Unmarshal([]byte(resourceQueryTags), &tags) + if err != nil { + return nil, fmt.Errorf("invalid JSON for tags, example of valid JSON:\n%s", "'[\n \"image\",\n \"build\"\n ]'") + } + } + } + var limit uint + { + if resourceQueryLimit != "" { + var v uint64 + v, err = strconv.ParseUint(resourceQueryLimit, 10, 64) + limit = uint(v) + if err != nil { + return nil, fmt.Errorf("invalid value for limit, must be UINT") + } + } + } + var match string + { + if resourceQueryMatch != "" { + match = resourceQueryMatch + if !(match == "exact" || match == "contains") { + err = goa.MergeErrors(err, goa.InvalidEnumValueError("match", match, []interface{}{"exact", "contains"})) + } + if err != nil { + return nil, err + } + } + } + v := &resource.QueryPayload{} + v.Name = name + v.Kinds = kinds + v.Tags = tags + v.Limit = limit + v.Match = match + + return v, nil +} + +// BuildListPayload builds the payload for the resource List endpoint from CLI +// flags. +func BuildListPayload(resourceListLimit string) (*resource.ListPayload, error) { + var err error + var limit uint + { + if resourceListLimit != "" { + var v uint64 + v, err = strconv.ParseUint(resourceListLimit, 10, 64) + limit = uint(v) + if err != nil { + return nil, fmt.Errorf("invalid value for limit, must be UINT") + } + } + } + v := &resource.ListPayload{} + v.Limit = limit + + return v, nil +} + +// BuildVersionsByIDPayload builds the payload for the resource VersionsByID +// endpoint from CLI flags. +func BuildVersionsByIDPayload(resourceVersionsByIDID string) (*resource.VersionsByIDPayload, error) { + var err error + var id uint + { + var v uint64 + v, err = strconv.ParseUint(resourceVersionsByIDID, 10, 64) + id = uint(v) + if err != nil { + return nil, fmt.Errorf("invalid value for id, must be UINT") + } + } + v := &resource.VersionsByIDPayload{} + v.ID = id + + return v, nil +} + +// BuildByCatalogKindNameVersionPayload builds the payload for the resource +// ByCatalogKindNameVersion endpoint from CLI flags. +func BuildByCatalogKindNameVersionPayload(resourceByCatalogKindNameVersionCatalog string, resourceByCatalogKindNameVersionKind string, resourceByCatalogKindNameVersionName string, resourceByCatalogKindNameVersionVersion string) (*resource.ByCatalogKindNameVersionPayload, error) { + var err error + var catalog string + { + catalog = resourceByCatalogKindNameVersionCatalog + } + var kind string + { + kind = resourceByCatalogKindNameVersionKind + if !(kind == "task" || kind == "pipeline") { + err = goa.MergeErrors(err, goa.InvalidEnumValueError("kind", kind, []interface{}{"task", "pipeline"})) + } + if err != nil { + return nil, err + } + } + var name string + { + name = resourceByCatalogKindNameVersionName + } + var version string + { + version = resourceByCatalogKindNameVersionVersion + } + v := &resource.ByCatalogKindNameVersionPayload{} + v.Catalog = catalog + v.Kind = kind + v.Name = name + v.Version = version + + return v, nil +} + +// BuildByVersionIDPayload builds the payload for the resource ByVersionId +// endpoint from CLI flags. +func BuildByVersionIDPayload(resourceByVersionIDVersionID string) (*resource.ByVersionIDPayload, error) { + var err error + var versionID uint + { + var v uint64 + v, err = strconv.ParseUint(resourceByVersionIDVersionID, 10, 64) + versionID = uint(v) + if err != nil { + return nil, fmt.Errorf("invalid value for versionID, must be UINT") + } + } + v := &resource.ByVersionIDPayload{} + v.VersionID = versionID + + return v, nil +} + +// BuildByCatalogKindNamePayload builds the payload for the resource +// ByCatalogKindName endpoint from CLI flags. +func BuildByCatalogKindNamePayload(resourceByCatalogKindNameCatalog string, resourceByCatalogKindNameKind string, resourceByCatalogKindNameName string) (*resource.ByCatalogKindNamePayload, error) { + var err error + var catalog string + { + catalog = resourceByCatalogKindNameCatalog + } + var kind string + { + kind = resourceByCatalogKindNameKind + if !(kind == "task" || kind == "pipeline") { + err = goa.MergeErrors(err, goa.InvalidEnumValueError("kind", kind, []interface{}{"task", "pipeline"})) + } + if err != nil { + return nil, err + } + } + var name string + { + name = resourceByCatalogKindNameName + } + v := &resource.ByCatalogKindNamePayload{} + v.Catalog = catalog + v.Kind = kind + v.Name = name + + return v, nil +} + +// BuildByIDPayload builds the payload for the resource ById endpoint from CLI +// flags. +func BuildByIDPayload(resourceByIDID string) (*resource.ByIDPayload, error) { + var err error + var id uint + { + var v uint64 + v, err = strconv.ParseUint(resourceByIDID, 10, 64) + id = uint(v) + if err != nil { + return nil, fmt.Errorf("invalid value for id, must be UINT") + } + } + v := &resource.ByIDPayload{} + v.ID = id + + return v, nil +} diff --git a/api/v1/gen/http/resource/client/client.go b/api/v1/gen/http/resource/client/client.go new file mode 100644 index 0000000000..5dddf8d75d --- /dev/null +++ b/api/v1/gen/http/resource/client/client.go @@ -0,0 +1,225 @@ +// Code generated by goa v3.2.2, DO NOT EDIT. +// +// resource client HTTP transport +// +// Command: +// $ goa gen github.com/tektoncd/hub/api/v1/design + +package client + +import ( + "context" + "net/http" + + goahttp "goa.design/goa/v3/http" + goa "goa.design/goa/v3/pkg" +) + +// Client lists the resource service endpoint HTTP clients. +type Client struct { + // Query Doer is the HTTP client used to make requests to the Query endpoint. + QueryDoer goahttp.Doer + + // List Doer is the HTTP client used to make requests to the List endpoint. + ListDoer goahttp.Doer + + // VersionsByID Doer is the HTTP client used to make requests to the + // VersionsByID endpoint. + VersionsByIDDoer goahttp.Doer + + // ByCatalogKindNameVersion Doer is the HTTP client used to make requests to + // the ByCatalogKindNameVersion endpoint. + ByCatalogKindNameVersionDoer goahttp.Doer + + // ByVersionID Doer is the HTTP client used to make requests to the ByVersionId + // endpoint. + ByVersionIDDoer goahttp.Doer + + // ByCatalogKindName Doer is the HTTP client used to make requests to the + // ByCatalogKindName endpoint. + ByCatalogKindNameDoer goahttp.Doer + + // ByID Doer is the HTTP client used to make requests to the ById endpoint. + ByIDDoer goahttp.Doer + + // CORS Doer is the HTTP client used to make requests to the endpoint. + CORSDoer goahttp.Doer + + // RestoreResponseBody controls whether the response bodies are reset after + // decoding so they can be read again. + RestoreResponseBody bool + + scheme string + host string + encoder func(*http.Request) goahttp.Encoder + decoder func(*http.Response) goahttp.Decoder +} + +// NewClient instantiates HTTP clients for all the resource service servers. +func NewClient( + scheme string, + host string, + doer goahttp.Doer, + enc func(*http.Request) goahttp.Encoder, + dec func(*http.Response) goahttp.Decoder, + restoreBody bool, +) *Client { + return &Client{ + QueryDoer: doer, + ListDoer: doer, + VersionsByIDDoer: doer, + ByCatalogKindNameVersionDoer: doer, + ByVersionIDDoer: doer, + ByCatalogKindNameDoer: doer, + ByIDDoer: doer, + CORSDoer: doer, + RestoreResponseBody: restoreBody, + scheme: scheme, + host: host, + decoder: dec, + encoder: enc, + } +} + +// Query returns an endpoint that makes HTTP requests to the resource service +// Query server. +func (c *Client) Query() goa.Endpoint { + var ( + encodeRequest = EncodeQueryRequest(c.encoder) + decodeResponse = DecodeQueryResponse(c.decoder, c.RestoreResponseBody) + ) + return func(ctx context.Context, v interface{}) (interface{}, error) { + req, err := c.BuildQueryRequest(ctx, v) + if err != nil { + return nil, err + } + err = encodeRequest(req, v) + if err != nil { + return nil, err + } + resp, err := c.QueryDoer.Do(req) + if err != nil { + return nil, goahttp.ErrRequestError("resource", "Query", err) + } + return decodeResponse(resp) + } +} + +// List returns an endpoint that makes HTTP requests to the resource service +// List server. +func (c *Client) List() goa.Endpoint { + var ( + encodeRequest = EncodeListRequest(c.encoder) + decodeResponse = DecodeListResponse(c.decoder, c.RestoreResponseBody) + ) + return func(ctx context.Context, v interface{}) (interface{}, error) { + req, err := c.BuildListRequest(ctx, v) + if err != nil { + return nil, err + } + err = encodeRequest(req, v) + if err != nil { + return nil, err + } + resp, err := c.ListDoer.Do(req) + if err != nil { + return nil, goahttp.ErrRequestError("resource", "List", err) + } + return decodeResponse(resp) + } +} + +// VersionsByID returns an endpoint that makes HTTP requests to the resource +// service VersionsByID server. +func (c *Client) VersionsByID() goa.Endpoint { + var ( + decodeResponse = DecodeVersionsByIDResponse(c.decoder, c.RestoreResponseBody) + ) + return func(ctx context.Context, v interface{}) (interface{}, error) { + req, err := c.BuildVersionsByIDRequest(ctx, v) + if err != nil { + return nil, err + } + resp, err := c.VersionsByIDDoer.Do(req) + if err != nil { + return nil, goahttp.ErrRequestError("resource", "VersionsByID", err) + } + return decodeResponse(resp) + } +} + +// ByCatalogKindNameVersion returns an endpoint that makes HTTP requests to the +// resource service ByCatalogKindNameVersion server. +func (c *Client) ByCatalogKindNameVersion() goa.Endpoint { + var ( + decodeResponse = DecodeByCatalogKindNameVersionResponse(c.decoder, c.RestoreResponseBody) + ) + return func(ctx context.Context, v interface{}) (interface{}, error) { + req, err := c.BuildByCatalogKindNameVersionRequest(ctx, v) + if err != nil { + return nil, err + } + resp, err := c.ByCatalogKindNameVersionDoer.Do(req) + if err != nil { + return nil, goahttp.ErrRequestError("resource", "ByCatalogKindNameVersion", err) + } + return decodeResponse(resp) + } +} + +// ByVersionID returns an endpoint that makes HTTP requests to the resource +// service ByVersionId server. +func (c *Client) ByVersionID() goa.Endpoint { + var ( + decodeResponse = DecodeByVersionIDResponse(c.decoder, c.RestoreResponseBody) + ) + return func(ctx context.Context, v interface{}) (interface{}, error) { + req, err := c.BuildByVersionIDRequest(ctx, v) + if err != nil { + return nil, err + } + resp, err := c.ByVersionIDDoer.Do(req) + if err != nil { + return nil, goahttp.ErrRequestError("resource", "ByVersionId", err) + } + return decodeResponse(resp) + } +} + +// ByCatalogKindName returns an endpoint that makes HTTP requests to the +// resource service ByCatalogKindName server. +func (c *Client) ByCatalogKindName() goa.Endpoint { + var ( + decodeResponse = DecodeByCatalogKindNameResponse(c.decoder, c.RestoreResponseBody) + ) + return func(ctx context.Context, v interface{}) (interface{}, error) { + req, err := c.BuildByCatalogKindNameRequest(ctx, v) + if err != nil { + return nil, err + } + resp, err := c.ByCatalogKindNameDoer.Do(req) + if err != nil { + return nil, goahttp.ErrRequestError("resource", "ByCatalogKindName", err) + } + return decodeResponse(resp) + } +} + +// ByID returns an endpoint that makes HTTP requests to the resource service +// ById server. +func (c *Client) ByID() goa.Endpoint { + var ( + decodeResponse = DecodeByIDResponse(c.decoder, c.RestoreResponseBody) + ) + return func(ctx context.Context, v interface{}) (interface{}, error) { + req, err := c.BuildByIDRequest(ctx, v) + if err != nil { + return nil, err + } + resp, err := c.ByIDDoer.Do(req) + if err != nil { + return nil, goahttp.ErrRequestError("resource", "ById", err) + } + return decodeResponse(resp) + } +} diff --git a/api/v1/gen/http/resource/client/encode_decode.go b/api/v1/gen/http/resource/client/encode_decode.go new file mode 100644 index 0000000000..ad454855c0 --- /dev/null +++ b/api/v1/gen/http/resource/client/encode_decode.go @@ -0,0 +1,822 @@ +// Code generated by goa v3.2.2, DO NOT EDIT. +// +// resource HTTP client encoders and decoders +// +// Command: +// $ goa gen github.com/tektoncd/hub/api/v1/design + +package client + +import ( + "bytes" + "context" + "fmt" + "io/ioutil" + "net/http" + "net/url" + + resource "github.com/tektoncd/hub/api/v1/gen/resource" + resourceviews "github.com/tektoncd/hub/api/v1/gen/resource/views" + goahttp "goa.design/goa/v3/http" +) + +// BuildQueryRequest instantiates a HTTP request object with method and path +// set to call the "resource" service "Query" endpoint +func (c *Client) BuildQueryRequest(ctx context.Context, v interface{}) (*http.Request, error) { + u := &url.URL{Scheme: c.scheme, Host: c.host, Path: QueryResourcePath()} + req, err := http.NewRequest("GET", u.String(), nil) + if err != nil { + return nil, goahttp.ErrInvalidURL("resource", "Query", u.String(), err) + } + if ctx != nil { + req = req.WithContext(ctx) + } + + return req, nil +} + +// EncodeQueryRequest returns an encoder for requests sent to the resource +// Query server. +func EncodeQueryRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error { + return func(req *http.Request, v interface{}) error { + p, ok := v.(*resource.QueryPayload) + if !ok { + return goahttp.ErrInvalidType("resource", "Query", "*resource.QueryPayload", v) + } + values := req.URL.Query() + values.Add("name", p.Name) + for _, value := range p.Kinds { + values.Add("kinds", value) + } + for _, value := range p.Tags { + values.Add("tags", value) + } + values.Add("limit", fmt.Sprintf("%v", p.Limit)) + values.Add("match", p.Match) + req.URL.RawQuery = values.Encode() + return nil + } +} + +// DecodeQueryResponse returns a decoder for responses returned by the resource +// Query endpoint. restoreBody controls whether the response body should be +// restored after having been read. +// DecodeQueryResponse may return the following errors: +// - "internal-error" (type *goa.ServiceError): http.StatusInternalServerError +// - "invalid-kind" (type *goa.ServiceError): http.StatusBadRequest +// - "not-found" (type *goa.ServiceError): http.StatusNotFound +// - error: internal error +func DecodeQueryResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (interface{}, error) { + return func(resp *http.Response) (interface{}, error) { + if restoreBody { + b, err := ioutil.ReadAll(resp.Body) + if err != nil { + return nil, err + } + resp.Body = ioutil.NopCloser(bytes.NewBuffer(b)) + defer func() { + resp.Body = ioutil.NopCloser(bytes.NewBuffer(b)) + }() + } else { + defer resp.Body.Close() + } + switch resp.StatusCode { + case http.StatusOK: + var ( + body QueryResponseBody + err error + ) + err = decoder(resp).Decode(&body) + if err != nil { + return nil, goahttp.ErrDecodingError("resource", "Query", err) + } + p := NewQueryResourcesOK(&body) + view := "default" + vres := &resourceviews.Resources{Projected: p, View: view} + if err = resourceviews.ValidateResources(vres); err != nil { + return nil, goahttp.ErrValidationError("resource", "Query", err) + } + res := resource.NewResources(vres) + return res, nil + case http.StatusInternalServerError: + var ( + body QueryInternalErrorResponseBody + err error + ) + err = decoder(resp).Decode(&body) + if err != nil { + return nil, goahttp.ErrDecodingError("resource", "Query", err) + } + err = ValidateQueryInternalErrorResponseBody(&body) + if err != nil { + return nil, goahttp.ErrValidationError("resource", "Query", err) + } + return nil, NewQueryInternalError(&body) + case http.StatusBadRequest: + var ( + body QueryInvalidKindResponseBody + err error + ) + err = decoder(resp).Decode(&body) + if err != nil { + return nil, goahttp.ErrDecodingError("resource", "Query", err) + } + err = ValidateQueryInvalidKindResponseBody(&body) + if err != nil { + return nil, goahttp.ErrValidationError("resource", "Query", err) + } + return nil, NewQueryInvalidKind(&body) + case http.StatusNotFound: + var ( + body QueryNotFoundResponseBody + err error + ) + err = decoder(resp).Decode(&body) + if err != nil { + return nil, goahttp.ErrDecodingError("resource", "Query", err) + } + err = ValidateQueryNotFoundResponseBody(&body) + if err != nil { + return nil, goahttp.ErrValidationError("resource", "Query", err) + } + return nil, NewQueryNotFound(&body) + default: + body, _ := ioutil.ReadAll(resp.Body) + return nil, goahttp.ErrInvalidResponse("resource", "Query", resp.StatusCode, string(body)) + } + } +} + +// BuildListRequest instantiates a HTTP request object with method and path set +// to call the "resource" service "List" endpoint +func (c *Client) BuildListRequest(ctx context.Context, v interface{}) (*http.Request, error) { + u := &url.URL{Scheme: c.scheme, Host: c.host, Path: ListResourcePath()} + req, err := http.NewRequest("GET", u.String(), nil) + if err != nil { + return nil, goahttp.ErrInvalidURL("resource", "List", u.String(), err) + } + if ctx != nil { + req = req.WithContext(ctx) + } + + return req, nil +} + +// EncodeListRequest returns an encoder for requests sent to the resource List +// server. +func EncodeListRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error { + return func(req *http.Request, v interface{}) error { + p, ok := v.(*resource.ListPayload) + if !ok { + return goahttp.ErrInvalidType("resource", "List", "*resource.ListPayload", v) + } + values := req.URL.Query() + values.Add("limit", fmt.Sprintf("%v", p.Limit)) + req.URL.RawQuery = values.Encode() + return nil + } +} + +// DecodeListResponse returns a decoder for responses returned by the resource +// List endpoint. restoreBody controls whether the response body should be +// restored after having been read. +// DecodeListResponse may return the following errors: +// - "internal-error" (type *goa.ServiceError): http.StatusInternalServerError +// - error: internal error +func DecodeListResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (interface{}, error) { + return func(resp *http.Response) (interface{}, error) { + if restoreBody { + b, err := ioutil.ReadAll(resp.Body) + if err != nil { + return nil, err + } + resp.Body = ioutil.NopCloser(bytes.NewBuffer(b)) + defer func() { + resp.Body = ioutil.NopCloser(bytes.NewBuffer(b)) + }() + } else { + defer resp.Body.Close() + } + switch resp.StatusCode { + case http.StatusOK: + var ( + body ListResponseBody + err error + ) + err = decoder(resp).Decode(&body) + if err != nil { + return nil, goahttp.ErrDecodingError("resource", "List", err) + } + p := NewListResourcesOK(&body) + view := "default" + vres := &resourceviews.Resources{Projected: p, View: view} + if err = resourceviews.ValidateResources(vres); err != nil { + return nil, goahttp.ErrValidationError("resource", "List", err) + } + res := resource.NewResources(vres) + return res, nil + case http.StatusInternalServerError: + var ( + body ListInternalErrorResponseBody + err error + ) + err = decoder(resp).Decode(&body) + if err != nil { + return nil, goahttp.ErrDecodingError("resource", "List", err) + } + err = ValidateListInternalErrorResponseBody(&body) + if err != nil { + return nil, goahttp.ErrValidationError("resource", "List", err) + } + return nil, NewListInternalError(&body) + default: + body, _ := ioutil.ReadAll(resp.Body) + return nil, goahttp.ErrInvalidResponse("resource", "List", resp.StatusCode, string(body)) + } + } +} + +// BuildVersionsByIDRequest instantiates a HTTP request object with method and +// path set to call the "resource" service "VersionsByID" endpoint +func (c *Client) BuildVersionsByIDRequest(ctx context.Context, v interface{}) (*http.Request, error) { + var ( + id uint + ) + { + p, ok := v.(*resource.VersionsByIDPayload) + if !ok { + return nil, goahttp.ErrInvalidType("resource", "VersionsByID", "*resource.VersionsByIDPayload", v) + } + id = p.ID + } + u := &url.URL{Scheme: c.scheme, Host: c.host, Path: VersionsByIDResourcePath(id)} + req, err := http.NewRequest("GET", u.String(), nil) + if err != nil { + return nil, goahttp.ErrInvalidURL("resource", "VersionsByID", u.String(), err) + } + if ctx != nil { + req = req.WithContext(ctx) + } + + return req, nil +} + +// DecodeVersionsByIDResponse returns a decoder for responses returned by the +// resource VersionsByID endpoint. restoreBody controls whether the response +// body should be restored after having been read. +// DecodeVersionsByIDResponse may return the following errors: +// - "internal-error" (type *goa.ServiceError): http.StatusInternalServerError +// - "not-found" (type *goa.ServiceError): http.StatusNotFound +// - error: internal error +func DecodeVersionsByIDResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (interface{}, error) { + return func(resp *http.Response) (interface{}, error) { + if restoreBody { + b, err := ioutil.ReadAll(resp.Body) + if err != nil { + return nil, err + } + resp.Body = ioutil.NopCloser(bytes.NewBuffer(b)) + defer func() { + resp.Body = ioutil.NopCloser(bytes.NewBuffer(b)) + }() + } else { + defer resp.Body.Close() + } + switch resp.StatusCode { + case http.StatusOK: + var ( + body VersionsByIDResponseBody + err error + ) + err = decoder(resp).Decode(&body) + if err != nil { + return nil, goahttp.ErrDecodingError("resource", "VersionsByID", err) + } + p := NewVersionsByIDResourceVersionsOK(&body) + view := "default" + vres := &resourceviews.ResourceVersions{Projected: p, View: view} + if err = resourceviews.ValidateResourceVersions(vres); err != nil { + return nil, goahttp.ErrValidationError("resource", "VersionsByID", err) + } + res := resource.NewResourceVersions(vres) + return res, nil + case http.StatusInternalServerError: + var ( + body VersionsByIDInternalErrorResponseBody + err error + ) + err = decoder(resp).Decode(&body) + if err != nil { + return nil, goahttp.ErrDecodingError("resource", "VersionsByID", err) + } + err = ValidateVersionsByIDInternalErrorResponseBody(&body) + if err != nil { + return nil, goahttp.ErrValidationError("resource", "VersionsByID", err) + } + return nil, NewVersionsByIDInternalError(&body) + case http.StatusNotFound: + var ( + body VersionsByIDNotFoundResponseBody + err error + ) + err = decoder(resp).Decode(&body) + if err != nil { + return nil, goahttp.ErrDecodingError("resource", "VersionsByID", err) + } + err = ValidateVersionsByIDNotFoundResponseBody(&body) + if err != nil { + return nil, goahttp.ErrValidationError("resource", "VersionsByID", err) + } + return nil, NewVersionsByIDNotFound(&body) + default: + body, _ := ioutil.ReadAll(resp.Body) + return nil, goahttp.ErrInvalidResponse("resource", "VersionsByID", resp.StatusCode, string(body)) + } + } +} + +// BuildByCatalogKindNameVersionRequest instantiates a HTTP request object with +// method and path set to call the "resource" service +// "ByCatalogKindNameVersion" endpoint +func (c *Client) BuildByCatalogKindNameVersionRequest(ctx context.Context, v interface{}) (*http.Request, error) { + var ( + catalog string + kind string + name string + version string + ) + { + p, ok := v.(*resource.ByCatalogKindNameVersionPayload) + if !ok { + return nil, goahttp.ErrInvalidType("resource", "ByCatalogKindNameVersion", "*resource.ByCatalogKindNameVersionPayload", v) + } + catalog = p.Catalog + kind = p.Kind + name = p.Name + version = p.Version + } + u := &url.URL{Scheme: c.scheme, Host: c.host, Path: ByCatalogKindNameVersionResourcePath(catalog, kind, name, version)} + req, err := http.NewRequest("GET", u.String(), nil) + if err != nil { + return nil, goahttp.ErrInvalidURL("resource", "ByCatalogKindNameVersion", u.String(), err) + } + if ctx != nil { + req = req.WithContext(ctx) + } + + return req, nil +} + +// DecodeByCatalogKindNameVersionResponse returns a decoder for responses +// returned by the resource ByCatalogKindNameVersion endpoint. restoreBody +// controls whether the response body should be restored after having been read. +// DecodeByCatalogKindNameVersionResponse may return the following errors: +// - "internal-error" (type *goa.ServiceError): http.StatusInternalServerError +// - "not-found" (type *goa.ServiceError): http.StatusNotFound +// - error: internal error +func DecodeByCatalogKindNameVersionResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (interface{}, error) { + return func(resp *http.Response) (interface{}, error) { + if restoreBody { + b, err := ioutil.ReadAll(resp.Body) + if err != nil { + return nil, err + } + resp.Body = ioutil.NopCloser(bytes.NewBuffer(b)) + defer func() { + resp.Body = ioutil.NopCloser(bytes.NewBuffer(b)) + }() + } else { + defer resp.Body.Close() + } + switch resp.StatusCode { + case http.StatusOK: + var ( + body ByCatalogKindNameVersionResponseBody + err error + ) + err = decoder(resp).Decode(&body) + if err != nil { + return nil, goahttp.ErrDecodingError("resource", "ByCatalogKindNameVersion", err) + } + p := NewByCatalogKindNameVersionResourceVersionOK(&body) + view := "default" + vres := &resourceviews.ResourceVersion{Projected: p, View: view} + if err = resourceviews.ValidateResourceVersion(vres); err != nil { + return nil, goahttp.ErrValidationError("resource", "ByCatalogKindNameVersion", err) + } + res := resource.NewResourceVersion(vres) + return res, nil + case http.StatusInternalServerError: + var ( + body ByCatalogKindNameVersionInternalErrorResponseBody + err error + ) + err = decoder(resp).Decode(&body) + if err != nil { + return nil, goahttp.ErrDecodingError("resource", "ByCatalogKindNameVersion", err) + } + err = ValidateByCatalogKindNameVersionInternalErrorResponseBody(&body) + if err != nil { + return nil, goahttp.ErrValidationError("resource", "ByCatalogKindNameVersion", err) + } + return nil, NewByCatalogKindNameVersionInternalError(&body) + case http.StatusNotFound: + var ( + body ByCatalogKindNameVersionNotFoundResponseBody + err error + ) + err = decoder(resp).Decode(&body) + if err != nil { + return nil, goahttp.ErrDecodingError("resource", "ByCatalogKindNameVersion", err) + } + err = ValidateByCatalogKindNameVersionNotFoundResponseBody(&body) + if err != nil { + return nil, goahttp.ErrValidationError("resource", "ByCatalogKindNameVersion", err) + } + return nil, NewByCatalogKindNameVersionNotFound(&body) + default: + body, _ := ioutil.ReadAll(resp.Body) + return nil, goahttp.ErrInvalidResponse("resource", "ByCatalogKindNameVersion", resp.StatusCode, string(body)) + } + } +} + +// BuildByVersionIDRequest instantiates a HTTP request object with method and +// path set to call the "resource" service "ByVersionId" endpoint +func (c *Client) BuildByVersionIDRequest(ctx context.Context, v interface{}) (*http.Request, error) { + var ( + versionID uint + ) + { + p, ok := v.(*resource.ByVersionIDPayload) + if !ok { + return nil, goahttp.ErrInvalidType("resource", "ByVersionId", "*resource.ByVersionIDPayload", v) + } + versionID = p.VersionID + } + u := &url.URL{Scheme: c.scheme, Host: c.host, Path: ByVersionIDResourcePath(versionID)} + req, err := http.NewRequest("GET", u.String(), nil) + if err != nil { + return nil, goahttp.ErrInvalidURL("resource", "ByVersionId", u.String(), err) + } + if ctx != nil { + req = req.WithContext(ctx) + } + + return req, nil +} + +// DecodeByVersionIDResponse returns a decoder for responses returned by the +// resource ByVersionId endpoint. restoreBody controls whether the response +// body should be restored after having been read. +// DecodeByVersionIDResponse may return the following errors: +// - "internal-error" (type *goa.ServiceError): http.StatusInternalServerError +// - "not-found" (type *goa.ServiceError): http.StatusNotFound +// - error: internal error +func DecodeByVersionIDResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (interface{}, error) { + return func(resp *http.Response) (interface{}, error) { + if restoreBody { + b, err := ioutil.ReadAll(resp.Body) + if err != nil { + return nil, err + } + resp.Body = ioutil.NopCloser(bytes.NewBuffer(b)) + defer func() { + resp.Body = ioutil.NopCloser(bytes.NewBuffer(b)) + }() + } else { + defer resp.Body.Close() + } + switch resp.StatusCode { + case http.StatusOK: + var ( + body ByVersionIDResponseBody + err error + ) + err = decoder(resp).Decode(&body) + if err != nil { + return nil, goahttp.ErrDecodingError("resource", "ByVersionId", err) + } + p := NewByVersionIDResourceVersionOK(&body) + view := "default" + vres := &resourceviews.ResourceVersion{Projected: p, View: view} + if err = resourceviews.ValidateResourceVersion(vres); err != nil { + return nil, goahttp.ErrValidationError("resource", "ByVersionId", err) + } + res := resource.NewResourceVersion(vres) + return res, nil + case http.StatusInternalServerError: + var ( + body ByVersionIDInternalErrorResponseBody + err error + ) + err = decoder(resp).Decode(&body) + if err != nil { + return nil, goahttp.ErrDecodingError("resource", "ByVersionId", err) + } + err = ValidateByVersionIDInternalErrorResponseBody(&body) + if err != nil { + return nil, goahttp.ErrValidationError("resource", "ByVersionId", err) + } + return nil, NewByVersionIDInternalError(&body) + case http.StatusNotFound: + var ( + body ByVersionIDNotFoundResponseBody + err error + ) + err = decoder(resp).Decode(&body) + if err != nil { + return nil, goahttp.ErrDecodingError("resource", "ByVersionId", err) + } + err = ValidateByVersionIDNotFoundResponseBody(&body) + if err != nil { + return nil, goahttp.ErrValidationError("resource", "ByVersionId", err) + } + return nil, NewByVersionIDNotFound(&body) + default: + body, _ := ioutil.ReadAll(resp.Body) + return nil, goahttp.ErrInvalidResponse("resource", "ByVersionId", resp.StatusCode, string(body)) + } + } +} + +// BuildByCatalogKindNameRequest instantiates a HTTP request object with method +// and path set to call the "resource" service "ByCatalogKindName" endpoint +func (c *Client) BuildByCatalogKindNameRequest(ctx context.Context, v interface{}) (*http.Request, error) { + var ( + catalog string + kind string + name string + ) + { + p, ok := v.(*resource.ByCatalogKindNamePayload) + if !ok { + return nil, goahttp.ErrInvalidType("resource", "ByCatalogKindName", "*resource.ByCatalogKindNamePayload", v) + } + catalog = p.Catalog + kind = p.Kind + name = p.Name + } + u := &url.URL{Scheme: c.scheme, Host: c.host, Path: ByCatalogKindNameResourcePath(catalog, kind, name)} + req, err := http.NewRequest("GET", u.String(), nil) + if err != nil { + return nil, goahttp.ErrInvalidURL("resource", "ByCatalogKindName", u.String(), err) + } + if ctx != nil { + req = req.WithContext(ctx) + } + + return req, nil +} + +// DecodeByCatalogKindNameResponse returns a decoder for responses returned by +// the resource ByCatalogKindName endpoint. restoreBody controls whether the +// response body should be restored after having been read. +// DecodeByCatalogKindNameResponse may return the following errors: +// - "internal-error" (type *goa.ServiceError): http.StatusInternalServerError +// - "not-found" (type *goa.ServiceError): http.StatusNotFound +// - error: internal error +func DecodeByCatalogKindNameResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (interface{}, error) { + return func(resp *http.Response) (interface{}, error) { + if restoreBody { + b, err := ioutil.ReadAll(resp.Body) + if err != nil { + return nil, err + } + resp.Body = ioutil.NopCloser(bytes.NewBuffer(b)) + defer func() { + resp.Body = ioutil.NopCloser(bytes.NewBuffer(b)) + }() + } else { + defer resp.Body.Close() + } + switch resp.StatusCode { + case http.StatusOK: + var ( + body ByCatalogKindNameResponseBody + err error + ) + err = decoder(resp).Decode(&body) + if err != nil { + return nil, goahttp.ErrDecodingError("resource", "ByCatalogKindName", err) + } + p := NewByCatalogKindNameResourceOK(&body) + view := "default" + vres := &resourceviews.Resource{Projected: p, View: view} + if err = resourceviews.ValidateResource(vres); err != nil { + return nil, goahttp.ErrValidationError("resource", "ByCatalogKindName", err) + } + res := resource.NewResource(vres) + return res, nil + case http.StatusInternalServerError: + var ( + body ByCatalogKindNameInternalErrorResponseBody + err error + ) + err = decoder(resp).Decode(&body) + if err != nil { + return nil, goahttp.ErrDecodingError("resource", "ByCatalogKindName", err) + } + err = ValidateByCatalogKindNameInternalErrorResponseBody(&body) + if err != nil { + return nil, goahttp.ErrValidationError("resource", "ByCatalogKindName", err) + } + return nil, NewByCatalogKindNameInternalError(&body) + case http.StatusNotFound: + var ( + body ByCatalogKindNameNotFoundResponseBody + err error + ) + err = decoder(resp).Decode(&body) + if err != nil { + return nil, goahttp.ErrDecodingError("resource", "ByCatalogKindName", err) + } + err = ValidateByCatalogKindNameNotFoundResponseBody(&body) + if err != nil { + return nil, goahttp.ErrValidationError("resource", "ByCatalogKindName", err) + } + return nil, NewByCatalogKindNameNotFound(&body) + default: + body, _ := ioutil.ReadAll(resp.Body) + return nil, goahttp.ErrInvalidResponse("resource", "ByCatalogKindName", resp.StatusCode, string(body)) + } + } +} + +// BuildByIDRequest instantiates a HTTP request object with method and path set +// to call the "resource" service "ById" endpoint +func (c *Client) BuildByIDRequest(ctx context.Context, v interface{}) (*http.Request, error) { + var ( + id uint + ) + { + p, ok := v.(*resource.ByIDPayload) + if !ok { + return nil, goahttp.ErrInvalidType("resource", "ById", "*resource.ByIDPayload", v) + } + id = p.ID + } + u := &url.URL{Scheme: c.scheme, Host: c.host, Path: ByIDResourcePath(id)} + req, err := http.NewRequest("GET", u.String(), nil) + if err != nil { + return nil, goahttp.ErrInvalidURL("resource", "ById", u.String(), err) + } + if ctx != nil { + req = req.WithContext(ctx) + } + + return req, nil +} + +// DecodeByIDResponse returns a decoder for responses returned by the resource +// ById endpoint. restoreBody controls whether the response body should be +// restored after having been read. +// DecodeByIDResponse may return the following errors: +// - "internal-error" (type *goa.ServiceError): http.StatusInternalServerError +// - "not-found" (type *goa.ServiceError): http.StatusNotFound +// - error: internal error +func DecodeByIDResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (interface{}, error) { + return func(resp *http.Response) (interface{}, error) { + if restoreBody { + b, err := ioutil.ReadAll(resp.Body) + if err != nil { + return nil, err + } + resp.Body = ioutil.NopCloser(bytes.NewBuffer(b)) + defer func() { + resp.Body = ioutil.NopCloser(bytes.NewBuffer(b)) + }() + } else { + defer resp.Body.Close() + } + switch resp.StatusCode { + case http.StatusOK: + var ( + body ByIDResponseBody + err error + ) + err = decoder(resp).Decode(&body) + if err != nil { + return nil, goahttp.ErrDecodingError("resource", "ById", err) + } + p := NewByIDResourceOK(&body) + view := "default" + vres := &resourceviews.Resource{Projected: p, View: view} + if err = resourceviews.ValidateResource(vres); err != nil { + return nil, goahttp.ErrValidationError("resource", "ById", err) + } + res := resource.NewResource(vres) + return res, nil + case http.StatusInternalServerError: + var ( + body ByIDInternalErrorResponseBody + err error + ) + err = decoder(resp).Decode(&body) + if err != nil { + return nil, goahttp.ErrDecodingError("resource", "ById", err) + } + err = ValidateByIDInternalErrorResponseBody(&body) + if err != nil { + return nil, goahttp.ErrValidationError("resource", "ById", err) + } + return nil, NewByIDInternalError(&body) + case http.StatusNotFound: + var ( + body ByIDNotFoundResponseBody + err error + ) + err = decoder(resp).Decode(&body) + if err != nil { + return nil, goahttp.ErrDecodingError("resource", "ById", err) + } + err = ValidateByIDNotFoundResponseBody(&body) + if err != nil { + return nil, goahttp.ErrValidationError("resource", "ById", err) + } + return nil, NewByIDNotFound(&body) + default: + body, _ := ioutil.ReadAll(resp.Body) + return nil, goahttp.ErrInvalidResponse("resource", "ById", resp.StatusCode, string(body)) + } + } +} + +// unmarshalResourceDataResponseBodyToResourceviewsResourceDataView builds a +// value of type *resourceviews.ResourceDataView from a value of type +// *ResourceDataResponseBody. +func unmarshalResourceDataResponseBodyToResourceviewsResourceDataView(v *ResourceDataResponseBody) *resourceviews.ResourceDataView { + res := &resourceviews.ResourceDataView{ + ID: v.ID, + Name: v.Name, + Kind: v.Kind, + Rating: v.Rating, + } + res.Catalog = unmarshalCatalogResponseBodyToResourceviewsCatalogView(v.Catalog) + res.LatestVersion = unmarshalResourceVersionDataResponseBodyToResourceviewsResourceVersionDataView(v.LatestVersion) + res.Tags = make([]*resourceviews.TagView, len(v.Tags)) + for i, val := range v.Tags { + res.Tags[i] = unmarshalTagResponseBodyToResourceviewsTagView(val) + } + res.Versions = make([]*resourceviews.ResourceVersionDataView, len(v.Versions)) + for i, val := range v.Versions { + res.Versions[i] = unmarshalResourceVersionDataResponseBodyToResourceviewsResourceVersionDataView(val) + } + + return res +} + +// unmarshalCatalogResponseBodyToResourceviewsCatalogView builds a value of +// type *resourceviews.CatalogView from a value of type *CatalogResponseBody. +func unmarshalCatalogResponseBodyToResourceviewsCatalogView(v *CatalogResponseBody) *resourceviews.CatalogView { + res := &resourceviews.CatalogView{ + ID: v.ID, + Name: v.Name, + Type: v.Type, + } + + return res +} + +// unmarshalResourceVersionDataResponseBodyToResourceviewsResourceVersionDataView +// builds a value of type *resourceviews.ResourceVersionDataView from a value +// of type *ResourceVersionDataResponseBody. +func unmarshalResourceVersionDataResponseBodyToResourceviewsResourceVersionDataView(v *ResourceVersionDataResponseBody) *resourceviews.ResourceVersionDataView { + res := &resourceviews.ResourceVersionDataView{ + ID: v.ID, + Version: v.Version, + DisplayName: v.DisplayName, + Description: v.Description, + MinPipelinesVersion: v.MinPipelinesVersion, + RawURL: v.RawURL, + WebURL: v.WebURL, + UpdatedAt: v.UpdatedAt, + } + res.Resource = unmarshalResourceDataResponseBodyToResourceviewsResourceDataView(v.Resource) + + return res +} + +// unmarshalTagResponseBodyToResourceviewsTagView builds a value of type +// *resourceviews.TagView from a value of type *TagResponseBody. +func unmarshalTagResponseBodyToResourceviewsTagView(v *TagResponseBody) *resourceviews.TagView { + res := &resourceviews.TagView{ + ID: v.ID, + Name: v.Name, + } + + return res +} + +// unmarshalVersionsResponseBodyToResourceviewsVersionsView builds a value of +// type *resourceviews.VersionsView from a value of type *VersionsResponseBody. +func unmarshalVersionsResponseBodyToResourceviewsVersionsView(v *VersionsResponseBody) *resourceviews.VersionsView { + res := &resourceviews.VersionsView{} + res.Latest = unmarshalResourceVersionDataResponseBodyToResourceviewsResourceVersionDataView(v.Latest) + res.Versions = make([]*resourceviews.ResourceVersionDataView, len(v.Versions)) + for i, val := range v.Versions { + res.Versions[i] = unmarshalResourceVersionDataResponseBodyToResourceviewsResourceVersionDataView(val) + } + + return res +} diff --git a/api/v1/gen/http/resource/client/paths.go b/api/v1/gen/http/resource/client/paths.go new file mode 100644 index 0000000000..cf9256f8aa --- /dev/null +++ b/api/v1/gen/http/resource/client/paths.go @@ -0,0 +1,47 @@ +// Code generated by goa v3.2.2, DO NOT EDIT. +// +// HTTP request path constructors for the resource service. +// +// Command: +// $ goa gen github.com/tektoncd/hub/api/v1/design + +package client + +import ( + "fmt" +) + +// QueryResourcePath returns the URL path to the resource service Query HTTP endpoint. +func QueryResourcePath() string { + return "/v1/query" +} + +// ListResourcePath returns the URL path to the resource service List HTTP endpoint. +func ListResourcePath() string { + return "/v1/resources" +} + +// VersionsByIDResourcePath returns the URL path to the resource service VersionsByID HTTP endpoint. +func VersionsByIDResourcePath(id uint) string { + return fmt.Sprintf("/v1/resource/%v/versions", id) +} + +// ByCatalogKindNameVersionResourcePath returns the URL path to the resource service ByCatalogKindNameVersion HTTP endpoint. +func ByCatalogKindNameVersionResourcePath(catalog string, kind string, name string, version string) string { + return fmt.Sprintf("/v1/resource/%v/%v/%v/%v", catalog, kind, name, version) +} + +// ByVersionIDResourcePath returns the URL path to the resource service ByVersionId HTTP endpoint. +func ByVersionIDResourcePath(versionID uint) string { + return fmt.Sprintf("/v1/resource/version/%v", versionID) +} + +// ByCatalogKindNameResourcePath returns the URL path to the resource service ByCatalogKindName HTTP endpoint. +func ByCatalogKindNameResourcePath(catalog string, kind string, name string) string { + return fmt.Sprintf("/v1/resource/%v/%v/%v", catalog, kind, name) +} + +// ByIDResourcePath returns the URL path to the resource service ById HTTP endpoint. +func ByIDResourcePath(id uint) string { + return fmt.Sprintf("/v1/resource/%v", id) +} diff --git a/api/v1/gen/http/resource/client/types.go b/api/v1/gen/http/resource/client/types.go new file mode 100644 index 0000000000..51cc92d487 --- /dev/null +++ b/api/v1/gen/http/resource/client/types.go @@ -0,0 +1,1165 @@ +// Code generated by goa v3.2.2, DO NOT EDIT. +// +// resource HTTP client types +// +// Command: +// $ goa gen github.com/tektoncd/hub/api/v1/design + +package client + +import ( + resourceviews "github.com/tektoncd/hub/api/v1/gen/resource/views" + goa "goa.design/goa/v3/pkg" +) + +// QueryResponseBody is the type of the "resource" service "Query" endpoint +// HTTP response body. +type QueryResponseBody struct { + Data ResourceDataCollectionResponseBody `form:"data,omitempty" json:"data,omitempty" xml:"data,omitempty"` +} + +// ListResponseBody is the type of the "resource" service "List" endpoint HTTP +// response body. +type ListResponseBody struct { + Data ResourceDataCollectionResponseBody `form:"data,omitempty" json:"data,omitempty" xml:"data,omitempty"` +} + +// VersionsByIDResponseBody is the type of the "resource" service +// "VersionsByID" endpoint HTTP response body. +type VersionsByIDResponseBody struct { + Data *VersionsResponseBody `form:"data,omitempty" json:"data,omitempty" xml:"data,omitempty"` +} + +// ByCatalogKindNameVersionResponseBody is the type of the "resource" service +// "ByCatalogKindNameVersion" endpoint HTTP response body. +type ByCatalogKindNameVersionResponseBody struct { + Data *ResourceVersionDataResponseBody `form:"data,omitempty" json:"data,omitempty" xml:"data,omitempty"` +} + +// ByVersionIDResponseBody is the type of the "resource" service "ByVersionId" +// endpoint HTTP response body. +type ByVersionIDResponseBody struct { + Data *ResourceVersionDataResponseBody `form:"data,omitempty" json:"data,omitempty" xml:"data,omitempty"` +} + +// ByCatalogKindNameResponseBody is the type of the "resource" service +// "ByCatalogKindName" endpoint HTTP response body. +type ByCatalogKindNameResponseBody struct { + Data *ResourceDataResponseBody `form:"data,omitempty" json:"data,omitempty" xml:"data,omitempty"` +} + +// ByIDResponseBody is the type of the "resource" service "ById" endpoint HTTP +// response body. +type ByIDResponseBody struct { + Data *ResourceDataResponseBody `form:"data,omitempty" json:"data,omitempty" xml:"data,omitempty"` +} + +// QueryInternalErrorResponseBody is the type of the "resource" service "Query" +// endpoint HTTP response body for the "internal-error" error. +type QueryInternalErrorResponseBody struct { + // Name is the name of this class of errors. + Name *string `form:"name,omitempty" json:"name,omitempty" xml:"name,omitempty"` + // ID is a unique identifier for this particular occurrence of the problem. + ID *string `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"` + // Message is a human-readable explanation specific to this occurrence of the + // problem. + Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"` + // Is the error temporary? + Temporary *bool `form:"temporary,omitempty" json:"temporary,omitempty" xml:"temporary,omitempty"` + // Is the error a timeout? + Timeout *bool `form:"timeout,omitempty" json:"timeout,omitempty" xml:"timeout,omitempty"` + // Is the error a server-side fault? + Fault *bool `form:"fault,omitempty" json:"fault,omitempty" xml:"fault,omitempty"` +} + +// QueryInvalidKindResponseBody is the type of the "resource" service "Query" +// endpoint HTTP response body for the "invalid-kind" error. +type QueryInvalidKindResponseBody struct { + // Name is the name of this class of errors. + Name *string `form:"name,omitempty" json:"name,omitempty" xml:"name,omitempty"` + // ID is a unique identifier for this particular occurrence of the problem. + ID *string `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"` + // Message is a human-readable explanation specific to this occurrence of the + // problem. + Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"` + // Is the error temporary? + Temporary *bool `form:"temporary,omitempty" json:"temporary,omitempty" xml:"temporary,omitempty"` + // Is the error a timeout? + Timeout *bool `form:"timeout,omitempty" json:"timeout,omitempty" xml:"timeout,omitempty"` + // Is the error a server-side fault? + Fault *bool `form:"fault,omitempty" json:"fault,omitempty" xml:"fault,omitempty"` +} + +// QueryNotFoundResponseBody is the type of the "resource" service "Query" +// endpoint HTTP response body for the "not-found" error. +type QueryNotFoundResponseBody struct { + // Name is the name of this class of errors. + Name *string `form:"name,omitempty" json:"name,omitempty" xml:"name,omitempty"` + // ID is a unique identifier for this particular occurrence of the problem. + ID *string `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"` + // Message is a human-readable explanation specific to this occurrence of the + // problem. + Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"` + // Is the error temporary? + Temporary *bool `form:"temporary,omitempty" json:"temporary,omitempty" xml:"temporary,omitempty"` + // Is the error a timeout? + Timeout *bool `form:"timeout,omitempty" json:"timeout,omitempty" xml:"timeout,omitempty"` + // Is the error a server-side fault? + Fault *bool `form:"fault,omitempty" json:"fault,omitempty" xml:"fault,omitempty"` +} + +// ListInternalErrorResponseBody is the type of the "resource" service "List" +// endpoint HTTP response body for the "internal-error" error. +type ListInternalErrorResponseBody struct { + // Name is the name of this class of errors. + Name *string `form:"name,omitempty" json:"name,omitempty" xml:"name,omitempty"` + // ID is a unique identifier for this particular occurrence of the problem. + ID *string `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"` + // Message is a human-readable explanation specific to this occurrence of the + // problem. + Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"` + // Is the error temporary? + Temporary *bool `form:"temporary,omitempty" json:"temporary,omitempty" xml:"temporary,omitempty"` + // Is the error a timeout? + Timeout *bool `form:"timeout,omitempty" json:"timeout,omitempty" xml:"timeout,omitempty"` + // Is the error a server-side fault? + Fault *bool `form:"fault,omitempty" json:"fault,omitempty" xml:"fault,omitempty"` +} + +// VersionsByIDInternalErrorResponseBody is the type of the "resource" service +// "VersionsByID" endpoint HTTP response body for the "internal-error" error. +type VersionsByIDInternalErrorResponseBody struct { + // Name is the name of this class of errors. + Name *string `form:"name,omitempty" json:"name,omitempty" xml:"name,omitempty"` + // ID is a unique identifier for this particular occurrence of the problem. + ID *string `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"` + // Message is a human-readable explanation specific to this occurrence of the + // problem. + Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"` + // Is the error temporary? + Temporary *bool `form:"temporary,omitempty" json:"temporary,omitempty" xml:"temporary,omitempty"` + // Is the error a timeout? + Timeout *bool `form:"timeout,omitempty" json:"timeout,omitempty" xml:"timeout,omitempty"` + // Is the error a server-side fault? + Fault *bool `form:"fault,omitempty" json:"fault,omitempty" xml:"fault,omitempty"` +} + +// VersionsByIDNotFoundResponseBody is the type of the "resource" service +// "VersionsByID" endpoint HTTP response body for the "not-found" error. +type VersionsByIDNotFoundResponseBody struct { + // Name is the name of this class of errors. + Name *string `form:"name,omitempty" json:"name,omitempty" xml:"name,omitempty"` + // ID is a unique identifier for this particular occurrence of the problem. + ID *string `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"` + // Message is a human-readable explanation specific to this occurrence of the + // problem. + Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"` + // Is the error temporary? + Temporary *bool `form:"temporary,omitempty" json:"temporary,omitempty" xml:"temporary,omitempty"` + // Is the error a timeout? + Timeout *bool `form:"timeout,omitempty" json:"timeout,omitempty" xml:"timeout,omitempty"` + // Is the error a server-side fault? + Fault *bool `form:"fault,omitempty" json:"fault,omitempty" xml:"fault,omitempty"` +} + +// ByCatalogKindNameVersionInternalErrorResponseBody is the type of the +// "resource" service "ByCatalogKindNameVersion" endpoint HTTP response body +// for the "internal-error" error. +type ByCatalogKindNameVersionInternalErrorResponseBody struct { + // Name is the name of this class of errors. + Name *string `form:"name,omitempty" json:"name,omitempty" xml:"name,omitempty"` + // ID is a unique identifier for this particular occurrence of the problem. + ID *string `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"` + // Message is a human-readable explanation specific to this occurrence of the + // problem. + Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"` + // Is the error temporary? + Temporary *bool `form:"temporary,omitempty" json:"temporary,omitempty" xml:"temporary,omitempty"` + // Is the error a timeout? + Timeout *bool `form:"timeout,omitempty" json:"timeout,omitempty" xml:"timeout,omitempty"` + // Is the error a server-side fault? + Fault *bool `form:"fault,omitempty" json:"fault,omitempty" xml:"fault,omitempty"` +} + +// ByCatalogKindNameVersionNotFoundResponseBody is the type of the "resource" +// service "ByCatalogKindNameVersion" endpoint HTTP response body for the +// "not-found" error. +type ByCatalogKindNameVersionNotFoundResponseBody struct { + // Name is the name of this class of errors. + Name *string `form:"name,omitempty" json:"name,omitempty" xml:"name,omitempty"` + // ID is a unique identifier for this particular occurrence of the problem. + ID *string `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"` + // Message is a human-readable explanation specific to this occurrence of the + // problem. + Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"` + // Is the error temporary? + Temporary *bool `form:"temporary,omitempty" json:"temporary,omitempty" xml:"temporary,omitempty"` + // Is the error a timeout? + Timeout *bool `form:"timeout,omitempty" json:"timeout,omitempty" xml:"timeout,omitempty"` + // Is the error a server-side fault? + Fault *bool `form:"fault,omitempty" json:"fault,omitempty" xml:"fault,omitempty"` +} + +// ByVersionIDInternalErrorResponseBody is the type of the "resource" service +// "ByVersionId" endpoint HTTP response body for the "internal-error" error. +type ByVersionIDInternalErrorResponseBody struct { + // Name is the name of this class of errors. + Name *string `form:"name,omitempty" json:"name,omitempty" xml:"name,omitempty"` + // ID is a unique identifier for this particular occurrence of the problem. + ID *string `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"` + // Message is a human-readable explanation specific to this occurrence of the + // problem. + Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"` + // Is the error temporary? + Temporary *bool `form:"temporary,omitempty" json:"temporary,omitempty" xml:"temporary,omitempty"` + // Is the error a timeout? + Timeout *bool `form:"timeout,omitempty" json:"timeout,omitempty" xml:"timeout,omitempty"` + // Is the error a server-side fault? + Fault *bool `form:"fault,omitempty" json:"fault,omitempty" xml:"fault,omitempty"` +} + +// ByVersionIDNotFoundResponseBody is the type of the "resource" service +// "ByVersionId" endpoint HTTP response body for the "not-found" error. +type ByVersionIDNotFoundResponseBody struct { + // Name is the name of this class of errors. + Name *string `form:"name,omitempty" json:"name,omitempty" xml:"name,omitempty"` + // ID is a unique identifier for this particular occurrence of the problem. + ID *string `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"` + // Message is a human-readable explanation specific to this occurrence of the + // problem. + Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"` + // Is the error temporary? + Temporary *bool `form:"temporary,omitempty" json:"temporary,omitempty" xml:"temporary,omitempty"` + // Is the error a timeout? + Timeout *bool `form:"timeout,omitempty" json:"timeout,omitempty" xml:"timeout,omitempty"` + // Is the error a server-side fault? + Fault *bool `form:"fault,omitempty" json:"fault,omitempty" xml:"fault,omitempty"` +} + +// ByCatalogKindNameInternalErrorResponseBody is the type of the "resource" +// service "ByCatalogKindName" endpoint HTTP response body for the +// "internal-error" error. +type ByCatalogKindNameInternalErrorResponseBody struct { + // Name is the name of this class of errors. + Name *string `form:"name,omitempty" json:"name,omitempty" xml:"name,omitempty"` + // ID is a unique identifier for this particular occurrence of the problem. + ID *string `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"` + // Message is a human-readable explanation specific to this occurrence of the + // problem. + Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"` + // Is the error temporary? + Temporary *bool `form:"temporary,omitempty" json:"temporary,omitempty" xml:"temporary,omitempty"` + // Is the error a timeout? + Timeout *bool `form:"timeout,omitempty" json:"timeout,omitempty" xml:"timeout,omitempty"` + // Is the error a server-side fault? + Fault *bool `form:"fault,omitempty" json:"fault,omitempty" xml:"fault,omitempty"` +} + +// ByCatalogKindNameNotFoundResponseBody is the type of the "resource" service +// "ByCatalogKindName" endpoint HTTP response body for the "not-found" error. +type ByCatalogKindNameNotFoundResponseBody struct { + // Name is the name of this class of errors. + Name *string `form:"name,omitempty" json:"name,omitempty" xml:"name,omitempty"` + // ID is a unique identifier for this particular occurrence of the problem. + ID *string `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"` + // Message is a human-readable explanation specific to this occurrence of the + // problem. + Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"` + // Is the error temporary? + Temporary *bool `form:"temporary,omitempty" json:"temporary,omitempty" xml:"temporary,omitempty"` + // Is the error a timeout? + Timeout *bool `form:"timeout,omitempty" json:"timeout,omitempty" xml:"timeout,omitempty"` + // Is the error a server-side fault? + Fault *bool `form:"fault,omitempty" json:"fault,omitempty" xml:"fault,omitempty"` +} + +// ByIDInternalErrorResponseBody is the type of the "resource" service "ById" +// endpoint HTTP response body for the "internal-error" error. +type ByIDInternalErrorResponseBody struct { + // Name is the name of this class of errors. + Name *string `form:"name,omitempty" json:"name,omitempty" xml:"name,omitempty"` + // ID is a unique identifier for this particular occurrence of the problem. + ID *string `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"` + // Message is a human-readable explanation specific to this occurrence of the + // problem. + Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"` + // Is the error temporary? + Temporary *bool `form:"temporary,omitempty" json:"temporary,omitempty" xml:"temporary,omitempty"` + // Is the error a timeout? + Timeout *bool `form:"timeout,omitempty" json:"timeout,omitempty" xml:"timeout,omitempty"` + // Is the error a server-side fault? + Fault *bool `form:"fault,omitempty" json:"fault,omitempty" xml:"fault,omitempty"` +} + +// ByIDNotFoundResponseBody is the type of the "resource" service "ById" +// endpoint HTTP response body for the "not-found" error. +type ByIDNotFoundResponseBody struct { + // Name is the name of this class of errors. + Name *string `form:"name,omitempty" json:"name,omitempty" xml:"name,omitempty"` + // ID is a unique identifier for this particular occurrence of the problem. + ID *string `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"` + // Message is a human-readable explanation specific to this occurrence of the + // problem. + Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"` + // Is the error temporary? + Temporary *bool `form:"temporary,omitempty" json:"temporary,omitempty" xml:"temporary,omitempty"` + // Is the error a timeout? + Timeout *bool `form:"timeout,omitempty" json:"timeout,omitempty" xml:"timeout,omitempty"` + // Is the error a server-side fault? + Fault *bool `form:"fault,omitempty" json:"fault,omitempty" xml:"fault,omitempty"` +} + +// ResourceDataCollectionResponseBody is used to define fields on response body +// types. +type ResourceDataCollectionResponseBody []*ResourceDataResponseBody + +// ResourceDataResponseBody is used to define fields on response body types. +type ResourceDataResponseBody struct { + // ID is the unique id of the resource + ID *uint `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"` + // Name of resource + Name *string `form:"name,omitempty" json:"name,omitempty" xml:"name,omitempty"` + // Type of catalog to which resource belongs + Catalog *CatalogResponseBody `form:"catalog,omitempty" json:"catalog,omitempty" xml:"catalog,omitempty"` + // Kind of resource + Kind *string `form:"kind,omitempty" json:"kind,omitempty" xml:"kind,omitempty"` + // Latest version of resource + LatestVersion *ResourceVersionDataResponseBody `form:"latestVersion,omitempty" json:"latestVersion,omitempty" xml:"latestVersion,omitempty"` + // Tags related to resource + Tags []*TagResponseBody `form:"tags,omitempty" json:"tags,omitempty" xml:"tags,omitempty"` + // Rating of resource + Rating *float64 `form:"rating,omitempty" json:"rating,omitempty" xml:"rating,omitempty"` + // List of all versions of a resource + Versions []*ResourceVersionDataResponseBody `form:"versions,omitempty" json:"versions,omitempty" xml:"versions,omitempty"` +} + +// CatalogResponseBody is used to define fields on response body types. +type CatalogResponseBody struct { + // ID is the unique id of the catalog + ID *uint `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"` + // Name of catalog + Name *string `form:"name,omitempty" json:"name,omitempty" xml:"name,omitempty"` + // Type of catalog + Type *string `form:"type,omitempty" json:"type,omitempty" xml:"type,omitempty"` +} + +// ResourceVersionDataResponseBody is used to define fields on response body +// types. +type ResourceVersionDataResponseBody struct { + // ID is the unique id of resource's version + ID *uint `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"` + // Version of resource + Version *string `form:"version,omitempty" json:"version,omitempty" xml:"version,omitempty"` + // Display name of version + DisplayName *string `form:"displayName,omitempty" json:"displayName,omitempty" xml:"displayName,omitempty"` + // Description of version + Description *string `form:"description,omitempty" json:"description,omitempty" xml:"description,omitempty"` + // Minimum pipelines version the resource's version is compatible with + MinPipelinesVersion *string `form:"minPipelinesVersion,omitempty" json:"minPipelinesVersion,omitempty" xml:"minPipelinesVersion,omitempty"` + // Raw URL of resource's yaml file of the version + RawURL *string `form:"rawURL,omitempty" json:"rawURL,omitempty" xml:"rawURL,omitempty"` + // Web URL of resource's yaml file of the version + WebURL *string `form:"webURL,omitempty" json:"webURL,omitempty" xml:"webURL,omitempty"` + // Timestamp when version was last updated + UpdatedAt *string `form:"updatedAt,omitempty" json:"updatedAt,omitempty" xml:"updatedAt,omitempty"` + // Resource to which the version belongs + Resource *ResourceDataResponseBody `form:"resource,omitempty" json:"resource,omitempty" xml:"resource,omitempty"` +} + +// TagResponseBody is used to define fields on response body types. +type TagResponseBody struct { + // ID is the unique id of tag + ID *uint `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"` + // Name of tag + Name *string `form:"name,omitempty" json:"name,omitempty" xml:"name,omitempty"` +} + +// VersionsResponseBody is used to define fields on response body types. +type VersionsResponseBody struct { + // Latest Version of resource + Latest *ResourceVersionDataResponseBody `form:"latest,omitempty" json:"latest,omitempty" xml:"latest,omitempty"` + // List of all versions of resource + Versions []*ResourceVersionDataResponseBody `form:"versions,omitempty" json:"versions,omitempty" xml:"versions,omitempty"` +} + +// NewQueryResourcesOK builds a "resource" service "Query" endpoint result from +// a HTTP "OK" response. +func NewQueryResourcesOK(body *QueryResponseBody) *resourceviews.ResourcesView { + v := &resourceviews.ResourcesView{} + v.Data = make([]*resourceviews.ResourceDataView, len(body.Data)) + for i, val := range body.Data { + v.Data[i] = unmarshalResourceDataResponseBodyToResourceviewsResourceDataView(val) + } + + return v +} + +// NewQueryInternalError builds a resource service Query endpoint +// internal-error error. +func NewQueryInternalError(body *QueryInternalErrorResponseBody) *goa.ServiceError { + v := &goa.ServiceError{ + Name: *body.Name, + ID: *body.ID, + Message: *body.Message, + Temporary: *body.Temporary, + Timeout: *body.Timeout, + Fault: *body.Fault, + } + + return v +} + +// NewQueryInvalidKind builds a resource service Query endpoint invalid-kind +// error. +func NewQueryInvalidKind(body *QueryInvalidKindResponseBody) *goa.ServiceError { + v := &goa.ServiceError{ + Name: *body.Name, + ID: *body.ID, + Message: *body.Message, + Temporary: *body.Temporary, + Timeout: *body.Timeout, + Fault: *body.Fault, + } + + return v +} + +// NewQueryNotFound builds a resource service Query endpoint not-found error. +func NewQueryNotFound(body *QueryNotFoundResponseBody) *goa.ServiceError { + v := &goa.ServiceError{ + Name: *body.Name, + ID: *body.ID, + Message: *body.Message, + Temporary: *body.Temporary, + Timeout: *body.Timeout, + Fault: *body.Fault, + } + + return v +} + +// NewListResourcesOK builds a "resource" service "List" endpoint result from a +// HTTP "OK" response. +func NewListResourcesOK(body *ListResponseBody) *resourceviews.ResourcesView { + v := &resourceviews.ResourcesView{} + v.Data = make([]*resourceviews.ResourceDataView, len(body.Data)) + for i, val := range body.Data { + v.Data[i] = unmarshalResourceDataResponseBodyToResourceviewsResourceDataView(val) + } + + return v +} + +// NewListInternalError builds a resource service List endpoint internal-error +// error. +func NewListInternalError(body *ListInternalErrorResponseBody) *goa.ServiceError { + v := &goa.ServiceError{ + Name: *body.Name, + ID: *body.ID, + Message: *body.Message, + Temporary: *body.Temporary, + Timeout: *body.Timeout, + Fault: *body.Fault, + } + + return v +} + +// NewVersionsByIDResourceVersionsOK builds a "resource" service "VersionsByID" +// endpoint result from a HTTP "OK" response. +func NewVersionsByIDResourceVersionsOK(body *VersionsByIDResponseBody) *resourceviews.ResourceVersionsView { + v := &resourceviews.ResourceVersionsView{} + v.Data = unmarshalVersionsResponseBodyToResourceviewsVersionsView(body.Data) + + return v +} + +// NewVersionsByIDInternalError builds a resource service VersionsByID endpoint +// internal-error error. +func NewVersionsByIDInternalError(body *VersionsByIDInternalErrorResponseBody) *goa.ServiceError { + v := &goa.ServiceError{ + Name: *body.Name, + ID: *body.ID, + Message: *body.Message, + Temporary: *body.Temporary, + Timeout: *body.Timeout, + Fault: *body.Fault, + } + + return v +} + +// NewVersionsByIDNotFound builds a resource service VersionsByID endpoint +// not-found error. +func NewVersionsByIDNotFound(body *VersionsByIDNotFoundResponseBody) *goa.ServiceError { + v := &goa.ServiceError{ + Name: *body.Name, + ID: *body.ID, + Message: *body.Message, + Temporary: *body.Temporary, + Timeout: *body.Timeout, + Fault: *body.Fault, + } + + return v +} + +// NewByCatalogKindNameVersionResourceVersionOK builds a "resource" service +// "ByCatalogKindNameVersion" endpoint result from a HTTP "OK" response. +func NewByCatalogKindNameVersionResourceVersionOK(body *ByCatalogKindNameVersionResponseBody) *resourceviews.ResourceVersionView { + v := &resourceviews.ResourceVersionView{} + v.Data = unmarshalResourceVersionDataResponseBodyToResourceviewsResourceVersionDataView(body.Data) + + return v +} + +// NewByCatalogKindNameVersionInternalError builds a resource service +// ByCatalogKindNameVersion endpoint internal-error error. +func NewByCatalogKindNameVersionInternalError(body *ByCatalogKindNameVersionInternalErrorResponseBody) *goa.ServiceError { + v := &goa.ServiceError{ + Name: *body.Name, + ID: *body.ID, + Message: *body.Message, + Temporary: *body.Temporary, + Timeout: *body.Timeout, + Fault: *body.Fault, + } + + return v +} + +// NewByCatalogKindNameVersionNotFound builds a resource service +// ByCatalogKindNameVersion endpoint not-found error. +func NewByCatalogKindNameVersionNotFound(body *ByCatalogKindNameVersionNotFoundResponseBody) *goa.ServiceError { + v := &goa.ServiceError{ + Name: *body.Name, + ID: *body.ID, + Message: *body.Message, + Temporary: *body.Temporary, + Timeout: *body.Timeout, + Fault: *body.Fault, + } + + return v +} + +// NewByVersionIDResourceVersionOK builds a "resource" service "ByVersionId" +// endpoint result from a HTTP "OK" response. +func NewByVersionIDResourceVersionOK(body *ByVersionIDResponseBody) *resourceviews.ResourceVersionView { + v := &resourceviews.ResourceVersionView{} + v.Data = unmarshalResourceVersionDataResponseBodyToResourceviewsResourceVersionDataView(body.Data) + + return v +} + +// NewByVersionIDInternalError builds a resource service ByVersionId endpoint +// internal-error error. +func NewByVersionIDInternalError(body *ByVersionIDInternalErrorResponseBody) *goa.ServiceError { + v := &goa.ServiceError{ + Name: *body.Name, + ID: *body.ID, + Message: *body.Message, + Temporary: *body.Temporary, + Timeout: *body.Timeout, + Fault: *body.Fault, + } + + return v +} + +// NewByVersionIDNotFound builds a resource service ByVersionId endpoint +// not-found error. +func NewByVersionIDNotFound(body *ByVersionIDNotFoundResponseBody) *goa.ServiceError { + v := &goa.ServiceError{ + Name: *body.Name, + ID: *body.ID, + Message: *body.Message, + Temporary: *body.Temporary, + Timeout: *body.Timeout, + Fault: *body.Fault, + } + + return v +} + +// NewByCatalogKindNameResourceOK builds a "resource" service +// "ByCatalogKindName" endpoint result from a HTTP "OK" response. +func NewByCatalogKindNameResourceOK(body *ByCatalogKindNameResponseBody) *resourceviews.ResourceView { + v := &resourceviews.ResourceView{} + v.Data = unmarshalResourceDataResponseBodyToResourceviewsResourceDataView(body.Data) + + return v +} + +// NewByCatalogKindNameInternalError builds a resource service +// ByCatalogKindName endpoint internal-error error. +func NewByCatalogKindNameInternalError(body *ByCatalogKindNameInternalErrorResponseBody) *goa.ServiceError { + v := &goa.ServiceError{ + Name: *body.Name, + ID: *body.ID, + Message: *body.Message, + Temporary: *body.Temporary, + Timeout: *body.Timeout, + Fault: *body.Fault, + } + + return v +} + +// NewByCatalogKindNameNotFound builds a resource service ByCatalogKindName +// endpoint not-found error. +func NewByCatalogKindNameNotFound(body *ByCatalogKindNameNotFoundResponseBody) *goa.ServiceError { + v := &goa.ServiceError{ + Name: *body.Name, + ID: *body.ID, + Message: *body.Message, + Temporary: *body.Temporary, + Timeout: *body.Timeout, + Fault: *body.Fault, + } + + return v +} + +// NewByIDResourceOK builds a "resource" service "ById" endpoint result from a +// HTTP "OK" response. +func NewByIDResourceOK(body *ByIDResponseBody) *resourceviews.ResourceView { + v := &resourceviews.ResourceView{} + v.Data = unmarshalResourceDataResponseBodyToResourceviewsResourceDataView(body.Data) + + return v +} + +// NewByIDInternalError builds a resource service ById endpoint internal-error +// error. +func NewByIDInternalError(body *ByIDInternalErrorResponseBody) *goa.ServiceError { + v := &goa.ServiceError{ + Name: *body.Name, + ID: *body.ID, + Message: *body.Message, + Temporary: *body.Temporary, + Timeout: *body.Timeout, + Fault: *body.Fault, + } + + return v +} + +// NewByIDNotFound builds a resource service ById endpoint not-found error. +func NewByIDNotFound(body *ByIDNotFoundResponseBody) *goa.ServiceError { + v := &goa.ServiceError{ + Name: *body.Name, + ID: *body.ID, + Message: *body.Message, + Temporary: *body.Temporary, + Timeout: *body.Timeout, + Fault: *body.Fault, + } + + return v +} + +// ValidateQueryInternalErrorResponseBody runs the validations defined on +// Query_internal-error_Response_Body +func ValidateQueryInternalErrorResponseBody(body *QueryInternalErrorResponseBody) (err error) { + if body.Name == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("name", "body")) + } + if body.ID == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("id", "body")) + } + if body.Message == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("message", "body")) + } + if body.Temporary == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("temporary", "body")) + } + if body.Timeout == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("timeout", "body")) + } + if body.Fault == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("fault", "body")) + } + return +} + +// ValidateQueryInvalidKindResponseBody runs the validations defined on +// Query_invalid-kind_Response_Body +func ValidateQueryInvalidKindResponseBody(body *QueryInvalidKindResponseBody) (err error) { + if body.Name == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("name", "body")) + } + if body.ID == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("id", "body")) + } + if body.Message == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("message", "body")) + } + if body.Temporary == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("temporary", "body")) + } + if body.Timeout == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("timeout", "body")) + } + if body.Fault == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("fault", "body")) + } + return +} + +// ValidateQueryNotFoundResponseBody runs the validations defined on +// Query_not-found_Response_Body +func ValidateQueryNotFoundResponseBody(body *QueryNotFoundResponseBody) (err error) { + if body.Name == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("name", "body")) + } + if body.ID == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("id", "body")) + } + if body.Message == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("message", "body")) + } + if body.Temporary == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("temporary", "body")) + } + if body.Timeout == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("timeout", "body")) + } + if body.Fault == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("fault", "body")) + } + return +} + +// ValidateListInternalErrorResponseBody runs the validations defined on +// List_internal-error_Response_Body +func ValidateListInternalErrorResponseBody(body *ListInternalErrorResponseBody) (err error) { + if body.Name == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("name", "body")) + } + if body.ID == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("id", "body")) + } + if body.Message == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("message", "body")) + } + if body.Temporary == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("temporary", "body")) + } + if body.Timeout == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("timeout", "body")) + } + if body.Fault == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("fault", "body")) + } + return +} + +// ValidateVersionsByIDInternalErrorResponseBody runs the validations defined +// on VersionsByID_internal-error_Response_Body +func ValidateVersionsByIDInternalErrorResponseBody(body *VersionsByIDInternalErrorResponseBody) (err error) { + if body.Name == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("name", "body")) + } + if body.ID == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("id", "body")) + } + if body.Message == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("message", "body")) + } + if body.Temporary == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("temporary", "body")) + } + if body.Timeout == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("timeout", "body")) + } + if body.Fault == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("fault", "body")) + } + return +} + +// ValidateVersionsByIDNotFoundResponseBody runs the validations defined on +// VersionsByID_not-found_Response_Body +func ValidateVersionsByIDNotFoundResponseBody(body *VersionsByIDNotFoundResponseBody) (err error) { + if body.Name == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("name", "body")) + } + if body.ID == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("id", "body")) + } + if body.Message == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("message", "body")) + } + if body.Temporary == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("temporary", "body")) + } + if body.Timeout == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("timeout", "body")) + } + if body.Fault == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("fault", "body")) + } + return +} + +// ValidateByCatalogKindNameVersionInternalErrorResponseBody runs the +// validations defined on ByCatalogKindNameVersion_internal-error_Response_Body +func ValidateByCatalogKindNameVersionInternalErrorResponseBody(body *ByCatalogKindNameVersionInternalErrorResponseBody) (err error) { + if body.Name == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("name", "body")) + } + if body.ID == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("id", "body")) + } + if body.Message == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("message", "body")) + } + if body.Temporary == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("temporary", "body")) + } + if body.Timeout == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("timeout", "body")) + } + if body.Fault == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("fault", "body")) + } + return +} + +// ValidateByCatalogKindNameVersionNotFoundResponseBody runs the validations +// defined on ByCatalogKindNameVersion_not-found_Response_Body +func ValidateByCatalogKindNameVersionNotFoundResponseBody(body *ByCatalogKindNameVersionNotFoundResponseBody) (err error) { + if body.Name == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("name", "body")) + } + if body.ID == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("id", "body")) + } + if body.Message == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("message", "body")) + } + if body.Temporary == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("temporary", "body")) + } + if body.Timeout == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("timeout", "body")) + } + if body.Fault == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("fault", "body")) + } + return +} + +// ValidateByVersionIDInternalErrorResponseBody runs the validations defined on +// ByVersionId_internal-error_Response_Body +func ValidateByVersionIDInternalErrorResponseBody(body *ByVersionIDInternalErrorResponseBody) (err error) { + if body.Name == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("name", "body")) + } + if body.ID == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("id", "body")) + } + if body.Message == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("message", "body")) + } + if body.Temporary == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("temporary", "body")) + } + if body.Timeout == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("timeout", "body")) + } + if body.Fault == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("fault", "body")) + } + return +} + +// ValidateByVersionIDNotFoundResponseBody runs the validations defined on +// ByVersionId_not-found_Response_Body +func ValidateByVersionIDNotFoundResponseBody(body *ByVersionIDNotFoundResponseBody) (err error) { + if body.Name == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("name", "body")) + } + if body.ID == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("id", "body")) + } + if body.Message == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("message", "body")) + } + if body.Temporary == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("temporary", "body")) + } + if body.Timeout == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("timeout", "body")) + } + if body.Fault == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("fault", "body")) + } + return +} + +// ValidateByCatalogKindNameInternalErrorResponseBody runs the validations +// defined on ByCatalogKindName_internal-error_Response_Body +func ValidateByCatalogKindNameInternalErrorResponseBody(body *ByCatalogKindNameInternalErrorResponseBody) (err error) { + if body.Name == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("name", "body")) + } + if body.ID == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("id", "body")) + } + if body.Message == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("message", "body")) + } + if body.Temporary == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("temporary", "body")) + } + if body.Timeout == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("timeout", "body")) + } + if body.Fault == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("fault", "body")) + } + return +} + +// ValidateByCatalogKindNameNotFoundResponseBody runs the validations defined +// on ByCatalogKindName_not-found_Response_Body +func ValidateByCatalogKindNameNotFoundResponseBody(body *ByCatalogKindNameNotFoundResponseBody) (err error) { + if body.Name == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("name", "body")) + } + if body.ID == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("id", "body")) + } + if body.Message == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("message", "body")) + } + if body.Temporary == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("temporary", "body")) + } + if body.Timeout == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("timeout", "body")) + } + if body.Fault == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("fault", "body")) + } + return +} + +// ValidateByIDInternalErrorResponseBody runs the validations defined on +// ById_internal-error_Response_Body +func ValidateByIDInternalErrorResponseBody(body *ByIDInternalErrorResponseBody) (err error) { + if body.Name == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("name", "body")) + } + if body.ID == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("id", "body")) + } + if body.Message == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("message", "body")) + } + if body.Temporary == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("temporary", "body")) + } + if body.Timeout == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("timeout", "body")) + } + if body.Fault == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("fault", "body")) + } + return +} + +// ValidateByIDNotFoundResponseBody runs the validations defined on +// ById_not-found_Response_Body +func ValidateByIDNotFoundResponseBody(body *ByIDNotFoundResponseBody) (err error) { + if body.Name == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("name", "body")) + } + if body.ID == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("id", "body")) + } + if body.Message == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("message", "body")) + } + if body.Temporary == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("temporary", "body")) + } + if body.Timeout == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("timeout", "body")) + } + if body.Fault == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("fault", "body")) + } + return +} + +// ValidateResourceDataCollectionResponseBody runs the validations defined on +// ResourceDataCollectionResponseBody +func ValidateResourceDataCollectionResponseBody(body ResourceDataCollectionResponseBody) (err error) { + for _, e := range body { + if e != nil { + if err2 := ValidateResourceDataResponseBody(e); err2 != nil { + err = goa.MergeErrors(err, err2) + } + } + } + return +} + +// ValidateResourceDataResponseBody runs the validations defined on +// ResourceDataResponseBody +func ValidateResourceDataResponseBody(body *ResourceDataResponseBody) (err error) { + if body.ID == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("id", "body")) + } + if body.Name == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("name", "body")) + } + if body.Catalog == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("catalog", "body")) + } + if body.Kind == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("kind", "body")) + } + if body.LatestVersion == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("latestVersion", "body")) + } + if body.Tags == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("tags", "body")) + } + if body.Rating == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("rating", "body")) + } + if body.Versions == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("versions", "body")) + } + if body.Catalog != nil { + if err2 := ValidateCatalogResponseBody(body.Catalog); err2 != nil { + err = goa.MergeErrors(err, err2) + } + } + if body.LatestVersion != nil { + if err2 := ValidateResourceVersionDataResponseBody(body.LatestVersion); err2 != nil { + err = goa.MergeErrors(err, err2) + } + } + for _, e := range body.Tags { + if e != nil { + if err2 := ValidateTagResponseBody(e); err2 != nil { + err = goa.MergeErrors(err, err2) + } + } + } + for _, e := range body.Versions { + if e != nil { + if err2 := ValidateResourceVersionDataResponseBody(e); err2 != nil { + err = goa.MergeErrors(err, err2) + } + } + } + return +} + +// ValidateCatalogResponseBody runs the validations defined on +// CatalogResponseBody +func ValidateCatalogResponseBody(body *CatalogResponseBody) (err error) { + if body.ID == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("id", "body")) + } + if body.Name == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("name", "body")) + } + if body.Type == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("type", "body")) + } + if body.Type != nil { + if !(*body.Type == "official" || *body.Type == "community") { + err = goa.MergeErrors(err, goa.InvalidEnumValueError("body.type", *body.Type, []interface{}{"official", "community"})) + } + } + return +} + +// ValidateResourceVersionDataResponseBody runs the validations defined on +// ResourceVersionDataResponseBody +func ValidateResourceVersionDataResponseBody(body *ResourceVersionDataResponseBody) (err error) { + if body.ID == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("id", "body")) + } + if body.Version == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("version", "body")) + } + if body.DisplayName == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("displayName", "body")) + } + if body.Description == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("description", "body")) + } + if body.MinPipelinesVersion == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("minPipelinesVersion", "body")) + } + if body.RawURL == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("rawURL", "body")) + } + if body.WebURL == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("webURL", "body")) + } + if body.UpdatedAt == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("updatedAt", "body")) + } + if body.Resource == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("resource", "body")) + } + if body.RawURL != nil { + err = goa.MergeErrors(err, goa.ValidateFormat("body.rawURL", *body.RawURL, goa.FormatURI)) + } + if body.WebURL != nil { + err = goa.MergeErrors(err, goa.ValidateFormat("body.webURL", *body.WebURL, goa.FormatURI)) + } + if body.UpdatedAt != nil { + err = goa.MergeErrors(err, goa.ValidateFormat("body.updatedAt", *body.UpdatedAt, goa.FormatDateTime)) + } + if body.Resource != nil { + if err2 := ValidateResourceDataResponseBody(body.Resource); err2 != nil { + err = goa.MergeErrors(err, err2) + } + } + return +} + +// ValidateTagResponseBody runs the validations defined on TagResponseBody +func ValidateTagResponseBody(body *TagResponseBody) (err error) { + if body.ID == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("id", "body")) + } + if body.Name == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("name", "body")) + } + return +} + +// ValidateVersionsResponseBody runs the validations defined on +// VersionsResponseBody +func ValidateVersionsResponseBody(body *VersionsResponseBody) (err error) { + if body.Latest == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("latest", "body")) + } + if body.Versions == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("versions", "body")) + } + if body.Latest != nil { + if err2 := ValidateResourceVersionDataResponseBody(body.Latest); err2 != nil { + err = goa.MergeErrors(err, err2) + } + } + for _, e := range body.Versions { + if e != nil { + if err2 := ValidateResourceVersionDataResponseBody(e); err2 != nil { + err = goa.MergeErrors(err, err2) + } + } + } + return +} diff --git a/api/v1/gen/http/resource/server/encode_decode.go b/api/v1/gen/http/resource/server/encode_decode.go new file mode 100644 index 0000000000..ab63442d57 --- /dev/null +++ b/api/v1/gen/http/resource/server/encode_decode.go @@ -0,0 +1,782 @@ +// Code generated by goa v3.2.2, DO NOT EDIT. +// +// resource HTTP server encoders and decoders +// +// Command: +// $ goa gen github.com/tektoncd/hub/api/v1/design + +package server + +import ( + "context" + "net/http" + "strconv" + + resourceviews "github.com/tektoncd/hub/api/v1/gen/resource/views" + goahttp "goa.design/goa/v3/http" + goa "goa.design/goa/v3/pkg" +) + +// EncodeQueryResponse returns an encoder for responses returned by the +// resource Query endpoint. +func EncodeQueryResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error { + return func(ctx context.Context, w http.ResponseWriter, v interface{}) error { + res := v.(*resourceviews.Resources) + enc := encoder(ctx, w) + body := NewQueryResponseBody(res.Projected) + w.WriteHeader(http.StatusOK) + return enc.Encode(body) + } +} + +// DecodeQueryRequest returns a decoder for requests sent to the resource Query +// endpoint. +func DecodeQueryRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) { + return func(r *http.Request) (interface{}, error) { + var ( + name string + kinds []string + tags []string + limit uint + match string + err error + ) + nameRaw := r.URL.Query().Get("name") + if nameRaw != "" { + name = nameRaw + } + kinds = r.URL.Query()["kinds"] + tags = r.URL.Query()["tags"] + { + limitRaw := r.URL.Query().Get("limit") + if limitRaw == "" { + limit = 1000 + } else { + v, err2 := strconv.ParseUint(limitRaw, 10, strconv.IntSize) + if err2 != nil { + err = goa.MergeErrors(err, goa.InvalidFieldTypeError("limit", limitRaw, "unsigned integer")) + } + limit = uint(v) + } + } + matchRaw := r.URL.Query().Get("match") + if matchRaw != "" { + match = matchRaw + } else { + match = "contains" + } + if !(match == "exact" || match == "contains") { + err = goa.MergeErrors(err, goa.InvalidEnumValueError("match", match, []interface{}{"exact", "contains"})) + } + if err != nil { + return nil, err + } + payload := NewQueryPayload(name, kinds, tags, limit, match) + + return payload, nil + } +} + +// EncodeQueryError returns an encoder for errors returned by the Query +// resource endpoint. +func EncodeQueryError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, formatter func(err error) goahttp.Statuser) func(context.Context, http.ResponseWriter, error) error { + encodeError := goahttp.ErrorEncoder(encoder, formatter) + return func(ctx context.Context, w http.ResponseWriter, v error) error { + en, ok := v.(ErrorNamer) + if !ok { + return encodeError(ctx, w, v) + } + switch en.ErrorName() { + case "internal-error": + res := v.(*goa.ServiceError) + enc := encoder(ctx, w) + var body interface{} + if formatter != nil { + body = formatter(res) + } else { + body = NewQueryInternalErrorResponseBody(res) + } + w.Header().Set("goa-error", "internal-error") + w.WriteHeader(http.StatusInternalServerError) + return enc.Encode(body) + case "invalid-kind": + res := v.(*goa.ServiceError) + enc := encoder(ctx, w) + var body interface{} + if formatter != nil { + body = formatter(res) + } else { + body = NewQueryInvalidKindResponseBody(res) + } + w.Header().Set("goa-error", "invalid-kind") + w.WriteHeader(http.StatusBadRequest) + return enc.Encode(body) + case "not-found": + res := v.(*goa.ServiceError) + enc := encoder(ctx, w) + var body interface{} + if formatter != nil { + body = formatter(res) + } else { + body = NewQueryNotFoundResponseBody(res) + } + w.Header().Set("goa-error", "not-found") + w.WriteHeader(http.StatusNotFound) + return enc.Encode(body) + default: + return encodeError(ctx, w, v) + } + } +} + +// EncodeListResponse returns an encoder for responses returned by the resource +// List endpoint. +func EncodeListResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error { + return func(ctx context.Context, w http.ResponseWriter, v interface{}) error { + res := v.(*resourceviews.Resources) + enc := encoder(ctx, w) + body := NewListResponseBody(res.Projected) + w.WriteHeader(http.StatusOK) + return enc.Encode(body) + } +} + +// DecodeListRequest returns a decoder for requests sent to the resource List +// endpoint. +func DecodeListRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) { + return func(r *http.Request) (interface{}, error) { + var ( + limit uint + err error + ) + { + limitRaw := r.URL.Query().Get("limit") + if limitRaw == "" { + limit = 1000 + } else { + v, err2 := strconv.ParseUint(limitRaw, 10, strconv.IntSize) + if err2 != nil { + err = goa.MergeErrors(err, goa.InvalidFieldTypeError("limit", limitRaw, "unsigned integer")) + } + limit = uint(v) + } + } + if err != nil { + return nil, err + } + payload := NewListPayload(limit) + + return payload, nil + } +} + +// EncodeListError returns an encoder for errors returned by the List resource +// endpoint. +func EncodeListError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, formatter func(err error) goahttp.Statuser) func(context.Context, http.ResponseWriter, error) error { + encodeError := goahttp.ErrorEncoder(encoder, formatter) + return func(ctx context.Context, w http.ResponseWriter, v error) error { + en, ok := v.(ErrorNamer) + if !ok { + return encodeError(ctx, w, v) + } + switch en.ErrorName() { + case "internal-error": + res := v.(*goa.ServiceError) + enc := encoder(ctx, w) + var body interface{} + if formatter != nil { + body = formatter(res) + } else { + body = NewListInternalErrorResponseBody(res) + } + w.Header().Set("goa-error", "internal-error") + w.WriteHeader(http.StatusInternalServerError) + return enc.Encode(body) + default: + return encodeError(ctx, w, v) + } + } +} + +// EncodeVersionsByIDResponse returns an encoder for responses returned by the +// resource VersionsByID endpoint. +func EncodeVersionsByIDResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error { + return func(ctx context.Context, w http.ResponseWriter, v interface{}) error { + res := v.(*resourceviews.ResourceVersions) + enc := encoder(ctx, w) + body := NewVersionsByIDResponseBody(res.Projected) + w.WriteHeader(http.StatusOK) + return enc.Encode(body) + } +} + +// DecodeVersionsByIDRequest returns a decoder for requests sent to the +// resource VersionsByID endpoint. +func DecodeVersionsByIDRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) { + return func(r *http.Request) (interface{}, error) { + var ( + id uint + err error + + params = mux.Vars(r) + ) + { + idRaw := params["id"] + v, err2 := strconv.ParseUint(idRaw, 10, strconv.IntSize) + if err2 != nil { + err = goa.MergeErrors(err, goa.InvalidFieldTypeError("id", idRaw, "unsigned integer")) + } + id = uint(v) + } + if err != nil { + return nil, err + } + payload := NewVersionsByIDPayload(id) + + return payload, nil + } +} + +// EncodeVersionsByIDError returns an encoder for errors returned by the +// VersionsByID resource endpoint. +func EncodeVersionsByIDError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, formatter func(err error) goahttp.Statuser) func(context.Context, http.ResponseWriter, error) error { + encodeError := goahttp.ErrorEncoder(encoder, formatter) + return func(ctx context.Context, w http.ResponseWriter, v error) error { + en, ok := v.(ErrorNamer) + if !ok { + return encodeError(ctx, w, v) + } + switch en.ErrorName() { + case "internal-error": + res := v.(*goa.ServiceError) + enc := encoder(ctx, w) + var body interface{} + if formatter != nil { + body = formatter(res) + } else { + body = NewVersionsByIDInternalErrorResponseBody(res) + } + w.Header().Set("goa-error", "internal-error") + w.WriteHeader(http.StatusInternalServerError) + return enc.Encode(body) + case "not-found": + res := v.(*goa.ServiceError) + enc := encoder(ctx, w) + var body interface{} + if formatter != nil { + body = formatter(res) + } else { + body = NewVersionsByIDNotFoundResponseBody(res) + } + w.Header().Set("goa-error", "not-found") + w.WriteHeader(http.StatusNotFound) + return enc.Encode(body) + default: + return encodeError(ctx, w, v) + } + } +} + +// EncodeByCatalogKindNameVersionResponse returns an encoder for responses +// returned by the resource ByCatalogKindNameVersion endpoint. +func EncodeByCatalogKindNameVersionResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error { + return func(ctx context.Context, w http.ResponseWriter, v interface{}) error { + res := v.(*resourceviews.ResourceVersion) + enc := encoder(ctx, w) + body := NewByCatalogKindNameVersionResponseBody(res.Projected) + w.WriteHeader(http.StatusOK) + return enc.Encode(body) + } +} + +// DecodeByCatalogKindNameVersionRequest returns a decoder for requests sent to +// the resource ByCatalogKindNameVersion endpoint. +func DecodeByCatalogKindNameVersionRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) { + return func(r *http.Request) (interface{}, error) { + var ( + catalog string + kind string + name string + version string + err error + + params = mux.Vars(r) + ) + catalog = params["catalog"] + kind = params["kind"] + if !(kind == "task" || kind == "pipeline") { + err = goa.MergeErrors(err, goa.InvalidEnumValueError("kind", kind, []interface{}{"task", "pipeline"})) + } + name = params["name"] + version = params["version"] + if err != nil { + return nil, err + } + payload := NewByCatalogKindNameVersionPayload(catalog, kind, name, version) + + return payload, nil + } +} + +// EncodeByCatalogKindNameVersionError returns an encoder for errors returned +// by the ByCatalogKindNameVersion resource endpoint. +func EncodeByCatalogKindNameVersionError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, formatter func(err error) goahttp.Statuser) func(context.Context, http.ResponseWriter, error) error { + encodeError := goahttp.ErrorEncoder(encoder, formatter) + return func(ctx context.Context, w http.ResponseWriter, v error) error { + en, ok := v.(ErrorNamer) + if !ok { + return encodeError(ctx, w, v) + } + switch en.ErrorName() { + case "internal-error": + res := v.(*goa.ServiceError) + enc := encoder(ctx, w) + var body interface{} + if formatter != nil { + body = formatter(res) + } else { + body = NewByCatalogKindNameVersionInternalErrorResponseBody(res) + } + w.Header().Set("goa-error", "internal-error") + w.WriteHeader(http.StatusInternalServerError) + return enc.Encode(body) + case "not-found": + res := v.(*goa.ServiceError) + enc := encoder(ctx, w) + var body interface{} + if formatter != nil { + body = formatter(res) + } else { + body = NewByCatalogKindNameVersionNotFoundResponseBody(res) + } + w.Header().Set("goa-error", "not-found") + w.WriteHeader(http.StatusNotFound) + return enc.Encode(body) + default: + return encodeError(ctx, w, v) + } + } +} + +// EncodeByVersionIDResponse returns an encoder for responses returned by the +// resource ByVersionId endpoint. +func EncodeByVersionIDResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error { + return func(ctx context.Context, w http.ResponseWriter, v interface{}) error { + res := v.(*resourceviews.ResourceVersion) + enc := encoder(ctx, w) + body := NewByVersionIDResponseBody(res.Projected) + w.WriteHeader(http.StatusOK) + return enc.Encode(body) + } +} + +// DecodeByVersionIDRequest returns a decoder for requests sent to the resource +// ByVersionId endpoint. +func DecodeByVersionIDRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) { + return func(r *http.Request) (interface{}, error) { + var ( + versionID uint + err error + + params = mux.Vars(r) + ) + { + versionIDRaw := params["versionID"] + v, err2 := strconv.ParseUint(versionIDRaw, 10, strconv.IntSize) + if err2 != nil { + err = goa.MergeErrors(err, goa.InvalidFieldTypeError("versionID", versionIDRaw, "unsigned integer")) + } + versionID = uint(v) + } + if err != nil { + return nil, err + } + payload := NewByVersionIDPayload(versionID) + + return payload, nil + } +} + +// EncodeByVersionIDError returns an encoder for errors returned by the +// ByVersionId resource endpoint. +func EncodeByVersionIDError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, formatter func(err error) goahttp.Statuser) func(context.Context, http.ResponseWriter, error) error { + encodeError := goahttp.ErrorEncoder(encoder, formatter) + return func(ctx context.Context, w http.ResponseWriter, v error) error { + en, ok := v.(ErrorNamer) + if !ok { + return encodeError(ctx, w, v) + } + switch en.ErrorName() { + case "internal-error": + res := v.(*goa.ServiceError) + enc := encoder(ctx, w) + var body interface{} + if formatter != nil { + body = formatter(res) + } else { + body = NewByVersionIDInternalErrorResponseBody(res) + } + w.Header().Set("goa-error", "internal-error") + w.WriteHeader(http.StatusInternalServerError) + return enc.Encode(body) + case "not-found": + res := v.(*goa.ServiceError) + enc := encoder(ctx, w) + var body interface{} + if formatter != nil { + body = formatter(res) + } else { + body = NewByVersionIDNotFoundResponseBody(res) + } + w.Header().Set("goa-error", "not-found") + w.WriteHeader(http.StatusNotFound) + return enc.Encode(body) + default: + return encodeError(ctx, w, v) + } + } +} + +// EncodeByCatalogKindNameResponse returns an encoder for responses returned by +// the resource ByCatalogKindName endpoint. +func EncodeByCatalogKindNameResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error { + return func(ctx context.Context, w http.ResponseWriter, v interface{}) error { + res := v.(*resourceviews.Resource) + enc := encoder(ctx, w) + body := NewByCatalogKindNameResponseBody(res.Projected) + w.WriteHeader(http.StatusOK) + return enc.Encode(body) + } +} + +// DecodeByCatalogKindNameRequest returns a decoder for requests sent to the +// resource ByCatalogKindName endpoint. +func DecodeByCatalogKindNameRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) { + return func(r *http.Request) (interface{}, error) { + var ( + catalog string + kind string + name string + err error + + params = mux.Vars(r) + ) + catalog = params["catalog"] + kind = params["kind"] + if !(kind == "task" || kind == "pipeline") { + err = goa.MergeErrors(err, goa.InvalidEnumValueError("kind", kind, []interface{}{"task", "pipeline"})) + } + name = params["name"] + if err != nil { + return nil, err + } + payload := NewByCatalogKindNamePayload(catalog, kind, name) + + return payload, nil + } +} + +// EncodeByCatalogKindNameError returns an encoder for errors returned by the +// ByCatalogKindName resource endpoint. +func EncodeByCatalogKindNameError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, formatter func(err error) goahttp.Statuser) func(context.Context, http.ResponseWriter, error) error { + encodeError := goahttp.ErrorEncoder(encoder, formatter) + return func(ctx context.Context, w http.ResponseWriter, v error) error { + en, ok := v.(ErrorNamer) + if !ok { + return encodeError(ctx, w, v) + } + switch en.ErrorName() { + case "internal-error": + res := v.(*goa.ServiceError) + enc := encoder(ctx, w) + var body interface{} + if formatter != nil { + body = formatter(res) + } else { + body = NewByCatalogKindNameInternalErrorResponseBody(res) + } + w.Header().Set("goa-error", "internal-error") + w.WriteHeader(http.StatusInternalServerError) + return enc.Encode(body) + case "not-found": + res := v.(*goa.ServiceError) + enc := encoder(ctx, w) + var body interface{} + if formatter != nil { + body = formatter(res) + } else { + body = NewByCatalogKindNameNotFoundResponseBody(res) + } + w.Header().Set("goa-error", "not-found") + w.WriteHeader(http.StatusNotFound) + return enc.Encode(body) + default: + return encodeError(ctx, w, v) + } + } +} + +// EncodeByIDResponse returns an encoder for responses returned by the resource +// ById endpoint. +func EncodeByIDResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error { + return func(ctx context.Context, w http.ResponseWriter, v interface{}) error { + res := v.(*resourceviews.Resource) + enc := encoder(ctx, w) + body := NewByIDResponseBody(res.Projected) + w.WriteHeader(http.StatusOK) + return enc.Encode(body) + } +} + +// DecodeByIDRequest returns a decoder for requests sent to the resource ById +// endpoint. +func DecodeByIDRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) { + return func(r *http.Request) (interface{}, error) { + var ( + id uint + err error + + params = mux.Vars(r) + ) + { + idRaw := params["id"] + v, err2 := strconv.ParseUint(idRaw, 10, strconv.IntSize) + if err2 != nil { + err = goa.MergeErrors(err, goa.InvalidFieldTypeError("id", idRaw, "unsigned integer")) + } + id = uint(v) + } + if err != nil { + return nil, err + } + payload := NewByIDPayload(id) + + return payload, nil + } +} + +// EncodeByIDError returns an encoder for errors returned by the ById resource +// endpoint. +func EncodeByIDError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, formatter func(err error) goahttp.Statuser) func(context.Context, http.ResponseWriter, error) error { + encodeError := goahttp.ErrorEncoder(encoder, formatter) + return func(ctx context.Context, w http.ResponseWriter, v error) error { + en, ok := v.(ErrorNamer) + if !ok { + return encodeError(ctx, w, v) + } + switch en.ErrorName() { + case "internal-error": + res := v.(*goa.ServiceError) + enc := encoder(ctx, w) + var body interface{} + if formatter != nil { + body = formatter(res) + } else { + body = NewByIDInternalErrorResponseBody(res) + } + w.Header().Set("goa-error", "internal-error") + w.WriteHeader(http.StatusInternalServerError) + return enc.Encode(body) + case "not-found": + res := v.(*goa.ServiceError) + enc := encoder(ctx, w) + var body interface{} + if formatter != nil { + body = formatter(res) + } else { + body = NewByIDNotFoundResponseBody(res) + } + w.Header().Set("goa-error", "not-found") + w.WriteHeader(http.StatusNotFound) + return enc.Encode(body) + default: + return encodeError(ctx, w, v) + } + } +} + +// marshalResourceviewsResourceDataViewToResourceDataResponseBodyWithoutVersion +// builds a value of type *ResourceDataResponseBodyWithoutVersion from a value +// of type *resourceviews.ResourceDataView. +func marshalResourceviewsResourceDataViewToResourceDataResponseBodyWithoutVersion(v *resourceviews.ResourceDataView) *ResourceDataResponseBodyWithoutVersion { + res := &ResourceDataResponseBodyWithoutVersion{ + ID: *v.ID, + Name: *v.Name, + Kind: *v.Kind, + Rating: *v.Rating, + } + if v.Catalog != nil { + res.Catalog = marshalResourceviewsCatalogViewToCatalogResponseBody(v.Catalog) + } + if v.LatestVersion != nil { + res.LatestVersion = marshalResourceviewsResourceVersionDataViewToResourceVersionDataResponseBodyWithoutResource(v.LatestVersion) + } + if v.Tags != nil { + res.Tags = make([]*TagResponseBody, len(v.Tags)) + for i, val := range v.Tags { + res.Tags[i] = marshalResourceviewsTagViewToTagResponseBody(val) + } + } + + return res +} + +// marshalResourceviewsCatalogViewToCatalogResponseBody builds a value of type +// *CatalogResponseBody from a value of type *resourceviews.CatalogView. +func marshalResourceviewsCatalogViewToCatalogResponseBody(v *resourceviews.CatalogView) *CatalogResponseBody { + res := &CatalogResponseBody{ + ID: *v.ID, + Name: *v.Name, + Type: *v.Type, + } + + return res +} + +// marshalResourceviewsResourceVersionDataViewToResourceVersionDataResponseBodyWithoutResource +// builds a value of type *ResourceVersionDataResponseBodyWithoutResource from +// a value of type *resourceviews.ResourceVersionDataView. +func marshalResourceviewsResourceVersionDataViewToResourceVersionDataResponseBodyWithoutResource(v *resourceviews.ResourceVersionDataView) *ResourceVersionDataResponseBodyWithoutResource { + res := &ResourceVersionDataResponseBodyWithoutResource{ + ID: *v.ID, + Version: *v.Version, + DisplayName: *v.DisplayName, + Description: *v.Description, + MinPipelinesVersion: *v.MinPipelinesVersion, + RawURL: *v.RawURL, + WebURL: *v.WebURL, + UpdatedAt: *v.UpdatedAt, + } + + return res +} + +// marshalResourceviewsTagViewToTagResponseBody builds a value of type +// *TagResponseBody from a value of type *resourceviews.TagView. +func marshalResourceviewsTagViewToTagResponseBody(v *resourceviews.TagView) *TagResponseBody { + res := &TagResponseBody{ + ID: *v.ID, + Name: *v.Name, + } + + return res +} + +// marshalResourceviewsVersionsViewToVersionsResponseBody builds a value of +// type *VersionsResponseBody from a value of type *resourceviews.VersionsView. +func marshalResourceviewsVersionsViewToVersionsResponseBody(v *resourceviews.VersionsView) *VersionsResponseBody { + res := &VersionsResponseBody{} + if v.Latest != nil { + res.Latest = marshalResourceviewsResourceVersionDataViewToResourceVersionDataResponseBodyMin(v.Latest) + } + if v.Versions != nil { + res.Versions = make([]*ResourceVersionDataResponseBodyMin, len(v.Versions)) + for i, val := range v.Versions { + res.Versions[i] = marshalResourceviewsResourceVersionDataViewToResourceVersionDataResponseBodyMin(val) + } + } + + return res +} + +// marshalResourceviewsResourceVersionDataViewToResourceVersionDataResponseBodyMin +// builds a value of type *ResourceVersionDataResponseBodyMin from a value of +// type *resourceviews.ResourceVersionDataView. +func marshalResourceviewsResourceVersionDataViewToResourceVersionDataResponseBodyMin(v *resourceviews.ResourceVersionDataView) *ResourceVersionDataResponseBodyMin { + res := &ResourceVersionDataResponseBodyMin{ + ID: *v.ID, + Version: *v.Version, + RawURL: *v.RawURL, + WebURL: *v.WebURL, + } + + return res +} + +// marshalResourceviewsResourceVersionDataViewToResourceVersionDataResponseBody +// builds a value of type *ResourceVersionDataResponseBody from a value of type +// *resourceviews.ResourceVersionDataView. +func marshalResourceviewsResourceVersionDataViewToResourceVersionDataResponseBody(v *resourceviews.ResourceVersionDataView) *ResourceVersionDataResponseBody { + res := &ResourceVersionDataResponseBody{ + ID: *v.ID, + Version: *v.Version, + DisplayName: *v.DisplayName, + Description: *v.Description, + MinPipelinesVersion: *v.MinPipelinesVersion, + RawURL: *v.RawURL, + WebURL: *v.WebURL, + UpdatedAt: *v.UpdatedAt, + } + if v.Resource != nil { + res.Resource = marshalResourceviewsResourceDataViewToResourceDataResponseBodyInfo(v.Resource) + } + + return res +} + +// marshalResourceviewsResourceDataViewToResourceDataResponseBodyInfo builds a +// value of type *ResourceDataResponseBodyInfo from a value of type +// *resourceviews.ResourceDataView. +func marshalResourceviewsResourceDataViewToResourceDataResponseBodyInfo(v *resourceviews.ResourceDataView) *ResourceDataResponseBodyInfo { + res := &ResourceDataResponseBodyInfo{ + ID: *v.ID, + Name: *v.Name, + Kind: *v.Kind, + Rating: *v.Rating, + } + if v.Catalog != nil { + res.Catalog = marshalResourceviewsCatalogViewToCatalogResponseBody(v.Catalog) + } + if v.Tags != nil { + res.Tags = make([]*TagResponseBody, len(v.Tags)) + for i, val := range v.Tags { + res.Tags[i] = marshalResourceviewsTagViewToTagResponseBody(val) + } + } + + return res +} + +// marshalResourceviewsResourceDataViewToResourceDataResponseBody builds a +// value of type *ResourceDataResponseBody from a value of type +// *resourceviews.ResourceDataView. +func marshalResourceviewsResourceDataViewToResourceDataResponseBody(v *resourceviews.ResourceDataView) *ResourceDataResponseBody { + res := &ResourceDataResponseBody{ + ID: *v.ID, + Name: *v.Name, + Kind: *v.Kind, + Rating: *v.Rating, + } + if v.Catalog != nil { + res.Catalog = marshalResourceviewsCatalogViewToCatalogResponseBody(v.Catalog) + } + if v.LatestVersion != nil { + res.LatestVersion = marshalResourceviewsResourceVersionDataViewToResourceVersionDataResponseBodyWithoutResource(v.LatestVersion) + } + if v.Tags != nil { + res.Tags = make([]*TagResponseBody, len(v.Tags)) + for i, val := range v.Tags { + res.Tags[i] = marshalResourceviewsTagViewToTagResponseBody(val) + } + } + if v.Versions != nil { + res.Versions = make([]*ResourceVersionDataResponseBodyTiny, len(v.Versions)) + for i, val := range v.Versions { + res.Versions[i] = marshalResourceviewsResourceVersionDataViewToResourceVersionDataResponseBodyTiny(val) + } + } + + return res +} + +// marshalResourceviewsResourceVersionDataViewToResourceVersionDataResponseBodyTiny +// builds a value of type *ResourceVersionDataResponseBodyTiny from a value of +// type *resourceviews.ResourceVersionDataView. +func marshalResourceviewsResourceVersionDataViewToResourceVersionDataResponseBodyTiny(v *resourceviews.ResourceVersionDataView) *ResourceVersionDataResponseBodyTiny { + res := &ResourceVersionDataResponseBodyTiny{ + ID: *v.ID, + Version: *v.Version, + } + + return res +} diff --git a/api/v1/gen/http/resource/server/paths.go b/api/v1/gen/http/resource/server/paths.go new file mode 100644 index 0000000000..d5c59b8123 --- /dev/null +++ b/api/v1/gen/http/resource/server/paths.go @@ -0,0 +1,47 @@ +// Code generated by goa v3.2.2, DO NOT EDIT. +// +// HTTP request path constructors for the resource service. +// +// Command: +// $ goa gen github.com/tektoncd/hub/api/v1/design + +package server + +import ( + "fmt" +) + +// QueryResourcePath returns the URL path to the resource service Query HTTP endpoint. +func QueryResourcePath() string { + return "/v1/query" +} + +// ListResourcePath returns the URL path to the resource service List HTTP endpoint. +func ListResourcePath() string { + return "/v1/resources" +} + +// VersionsByIDResourcePath returns the URL path to the resource service VersionsByID HTTP endpoint. +func VersionsByIDResourcePath(id uint) string { + return fmt.Sprintf("/v1/resource/%v/versions", id) +} + +// ByCatalogKindNameVersionResourcePath returns the URL path to the resource service ByCatalogKindNameVersion HTTP endpoint. +func ByCatalogKindNameVersionResourcePath(catalog string, kind string, name string, version string) string { + return fmt.Sprintf("/v1/resource/%v/%v/%v/%v", catalog, kind, name, version) +} + +// ByVersionIDResourcePath returns the URL path to the resource service ByVersionId HTTP endpoint. +func ByVersionIDResourcePath(versionID uint) string { + return fmt.Sprintf("/v1/resource/version/%v", versionID) +} + +// ByCatalogKindNameResourcePath returns the URL path to the resource service ByCatalogKindName HTTP endpoint. +func ByCatalogKindNameResourcePath(catalog string, kind string, name string) string { + return fmt.Sprintf("/v1/resource/%v/%v/%v", catalog, kind, name) +} + +// ByIDResourcePath returns the URL path to the resource service ById HTTP endpoint. +func ByIDResourcePath(id uint) string { + return fmt.Sprintf("/v1/resource/%v", id) +} diff --git a/api/v1/gen/http/resource/server/server.go b/api/v1/gen/http/resource/server/server.go new file mode 100644 index 0000000000..6ca11e2365 --- /dev/null +++ b/api/v1/gen/http/resource/server/server.go @@ -0,0 +1,527 @@ +// Code generated by goa v3.2.2, DO NOT EDIT. +// +// resource HTTP server +// +// Command: +// $ goa gen github.com/tektoncd/hub/api/v1/design + +package server + +import ( + "context" + "net/http" + + resource "github.com/tektoncd/hub/api/v1/gen/resource" + goahttp "goa.design/goa/v3/http" + goa "goa.design/goa/v3/pkg" + "goa.design/plugins/v3/cors" +) + +// Server lists the resource service endpoint HTTP handlers. +type Server struct { + Mounts []*MountPoint + Query http.Handler + List http.Handler + VersionsByID http.Handler + ByCatalogKindNameVersion http.Handler + ByVersionID http.Handler + ByCatalogKindName http.Handler + ByID http.Handler + CORS http.Handler +} + +// ErrorNamer is an interface implemented by generated error structs that +// exposes the name of the error as defined in the design. +type ErrorNamer interface { + ErrorName() string +} + +// MountPoint holds information about the mounted endpoints. +type MountPoint struct { + // Method is the name of the service method served by the mounted HTTP handler. + Method string + // Verb is the HTTP method used to match requests to the mounted handler. + Verb string + // Pattern is the HTTP request path pattern used to match requests to the + // mounted handler. + Pattern string +} + +// New instantiates HTTP handlers for all the resource service endpoints using +// the provided encoder and decoder. The handlers are mounted on the given mux +// using the HTTP verb and path defined in the design. errhandler is called +// whenever a response fails to be encoded. formatter is used to format errors +// returned by the service methods prior to encoding. Both errhandler and +// formatter are optional and can be nil. +func New( + e *resource.Endpoints, + mux goahttp.Muxer, + decoder func(*http.Request) goahttp.Decoder, + encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, + errhandler func(context.Context, http.ResponseWriter, error), + formatter func(err error) goahttp.Statuser, +) *Server { + return &Server{ + Mounts: []*MountPoint{ + {"Query", "GET", "/v1/query"}, + {"List", "GET", "/v1/resources"}, + {"VersionsByID", "GET", "/v1/resource/{id}/versions"}, + {"ByCatalogKindNameVersion", "GET", "/v1/resource/{catalog}/{kind}/{name}/{version}"}, + {"ByVersionID", "GET", "/v1/resource/version/{versionID}"}, + {"ByCatalogKindName", "GET", "/v1/resource/{catalog}/{kind}/{name}"}, + {"ByID", "GET", "/v1/resource/{id}"}, + {"CORS", "OPTIONS", "/v1/query"}, + {"CORS", "OPTIONS", "/v1/resources"}, + {"CORS", "OPTIONS", "/v1/resource/{id}/versions"}, + {"CORS", "OPTIONS", "/v1/resource/{catalog}/{kind}/{name}/{version}"}, + {"CORS", "OPTIONS", "/v1/resource/version/{versionID}"}, + {"CORS", "OPTIONS", "/v1/resource/{catalog}/{kind}/{name}"}, + {"CORS", "OPTIONS", "/v1/resource/{id}"}, + }, + Query: NewQueryHandler(e.Query, mux, decoder, encoder, errhandler, formatter), + List: NewListHandler(e.List, mux, decoder, encoder, errhandler, formatter), + VersionsByID: NewVersionsByIDHandler(e.VersionsByID, mux, decoder, encoder, errhandler, formatter), + ByCatalogKindNameVersion: NewByCatalogKindNameVersionHandler(e.ByCatalogKindNameVersion, mux, decoder, encoder, errhandler, formatter), + ByVersionID: NewByVersionIDHandler(e.ByVersionID, mux, decoder, encoder, errhandler, formatter), + ByCatalogKindName: NewByCatalogKindNameHandler(e.ByCatalogKindName, mux, decoder, encoder, errhandler, formatter), + ByID: NewByIDHandler(e.ByID, mux, decoder, encoder, errhandler, formatter), + CORS: NewCORSHandler(), + } +} + +// Service returns the name of the service served. +func (s *Server) Service() string { return "resource" } + +// Use wraps the server handlers with the given middleware. +func (s *Server) Use(m func(http.Handler) http.Handler) { + s.Query = m(s.Query) + s.List = m(s.List) + s.VersionsByID = m(s.VersionsByID) + s.ByCatalogKindNameVersion = m(s.ByCatalogKindNameVersion) + s.ByVersionID = m(s.ByVersionID) + s.ByCatalogKindName = m(s.ByCatalogKindName) + s.ByID = m(s.ByID) + s.CORS = m(s.CORS) +} + +// Mount configures the mux to serve the resource endpoints. +func Mount(mux goahttp.Muxer, h *Server) { + MountQueryHandler(mux, h.Query) + MountListHandler(mux, h.List) + MountVersionsByIDHandler(mux, h.VersionsByID) + MountByCatalogKindNameVersionHandler(mux, h.ByCatalogKindNameVersion) + MountByVersionIDHandler(mux, h.ByVersionID) + MountByCatalogKindNameHandler(mux, h.ByCatalogKindName) + MountByIDHandler(mux, h.ByID) + MountCORSHandler(mux, h.CORS) +} + +// MountQueryHandler configures the mux to serve the "resource" service "Query" +// endpoint. +func MountQueryHandler(mux goahttp.Muxer, h http.Handler) { + f, ok := handleResourceOrigin(h).(http.HandlerFunc) + if !ok { + f = func(w http.ResponseWriter, r *http.Request) { + h.ServeHTTP(w, r) + } + } + mux.Handle("GET", "/v1/query", f) +} + +// NewQueryHandler creates a HTTP handler which loads the HTTP request and +// calls the "resource" service "Query" endpoint. +func NewQueryHandler( + endpoint goa.Endpoint, + mux goahttp.Muxer, + decoder func(*http.Request) goahttp.Decoder, + encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, + errhandler func(context.Context, http.ResponseWriter, error), + formatter func(err error) goahttp.Statuser, +) http.Handler { + var ( + decodeRequest = DecodeQueryRequest(mux, decoder) + encodeResponse = EncodeQueryResponse(encoder) + encodeError = EncodeQueryError(encoder, formatter) + ) + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + ctx := context.WithValue(r.Context(), goahttp.AcceptTypeKey, r.Header.Get("Accept")) + ctx = context.WithValue(ctx, goa.MethodKey, "Query") + ctx = context.WithValue(ctx, goa.ServiceKey, "resource") + payload, err := decodeRequest(r) + if err != nil { + if err := encodeError(ctx, w, err); err != nil { + errhandler(ctx, w, err) + } + return + } + res, err := endpoint(ctx, payload) + if err != nil { + if err := encodeError(ctx, w, err); err != nil { + errhandler(ctx, w, err) + } + return + } + if err := encodeResponse(ctx, w, res); err != nil { + errhandler(ctx, w, err) + } + }) +} + +// MountListHandler configures the mux to serve the "resource" service "List" +// endpoint. +func MountListHandler(mux goahttp.Muxer, h http.Handler) { + f, ok := handleResourceOrigin(h).(http.HandlerFunc) + if !ok { + f = func(w http.ResponseWriter, r *http.Request) { + h.ServeHTTP(w, r) + } + } + mux.Handle("GET", "/v1/resources", f) +} + +// NewListHandler creates a HTTP handler which loads the HTTP request and calls +// the "resource" service "List" endpoint. +func NewListHandler( + endpoint goa.Endpoint, + mux goahttp.Muxer, + decoder func(*http.Request) goahttp.Decoder, + encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, + errhandler func(context.Context, http.ResponseWriter, error), + formatter func(err error) goahttp.Statuser, +) http.Handler { + var ( + decodeRequest = DecodeListRequest(mux, decoder) + encodeResponse = EncodeListResponse(encoder) + encodeError = EncodeListError(encoder, formatter) + ) + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + ctx := context.WithValue(r.Context(), goahttp.AcceptTypeKey, r.Header.Get("Accept")) + ctx = context.WithValue(ctx, goa.MethodKey, "List") + ctx = context.WithValue(ctx, goa.ServiceKey, "resource") + payload, err := decodeRequest(r) + if err != nil { + if err := encodeError(ctx, w, err); err != nil { + errhandler(ctx, w, err) + } + return + } + res, err := endpoint(ctx, payload) + if err != nil { + if err := encodeError(ctx, w, err); err != nil { + errhandler(ctx, w, err) + } + return + } + if err := encodeResponse(ctx, w, res); err != nil { + errhandler(ctx, w, err) + } + }) +} + +// MountVersionsByIDHandler configures the mux to serve the "resource" service +// "VersionsByID" endpoint. +func MountVersionsByIDHandler(mux goahttp.Muxer, h http.Handler) { + f, ok := handleResourceOrigin(h).(http.HandlerFunc) + if !ok { + f = func(w http.ResponseWriter, r *http.Request) { + h.ServeHTTP(w, r) + } + } + mux.Handle("GET", "/v1/resource/{id}/versions", f) +} + +// NewVersionsByIDHandler creates a HTTP handler which loads the HTTP request +// and calls the "resource" service "VersionsByID" endpoint. +func NewVersionsByIDHandler( + endpoint goa.Endpoint, + mux goahttp.Muxer, + decoder func(*http.Request) goahttp.Decoder, + encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, + errhandler func(context.Context, http.ResponseWriter, error), + formatter func(err error) goahttp.Statuser, +) http.Handler { + var ( + decodeRequest = DecodeVersionsByIDRequest(mux, decoder) + encodeResponse = EncodeVersionsByIDResponse(encoder) + encodeError = EncodeVersionsByIDError(encoder, formatter) + ) + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + ctx := context.WithValue(r.Context(), goahttp.AcceptTypeKey, r.Header.Get("Accept")) + ctx = context.WithValue(ctx, goa.MethodKey, "VersionsByID") + ctx = context.WithValue(ctx, goa.ServiceKey, "resource") + payload, err := decodeRequest(r) + if err != nil { + if err := encodeError(ctx, w, err); err != nil { + errhandler(ctx, w, err) + } + return + } + res, err := endpoint(ctx, payload) + if err != nil { + if err := encodeError(ctx, w, err); err != nil { + errhandler(ctx, w, err) + } + return + } + if err := encodeResponse(ctx, w, res); err != nil { + errhandler(ctx, w, err) + } + }) +} + +// MountByCatalogKindNameVersionHandler configures the mux to serve the +// "resource" service "ByCatalogKindNameVersion" endpoint. +func MountByCatalogKindNameVersionHandler(mux goahttp.Muxer, h http.Handler) { + f, ok := handleResourceOrigin(h).(http.HandlerFunc) + if !ok { + f = func(w http.ResponseWriter, r *http.Request) { + h.ServeHTTP(w, r) + } + } + mux.Handle("GET", "/v1/resource/{catalog}/{kind}/{name}/{version}", f) +} + +// NewByCatalogKindNameVersionHandler creates a HTTP handler which loads the +// HTTP request and calls the "resource" service "ByCatalogKindNameVersion" +// endpoint. +func NewByCatalogKindNameVersionHandler( + endpoint goa.Endpoint, + mux goahttp.Muxer, + decoder func(*http.Request) goahttp.Decoder, + encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, + errhandler func(context.Context, http.ResponseWriter, error), + formatter func(err error) goahttp.Statuser, +) http.Handler { + var ( + decodeRequest = DecodeByCatalogKindNameVersionRequest(mux, decoder) + encodeResponse = EncodeByCatalogKindNameVersionResponse(encoder) + encodeError = EncodeByCatalogKindNameVersionError(encoder, formatter) + ) + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + ctx := context.WithValue(r.Context(), goahttp.AcceptTypeKey, r.Header.Get("Accept")) + ctx = context.WithValue(ctx, goa.MethodKey, "ByCatalogKindNameVersion") + ctx = context.WithValue(ctx, goa.ServiceKey, "resource") + payload, err := decodeRequest(r) + if err != nil { + if err := encodeError(ctx, w, err); err != nil { + errhandler(ctx, w, err) + } + return + } + res, err := endpoint(ctx, payload) + if err != nil { + if err := encodeError(ctx, w, err); err != nil { + errhandler(ctx, w, err) + } + return + } + if err := encodeResponse(ctx, w, res); err != nil { + errhandler(ctx, w, err) + } + }) +} + +// MountByVersionIDHandler configures the mux to serve the "resource" service +// "ByVersionId" endpoint. +func MountByVersionIDHandler(mux goahttp.Muxer, h http.Handler) { + f, ok := handleResourceOrigin(h).(http.HandlerFunc) + if !ok { + f = func(w http.ResponseWriter, r *http.Request) { + h.ServeHTTP(w, r) + } + } + mux.Handle("GET", "/v1/resource/version/{versionID}", f) +} + +// NewByVersionIDHandler creates a HTTP handler which loads the HTTP request +// and calls the "resource" service "ByVersionId" endpoint. +func NewByVersionIDHandler( + endpoint goa.Endpoint, + mux goahttp.Muxer, + decoder func(*http.Request) goahttp.Decoder, + encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, + errhandler func(context.Context, http.ResponseWriter, error), + formatter func(err error) goahttp.Statuser, +) http.Handler { + var ( + decodeRequest = DecodeByVersionIDRequest(mux, decoder) + encodeResponse = EncodeByVersionIDResponse(encoder) + encodeError = EncodeByVersionIDError(encoder, formatter) + ) + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + ctx := context.WithValue(r.Context(), goahttp.AcceptTypeKey, r.Header.Get("Accept")) + ctx = context.WithValue(ctx, goa.MethodKey, "ByVersionId") + ctx = context.WithValue(ctx, goa.ServiceKey, "resource") + payload, err := decodeRequest(r) + if err != nil { + if err := encodeError(ctx, w, err); err != nil { + errhandler(ctx, w, err) + } + return + } + res, err := endpoint(ctx, payload) + if err != nil { + if err := encodeError(ctx, w, err); err != nil { + errhandler(ctx, w, err) + } + return + } + if err := encodeResponse(ctx, w, res); err != nil { + errhandler(ctx, w, err) + } + }) +} + +// MountByCatalogKindNameHandler configures the mux to serve the "resource" +// service "ByCatalogKindName" endpoint. +func MountByCatalogKindNameHandler(mux goahttp.Muxer, h http.Handler) { + f, ok := handleResourceOrigin(h).(http.HandlerFunc) + if !ok { + f = func(w http.ResponseWriter, r *http.Request) { + h.ServeHTTP(w, r) + } + } + mux.Handle("GET", "/v1/resource/{catalog}/{kind}/{name}", f) +} + +// NewByCatalogKindNameHandler creates a HTTP handler which loads the HTTP +// request and calls the "resource" service "ByCatalogKindName" endpoint. +func NewByCatalogKindNameHandler( + endpoint goa.Endpoint, + mux goahttp.Muxer, + decoder func(*http.Request) goahttp.Decoder, + encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, + errhandler func(context.Context, http.ResponseWriter, error), + formatter func(err error) goahttp.Statuser, +) http.Handler { + var ( + decodeRequest = DecodeByCatalogKindNameRequest(mux, decoder) + encodeResponse = EncodeByCatalogKindNameResponse(encoder) + encodeError = EncodeByCatalogKindNameError(encoder, formatter) + ) + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + ctx := context.WithValue(r.Context(), goahttp.AcceptTypeKey, r.Header.Get("Accept")) + ctx = context.WithValue(ctx, goa.MethodKey, "ByCatalogKindName") + ctx = context.WithValue(ctx, goa.ServiceKey, "resource") + payload, err := decodeRequest(r) + if err != nil { + if err := encodeError(ctx, w, err); err != nil { + errhandler(ctx, w, err) + } + return + } + res, err := endpoint(ctx, payload) + if err != nil { + if err := encodeError(ctx, w, err); err != nil { + errhandler(ctx, w, err) + } + return + } + if err := encodeResponse(ctx, w, res); err != nil { + errhandler(ctx, w, err) + } + }) +} + +// MountByIDHandler configures the mux to serve the "resource" service "ById" +// endpoint. +func MountByIDHandler(mux goahttp.Muxer, h http.Handler) { + f, ok := handleResourceOrigin(h).(http.HandlerFunc) + if !ok { + f = func(w http.ResponseWriter, r *http.Request) { + h.ServeHTTP(w, r) + } + } + mux.Handle("GET", "/v1/resource/{id}", f) +} + +// NewByIDHandler creates a HTTP handler which loads the HTTP request and calls +// the "resource" service "ById" endpoint. +func NewByIDHandler( + endpoint goa.Endpoint, + mux goahttp.Muxer, + decoder func(*http.Request) goahttp.Decoder, + encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, + errhandler func(context.Context, http.ResponseWriter, error), + formatter func(err error) goahttp.Statuser, +) http.Handler { + var ( + decodeRequest = DecodeByIDRequest(mux, decoder) + encodeResponse = EncodeByIDResponse(encoder) + encodeError = EncodeByIDError(encoder, formatter) + ) + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + ctx := context.WithValue(r.Context(), goahttp.AcceptTypeKey, r.Header.Get("Accept")) + ctx = context.WithValue(ctx, goa.MethodKey, "ById") + ctx = context.WithValue(ctx, goa.ServiceKey, "resource") + payload, err := decodeRequest(r) + if err != nil { + if err := encodeError(ctx, w, err); err != nil { + errhandler(ctx, w, err) + } + return + } + res, err := endpoint(ctx, payload) + if err != nil { + if err := encodeError(ctx, w, err); err != nil { + errhandler(ctx, w, err) + } + return + } + if err := encodeResponse(ctx, w, res); err != nil { + errhandler(ctx, w, err) + } + }) +} + +// MountCORSHandler configures the mux to serve the CORS endpoints for the +// service resource. +func MountCORSHandler(mux goahttp.Muxer, h http.Handler) { + h = handleResourceOrigin(h) + f, ok := h.(http.HandlerFunc) + if !ok { + f = func(w http.ResponseWriter, r *http.Request) { + h.ServeHTTP(w, r) + } + } + mux.Handle("OPTIONS", "/v1/query", f) + mux.Handle("OPTIONS", "/v1/resources", f) + mux.Handle("OPTIONS", "/v1/resource/{id}/versions", f) + mux.Handle("OPTIONS", "/v1/resource/{catalog}/{kind}/{name}/{version}", f) + mux.Handle("OPTIONS", "/v1/resource/version/{versionID}", f) + mux.Handle("OPTIONS", "/v1/resource/{catalog}/{kind}/{name}", f) + mux.Handle("OPTIONS", "/v1/resource/{id}", f) +} + +// NewCORSHandler creates a HTTP handler which returns a simple 200 response. +func NewCORSHandler() http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(200) + }) +} + +// handleResourceOrigin applies the CORS response headers corresponding to the +// origin for the service resource. +func handleResourceOrigin(h http.Handler) http.Handler { + origHndlr := h.(http.HandlerFunc) + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + origin := r.Header.Get("Origin") + if origin == "" { + // Not a CORS request + origHndlr(w, r) + return + } + if cors.MatchOrigin(origin, "*") { + w.Header().Set("Access-Control-Allow-Origin", origin) + w.Header().Set("Access-Control-Allow-Credentials", "false") + if acrm := r.Header.Get("Access-Control-Request-Method"); acrm != "" { + // We are handling a preflight request + w.Header().Set("Access-Control-Allow-Methods", "GET") + } + origHndlr(w, r) + return + } + origHndlr(w, r) + return + }) +} diff --git a/api/v1/gen/http/resource/server/types.go b/api/v1/gen/http/resource/server/types.go new file mode 100644 index 0000000000..9aa0037759 --- /dev/null +++ b/api/v1/gen/http/resource/server/types.go @@ -0,0 +1,806 @@ +// Code generated by goa v3.2.2, DO NOT EDIT. +// +// resource HTTP server types +// +// Command: +// $ goa gen github.com/tektoncd/hub/api/v1/design + +package server + +import ( + resource "github.com/tektoncd/hub/api/v1/gen/resource" + resourceviews "github.com/tektoncd/hub/api/v1/gen/resource/views" + goa "goa.design/goa/v3/pkg" +) + +// QueryResponseBody is the type of the "resource" service "Query" endpoint +// HTTP response body. +type QueryResponseBody struct { + Data ResourceDataResponseBodyWithoutVersionCollection `form:"data" json:"data" xml:"data"` +} + +// ListResponseBody is the type of the "resource" service "List" endpoint HTTP +// response body. +type ListResponseBody struct { + Data ResourceDataResponseBodyWithoutVersionCollection `form:"data" json:"data" xml:"data"` +} + +// VersionsByIDResponseBody is the type of the "resource" service +// "VersionsByID" endpoint HTTP response body. +type VersionsByIDResponseBody struct { + Data *VersionsResponseBody `form:"data" json:"data" xml:"data"` +} + +// ByCatalogKindNameVersionResponseBody is the type of the "resource" service +// "ByCatalogKindNameVersion" endpoint HTTP response body. +type ByCatalogKindNameVersionResponseBody struct { + Data *ResourceVersionDataResponseBody `form:"data" json:"data" xml:"data"` +} + +// ByVersionIDResponseBody is the type of the "resource" service "ByVersionId" +// endpoint HTTP response body. +type ByVersionIDResponseBody struct { + Data *ResourceVersionDataResponseBody `form:"data" json:"data" xml:"data"` +} + +// ByCatalogKindNameResponseBody is the type of the "resource" service +// "ByCatalogKindName" endpoint HTTP response body. +type ByCatalogKindNameResponseBody struct { + Data *ResourceDataResponseBody `form:"data" json:"data" xml:"data"` +} + +// ByIDResponseBody is the type of the "resource" service "ById" endpoint HTTP +// response body. +type ByIDResponseBody struct { + Data *ResourceDataResponseBody `form:"data" json:"data" xml:"data"` +} + +// QueryInternalErrorResponseBody is the type of the "resource" service "Query" +// endpoint HTTP response body for the "internal-error" error. +type QueryInternalErrorResponseBody struct { + // Name is the name of this class of errors. + Name string `form:"name" json:"name" xml:"name"` + // ID is a unique identifier for this particular occurrence of the problem. + ID string `form:"id" json:"id" xml:"id"` + // Message is a human-readable explanation specific to this occurrence of the + // problem. + Message string `form:"message" json:"message" xml:"message"` + // Is the error temporary? + Temporary bool `form:"temporary" json:"temporary" xml:"temporary"` + // Is the error a timeout? + Timeout bool `form:"timeout" json:"timeout" xml:"timeout"` + // Is the error a server-side fault? + Fault bool `form:"fault" json:"fault" xml:"fault"` +} + +// QueryInvalidKindResponseBody is the type of the "resource" service "Query" +// endpoint HTTP response body for the "invalid-kind" error. +type QueryInvalidKindResponseBody struct { + // Name is the name of this class of errors. + Name string `form:"name" json:"name" xml:"name"` + // ID is a unique identifier for this particular occurrence of the problem. + ID string `form:"id" json:"id" xml:"id"` + // Message is a human-readable explanation specific to this occurrence of the + // problem. + Message string `form:"message" json:"message" xml:"message"` + // Is the error temporary? + Temporary bool `form:"temporary" json:"temporary" xml:"temporary"` + // Is the error a timeout? + Timeout bool `form:"timeout" json:"timeout" xml:"timeout"` + // Is the error a server-side fault? + Fault bool `form:"fault" json:"fault" xml:"fault"` +} + +// QueryNotFoundResponseBody is the type of the "resource" service "Query" +// endpoint HTTP response body for the "not-found" error. +type QueryNotFoundResponseBody struct { + // Name is the name of this class of errors. + Name string `form:"name" json:"name" xml:"name"` + // ID is a unique identifier for this particular occurrence of the problem. + ID string `form:"id" json:"id" xml:"id"` + // Message is a human-readable explanation specific to this occurrence of the + // problem. + Message string `form:"message" json:"message" xml:"message"` + // Is the error temporary? + Temporary bool `form:"temporary" json:"temporary" xml:"temporary"` + // Is the error a timeout? + Timeout bool `form:"timeout" json:"timeout" xml:"timeout"` + // Is the error a server-side fault? + Fault bool `form:"fault" json:"fault" xml:"fault"` +} + +// ListInternalErrorResponseBody is the type of the "resource" service "List" +// endpoint HTTP response body for the "internal-error" error. +type ListInternalErrorResponseBody struct { + // Name is the name of this class of errors. + Name string `form:"name" json:"name" xml:"name"` + // ID is a unique identifier for this particular occurrence of the problem. + ID string `form:"id" json:"id" xml:"id"` + // Message is a human-readable explanation specific to this occurrence of the + // problem. + Message string `form:"message" json:"message" xml:"message"` + // Is the error temporary? + Temporary bool `form:"temporary" json:"temporary" xml:"temporary"` + // Is the error a timeout? + Timeout bool `form:"timeout" json:"timeout" xml:"timeout"` + // Is the error a server-side fault? + Fault bool `form:"fault" json:"fault" xml:"fault"` +} + +// VersionsByIDInternalErrorResponseBody is the type of the "resource" service +// "VersionsByID" endpoint HTTP response body for the "internal-error" error. +type VersionsByIDInternalErrorResponseBody struct { + // Name is the name of this class of errors. + Name string `form:"name" json:"name" xml:"name"` + // ID is a unique identifier for this particular occurrence of the problem. + ID string `form:"id" json:"id" xml:"id"` + // Message is a human-readable explanation specific to this occurrence of the + // problem. + Message string `form:"message" json:"message" xml:"message"` + // Is the error temporary? + Temporary bool `form:"temporary" json:"temporary" xml:"temporary"` + // Is the error a timeout? + Timeout bool `form:"timeout" json:"timeout" xml:"timeout"` + // Is the error a server-side fault? + Fault bool `form:"fault" json:"fault" xml:"fault"` +} + +// VersionsByIDNotFoundResponseBody is the type of the "resource" service +// "VersionsByID" endpoint HTTP response body for the "not-found" error. +type VersionsByIDNotFoundResponseBody struct { + // Name is the name of this class of errors. + Name string `form:"name" json:"name" xml:"name"` + // ID is a unique identifier for this particular occurrence of the problem. + ID string `form:"id" json:"id" xml:"id"` + // Message is a human-readable explanation specific to this occurrence of the + // problem. + Message string `form:"message" json:"message" xml:"message"` + // Is the error temporary? + Temporary bool `form:"temporary" json:"temporary" xml:"temporary"` + // Is the error a timeout? + Timeout bool `form:"timeout" json:"timeout" xml:"timeout"` + // Is the error a server-side fault? + Fault bool `form:"fault" json:"fault" xml:"fault"` +} + +// ByCatalogKindNameVersionInternalErrorResponseBody is the type of the +// "resource" service "ByCatalogKindNameVersion" endpoint HTTP response body +// for the "internal-error" error. +type ByCatalogKindNameVersionInternalErrorResponseBody struct { + // Name is the name of this class of errors. + Name string `form:"name" json:"name" xml:"name"` + // ID is a unique identifier for this particular occurrence of the problem. + ID string `form:"id" json:"id" xml:"id"` + // Message is a human-readable explanation specific to this occurrence of the + // problem. + Message string `form:"message" json:"message" xml:"message"` + // Is the error temporary? + Temporary bool `form:"temporary" json:"temporary" xml:"temporary"` + // Is the error a timeout? + Timeout bool `form:"timeout" json:"timeout" xml:"timeout"` + // Is the error a server-side fault? + Fault bool `form:"fault" json:"fault" xml:"fault"` +} + +// ByCatalogKindNameVersionNotFoundResponseBody is the type of the "resource" +// service "ByCatalogKindNameVersion" endpoint HTTP response body for the +// "not-found" error. +type ByCatalogKindNameVersionNotFoundResponseBody struct { + // Name is the name of this class of errors. + Name string `form:"name" json:"name" xml:"name"` + // ID is a unique identifier for this particular occurrence of the problem. + ID string `form:"id" json:"id" xml:"id"` + // Message is a human-readable explanation specific to this occurrence of the + // problem. + Message string `form:"message" json:"message" xml:"message"` + // Is the error temporary? + Temporary bool `form:"temporary" json:"temporary" xml:"temporary"` + // Is the error a timeout? + Timeout bool `form:"timeout" json:"timeout" xml:"timeout"` + // Is the error a server-side fault? + Fault bool `form:"fault" json:"fault" xml:"fault"` +} + +// ByVersionIDInternalErrorResponseBody is the type of the "resource" service +// "ByVersionId" endpoint HTTP response body for the "internal-error" error. +type ByVersionIDInternalErrorResponseBody struct { + // Name is the name of this class of errors. + Name string `form:"name" json:"name" xml:"name"` + // ID is a unique identifier for this particular occurrence of the problem. + ID string `form:"id" json:"id" xml:"id"` + // Message is a human-readable explanation specific to this occurrence of the + // problem. + Message string `form:"message" json:"message" xml:"message"` + // Is the error temporary? + Temporary bool `form:"temporary" json:"temporary" xml:"temporary"` + // Is the error a timeout? + Timeout bool `form:"timeout" json:"timeout" xml:"timeout"` + // Is the error a server-side fault? + Fault bool `form:"fault" json:"fault" xml:"fault"` +} + +// ByVersionIDNotFoundResponseBody is the type of the "resource" service +// "ByVersionId" endpoint HTTP response body for the "not-found" error. +type ByVersionIDNotFoundResponseBody struct { + // Name is the name of this class of errors. + Name string `form:"name" json:"name" xml:"name"` + // ID is a unique identifier for this particular occurrence of the problem. + ID string `form:"id" json:"id" xml:"id"` + // Message is a human-readable explanation specific to this occurrence of the + // problem. + Message string `form:"message" json:"message" xml:"message"` + // Is the error temporary? + Temporary bool `form:"temporary" json:"temporary" xml:"temporary"` + // Is the error a timeout? + Timeout bool `form:"timeout" json:"timeout" xml:"timeout"` + // Is the error a server-side fault? + Fault bool `form:"fault" json:"fault" xml:"fault"` +} + +// ByCatalogKindNameInternalErrorResponseBody is the type of the "resource" +// service "ByCatalogKindName" endpoint HTTP response body for the +// "internal-error" error. +type ByCatalogKindNameInternalErrorResponseBody struct { + // Name is the name of this class of errors. + Name string `form:"name" json:"name" xml:"name"` + // ID is a unique identifier for this particular occurrence of the problem. + ID string `form:"id" json:"id" xml:"id"` + // Message is a human-readable explanation specific to this occurrence of the + // problem. + Message string `form:"message" json:"message" xml:"message"` + // Is the error temporary? + Temporary bool `form:"temporary" json:"temporary" xml:"temporary"` + // Is the error a timeout? + Timeout bool `form:"timeout" json:"timeout" xml:"timeout"` + // Is the error a server-side fault? + Fault bool `form:"fault" json:"fault" xml:"fault"` +} + +// ByCatalogKindNameNotFoundResponseBody is the type of the "resource" service +// "ByCatalogKindName" endpoint HTTP response body for the "not-found" error. +type ByCatalogKindNameNotFoundResponseBody struct { + // Name is the name of this class of errors. + Name string `form:"name" json:"name" xml:"name"` + // ID is a unique identifier for this particular occurrence of the problem. + ID string `form:"id" json:"id" xml:"id"` + // Message is a human-readable explanation specific to this occurrence of the + // problem. + Message string `form:"message" json:"message" xml:"message"` + // Is the error temporary? + Temporary bool `form:"temporary" json:"temporary" xml:"temporary"` + // Is the error a timeout? + Timeout bool `form:"timeout" json:"timeout" xml:"timeout"` + // Is the error a server-side fault? + Fault bool `form:"fault" json:"fault" xml:"fault"` +} + +// ByIDInternalErrorResponseBody is the type of the "resource" service "ById" +// endpoint HTTP response body for the "internal-error" error. +type ByIDInternalErrorResponseBody struct { + // Name is the name of this class of errors. + Name string `form:"name" json:"name" xml:"name"` + // ID is a unique identifier for this particular occurrence of the problem. + ID string `form:"id" json:"id" xml:"id"` + // Message is a human-readable explanation specific to this occurrence of the + // problem. + Message string `form:"message" json:"message" xml:"message"` + // Is the error temporary? + Temporary bool `form:"temporary" json:"temporary" xml:"temporary"` + // Is the error a timeout? + Timeout bool `form:"timeout" json:"timeout" xml:"timeout"` + // Is the error a server-side fault? + Fault bool `form:"fault" json:"fault" xml:"fault"` +} + +// ByIDNotFoundResponseBody is the type of the "resource" service "ById" +// endpoint HTTP response body for the "not-found" error. +type ByIDNotFoundResponseBody struct { + // Name is the name of this class of errors. + Name string `form:"name" json:"name" xml:"name"` + // ID is a unique identifier for this particular occurrence of the problem. + ID string `form:"id" json:"id" xml:"id"` + // Message is a human-readable explanation specific to this occurrence of the + // problem. + Message string `form:"message" json:"message" xml:"message"` + // Is the error temporary? + Temporary bool `form:"temporary" json:"temporary" xml:"temporary"` + // Is the error a timeout? + Timeout bool `form:"timeout" json:"timeout" xml:"timeout"` + // Is the error a server-side fault? + Fault bool `form:"fault" json:"fault" xml:"fault"` +} + +// ResourceDataResponseBodyWithoutVersionCollection is used to define fields on +// response body types. +type ResourceDataResponseBodyWithoutVersionCollection []*ResourceDataResponseBodyWithoutVersion + +// ResourceDataResponseBodyWithoutVersion is used to define fields on response +// body types. +type ResourceDataResponseBodyWithoutVersion struct { + // ID is the unique id of the resource + ID uint `form:"id" json:"id" xml:"id"` + // Name of resource + Name string `form:"name" json:"name" xml:"name"` + // Type of catalog to which resource belongs + Catalog *CatalogResponseBody `form:"catalog" json:"catalog" xml:"catalog"` + // Kind of resource + Kind string `form:"kind" json:"kind" xml:"kind"` + // Latest version of resource + LatestVersion *ResourceVersionDataResponseBodyWithoutResource `form:"latestVersion" json:"latestVersion" xml:"latestVersion"` + // Tags related to resource + Tags []*TagResponseBody `form:"tags" json:"tags" xml:"tags"` + // Rating of resource + Rating float64 `form:"rating" json:"rating" xml:"rating"` +} + +// CatalogResponseBody is used to define fields on response body types. +type CatalogResponseBody struct { + // ID is the unique id of the catalog + ID uint `form:"id" json:"id" xml:"id"` + // Name of catalog + Name string `form:"name" json:"name" xml:"name"` + // Type of catalog + Type string `form:"type" json:"type" xml:"type"` +} + +// ResourceVersionDataResponseBodyWithoutResource is used to define fields on +// response body types. +type ResourceVersionDataResponseBodyWithoutResource struct { + // ID is the unique id of resource's version + ID uint `form:"id" json:"id" xml:"id"` + // Version of resource + Version string `form:"version" json:"version" xml:"version"` + // Display name of version + DisplayName string `form:"displayName" json:"displayName" xml:"displayName"` + // Description of version + Description string `form:"description" json:"description" xml:"description"` + // Minimum pipelines version the resource's version is compatible with + MinPipelinesVersion string `form:"minPipelinesVersion" json:"minPipelinesVersion" xml:"minPipelinesVersion"` + // Raw URL of resource's yaml file of the version + RawURL string `form:"rawURL" json:"rawURL" xml:"rawURL"` + // Web URL of resource's yaml file of the version + WebURL string `form:"webURL" json:"webURL" xml:"webURL"` + // Timestamp when version was last updated + UpdatedAt string `form:"updatedAt" json:"updatedAt" xml:"updatedAt"` +} + +// TagResponseBody is used to define fields on response body types. +type TagResponseBody struct { + // ID is the unique id of tag + ID uint `form:"id" json:"id" xml:"id"` + // Name of tag + Name string `form:"name" json:"name" xml:"name"` +} + +// VersionsResponseBody is used to define fields on response body types. +type VersionsResponseBody struct { + // Latest Version of resource + Latest *ResourceVersionDataResponseBodyMin `form:"latest" json:"latest" xml:"latest"` + // List of all versions of resource + Versions []*ResourceVersionDataResponseBodyMin `form:"versions" json:"versions" xml:"versions"` +} + +// ResourceVersionDataResponseBodyMin is used to define fields on response body +// types. +type ResourceVersionDataResponseBodyMin struct { + // ID is the unique id of resource's version + ID uint `form:"id" json:"id" xml:"id"` + // Version of resource + Version string `form:"version" json:"version" xml:"version"` + // Raw URL of resource's yaml file of the version + RawURL string `form:"rawURL" json:"rawURL" xml:"rawURL"` + // Web URL of resource's yaml file of the version + WebURL string `form:"webURL" json:"webURL" xml:"webURL"` +} + +// ResourceVersionDataResponseBody is used to define fields on response body +// types. +type ResourceVersionDataResponseBody struct { + // ID is the unique id of resource's version + ID uint `form:"id" json:"id" xml:"id"` + // Version of resource + Version string `form:"version" json:"version" xml:"version"` + // Display name of version + DisplayName string `form:"displayName" json:"displayName" xml:"displayName"` + // Description of version + Description string `form:"description" json:"description" xml:"description"` + // Minimum pipelines version the resource's version is compatible with + MinPipelinesVersion string `form:"minPipelinesVersion" json:"minPipelinesVersion" xml:"minPipelinesVersion"` + // Raw URL of resource's yaml file of the version + RawURL string `form:"rawURL" json:"rawURL" xml:"rawURL"` + // Web URL of resource's yaml file of the version + WebURL string `form:"webURL" json:"webURL" xml:"webURL"` + // Timestamp when version was last updated + UpdatedAt string `form:"updatedAt" json:"updatedAt" xml:"updatedAt"` + // Resource to which the version belongs + Resource *ResourceDataResponseBodyInfo `form:"resource" json:"resource" xml:"resource"` +} + +// ResourceDataResponseBodyInfo is used to define fields on response body types. +type ResourceDataResponseBodyInfo struct { + // ID is the unique id of the resource + ID uint `form:"id" json:"id" xml:"id"` + // Name of resource + Name string `form:"name" json:"name" xml:"name"` + // Type of catalog to which resource belongs + Catalog *CatalogResponseBody `form:"catalog" json:"catalog" xml:"catalog"` + // Kind of resource + Kind string `form:"kind" json:"kind" xml:"kind"` + // Tags related to resource + Tags []*TagResponseBody `form:"tags" json:"tags" xml:"tags"` + // Rating of resource + Rating float64 `form:"rating" json:"rating" xml:"rating"` +} + +// ResourceDataResponseBody is used to define fields on response body types. +type ResourceDataResponseBody struct { + // ID is the unique id of the resource + ID uint `form:"id" json:"id" xml:"id"` + // Name of resource + Name string `form:"name" json:"name" xml:"name"` + // Type of catalog to which resource belongs + Catalog *CatalogResponseBody `form:"catalog" json:"catalog" xml:"catalog"` + // Kind of resource + Kind string `form:"kind" json:"kind" xml:"kind"` + // Latest version of resource + LatestVersion *ResourceVersionDataResponseBodyWithoutResource `form:"latestVersion" json:"latestVersion" xml:"latestVersion"` + // Tags related to resource + Tags []*TagResponseBody `form:"tags" json:"tags" xml:"tags"` + // Rating of resource + Rating float64 `form:"rating" json:"rating" xml:"rating"` + // List of all versions of a resource + Versions []*ResourceVersionDataResponseBodyTiny `form:"versions" json:"versions" xml:"versions"` +} + +// ResourceVersionDataResponseBodyTiny is used to define fields on response +// body types. +type ResourceVersionDataResponseBodyTiny struct { + // ID is the unique id of resource's version + ID uint `form:"id" json:"id" xml:"id"` + // Version of resource + Version string `form:"version" json:"version" xml:"version"` +} + +// NewQueryResponseBody builds the HTTP response body from the result of the +// "Query" endpoint of the "resource" service. +func NewQueryResponseBody(res *resourceviews.ResourcesView) *QueryResponseBody { + body := &QueryResponseBody{} + if res.Data != nil { + body.Data = make([]*ResourceDataResponseBodyWithoutVersion, len(res.Data)) + for i, val := range res.Data { + body.Data[i] = marshalResourceviewsResourceDataViewToResourceDataResponseBodyWithoutVersion(val) + } + } + return body +} + +// NewListResponseBody builds the HTTP response body from the result of the +// "List" endpoint of the "resource" service. +func NewListResponseBody(res *resourceviews.ResourcesView) *ListResponseBody { + body := &ListResponseBody{} + if res.Data != nil { + body.Data = make([]*ResourceDataResponseBodyWithoutVersion, len(res.Data)) + for i, val := range res.Data { + body.Data[i] = marshalResourceviewsResourceDataViewToResourceDataResponseBodyWithoutVersion(val) + } + } + return body +} + +// NewVersionsByIDResponseBody builds the HTTP response body from the result of +// the "VersionsByID" endpoint of the "resource" service. +func NewVersionsByIDResponseBody(res *resourceviews.ResourceVersionsView) *VersionsByIDResponseBody { + body := &VersionsByIDResponseBody{} + if res.Data != nil { + body.Data = marshalResourceviewsVersionsViewToVersionsResponseBody(res.Data) + } + return body +} + +// NewByCatalogKindNameVersionResponseBody builds the HTTP response body from +// the result of the "ByCatalogKindNameVersion" endpoint of the "resource" +// service. +func NewByCatalogKindNameVersionResponseBody(res *resourceviews.ResourceVersionView) *ByCatalogKindNameVersionResponseBody { + body := &ByCatalogKindNameVersionResponseBody{} + if res.Data != nil { + body.Data = marshalResourceviewsResourceVersionDataViewToResourceVersionDataResponseBody(res.Data) + } + return body +} + +// NewByVersionIDResponseBody builds the HTTP response body from the result of +// the "ByVersionId" endpoint of the "resource" service. +func NewByVersionIDResponseBody(res *resourceviews.ResourceVersionView) *ByVersionIDResponseBody { + body := &ByVersionIDResponseBody{} + if res.Data != nil { + body.Data = marshalResourceviewsResourceVersionDataViewToResourceVersionDataResponseBody(res.Data) + } + return body +} + +// NewByCatalogKindNameResponseBody builds the HTTP response body from the +// result of the "ByCatalogKindName" endpoint of the "resource" service. +func NewByCatalogKindNameResponseBody(res *resourceviews.ResourceView) *ByCatalogKindNameResponseBody { + body := &ByCatalogKindNameResponseBody{} + if res.Data != nil { + body.Data = marshalResourceviewsResourceDataViewToResourceDataResponseBody(res.Data) + } + return body +} + +// NewByIDResponseBody builds the HTTP response body from the result of the +// "ById" endpoint of the "resource" service. +func NewByIDResponseBody(res *resourceviews.ResourceView) *ByIDResponseBody { + body := &ByIDResponseBody{} + if res.Data != nil { + body.Data = marshalResourceviewsResourceDataViewToResourceDataResponseBody(res.Data) + } + return body +} + +// NewQueryInternalErrorResponseBody builds the HTTP response body from the +// result of the "Query" endpoint of the "resource" service. +func NewQueryInternalErrorResponseBody(res *goa.ServiceError) *QueryInternalErrorResponseBody { + body := &QueryInternalErrorResponseBody{ + Name: res.Name, + ID: res.ID, + Message: res.Message, + Temporary: res.Temporary, + Timeout: res.Timeout, + Fault: res.Fault, + } + return body +} + +// NewQueryInvalidKindResponseBody builds the HTTP response body from the +// result of the "Query" endpoint of the "resource" service. +func NewQueryInvalidKindResponseBody(res *goa.ServiceError) *QueryInvalidKindResponseBody { + body := &QueryInvalidKindResponseBody{ + Name: res.Name, + ID: res.ID, + Message: res.Message, + Temporary: res.Temporary, + Timeout: res.Timeout, + Fault: res.Fault, + } + return body +} + +// NewQueryNotFoundResponseBody builds the HTTP response body from the result +// of the "Query" endpoint of the "resource" service. +func NewQueryNotFoundResponseBody(res *goa.ServiceError) *QueryNotFoundResponseBody { + body := &QueryNotFoundResponseBody{ + Name: res.Name, + ID: res.ID, + Message: res.Message, + Temporary: res.Temporary, + Timeout: res.Timeout, + Fault: res.Fault, + } + return body +} + +// NewListInternalErrorResponseBody builds the HTTP response body from the +// result of the "List" endpoint of the "resource" service. +func NewListInternalErrorResponseBody(res *goa.ServiceError) *ListInternalErrorResponseBody { + body := &ListInternalErrorResponseBody{ + Name: res.Name, + ID: res.ID, + Message: res.Message, + Temporary: res.Temporary, + Timeout: res.Timeout, + Fault: res.Fault, + } + return body +} + +// NewVersionsByIDInternalErrorResponseBody builds the HTTP response body from +// the result of the "VersionsByID" endpoint of the "resource" service. +func NewVersionsByIDInternalErrorResponseBody(res *goa.ServiceError) *VersionsByIDInternalErrorResponseBody { + body := &VersionsByIDInternalErrorResponseBody{ + Name: res.Name, + ID: res.ID, + Message: res.Message, + Temporary: res.Temporary, + Timeout: res.Timeout, + Fault: res.Fault, + } + return body +} + +// NewVersionsByIDNotFoundResponseBody builds the HTTP response body from the +// result of the "VersionsByID" endpoint of the "resource" service. +func NewVersionsByIDNotFoundResponseBody(res *goa.ServiceError) *VersionsByIDNotFoundResponseBody { + body := &VersionsByIDNotFoundResponseBody{ + Name: res.Name, + ID: res.ID, + Message: res.Message, + Temporary: res.Temporary, + Timeout: res.Timeout, + Fault: res.Fault, + } + return body +} + +// NewByCatalogKindNameVersionInternalErrorResponseBody builds the HTTP +// response body from the result of the "ByCatalogKindNameVersion" endpoint of +// the "resource" service. +func NewByCatalogKindNameVersionInternalErrorResponseBody(res *goa.ServiceError) *ByCatalogKindNameVersionInternalErrorResponseBody { + body := &ByCatalogKindNameVersionInternalErrorResponseBody{ + Name: res.Name, + ID: res.ID, + Message: res.Message, + Temporary: res.Temporary, + Timeout: res.Timeout, + Fault: res.Fault, + } + return body +} + +// NewByCatalogKindNameVersionNotFoundResponseBody builds the HTTP response +// body from the result of the "ByCatalogKindNameVersion" endpoint of the +// "resource" service. +func NewByCatalogKindNameVersionNotFoundResponseBody(res *goa.ServiceError) *ByCatalogKindNameVersionNotFoundResponseBody { + body := &ByCatalogKindNameVersionNotFoundResponseBody{ + Name: res.Name, + ID: res.ID, + Message: res.Message, + Temporary: res.Temporary, + Timeout: res.Timeout, + Fault: res.Fault, + } + return body +} + +// NewByVersionIDInternalErrorResponseBody builds the HTTP response body from +// the result of the "ByVersionId" endpoint of the "resource" service. +func NewByVersionIDInternalErrorResponseBody(res *goa.ServiceError) *ByVersionIDInternalErrorResponseBody { + body := &ByVersionIDInternalErrorResponseBody{ + Name: res.Name, + ID: res.ID, + Message: res.Message, + Temporary: res.Temporary, + Timeout: res.Timeout, + Fault: res.Fault, + } + return body +} + +// NewByVersionIDNotFoundResponseBody builds the HTTP response body from the +// result of the "ByVersionId" endpoint of the "resource" service. +func NewByVersionIDNotFoundResponseBody(res *goa.ServiceError) *ByVersionIDNotFoundResponseBody { + body := &ByVersionIDNotFoundResponseBody{ + Name: res.Name, + ID: res.ID, + Message: res.Message, + Temporary: res.Temporary, + Timeout: res.Timeout, + Fault: res.Fault, + } + return body +} + +// NewByCatalogKindNameInternalErrorResponseBody builds the HTTP response body +// from the result of the "ByCatalogKindName" endpoint of the "resource" +// service. +func NewByCatalogKindNameInternalErrorResponseBody(res *goa.ServiceError) *ByCatalogKindNameInternalErrorResponseBody { + body := &ByCatalogKindNameInternalErrorResponseBody{ + Name: res.Name, + ID: res.ID, + Message: res.Message, + Temporary: res.Temporary, + Timeout: res.Timeout, + Fault: res.Fault, + } + return body +} + +// NewByCatalogKindNameNotFoundResponseBody builds the HTTP response body from +// the result of the "ByCatalogKindName" endpoint of the "resource" service. +func NewByCatalogKindNameNotFoundResponseBody(res *goa.ServiceError) *ByCatalogKindNameNotFoundResponseBody { + body := &ByCatalogKindNameNotFoundResponseBody{ + Name: res.Name, + ID: res.ID, + Message: res.Message, + Temporary: res.Temporary, + Timeout: res.Timeout, + Fault: res.Fault, + } + return body +} + +// NewByIDInternalErrorResponseBody builds the HTTP response body from the +// result of the "ById" endpoint of the "resource" service. +func NewByIDInternalErrorResponseBody(res *goa.ServiceError) *ByIDInternalErrorResponseBody { + body := &ByIDInternalErrorResponseBody{ + Name: res.Name, + ID: res.ID, + Message: res.Message, + Temporary: res.Temporary, + Timeout: res.Timeout, + Fault: res.Fault, + } + return body +} + +// NewByIDNotFoundResponseBody builds the HTTP response body from the result of +// the "ById" endpoint of the "resource" service. +func NewByIDNotFoundResponseBody(res *goa.ServiceError) *ByIDNotFoundResponseBody { + body := &ByIDNotFoundResponseBody{ + Name: res.Name, + ID: res.ID, + Message: res.Message, + Temporary: res.Temporary, + Timeout: res.Timeout, + Fault: res.Fault, + } + return body +} + +// NewQueryPayload builds a resource service Query endpoint payload. +func NewQueryPayload(name string, kinds []string, tags []string, limit uint, match string) *resource.QueryPayload { + v := &resource.QueryPayload{} + v.Name = name + v.Kinds = kinds + v.Tags = tags + v.Limit = limit + v.Match = match + + return v +} + +// NewListPayload builds a resource service List endpoint payload. +func NewListPayload(limit uint) *resource.ListPayload { + v := &resource.ListPayload{} + v.Limit = limit + + return v +} + +// NewVersionsByIDPayload builds a resource service VersionsByID endpoint +// payload. +func NewVersionsByIDPayload(id uint) *resource.VersionsByIDPayload { + v := &resource.VersionsByIDPayload{} + v.ID = id + + return v +} + +// NewByCatalogKindNameVersionPayload builds a resource service +// ByCatalogKindNameVersion endpoint payload. +func NewByCatalogKindNameVersionPayload(catalog string, kind string, name string, version string) *resource.ByCatalogKindNameVersionPayload { + v := &resource.ByCatalogKindNameVersionPayload{} + v.Catalog = catalog + v.Kind = kind + v.Name = name + v.Version = version + + return v +} + +// NewByVersionIDPayload builds a resource service ByVersionId endpoint payload. +func NewByVersionIDPayload(versionID uint) *resource.ByVersionIDPayload { + v := &resource.ByVersionIDPayload{} + v.VersionID = versionID + + return v +} + +// NewByCatalogKindNamePayload builds a resource service ByCatalogKindName +// endpoint payload. +func NewByCatalogKindNamePayload(catalog string, kind string, name string) *resource.ByCatalogKindNamePayload { + v := &resource.ByCatalogKindNamePayload{} + v.Catalog = catalog + v.Kind = kind + v.Name = name + + return v +} + +// NewByIDPayload builds a resource service ById endpoint payload. +func NewByIDPayload(id uint) *resource.ByIDPayload { + v := &resource.ByIDPayload{} + v.ID = id + + return v +} diff --git a/api/v1/gen/http/swagger/client/client.go b/api/v1/gen/http/swagger/client/client.go new file mode 100644 index 0000000000..dda14d90ee --- /dev/null +++ b/api/v1/gen/http/swagger/client/client.go @@ -0,0 +1,48 @@ +// Code generated by goa v3.2.2, DO NOT EDIT. +// +// swagger client HTTP transport +// +// Command: +// $ goa gen github.com/tektoncd/hub/api/v1/design + +package client + +import ( + "net/http" + + goahttp "goa.design/goa/v3/http" +) + +// Client lists the swagger service endpoint HTTP clients. +type Client struct { + // CORS Doer is the HTTP client used to make requests to the endpoint. + CORSDoer goahttp.Doer + + // RestoreResponseBody controls whether the response bodies are reset after + // decoding so they can be read again. + RestoreResponseBody bool + + scheme string + host string + encoder func(*http.Request) goahttp.Encoder + decoder func(*http.Response) goahttp.Decoder +} + +// NewClient instantiates HTTP clients for all the swagger service servers. +func NewClient( + scheme string, + host string, + doer goahttp.Doer, + enc func(*http.Request) goahttp.Encoder, + dec func(*http.Response) goahttp.Decoder, + restoreBody bool, +) *Client { + return &Client{ + CORSDoer: doer, + RestoreResponseBody: restoreBody, + scheme: scheme, + host: host, + decoder: dec, + encoder: enc, + } +} diff --git a/api/v1/gen/http/swagger/client/encode_decode.go b/api/v1/gen/http/swagger/client/encode_decode.go new file mode 100644 index 0000000000..b9521fb2c4 --- /dev/null +++ b/api/v1/gen/http/swagger/client/encode_decode.go @@ -0,0 +1,8 @@ +// Code generated by goa v3.2.2, DO NOT EDIT. +// +// swagger HTTP client encoders and decoders +// +// Command: +// $ goa gen github.com/tektoncd/hub/api/v1/design + +package client diff --git a/api/v1/gen/http/swagger/client/paths.go b/api/v1/gen/http/swagger/client/paths.go new file mode 100644 index 0000000000..7f50da45df --- /dev/null +++ b/api/v1/gen/http/swagger/client/paths.go @@ -0,0 +1,8 @@ +// Code generated by goa v3.2.2, DO NOT EDIT. +// +// HTTP request path constructors for the swagger service. +// +// Command: +// $ goa gen github.com/tektoncd/hub/api/v1/design + +package client diff --git a/api/v1/gen/http/swagger/client/types.go b/api/v1/gen/http/swagger/client/types.go new file mode 100644 index 0000000000..67172d77cf --- /dev/null +++ b/api/v1/gen/http/swagger/client/types.go @@ -0,0 +1,8 @@ +// Code generated by goa v3.2.2, DO NOT EDIT. +// +// swagger HTTP client types +// +// Command: +// $ goa gen github.com/tektoncd/hub/api/v1/design + +package client diff --git a/api/v1/gen/http/swagger/server/paths.go b/api/v1/gen/http/swagger/server/paths.go new file mode 100644 index 0000000000..6b1a0ce370 --- /dev/null +++ b/api/v1/gen/http/swagger/server/paths.go @@ -0,0 +1,8 @@ +// Code generated by goa v3.2.2, DO NOT EDIT. +// +// HTTP request path constructors for the swagger service. +// +// Command: +// $ goa gen github.com/tektoncd/hub/api/v1/design + +package server diff --git a/api/v1/gen/http/swagger/server/server.go b/api/v1/gen/http/swagger/server/server.go new file mode 100644 index 0000000000..54dee24094 --- /dev/null +++ b/api/v1/gen/http/swagger/server/server.go @@ -0,0 +1,131 @@ +// Code generated by goa v3.2.2, DO NOT EDIT. +// +// swagger HTTP server +// +// Command: +// $ goa gen github.com/tektoncd/hub/api/v1/design + +package server + +import ( + "context" + "net/http" + + swagger "github.com/tektoncd/hub/api/v1/gen/swagger" + goahttp "goa.design/goa/v3/http" + "goa.design/plugins/v3/cors" +) + +// Server lists the swagger service endpoint HTTP handlers. +type Server struct { + Mounts []*MountPoint + CORS http.Handler +} + +// ErrorNamer is an interface implemented by generated error structs that +// exposes the name of the error as defined in the design. +type ErrorNamer interface { + ErrorName() string +} + +// MountPoint holds information about the mounted endpoints. +type MountPoint struct { + // Method is the name of the service method served by the mounted HTTP handler. + Method string + // Verb is the HTTP method used to match requests to the mounted handler. + Verb string + // Pattern is the HTTP request path pattern used to match requests to the + // mounted handler. + Pattern string +} + +// New instantiates HTTP handlers for all the swagger service endpoints using +// the provided encoder and decoder. The handlers are mounted on the given mux +// using the HTTP verb and path defined in the design. errhandler is called +// whenever a response fails to be encoded. formatter is used to format errors +// returned by the service methods prior to encoding. Both errhandler and +// formatter are optional and can be nil. +func New( + e *swagger.Endpoints, + mux goahttp.Muxer, + decoder func(*http.Request) goahttp.Decoder, + encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, + errhandler func(context.Context, http.ResponseWriter, error), + formatter func(err error) goahttp.Statuser, +) *Server { + return &Server{ + Mounts: []*MountPoint{ + {"CORS", "OPTIONS", "/v1/schema/swagger.json"}, + {"v1/gen/http/openapi3.yaml", "GET", "/v1/schema/swagger.json"}, + }, + CORS: NewCORSHandler(), + } +} + +// Service returns the name of the service served. +func (s *Server) Service() string { return "swagger" } + +// Use wraps the server handlers with the given middleware. +func (s *Server) Use(m func(http.Handler) http.Handler) { + s.CORS = m(s.CORS) +} + +// Mount configures the mux to serve the swagger endpoints. +func Mount(mux goahttp.Muxer, h *Server) { + MountCORSHandler(mux, h.CORS) + MountV1GenHTTPOpenapi3Yaml(mux, http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + http.ServeFile(w, r, "v1/gen/http/openapi3.yaml") + })) +} + +// MountV1GenHTTPOpenapi3Yaml configures the mux to serve GET request made to +// "/v1/schema/swagger.json". +func MountV1GenHTTPOpenapi3Yaml(mux goahttp.Muxer, h http.Handler) { + mux.Handle("GET", "/v1/schema/swagger.json", handleSwaggerOrigin(h).ServeHTTP) +} + +// MountCORSHandler configures the mux to serve the CORS endpoints for the +// service swagger. +func MountCORSHandler(mux goahttp.Muxer, h http.Handler) { + h = handleSwaggerOrigin(h) + f, ok := h.(http.HandlerFunc) + if !ok { + f = func(w http.ResponseWriter, r *http.Request) { + h.ServeHTTP(w, r) + } + } + mux.Handle("OPTIONS", "/v1/schema/swagger.json", f) +} + +// NewCORSHandler creates a HTTP handler which returns a simple 200 response. +func NewCORSHandler() http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(200) + }) +} + +// handleSwaggerOrigin applies the CORS response headers corresponding to the +// origin for the service swagger. +func handleSwaggerOrigin(h http.Handler) http.Handler { + origHndlr := h.(http.HandlerFunc) + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + origin := r.Header.Get("Origin") + if origin == "" { + // Not a CORS request + origHndlr(w, r) + return + } + if cors.MatchOrigin(origin, "*") { + w.Header().Set("Access-Control-Allow-Origin", origin) + w.Header().Set("Access-Control-Allow-Credentials", "false") + if acrm := r.Header.Get("Access-Control-Request-Method"); acrm != "" { + // We are handling a preflight request + w.Header().Set("Access-Control-Allow-Methods", "GET") + } + origHndlr(w, r) + return + } + origHndlr(w, r) + return + }) +} diff --git a/api/v1/gen/http/swagger/server/types.go b/api/v1/gen/http/swagger/server/types.go new file mode 100644 index 0000000000..2d421c7181 --- /dev/null +++ b/api/v1/gen/http/swagger/server/types.go @@ -0,0 +1,8 @@ +// Code generated by goa v3.2.2, DO NOT EDIT. +// +// swagger HTTP server types +// +// Command: +// $ goa gen github.com/tektoncd/hub/api/v1/design + +package server diff --git a/api/v1/gen/log/logger.go b/api/v1/gen/log/logger.go new file mode 100644 index 0000000000..4e296d8846 --- /dev/null +++ b/api/v1/gen/log/logger.go @@ -0,0 +1,35 @@ +// Code generated by goa v3.2.2, DO NOT EDIT. +// +// Zap logger implementation +// +// Command: +// $ goa gen github.com/tektoncd/hub/api/v1/design + +package log + +import ( + "go.uber.org/zap" +) + +// Logger is an adapted zap logger +type Logger struct { + *zap.SugaredLogger +} + +// New creates a new zap logger +func New(serviceName string, production bool) *Logger { + + if production { + l, _ := zap.NewProduction() + return &Logger{l.Sugar().With(zap.String("service", serviceName))} + } else { + l, _ := zap.NewDevelopment() + return &Logger{l.Sugar().With(zap.String("service", serviceName))} + } +} + +// Log is called by the log middleware to log HTTP requests key values +func (logger *Logger) Log(keyvals ...interface{}) error { + logger.Infow("HTTP Request", keyvals...) + return nil +} diff --git a/api/v1/gen/resource/client.go b/api/v1/gen/resource/client.go new file mode 100644 index 0000000000..1d862fcdc7 --- /dev/null +++ b/api/v1/gen/resource/client.go @@ -0,0 +1,110 @@ +// Code generated by goa v3.2.2, DO NOT EDIT. +// +// resource client +// +// Command: +// $ goa gen github.com/tektoncd/hub/api/v1/design + +package resource + +import ( + "context" + + goa "goa.design/goa/v3/pkg" +) + +// Client is the "resource" service client. +type Client struct { + QueryEndpoint goa.Endpoint + ListEndpoint goa.Endpoint + VersionsByIDEndpoint goa.Endpoint + ByCatalogKindNameVersionEndpoint goa.Endpoint + ByVersionIDEndpoint goa.Endpoint + ByCatalogKindNameEndpoint goa.Endpoint + ByIDEndpoint goa.Endpoint +} + +// NewClient initializes a "resource" service client given the endpoints. +func NewClient(query, list, versionsByID, byCatalogKindNameVersion, byVersionID, byCatalogKindName, byID goa.Endpoint) *Client { + return &Client{ + QueryEndpoint: query, + ListEndpoint: list, + VersionsByIDEndpoint: versionsByID, + ByCatalogKindNameVersionEndpoint: byCatalogKindNameVersion, + ByVersionIDEndpoint: byVersionID, + ByCatalogKindNameEndpoint: byCatalogKindName, + ByIDEndpoint: byID, + } +} + +// Query calls the "Query" endpoint of the "resource" service. +func (c *Client) Query(ctx context.Context, p *QueryPayload) (res *Resources, err error) { + var ires interface{} + ires, err = c.QueryEndpoint(ctx, p) + if err != nil { + return + } + return ires.(*Resources), nil +} + +// List calls the "List" endpoint of the "resource" service. +func (c *Client) List(ctx context.Context, p *ListPayload) (res *Resources, err error) { + var ires interface{} + ires, err = c.ListEndpoint(ctx, p) + if err != nil { + return + } + return ires.(*Resources), nil +} + +// VersionsByID calls the "VersionsByID" endpoint of the "resource" service. +func (c *Client) VersionsByID(ctx context.Context, p *VersionsByIDPayload) (res *ResourceVersions, err error) { + var ires interface{} + ires, err = c.VersionsByIDEndpoint(ctx, p) + if err != nil { + return + } + return ires.(*ResourceVersions), nil +} + +// ByCatalogKindNameVersion calls the "ByCatalogKindNameVersion" endpoint of +// the "resource" service. +func (c *Client) ByCatalogKindNameVersion(ctx context.Context, p *ByCatalogKindNameVersionPayload) (res *ResourceVersion, err error) { + var ires interface{} + ires, err = c.ByCatalogKindNameVersionEndpoint(ctx, p) + if err != nil { + return + } + return ires.(*ResourceVersion), nil +} + +// ByVersionID calls the "ByVersionId" endpoint of the "resource" service. +func (c *Client) ByVersionID(ctx context.Context, p *ByVersionIDPayload) (res *ResourceVersion, err error) { + var ires interface{} + ires, err = c.ByVersionIDEndpoint(ctx, p) + if err != nil { + return + } + return ires.(*ResourceVersion), nil +} + +// ByCatalogKindName calls the "ByCatalogKindName" endpoint of the "resource" +// service. +func (c *Client) ByCatalogKindName(ctx context.Context, p *ByCatalogKindNamePayload) (res *Resource, err error) { + var ires interface{} + ires, err = c.ByCatalogKindNameEndpoint(ctx, p) + if err != nil { + return + } + return ires.(*Resource), nil +} + +// ByID calls the "ById" endpoint of the "resource" service. +func (c *Client) ByID(ctx context.Context, p *ByIDPayload) (res *Resource, err error) { + var ires interface{} + ires, err = c.ByIDEndpoint(ctx, p) + if err != nil { + return + } + return ires.(*Resource), nil +} diff --git a/api/v1/gen/resource/endpoints.go b/api/v1/gen/resource/endpoints.go new file mode 100644 index 0000000000..5a103d582a --- /dev/null +++ b/api/v1/gen/resource/endpoints.go @@ -0,0 +1,147 @@ +// Code generated by goa v3.2.2, DO NOT EDIT. +// +// resource endpoints +// +// Command: +// $ goa gen github.com/tektoncd/hub/api/v1/design + +package resource + +import ( + "context" + + goa "goa.design/goa/v3/pkg" +) + +// Endpoints wraps the "resource" service endpoints. +type Endpoints struct { + Query goa.Endpoint + List goa.Endpoint + VersionsByID goa.Endpoint + ByCatalogKindNameVersion goa.Endpoint + ByVersionID goa.Endpoint + ByCatalogKindName goa.Endpoint + ByID goa.Endpoint +} + +// NewEndpoints wraps the methods of the "resource" service with endpoints. +func NewEndpoints(s Service) *Endpoints { + return &Endpoints{ + Query: NewQueryEndpoint(s), + List: NewListEndpoint(s), + VersionsByID: NewVersionsByIDEndpoint(s), + ByCatalogKindNameVersion: NewByCatalogKindNameVersionEndpoint(s), + ByVersionID: NewByVersionIDEndpoint(s), + ByCatalogKindName: NewByCatalogKindNameEndpoint(s), + ByID: NewByIDEndpoint(s), + } +} + +// Use applies the given middleware to all the "resource" service endpoints. +func (e *Endpoints) Use(m func(goa.Endpoint) goa.Endpoint) { + e.Query = m(e.Query) + e.List = m(e.List) + e.VersionsByID = m(e.VersionsByID) + e.ByCatalogKindNameVersion = m(e.ByCatalogKindNameVersion) + e.ByVersionID = m(e.ByVersionID) + e.ByCatalogKindName = m(e.ByCatalogKindName) + e.ByID = m(e.ByID) +} + +// NewQueryEndpoint returns an endpoint function that calls the method "Query" +// of service "resource". +func NewQueryEndpoint(s Service) goa.Endpoint { + return func(ctx context.Context, req interface{}) (interface{}, error) { + p := req.(*QueryPayload) + res, err := s.Query(ctx, p) + if err != nil { + return nil, err + } + vres := NewViewedResources(res, "default") + return vres, nil + } +} + +// NewListEndpoint returns an endpoint function that calls the method "List" of +// service "resource". +func NewListEndpoint(s Service) goa.Endpoint { + return func(ctx context.Context, req interface{}) (interface{}, error) { + p := req.(*ListPayload) + res, err := s.List(ctx, p) + if err != nil { + return nil, err + } + vres := NewViewedResources(res, "default") + return vres, nil + } +} + +// NewVersionsByIDEndpoint returns an endpoint function that calls the method +// "VersionsByID" of service "resource". +func NewVersionsByIDEndpoint(s Service) goa.Endpoint { + return func(ctx context.Context, req interface{}) (interface{}, error) { + p := req.(*VersionsByIDPayload) + res, err := s.VersionsByID(ctx, p) + if err != nil { + return nil, err + } + vres := NewViewedResourceVersions(res, "default") + return vres, nil + } +} + +// NewByCatalogKindNameVersionEndpoint returns an endpoint function that calls +// the method "ByCatalogKindNameVersion" of service "resource". +func NewByCatalogKindNameVersionEndpoint(s Service) goa.Endpoint { + return func(ctx context.Context, req interface{}) (interface{}, error) { + p := req.(*ByCatalogKindNameVersionPayload) + res, err := s.ByCatalogKindNameVersion(ctx, p) + if err != nil { + return nil, err + } + vres := NewViewedResourceVersion(res, "default") + return vres, nil + } +} + +// NewByVersionIDEndpoint returns an endpoint function that calls the method +// "ByVersionId" of service "resource". +func NewByVersionIDEndpoint(s Service) goa.Endpoint { + return func(ctx context.Context, req interface{}) (interface{}, error) { + p := req.(*ByVersionIDPayload) + res, err := s.ByVersionID(ctx, p) + if err != nil { + return nil, err + } + vres := NewViewedResourceVersion(res, "default") + return vres, nil + } +} + +// NewByCatalogKindNameEndpoint returns an endpoint function that calls the +// method "ByCatalogKindName" of service "resource". +func NewByCatalogKindNameEndpoint(s Service) goa.Endpoint { + return func(ctx context.Context, req interface{}) (interface{}, error) { + p := req.(*ByCatalogKindNamePayload) + res, err := s.ByCatalogKindName(ctx, p) + if err != nil { + return nil, err + } + vres := NewViewedResource(res, "default") + return vres, nil + } +} + +// NewByIDEndpoint returns an endpoint function that calls the method "ById" of +// service "resource". +func NewByIDEndpoint(s Service) goa.Endpoint { + return func(ctx context.Context, req interface{}) (interface{}, error) { + p := req.(*ByIDPayload) + res, err := s.ByID(ctx, p) + if err != nil { + return nil, err + } + vres := NewViewedResource(res, "default") + return vres, nil + } +} diff --git a/api/v1/gen/resource/service.go b/api/v1/gen/resource/service.go new file mode 100644 index 0000000000..e489a5382d --- /dev/null +++ b/api/v1/gen/resource/service.go @@ -0,0 +1,945 @@ +// Code generated by goa v3.2.2, DO NOT EDIT. +// +// resource service +// +// Command: +// $ goa gen github.com/tektoncd/hub/api/v1/design + +package resource + +import ( + "context" + + resourceviews "github.com/tektoncd/hub/api/v1/gen/resource/views" + goa "goa.design/goa/v3/pkg" +) + +// The resource service provides details about all kind of resources +type Service interface { + // Find resources by a combination of name, kind and tags + Query(context.Context, *QueryPayload) (res *Resources, err error) + // List all resources sorted by rating and name + List(context.Context, *ListPayload) (res *Resources, err error) + // Find all versions of a resource by its id + VersionsByID(context.Context, *VersionsByIDPayload) (res *ResourceVersions, err error) + // Find resource using name of catalog & name, kind and version of resource + ByCatalogKindNameVersion(context.Context, *ByCatalogKindNameVersionPayload) (res *ResourceVersion, err error) + // Find a resource using its version's id + ByVersionID(context.Context, *ByVersionIDPayload) (res *ResourceVersion, err error) + // Find resources using name of catalog, resource name and kind of resource + ByCatalogKindName(context.Context, *ByCatalogKindNamePayload) (res *Resource, err error) + // Find a resource using it's id + ByID(context.Context, *ByIDPayload) (res *Resource, err error) +} + +// ServiceName is the name of the service as defined in the design. This is the +// same value that is set in the endpoint request contexts under the ServiceKey +// key. +const ServiceName = "resource" + +// MethodNames lists the service method names as defined in the design. These +// are the same values that are set in the endpoint request contexts under the +// MethodKey key. +var MethodNames = [7]string{"Query", "List", "VersionsByID", "ByCatalogKindNameVersion", "ByVersionId", "ByCatalogKindName", "ById"} + +// QueryPayload is the payload type of the resource service Query method. +type QueryPayload struct { + // Name of resource + Name string + // Kinds of resource to filter by + Kinds []string + // Tags associated with a resource to filter by + Tags []string + // Maximum number of resources to be returned + Limit uint + // Strategy used to find matching resources + Match string +} + +// Resources is the result type of the resource service Query method. +type Resources struct { + Data ResourceDataCollection +} + +// ListPayload is the payload type of the resource service List method. +type ListPayload struct { + // Maximum number of resources to be returned + Limit uint +} + +// VersionsByIDPayload is the payload type of the resource service VersionsByID +// method. +type VersionsByIDPayload struct { + // ID of a resource + ID uint +} + +// ResourceVersions is the result type of the resource service VersionsByID +// method. +type ResourceVersions struct { + Data *Versions +} + +// ByCatalogKindNameVersionPayload is the payload type of the resource service +// ByCatalogKindNameVersion method. +type ByCatalogKindNameVersionPayload struct { + // name of catalog + Catalog string + // kind of resource + Kind string + // name of resource + Name string + // version of resource + Version string +} + +// ResourceVersion is the result type of the resource service +// ByCatalogKindNameVersion method. +type ResourceVersion struct { + Data *ResourceVersionData +} + +// ByVersionIDPayload is the payload type of the resource service ByVersionId +// method. +type ByVersionIDPayload struct { + // Version ID of a resource's version + VersionID uint +} + +// ByCatalogKindNamePayload is the payload type of the resource service +// ByCatalogKindName method. +type ByCatalogKindNamePayload struct { + // name of catalog + Catalog string + // kind of resource + Kind string + // Name of resource + Name string +} + +// Resource is the result type of the resource service ByCatalogKindName method. +type Resource struct { + Data *ResourceData +} + +// ByIDPayload is the payload type of the resource service ById method. +type ByIDPayload struct { + // ID of a resource + ID uint +} + +type ResourceDataCollection []*ResourceData + +// The resource type describes resource information. +type ResourceData struct { + // ID is the unique id of the resource + ID uint + // Name of resource + Name string + // Type of catalog to which resource belongs + Catalog *Catalog + // Kind of resource + Kind string + // Latest version of resource + LatestVersion *ResourceVersionData + // Tags related to resource + Tags []*Tag + // Rating of resource + Rating float64 + // List of all versions of a resource + Versions []*ResourceVersionData +} + +type Catalog struct { + // ID is the unique id of the catalog + ID uint + // Name of catalog + Name string + // Type of catalog + Type string +} + +// The Version result type describes resource's version information. +type ResourceVersionData struct { + // ID is the unique id of resource's version + ID uint + // Version of resource + Version string + // Display name of version + DisplayName string + // Description of version + Description string + // Minimum pipelines version the resource's version is compatible with + MinPipelinesVersion string + // Raw URL of resource's yaml file of the version + RawURL string + // Web URL of resource's yaml file of the version + WebURL string + // Timestamp when version was last updated + UpdatedAt string + // Resource to which the version belongs + Resource *ResourceData +} + +type Tag struct { + // ID is the unique id of tag + ID uint + // Name of tag + Name string +} + +// The Versions type describes response for versions by resource id API. +type Versions struct { + // Latest Version of resource + Latest *ResourceVersionData + // List of all versions of resource + Versions []*ResourceVersionData +} + +// MakeInternalError builds a goa.ServiceError from an error. +func MakeInternalError(err error) *goa.ServiceError { + return &goa.ServiceError{ + Name: "internal-error", + ID: goa.NewErrorID(), + Message: err.Error(), + } +} + +// MakeNotFound builds a goa.ServiceError from an error. +func MakeNotFound(err error) *goa.ServiceError { + return &goa.ServiceError{ + Name: "not-found", + ID: goa.NewErrorID(), + Message: err.Error(), + } +} + +// MakeInvalidKind builds a goa.ServiceError from an error. +func MakeInvalidKind(err error) *goa.ServiceError { + return &goa.ServiceError{ + Name: "invalid-kind", + ID: goa.NewErrorID(), + Message: err.Error(), + } +} + +// NewResources initializes result type Resources from viewed result type +// Resources. +func NewResources(vres *resourceviews.Resources) *Resources { + return newResources(vres.Projected) +} + +// NewViewedResources initializes viewed result type Resources from result type +// Resources using the given view. +func NewViewedResources(res *Resources, view string) *resourceviews.Resources { + p := newResourcesView(res) + return &resourceviews.Resources{Projected: p, View: "default"} +} + +// NewResourceVersions initializes result type ResourceVersions from viewed +// result type ResourceVersions. +func NewResourceVersions(vres *resourceviews.ResourceVersions) *ResourceVersions { + return newResourceVersions(vres.Projected) +} + +// NewViewedResourceVersions initializes viewed result type ResourceVersions +// from result type ResourceVersions using the given view. +func NewViewedResourceVersions(res *ResourceVersions, view string) *resourceviews.ResourceVersions { + p := newResourceVersionsView(res) + return &resourceviews.ResourceVersions{Projected: p, View: "default"} +} + +// NewResourceVersion initializes result type ResourceVersion from viewed +// result type ResourceVersion. +func NewResourceVersion(vres *resourceviews.ResourceVersion) *ResourceVersion { + return newResourceVersion(vres.Projected) +} + +// NewViewedResourceVersion initializes viewed result type ResourceVersion from +// result type ResourceVersion using the given view. +func NewViewedResourceVersion(res *ResourceVersion, view string) *resourceviews.ResourceVersion { + p := newResourceVersionView(res) + return &resourceviews.ResourceVersion{Projected: p, View: "default"} +} + +// NewResource initializes result type Resource from viewed result type +// Resource. +func NewResource(vres *resourceviews.Resource) *Resource { + return newResource(vres.Projected) +} + +// NewViewedResource initializes viewed result type Resource from result type +// Resource using the given view. +func NewViewedResource(res *Resource, view string) *resourceviews.Resource { + p := newResourceView(res) + return &resourceviews.Resource{Projected: p, View: "default"} +} + +// newResources converts projected type Resources to service type Resources. +func newResources(vres *resourceviews.ResourcesView) *Resources { + res := &Resources{} + if vres.Data != nil { + res.Data = newResourceDataCollectionWithoutVersion(vres.Data) + } + return res +} + +// newResourcesView projects result type Resources to projected type +// ResourcesView using the "default" view. +func newResourcesView(res *Resources) *resourceviews.ResourcesView { + vres := &resourceviews.ResourcesView{} + if res.Data != nil { + vres.Data = newResourceDataCollectionViewWithoutVersion(res.Data) + } + return vres +} + +// newResourceDataCollectionInfo converts projected type ResourceDataCollection +// to service type ResourceDataCollection. +func newResourceDataCollectionInfo(vres resourceviews.ResourceDataCollectionView) ResourceDataCollection { + res := make(ResourceDataCollection, len(vres)) + for i, n := range vres { + res[i] = newResourceDataInfo(n) + } + return res +} + +// newResourceDataCollectionWithoutVersion converts projected type +// ResourceDataCollection to service type ResourceDataCollection. +func newResourceDataCollectionWithoutVersion(vres resourceviews.ResourceDataCollectionView) ResourceDataCollection { + res := make(ResourceDataCollection, len(vres)) + for i, n := range vres { + res[i] = newResourceDataWithoutVersion(n) + } + return res +} + +// newResourceDataCollection converts projected type ResourceDataCollection to +// service type ResourceDataCollection. +func newResourceDataCollection(vres resourceviews.ResourceDataCollectionView) ResourceDataCollection { + res := make(ResourceDataCollection, len(vres)) + for i, n := range vres { + res[i] = newResourceData(n) + } + return res +} + +// newResourceDataCollectionViewInfo projects result type +// ResourceDataCollection to projected type ResourceDataCollectionView using +// the "info" view. +func newResourceDataCollectionViewInfo(res ResourceDataCollection) resourceviews.ResourceDataCollectionView { + vres := make(resourceviews.ResourceDataCollectionView, len(res)) + for i, n := range res { + vres[i] = newResourceDataViewInfo(n) + } + return vres +} + +// newResourceDataCollectionViewWithoutVersion projects result type +// ResourceDataCollection to projected type ResourceDataCollectionView using +// the "withoutVersion" view. +func newResourceDataCollectionViewWithoutVersion(res ResourceDataCollection) resourceviews.ResourceDataCollectionView { + vres := make(resourceviews.ResourceDataCollectionView, len(res)) + for i, n := range res { + vres[i] = newResourceDataViewWithoutVersion(n) + } + return vres +} + +// newResourceDataCollectionView projects result type ResourceDataCollection to +// projected type ResourceDataCollectionView using the "default" view. +func newResourceDataCollectionView(res ResourceDataCollection) resourceviews.ResourceDataCollectionView { + vres := make(resourceviews.ResourceDataCollectionView, len(res)) + for i, n := range res { + vres[i] = newResourceDataView(n) + } + return vres +} + +// newResourceDataInfo converts projected type ResourceData to service type +// ResourceData. +func newResourceDataInfo(vres *resourceviews.ResourceDataView) *ResourceData { + res := &ResourceData{} + if vres.ID != nil { + res.ID = *vres.ID + } + if vres.Name != nil { + res.Name = *vres.Name + } + if vres.Kind != nil { + res.Kind = *vres.Kind + } + if vres.Rating != nil { + res.Rating = *vres.Rating + } + if vres.Catalog != nil { + res.Catalog = transformResourceviewsCatalogViewToCatalog(vres.Catalog) + } + if vres.Tags != nil { + res.Tags = make([]*Tag, len(vres.Tags)) + for i, val := range vres.Tags { + res.Tags[i] = transformResourceviewsTagViewToTag(val) + } + } + if vres.LatestVersion != nil { + res.LatestVersion = newResourceVersionData(vres.LatestVersion) + } + return res +} + +// newResourceDataWithoutVersion converts projected type ResourceData to +// service type ResourceData. +func newResourceDataWithoutVersion(vres *resourceviews.ResourceDataView) *ResourceData { + res := &ResourceData{} + if vres.ID != nil { + res.ID = *vres.ID + } + if vres.Name != nil { + res.Name = *vres.Name + } + if vres.Kind != nil { + res.Kind = *vres.Kind + } + if vres.Rating != nil { + res.Rating = *vres.Rating + } + if vres.Catalog != nil { + res.Catalog = transformResourceviewsCatalogViewToCatalog(vres.Catalog) + } + if vres.Tags != nil { + res.Tags = make([]*Tag, len(vres.Tags)) + for i, val := range vres.Tags { + res.Tags[i] = transformResourceviewsTagViewToTag(val) + } + } + if vres.LatestVersion != nil { + res.LatestVersion = newResourceVersionDataWithoutResource(vres.LatestVersion) + } + return res +} + +// newResourceData converts projected type ResourceData to service type +// ResourceData. +func newResourceData(vres *resourceviews.ResourceDataView) *ResourceData { + res := &ResourceData{} + if vres.ID != nil { + res.ID = *vres.ID + } + if vres.Name != nil { + res.Name = *vres.Name + } + if vres.Kind != nil { + res.Kind = *vres.Kind + } + if vres.Rating != nil { + res.Rating = *vres.Rating + } + if vres.Catalog != nil { + res.Catalog = transformResourceviewsCatalogViewToCatalog(vres.Catalog) + } + if vres.Tags != nil { + res.Tags = make([]*Tag, len(vres.Tags)) + for i, val := range vres.Tags { + res.Tags[i] = transformResourceviewsTagViewToTag(val) + } + } + if vres.Versions != nil { + res.Versions = make([]*ResourceVersionData, len(vres.Versions)) + for i, val := range vres.Versions { + res.Versions[i] = transformResourceviewsResourceVersionDataViewToResourceVersionData(val) + } + } + if vres.LatestVersion != nil { + res.LatestVersion = newResourceVersionDataWithoutResource(vres.LatestVersion) + } + return res +} + +// newResourceDataViewInfo projects result type ResourceData to projected type +// ResourceDataView using the "info" view. +func newResourceDataViewInfo(res *ResourceData) *resourceviews.ResourceDataView { + vres := &resourceviews.ResourceDataView{ + ID: &res.ID, + Name: &res.Name, + Kind: &res.Kind, + Rating: &res.Rating, + } + if res.Catalog != nil { + vres.Catalog = transformCatalogToResourceviewsCatalogView(res.Catalog) + } + if res.Tags != nil { + vres.Tags = make([]*resourceviews.TagView, len(res.Tags)) + for i, val := range res.Tags { + vres.Tags[i] = transformTagToResourceviewsTagView(val) + } + } + return vres +} + +// newResourceDataViewWithoutVersion projects result type ResourceData to +// projected type ResourceDataView using the "withoutVersion" view. +func newResourceDataViewWithoutVersion(res *ResourceData) *resourceviews.ResourceDataView { + vres := &resourceviews.ResourceDataView{ + ID: &res.ID, + Name: &res.Name, + Kind: &res.Kind, + Rating: &res.Rating, + } + if res.Catalog != nil { + vres.Catalog = transformCatalogToResourceviewsCatalogView(res.Catalog) + } + if res.Tags != nil { + vres.Tags = make([]*resourceviews.TagView, len(res.Tags)) + for i, val := range res.Tags { + vres.Tags[i] = transformTagToResourceviewsTagView(val) + } + } + if res.LatestVersion != nil { + vres.LatestVersion = newResourceVersionDataViewWithoutResource(res.LatestVersion) + } + return vres +} + +// newResourceDataView projects result type ResourceData to projected type +// ResourceDataView using the "default" view. +func newResourceDataView(res *ResourceData) *resourceviews.ResourceDataView { + vres := &resourceviews.ResourceDataView{ + ID: &res.ID, + Name: &res.Name, + Kind: &res.Kind, + Rating: &res.Rating, + } + if res.Catalog != nil { + vres.Catalog = transformCatalogToResourceviewsCatalogView(res.Catalog) + } + if res.Tags != nil { + vres.Tags = make([]*resourceviews.TagView, len(res.Tags)) + for i, val := range res.Tags { + vres.Tags[i] = transformTagToResourceviewsTagView(val) + } + } + if res.Versions != nil { + vres.Versions = make([]*resourceviews.ResourceVersionDataView, len(res.Versions)) + for i, val := range res.Versions { + vres.Versions[i] = transformResourceVersionDataToResourceviewsResourceVersionDataView(val) + } + } + if res.LatestVersion != nil { + vres.LatestVersion = newResourceVersionDataViewWithoutResource(res.LatestVersion) + } + return vres +} + +// newResourceVersionDataTiny converts projected type ResourceVersionData to +// service type ResourceVersionData. +func newResourceVersionDataTiny(vres *resourceviews.ResourceVersionDataView) *ResourceVersionData { + res := &ResourceVersionData{} + if vres.ID != nil { + res.ID = *vres.ID + } + if vres.Version != nil { + res.Version = *vres.Version + } + if vres.Resource != nil { + res.Resource = newResourceData(vres.Resource) + } + return res +} + +// newResourceVersionDataMin converts projected type ResourceVersionData to +// service type ResourceVersionData. +func newResourceVersionDataMin(vres *resourceviews.ResourceVersionDataView) *ResourceVersionData { + res := &ResourceVersionData{} + if vres.ID != nil { + res.ID = *vres.ID + } + if vres.Version != nil { + res.Version = *vres.Version + } + if vres.RawURL != nil { + res.RawURL = *vres.RawURL + } + if vres.WebURL != nil { + res.WebURL = *vres.WebURL + } + if vres.Resource != nil { + res.Resource = newResourceData(vres.Resource) + } + return res +} + +// newResourceVersionDataWithoutResource converts projected type +// ResourceVersionData to service type ResourceVersionData. +func newResourceVersionDataWithoutResource(vres *resourceviews.ResourceVersionDataView) *ResourceVersionData { + res := &ResourceVersionData{} + if vres.ID != nil { + res.ID = *vres.ID + } + if vres.Version != nil { + res.Version = *vres.Version + } + if vres.DisplayName != nil { + res.DisplayName = *vres.DisplayName + } + if vres.Description != nil { + res.Description = *vres.Description + } + if vres.MinPipelinesVersion != nil { + res.MinPipelinesVersion = *vres.MinPipelinesVersion + } + if vres.RawURL != nil { + res.RawURL = *vres.RawURL + } + if vres.WebURL != nil { + res.WebURL = *vres.WebURL + } + if vres.UpdatedAt != nil { + res.UpdatedAt = *vres.UpdatedAt + } + if vres.Resource != nil { + res.Resource = newResourceData(vres.Resource) + } + return res +} + +// newResourceVersionData converts projected type ResourceVersionData to +// service type ResourceVersionData. +func newResourceVersionData(vres *resourceviews.ResourceVersionDataView) *ResourceVersionData { + res := &ResourceVersionData{} + if vres.ID != nil { + res.ID = *vres.ID + } + if vres.Version != nil { + res.Version = *vres.Version + } + if vres.DisplayName != nil { + res.DisplayName = *vres.DisplayName + } + if vres.Description != nil { + res.Description = *vres.Description + } + if vres.MinPipelinesVersion != nil { + res.MinPipelinesVersion = *vres.MinPipelinesVersion + } + if vres.RawURL != nil { + res.RawURL = *vres.RawURL + } + if vres.WebURL != nil { + res.WebURL = *vres.WebURL + } + if vres.UpdatedAt != nil { + res.UpdatedAt = *vres.UpdatedAt + } + if vres.Resource != nil { + res.Resource = newResourceDataInfo(vres.Resource) + } + return res +} + +// newResourceVersionDataViewTiny projects result type ResourceVersionData to +// projected type ResourceVersionDataView using the "tiny" view. +func newResourceVersionDataViewTiny(res *ResourceVersionData) *resourceviews.ResourceVersionDataView { + vres := &resourceviews.ResourceVersionDataView{ + ID: &res.ID, + Version: &res.Version, + } + return vres +} + +// newResourceVersionDataViewMin projects result type ResourceVersionData to +// projected type ResourceVersionDataView using the "min" view. +func newResourceVersionDataViewMin(res *ResourceVersionData) *resourceviews.ResourceVersionDataView { + vres := &resourceviews.ResourceVersionDataView{ + ID: &res.ID, + Version: &res.Version, + RawURL: &res.RawURL, + WebURL: &res.WebURL, + } + return vres +} + +// newResourceVersionDataViewWithoutResource projects result type +// ResourceVersionData to projected type ResourceVersionDataView using the +// "withoutResource" view. +func newResourceVersionDataViewWithoutResource(res *ResourceVersionData) *resourceviews.ResourceVersionDataView { + vres := &resourceviews.ResourceVersionDataView{ + ID: &res.ID, + Version: &res.Version, + DisplayName: &res.DisplayName, + Description: &res.Description, + MinPipelinesVersion: &res.MinPipelinesVersion, + RawURL: &res.RawURL, + WebURL: &res.WebURL, + UpdatedAt: &res.UpdatedAt, + } + return vres +} + +// newResourceVersionDataView projects result type ResourceVersionData to +// projected type ResourceVersionDataView using the "default" view. +func newResourceVersionDataView(res *ResourceVersionData) *resourceviews.ResourceVersionDataView { + vres := &resourceviews.ResourceVersionDataView{ + ID: &res.ID, + Version: &res.Version, + DisplayName: &res.DisplayName, + Description: &res.Description, + MinPipelinesVersion: &res.MinPipelinesVersion, + RawURL: &res.RawURL, + WebURL: &res.WebURL, + UpdatedAt: &res.UpdatedAt, + } + if res.Resource != nil { + vres.Resource = newResourceDataViewInfo(res.Resource) + } + return vres +} + +// newResourceVersions converts projected type ResourceVersions to service type +// ResourceVersions. +func newResourceVersions(vres *resourceviews.ResourceVersionsView) *ResourceVersions { + res := &ResourceVersions{} + if vres.Data != nil { + res.Data = newVersions(vres.Data) + } + return res +} + +// newResourceVersionsView projects result type ResourceVersions to projected +// type ResourceVersionsView using the "default" view. +func newResourceVersionsView(res *ResourceVersions) *resourceviews.ResourceVersionsView { + vres := &resourceviews.ResourceVersionsView{} + if res.Data != nil { + vres.Data = newVersionsView(res.Data) + } + return vres +} + +// newVersions converts projected type Versions to service type Versions. +func newVersions(vres *resourceviews.VersionsView) *Versions { + res := &Versions{} + if vres.Versions != nil { + res.Versions = make([]*ResourceVersionData, len(vres.Versions)) + for i, val := range vres.Versions { + res.Versions[i] = transformResourceviewsResourceVersionDataViewToResourceVersionData(val) + } + } + if vres.Latest != nil { + res.Latest = newResourceVersionDataMin(vres.Latest) + } + return res +} + +// newVersionsView projects result type Versions to projected type VersionsView +// using the "default" view. +func newVersionsView(res *Versions) *resourceviews.VersionsView { + vres := &resourceviews.VersionsView{} + if res.Versions != nil { + vres.Versions = make([]*resourceviews.ResourceVersionDataView, len(res.Versions)) + for i, val := range res.Versions { + vres.Versions[i] = transformResourceVersionDataToResourceviewsResourceVersionDataView(val) + } + } + if res.Latest != nil { + vres.Latest = newResourceVersionDataViewMin(res.Latest) + } + return vres +} + +// newResourceVersion converts projected type ResourceVersion to service type +// ResourceVersion. +func newResourceVersion(vres *resourceviews.ResourceVersionView) *ResourceVersion { + res := &ResourceVersion{} + if vres.Data != nil { + res.Data = newResourceVersionData(vres.Data) + } + return res +} + +// newResourceVersionView projects result type ResourceVersion to projected +// type ResourceVersionView using the "default" view. +func newResourceVersionView(res *ResourceVersion) *resourceviews.ResourceVersionView { + vres := &resourceviews.ResourceVersionView{} + if res.Data != nil { + vres.Data = newResourceVersionDataView(res.Data) + } + return vres +} + +// newResource converts projected type Resource to service type Resource. +func newResource(vres *resourceviews.ResourceView) *Resource { + res := &Resource{} + if vres.Data != nil { + res.Data = newResourceData(vres.Data) + } + return res +} + +// newResourceView projects result type Resource to projected type ResourceView +// using the "default" view. +func newResourceView(res *Resource) *resourceviews.ResourceView { + vres := &resourceviews.ResourceView{} + if res.Data != nil { + vres.Data = newResourceDataView(res.Data) + } + return vres +} + +// transformResourceviewsCatalogViewToCatalog builds a value of type *Catalog +// from a value of type *resourceviews.CatalogView. +func transformResourceviewsCatalogViewToCatalog(v *resourceviews.CatalogView) *Catalog { + if v == nil { + return nil + } + res := &Catalog{ + ID: *v.ID, + Name: *v.Name, + Type: *v.Type, + } + + return res +} + +// transformResourceviewsTagViewToTag builds a value of type *Tag from a value +// of type *resourceviews.TagView. +func transformResourceviewsTagViewToTag(v *resourceviews.TagView) *Tag { + if v == nil { + return nil + } + res := &Tag{ + ID: *v.ID, + Name: *v.Name, + } + + return res +} + +// transformResourceviewsResourceVersionDataViewToResourceVersionData builds a +// value of type *ResourceVersionData from a value of type +// *resourceviews.ResourceVersionDataView. +func transformResourceviewsResourceVersionDataViewToResourceVersionData(v *resourceviews.ResourceVersionDataView) *ResourceVersionData { + if v == nil { + return nil + } + res := &ResourceVersionData{ + ID: *v.ID, + Version: *v.Version, + DisplayName: *v.DisplayName, + Description: *v.Description, + MinPipelinesVersion: *v.MinPipelinesVersion, + RawURL: *v.RawURL, + WebURL: *v.WebURL, + UpdatedAt: *v.UpdatedAt, + } + if v.Resource != nil { + res.Resource = transformResourceviewsResourceDataViewToResourceData(v.Resource) + } + + return res +} + +// transformResourceviewsResourceDataViewToResourceData builds a value of type +// *ResourceData from a value of type *resourceviews.ResourceDataView. +func transformResourceviewsResourceDataViewToResourceData(v *resourceviews.ResourceDataView) *ResourceData { + res := &ResourceData{} + if v.ID != nil { + res.ID = *v.ID + } + if v.Name != nil { + res.Name = *v.Name + } + if v.Kind != nil { + res.Kind = *v.Kind + } + if v.Rating != nil { + res.Rating = *v.Rating + } + if v.Catalog != nil { + res.Catalog = transformResourceviewsCatalogViewToCatalog(v.Catalog) + } + if v.Tags != nil { + res.Tags = make([]*Tag, len(v.Tags)) + for i, val := range v.Tags { + res.Tags[i] = transformResourceviewsTagViewToTag(val) + } + } + if v.Versions != nil { + res.Versions = make([]*ResourceVersionData, len(v.Versions)) + for i, val := range v.Versions { + res.Versions[i] = transformResourceviewsResourceVersionDataViewToResourceVersionData(val) + } + } + + return res +} + +// transformCatalogToResourceviewsCatalogView builds a value of type +// *resourceviews.CatalogView from a value of type *Catalog. +func transformCatalogToResourceviewsCatalogView(v *Catalog) *resourceviews.CatalogView { + res := &resourceviews.CatalogView{ + ID: &v.ID, + Name: &v.Name, + Type: &v.Type, + } + + return res +} + +// transformTagToResourceviewsTagView builds a value of type +// *resourceviews.TagView from a value of type *Tag. +func transformTagToResourceviewsTagView(v *Tag) *resourceviews.TagView { + res := &resourceviews.TagView{ + ID: &v.ID, + Name: &v.Name, + } + + return res +} + +// transformResourceVersionDataToResourceviewsResourceVersionDataView builds a +// value of type *resourceviews.ResourceVersionDataView from a value of type +// *ResourceVersionData. +func transformResourceVersionDataToResourceviewsResourceVersionDataView(v *ResourceVersionData) *resourceviews.ResourceVersionDataView { + res := &resourceviews.ResourceVersionDataView{ + ID: &v.ID, + Version: &v.Version, + DisplayName: &v.DisplayName, + Description: &v.Description, + MinPipelinesVersion: &v.MinPipelinesVersion, + RawURL: &v.RawURL, + WebURL: &v.WebURL, + UpdatedAt: &v.UpdatedAt, + } + if v.Resource != nil { + res.Resource = transformResourceDataToResourceviewsResourceDataView(v.Resource) + } + + return res +} + +// transformResourceDataToResourceviewsResourceDataView builds a value of type +// *resourceviews.ResourceDataView from a value of type *ResourceData. +func transformResourceDataToResourceviewsResourceDataView(v *ResourceData) *resourceviews.ResourceDataView { + res := &resourceviews.ResourceDataView{ + ID: &v.ID, + Name: &v.Name, + Kind: &v.Kind, + Rating: &v.Rating, + } + if v.Catalog != nil { + res.Catalog = transformCatalogToResourceviewsCatalogView(v.Catalog) + } + if v.Tags != nil { + res.Tags = make([]*resourceviews.TagView, len(v.Tags)) + for i, val := range v.Tags { + res.Tags[i] = transformTagToResourceviewsTagView(val) + } + } + if v.Versions != nil { + res.Versions = make([]*resourceviews.ResourceVersionDataView, len(v.Versions)) + for i, val := range v.Versions { + res.Versions[i] = transformResourceVersionDataToResourceviewsResourceVersionDataView(val) + } + } + + return res +} diff --git a/api/v1/gen/resource/views/view.go b/api/v1/gen/resource/views/view.go new file mode 100644 index 0000000000..6208065788 --- /dev/null +++ b/api/v1/gen/resource/views/view.go @@ -0,0 +1,699 @@ +// Code generated by goa v3.2.2, DO NOT EDIT. +// +// resource views +// +// Command: +// $ goa gen github.com/tektoncd/hub/api/v1/design + +package views + +import ( + goa "goa.design/goa/v3/pkg" +) + +// Resources is the viewed result type that is projected based on a view. +type Resources struct { + // Type to project + Projected *ResourcesView + // View to render + View string +} + +// ResourceVersions is the viewed result type that is projected based on a view. +type ResourceVersions struct { + // Type to project + Projected *ResourceVersionsView + // View to render + View string +} + +// ResourceVersion is the viewed result type that is projected based on a view. +type ResourceVersion struct { + // Type to project + Projected *ResourceVersionView + // View to render + View string +} + +// Resource is the viewed result type that is projected based on a view. +type Resource struct { + // Type to project + Projected *ResourceView + // View to render + View string +} + +// ResourcesView is a type that runs validations on a projected type. +type ResourcesView struct { + Data ResourceDataCollectionView +} + +// ResourceDataCollectionView is a type that runs validations on a projected +// type. +type ResourceDataCollectionView []*ResourceDataView + +// ResourceDataView is a type that runs validations on a projected type. +type ResourceDataView struct { + // ID is the unique id of the resource + ID *uint + // Name of resource + Name *string + // Type of catalog to which resource belongs + Catalog *CatalogView + // Kind of resource + Kind *string + // Latest version of resource + LatestVersion *ResourceVersionDataView + // Tags related to resource + Tags []*TagView + // Rating of resource + Rating *float64 + // List of all versions of a resource + Versions []*ResourceVersionDataView +} + +// CatalogView is a type that runs validations on a projected type. +type CatalogView struct { + // ID is the unique id of the catalog + ID *uint + // Name of catalog + Name *string + // Type of catalog + Type *string +} + +// ResourceVersionDataView is a type that runs validations on a projected type. +type ResourceVersionDataView struct { + // ID is the unique id of resource's version + ID *uint + // Version of resource + Version *string + // Display name of version + DisplayName *string + // Description of version + Description *string + // Minimum pipelines version the resource's version is compatible with + MinPipelinesVersion *string + // Raw URL of resource's yaml file of the version + RawURL *string + // Web URL of resource's yaml file of the version + WebURL *string + // Timestamp when version was last updated + UpdatedAt *string + // Resource to which the version belongs + Resource *ResourceDataView +} + +// TagView is a type that runs validations on a projected type. +type TagView struct { + // ID is the unique id of tag + ID *uint + // Name of tag + Name *string +} + +// ResourceVersionsView is a type that runs validations on a projected type. +type ResourceVersionsView struct { + Data *VersionsView +} + +// VersionsView is a type that runs validations on a projected type. +type VersionsView struct { + // Latest Version of resource + Latest *ResourceVersionDataView + // List of all versions of resource + Versions []*ResourceVersionDataView +} + +// ResourceVersionView is a type that runs validations on a projected type. +type ResourceVersionView struct { + Data *ResourceVersionDataView +} + +// ResourceView is a type that runs validations on a projected type. +type ResourceView struct { + Data *ResourceDataView +} + +var ( + // ResourcesMap is a map of attribute names in result type Resources indexed by + // view name. + ResourcesMap = map[string][]string{ + "default": []string{ + "data", + }, + } + // ResourceVersionsMap is a map of attribute names in result type + // ResourceVersions indexed by view name. + ResourceVersionsMap = map[string][]string{ + "default": []string{ + "data", + }, + } + // ResourceVersionMap is a map of attribute names in result type + // ResourceVersion indexed by view name. + ResourceVersionMap = map[string][]string{ + "default": []string{ + "data", + }, + } + // ResourceMap is a map of attribute names in result type Resource indexed by + // view name. + ResourceMap = map[string][]string{ + "default": []string{ + "data", + }, + } + // ResourceDataCollectionMap is a map of attribute names in result type + // ResourceDataCollection indexed by view name. + ResourceDataCollectionMap = map[string][]string{ + "info": []string{ + "id", + "name", + "catalog", + "kind", + "tags", + "rating", + }, + "withoutVersion": []string{ + "id", + "name", + "catalog", + "kind", + "latestVersion", + "tags", + "rating", + }, + "default": []string{ + "id", + "name", + "catalog", + "kind", + "latestVersion", + "tags", + "rating", + "versions", + }, + } + // ResourceDataMap is a map of attribute names in result type ResourceData + // indexed by view name. + ResourceDataMap = map[string][]string{ + "info": []string{ + "id", + "name", + "catalog", + "kind", + "tags", + "rating", + }, + "withoutVersion": []string{ + "id", + "name", + "catalog", + "kind", + "latestVersion", + "tags", + "rating", + }, + "default": []string{ + "id", + "name", + "catalog", + "kind", + "latestVersion", + "tags", + "rating", + "versions", + }, + } + // ResourceVersionDataMap is a map of attribute names in result type + // ResourceVersionData indexed by view name. + ResourceVersionDataMap = map[string][]string{ + "tiny": []string{ + "id", + "version", + }, + "min": []string{ + "id", + "version", + "rawURL", + "webURL", + }, + "withoutResource": []string{ + "id", + "version", + "displayName", + "description", + "minPipelinesVersion", + "rawURL", + "webURL", + "updatedAt", + }, + "default": []string{ + "id", + "version", + "displayName", + "description", + "minPipelinesVersion", + "rawURL", + "webURL", + "updatedAt", + "resource", + }, + } + // VersionsMap is a map of attribute names in result type Versions indexed by + // view name. + VersionsMap = map[string][]string{ + "default": []string{ + "latest", + "versions", + }, + } +) + +// ValidateResources runs the validations defined on the viewed result type +// Resources. +func ValidateResources(result *Resources) (err error) { + switch result.View { + case "default", "": + err = ValidateResourcesView(result.Projected) + default: + err = goa.InvalidEnumValueError("view", result.View, []interface{}{"default"}) + } + return +} + +// ValidateResourceVersions runs the validations defined on the viewed result +// type ResourceVersions. +func ValidateResourceVersions(result *ResourceVersions) (err error) { + switch result.View { + case "default", "": + err = ValidateResourceVersionsView(result.Projected) + default: + err = goa.InvalidEnumValueError("view", result.View, []interface{}{"default"}) + } + return +} + +// ValidateResourceVersion runs the validations defined on the viewed result +// type ResourceVersion. +func ValidateResourceVersion(result *ResourceVersion) (err error) { + switch result.View { + case "default", "": + err = ValidateResourceVersionView(result.Projected) + default: + err = goa.InvalidEnumValueError("view", result.View, []interface{}{"default"}) + } + return +} + +// ValidateResource runs the validations defined on the viewed result type +// Resource. +func ValidateResource(result *Resource) (err error) { + switch result.View { + case "default", "": + err = ValidateResourceView(result.Projected) + default: + err = goa.InvalidEnumValueError("view", result.View, []interface{}{"default"}) + } + return +} + +// ValidateResourcesView runs the validations defined on ResourcesView using +// the "default" view. +func ValidateResourcesView(result *ResourcesView) (err error) { + + if result.Data != nil { + if err2 := ValidateResourceDataCollectionViewWithoutVersion(result.Data); err2 != nil { + err = goa.MergeErrors(err, err2) + } + } + return +} + +// ValidateResourceDataCollectionViewInfo runs the validations defined on +// ResourceDataCollectionView using the "info" view. +func ValidateResourceDataCollectionViewInfo(result ResourceDataCollectionView) (err error) { + for _, item := range result { + if err2 := ValidateResourceDataViewInfo(item); err2 != nil { + err = goa.MergeErrors(err, err2) + } + } + return +} + +// ValidateResourceDataCollectionViewWithoutVersion runs the validations +// defined on ResourceDataCollectionView using the "withoutVersion" view. +func ValidateResourceDataCollectionViewWithoutVersion(result ResourceDataCollectionView) (err error) { + for _, item := range result { + if err2 := ValidateResourceDataViewWithoutVersion(item); err2 != nil { + err = goa.MergeErrors(err, err2) + } + } + return +} + +// ValidateResourceDataCollectionView runs the validations defined on +// ResourceDataCollectionView using the "default" view. +func ValidateResourceDataCollectionView(result ResourceDataCollectionView) (err error) { + for _, item := range result { + if err2 := ValidateResourceDataView(item); err2 != nil { + err = goa.MergeErrors(err, err2) + } + } + return +} + +// ValidateResourceDataViewInfo runs the validations defined on +// ResourceDataView using the "info" view. +func ValidateResourceDataViewInfo(result *ResourceDataView) (err error) { + if result.ID == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("id", "result")) + } + if result.Name == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("name", "result")) + } + if result.Catalog == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("catalog", "result")) + } + if result.Kind == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("kind", "result")) + } + if result.Tags == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("tags", "result")) + } + if result.Rating == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("rating", "result")) + } + if result.Catalog != nil { + if err2 := ValidateCatalogView(result.Catalog); err2 != nil { + err = goa.MergeErrors(err, err2) + } + } + for _, e := range result.Tags { + if e != nil { + if err2 := ValidateTagView(e); err2 != nil { + err = goa.MergeErrors(err, err2) + } + } + } + return +} + +// ValidateResourceDataViewWithoutVersion runs the validations defined on +// ResourceDataView using the "withoutVersion" view. +func ValidateResourceDataViewWithoutVersion(result *ResourceDataView) (err error) { + if result.ID == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("id", "result")) + } + if result.Name == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("name", "result")) + } + if result.Catalog == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("catalog", "result")) + } + if result.Kind == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("kind", "result")) + } + if result.Tags == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("tags", "result")) + } + if result.Rating == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("rating", "result")) + } + if result.Catalog != nil { + if err2 := ValidateCatalogView(result.Catalog); err2 != nil { + err = goa.MergeErrors(err, err2) + } + } + for _, e := range result.Tags { + if e != nil { + if err2 := ValidateTagView(e); err2 != nil { + err = goa.MergeErrors(err, err2) + } + } + } + if result.LatestVersion != nil { + if err2 := ValidateResourceVersionDataViewWithoutResource(result.LatestVersion); err2 != nil { + err = goa.MergeErrors(err, err2) + } + } + return +} + +// ValidateResourceDataView runs the validations defined on ResourceDataView +// using the "default" view. +func ValidateResourceDataView(result *ResourceDataView) (err error) { + if result.ID == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("id", "result")) + } + if result.Name == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("name", "result")) + } + if result.Catalog == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("catalog", "result")) + } + if result.Kind == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("kind", "result")) + } + if result.Tags == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("tags", "result")) + } + if result.Rating == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("rating", "result")) + } + if result.Versions == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("versions", "result")) + } + if result.Catalog != nil { + if err2 := ValidateCatalogView(result.Catalog); err2 != nil { + err = goa.MergeErrors(err, err2) + } + } + for _, e := range result.Tags { + if e != nil { + if err2 := ValidateTagView(e); err2 != nil { + err = goa.MergeErrors(err, err2) + } + } + } + for _, e := range result.Versions { + if e != nil { + if err2 := ValidateResourceVersionDataView(e); err2 != nil { + err = goa.MergeErrors(err, err2) + } + } + } + if result.LatestVersion != nil { + if err2 := ValidateResourceVersionDataViewWithoutResource(result.LatestVersion); err2 != nil { + err = goa.MergeErrors(err, err2) + } + } + return +} + +// ValidateCatalogView runs the validations defined on CatalogView. +func ValidateCatalogView(result *CatalogView) (err error) { + if result.ID == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("id", "result")) + } + if result.Name == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("name", "result")) + } + if result.Type == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("type", "result")) + } + if result.Type != nil { + if !(*result.Type == "official" || *result.Type == "community") { + err = goa.MergeErrors(err, goa.InvalidEnumValueError("result.type", *result.Type, []interface{}{"official", "community"})) + } + } + return +} + +// ValidateResourceVersionDataViewTiny runs the validations defined on +// ResourceVersionDataView using the "tiny" view. +func ValidateResourceVersionDataViewTiny(result *ResourceVersionDataView) (err error) { + if result.ID == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("id", "result")) + } + if result.Version == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("version", "result")) + } + return +} + +// ValidateResourceVersionDataViewMin runs the validations defined on +// ResourceVersionDataView using the "min" view. +func ValidateResourceVersionDataViewMin(result *ResourceVersionDataView) (err error) { + if result.ID == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("id", "result")) + } + if result.Version == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("version", "result")) + } + if result.RawURL == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("rawURL", "result")) + } + if result.WebURL == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("webURL", "result")) + } + if result.RawURL != nil { + err = goa.MergeErrors(err, goa.ValidateFormat("result.rawURL", *result.RawURL, goa.FormatURI)) + } + if result.WebURL != nil { + err = goa.MergeErrors(err, goa.ValidateFormat("result.webURL", *result.WebURL, goa.FormatURI)) + } + return +} + +// ValidateResourceVersionDataViewWithoutResource runs the validations defined +// on ResourceVersionDataView using the "withoutResource" view. +func ValidateResourceVersionDataViewWithoutResource(result *ResourceVersionDataView) (err error) { + if result.ID == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("id", "result")) + } + if result.Version == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("version", "result")) + } + if result.DisplayName == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("displayName", "result")) + } + if result.Description == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("description", "result")) + } + if result.MinPipelinesVersion == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("minPipelinesVersion", "result")) + } + if result.RawURL == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("rawURL", "result")) + } + if result.WebURL == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("webURL", "result")) + } + if result.UpdatedAt == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("updatedAt", "result")) + } + if result.RawURL != nil { + err = goa.MergeErrors(err, goa.ValidateFormat("result.rawURL", *result.RawURL, goa.FormatURI)) + } + if result.WebURL != nil { + err = goa.MergeErrors(err, goa.ValidateFormat("result.webURL", *result.WebURL, goa.FormatURI)) + } + if result.UpdatedAt != nil { + err = goa.MergeErrors(err, goa.ValidateFormat("result.updatedAt", *result.UpdatedAt, goa.FormatDateTime)) + } + return +} + +// ValidateResourceVersionDataView runs the validations defined on +// ResourceVersionDataView using the "default" view. +func ValidateResourceVersionDataView(result *ResourceVersionDataView) (err error) { + if result.ID == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("id", "result")) + } + if result.Version == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("version", "result")) + } + if result.DisplayName == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("displayName", "result")) + } + if result.Description == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("description", "result")) + } + if result.MinPipelinesVersion == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("minPipelinesVersion", "result")) + } + if result.RawURL == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("rawURL", "result")) + } + if result.WebURL == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("webURL", "result")) + } + if result.UpdatedAt == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("updatedAt", "result")) + } + if result.RawURL != nil { + err = goa.MergeErrors(err, goa.ValidateFormat("result.rawURL", *result.RawURL, goa.FormatURI)) + } + if result.WebURL != nil { + err = goa.MergeErrors(err, goa.ValidateFormat("result.webURL", *result.WebURL, goa.FormatURI)) + } + if result.UpdatedAt != nil { + err = goa.MergeErrors(err, goa.ValidateFormat("result.updatedAt", *result.UpdatedAt, goa.FormatDateTime)) + } + if result.Resource != nil { + if err2 := ValidateResourceDataViewInfo(result.Resource); err2 != nil { + err = goa.MergeErrors(err, err2) + } + } + return +} + +// ValidateTagView runs the validations defined on TagView. +func ValidateTagView(result *TagView) (err error) { + if result.ID == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("id", "result")) + } + if result.Name == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("name", "result")) + } + return +} + +// ValidateResourceVersionsView runs the validations defined on +// ResourceVersionsView using the "default" view. +func ValidateResourceVersionsView(result *ResourceVersionsView) (err error) { + + if result.Data != nil { + if err2 := ValidateVersionsView(result.Data); err2 != nil { + err = goa.MergeErrors(err, err2) + } + } + return +} + +// ValidateVersionsView runs the validations defined on VersionsView using the +// "default" view. +func ValidateVersionsView(result *VersionsView) (err error) { + if result.Versions == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("versions", "result")) + } + for _, e := range result.Versions { + if e != nil { + if err2 := ValidateResourceVersionDataView(e); err2 != nil { + err = goa.MergeErrors(err, err2) + } + } + } + if result.Latest != nil { + if err2 := ValidateResourceVersionDataViewMin(result.Latest); err2 != nil { + err = goa.MergeErrors(err, err2) + } + } + return +} + +// ValidateResourceVersionView runs the validations defined on +// ResourceVersionView using the "default" view. +func ValidateResourceVersionView(result *ResourceVersionView) (err error) { + + if result.Data != nil { + if err2 := ValidateResourceVersionDataView(result.Data); err2 != nil { + err = goa.MergeErrors(err, err2) + } + } + return +} + +// ValidateResourceView runs the validations defined on ResourceView using the +// "default" view. +func ValidateResourceView(result *ResourceView) (err error) { + + if result.Data != nil { + if err2 := ValidateResourceDataView(result.Data); err2 != nil { + err = goa.MergeErrors(err, err2) + } + } + return +} diff --git a/api/v1/gen/swagger/client.go b/api/v1/gen/swagger/client.go new file mode 100644 index 0000000000..ac9352267d --- /dev/null +++ b/api/v1/gen/swagger/client.go @@ -0,0 +1,21 @@ +// Code generated by goa v3.2.2, DO NOT EDIT. +// +// swagger client +// +// Command: +// $ goa gen github.com/tektoncd/hub/api/v1/design + +package swagger + +import ( + goa "goa.design/goa/v3/pkg" +) + +// Client is the "swagger" service client. +type Client struct { +} + +// NewClient initializes a "swagger" service client given the endpoints. +func NewClient(goa.Endpoint) *Client { + return &Client{} +} diff --git a/api/v1/gen/swagger/endpoints.go b/api/v1/gen/swagger/endpoints.go new file mode 100644 index 0000000000..2655340373 --- /dev/null +++ b/api/v1/gen/swagger/endpoints.go @@ -0,0 +1,25 @@ +// Code generated by goa v3.2.2, DO NOT EDIT. +// +// swagger endpoints +// +// Command: +// $ goa gen github.com/tektoncd/hub/api/v1/design + +package swagger + +import ( + goa "goa.design/goa/v3/pkg" +) + +// Endpoints wraps the "swagger" service endpoints. +type Endpoints struct { +} + +// NewEndpoints wraps the methods of the "swagger" service with endpoints. +func NewEndpoints(s Service) *Endpoints { + return &Endpoints{} +} + +// Use applies the given middleware to all the "swagger" service endpoints. +func (e *Endpoints) Use(m func(goa.Endpoint) goa.Endpoint) { +} diff --git a/api/v1/gen/swagger/service.go b/api/v1/gen/swagger/service.go new file mode 100644 index 0000000000..dcdd8753a0 --- /dev/null +++ b/api/v1/gen/swagger/service.go @@ -0,0 +1,22 @@ +// Code generated by goa v3.2.2, DO NOT EDIT. +// +// swagger service +// +// Command: +// $ goa gen github.com/tektoncd/hub/api/v1/design + +package swagger + +// The swagger service serves the API swagger definition. +type Service interface { +} + +// ServiceName is the name of the service as defined in the design. This is the +// same value that is set in the endpoint request contexts under the ServiceKey +// key. +const ServiceName = "swagger" + +// MethodNames lists the service method names as defined in the design. These +// are the same values that are set in the endpoint request contexts under the +// MethodKey key. +var MethodNames = [0]string{} diff --git a/api/v1/service/resource/resource.go b/api/v1/service/resource/resource.go new file mode 100644 index 0000000000..88a0a1c5f4 --- /dev/null +++ b/api/v1/service/resource/resource.go @@ -0,0 +1,341 @@ +// Copyright © 2020 The Tekton Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package resource + +import ( + "context" + "fmt" + "strings" + "time" + + "github.com/tektoncd/hub/api/pkg/app" + "github.com/tektoncd/hub/api/pkg/db/model" + res "github.com/tektoncd/hub/api/pkg/shared/resource" + "github.com/tektoncd/hub/api/v1/gen/resource" +) + +type service struct { + app.Service +} + +var replaceGHtoRaw = strings.NewReplacer("github.com", "raw.githubusercontent.com", "/tree/", "/") + +// New returns the resource service implementation. +func New(api app.BaseConfig) resource.Service { + return &service{api.Service("resource")} +} + +// Find resources based on name, kind or both +func (s *service) Query(ctx context.Context, p *resource.QueryPayload) (*resource.Resources, error) { + + req := res.Request{ + Db: s.DB(ctx), + Log: s.Logger(ctx), + Name: p.Name, + Kinds: p.Kinds, + Tags: p.Tags, + Limit: p.Limit, + Match: p.Match, + } + + rArr, err := req.Query() + if err != nil { + if strings.Contains(err.Error(), "not supported") { + return nil, resource.MakeInvalidKind(err) + } + if err == res.NotFoundError { + return nil, resource.MakeNotFound(err) + } + if err == res.FetchError { + return nil, resource.MakeInternalError(err) + } + } + + var rd []*resource.ResourceData + for _, r := range rArr { + rd = append(rd, initResource(r)) + } + + return &resource.Resources{Data: rd}, nil +} + +// List all resources sorted by rating and name +func (s *service) List(ctx context.Context, p *resource.ListPayload) (*resource.Resources, error) { + + req := res.Request{ + Db: s.DB(ctx), + Log: s.Logger(ctx), + Limit: p.Limit, + } + + rArr, err := req.AllResources() + if err != nil { + if err == res.NotFoundError { + return nil, resource.MakeNotFound(err) + } + if err == res.FetchError { + return nil, resource.MakeInternalError(err) + } + } + + var rd []*resource.ResourceData + for _, r := range rArr { + rd = append(rd, initResource(r)) + } + + return &resource.Resources{Data: rd}, nil +} + +// VersionsByID returns all versions of a resource given its resource id +func (s *service) VersionsByID(ctx context.Context, p *resource.VersionsByIDPayload) (*resource.ResourceVersions, error) { + + req := res.Request{ + Db: s.DB(ctx), + Log: s.Logger(ctx), + ID: p.ID, + } + + versions, err := req.AllVersions() + if err != nil { + if err == res.FetchError { + return nil, resource.MakeInternalError(err) + } + if err == res.NotFoundError { + return nil, resource.MakeNotFound(err) + } + } + + var rv resource.Versions + rv.Versions = []*resource.ResourceVersionData{} + for _, r := range versions { + rv.Versions = append(rv.Versions, minVersionInfo(r)) + } + rv.Latest = minVersionInfo(versions[len(versions)-1]) + + return &resource.ResourceVersions{Data: &rv}, nil +} + +// find resource using name of catalog & name, kind and version of resource +func (s *service) ByCatalogKindNameVersion(ctx context.Context, p *resource.ByCatalogKindNameVersionPayload) (*resource.ResourceVersion, error) { + + req := res.Request{ + Db: s.DB(ctx), + Log: s.Logger(ctx), + Catalog: p.Catalog, + Kind: p.Kind, + Name: p.Name, + Version: p.Version, + } + + r, err := req.ByCatalogKindNameVersion() + if err != nil { + if err == res.FetchError { + return nil, resource.MakeInternalError(err) + } + if err == res.NotFoundError { + return nil, resource.MakeNotFound(err) + } + } + + switch count := len(r.Versions); { + case count == 1: + return versionInfoFromResource(r), nil + case count == 0: + return nil, resource.MakeNotFound(fmt.Errorf("resource not found")) + default: + s.Logger(ctx).Warnf("expected to find one version but found %d", count) + r.Versions = []model.ResourceVersion{r.Versions[0]} + return versionInfoFromResource(r), nil + } +} + +// find a resource using its version's id +func (s *service) ByVersionID(ctx context.Context, p *resource.ByVersionIDPayload) (*resource.ResourceVersion, error) { + + req := res.Request{ + Db: s.DB(ctx), + Log: s.Logger(ctx), + VersionID: p.VersionID, + } + + v, err := req.ByVersionID() + if err != nil { + if err == res.FetchError { + return nil, resource.MakeInternalError(err) + } + if err == res.NotFoundError { + return nil, resource.MakeNotFound(err) + } + } + + return versionInfoFromVersion(v), nil +} + +// find resources using name of catalog, resource name and kind of resource +func (s *service) ByCatalogKindName(ctx context.Context, p *resource.ByCatalogKindNamePayload) (*resource.Resource, error) { + + req := res.Request{ + Db: s.DB(ctx), + Log: s.Logger(ctx), + Catalog: p.Catalog, + Kind: p.Kind, + Name: p.Name, + } + + r, err := req.ByCatalogKindName() + if err != nil { + if err == res.FetchError { + return nil, resource.MakeInternalError(err) + } + if err == res.NotFoundError { + return nil, resource.MakeNotFound(err) + } + } + + res := initResource(r) + for _, v := range r.Versions { + res.Versions = append(res.Versions, tinyVersionInfo(v)) + } + + return &resource.Resource{Data: res}, nil +} + +// Find a resource using it's id +func (s *service) ByID(ctx context.Context, p *resource.ByIDPayload) (*resource.Resource, error) { + + req := res.Request{ + Db: s.DB(ctx), + Log: s.Logger(ctx), + ID: p.ID, + } + + r, err := req.ByID() + if err != nil { + if err == res.FetchError { + return nil, resource.MakeInternalError(err) + } + if err == res.NotFoundError { + return nil, resource.MakeNotFound(err) + } + } + + res := initResource(r) + for _, v := range r.Versions { + res.Versions = append(res.Versions, tinyVersionInfo(v)) + } + + return &resource.Resource{Data: res}, nil +} + +func initResource(r model.Resource) *resource.ResourceData { + + res := &resource.ResourceData{} + res.ID = r.ID + res.Name = r.Name + res.Catalog = &resource.Catalog{ + ID: r.Catalog.ID, + Name: r.Catalog.Name, + Type: r.Catalog.Type, + } + res.Kind = r.Kind + res.Rating = r.Rating + + lv := (r.Versions)[len(r.Versions)-1] + res.LatestVersion = &resource.ResourceVersionData{ + ID: lv.ID, + Version: lv.Version, + Description: lv.Description, + DisplayName: lv.DisplayName, + MinPipelinesVersion: lv.MinPipelinesVersion, + WebURL: lv.URL, + RawURL: replaceGHtoRaw.Replace(lv.URL), + UpdatedAt: lv.ModifiedAt.UTC().Format(time.RFC3339), + } + res.Tags = []*resource.Tag{} + for _, tag := range r.Tags { + res.Tags = append(res.Tags, &resource.Tag{ + ID: tag.ID, + Name: tag.Name, + }) + } + + return res +} + +func tinyVersionInfo(r model.ResourceVersion) *resource.ResourceVersionData { + + res := &resource.ResourceVersionData{ + ID: r.ID, + Version: r.Version, + } + + return res +} + +func minVersionInfo(r model.ResourceVersion) *resource.ResourceVersionData { + + res := tinyVersionInfo(r) + res.WebURL = r.URL + res.RawURL = replaceGHtoRaw.Replace(r.URL) + + return res +} + +func versionInfoFromResource(r model.Resource) *resource.ResourceVersion { + + var tags []*resource.Tag + for _, tag := range r.Tags { + tags = append(tags, &resource.Tag{ + ID: tag.ID, + Name: tag.Name, + }) + } + res := &resource.ResourceData{ + ID: r.ID, + Name: r.Name, + Kind: r.Kind, + Rating: r.Rating, + Tags: tags, + Catalog: &resource.Catalog{ + ID: r.Catalog.ID, + Name: r.Catalog.Name, + Type: r.Catalog.Type, + }, + } + + v := r.Versions[0] + ver := &resource.ResourceVersionData{ + ID: v.ID, + Version: v.Version, + Description: v.Description, + DisplayName: v.DisplayName, + MinPipelinesVersion: v.MinPipelinesVersion, + WebURL: v.URL, + RawURL: replaceGHtoRaw.Replace(v.URL), + UpdatedAt: v.ModifiedAt.UTC().Format(time.RFC3339), + Resource: res, + } + + return &resource.ResourceVersion{Data: ver} +} + +func versionInfoFromVersion(v model.ResourceVersion) *resource.ResourceVersion { + + // NOTE: we are not preloading all versions (optimisation) and we only + // need to return version details of v, thus manually populating only + // the required info + v.Resource.Versions = []model.ResourceVersion{v} + return versionInfoFromResource(v.Resource) +} diff --git a/api/v1/service/resource/resource_http_test.go b/api/v1/service/resource/resource_http_test.go new file mode 100644 index 0000000000..eccdc8fc61 --- /dev/null +++ b/api/v1/service/resource/resource_http_test.go @@ -0,0 +1,475 @@ +// Copyright © 2020 The Tekton Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package resource + +import ( + "encoding/json" + "fmt" + "io/ioutil" + "net/http" + "testing" + + "github.com/ikawaha/goahttpcheck" + "github.com/stretchr/testify/assert" + "github.com/tektoncd/hub/api/pkg/testutils" + "github.com/tektoncd/hub/api/v1/gen/http/resource/server" + "github.com/tektoncd/hub/api/v1/gen/resource" + goa "goa.design/goa/v3/pkg" + "gotest.tools/v3/golden" +) + +func QueryChecker(tc *testutils.TestConfig) *goahttpcheck.APIChecker { + checker := goahttpcheck.New() + checker.Mount(server.NewQueryHandler, + server.MountQueryHandler, + resource.NewQueryEndpoint(New(tc))) + return checker +} + +func TestQuery_Http(t *testing.T) { + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + QueryChecker(tc).Test(t, http.MethodGet, "/v1/query?name=build&kinds=pipeline&limit=1").Check(). + HasStatus(200).Cb(func(r *http.Response) { + b, readErr := ioutil.ReadAll(r.Body) + assert.NoError(t, readErr) + defer r.Body.Close() + + res, err := testutils.FormatJSON(b) + assert.NoError(t, err) + + golden.Assert(t, res, fmt.Sprintf("%s.golden", t.Name())) + }) +} + +func TestQueryWithKinds_Http(t *testing.T) { + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + QueryChecker(tc).Test(t, http.MethodGet, "/v1/query?kinds=pipeline").Check(). + HasStatus(200).Cb(func(r *http.Response) { + b, readErr := ioutil.ReadAll(r.Body) + assert.NoError(t, readErr) + defer r.Body.Close() + + res, err := testutils.FormatJSON(b) + assert.NoError(t, err) + + golden.Assert(t, res, fmt.Sprintf("%s.golden", t.Name())) + }) +} + +func TestQueryWithInvalidKind_Http(t *testing.T) { + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + QueryChecker(tc).Test(t, http.MethodGet, "/v1/query?kinds=task&kinds=abc").Check(). + HasStatus(400).Cb(func(r *http.Response) { + b, readErr := ioutil.ReadAll(r.Body) + assert.NoError(t, readErr) + defer r.Body.Close() + + var err *goa.ServiceError + marshallErr := json.Unmarshal([]byte(b), &err) + assert.NoError(t, marshallErr) + + assert.Equal(t, "invalid-kind", err.Name) + assert.Equal(t, "resource kind 'abc' not supported. Supported kinds are [Task Pipeline]", err.Message) + }) +} + +func TestQueryWithTags_Http(t *testing.T) { + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + QueryChecker(tc).Test(t, http.MethodGet, "/v1/query?tags=ztag&tags=Atag").Check(). + HasStatus(200).Cb(func(r *http.Response) { + b, readErr := ioutil.ReadAll(r.Body) + assert.NoError(t, readErr) + defer r.Body.Close() + + res, err := testutils.FormatJSON(b) + assert.NoError(t, err) + + golden.Assert(t, res, fmt.Sprintf("%s.golden", t.Name())) + }) +} + +func TestQueryWithExactName_Http(t *testing.T) { + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + QueryChecker(tc).Test(t, http.MethodGet, "/v1/query?name=buildah&exact=true").Check(). + HasStatus(200).Cb(func(r *http.Response) { + b, readErr := ioutil.ReadAll(r.Body) + assert.NoError(t, readErr) + defer r.Body.Close() + + res, err := testutils.FormatJSON(b) + assert.NoError(t, err) + + golden.Assert(t, res, fmt.Sprintf("%s.golden", t.Name())) + }) +} + +func TestQueryWithNameAndKinds_Http(t *testing.T) { + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + QueryChecker(tc).Test(t, http.MethodGet, "/v1/query?name=build&kinds=task&kinds=pipeline").Check(). + HasStatus(200).Cb(func(r *http.Response) { + b, readErr := ioutil.ReadAll(r.Body) + assert.NoError(t, readErr) + defer r.Body.Close() + + res, err := testutils.FormatJSON(b) + assert.NoError(t, err) + + golden.Assert(t, res, fmt.Sprintf("%s.golden", t.Name())) + }) +} + +func TestQueryWithNameAndTags_Http(t *testing.T) { + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + QueryChecker(tc).Test(t, http.MethodGet, "/v1/query?name=build&tags=atag&tags=ztag").Check(). + HasStatus(200).Cb(func(r *http.Response) { + b, readErr := ioutil.ReadAll(r.Body) + assert.NoError(t, readErr) + defer r.Body.Close() + + res, err := testutils.FormatJSON(b) + assert.NoError(t, err) + + golden.Assert(t, res, fmt.Sprintf("%s.golden", t.Name())) + }) +} + +func TestQueryWithKindsAndTags_Http(t *testing.T) { + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + QueryChecker(tc).Test(t, http.MethodGet, "/v1/query?name=build&kinds=task&kinds=pipeline").Check(). + HasStatus(200).Cb(func(r *http.Response) { + b, readErr := ioutil.ReadAll(r.Body) + assert.NoError(t, readErr) + defer r.Body.Close() + + res, err := testutils.FormatJSON(b) + assert.NoError(t, err) + + golden.Assert(t, res, fmt.Sprintf("%s.golden", t.Name())) + }) +} + +func TestQueryWithAllParams_Http(t *testing.T) { + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + QueryChecker(tc).Test(t, http.MethodGet, "/v1/query?name=build&kinds=task&kinds=Pipeline&tags=ztag&tags=Atag&exact=false").Check(). + HasStatus(200).Cb(func(r *http.Response) { + b, readErr := ioutil.ReadAll(r.Body) + assert.NoError(t, readErr) + defer r.Body.Close() + + res, err := testutils.FormatJSON(b) + assert.NoError(t, err) + + golden.Assert(t, res, fmt.Sprintf("%s.golden", t.Name())) + }) +} + +func TestQuery_Http_ErrorCase(t *testing.T) { + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + QueryChecker(tc).Test(t, http.MethodGet, "/v1/query?name=foo").Check(). + HasStatus(404).Cb(func(r *http.Response) { + b, readErr := ioutil.ReadAll(r.Body) + assert.NoError(t, readErr) + defer r.Body.Close() + + err := goa.ServiceError{} + marshallErr := json.Unmarshal([]byte(b), &err) + assert.NoError(t, marshallErr) + + assert.Equal(t, "not-found", err.Name) + }) +} + +func ListChecker(tc *testutils.TestConfig) *goahttpcheck.APIChecker { + checker := goahttpcheck.New() + checker.Mount(server.NewListHandler, + server.MountListHandler, + resource.NewListEndpoint(New(tc))) + return checker +} + +func TestList_Http_WithLimit(t *testing.T) { + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + ListChecker(tc).Test(t, http.MethodGet, "/v1/resources?limit=2").Check(). + HasStatus(200).Cb(func(r *http.Response) { + b, readErr := ioutil.ReadAll(r.Body) + assert.NoError(t, readErr) + defer r.Body.Close() + + res, err := testutils.FormatJSON(b) + assert.NoError(t, err) + + golden.Assert(t, res, fmt.Sprintf("%s.golden", t.Name())) + }) +} + +func TestList_Http_NoLimit(t *testing.T) { + // Test no limit returns some records + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + ListChecker(tc).Test(t, http.MethodGet, "/v1/resources").Check(). + HasStatus(200).Cb(func(r *http.Response) { + b, readErr := ioutil.ReadAll(r.Body) + assert.NoError(t, readErr) + defer r.Body.Close() + + res, err := testutils.FormatJSON(b) + assert.NoError(t, err) + + golden.Assert(t, res, fmt.Sprintf("%s.golden", t.Name())) + }) +} + +func VersionsByIDChecker(tc *testutils.TestConfig) *goahttpcheck.APIChecker { + checker := goahttpcheck.New() + checker.Mount( + server.NewVersionsByIDHandler, + server.MountVersionsByIDHandler, + resource.NewVersionsByIDEndpoint(New(tc))) + return checker +} + +func TestVersionsByID_Http(t *testing.T) { + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + VersionsByIDChecker(tc).Test(t, http.MethodGet, "/v1/resource/1/versions").Check(). + HasStatus(200).Cb(func(r *http.Response) { + b, readErr := ioutil.ReadAll(r.Body) + assert.NoError(t, readErr) + defer r.Body.Close() + + res, err := testutils.FormatJSON(b) + assert.NoError(t, err) + + golden.Assert(t, res, fmt.Sprintf("%s.golden", t.Name())) + }) +} + +func TestVersionsByID_Http_ErrorCase(t *testing.T) { + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + VersionsByIDChecker(tc).Test(t, http.MethodGet, "/v1/resource/111/versions").Check(). + HasStatus(404).Cb(func(r *http.Response) { + b, readErr := ioutil.ReadAll(r.Body) + assert.NoError(t, readErr) + defer r.Body.Close() + + err := goa.ServiceError{} + marshallErr := json.Unmarshal([]byte(b), &err) + assert.NoError(t, marshallErr) + + assert.Equal(t, "not-found", err.Name) + }) +} + +func ByCatalogKindNameVersionChecker(tc *testutils.TestConfig) *goahttpcheck.APIChecker { + checker := goahttpcheck.New() + checker.Mount( + server.NewByCatalogKindNameVersionHandler, + server.MountByCatalogKindNameVersionHandler, + resource.NewByCatalogKindNameVersionEndpoint(New(tc))) + return checker +} + +func TestByCatalogKindNameVersion_Http(t *testing.T) { + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + ByCatalogKindNameVersionChecker(tc).Test(t, http.MethodGet, "/v1/resource/catalog-official/task/tkn/0.1").Check(). + HasStatus(200).Cb(func(r *http.Response) { + b, readErr := ioutil.ReadAll(r.Body) + assert.NoError(t, readErr) + defer r.Body.Close() + + res, err := testutils.FormatJSON(b) + assert.NoError(t, err) + + golden.Assert(t, res, fmt.Sprintf("%s.golden", t.Name())) + }) +} + +func TestByCatalogKindNameVersion_Http_ErrorCase(t *testing.T) { + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + ByCatalogKindNameVersionChecker(tc).Test(t, http.MethodGet, "/v1/resource/catalog-official/task/foo/0.1.1").Check(). + HasStatus(404).Cb(func(r *http.Response) { + b, readErr := ioutil.ReadAll(r.Body) + assert.NoError(t, readErr) + defer r.Body.Close() + + err := goa.ServiceError{} + marshallErr := json.Unmarshal([]byte(b), &err) + assert.NoError(t, marshallErr) + + assert.Equal(t, "not-found", err.Name) + }) +} + +func ByVersionIDChecker(tc *testutils.TestConfig) *goahttpcheck.APIChecker { + checker := goahttpcheck.New() + checker.Mount( + server.NewByVersionIDHandler, + server.MountByVersionIDHandler, + resource.NewByVersionIDEndpoint(New(tc))) + return checker +} + +func TestByVersionID_Http(t *testing.T) { + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + ByVersionIDChecker(tc).Test(t, http.MethodGet, "/v1/resource/version/4").Check(). + HasStatus(200).Cb(func(r *http.Response) { + b, readErr := ioutil.ReadAll(r.Body) + assert.NoError(t, readErr) + defer r.Body.Close() + + res, err := testutils.FormatJSON(b) + assert.NoError(t, err) + + golden.Assert(t, res, fmt.Sprintf("%s.golden", t.Name())) + }) +} + +func TestByVersionID_Http_ErrorCase(t *testing.T) { + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + ByVersionIDChecker(tc).Test(t, http.MethodGet, "/v1/resource/version/43").Check(). + HasStatus(404).Cb(func(r *http.Response) { + b, readErr := ioutil.ReadAll(r.Body) + assert.NoError(t, readErr) + defer r.Body.Close() + + err := goa.ServiceError{} + marshallErr := json.Unmarshal([]byte(b), &err) + assert.NoError(t, marshallErr) + + assert.Equal(t, "not-found", err.Name) + }) +} + +func ByCatalogKindNameChecker(tc *testutils.TestConfig) *goahttpcheck.APIChecker { + checker := goahttpcheck.New() + checker.Mount( + server.NewByCatalogKindNameHandler, + server.MountByCatalogKindNameHandler, + resource.NewByCatalogKindNameEndpoint(New(tc))) + return checker +} + +func TestByCatalogKindName_Http(t *testing.T) { + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + ByCatalogKindNameChecker(tc).Test(t, http.MethodGet, "/v1/resource/catalog-official/task/tekton").Check(). + HasStatus(200).Cb(func(r *http.Response) { + b, readErr := ioutil.ReadAll(r.Body) + assert.NoError(t, readErr) + defer r.Body.Close() + + res, err := testutils.FormatJSON(b) + assert.NoError(t, err) + + golden.Assert(t, res, fmt.Sprintf("%s.golden", t.Name())) + }) +} + +func TestByCatalogKindName_Http_ErrorCase(t *testing.T) { + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + ByCatalogKindNameChecker(tc).Test(t, http.MethodGet, "/v1/resource/catalog-official/task/foo").Check(). + HasStatus(404).Cb(func(r *http.Response) { + b, readErr := ioutil.ReadAll(r.Body) + assert.NoError(t, readErr) + defer r.Body.Close() + + err := goa.ServiceError{} + marshallErr := json.Unmarshal([]byte(b), &err) + assert.NoError(t, marshallErr) + + assert.Equal(t, "not-found", err.Name) + }) +} + +func ByIDChecker(tc *testutils.TestConfig) *goahttpcheck.APIChecker { + checker := goahttpcheck.New() + checker.Mount( + server.NewByIDHandler, + server.MountByIDHandler, + resource.NewByIDEndpoint(New(tc))) + return checker +} + +func TestByID_Http(t *testing.T) { + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + ByIDChecker(tc).Test(t, http.MethodGet, "/v1/resource/1").Check(). + HasStatus(200).Cb(func(r *http.Response) { + b, readErr := ioutil.ReadAll(r.Body) + assert.NoError(t, readErr) + defer r.Body.Close() + + res, err := testutils.FormatJSON(b) + assert.NoError(t, err) + + golden.Assert(t, res, fmt.Sprintf("%s.golden", t.Name())) + }) +} + +func TestByID_Http_ErrorCase(t *testing.T) { + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + ByIDChecker(tc).Test(t, http.MethodGet, "/v1/resource/77").Check(). + HasStatus(404).Cb(func(r *http.Response) { + b, readErr := ioutil.ReadAll(r.Body) + assert.NoError(t, readErr) + defer r.Body.Close() + + err := goa.ServiceError{} + marshallErr := json.Unmarshal([]byte(b), &err) + assert.NoError(t, marshallErr) + + assert.Equal(t, "not-found", err.Name) + }) +} diff --git a/api/v1/service/resource/resource_test.go b/api/v1/service/resource/resource_test.go new file mode 100644 index 0000000000..22915399a5 --- /dev/null +++ b/api/v1/service/resource/resource_test.go @@ -0,0 +1,181 @@ +// Copyright © 2020 The Tekton Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package resource + +import ( + "context" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/tektoncd/hub/api/pkg/testutils" + "github.com/tektoncd/hub/api/v1/gen/resource" +) + +func TestQuery_ByTags(t *testing.T) { + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + resourceSvc := New(tc) + payload := &resource.QueryPayload{Name: "", Kinds: []string{}, Tags: []string{"atag"}, Limit: 100} + all, err := resourceSvc.Query(context.Background(), payload) + assert.NoError(t, err) + assert.Equal(t, 1, len(all.Data)) +} + +func TestQuery_ByNameAndKind(t *testing.T) { + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + resourceSvc := New(tc) + payload := &resource.QueryPayload{Name: "build", Kinds: []string{"pipeline"}, Limit: 100} + all, err := resourceSvc.Query(context.Background(), payload) + assert.NoError(t, err) + assert.Equal(t, 1, len(all.Data)) + assert.Equal(t, "build-pipeline", all.Data[0].Name) +} + +func TestQuery_NotFoundError(t *testing.T) { + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + resourceSvc := New(tc) + payload := &resource.QueryPayload{Name: "foo", Kinds: []string{}, Limit: 100} + _, err := resourceSvc.Query(context.Background(), payload) + assert.Error(t, err) + assert.EqualError(t, err, "resource not found") +} + +func TestList_ByLimit(t *testing.T) { + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + resourceSvc := New(tc) + payload := &resource.ListPayload{Limit: 3} + all, err := resourceSvc.List(context.Background(), payload) + assert.NoError(t, err) + assert.Equal(t, 3, len(all.Data)) + assert.Equal(t, "tekton", all.Data[0].Name) +} + +func TestVersionsByID(t *testing.T) { + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + resourceSvc := New(tc) + payload := &resource.VersionsByIDPayload{ID: 1} + res, err := resourceSvc.VersionsByID(context.Background(), payload) + assert.NoError(t, err) + assert.Equal(t, 3, len(res.Data.Versions)) + assert.Equal(t, "0.2", res.Data.Latest.Version) +} + +func TestVersionsByID_NotFoundError(t *testing.T) { + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + resourceSvc := New(tc) + payload := &resource.VersionsByIDPayload{ID: 11} + _, err := resourceSvc.VersionsByID(context.Background(), payload) + assert.Error(t, err) + assert.EqualError(t, err, "resource not found") +} + +func TestByCatalogKindNameVersion(t *testing.T) { + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + resourceSvc := New(tc) + payload := &resource.ByCatalogKindNameVersionPayload{Catalog: "catalog-official", Kind: "task", Name: "tkn", Version: "0.1"} + res, err := resourceSvc.ByCatalogKindNameVersion(context.Background(), payload) + assert.NoError(t, err) + assert.Equal(t, "0.1", res.Data.Version) +} + +func TestByCatalogKindNameVersion_NoResourceWithName(t *testing.T) { + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + resourceSvc := New(tc) + payload := &resource.ByCatalogKindNameVersionPayload{Catalog: "catalog-official", Kind: "task", Name: "foo", Version: "0.1"} + _, err := resourceSvc.ByCatalogKindNameVersion(context.Background(), payload) + assert.Error(t, err) + assert.EqualError(t, err, "resource not found") +} + +func TestByVersionID(t *testing.T) { + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + resourceSvc := New(tc) + payload := &resource.ByVersionIDPayload{VersionID: 6} + res, err := resourceSvc.ByVersionID(context.Background(), payload) + assert.NoError(t, err) + assert.Equal(t, "0.1.1", res.Data.Version) +} + +func TestByVersionID_NotFoundError(t *testing.T) { + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + resourceSvc := New(tc) + payload := &resource.ByVersionIDPayload{VersionID: 111} + _, err := resourceSvc.ByVersionID(context.Background(), payload) + assert.Error(t, err) + assert.EqualError(t, err, "resource not found") +} + +func TestByCatalogKindName(t *testing.T) { + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + resourceSvc := New(tc) + payload := &resource.ByCatalogKindNamePayload{Catalog: "catalog-community", Kind: "task", Name: "img"} + res, err := resourceSvc.ByCatalogKindName(context.Background(), payload) + assert.NoError(t, err) + assert.Equal(t, "img", res.Data.Name) +} + +func TestByCatalogKindName_ResourceNotFoundError(t *testing.T) { + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + resourceSvc := New(tc) + payload := &resource.ByCatalogKindNamePayload{Catalog: "catalog-community", Kind: "task", Name: "foo"} + _, err := resourceSvc.ByCatalogKindName(context.Background(), payload) + assert.Error(t, err) + assert.EqualError(t, err, "resource not found") +} + +func TestByID(t *testing.T) { + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + resourceSvc := New(tc) + payload := &resource.ByIDPayload{ID: 1} + res, err := resourceSvc.ByID(context.Background(), payload) + assert.NoError(t, err) + assert.Equal(t, "tekton", res.Data.Name) +} + +func TestByID_NotFoundError(t *testing.T) { + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + resourceSvc := New(tc) + payload := &resource.ByIDPayload{ID: 77} + _, err := resourceSvc.ByID(context.Background(), payload) + assert.Error(t, err) + assert.EqualError(t, err, "resource not found") +} diff --git a/api/v1/service/resource/testdata/TestByCatalogKindNameVersion_Http.golden b/api/v1/service/resource/testdata/TestByCatalogKindNameVersion_Http.golden new file mode 100644 index 0000000000..13b6c9cc52 --- /dev/null +++ b/api/v1/service/resource/testdata/TestByCatalogKindNameVersion_Http.golden @@ -0,0 +1,29 @@ +{ + "data": { + "id": 8, + "version": "0.1", + "displayName": "Tkn CLI", + "description": "Desc5", + "minPipelinesVersion": "0.12.1", + "rawURL": "https://raw.githubusercontent.com/Pipelines-Marketplace/catalog/master/task/tkn/0.1/tkn.yaml", + "webURL": "https://github.com/Pipelines-Marketplace/catalog/tree/master/task/tkn/0.1/tkn.yaml", + "updatedAt": "2013-01-01T00:00:01Z", + "resource": { + "id": 5, + "name": "tkn", + "catalog": { + "id": 1, + "name": "catalog-official", + "type": "official" + }, + "kind": "task", + "tags": [ + { + "id": 2, + "name": "rtag" + } + ], + "rating": 5 + } + } +} diff --git a/api/v1/service/resource/testdata/TestByCatalogKindName_Http.golden b/api/v1/service/resource/testdata/TestByCatalogKindName_Http.golden new file mode 100644 index 0000000000..98a13fcf06 --- /dev/null +++ b/api/v1/service/resource/testdata/TestByCatalogKindName_Http.golden @@ -0,0 +1,43 @@ +{ + "data": { + "id": 1, + "name": "tekton", + "catalog": { + "id": 1, + "name": "catalog-official", + "type": "official" + }, + "kind": "task", + "latestVersion": { + "id": 5, + "version": "0.2", + "displayName": "Tekton CLI", + "description": "Desc1", + "minPipelinesVersion": "0.12.1", + "rawURL": "https://raw.githubusercontent.com/Pipelines-Marketplace/catalog/master/task/tekton/0.2/tekton.yaml", + "webURL": "https://github.com/Pipelines-Marketplace/catalog/tree/master/task/tekton/0.2/tekton.yaml", + "updatedAt": "2013-01-01T00:00:01Z" + }, + "tags": [ + { + "id": 2, + "name": "rtag" + } + ], + "rating": 5, + "versions": [ + { + "id": 1, + "version": "0.1" + }, + { + "id": 6, + "version": "0.1.1" + }, + { + "id": 5, + "version": "0.2" + } + ] + } +} diff --git a/api/v1/service/resource/testdata/TestByID_Http.golden b/api/v1/service/resource/testdata/TestByID_Http.golden new file mode 100644 index 0000000000..98a13fcf06 --- /dev/null +++ b/api/v1/service/resource/testdata/TestByID_Http.golden @@ -0,0 +1,43 @@ +{ + "data": { + "id": 1, + "name": "tekton", + "catalog": { + "id": 1, + "name": "catalog-official", + "type": "official" + }, + "kind": "task", + "latestVersion": { + "id": 5, + "version": "0.2", + "displayName": "Tekton CLI", + "description": "Desc1", + "minPipelinesVersion": "0.12.1", + "rawURL": "https://raw.githubusercontent.com/Pipelines-Marketplace/catalog/master/task/tekton/0.2/tekton.yaml", + "webURL": "https://github.com/Pipelines-Marketplace/catalog/tree/master/task/tekton/0.2/tekton.yaml", + "updatedAt": "2013-01-01T00:00:01Z" + }, + "tags": [ + { + "id": 2, + "name": "rtag" + } + ], + "rating": 5, + "versions": [ + { + "id": 1, + "version": "0.1" + }, + { + "id": 6, + "version": "0.1.1" + }, + { + "id": 5, + "version": "0.2" + } + ] + } +} diff --git a/api/v1/service/resource/testdata/TestByVersionID_Http.golden b/api/v1/service/resource/testdata/TestByVersionID_Http.golden new file mode 100644 index 0000000000..e4832620c3 --- /dev/null +++ b/api/v1/service/resource/testdata/TestByVersionID_Http.golden @@ -0,0 +1,33 @@ +{ + "data": { + "id": 4, + "version": "0.2", + "displayName": "Build", + "description": "Desc2", + "minPipelinesVersion": "0.12.1", + "rawURL": "https://raw.githubusercontent.com/Pipelines-Marketplace/catalog/master/task/build/0.2/build.yaml", + "webURL": "https://github.com/Pipelines-Marketplace/catalog/tree/master/task/build/0.2/build.yaml", + "updatedAt": "2013-01-01T00:00:01Z", + "resource": { + "id": 2, + "name": "build-pipeline", + "catalog": { + "id": 1, + "name": "catalog-official", + "type": "official" + }, + "kind": "pipeline", + "tags": [ + { + "id": 4, + "name": "atag" + }, + { + "id": 1, + "name": "ztag" + } + ], + "rating": 4.4 + } + } +} diff --git a/api/v1/service/resource/testdata/TestList_Http_NoLimit.golden b/api/v1/service/resource/testdata/TestList_Http_NoLimit.golden new file mode 100644 index 0000000000..5bea9e3e74 --- /dev/null +++ b/api/v1/service/resource/testdata/TestList_Http_NoLimit.golden @@ -0,0 +1,192 @@ +{ + "data": [ + { + "id": 1, + "name": "tekton", + "catalog": { + "id": 1, + "name": "catalog-official", + "type": "official" + }, + "kind": "task", + "latestVersion": { + "id": 5, + "version": "0.2", + "displayName": "Tekton CLI", + "description": "Desc1", + "minPipelinesVersion": "0.12.1", + "rawURL": "https://raw.githubusercontent.com/Pipelines-Marketplace/catalog/master/task/tekton/0.2/tekton.yaml", + "webURL": "https://github.com/Pipelines-Marketplace/catalog/tree/master/task/tekton/0.2/tekton.yaml", + "updatedAt": "2013-01-01T00:00:01Z" + }, + "tags": [ + { + "id": 2, + "name": "rtag" + } + ], + "rating": 5 + }, + { + "id": 5, + "name": "tkn", + "catalog": { + "id": 1, + "name": "catalog-official", + "type": "official" + }, + "kind": "task", + "latestVersion": { + "id": 8, + "version": "0.1", + "displayName": "Tkn CLI", + "description": "Desc5", + "minPipelinesVersion": "0.12.1", + "rawURL": "https://raw.githubusercontent.com/Pipelines-Marketplace/catalog/master/task/tkn/0.1/tkn.yaml", + "webURL": "https://github.com/Pipelines-Marketplace/catalog/tree/master/task/tkn/0.1/tkn.yaml", + "updatedAt": "2013-01-01T00:00:01Z" + }, + "tags": [ + { + "id": 2, + "name": "rtag" + } + ], + "rating": 5 + }, + { + "id": 7, + "name": "tkn-hub", + "catalog": { + "id": 1, + "name": "catalog-official", + "type": "official" + }, + "kind": "task", + "latestVersion": { + "id": 10, + "version": "0.1", + "displayName": "Tkn Hub", + "description": "Desc7", + "minPipelinesVersion": "0.12.1", + "rawURL": "https://raw.githubusercontent.com/Pipelines-Marketplace/catalog-community/master/task/tkn-hub/0.1/tkn-hub.yaml", + "webURL": "https://github.com/Pipelines-Marketplace/catalog-community/tree/master/task/tkn-hub/0.1/tkn-hub.yaml", + "updatedAt": "2013-01-01T00:00:01Z" + }, + "tags": [ + { + "id": 2, + "name": "rtag" + } + ], + "rating": 5 + }, + { + "id": 2, + "name": "build-pipeline", + "catalog": { + "id": 1, + "name": "catalog-official", + "type": "official" + }, + "kind": "pipeline", + "latestVersion": { + "id": 4, + "version": "0.2", + "displayName": "Build", + "description": "Desc2", + "minPipelinesVersion": "0.12.1", + "rawURL": "https://raw.githubusercontent.com/Pipelines-Marketplace/catalog/master/task/build/0.2/build.yaml", + "webURL": "https://github.com/Pipelines-Marketplace/catalog/tree/master/task/build/0.2/build.yaml", + "updatedAt": "2013-01-01T00:00:01Z" + }, + "tags": [ + { + "id": 4, + "name": "atag" + }, + { + "id": 1, + "name": "ztag" + } + ], + "rating": 4.4 + }, + { + "id": 6, + "name": "img", + "catalog": { + "id": 2, + "name": "catalog-community", + "type": "community" + }, + "kind": "task", + "latestVersion": { + "id": 9, + "version": "0.1", + "displayName": "Image", + "description": "Desc3", + "minPipelinesVersion": "0.12.1", + "rawURL": "https://raw.githubusercontent.com/Pipelines-Marketplace/catalog-community/master/task/img/0.1/img.yaml", + "webURL": "https://github.com/Pipelines-Marketplace/catalog-community/tree/master/task/img/0.1/img.yaml", + "updatedAt": "2013-01-01T00:00:01Z" + }, + "tags": [], + "rating": 2.3 + }, + { + "id": 3, + "name": "img", + "catalog": { + "id": 1, + "name": "catalog-official", + "type": "official" + }, + "kind": "task", + "latestVersion": { + "id": 3, + "version": "0.1", + "displayName": "Image", + "description": "Desc3", + "minPipelinesVersion": "0.12.1", + "rawURL": "https://raw.githubusercontent.com/Pipelines-Marketplace/catalog/master/task/img/0.1/img.yaml", + "webURL": "https://github.com/Pipelines-Marketplace/catalog/tree/master/task/img/0.1/img.yaml", + "updatedAt": "2013-01-01T00:00:01Z" + }, + "tags": [ + { + "id": 3, + "name": "ptag" + } + ], + "rating": 2 + }, + { + "id": 4, + "name": "buildah", + "catalog": { + "id": 1, + "name": "catalog-official", + "type": "official" + }, + "kind": "task", + "latestVersion": { + "id": 7, + "version": "0.1", + "displayName": "Buildah", + "description": "Desc4", + "minPipelinesVersion": "0.12.1", + "rawURL": "https://raw.githubusercontent.com/Pipelines-Marketplace/catalog/master/task/buildah/0.1/buildah.yaml", + "webURL": "https://github.com/Pipelines-Marketplace/catalog/tree/master/task/buildah/0.1/buildah.yaml", + "updatedAt": "2013-01-01T00:00:01Z" + }, + "tags": [ + { + "id": 1, + "name": "ztag" + } + ], + "rating": 1.3 + } + ] +} diff --git a/api/v1/service/resource/testdata/TestList_Http_WithLimit.golden b/api/v1/service/resource/testdata/TestList_Http_WithLimit.golden new file mode 100644 index 0000000000..8a3e3d4521 --- /dev/null +++ b/api/v1/service/resource/testdata/TestList_Http_WithLimit.golden @@ -0,0 +1,58 @@ +{ + "data": [ + { + "id": 1, + "name": "tekton", + "catalog": { + "id": 1, + "name": "catalog-official", + "type": "official" + }, + "kind": "task", + "latestVersion": { + "id": 5, + "version": "0.2", + "displayName": "Tekton CLI", + "description": "Desc1", + "minPipelinesVersion": "0.12.1", + "rawURL": "https://raw.githubusercontent.com/Pipelines-Marketplace/catalog/master/task/tekton/0.2/tekton.yaml", + "webURL": "https://github.com/Pipelines-Marketplace/catalog/tree/master/task/tekton/0.2/tekton.yaml", + "updatedAt": "2013-01-01T00:00:01Z" + }, + "tags": [ + { + "id": 2, + "name": "rtag" + } + ], + "rating": 5 + }, + { + "id": 5, + "name": "tkn", + "catalog": { + "id": 1, + "name": "catalog-official", + "type": "official" + }, + "kind": "task", + "latestVersion": { + "id": 8, + "version": "0.1", + "displayName": "Tkn CLI", + "description": "Desc5", + "minPipelinesVersion": "0.12.1", + "rawURL": "https://raw.githubusercontent.com/Pipelines-Marketplace/catalog/master/task/tkn/0.1/tkn.yaml", + "webURL": "https://github.com/Pipelines-Marketplace/catalog/tree/master/task/tkn/0.1/tkn.yaml", + "updatedAt": "2013-01-01T00:00:01Z" + }, + "tags": [ + { + "id": 2, + "name": "rtag" + } + ], + "rating": 5 + } + ] +} diff --git a/api/v1/service/resource/testdata/TestQueryWithAllParams_Http.golden b/api/v1/service/resource/testdata/TestQueryWithAllParams_Http.golden new file mode 100644 index 0000000000..7173012bc6 --- /dev/null +++ b/api/v1/service/resource/testdata/TestQueryWithAllParams_Http.golden @@ -0,0 +1,62 @@ +{ + "data": [ + { + "id": 2, + "name": "build-pipeline", + "catalog": { + "id": 1, + "name": "catalog-official", + "type": "official" + }, + "kind": "pipeline", + "latestVersion": { + "id": 4, + "version": "0.2", + "displayName": "Build", + "description": "Desc2", + "minPipelinesVersion": "0.12.1", + "rawURL": "https://raw.githubusercontent.com/Pipelines-Marketplace/catalog/master/task/build/0.2/build.yaml", + "webURL": "https://github.com/Pipelines-Marketplace/catalog/tree/master/task/build/0.2/build.yaml", + "updatedAt": "2013-01-01T00:00:01Z" + }, + "tags": [ + { + "id": 4, + "name": "atag" + }, + { + "id": 1, + "name": "ztag" + } + ], + "rating": 4.4 + }, + { + "id": 4, + "name": "buildah", + "catalog": { + "id": 1, + "name": "catalog-official", + "type": "official" + }, + "kind": "task", + "latestVersion": { + "id": 7, + "version": "0.1", + "displayName": "Buildah", + "description": "Desc4", + "minPipelinesVersion": "0.12.1", + "rawURL": "https://raw.githubusercontent.com/Pipelines-Marketplace/catalog/master/task/buildah/0.1/buildah.yaml", + "webURL": "https://github.com/Pipelines-Marketplace/catalog/tree/master/task/buildah/0.1/buildah.yaml", + "updatedAt": "2013-01-01T00:00:01Z" + }, + "tags": [ + { + "id": 1, + "name": "ztag" + } + ], + "rating": 1.3 + } + ] +} diff --git a/api/v1/service/resource/testdata/TestQueryWithExactName_Http.golden b/api/v1/service/resource/testdata/TestQueryWithExactName_Http.golden new file mode 100644 index 0000000000..692cdb4062 --- /dev/null +++ b/api/v1/service/resource/testdata/TestQueryWithExactName_Http.golden @@ -0,0 +1,31 @@ +{ + "data": [ + { + "id": 4, + "name": "buildah", + "catalog": { + "id": 1, + "name": "catalog-official", + "type": "official" + }, + "kind": "task", + "latestVersion": { + "id": 7, + "version": "0.1", + "displayName": "Buildah", + "description": "Desc4", + "minPipelinesVersion": "0.12.1", + "rawURL": "https://raw.githubusercontent.com/Pipelines-Marketplace/catalog/master/task/buildah/0.1/buildah.yaml", + "webURL": "https://github.com/Pipelines-Marketplace/catalog/tree/master/task/buildah/0.1/buildah.yaml", + "updatedAt": "2013-01-01T00:00:01Z" + }, + "tags": [ + { + "id": 1, + "name": "ztag" + } + ], + "rating": 1.3 + } + ] +} diff --git a/api/v1/service/resource/testdata/TestQueryWithKindsAndTags_Http.golden b/api/v1/service/resource/testdata/TestQueryWithKindsAndTags_Http.golden new file mode 100644 index 0000000000..7173012bc6 --- /dev/null +++ b/api/v1/service/resource/testdata/TestQueryWithKindsAndTags_Http.golden @@ -0,0 +1,62 @@ +{ + "data": [ + { + "id": 2, + "name": "build-pipeline", + "catalog": { + "id": 1, + "name": "catalog-official", + "type": "official" + }, + "kind": "pipeline", + "latestVersion": { + "id": 4, + "version": "0.2", + "displayName": "Build", + "description": "Desc2", + "minPipelinesVersion": "0.12.1", + "rawURL": "https://raw.githubusercontent.com/Pipelines-Marketplace/catalog/master/task/build/0.2/build.yaml", + "webURL": "https://github.com/Pipelines-Marketplace/catalog/tree/master/task/build/0.2/build.yaml", + "updatedAt": "2013-01-01T00:00:01Z" + }, + "tags": [ + { + "id": 4, + "name": "atag" + }, + { + "id": 1, + "name": "ztag" + } + ], + "rating": 4.4 + }, + { + "id": 4, + "name": "buildah", + "catalog": { + "id": 1, + "name": "catalog-official", + "type": "official" + }, + "kind": "task", + "latestVersion": { + "id": 7, + "version": "0.1", + "displayName": "Buildah", + "description": "Desc4", + "minPipelinesVersion": "0.12.1", + "rawURL": "https://raw.githubusercontent.com/Pipelines-Marketplace/catalog/master/task/buildah/0.1/buildah.yaml", + "webURL": "https://github.com/Pipelines-Marketplace/catalog/tree/master/task/buildah/0.1/buildah.yaml", + "updatedAt": "2013-01-01T00:00:01Z" + }, + "tags": [ + { + "id": 1, + "name": "ztag" + } + ], + "rating": 1.3 + } + ] +} diff --git a/api/v1/service/resource/testdata/TestQueryWithKinds_Http.golden b/api/v1/service/resource/testdata/TestQueryWithKinds_Http.golden new file mode 100644 index 0000000000..d945aefcf2 --- /dev/null +++ b/api/v1/service/resource/testdata/TestQueryWithKinds_Http.golden @@ -0,0 +1,35 @@ +{ + "data": [ + { + "id": 2, + "name": "build-pipeline", + "catalog": { + "id": 1, + "name": "catalog-official", + "type": "official" + }, + "kind": "pipeline", + "latestVersion": { + "id": 4, + "version": "0.2", + "displayName": "Build", + "description": "Desc2", + "minPipelinesVersion": "0.12.1", + "rawURL": "https://raw.githubusercontent.com/Pipelines-Marketplace/catalog/master/task/build/0.2/build.yaml", + "webURL": "https://github.com/Pipelines-Marketplace/catalog/tree/master/task/build/0.2/build.yaml", + "updatedAt": "2013-01-01T00:00:01Z" + }, + "tags": [ + { + "id": 4, + "name": "atag" + }, + { + "id": 1, + "name": "ztag" + } + ], + "rating": 4.4 + } + ] +} diff --git a/api/v1/service/resource/testdata/TestQueryWithNameAndKinds_Http.golden b/api/v1/service/resource/testdata/TestQueryWithNameAndKinds_Http.golden new file mode 100644 index 0000000000..7173012bc6 --- /dev/null +++ b/api/v1/service/resource/testdata/TestQueryWithNameAndKinds_Http.golden @@ -0,0 +1,62 @@ +{ + "data": [ + { + "id": 2, + "name": "build-pipeline", + "catalog": { + "id": 1, + "name": "catalog-official", + "type": "official" + }, + "kind": "pipeline", + "latestVersion": { + "id": 4, + "version": "0.2", + "displayName": "Build", + "description": "Desc2", + "minPipelinesVersion": "0.12.1", + "rawURL": "https://raw.githubusercontent.com/Pipelines-Marketplace/catalog/master/task/build/0.2/build.yaml", + "webURL": "https://github.com/Pipelines-Marketplace/catalog/tree/master/task/build/0.2/build.yaml", + "updatedAt": "2013-01-01T00:00:01Z" + }, + "tags": [ + { + "id": 4, + "name": "atag" + }, + { + "id": 1, + "name": "ztag" + } + ], + "rating": 4.4 + }, + { + "id": 4, + "name": "buildah", + "catalog": { + "id": 1, + "name": "catalog-official", + "type": "official" + }, + "kind": "task", + "latestVersion": { + "id": 7, + "version": "0.1", + "displayName": "Buildah", + "description": "Desc4", + "minPipelinesVersion": "0.12.1", + "rawURL": "https://raw.githubusercontent.com/Pipelines-Marketplace/catalog/master/task/buildah/0.1/buildah.yaml", + "webURL": "https://github.com/Pipelines-Marketplace/catalog/tree/master/task/buildah/0.1/buildah.yaml", + "updatedAt": "2013-01-01T00:00:01Z" + }, + "tags": [ + { + "id": 1, + "name": "ztag" + } + ], + "rating": 1.3 + } + ] +} diff --git a/api/v1/service/resource/testdata/TestQueryWithNameAndTags_Http.golden b/api/v1/service/resource/testdata/TestQueryWithNameAndTags_Http.golden new file mode 100644 index 0000000000..7173012bc6 --- /dev/null +++ b/api/v1/service/resource/testdata/TestQueryWithNameAndTags_Http.golden @@ -0,0 +1,62 @@ +{ + "data": [ + { + "id": 2, + "name": "build-pipeline", + "catalog": { + "id": 1, + "name": "catalog-official", + "type": "official" + }, + "kind": "pipeline", + "latestVersion": { + "id": 4, + "version": "0.2", + "displayName": "Build", + "description": "Desc2", + "minPipelinesVersion": "0.12.1", + "rawURL": "https://raw.githubusercontent.com/Pipelines-Marketplace/catalog/master/task/build/0.2/build.yaml", + "webURL": "https://github.com/Pipelines-Marketplace/catalog/tree/master/task/build/0.2/build.yaml", + "updatedAt": "2013-01-01T00:00:01Z" + }, + "tags": [ + { + "id": 4, + "name": "atag" + }, + { + "id": 1, + "name": "ztag" + } + ], + "rating": 4.4 + }, + { + "id": 4, + "name": "buildah", + "catalog": { + "id": 1, + "name": "catalog-official", + "type": "official" + }, + "kind": "task", + "latestVersion": { + "id": 7, + "version": "0.1", + "displayName": "Buildah", + "description": "Desc4", + "minPipelinesVersion": "0.12.1", + "rawURL": "https://raw.githubusercontent.com/Pipelines-Marketplace/catalog/master/task/buildah/0.1/buildah.yaml", + "webURL": "https://github.com/Pipelines-Marketplace/catalog/tree/master/task/buildah/0.1/buildah.yaml", + "updatedAt": "2013-01-01T00:00:01Z" + }, + "tags": [ + { + "id": 1, + "name": "ztag" + } + ], + "rating": 1.3 + } + ] +} diff --git a/api/v1/service/resource/testdata/TestQueryWithTags_Http.golden b/api/v1/service/resource/testdata/TestQueryWithTags_Http.golden new file mode 100644 index 0000000000..7173012bc6 --- /dev/null +++ b/api/v1/service/resource/testdata/TestQueryWithTags_Http.golden @@ -0,0 +1,62 @@ +{ + "data": [ + { + "id": 2, + "name": "build-pipeline", + "catalog": { + "id": 1, + "name": "catalog-official", + "type": "official" + }, + "kind": "pipeline", + "latestVersion": { + "id": 4, + "version": "0.2", + "displayName": "Build", + "description": "Desc2", + "minPipelinesVersion": "0.12.1", + "rawURL": "https://raw.githubusercontent.com/Pipelines-Marketplace/catalog/master/task/build/0.2/build.yaml", + "webURL": "https://github.com/Pipelines-Marketplace/catalog/tree/master/task/build/0.2/build.yaml", + "updatedAt": "2013-01-01T00:00:01Z" + }, + "tags": [ + { + "id": 4, + "name": "atag" + }, + { + "id": 1, + "name": "ztag" + } + ], + "rating": 4.4 + }, + { + "id": 4, + "name": "buildah", + "catalog": { + "id": 1, + "name": "catalog-official", + "type": "official" + }, + "kind": "task", + "latestVersion": { + "id": 7, + "version": "0.1", + "displayName": "Buildah", + "description": "Desc4", + "minPipelinesVersion": "0.12.1", + "rawURL": "https://raw.githubusercontent.com/Pipelines-Marketplace/catalog/master/task/buildah/0.1/buildah.yaml", + "webURL": "https://github.com/Pipelines-Marketplace/catalog/tree/master/task/buildah/0.1/buildah.yaml", + "updatedAt": "2013-01-01T00:00:01Z" + }, + "tags": [ + { + "id": 1, + "name": "ztag" + } + ], + "rating": 1.3 + } + ] +} diff --git a/api/v1/service/resource/testdata/TestQuery_Http.golden b/api/v1/service/resource/testdata/TestQuery_Http.golden new file mode 100644 index 0000000000..d945aefcf2 --- /dev/null +++ b/api/v1/service/resource/testdata/TestQuery_Http.golden @@ -0,0 +1,35 @@ +{ + "data": [ + { + "id": 2, + "name": "build-pipeline", + "catalog": { + "id": 1, + "name": "catalog-official", + "type": "official" + }, + "kind": "pipeline", + "latestVersion": { + "id": 4, + "version": "0.2", + "displayName": "Build", + "description": "Desc2", + "minPipelinesVersion": "0.12.1", + "rawURL": "https://raw.githubusercontent.com/Pipelines-Marketplace/catalog/master/task/build/0.2/build.yaml", + "webURL": "https://github.com/Pipelines-Marketplace/catalog/tree/master/task/build/0.2/build.yaml", + "updatedAt": "2013-01-01T00:00:01Z" + }, + "tags": [ + { + "id": 4, + "name": "atag" + }, + { + "id": 1, + "name": "ztag" + } + ], + "rating": 4.4 + } + ] +} diff --git a/api/v1/service/resource/testdata/TestVersionsByID_Http.golden b/api/v1/service/resource/testdata/TestVersionsByID_Http.golden new file mode 100644 index 0000000000..1d9a96648c --- /dev/null +++ b/api/v1/service/resource/testdata/TestVersionsByID_Http.golden @@ -0,0 +1,30 @@ +{ + "data": { + "latest": { + "id": 5, + "version": "0.2", + "rawURL": "https://raw.githubusercontent.com/Pipelines-Marketplace/catalog/master/task/tekton/0.2/tekton.yaml", + "webURL": "https://github.com/Pipelines-Marketplace/catalog/tree/master/task/tekton/0.2/tekton.yaml" + }, + "versions": [ + { + "id": 1, + "version": "0.1", + "rawURL": "https://raw.githubusercontent.com/Pipelines-Marketplace/catalog/master/task/tekton/0.1/tekton.yaml", + "webURL": "https://github.com/Pipelines-Marketplace/catalog/tree/master/task/tekton/0.1/tekton.yaml" + }, + { + "id": 6, + "version": "0.1.1", + "rawURL": "https://raw.githubusercontent.com/Pipelines-Marketplace/catalog/master/task/tekton/0.1.1/tekton.yaml", + "webURL": "https://github.com/Pipelines-Marketplace/catalog/tree/master/task/tekton/0.1.1/tekton.yaml" + }, + { + "id": 5, + "version": "0.2", + "rawURL": "https://raw.githubusercontent.com/Pipelines-Marketplace/catalog/master/task/tekton/0.2/tekton.yaml", + "webURL": "https://github.com/Pipelines-Marketplace/catalog/tree/master/task/tekton/0.2/tekton.yaml" + } + ] + } +} diff --git a/test/presubmit-tests.sh b/test/presubmit-tests.sh index f4cab68816..1778f0c9dc 100755 --- a/test/presubmit-tests.sh +++ b/test/presubmit-tests.sh @@ -85,7 +85,8 @@ api-unittest(){ info Running unittests go mod vendor - go test -p 1 -v ./pkg/... + go test -p 1 -v ./pkg/... && + go test -p 1 -v ./v1/service/... } api-build(){