diff --git a/index/server/registry-REST-API.adoc b/index/server/registry-REST-API.adoc new file mode 100644 index 000000000..f6caaf9bd --- /dev/null +++ b/index/server/registry-REST-API.adoc @@ -0,0 +1,2119 @@ += Registry REST API +This documentation explains how to use registry REST API + +== Content Guide +[cols="1,1"] +|=== +|Get registry index| +|/index +|xref:Gets registry index of stack devfile type[stack devfile type] + +xref:Gets registry index of sample devfile type[sample devfile type] + +xref:Gets registry index of all devfile types[all devfile types] + +|/v2index +|xref:Gets registry v2 index of stack devfile type[stack devfile type] + +xref:Gets registry v2 index of sample devfile type[sample devfile type] + +xref:Gets registry v2 index of all devfile types[all types] + +|Gets registry stack content| +|/devfiles +|xref:Gets registry stack devfile[] + +xref:Gets registry stack devfile with version[] + +|/devfiles/:stack/starterProjects +|xref:Download Starter Project from requested Devfile[] + +xref:Download Starter Project from requested Devfile with Version[] + +|=== + +== Gets registry index of stack devfile type +Gets the registry index file content of stack devfile type from HTTP response + +=== HTTP request +.... +GET http://{registry host}/index +.... + +=== Request parameters +[cols="1,1"] +|=== +|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 +[source,json] +---- +[ + { + "name": "java-maven", + "version": "1.1.0", + "displayName": "Maven Java", + "description": "Upstream Maven and OpenJDK 11", + "type": "stack", + "tags": [ + "Java", + "Maven" + ], + "projectType": "maven", + "language": "java", + "links": { + "self": "devfile-catalog/java-maven:latest" + }, + "resources": [ + "devfile.yaml" + ], + "starterProjects": [ + "springbootproject" + ] + }, + { + "name": "java-openliberty", + "version": "0.5.0", + "displayName": "Open Liberty", + "description": "Java application stack using Open Liberty runtime", + "type": "stack", + "projectType": "docker", + "language": "java", + "links": { + "self": "devfile-catalog/java-openliberty:latest" + }, + "resources": [ + "devfile.yaml" + ], + "starterProjects": [ + "user-app" + ] + }, + { + "name": "java-quarkus", + "version": "1.1.0", + "displayName": "Quarkus Java", + "description": "Upstream Quarkus with Java+GraalVM", + "type": "stack", + "tags": [ + "Java", + "Quarkus" + ], + "projectType": "quarkus", + "language": "java", + "links": { + "self": "devfile-catalog/java-quarkus:latest" + }, + "resources": [ + "devfile.yaml" + ], + "starterProjects": [ + "community", + "redhat-product" + ] + }, + { + "name": "java-springboot", + "version": "1.1.0", + "displayName": "Spring Boot®", + "description": "Spring Boot® using Java", + "type": "stack", + "tags": [ + "Java", + "Spring" + ], + "icon": "https://www.eclipse.org/che/images/logo-eclipseche.svg", + "globalMemoryLimit": "2674Mi", + "projectType": "spring", + "language": "java", + "links": { + "self": "devfile-catalog/java-springboot:latest" + }, + "resources": [ + "devfile.yaml" + ], + "starterProjects": [ + "springbootproject" + ] + }, + { + "name": "java-vertx", + "version": "1.1.0", + "displayName": "Vert.x Java", + "description": "Upstream Vert.x using Java", + "type": "stack", + "tags": [ + "Java", + "Vert.x" + ], + "projectType": "vertx", + "language": "java", + "links": { + "self": "devfile-catalog/java-vertx:latest" + }, + "resources": [ + "devfile.yaml" + ], + "starterProjects": [ + "vertx-http-example", + "vertx-istio-circuit-breaker-booster", + "vertx-istio-routing-booster", + "vertx-secured-http-example-redhat", + "vertx-crud-example-redhat", + "vertx-istio-security-booster", + "vertx-crud-example", + "vertx-circuit-breaker-example", + "vertx-configmap-example", + "vertx-circuit-breaker-example-redhat", + "vertx-cache-example-redhat", + "vertx-cache-example", + "vertx-secured-http-example", + "vertx-health-checks-example-redhat", + "vertx-http-example-redhat", + "vertx-health-checks-example", + "vertx-configmap-example-redhat", + "vertx-messaging-work-queue-booster", + "vertx-istio-distributed-tracing-booster" + ] + }, + { + "name": "java-wildfly", + "version": "1.0.2", + "displayName": "WildFly Java", + "description": "Upstream WildFly", + "type": "stack", + "tags": [ + "Java", + "WildFly" + ], + "projectType": "wildfly", + "language": "java", + "links": { + "self": "devfile-catalog/java-wildfly:latest" + }, + "resources": [ + "devfile.yaml" + ], + "starterProjects": [ + "microprofile-config", + "microprofile-fault-tolerance", + "microprofile-health", + "microprofile-jwt", + "microprofile-metrics", + "microprofile-openapi", + "microprofile-opentracing", + "microprofile-rest-client" + ] + }, + { + "name": "java-wildfly-bootable-jar", + "version": "1.0.2", + "displayName": "WildFly Bootable Jar", + "description": "Java stack with WildFly in bootable Jar mode, OpenJDK 11 and Maven 3.5", + "type": "stack", + "tags": [ + "RHEL8", + "Java", + "OpenJDK", + "Maven", + "WildFly", + "Microprofile", + "WildFly Bootable" + ], + "projectType": "WildFly", + "language": "java", + "links": { + "self": "devfile-catalog/java-wildfly-bootable-jar:latest" + }, + "resources": [ + "devfile.yaml" + ], + "starterProjects": [ + "microprofile-config", + "microprofile-fault-tolerance", + "microprofile-health", + "microprofile-jwt", + "microprofile-metrics", + "microprofile-openapi", + "microprofile-opentracing", + "microprofile-rest-client" + ] + }, + { + "name": "nodejs", + "version": "1.0.0", + "displayName": "NodeJS Runtime", + "description": "Stack with NodeJS 12", + "type": "stack", + "tags": [ + "NodeJS", + "Express", + "ubi8" + ], + "projectType": "nodejs", + "language": "nodejs", + "links": { + "self": "devfile-catalog/nodejs:latest" + }, + "resources": [ + "devfile.yaml" + ], + "starterProjects": [ + "nodejs-starter" + ] + }, + { + "name": "python", + "version": "1.0.0", + "displayName": "Python", + "description": "Python Stack with Python 3.7", + "type": "stack", + "tags": [ + "Python", + "pip" + ], + "projectType": "python", + "language": "python", + "links": { + "self": "devfile-catalog/python:latest" + }, + "resources": [ + "devfile.yaml" + ], + "starterProjects": [ + "python-example" + ] + }, + { + "name": "python-django", + "version": "1.0.0", + "displayName": "Django", + "description": "Python3.7 with Django", + "type": "stack", + "tags": [ + "Python", + "pip", + "Django" + ], + "projectType": "django", + "language": "python", + "links": { + "self": "devfile-catalog/python-django:latest" + }, + "resources": [ + "devfile.yaml" + ], + "starterProjects": [ + "django-example" + ] + } +] +---- + +== Gets registry index of sample devfile type +Gets the registry index file content of sample devfile type from HTTP response + +=== HTTP request +.... +GET http://{registry host}/index/sample +.... + +=== Request parameters +[cols="1,1"] +|=== +|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/sample +.... + +=== Response example +[source,json] +--- +[ + { + "name": "nodejs-basic", + "displayName": "Basic NodeJS", + "description": "A simple Hello World Node.js application", + "type": "sample", + "tags": [ + "NodeJS", + "Express" + ], + "icon": "https://github.com/maysunfaisal/node-bulletin-board-2/blob/main/nodejs-icon.png", + "projectType": "nodejs", + "language": "nodejs", + "git": { + "remotes": { + "origin": "https://github.com/redhat-developer/devfile-sample.git" + } + } + }, + { + "name": "code-with-quarkus", + "displayName": "Basic Quarkus", + "description": "A simple Hello World Java application using Quarkus", + "type": "sample", + "tags": [ + "Java", + "Quarkus" + ], + "icon": ".devfile/icon/quarkus.png", + "projectType": "quarkus", + "language": "java", + "git": { + "remotes": { + "origin": "https://github.com/elsony/devfile-sample-code-with-quarkus.git" + } + } + }, + { + "name": "java-springboot-basic", + "displayName": "Basic Spring Boot", + "description": "A simple Hello World Java Spring Boot application using Maven", + "type": "sample", + "tags": [ + "Java", + "Spring" + ], + "icon": ".devfile/icon/spring-logo.png", + "projectType": "springboot", + "language": "java", + "git": { + "remotes": { + "origin": "https://github.com/elsony/devfile-sample-java-springboot-basic.git" + } + } + }, + { + "name": "python-basic", + "displayName": "Basic Python", + "description": "A simple Hello World application using Python", + "type": "sample", + "tags": [ + "Python" + ], + "icon": ".devfile/icon/python.png", + "projectType": "python", + "language": "python", + "git": { + "remotes": { + "origin": "https://github.com/elsony/devfile-sample-python-basic.git" + } + } + } +] +--- + +== Gets registry index of all devfile types +Gets the registry index file content of all devfile types from HTTP response + +=== HTTP request +.... +GET http://{registry host}/index/all +.... + +=== Request parameters +[cols="1,1"] +|=== +|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/all +.... + +=== Response example +[source,json] +---- +[ + { + "name": "java-maven", + "version": "1.1.0", + "displayName": "Maven Java", + "description": "Upstream Maven and OpenJDK 11", + "type": "stack", + "tags": [ + "Java", + "Maven" + ], + "projectType": "maven", + "language": "java", + "links": { + "self": "devfile-catalog/java-maven:latest" + }, + "resources": [ + "devfile.yaml" + ], + "starterProjects": [ + "springbootproject" + ] + }, + { + "name": "java-openliberty", + "version": "0.5.0", + "displayName": "Open Liberty", + "description": "Java application stack using Open Liberty runtime", + "type": "stack", + "projectType": "docker", + "language": "java", + "links": { + "self": "devfile-catalog/java-openliberty:latest" + }, + "resources": [ + "devfile.yaml" + ], + "starterProjects": [ + "user-app" + ] + }, + { + "name": "java-quarkus", + "version": "1.1.0", + "displayName": "Quarkus Java", + "description": "Upstream Quarkus with Java+GraalVM", + "type": "stack", + "tags": [ + "Java", + "Quarkus" + ], + "projectType": "quarkus", + "language": "java", + "links": { + "self": "devfile-catalog/java-quarkus:latest" + }, + "resources": [ + "devfile.yaml" + ], + "starterProjects": [ + "community", + "redhat-product" + ] + }, + { + "name": "java-springboot", + "version": "1.1.0", + "displayName": "Spring Boot®", + "description": "Spring Boot® using Java", + "type": "stack", + "tags": [ + "Java", + "Spring" + ], + "icon": "https://www.eclipse.org/che/images/logo-eclipseche.svg", + "globalMemoryLimit": "2674Mi", + "projectType": "spring", + "language": "java", + "links": { + "self": "devfile-catalog/java-springboot:latest" + }, + "resources": [ + "devfile.yaml" + ], + "starterProjects": [ + "springbootproject" + ] + }, + { + "name": "java-vertx", + "version": "1.1.0", + "displayName": "Vert.x Java", + "description": "Upstream Vert.x using Java", + "type": "stack", + "tags": [ + "Java", + "Vert.x" + ], + "projectType": "vertx", + "language": "java", + "links": { + "self": "devfile-catalog/java-vertx:latest" + }, + "resources": [ + "devfile.yaml" + ], + "starterProjects": [ + "vertx-http-example", + "vertx-istio-circuit-breaker-booster", + "vertx-istio-routing-booster", + "vertx-secured-http-example-redhat", + "vertx-crud-example-redhat", + "vertx-istio-security-booster", + "vertx-crud-example", + "vertx-circuit-breaker-example", + "vertx-configmap-example", + "vertx-circuit-breaker-example-redhat", + "vertx-cache-example-redhat", + "vertx-cache-example", + "vertx-secured-http-example", + "vertx-health-checks-example-redhat", + "vertx-http-example-redhat", + "vertx-health-checks-example", + "vertx-configmap-example-redhat", + "vertx-messaging-work-queue-booster", + "vertx-istio-distributed-tracing-booster" + ] + }, + { + "name": "java-wildfly", + "version": "1.0.2", + "displayName": "WildFly Java", + "description": "Upstream WildFly", + "type": "stack", + "tags": [ + "Java", + "WildFly" + ], + "projectType": "wildfly", + "language": "java", + "links": { + "self": "devfile-catalog/java-wildfly:latest" + }, + "resources": [ + "devfile.yaml" + ], + "starterProjects": [ + "microprofile-config", + "microprofile-fault-tolerance", + "microprofile-health", + "microprofile-jwt", + "microprofile-metrics", + "microprofile-openapi", + "microprofile-opentracing", + "microprofile-rest-client" + ] + }, + { + "name": "java-wildfly-bootable-jar", + "version": "1.0.2", + "displayName": "WildFly Bootable Jar", + "description": "Java stack with WildFly in bootable Jar mode, OpenJDK 11 and Maven 3.5", + "type": "stack", + "tags": [ + "RHEL8", + "Java", + "OpenJDK", + "Maven", + "WildFly", + "Microprofile", + "WildFly Bootable" + ], + "projectType": "WildFly", + "language": "java", + "links": { + "self": "devfile-catalog/java-wildfly-bootable-jar:latest" + }, + "resources": [ + "devfile.yaml" + ], + "starterProjects": [ + "microprofile-config", + "microprofile-fault-tolerance", + "microprofile-health", + "microprofile-jwt", + "microprofile-metrics", + "microprofile-openapi", + "microprofile-opentracing", + "microprofile-rest-client" + ] + }, + { + "name": "nodejs", + "version": "1.0.0", + "displayName": "NodeJS Runtime", + "description": "Stack with NodeJS 12", + "type": "stack", + "tags": [ + "NodeJS", + "Express", + "ubi8" + ], + "projectType": "nodejs", + "language": "nodejs", + "links": { + "self": "devfile-catalog/nodejs:latest" + }, + "resources": [ + "devfile.yaml" + ], + "starterProjects": [ + "nodejs-starter" + ] + }, + { + "name": "python", + "version": "1.0.0", + "displayName": "Python", + "description": "Python Stack with Python 3.7", + "type": "stack", + "tags": [ + "Python", + "pip" + ], + "projectType": "python", + "language": "python", + "links": { + "self": "devfile-catalog/python:latest" + }, + "resources": [ + "devfile.yaml" + ], + "starterProjects": [ + "python-example" + ] + }, + { + "name": "python-django", + "version": "1.0.0", + "displayName": "Django", + "description": "Python3.7 with Django", + "type": "stack", + "tags": [ + "Python", + "pip", + "Django" + ], + "projectType": "django", + "language": "python", + "links": { + "self": "devfile-catalog/python-django:latest" + }, + "resources": [ + "devfile.yaml" + ], + "starterProjects": [ + "django-example" + ] + }, + { + "name": "nodejs-basic", + "displayName": "Basic NodeJS", + "description": "A simple Hello World Node.js application", + "type": "sample", + "tags": [ + "NodeJS", + "Express" + ], + "icon": "https://github.com/maysunfaisal/node-bulletin-board-2/blob/main/nodejs-icon.png", + "projectType": "nodejs", + "language": "nodejs", + "git": { + "remotes": { + "origin": "https://github.com/redhat-developer/devfile-sample.git" + } + } + }, + { + "name": "code-with-quarkus", + "displayName": "Basic Quarkus", + "description": "A simple Hello World Java application using Quarkus", + "type": "sample", + "tags": [ + "Java", + "Quarkus" + ], + "icon": ".devfile/icon/quarkus.png", + "projectType": "quarkus", + "language": "java", + "git": { + "remotes": { + "origin": "https://github.com/elsony/devfile-sample-code-with-quarkus.git" + } + } + }, + { + "name": "java-springboot-basic", + "displayName": "Basic Spring Boot", + "description": "A simple Hello World Java Spring Boot application using Maven", + "type": "sample", + "tags": [ + "Java", + "Spring" + ], + "icon": ".devfile/icon/spring-logo.png", + "projectType": "springboot", + "language": "java", + "git": { + "remotes": { + "origin": "https://github.com/elsony/devfile-sample-java-springboot-basic.git" + } + } + }, + { + "name": "python-basic", + "displayName": "Basic Python", + "description": "A simple Hello World application using Python", + "type": "sample", + "tags": [ + "Python" + ], + "icon": ".devfile/icon/python.png", + "projectType": "python", + "language": "python", + "git": { + "remotes": { + "origin": "https://github.com/elsony/devfile-sample-python-basic.git" + } + } + } +] +---- + +== Gets registry v2 index of stack devfile type +Gets the registry v2 index file content of stack devfile type, which contains versions information, from HTTP response + +=== HTTP request +.... +GET http://{registry host}/v2index +.... + +=== Request parameters +[cols="1,1"] +|=== +|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/v2index +.... + +=== Response example +[source,json] +---- +[ + { + "name": "java-maven", + "displayName": "Maven Java", + "description": "Upstream Maven and OpenJDK 11", + "type": "stack", + "tags": [ + "Java", + "Maven" + ], + "icon": "https://raw.githubusercontent.com/devfile-samples/devfile-stack-icons/main/java-maven.jpg", + "projectType": "maven", + "language": "java", + "versions": [ + { + "version": "1.1.0", + "schemaVersion": "2.0.0", + "default": true, + "description": "Upstream Maven and OpenJDK 11", + "tags": [ + "Java", + "Maven" + ], + "icon": "https://raw.githubusercontent.com/devfile-samples/devfile-stack-icons/main/java-maven.jpg", + "links": { + "self": "devfile-catalog/java-maven:1.1.0" + }, + "resources": [ + "devfile.yaml" + ], + "starterProjects": [ + "springbootproject" + ] + } + ] + }, + { + "name": "java-quarkus", + "displayName": "Quarkus Java", + "description": "Quarkus with Java", + "type": "stack", + "tags": [ + "Java", + "Quarkus" + ], + "icon": "https://design.jboss.org/quarkus/logo/final/SVG/quarkus_icon_rgb_default.svg", + "projectType": "quarkus", + "language": "java", + "versions": [ + { + "version": "1.1.0", + "schemaVersion": "2.0.0", + "default": true, + "description": "Quarkus with Java", + "tags": [ + "Java", + "Quarkus" + ], + "icon": "https://design.jboss.org/quarkus/logo/final/SVG/quarkus_icon_rgb_default.svg", + "links": { + "self": "devfile-catalog/java-quarkus:1.1.0" + }, + "resources": [ + "devfile.yaml" + ], + "starterProjects": [ + "community", + "redhat-product" + ] + } + ] + }, + { + "name": "java-springboot", + "displayName": "Spring Boot®", + "description": "Spring Boot® using Java", + "type": "stack", + "tags": [ + "Java", + "Spring" + ], + "icon": "https://spring.io/images/projects/spring-edf462fec682b9d48cf628eaf9e19521.svg", + "projectType": "spring", + "language": "java", + "versions": [ + { + "version": "1.1.0", + "schemaVersion": "2.0.0", + "default": true, + "description": "Spring Boot® using Java", + "tags": [ + "Java", + "Spring" + ], + "icon": "https://spring.io/images/projects/spring-edf462fec682b9d48cf628eaf9e19521.svg", + "links": { + "self": "devfile-catalog/java-springboot:1.1.0" + }, + "resources": [ + "devfile.yaml" + ], + "starterProjects": [ + "springbootproject" + ] + } + ] + }, +{ + "name": "java-openliberty", + "displayName": "Open Liberty Maven", + "description": "Java application Maven-built stack using the Open Liberty runtime", + "type": "stack", + "tags": [ + "Java", + "Maven" + ], + "architectures": [ + "amd64", + "ppc64le", + "s390x" + ], + "icon": "https://raw.githubusercontent.com/OpenLiberty/logos/7fbb132949b9b2589e18c8d5665c1b107028a21d/logomark/svg/OL_logomark.svg", + "projectType": "openliberty", + "language": "java", + "versions": [ + { + "version": "0.8.1", + "schemaVersion": "2.1.0", + "default": true, + "description": "Java application Maven-built stack using the Open Liberty runtime", + "tags": [ + "Java", + "Maven" + ], + "architectures": [ + "amd64", + "ppc64le", + "s390x" + ], + "icon": "https://raw.githubusercontent.com/OpenLiberty/logos/7fbb132949b9b2589e18c8d5665c1b107028a21d/logomark/svg/OL_logomark.svg", + "links": { + "self": "devfile-catalog/java-openliberty:0.8.1" + }, + "resources": [ + "devfile.yaml" + ], + "starterProjects": [ + "rest" + ] + } + ] + }, + { + "name": "java-openliberty-gradle", + "displayName": "Open Liberty Gradle", + "description": "Java application Gradle-built stack using the Open Liberty runtime", + "type": "stack", + "tags": [ + "Java", + "Gradle" + ], + "architectures": [ + "amd64", + "ppc64le", + "s390x" + ], + "icon": "https://raw.githubusercontent.com/OpenLiberty/logos/7fbb132949b9b2589e18c8d5665c1b107028a21d/logomark/svg/OL_logomark.svg", + "projectType": "openliberty", + "language": "java", + "versions": [ + { + "version": "0.3.1", + "schemaVersion": "2.1.0", + "default": true, + "description": "Java application Gradle-built stack using the Open Liberty runtime", + "tags": [ + "Java", + "Gradle" + ], + "architectures": [ + "amd64", + "ppc64le", + "s390x" + ], + "icon": "https://raw.githubusercontent.com/OpenLiberty/logos/7fbb132949b9b2589e18c8d5665c1b107028a21d/logomark/svg/OL_logomark.svg", + "links": { + "self": "devfile-catalog/java-openliberty-gradle:0.3.1" + }, + "resources": [ + "devfile.yaml" + ], + "starterProjects": [ + "rest" + ] + } + ] + }, + { + "name": "java-vertx", + "displayName": "Vert.x Java", + "description": "Upstream Vert.x using Java", + "type": "stack", + "tags": [ + "Java", + "Vert.x" + ], + "icon": "https://raw.githubusercontent.com/vertx-web-site/vertx-logo/master/vertx-logo.svg", + "projectType": "vertx", + "language": "java", + "versions": [ + { + "version": "1.1.0", + "schemaVersion": "2.0.0", + "default": true, + "description": "Upstream Vert.x using Java", + "tags": [ + "Java", + "Vert.x" + ], + "icon": "https://raw.githubusercontent.com/vertx-web-site/vertx-logo/master/vertx-logo.svg", + "links": { + "self": "devfile-catalog/java-vertx:1.1.0" + }, + "resources": [ + "devfile.yaml" + ], + "starterProjects": [ + "vertx-http-example", + "vertx-istio-circuit-breaker-booster", + "vertx-istio-routing-booster", + "vertx-secured-http-example-redhat", + "vertx-crud-example-redhat", + "vertx-istio-security-booster", + "vertx-crud-example", + "vertx-circuit-breaker-example", + "vertx-configmap-example", + "vertx-circuit-breaker-example-redhat", + "vertx-cache-example-redhat", + "vertx-cache-example", + "vertx-secured-http-example", + "vertx-health-checks-example-redhat", + "vertx-http-example-redhat", + "vertx-health-checks-example", + "vertx-configmap-example-redhat", + "vertx-messaging-work-queue-booster", + "vertx-istio-distributed-tracing-booster" + ] + } + ] + } +] +---- + +=== Query parameters +[cols="1,1"] +|=== +|Parameter|Description + +|MaxSchemaVersion +|The maximum devfile schema version + +|MinSchemaVersion +|The minimum devfile schema version +|=== + +=== Request example +.... +curl http://devfile-registry.192.168.1.1.nip.io/v2index?minSchemaVersion=2.1&maxSchemaVersion=2.1 +.... + +=== Response example +[source,json] +---- +[ + { + "name": "java-openliberty", + "displayName": "Open Liberty Maven", + "description": "Java application Maven-built stack using the Open Liberty runtime", + "type": "stack", + "tags": [ + "Java", + "Maven" + ], + "architectures": [ + "amd64", + "ppc64le", + "s390x" + ], + "icon": "https://raw.githubusercontent.com/OpenLiberty/logos/7fbb132949b9b2589e18c8d5665c1b107028a21d/logomark/svg/OL_logomark.svg", + "projectType": "openliberty", + "language": "java", + "versions": [ + { + "version": "0.8.1", + "schemaVersion": "2.1.0", + "default": true, + "description": "Java application Maven-built stack using the Open Liberty runtime", + "tags": [ + "Java", + "Maven" + ], + "architectures": [ + "amd64", + "ppc64le", + "s390x" + ], + "icon": "https://raw.githubusercontent.com/OpenLiberty/logos/7fbb132949b9b2589e18c8d5665c1b107028a21d/logomark/svg/OL_logomark.svg", + "links": { + "self": "devfile-catalog/java-openliberty:0.8.1" + }, + "resources": [ + "devfile.yaml" + ], + "starterProjects": [ + "rest" + ] + } + ] + }, + { + "name": "java-openliberty-gradle", + "displayName": "Open Liberty Gradle", + "description": "Java application Gradle-built stack using the Open Liberty runtime", + "type": "stack", + "tags": [ + "Java", + "Gradle" + ], + "architectures": [ + "amd64", + "ppc64le", + "s390x" + ], + "icon": "https://raw.githubusercontent.com/OpenLiberty/logos/7fbb132949b9b2589e18c8d5665c1b107028a21d/logomark/svg/OL_logomark.svg", + "projectType": "openliberty", + "language": "java", + "versions": [ + { + "version": "0.3.1", + "schemaVersion": "2.1.0", + "default": true, + "description": "Java application Gradle-built stack using the Open Liberty runtime", + "tags": [ + "Java", + "Gradle" + ], + "architectures": [ + "amd64", + "ppc64le", + "s390x" + ], + "icon": "https://raw.githubusercontent.com/OpenLiberty/logos/7fbb132949b9b2589e18c8d5665c1b107028a21d/logomark/svg/OL_logomark.svg", + "links": { + "self": "devfile-catalog/java-openliberty-gradle:0.3.1" + }, + "resources": [ + "devfile.yaml" + ], + "starterProjects": [ + "rest" + ] + } + ] + } +] +---- + +== Gets registry v2 index of sample devfile type +Gets the registry v2 index file content of sample devfile type, which contains versions information, from HTTP response + +=== HTTP request +.... +GET http://{registry host}/v2index/sample +.... + +=== Request parameters +[cols="1,1"] +|=== +|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/v2index/sample +.... + +=== Response example +[source,json] +---- +[ + { + "name": "nodejs-basic", + "displayName": "Basic Node.js", + "description": "A simple Hello World Node.js application", + "type": "sample", + "tags": [ + "NodeJS", + "Express" + ], + "icon": "https://nodejs.org/static/images/logos/nodejs-new-pantone-black.svg", + "projectType": "nodejs", + "language": "nodejs", + "versions": [ + { + "version": "1.1.0", + "schemaVersion": "2.2.0", + "default": true, + "git": { + "remotes": { + "origin": "https://github.com/nodeshift-starters/devfile-sample.git" + } + }, + "description": "nodejs with devfile v2.2.0" + } + ] + }, + { + "name": "code-with-quarkus", + "displayName": "Basic Quarkus", + "description": "A simple Hello World Java application using Quarkus", + "type": "sample", + "tags": [ + "Java", + "Quarkus" + ], + "icon": "https://design.jboss.org/quarkus/logo/final/SVG/quarkus_icon_rgb_default.svg", + "projectType": "quarkus", + "language": "java", + "versions": [ + { + "version": "1.1.0", + "schemaVersion": "2.2.0", + "default": true, + "git": { + "remotes": { + "origin": "https://github.com/devfile-samples/devfile-sample-code-with-quarkus.git" + } + }, + "description": "java quarkus with devfile v2.2.0" + }, + { + "version": "1.0.0", + "schemaVersion": "2.0.0", + "git": { + "remotes": { + "origin": "https://github.com/elsony/devfile-sample-code-with-quarkus.git" + } + }, + "description": "java quarkus with devfile v2.0.0" + } + ] + } +] +---- + +=== Query parameters +[cols="1,1"] +|=== +|Parameter|Description + +|MaxSchemaVersion +|The maximum devfile schema version + +|MinSchemaVersion +|The minimum devfile schema version +|=== + +=== Request example +.... +curl http://devfile-registry.192.168.1.1.nip.io/v2index/sample?maxSchemaVersion=2.1 +.... + +=== Response example +[source,json] +---- +[ + { + "name": "code-with-quarkus", + "displayName": "Basic Quarkus", + "description": "A simple Hello World Java application using Quarkus", + "type": "sample", + "tags": [ + "Java", + "Quarkus" + ], + "icon": "https://design.jboss.org/quarkus/logo/final/SVG/quarkus_icon_rgb_default.svg", + "projectType": "quarkus", + "language": "java", + "versions": [ + { + "version": "1.0.0", + "schemaVersion": "2.0.0", + "git": { + "remotes": { + "origin": "https://github.com/elsony/devfile-sample-code-with-quarkus.git" + } + }, + "description": "java quarkus with devfile v2.0.0" + } + ] + } +] +---- + +== Gets registry v2 index of all devfile types +Gets the registry v2 index file content of all devfile types, which contains versions information, from HTTP response + +=== HTTP request +.... +GET http://{registry host}/v2index/all +.... + +=== Request parameters +[cols="1,1"] +|=== +|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/v2index/all +.... + +=== Response example +[source,json] +---- +[ + { + "name": "java-maven", + "displayName": "Maven Java", + "description": "Upstream Maven and OpenJDK 11", + "type": "stack", + "tags": [ + "Java", + "Maven" + ], + "icon": "https://raw.githubusercontent.com/devfile-samples/devfile-stack-icons/main/java-maven.jpg", + "projectType": "maven", + "language": "java", + "versions": [ + { + "version": "1.1.0", + "schemaVersion": "2.0.0", + "default": true, + "description": "Upstream Maven and OpenJDK 11", + "tags": [ + "Java", + "Maven" + ], + "icon": "https://raw.githubusercontent.com/devfile-samples/devfile-stack-icons/main/java-maven.jpg", + "links": { + "self": "devfile-catalog/java-maven:1.1.0" + }, + "resources": [ + "devfile.yaml" + ], + "starterProjects": [ + "springbootproject" + ] + } + ] + }, + { + "name": "java-quarkus", + "displayName": "Quarkus Java", + "description": "Quarkus with Java", + "type": "stack", + "tags": [ + "Java", + "Quarkus" + ], + "icon": "https://design.jboss.org/quarkus/logo/final/SVG/quarkus_icon_rgb_default.svg", + "projectType": "quarkus", + "language": "java", + "versions": [ + { + "version": "1.1.0", + "schemaVersion": "2.0.0", + "default": true, + "description": "Quarkus with Java", + "tags": [ + "Java", + "Quarkus" + ], + "icon": "https://design.jboss.org/quarkus/logo/final/SVG/quarkus_icon_rgb_default.svg", + "links": { + "self": "devfile-catalog/java-quarkus:1.1.0" + }, + "resources": [ + "devfile.yaml" + ], + "starterProjects": [ + "community", + "redhat-product" + ] + } + ] + }, + { + "name": "java-springboot", + "displayName": "Spring Boot®", + "description": "Spring Boot® using Java", + "type": "stack", + "tags": [ + "Java", + "Spring" + ], + "icon": "https://spring.io/images/projects/spring-edf462fec682b9d48cf628eaf9e19521.svg", + "projectType": "spring", + "language": "java", + "versions": [ + { + "version": "1.1.0", + "schemaVersion": "2.0.0", + "default": true, + "description": "Spring Boot® using Java", + "tags": [ + "Java", + "Spring" + ], + "icon": "https://spring.io/images/projects/spring-edf462fec682b9d48cf628eaf9e19521.svg", + "links": { + "self": "devfile-catalog/java-springboot:1.1.0" + }, + "resources": [ + "devfile.yaml" + ], + "starterProjects": [ + "springbootproject" + ] + } + ] + }, +{ + "name": "java-openliberty", + "displayName": "Open Liberty Maven", + "description": "Java application Maven-built stack using the Open Liberty runtime", + "type": "stack", + "tags": [ + "Java", + "Maven" + ], + "architectures": [ + "amd64", + "ppc64le", + "s390x" + ], + "icon": "https://raw.githubusercontent.com/OpenLiberty/logos/7fbb132949b9b2589e18c8d5665c1b107028a21d/logomark/svg/OL_logomark.svg", + "projectType": "openliberty", + "language": "java", + "versions": [ + { + "version": "0.8.1", + "schemaVersion": "2.1.0", + "default": true, + "description": "Java application Maven-built stack using the Open Liberty runtime", + "tags": [ + "Java", + "Maven" + ], + "architectures": [ + "amd64", + "ppc64le", + "s390x" + ], + "icon": "https://raw.githubusercontent.com/OpenLiberty/logos/7fbb132949b9b2589e18c8d5665c1b107028a21d/logomark/svg/OL_logomark.svg", + "links": { + "self": "devfile-catalog/java-openliberty:0.8.1" + }, + "resources": [ + "devfile.yaml" + ], + "starterProjects": [ + "rest" + ] + } + ] + }, + { + "name": "java-openliberty-gradle", + "displayName": "Open Liberty Gradle", + "description": "Java application Gradle-built stack using the Open Liberty runtime", + "type": "stack", + "tags": [ + "Java", + "Gradle" + ], + "architectures": [ + "amd64", + "ppc64le", + "s390x" + ], + "icon": "https://raw.githubusercontent.com/OpenLiberty/logos/7fbb132949b9b2589e18c8d5665c1b107028a21d/logomark/svg/OL_logomark.svg", + "projectType": "openliberty", + "language": "java", + "versions": [ + { + "version": "0.3.1", + "schemaVersion": "2.1.0", + "default": true, + "description": "Java application Gradle-built stack using the Open Liberty runtime", + "tags": [ + "Java", + "Gradle" + ], + "architectures": [ + "amd64", + "ppc64le", + "s390x" + ], + "icon": "https://raw.githubusercontent.com/OpenLiberty/logos/7fbb132949b9b2589e18c8d5665c1b107028a21d/logomark/svg/OL_logomark.svg", + "links": { + "self": "devfile-catalog/java-openliberty-gradle:0.3.1" + }, + "resources": [ + "devfile.yaml" + ], + "starterProjects": [ + "rest" + ] + } + ] + }, + { + "name": "java-vertx", + "displayName": "Vert.x Java", + "description": "Upstream Vert.x using Java", + "type": "stack", + "tags": [ + "Java", + "Vert.x" + ], + "icon": "https://raw.githubusercontent.com/vertx-web-site/vertx-logo/master/vertx-logo.svg", + "projectType": "vertx", + "language": "java", + "versions": [ + { + "version": "1.1.0", + "schemaVersion": "2.0.0", + "default": true, + "description": "Upstream Vert.x using Java", + "tags": [ + "Java", + "Vert.x" + ], + "icon": "https://raw.githubusercontent.com/vertx-web-site/vertx-logo/master/vertx-logo.svg", + "links": { + "self": "devfile-catalog/java-vertx:1.1.0" + }, + "resources": [ + "devfile.yaml" + ], + "starterProjects": [ + "vertx-http-example", + "vertx-istio-circuit-breaker-booster", + "vertx-istio-routing-booster", + "vertx-secured-http-example-redhat", + "vertx-crud-example-redhat", + "vertx-istio-security-booster", + "vertx-crud-example", + "vertx-circuit-breaker-example", + "vertx-configmap-example", + "vertx-circuit-breaker-example-redhat", + "vertx-cache-example-redhat", + "vertx-cache-example", + "vertx-secured-http-example", + "vertx-health-checks-example-redhat", + "vertx-http-example-redhat", + "vertx-health-checks-example", + "vertx-configmap-example-redhat", + "vertx-messaging-work-queue-booster", + "vertx-istio-distributed-tracing-booster" + ] + } + ] + }, + { + "name": "nodejs-basic", + "displayName": "Basic Node.js", + "description": "A simple Hello World Node.js application", + "type": "sample", + "tags": [ + "NodeJS", + "Express" + ], + "icon": "https://nodejs.org/static/images/logos/nodejs-new-pantone-black.svg", + "projectType": "nodejs", + "language": "nodejs", + "versions": [ + { + "version": "1.1.0", + "schemaVersion": "2.2.0", + "default": true, + "git": { + "remotes": { + "origin": "https://github.com/nodeshift-starters/devfile-sample.git" + } + }, + "description": "nodejs with devfile v2.2.0" + } + ] + }, + { + "name": "code-with-quarkus", + "displayName": "Basic Quarkus", + "description": "A simple Hello World Java application using Quarkus", + "type": "sample", + "tags": [ + "Java", + "Quarkus" + ], + "icon": "https://design.jboss.org/quarkus/logo/final/SVG/quarkus_icon_rgb_default.svg", + "projectType": "quarkus", + "language": "java", + "versions": [ + { + "version": "1.1.0", + "schemaVersion": "2.2.0", + "default": true, + "git": { + "remotes": { + "origin": "https://github.com/devfile-samples/devfile-sample-code-with-quarkus.git" + } + }, + "description": "java quarkus with devfile v2.2.0" + }, + { + "version": "1.0.0", + "schemaVersion": "2.0.0", + "git": { + "remotes": { + "origin": "https://github.com/elsony/devfile-sample-code-with-quarkus.git" + } + }, + "description": "java quarkus with devfile v2.0.0" + } + ] + } +] +---- + +=== Query parameters +[cols="1,1"] +|=== +|Parameter|Description + +|MaxSchemaVersion +|The maximum devfile schema version + +|MinSchemaVersion +|The minimum devfile schema version +|=== + +=== Request example +.... +curl http://devfile-registry.192.168.1.1.nip.io/v2index/sample?minSchemaVersion=2.1 +.... + +=== Response example +[source,json] +---- +[ + { + "name": "java-openliberty", + "displayName": "Open Liberty Maven", + "description": "Java application Maven-built stack using the Open Liberty runtime", + "type": "stack", + "tags": [ + "Java", + "Maven" + ], + "architectures": [ + "amd64", + "ppc64le", + "s390x" + ], + "icon": "https://raw.githubusercontent.com/OpenLiberty/logos/7fbb132949b9b2589e18c8d5665c1b107028a21d/logomark/svg/OL_logomark.svg", + "projectType": "openliberty", + "language": "java", + "versions": [ + { + "version": "0.8.1", + "schemaVersion": "2.1.0", + "default": true, + "description": "Java application Maven-built stack using the Open Liberty runtime", + "tags": [ + "Java", + "Maven" + ], + "architectures": [ + "amd64", + "ppc64le", + "s390x" + ], + "icon": "https://raw.githubusercontent.com/OpenLiberty/logos/7fbb132949b9b2589e18c8d5665c1b107028a21d/logomark/svg/OL_logomark.svg", + "links": { + "self": "devfile-catalog/java-openliberty:0.8.1" + }, + "resources": [ + "devfile.yaml" + ], + "starterProjects": [ + "rest" + ] + } + ] + }, + { + "name": "java-openliberty-gradle", + "displayName": "Open Liberty Gradle", + "description": "Java application Gradle-built stack using the Open Liberty runtime", + "type": "stack", + "tags": [ + "Java", + "Gradle" + ], + "architectures": [ + "amd64", + "ppc64le", + "s390x" + ], + "icon": "https://raw.githubusercontent.com/OpenLiberty/logos/7fbb132949b9b2589e18c8d5665c1b107028a21d/logomark/svg/OL_logomark.svg", + "projectType": "openliberty", + "language": "java", + "versions": [ + { + "version": "0.3.1", + "schemaVersion": "2.1.0", + "default": true, + "description": "Java application Gradle-built stack using the Open Liberty runtime", + "tags": [ + "Java", + "Gradle" + ], + "architectures": [ + "amd64", + "ppc64le", + "s390x" + ], + "icon": "https://raw.githubusercontent.com/OpenLiberty/logos/7fbb132949b9b2589e18c8d5665c1b107028a21d/logomark/svg/OL_logomark.svg", + "links": { + "self": "devfile-catalog/java-openliberty-gradle:0.3.1" + }, + "resources": [ + "devfile.yaml" + ], + "starterProjects": [ + "rest" + ] + } + ] + }, + { + "name": "nodejs-basic", + "displayName": "Basic Node.js", + "description": "A simple Hello World Node.js application", + "type": "sample", + "tags": [ + "NodeJS", + "Express" + ], + "icon": "https://nodejs.org/static/images/logos/nodejs-new-pantone-black.svg", + "projectType": "nodejs", + "language": "nodejs", + "versions": [ + { + "version": "1.1.0", + "schemaVersion": "2.2.0", + "default": true, + "git": { + "remotes": { + "origin": "https://github.com/nodeshift-starters/devfile-sample.git" + } + }, + "description": "nodejs with devfile v2.2.0" + } + ] + }, + { + "name": "code-with-quarkus", + "displayName": "Basic Quarkus", + "description": "A simple Hello World Java application using Quarkus", + "type": "sample", + "tags": [ + "Java", + "Quarkus" + ], + "icon": "https://design.jboss.org/quarkus/logo/final/SVG/quarkus_icon_rgb_default.svg", + "projectType": "quarkus", + "language": "java", + "versions": [ + { + "version": "1.1.0", + "schemaVersion": "2.2.0", + "default": true, + "git": { + "remotes": { + "origin": "https://github.com/devfile-samples/devfile-sample-code-with-quarkus.git" + } + }, + "description": "java quarkus with devfile v2.2.0" + } + ] + } +] +---- + +== 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 +[cols="1,1"] +|=== +|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 +[source,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 +---- + +== Gets registry stack devfile with version +Gets the specific registry stack devfile content with stack version 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}/{version} +``` + +=== Request parameters +[cols="1,1"] +|=== +|Parameter|Description + +|Registry host +|The URL/ingress that exposes registry service + +|Stack +|Registry stack name + +|Version +|Specific version of the stack, or `latest` + +|=== + +=== Request body +The request body must be empty. + +=== Request example +``` +curl http://devfile-registry.192.168.1.1.nip.io/devfiles/nodejs/1.0.1 +``` + +=== Response example +[source,yaml] +---- +schemaVersion: 2.0.0 +metadata: + name: nodejs + version: 1.0.1 + displayName: Node.js Runtime + description: Stack with Node.js 14 + icon: https://nodejs.org/static/images/logos/nodejs-new-pantone-black.svg + tags: ['NodeJS', 'Express', 'ubi8'] + projectType: 'nodejs' + language: 'javascript' +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-14:latest + memoryLimit: 1024Mi + mountSources: true + endpoints: + - name: http-3000 + targetPort: 3000 +commands: + - id: install + exec: + component: runtime + commandLine: npm install + workingDir: ${PROJECT_SOURCE} + group: + kind: build + isDefault: true + - id: run + exec: + component: runtime + commandLine: npm start + workingDir: ${PROJECT_SOURCE} + group: + kind: run + isDefault: true + - id: debug + exec: + component: runtime + commandLine: npm run debug + workingDir: ${PROJECT_SOURCE} + group: + kind: debug + isDefault: true + - id: test + exec: + component: runtime + commandLine: npm test + workingDir: ${PROJECT_SOURCE} + group: + kind: test + isDefault: true +---- + +== Download Starter Project from requested Devfile + +Fetches starter project specified in requested registry stack devfile with version's content and provides an archive (zip) file download as the HTTP response. + +Note: Only provides download as the response, not the devfile content. + +=== HTTP Request +[source] +---- +GET http://{registry host}/devfiles/{stack}/starterProjects/{starterProject} +---- + +=== Request Parameters + +[cols="1,1"] +|=== +|Parameter|Description + +|Registry host +|The URL/ingress that exposes registry service + +|Stack +|Registry stack name + +|Starter Project +|Starter project name in the stack devfile + +|=== + +=== Request body +The request body must be empty. + +=== Request example +[source] +---- +curl http://devfile-registry.192.168.1.1.nip.io/devfiles/nodejs/starterProjects/nodejs-starter -o nodejs-starter.zip +---- + +=== Response example +[source] +---- + % Total % Received % Xferd Average Speed Time Time Time Current + Dload Upload Total Spent Left Speed +100 14383 0 14383 0 0 13910 0 --:--:-- 0:00:01 --:--:-- 13910 +---- + +== Download Starter Project from requested Devfile with Version + +Fetches starter project specified in requested registry stack devfile's content and provides an archive (zip) file download as the HTTP response. + +Note: Only provides download as the response, not the devfile content. + +=== HTTP Request +[source] +---- +GET http://{registry host}/devfiles/{stack}/{version}/starterProjects/{starterProject} +---- + +=== Request Parameters + +[cols="1,1"] +|=== +|Parameter|Description + +|Registry host +|The URL/ingress that exposes registry service + +|Stack +|Registry stack name + +|Version +|Specific version of the stack, or `latest` + +|Starter Project +|Starter project name in the stack devfile + +|=== + +=== Request body +The request body must be empty. + +=== Request example +[source] +---- +curl http://devfile-registry.192.168.1.1.nip.io/devfiles/nodejs/1.0.1/starterProjects/nodejs-starter -o nodejs-starter.zip +---- + +=== Response example +[source] +---- + % Total % Received % Xferd Average Speed Time Time Time Current + Dload Upload Total Spent Left Speed +100 14383 0 14383 0 0 13910 0 --:--:-- 0:00:01 --:--:-- 13910 +---- diff --git a/registry-library/README.md b/registry-library/README.md index d04e436dd..28f8e34d0 100644 --- a/registry-library/README.md +++ b/registry-library/README.md @@ -59,7 +59,18 @@ Supported devfile media types can be found in the latest version of [library.go] return err } ``` -2. Download a stack with all supported media types from the devfile registry + +2. Download a stack devfile with a given version and media type from the devfile registry + ```go + stack := "java-springboot:1.0.0" // java-springboot is stack name, 1.0.0 is stack version + destDir := "." + err := registryLibrary.PullStackByMediaTypesFromRegistry(registryURL, stack, registryLibrary.DevfileMediaTypeList, destDir, options) + if err != nil { + return err + } + ``` + +3. Download a stack with all supported media types from the devfile registry ```go err := registryLibrary.PullStackFromRegistry(registryURL, stack, destDir, options) if err != nil { @@ -91,6 +102,23 @@ Supported devfile media types can be found in the latest version of [library.go] Locale: "en_US" // set the OS or browser locale Client: "client-name" //the name of the client } -} - + } + ``` +4. Get v2index with versions information from the Devfile Registry + ```go + options := registryLibrary.RegistryOptions{ + NewIndexSchema: true + } + ``` +5. Filter Devfiles based the min and max devfile schema version provided + ```go + options := registryLibrary.RegistryOptions{ + NewIndexSchema: true, + Filter: registryLibrary.RegistryFilter{ + // devfile schema version range is [2.1, 2.2], inclusive + MinSchemaVersion: "2.1", + MaxSchemaVersion: "2.2" + }, + } + ```