forked from redhat-developer/odo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
odo registry -o json (redhat-developer#5739)
* Doc odo registry * JSON output * Move structure for JSON output to api package * Doc for json output * Add integration tests * Review * Do not rely on devfile version for tests as it is too unstable
- Loading branch information
Showing
30 changed files
with
1,170 additions
and
944 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
107 changes: 107 additions & 0 deletions
107
docs/website/versioned_docs/version-3.0.0/command-reference/registry.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
--- | ||
title: odo registry | ||
sidebar_position: 1 | ||
--- | ||
|
||
The `odo registry` command lists all the Devfile stacks from Devfile registries. | ||
|
||
The Devfile registries that are taken into account are the registries added with the command | ||
`odo preference registry`. | ||
|
||
## Available Flags | ||
|
||
By default, `odo registry` lists all the Devfile stacks from all the Devfile registries. | ||
|
||
These flags let you filter the listed Devfile stacks: | ||
|
||
* `--devfile <name>` to list the Devfile stacks with this exact name | ||
* `--devfile-registry <name>` to list the Devfile stack of this registry (this is the `name` used | ||
when adding the registry to the preferences with `odo preference registry add <name> <url>`) | ||
* `--filter <term>` to list the Devfile for which the term is found in the devfile name or description | ||
|
||
By default, the name, registry and description | ||
of the Devfile stacks are displayed on a table. | ||
|
||
This flag lets you change the content of the output: | ||
|
||
* `--details` to display details about the Devfile stacks | ||
* `-o json` to output the information in a JSON format | ||
|
||
## Examples | ||
|
||
For these examples, we consider we have two registries in our preferences: | ||
|
||
``` | ||
shell | ||
$ odo preference registry list | ||
NAME URL SECURE | ||
Staging https://registry.stage.devfile.io No | ||
DefaultDevfileRegistry https://registry.devfile.io No | ||
``` | ||
|
||
To get the complete list of accessible Devfile stacks: | ||
|
||
```shell | ||
$ odo registry | ||
NAME REGISTRY DESCRIPTION | ||
dotnet50 Staging Stack with .NET 5.0 | ||
dotnet50 DefaultDevfileRegistry Stack with .NET 5.0 | ||
dotnet60 Staging Stack with .NET 6.0 | ||
dotnet60 DefaultDevfileRegistry Stack with .NET 6.0 | ||
dotnetcore31 Staging Stack with .NET Core 3.1 | ||
dotnetcore31 DefaultDevfileRegistry Stack with .NET Core 3.1 | ||
go Staging Stack with the latest Go version | ||
go DefaultDevfileRegistry Stack with the latest Go version | ||
java-maven Staging Upstream Maven and OpenJDK 11 | ||
java-maven DefaultDevfileRegistry Upstream Maven and OpenJDK 11 | ||
[...] | ||
``` | ||
|
||
To list the Devfile stacks from the Staging registry only: | ||
|
||
```shell | ||
$ odo registry --devfile-registry Staging | ||
NAME REGISTRY DESCRIPTION | ||
dotnet50 Staging Stack with .NET 5.0 | ||
dotnet60 Staging Stack with .NET 6.0 | ||
dotnetcore31 Staging Stack with .NET Core 3.1 | ||
go Staging Stack with the latest Go version | ||
java-maven Staging Upstream Maven and OpenJDK 11 | ||
[...] | ||
``` | ||
|
||
To list the Devfile stacks related to Maven: | ||
|
||
```shell | ||
$ odo registry --filter Maven | ||
NAME REGISTRY DESCRIPTION | ||
java-maven Staging Upstream Maven and OpenJDK 11 | ||
java-maven DefaultDevfileRegistry Upstream Maven and OpenJDK 11 | ||
java-openliberty Staging Java application Maven-built stack using... | ||
java-openliberty DefaultDevfileRegistry Java application Maven-built stack using... | ||
java-websphereliberty Staging Java application Maven-built stack using... | ||
java-websphereliberty DefaultDevfileRegistry Java application Maven-built stack using... | ||
java-wildfly-bootable-jar Staging Java stack with WildFly in bootable Jar ... | ||
java-wildfly-bootable-jar DefaultDevfileRegistry Java stack with WildFly in bootable Jar ... | ||
``` | ||
|
||
To get the details of the `java-maven` Devfile in the Staging registry: | ||
|
||
```shell | ||
$ odo registry --devfile java-maven --devfile-registry Staging --details | ||
Name: java-maven | ||
Display Name: Maven Java | ||
Registry: Staging | ||
Registry URL: https://registry.stage.devfile.io | ||
Version: 1.1.0 | ||
Description: Upstream Maven and OpenJDK 11 | ||
Tags: Java, Maven | ||
Project Type: maven | ||
Language: java | ||
Starter Projects: | ||
- springbootproject | ||
Supported odo Features: | ||
- Dev: Y | ||
- Deploy: N | ||
- Debug: Y | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package api | ||
|
||
// Registry is the main struct of devfile registry | ||
type Registry struct { | ||
Name string `json:"name"` | ||
URL string `json:"url"` | ||
Secure bool `json:"secure"` | ||
// Priority of the registry for listing purposes. The higher the number, the higher the priority | ||
Priority int `json:"-"` | ||
} | ||
|
||
// DevfileStack is the main struct for devfile stack | ||
type DevfileStack struct { | ||
Name string `json:"name"` | ||
DisplayName string `json:"displayName"` | ||
Description string `json:"description"` | ||
Registry Registry `json:"registry"` | ||
Language string `json:"language"` | ||
Tags []string `json:"tags"` | ||
ProjectType string `json:"projectType"` | ||
Version string `json:"version"` | ||
StarterProjects []string `json:"starterProjects"` | ||
DevfileData *DevfileData `json:"devfileData,omitempty"` | ||
} |
Oops, something went wrong.