Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 214
Associate generated commands with command groups#475
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| package account | ||
| import "github.com/spf13/cobra" | ||
| // Groups returns an ordered list of command groups. | ||
| // The order matches the order used in the Databricks API explorer. | ||
| func Groups() []cobra.Group { | ||
| return []cobra.Group{ | ||
| { | ||
| ID: "iam", | ||
| Title: "Identity and Access Management", | ||
| }, | ||
| { | ||
| ID: "catalog", | ||
| Title: "Unity Catalog", | ||
| }, | ||
| { | ||
| ID: "settings", | ||
| Title: "Settings", | ||
| }, | ||
| { | ||
| ID: "provisioning", | ||
| Title: "Provisioning", | ||
| }, | ||
| { | ||
| ID: "billing", | ||
| Title: "Billing", | ||
| }, | ||
| { | ||
| ID: "oauth2", | ||
| Title: "OAuth", | ||
| }, | ||
| } | ||
| } | ||
| func init() { | ||
| // Register groups with parent command | ||
| groups := Groups() | ||
| for i := range groups { | ||
| accountCmd.AddGroup(&groups[i]) | ||
| } | ||
| } | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| package workspace | ||
| import ( | ||
| "github.com/databricks/cli/cmd/root" | ||
| "github.com/spf13/cobra" | ||
| ) | ||
| // Groups returns an ordered list of command groups. | ||
| // The order matches the order used in the Databricks API explorer. | ||
| func Groups() []cobra.Group { | ||
| return []cobra.Group{ | ||
| { | ||
| ID: "workspace", | ||
| Title: "Databricks Workspace", | ||
| }, | ||
| { | ||
| ID: "compute", | ||
| Title: "Compute", | ||
| }, | ||
| { | ||
| ID: "jobs", | ||
| Title: "Jobs", | ||
| }, | ||
| { | ||
| ID: "pipelines", | ||
| Title: "Delta Live Tables", | ||
| }, | ||
| { | ||
| ID: "ml", | ||
| Title: "Machine Learning", | ||
| }, | ||
| { | ||
| ID: "serving", | ||
| Title: "Real-time Serving", | ||
| }, | ||
| { | ||
| ID: "iam", | ||
| Title: "Identity and Access Management", | ||
| }, | ||
| { | ||
| ID: "sql", | ||
| Title: "Databricks SQL", | ||
| }, | ||
| { | ||
| ID: "catalog", | ||
| Title: "Unity Catalog", | ||
| }, | ||
| { | ||
| ID: "sharing", | ||
| Title: "Delta Sharing", | ||
| }, | ||
| { | ||
| ID: "settings", | ||
| Title: "Settings", | ||
| }, | ||
| } | ||
| } | ||
| func init() { | ||
| // Register groups with parent command | ||
| groups := Groups() | ||
| for i := range groups { | ||
| root.RootCmd.AddGroup(&groups[i]) | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you propagate it from
x-databricks-groupsfrom spec? otherwise, it'll get out of sync. Please also pull in descriptions from there:you'll have to add it to codegen and expose from there https://github.com/databricks/databricks-sdk-go/blob/main/openapi/model.go#L41-L46
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussed in person. This list of packages is incomplete so we need to hardcode it here. Once it is complete and we expose it in the OpenAPI code in the SDK then we can autogenerate these as well.