Skip to content

REST API query parameters for requesting field-based filtering of index schemas #959

@michael-valdron

Description

@michael-valdron

Which area this feature is related to?

/area registry

Which functionality do you think we should add?

Why is this needed? Is your feature request related to a problem?

Allows a consumer of the REST API to request for filtered down responses when working with GET /index and GET /v2index.

Detailed description:

Currently for GET /index and GET /v2index, there are a few query parameters which provide filtering based on schema version and architecture type. In addition to these, it would be good to have the following querying capabilities:

  • Stack/Sample query (fuzzy search) filter using index schema fields excluding select one
  • New lastModified filter

These capabilities would reduce load on both the registry index server and REST API consumers such as the registry viewer.

Describe the solution you'd like

Tasks

Examples

Request: GET /index?name=python or GET /v2index?name=python

Response:

[
  {
    "name": "python",
    "displayName": "Flask",
    "description": "Flask is a web framework, it’s a Python module that lets you develop web applications easily. It’s has a small and easy-to-extend core: it’s a microframework that doesn’t include an ORM (Object Relational Manager) or such features.",
    "type": "stack",
    "tags": [
      "Flask",
      "Python",
      "Pip"
    ],
    ...
  },
  {
    "name": "python-django",
    "displayName": "Django",
    "description": "Django is a high-level Python web framework that enables rapid development of secure and maintainable websites. Built by experienced developers, Django takes care of much of the hassle of web development, so you can focus on writing your app without needing to reinvent the wheel. It is free and open source, has a thriving and active community, great documentation, and many options for free and paid-for support.",
    "type": "stack",
    "tags": [
      "Django",
      "Python",
      "Pip"
    ],
    ...
  }
]

Describe alternatives you've considered

Without these changes, the filters in this issue would need to be applied on the client side which both requires the registry index server to create the entire list of index schemas to send as the response and put additional load on the consumer having to filter and pull out needed information after the fact.

Additional context

Metadata

Metadata

Labels

area/registryDevfile registry for stacks and infrastructuredemoIssue or PR candidate for a demo at the end of the Sprintseverity/blockerIssues that prevent developers from working

Type

No type

Projects

Status

Done ✅

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions