From 7775f0198b6e8bab7cfaa46afaa2c76ba45992da Mon Sep 17 00:00:00 2001 From: jingfu wang Date: Wed, 16 Dec 2020 17:07:45 -0500 Subject: [PATCH 1/6] docs: index server rest apis Signed-off-by: jingfu wang --- .../registry/index-server-REST-API.md | 239 ++++++++++++++++++ 1 file changed, 239 insertions(+) create mode 100644 docs/proposals/registry/index-server-REST-API.md diff --git a/docs/proposals/registry/index-server-REST-API.md b/docs/proposals/registry/index-server-REST-API.md new file mode 100644 index 000000000..c1989a58c --- /dev/null +++ b/docs/proposals/registry/index-server-REST-API.md @@ -0,0 +1,239 @@ +# Index server REST APIs +This documentation explains how to use the index server REST APIs + +## Gets registry index file +### HTTP request +``` +GET http:///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 +``` +[ + { + "name": "java-maven", + "displayName": "Maven Java", + "description": "Upstream Maven and OpenJDK 11", + "tags": [ + "Java", + "Maven" + ], + "projectType": "maven", + "language": "java", + "links": { + "self": "devfile-catalog/java-maven:latest" + }, + "resources": [ + "devfile.yaml", + "meta.yaml" + ] + }, + { + "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", + "meta.yaml" + ] + }, + { + "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", + "meta.yaml" + ] + }, + { + "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", + "meta.yaml" + ] + }, + { + "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", + "meta.yaml" + ] + }, + { + "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", + "meta.yaml" + ] + }, + { + "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", + "meta.yaml" + ] + }, + { + "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", + "meta.yaml" + ] + } +] +``` + +## Gets registry stack devfile +### 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 +``` +schemaVersion: 2.0.0 +metadata: + name: nodejs + version: 1.0.0 + alpha.build-dockerfile: "https://raw.githubusercontent.com/odo-devfiles/registry/master/devfiles/nodejs/build/Dockerfile" + alpha.deployment-manifest: "https://raw.githubusercontent.com/odo-devfiles/registry/master/devfiles/nodejs/deploy/deployment-manifest.yaml" +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 +``` \ No newline at end of file From 0941467960c408c1491709117d908f3b1636b33f Mon Sep 17 00:00:00 2001 From: jingfu wang Date: Wed, 16 Dec 2020 17:12:35 -0500 Subject: [PATCH 2/6] fix: placeholder syntax Signed-off-by: jingfu wang --- docs/proposals/registry/index-server-REST-API.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/proposals/registry/index-server-REST-API.md b/docs/proposals/registry/index-server-REST-API.md index c1989a58c..70b93ecea 100644 --- a/docs/proposals/registry/index-server-REST-API.md +++ b/docs/proposals/registry/index-server-REST-API.md @@ -4,7 +4,7 @@ This documentation explains how to use the index server REST APIs ## Gets registry index file ### HTTP request ``` -GET http:///index +GET http://{registry host}/index ``` ### Request parameters | Parameter | Description | From 5e7fb604716b5e723f9cfe1a70e54f01a49c4cdc Mon Sep 17 00:00:00 2001 From: jingfu wang Date: Thu, 17 Dec 2020 14:32:52 -0500 Subject: [PATCH 3/6] docs: address comments Signed-off-by: jingfu wang --- docs/proposals/registry/index-server-REST-API.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/proposals/registry/index-server-REST-API.md b/docs/proposals/registry/index-server-REST-API.md index 70b93ecea..c9161fdf4 100644 --- a/docs/proposals/registry/index-server-REST-API.md +++ b/docs/proposals/registry/index-server-REST-API.md @@ -1,7 +1,8 @@ # Index server REST APIs This documentation explains how to use the index server REST APIs -## Gets registry index file +## Gets registry index file +Gets the registry index file content from HTTP response ### HTTP request ``` GET http://{registry host}/index @@ -17,7 +18,7 @@ The request body must be empty. curl http://devfile-registry.192.168.1.1.nip.io/index ``` ### Response example -``` +```json [ { "name": "java-maven", @@ -165,6 +166,7 @@ curl http://devfile-registry.192.168.1.1.nip.io/index ``` ## Gets registry stack devfile +Gets the specific registry stack devfile content from HTTP response ### HTTP request ``` GET http://{registry host}/devfiles/{stack} @@ -181,7 +183,7 @@ The request body must be empty. curl http://devfile-registry.192.168.1.1.nip.io/devfiles/nodejs ``` ### Response example -``` +```yaml schemaVersion: 2.0.0 metadata: name: nodejs From da8cce818e15c6ef96f6627a7a06f61538e04695 Mon Sep 17 00:00:00 2001 From: jingfu wang Date: Thu, 17 Dec 2020 16:13:19 -0500 Subject: [PATCH 4/6] docs: add details Signed-off-by: jingfu wang --- docs/proposals/registry/index-server-REST-API.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/proposals/registry/index-server-REST-API.md b/docs/proposals/registry/index-server-REST-API.md index c9161fdf4..b7f007852 100644 --- a/docs/proposals/registry/index-server-REST-API.md +++ b/docs/proposals/registry/index-server-REST-API.md @@ -167,6 +167,7 @@ curl http://devfile-registry.192.168.1.1.nip.io/index ## 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} From 3d149dd7e188364d41652364b141dc9efc91ca4e Mon Sep 17 00:00:00 2001 From: jingfu wang Date: Thu, 17 Dec 2020 16:14:51 -0500 Subject: [PATCH 5/6] docs: adjust format Signed-off-by: jingfu wang --- docs/proposals/registry/index-server-REST-API.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/proposals/registry/index-server-REST-API.md b/docs/proposals/registry/index-server-REST-API.md index b7f007852..ca9d9b6c2 100644 --- a/docs/proposals/registry/index-server-REST-API.md +++ b/docs/proposals/registry/index-server-REST-API.md @@ -167,6 +167,7 @@ curl http://devfile-registry.192.168.1.1.nip.io/index ## 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 ``` From 42d68c50d7a4228788a50e5c088c089c97ca596c Mon Sep 17 00:00:00 2001 From: jingfu wang Date: Wed, 6 Jan 2021 17:18:36 -0500 Subject: [PATCH 6/6] docs: address comments Signed-off-by: jingfu wang --- .../registry/index-server-REST-API.md | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/docs/proposals/registry/index-server-REST-API.md b/docs/proposals/registry/index-server-REST-API.md index ca9d9b6c2..46eca8d52 100644 --- a/docs/proposals/registry/index-server-REST-API.md +++ b/docs/proposals/registry/index-server-REST-API.md @@ -35,7 +35,7 @@ curl http://devfile-registry.192.168.1.1.nip.io/index }, "resources": [ "devfile.yaml", - "meta.yaml" + "archive.tar" ] }, { @@ -49,7 +49,7 @@ curl http://devfile-registry.192.168.1.1.nip.io/index }, "resources": [ "devfile.yaml", - "meta.yaml" + "archive.tar" ] }, { @@ -67,7 +67,7 @@ curl http://devfile-registry.192.168.1.1.nip.io/index }, "resources": [ "devfile.yaml", - "meta.yaml" + "archive.tar" ] }, { @@ -85,7 +85,7 @@ curl http://devfile-registry.192.168.1.1.nip.io/index }, "resources": [ "devfile.yaml", - "meta.yaml" + "archive.tar" ] }, { @@ -103,7 +103,7 @@ curl http://devfile-registry.192.168.1.1.nip.io/index }, "resources": [ "devfile.yaml", - "meta.yaml" + "archive.tar" ] }, { @@ -122,7 +122,7 @@ curl http://devfile-registry.192.168.1.1.nip.io/index }, "resources": [ "devfile.yaml", - "meta.yaml" + "archive.tar" ] }, { @@ -140,7 +140,7 @@ curl http://devfile-registry.192.168.1.1.nip.io/index }, "resources": [ "devfile.yaml", - "meta.yaml" + "archive.tar" ] }, { @@ -159,7 +159,7 @@ curl http://devfile-registry.192.168.1.1.nip.io/index }, "resources": [ "devfile.yaml", - "meta.yaml" + "archive.tar" ] } ] @@ -190,8 +190,6 @@ schemaVersion: 2.0.0 metadata: name: nodejs version: 1.0.0 - alpha.build-dockerfile: "https://raw.githubusercontent.com/odo-devfiles/registry/master/devfiles/nodejs/build/Dockerfile" - alpha.deployment-manifest: "https://raw.githubusercontent.com/odo-devfiles/registry/master/devfiles/nodejs/deploy/deployment-manifest.yaml" starterProjects: - name: nodejs-starter git: