Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Index server REST APIs docs #282

Merged
merged 6 commits into from
Jan 11, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
241 changes: 241 additions & 0 deletions docs/proposals/registry/index-server-REST-API.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,241 @@
# Index server REST APIs
This documentation explains how to use the index server REST APIs

## Gets registry index file
Gets the registry index file content from HTTP response
### HTTP request
```
GET http://{registry host}/index
```
### Request parameters
| Parameter | Description |
| --------- | ----------- |
| registry host | the URL/ingress that exposes registry service |
### Request body
The request body must be empty.
### Request example
```
curl http://devfile-registry.192.168.1.1.nip.io/index
```
### Response example
```json
[
{
"name": "java-maven",
GeekArthur marked this conversation as resolved.
Show resolved Hide resolved
"displayName": "Maven Java",
"description": "Upstream Maven and OpenJDK 11",
"tags": [
"Java",
"Maven"
],
"projectType": "maven",
"language": "java",
"links": {
"self": "devfile-catalog/java-maven:latest"
GeekArthur marked this conversation as resolved.
Show resolved Hide resolved
},
"resources": [
"devfile.yaml",
"archive.tar"
]
},
{
"name": "java-openliberty",
"displayName": "Open Liberty",
"description": "Open Liberty microservice in Java",
"projectType": "docker",
"language": "java",
"links": {
"self": "devfile-catalog/java-openliberty:latest"
},
"resources": [
"devfile.yaml",
"archive.tar"
]
},
{
"name": "java-quarkus",
"displayName": "Quarkus Java",
"description": "Upstream Quarkus with Java+GraalVM",
"tags": [
"Java",
"Quarkus"
],
"projectType": "quarkus",
"language": "java",
"links": {
"self": "devfile-catalog/java-quarkus:latest"
},
"resources": [
"devfile.yaml",
"archive.tar"
]
},
{
"name": "java-springboot",
"displayName": "Spring Boot®",
"description": "Spring Boot® using Java",
"tags": [
"Java",
"Spring"
],
"projectType": "spring",
"language": "java",
"links": {
"self": "devfile-catalog/java-springboot:latest"
},
"resources": [
"devfile.yaml",
"archive.tar"
]
},
{
"name": "java-vertx",
"displayName": "Vert.x Java",
"description": "Upstream Vert.x using Java",
"tags": [
"Java",
"Vert.x"
],
"projectType": "vertx",
"language": "java",
"links": {
"self": "devfile-catalog/java-vertx:latest"
},
"resources": [
"devfile.yaml",
"archive.tar"
]
},
{
"name": "nodejs",
"displayName": "NodeJS Runtime",
"description": "Stack with NodeJS 12",
"tags": [
"NodeJS",
"Express",
"ubi8"
],
"projectType": "nodejs",
"language": "nodejs",
"links": {
"self": "devfile-catalog/nodejs:latest"
},
"resources": [
"devfile.yaml",
"archive.tar"
]
},
{
"name": "python",
"displayName": "Python",
"description": "Python Stack with Python 3.7",
"tags": [
"Python",
"pip"
],
"projectType": "python",
"language": "python",
"links": {
"self": "devfile-catalog/python:latest"
},
"resources": [
"devfile.yaml",
"archive.tar"
]
},
{
"name": "python-django",
"displayName": "Django",
"description": "Python3.7 with Django",
"tags": [
"Python",
"pip",
"Django"
],
"projectType": "django",
"language": "python",
"links": {
"self": "devfile-catalog/python-django:latest"
},
"resources": [
"devfile.yaml",
"archive.tar"
]
}
]
```

## Gets registry stack devfile
Gets the specific registry stack devfile content from HTTP response

Note: this REST API only returns the content of `devfile.yaml`, it won't return other resources in the stack
### HTTP request
```
GET http://{registry host}/devfiles/{stack}
```
### Request parameters
| Parameter | Description |
| ----------| ----------- |
| registry host | the URL/ingress that exposes registry service |
| stack | registry stack name |
### Request body
The request body must be empty.
### Request example
```
curl http://devfile-registry.192.168.1.1.nip.io/devfiles/nodejs
```
### Response example
GeekArthur marked this conversation as resolved.
Show resolved Hide resolved
```yaml
schemaVersion: 2.0.0
metadata:
name: nodejs
version: 1.0.0
starterProjects:
- name: nodejs-starter
git:
remotes:
origin: "https://github.com/odo-devfiles/nodejs-ex.git"
components:
- name: runtime
container:
image: registry.access.redhat.com/ubi8/nodejs-12:1-45
memoryLimit: 1024Mi
mountSources: true
sourceMapping: /project
endpoints:
- name: http-3000
targetPort: 3000
commands:
- id: install
exec:
component: runtime
commandLine: npm install
workingDir: /project
group:
kind: build
isDefault: true
- id: run
exec:
component: runtime
commandLine: npm start
workingDir: /project
group:
kind: run
isDefault: true
- id: debug
exec:
component: runtime
commandLine: npm run debug
workingDir: /project
group:
kind: debug
isDefault: true
- id: test
exec:
component: runtime
commandLine: npm test
workingDir: /project
group:
kind: test
isDefault: true
```