dfreilich / registry-api

API for searching and reading the Buildpack Registry

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Buildpack Registry API

CI

This repository contains an application that exposes an API for interacting with the Buildpack Registry.

Endpoints

Search

Search for a buildpack by keyword(s).

GET /search

Required Parameters

Name Type Description Example
matches string keyword(s) to search for "java"

Request Example

$ curl "https://registry.buildpacks.io/api/v1/search?matches=projectriff"

Response Example

[
    {
      "latest": {
        "description": "The Command Function Buildpack is a Cloud Native Buildpack V3 that provides riff Command Function Invoker to functions",
        "license": "MIT",
        "ns":"projectriff",
        "name":"command-function",
        "version": "1.4.1",
        "yanked":false,
        "addr":"gcr.io/projectriff/command-function@sha256:99f9054abb73635a9b251b61d3627a8ff86508c767f9d691c426d45e8758596f"
      },
      "versions": {
        "1.4.1": {
          "link": "https://registry.buildpacks.io/api/v1/buildpacks/projectriff/command-function/1.4.1"
        },
        "1.3.9": {
          "link": "https://registry.buildpacks.io/api/v1/buildpacks/projectriff/command-function/1.3.9"
        }
      }
    }
]

Buildpack Version List

Search for a buildpack by keyword(s).

GET /buildpacks/:namespace/:name

Required Parameters

Name Type Description Example
namespace string the namespace component from the ID of the buildpack "projectriff"
name string the name component from the ID of the buildpack "command-function"

Request Example

$ curl "https://registry.buildpacks.io/api/v1/buildpacks/projectriff/command-function"

Response Example

{
  "latest": {
    "description": "The Command Function Buildpack is a Cloud Native Buildpack V3 that provides riff Command Function Invoker to functions",
    "license": "MIT",
    "ns":"projectriff",
    "name":"command-function",
    "version": "1.4.1",
    "yanked":false,
    "addr":"gcr.io/projectriff/command-function@sha256:99f9054abb73635a9b251b61d3627a8ff86508c767f9d691c426d45e8758596f"
  },
  "versions": {
    "1.4.1": {
      "link": "https://registry.buildpacks.io/api/v1/buildpacks/projectriff/command-function/1.4.1"
    },
    "1.3.9": {
      "link": "https://registry.buildpacks.io/api/v1/buildpacks/projectriff/command-function/1.3.9"
    }
  }
}

Buildpack Version Info

Search for a buildpack by keyword(s).

GET /buildpacks/:namespace/:name/:version

Required Parameters

Name Type Description Example
namespace string the namespace component from the ID of the buildpack "projectriff"
name string the name component from the ID of the buildpack "command-function"
version string the version of the buildpack "1.4.1"

Request Example

$ curl "https://registry.buildpacks.io/api/v1/buildpacks/projectriff/command-function/1.4.1"

Response Example

{
  "description": "The Command Function Buildpack is a Cloud Native Buildpack V3 that provides riff Command Function Invoker to functions",
  "license": "MIT",
  "ns":"projectriff",
  "name":"command-function",
  "version": "1.4.1",
  "yanked":false,
  "addr":"gcr.io/projectriff/command-function@sha256:99f9054abb73635a9b251b61d3627a8ff86508c767f9d691c426d45e8758596f"
}

Development

This project requires Ruby and Golang tooling.

Run the tests:

$ make test

This app uses PostgreSQL. To set up the database, run:

$ bundle exec rake db:create
$ bundle exec rake db:migrate

Then run the app:

$ bundle exec rails s

In other terminal session, run the background worker to create the index:

$ make index

About

API for searching and reading the Buildpack Registry

License:Apache License 2.0


Languages

Language:Ruby 55.0%Language:TypeScript 17.8%Language:Go 10.8%Language:JavaScript 10.4%Language:SCSS 3.5%Language:CSS 0.9%Language:Makefile 0.9%Language:HTML 0.7%