Skip to content

Commit

Permalink
chore: Update commands descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
wtrocki committed Aug 11, 2021
1 parent 0cc9487 commit 1e7e30f
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 32 deletions.
39 changes: 28 additions & 11 deletions pkg/cmd/registry/artifact/artifacts.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,36 @@ func NewArtifactsCommand(f *factory.Factory) *cobra.Command {
cmd := &cobra.Command{
Use: "artifacts",
Short: "Manage Service Registry Artifacts commands",
Long: `Apicurio Registry Artifacts enables developers to manage and share the structure of their data.
For example, client applications can dynamically push or pull the latest updates to or from the registry without needing to redeploy.
Apicurio Registry also enables developers to create rules that govern how registry content can evolve over time.
For example, this includes rules for content validation and version compatibility.
Registry commands enable client applications to manage the artifacts in the registry.
This set of commands provide create, read, update, and delete operations for schema and API artifacts, rules, versions, and metadata.`,
Long: `
Apicurio Registry Artifacts enables developers to manage and share the structure of their data.
For example, client applications can dynamically push or pull the latest updates to or from the registry without needing to redeploy.
Apicurio Registry also enables developers to create rules that govern how registry content can evolve over time.
For example, this includes rules for content validation and version compatibility.
Registry commands enable client applications to manage the artifacts in the registry.
This set of commands provide create, read, update, and delete operations for schema and API artifacts, rules, versions, and metadata.
`,
Example: `
## Create artifact in my-group from schema.json file
rhoas service-registry artifacts create my-group schema.json
## Create artifact in my-group from schema.json file
rhoas service-registry artifact create --artifact=my-artifact --group=my-group artifact.json
## Get artifact content
rhoas service-registry artifact get --artifact=my-artifact --group=my-group file.json
## Delete artifact
rhoas service-registry artifact delete --artifact=my-artifact
## Get artifact metadata
rhoas service-registry artifact metadata --artifact=my-artifact --group=my-group
## Update artifact
rhoas service-registry artifact update --artifact=my-artifact artifact-new.json
## List Artifacts
rhoas service-registry artifact list --group=my-group --limit=10 page=1
## List Artifacts
rhoas service-registry artifacts list my-group
## View artifact versions
rhoas service-registry artifact versions --artifact=my-artifact --group=my-group
`,
Args: cobra.MinimumNArgs(1),
}
Expand Down
7 changes: 2 additions & 5 deletions pkg/cmd/registry/artifact/crud/create/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,11 @@ func NewCreateCommand(f *factory.Factory) *cobra.Command {
Short: "Creates new artifact from file or standard input",
Long: longDescription,
Example: `
## Create artifact in my-group from schema.json file
rhoas service-registry artifacts create my-group schema.json
# Create an artifact in default group
rhoas service-registry artifacts create my-artifact.json
rhoas service-registry artifact create my-artifact.json
# Create an artifact with specified type
rhoas service-registry artifacts create --type=JSON my-artifact.json
rhoas service-registry artifact create --type=JSON my-artifact.json
`,
Args: cobra.RangeArgs(0, 1),
RunE: func(cmd *cobra.Command, args []string) error {
Expand Down
8 changes: 4 additions & 4 deletions pkg/cmd/registry/artifact/crud/get/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,16 @@ For fetching artifacts using global identifiers please use "service-registry dow
`,
Example: `
## Get latest artifact by name
rhoas service-registry artifacts get myschema
rhoas service-registry artifact get myschema
## Get latest artifact and save its content to file
rhoas service-registry artifacts get myschema myschema.json
rhoas service-registry artifact get myschema myschema.json
## Get latest artifact and pipe it to other command
rhoas service-registry artifacts get myschema | grep -i 'user'
rhoas service-registry artifact get myschema | grep -i 'user'
## Get latest artifact by specifying custom group, registry and name as flag
rhoas service-registry artifacts get --group mygroup --instance-id=myregistry --artifact myartifact
rhoas service-registry artifact get --group mygroup --instance-id=myregistry --artifact myartifact
`,
Args: cobra.RangeArgs(0, 2),
RunE: func(cmd *cobra.Command, args []string) error {
Expand Down
6 changes: 3 additions & 3 deletions pkg/cmd/registry/artifact/crud/list/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,13 @@ func NewListCommand(f *factory.Factory) *cobra.Command {
Long: "List all artifacts for the group by specified output format (by default table)",
Example: `
## List all artifacts for the default artifacts group
rhoas service-registry artifacts list
rhoas service-registry artifact list
## List all artifacts with explicit group
rhoas service-registry artifacts list --group=my=group
rhoas service-registry artifact list --group=my-group
## List all artifacts with limit and group
rhoas service-registry artifacts list --page=2 --limit=10
rhoas service-registry artifact list --page=2 --limit=10
`,
Args: cobra.RangeArgs(0, 1),
RunE: func(cmd *cobra.Command, args []string) error {
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/registry/artifact/crud/update/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ This content is updated under a unique artifactId provided by user.
`,
Example: `
## update artifact from group and artifact-id
rhoas service-registry artifacts update my-artifact.json --artifact=my-artifact --group my-group
rhoas service-registry artifact update my-artifact.json --artifact=my-artifact --group my-group
`,
Args: cobra.RangeArgs(0, 2),
RunE: func(cmd *cobra.Command, args []string) error {
Expand Down
8 changes: 4 additions & 4 deletions pkg/cmd/registry/artifact/download/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,16 @@ func NewDownloadCommand(f *factory.Factory) *cobra.Command {
--hash - SHA-256 hash of the content`,
Example: `
## Get latest artifact by content id
rhoas service-registry artifacts download --content-id=183282932983
rhoas service-registry artifact download --content-id=183282932983
## Get latest artifact by content id to specific file
rhoas service-registry artifacts download --content-id=183282932983 schema.json
rhoas service-registry artifact download --content-id=183282932983 schema.json
## Get latest artifact by global id
rhoas service-registry artifacts download --global-id=383282932983
rhoas service-registry artifact download --global-id=383282932983
## Get latest artifact by hash
rhoas service-registry artifacts download --hash=c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4
rhoas service-registry artifact download --hash=c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4
`,
Args: cobra.RangeArgs(0, 1),
RunE: func(cmd *cobra.Command, args []string) error {
Expand Down
4 changes: 2 additions & 2 deletions pkg/cmd/registry/artifact/metadata/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ The returned metadata includes both generated (read-only) and editable metadata
`,
Example: `
## Get latest artifact metadata for default group
rhoas service-registry artifacts metadata my-artifact
rhoas service-registry artifact metadata my-artifact
## Get latest artifact metadata for my-group group
rhoas service-registry artifacts metadata my-artifact --group mygroup
rhoas service-registry artifact metadata my-artifact --group mygroup
`,
Args: cobra.RangeArgs(0, 1),
RunE: func(cmd *cobra.Command, args []string) error {
Expand Down
4 changes: 2 additions & 2 deletions pkg/cmd/registry/artifact/versions/versions.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ func NewVersionsCommand(f *factory.Factory) *cobra.Command {
Long: "Get latest artifact versions by specifying group and artifacts id",
Example: `
## Get latest artifact versions for default group
rhoas service-registry artifacts versions my-artifact
rhoas service-registry artifact versions my-artifact
## Get latest artifact versions for my-group group
rhoas service-registry artifacts versions my-artifact --group mygroup
rhoas service-registry artifact versions my-artifact --group mygroup
`,
Args: cobra.RangeArgs(0, 1),
RunE: func(cmd *cobra.Command, args []string) error {
Expand Down

0 comments on commit 1e7e30f

Please sign in to comment.