Skip to content

Commit 23ef66d

Browse files
authored
Index server REST APIs docs (#282)
* docs: index server rest apis Signed-off-by: jingfu wang <jingfu.j.wang@ibm.com> * fix: placeholder syntax Signed-off-by: jingfu wang <jingfu.j.wang@ibm.com> * docs: address comments Signed-off-by: jingfu wang <jingfu.j.wang@ibm.com> * docs: add details Signed-off-by: jingfu wang <jingfu.j.wang@ibm.com> * docs: adjust format Signed-off-by: jingfu wang <jingfu.j.wang@ibm.com> * docs: address comments Signed-off-by: jingfu wang <jingfu.j.wang@ibm.com>
1 parent 756f093 commit 23ef66d

File tree

1 file changed

+241
-0
lines changed

1 file changed

+241
-0
lines changed
Lines changed: 241 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,241 @@
1+
# Index server REST APIs
2+
This documentation explains how to use the index server REST APIs
3+
4+
## Gets registry index file
5+
Gets the registry index file content from HTTP response
6+
### HTTP request
7+
```
8+
GET http://{registry host}/index
9+
```
10+
### Request parameters
11+
| Parameter | Description |
12+
| --------- | ----------- |
13+
| registry host | the URL/ingress that exposes registry service |
14+
### Request body
15+
The request body must be empty.
16+
### Request example
17+
```
18+
curl http://devfile-registry.192.168.1.1.nip.io/index
19+
```
20+
### Response example
21+
```json
22+
[
23+
{
24+
"name": "java-maven",
25+
"displayName": "Maven Java",
26+
"description": "Upstream Maven and OpenJDK 11",
27+
"tags": [
28+
"Java",
29+
"Maven"
30+
],
31+
"projectType": "maven",
32+
"language": "java",
33+
"links": {
34+
"self": "devfile-catalog/java-maven:latest"
35+
},
36+
"resources": [
37+
"devfile.yaml",
38+
"archive.tar"
39+
]
40+
},
41+
{
42+
"name": "java-openliberty",
43+
"displayName": "Open Liberty",
44+
"description": "Open Liberty microservice in Java",
45+
"projectType": "docker",
46+
"language": "java",
47+
"links": {
48+
"self": "devfile-catalog/java-openliberty:latest"
49+
},
50+
"resources": [
51+
"devfile.yaml",
52+
"archive.tar"
53+
]
54+
},
55+
{
56+
"name": "java-quarkus",
57+
"displayName": "Quarkus Java",
58+
"description": "Upstream Quarkus with Java+GraalVM",
59+
"tags": [
60+
"Java",
61+
"Quarkus"
62+
],
63+
"projectType": "quarkus",
64+
"language": "java",
65+
"links": {
66+
"self": "devfile-catalog/java-quarkus:latest"
67+
},
68+
"resources": [
69+
"devfile.yaml",
70+
"archive.tar"
71+
]
72+
},
73+
{
74+
"name": "java-springboot",
75+
"displayName": "Spring Boot®",
76+
"description": "Spring Boot® using Java",
77+
"tags": [
78+
"Java",
79+
"Spring"
80+
],
81+
"projectType": "spring",
82+
"language": "java",
83+
"links": {
84+
"self": "devfile-catalog/java-springboot:latest"
85+
},
86+
"resources": [
87+
"devfile.yaml",
88+
"archive.tar"
89+
]
90+
},
91+
{
92+
"name": "java-vertx",
93+
"displayName": "Vert.x Java",
94+
"description": "Upstream Vert.x using Java",
95+
"tags": [
96+
"Java",
97+
"Vert.x"
98+
],
99+
"projectType": "vertx",
100+
"language": "java",
101+
"links": {
102+
"self": "devfile-catalog/java-vertx:latest"
103+
},
104+
"resources": [
105+
"devfile.yaml",
106+
"archive.tar"
107+
]
108+
},
109+
{
110+
"name": "nodejs",
111+
"displayName": "NodeJS Runtime",
112+
"description": "Stack with NodeJS 12",
113+
"tags": [
114+
"NodeJS",
115+
"Express",
116+
"ubi8"
117+
],
118+
"projectType": "nodejs",
119+
"language": "nodejs",
120+
"links": {
121+
"self": "devfile-catalog/nodejs:latest"
122+
},
123+
"resources": [
124+
"devfile.yaml",
125+
"archive.tar"
126+
]
127+
},
128+
{
129+
"name": "python",
130+
"displayName": "Python",
131+
"description": "Python Stack with Python 3.7",
132+
"tags": [
133+
"Python",
134+
"pip"
135+
],
136+
"projectType": "python",
137+
"language": "python",
138+
"links": {
139+
"self": "devfile-catalog/python:latest"
140+
},
141+
"resources": [
142+
"devfile.yaml",
143+
"archive.tar"
144+
]
145+
},
146+
{
147+
"name": "python-django",
148+
"displayName": "Django",
149+
"description": "Python3.7 with Django",
150+
"tags": [
151+
"Python",
152+
"pip",
153+
"Django"
154+
],
155+
"projectType": "django",
156+
"language": "python",
157+
"links": {
158+
"self": "devfile-catalog/python-django:latest"
159+
},
160+
"resources": [
161+
"devfile.yaml",
162+
"archive.tar"
163+
]
164+
}
165+
]
166+
```
167+
168+
## Gets registry stack devfile
169+
Gets the specific registry stack devfile content from HTTP response
170+
171+
Note: this REST API only returns the content of `devfile.yaml`, it won't return other resources in the stack
172+
### HTTP request
173+
```
174+
GET http://{registry host}/devfiles/{stack}
175+
```
176+
### Request parameters
177+
| Parameter | Description |
178+
| ----------| ----------- |
179+
| registry host | the URL/ingress that exposes registry service |
180+
| stack | registry stack name |
181+
### Request body
182+
The request body must be empty.
183+
### Request example
184+
```
185+
curl http://devfile-registry.192.168.1.1.nip.io/devfiles/nodejs
186+
```
187+
### Response example
188+
```yaml
189+
schemaVersion: 2.0.0
190+
metadata:
191+
name: nodejs
192+
version: 1.0.0
193+
starterProjects:
194+
- name: nodejs-starter
195+
git:
196+
remotes:
197+
origin: "https://github.com/odo-devfiles/nodejs-ex.git"
198+
components:
199+
- name: runtime
200+
container:
201+
image: registry.access.redhat.com/ubi8/nodejs-12:1-45
202+
memoryLimit: 1024Mi
203+
mountSources: true
204+
sourceMapping: /project
205+
endpoints:
206+
- name: http-3000
207+
targetPort: 3000
208+
commands:
209+
- id: install
210+
exec:
211+
component: runtime
212+
commandLine: npm install
213+
workingDir: /project
214+
group:
215+
kind: build
216+
isDefault: true
217+
- id: run
218+
exec:
219+
component: runtime
220+
commandLine: npm start
221+
workingDir: /project
222+
group:
223+
kind: run
224+
isDefault: true
225+
- id: debug
226+
exec:
227+
component: runtime
228+
commandLine: npm run debug
229+
workingDir: /project
230+
group:
231+
kind: debug
232+
isDefault: true
233+
- id: test
234+
exec:
235+
component: runtime
236+
commandLine: npm test
237+
workingDir: /project
238+
group:
239+
kind: test
240+
isDefault: true
241+
```

0 commit comments

Comments
 (0)