From fd1c9c60277f32ceff497e63380b279e7658bb9b Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Tue, 13 Jun 2023 11:37:04 +0200 Subject: [PATCH 1/3] Annotate generated commands with OpenAPI package name --- .codegen/service.go.tmpl | 4 +- cmd/account/access-control/access-control.go | 14 +- cmd/account/billable-usage/billable-usage.go | 4 +- cmd/account/budgets/budgets.go | 30 ++-- cmd/account/credentials/credentials.go | 24 ++-- .../custom-app-integration.go | 24 +++- .../encryption-keys/encryption-keys.go | 20 ++- cmd/account/groups/groups.go | 32 +++-- .../ip-access-lists/ip-access-lists.go | 36 +++-- cmd/account/log-delivery/log-delivery.go | 18 ++- .../metastore-assignments.go | 20 ++- cmd/account/metastores/metastores.go | 22 ++- cmd/account/networks/networks.go | 22 ++- .../o-auth-enrollment/o-auth-enrollment.go | 10 +- cmd/account/private-access/private-access.go | 26 ++-- .../published-app-integration.go | 22 ++- .../service-principal-secrets.go | 12 +- .../service-principals/service-principals.go | 32 +++-- cmd/account/settings/settings.go | 4 +- .../storage-credentials.go | 20 ++- cmd/account/storage/storage.go | 24 ++-- cmd/account/users/users.go | 32 +++-- cmd/account/vpc-endpoints/vpc-endpoints.go | 22 ++- .../workspace-assignment.go | 18 ++- cmd/account/workspaces/workspaces.go | 28 ++-- cmd/workspace/alerts/alerts.go | 30 ++-- cmd/workspace/catalogs/catalogs.go | 22 ++- .../cluster-policies/cluster-policies.go | 24 +++- cmd/workspace/clusters/clusters.go | 88 ++++++++---- cmd/workspace/connections/connections.go | 30 ++-- cmd/workspace/current-user/current-user.go | 6 +- cmd/workspace/dashboards/dashboards.go | 26 ++-- cmd/workspace/data-sources/data-sources.go | 6 +- cmd/workspace/experiments/experiments.go | 96 +++++++++---- .../external-locations/external-locations.go | 22 ++- cmd/workspace/functions/functions.go | 28 ++-- .../git-credentials/git-credentials.go | 28 ++-- .../global-init-scripts.go | 26 ++-- cmd/workspace/grants/grants.go | 12 +- cmd/workspace/groups/groups.go | 32 +++-- .../instance-pools/instance-pools.go | 26 ++-- .../instance-profiles/instance-profiles.go | 18 ++- .../ip-access-lists/ip-access-lists.go | 36 +++-- cmd/workspace/jobs/jobs.go | 88 ++++++++---- cmd/workspace/libraries/libraries.go | 22 ++- cmd/workspace/metastores/metastores.go | 58 +++++--- .../model-registry/model-registry.go | 130 +++++++++++++----- cmd/workspace/permissions/permissions.go | 16 ++- cmd/workspace/pipelines/pipelines.go | 60 +++++--- .../policy-families/policy-families.go | 8 +- cmd/workspace/providers/providers.go | 32 +++-- cmd/workspace/queries/queries.go | 32 +++-- cmd/workspace/query-history/query-history.go | 4 +- .../recipient-activation.go | 8 +- cmd/workspace/recipients/recipients.go | 36 +++-- cmd/workspace/repos/repos.go | 26 ++-- cmd/workspace/schemas/schemas.go | 26 ++-- cmd/workspace/secrets/secrets.go | 38 +++-- .../service-principals/service-principals.go | 32 +++-- .../serving-endpoints/serving-endpoints.go | 42 ++++-- cmd/workspace/shares/shares.go | 30 ++-- .../storage-credentials.go | 32 +++-- .../system-schemas/system-schemas.go | 14 +- .../table-constraints/table-constraints.go | 10 +- cmd/workspace/tables/tables.go | 22 ++- .../token-management/token-management.go | 20 ++- cmd/workspace/tokens/tokens.go | 16 ++- cmd/workspace/users/users.go | 32 +++-- cmd/workspace/volumes/volumes.go | 26 ++-- cmd/workspace/warehouses/warehouses.go | 48 +++++-- .../workspace-bindings/workspace-bindings.go | 8 +- .../workspace-conf/workspace-conf.go | 8 +- cmd/workspace/workspace/workspace.go | 30 ++-- 73 files changed, 1424 insertions(+), 606 deletions(-) diff --git a/.codegen/service.go.tmpl b/.codegen/service.go.tmpl index 16c7dc97693..81c3a68ea04 100644 --- a/.codegen/service.go.tmpl +++ b/.codegen/service.go.tmpl @@ -80,7 +80,9 @@ var {{.CamelName}}Cmd = &cobra.Command{ Short: `{{.Summary | without "`"}}`, Long: `{{.Comment " " 80 | without "`"}}`, {{end}} - Annotations: map[string]string{},{{if $hasRequiredArgs }} + Annotations: map[string]string{ + "package": {{ .Service.Package.Name | printf "%q" }}, + }, {{ if $hasRequiredArgs }} Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs({{len .Request.RequiredFields}}) if cmd.Flags().Changed("json") { diff --git a/cmd/account/access-control/access-control.go b/cmd/account/access-control/access-control.go index ce695a9bb2f..1c125b0da99 100755 --- a/cmd/account/access-control/access-control.go +++ b/cmd/account/access-control/access-control.go @@ -41,7 +41,9 @@ var getCmd = &cobra.Command{ contains a list of access rules on the said resource. Currently only a default rule set for each resource is supported.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "iam", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -92,7 +94,9 @@ var listCmd = &cobra.Command{ grantable if the rule set on the resource can contain an access rule of the role.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "iam", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -142,8 +146,10 @@ var updateCmd = &cobra.Command{ the rule set before modifying it. This pattern helps prevent conflicts between concurrent updates.`, - Annotations: map[string]string{}, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{ + "package": "iam", + }, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) diff --git a/cmd/account/billable-usage/billable-usage.go b/cmd/account/billable-usage/billable-usage.go index 3dc4eef4c86..ef6551dc01c 100755 --- a/cmd/account/billable-usage/billable-usage.go +++ b/cmd/account/billable-usage/billable-usage.go @@ -41,7 +41,9 @@ var downloadCmd = &cobra.Command{ [CSV file schema]: https://docs.databricks.com/administration-guide/account-settings/usage-analysis.html#schema`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "billing", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { diff --git a/cmd/account/budgets/budgets.go b/cmd/account/budgets/budgets.go index ff39aacfd72..ec0b5ab6c99 100755 --- a/cmd/account/budgets/budgets.go +++ b/cmd/account/budgets/budgets.go @@ -38,8 +38,10 @@ var createCmd = &cobra.Command{ Creates a new budget in the specified account.`, - Annotations: map[string]string{}, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{ + "package": "billing", + }, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -82,8 +84,10 @@ var deleteCmd = &cobra.Command{ Deletes the budget specified by its UUID.`, - Annotations: map[string]string{}, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{ + "package": "billing", + }, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -141,8 +145,10 @@ var getCmd = &cobra.Command{ Gets the budget specified by its UUID, including noncumulative status for each day that the budget is configured to include.`, - Annotations: map[string]string{}, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{ + "package": "billing", + }, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -195,8 +201,10 @@ var listCmd = &cobra.Command{ Gets all budgets associated with this account, including noncumulative status for each day that the budget is configured to include.`, - Annotations: map[string]string{}, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{ + "package": "billing", + }, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -228,8 +236,10 @@ var updateCmd = &cobra.Command{ Modifies a budget in this account. Budget properties are completely overwritten.`, - Annotations: map[string]string{}, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{ + "package": "billing", + }, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) diff --git a/cmd/account/credentials/credentials.go b/cmd/account/credentials/credentials.go index 0b2abb80dff..7a6a4e9eb22 100755 --- a/cmd/account/credentials/credentials.go +++ b/cmd/account/credentials/credentials.go @@ -54,8 +54,10 @@ var createCmd = &cobra.Command{ [Create a new workspace using the Account API]: http://docs.databricks.com/administration-guide/account-api/new-workspace.html`, - Annotations: map[string]string{}, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{ + "package": "provisioning", + }, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -101,8 +103,10 @@ var deleteCmd = &cobra.Command{ specified by ID. You cannot delete a credential that is associated with any workspace.`, - Annotations: map[string]string{}, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{ + "package": "provisioning", + }, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -160,8 +164,10 @@ var getCmd = &cobra.Command{ Gets a Databricks credential configuration object for an account, both specified by ID.`, - Annotations: map[string]string{}, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{ + "package": "provisioning", + }, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -214,8 +220,10 @@ var listCmd = &cobra.Command{ Gets all Databricks credential configurations associated with an account specified by ID.`, - Annotations: map[string]string{}, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{ + "package": "provisioning", + }, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) diff --git a/cmd/account/custom-app-integration/custom-app-integration.go b/cmd/account/custom-app-integration/custom-app-integration.go index 953a7c124ab..ca74d0da0ea 100755 --- a/cmd/account/custom-app-integration/custom-app-integration.go +++ b/cmd/account/custom-app-integration/custom-app-integration.go @@ -49,8 +49,10 @@ var createCmd = &cobra.Command{ You can retrieve the custom oauth app integration via :method:CustomAppIntegration/get.`, - Annotations: map[string]string{}, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{ + "package": "oauth2", + }, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -95,7 +97,9 @@ var deleteCmd = &cobra.Command{ Delete an existing Custom OAuth App Integration. You can retrieve the custom oauth app integration via :method:CustomAppIntegration/get.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "oauth2", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -143,7 +147,9 @@ var getCmd = &cobra.Command{ Gets the Custom OAuth App Integration for the given integration id.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "oauth2", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -187,8 +193,10 @@ var listCmd = &cobra.Command{ Get the list of custom oauth app integrations for the specified Databricks account`, - Annotations: map[string]string{}, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{ + "package": "oauth2", + }, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -223,7 +231,9 @@ var updateCmd = &cobra.Command{ Updates an existing custom OAuth App Integration. You can retrieve the custom oauth app integration via :method:CustomAppIntegration/get.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "oauth2", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { diff --git a/cmd/account/encryption-keys/encryption-keys.go b/cmd/account/encryption-keys/encryption-keys.go index 4cd9c71f8c2..d8217e6c5d5 100755 --- a/cmd/account/encryption-keys/encryption-keys.go +++ b/cmd/account/encryption-keys/encryption-keys.go @@ -71,8 +71,10 @@ var createCmd = &cobra.Command{ platform or on a select custom plan that allows multiple workspaces per account.`, - Annotations: map[string]string{}, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{ + "package": "provisioning", + }, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -116,7 +118,9 @@ var deleteCmd = &cobra.Command{ Deletes a customer-managed key configuration object for an account. You cannot delete a configuration that is associated with a running workspace.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "provisioning", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -178,7 +182,9 @@ var getCmd = &cobra.Command{ This operation is available only if your account is on the E2 version of the platform.",`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "provisioning", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -233,8 +239,10 @@ var listCmd = &cobra.Command{ This operation is available only if your account is on the E2 version of the platform.`, - Annotations: map[string]string{}, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{ + "package": "provisioning", + }, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) diff --git a/cmd/account/groups/groups.go b/cmd/account/groups/groups.go index 6b5db4140cf..399e08d888f 100755 --- a/cmd/account/groups/groups.go +++ b/cmd/account/groups/groups.go @@ -52,7 +52,9 @@ var createCmd = &cobra.Command{ Creates a group in the Databricks account with a unique name, using the supplied group details.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "iam", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -99,8 +101,10 @@ var deleteCmd = &cobra.Command{ Deletes a group from the Databricks account.`, - Annotations: map[string]string{}, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{ + "package": "iam", + }, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -157,8 +161,10 @@ var getCmd = &cobra.Command{ Gets the information for a specific group in the Databricks account.`, - Annotations: map[string]string{}, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{ + "package": "iam", + }, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -223,7 +229,9 @@ var listCmd = &cobra.Command{ Gets all details of the groups associated with the Databricks account.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "iam", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -272,8 +280,10 @@ var patchCmd = &cobra.Command{ Partially updates the details of a group.`, - Annotations: map[string]string{}, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{ + "package": "iam", + }, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -338,8 +348,10 @@ var updateCmd = &cobra.Command{ Updates the details of a group by replacing the entire group entity.`, - Annotations: map[string]string{}, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{ + "package": "iam", + }, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) diff --git a/cmd/account/ip-access-lists/ip-access-lists.go b/cmd/account/ip-access-lists/ip-access-lists.go index 1719dce81ff..34dd4380f9e 100755 --- a/cmd/account/ip-access-lists/ip-access-lists.go +++ b/cmd/account/ip-access-lists/ip-access-lists.go @@ -71,8 +71,10 @@ var createCmd = &cobra.Command{ It can take a few minutes for the changes to take effect.`, - Annotations: map[string]string{}, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{ + "package": "settings", + }, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -120,8 +122,10 @@ var deleteCmd = &cobra.Command{ Deletes an IP access list, specified by its list ID.`, - Annotations: map[string]string{}, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{ + "package": "settings", + }, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -178,8 +182,10 @@ var getCmd = &cobra.Command{ Gets an IP access list, specified by its list ID.`, - Annotations: map[string]string{}, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{ + "package": "settings", + }, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -231,8 +237,10 @@ var listCmd = &cobra.Command{ Gets all IP access lists for the specified account.`, - Annotations: map[string]string{}, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{ + "package": "settings", + }, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -274,8 +282,10 @@ var replaceCmd = &cobra.Command{ calling user's current IP, error 400 is returned with error_code value INVALID_STATE. It can take a few minutes for the changes to take effect.`, - Annotations: map[string]string{}, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{ + "package": "settings", + }, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -343,8 +353,10 @@ var updateCmd = &cobra.Command{ It can take a few minutes for the changes to take effect.`, - Annotations: map[string]string{}, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{ + "package": "settings", + }, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) diff --git a/cmd/account/log-delivery/log-delivery.go b/cmd/account/log-delivery/log-delivery.go index f42b9d54ca8..7193595a0c4 100755 --- a/cmd/account/log-delivery/log-delivery.go +++ b/cmd/account/log-delivery/log-delivery.go @@ -123,7 +123,9 @@ var createCmd = &cobra.Command{ [Configure audit logging]: https://docs.databricks.com/administration-guide/account-settings/audit-logs.html [Deliver and access billable usage logs]: https://docs.databricks.com/administration-guide/account-settings/billable-usage-delivery.html`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "billing", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -171,8 +173,10 @@ var getCmd = &cobra.Command{ Gets a Databricks log delivery configuration object for an account, both specified by ID.`, - Annotations: map[string]string{}, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{ + "package": "billing", + }, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -234,7 +238,9 @@ var listCmd = &cobra.Command{ Gets all Databricks log delivery configurations associated with an account specified by ID.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "billing", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -285,7 +291,9 @@ var patchStatusCmd = &cobra.Command{ if this would violate the delivery configuration limits described under [Create log delivery](#operation/create-log-delivery-config).`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "billing", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { diff --git a/cmd/account/metastore-assignments/metastore-assignments.go b/cmd/account/metastore-assignments/metastore-assignments.go index 22b4091dbf0..c923159cccf 100755 --- a/cmd/account/metastore-assignments/metastore-assignments.go +++ b/cmd/account/metastore-assignments/metastore-assignments.go @@ -40,7 +40,9 @@ var createCmd = &cobra.Command{ Creates an assignment to a metastore for a workspace Please add a header X-Databricks-Account-Console-API-Version: 2.0 to access this API.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "catalog", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -94,7 +96,9 @@ var deleteCmd = &cobra.Command{ metastore. Please add a header X-Databricks-Account-Console-API-Version: 2.0 to access this API.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "catalog", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -150,7 +154,9 @@ var getCmd = &cobra.Command{ 404 returned. Please add a header X-Databricks-Account-Console-API-Version: 2.0 to access this API.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "catalog", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -203,7 +209,9 @@ var listCmd = &cobra.Command{ metastore. Please add a header X-Databricks-Account-Console-API-Version: 2.0 to access this API`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "catalog", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -255,7 +263,9 @@ var updateCmd = &cobra.Command{ default catalog may be updated. Please add a header X-Databricks-Account-Console-API-Version: 2.0 to access this API.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "catalog", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { diff --git a/cmd/account/metastores/metastores.go b/cmd/account/metastores/metastores.go index a828d605a0d..523b6b2c50b 100755 --- a/cmd/account/metastores/metastores.go +++ b/cmd/account/metastores/metastores.go @@ -39,7 +39,9 @@ var createCmd = &cobra.Command{ Creates a Unity Catalog metastore. Please add a header X-Databricks-Account-Console-API-Version: 2.0 to access this API.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "catalog", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -87,7 +89,9 @@ var deleteCmd = &cobra.Command{ Deletes a Unity Catalog metastore for an account, both specified by ID. Please add a header X-Databricks-Account-Console-API-Version: 2.0 to access this API.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "catalog", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -136,7 +140,9 @@ var getCmd = &cobra.Command{ Gets a Unity Catalog metastore from an account, both specified by ID. Please add a header X-Databricks-Account-Console-API-Version: 2.0 to access this API.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "catalog", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -181,8 +187,10 @@ var listCmd = &cobra.Command{ Please add a header X-Databricks-Account-Console-API-Version: 2.0 to access this API.`, - Annotations: map[string]string{}, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{ + "package": "catalog", + }, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -216,7 +224,9 @@ var updateCmd = &cobra.Command{ Updates an existing Unity Catalog metastore. Please add a header X-Databricks-Account-Console-API-Version: 2.0 to access this API.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "catalog", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { diff --git a/cmd/account/networks/networks.go b/cmd/account/networks/networks.go index 4b0bf0637dc..549895fe734 100755 --- a/cmd/account/networks/networks.go +++ b/cmd/account/networks/networks.go @@ -46,7 +46,9 @@ var createCmd = &cobra.Command{ resources. The VPC will be used for new Databricks clusters. This requires a pre-existing VPC and subnets.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "provisioning", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -99,8 +101,10 @@ var deleteCmd = &cobra.Command{ This operation is available only if your account is on the E2 version of the platform.`, - Annotations: map[string]string{}, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{ + "package": "provisioning", + }, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -158,8 +162,10 @@ var getCmd = &cobra.Command{ Gets a Databricks network configuration, which represents a cloud VPC and its resources.`, - Annotations: map[string]string{}, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{ + "package": "provisioning", + }, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -215,8 +221,10 @@ var listCmd = &cobra.Command{ This operation is available only if your account is on the E2 version of the platform.`, - Annotations: map[string]string{}, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{ + "package": "provisioning", + }, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) diff --git a/cmd/account/o-auth-enrollment/o-auth-enrollment.go b/cmd/account/o-auth-enrollment/o-auth-enrollment.go index b790e2d7a1b..83d3200eaf1 100755 --- a/cmd/account/o-auth-enrollment/o-auth-enrollment.go +++ b/cmd/account/o-auth-enrollment/o-auth-enrollment.go @@ -49,7 +49,9 @@ var createCmd = &cobra.Command{ immediately. The actual enrollment take a few minutes, you can check the status via API :method:OAuthEnrollment/get.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "oauth2", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -94,8 +96,10 @@ var getCmd = &cobra.Command{ You can only add/use the OAuth published/custom application integrations when OAuth enrollment status is enabled.`, - Annotations: map[string]string{}, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{ + "package": "oauth2", + }, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) diff --git a/cmd/account/private-access/private-access.go b/cmd/account/private-access/private-access.go index bc91e1b51b8..3fa42fc943f 100755 --- a/cmd/account/private-access/private-access.go +++ b/cmd/account/private-access/private-access.go @@ -55,7 +55,9 @@ var createCmd = &cobra.Command{ [AWS PrivateLink]: https://aws.amazon.com/privatelink [Databricks article about PrivateLink]: https://docs.databricks.com/administration-guide/cloud-configurations/aws/privatelink.html`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "provisioning", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -111,8 +113,10 @@ var deleteCmd = &cobra.Command{ [AWS PrivateLink]: https://aws.amazon.com/privatelink [Databricks article about PrivateLink]: https://docs.databricks.com/administration-guide/cloud-configurations/aws/privatelink.html`, - Annotations: map[string]string{}, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{ + "package": "provisioning", + }, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -176,8 +180,10 @@ var getCmd = &cobra.Command{ [AWS PrivateLink]: https://aws.amazon.com/privatelink [Databricks article about PrivateLink]: https://docs.databricks.com/administration-guide/cloud-configurations/aws/privatelink.html`, - Annotations: map[string]string{}, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{ + "package": "provisioning", + }, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -230,8 +236,10 @@ var listCmd = &cobra.Command{ Gets a list of all private access settings objects for an account, specified by ID.`, - Annotations: map[string]string{}, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{ + "package": "provisioning", + }, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -286,7 +294,9 @@ var replaceCmd = &cobra.Command{ [AWS PrivateLink]: https://aws.amazon.com/privatelink [Databricks article about PrivateLink]: https://docs.databricks.com/administration-guide/cloud-configurations/aws/privatelink.html`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "provisioning", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(3) if cmd.Flags().Changed("json") { diff --git a/cmd/account/published-app-integration/published-app-integration.go b/cmd/account/published-app-integration/published-app-integration.go index cc5448005cd..291e79b4991 100755 --- a/cmd/account/published-app-integration/published-app-integration.go +++ b/cmd/account/published-app-integration/published-app-integration.go @@ -47,7 +47,9 @@ var createCmd = &cobra.Command{ You can retrieve the published oauth app integration via :method:PublishedAppIntegration/get.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "oauth2", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -95,7 +97,9 @@ var deleteCmd = &cobra.Command{ Delete an existing Published OAuth App Integration. You can retrieve the published oauth app integration via :method:PublishedAppIntegration/get.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "oauth2", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -143,7 +147,9 @@ var getCmd = &cobra.Command{ Gets the Published OAuth App Integration for the given integration id.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "oauth2", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -187,8 +193,10 @@ var listCmd = &cobra.Command{ Get the list of published oauth app integrations for the specified Databricks account`, - Annotations: map[string]string{}, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{ + "package": "oauth2", + }, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -222,7 +230,9 @@ var updateCmd = &cobra.Command{ Updates an existing published OAuth App Integration. You can retrieve the published oauth app integration via :method:PublishedAppIntegration/get.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "oauth2", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { diff --git a/cmd/account/service-principal-secrets/service-principal-secrets.go b/cmd/account/service-principal-secrets/service-principal-secrets.go index ef69afe0945..09661352c2a 100755 --- a/cmd/account/service-principal-secrets/service-principal-secrets.go +++ b/cmd/account/service-principal-secrets/service-principal-secrets.go @@ -49,7 +49,9 @@ var createCmd = &cobra.Command{ Create a secret for the given service principal.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "oauth2", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -100,7 +102,9 @@ var deleteCmd = &cobra.Command{ Delete a secret from the given service principal.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "oauth2", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -154,7 +158,9 @@ var listCmd = &cobra.Command{ only returns information about the secrets themselves and does not include the secret values.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "oauth2", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { diff --git a/cmd/account/service-principals/service-principals.go b/cmd/account/service-principals/service-principals.go index 7be4bc5a229..ca0cf12033f 100755 --- a/cmd/account/service-principals/service-principals.go +++ b/cmd/account/service-principals/service-principals.go @@ -51,7 +51,9 @@ var createCmd = &cobra.Command{ Creates a new service principal in the Databricks account.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "iam", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -98,8 +100,10 @@ var deleteCmd = &cobra.Command{ Delete a single service principal in the Databricks account.`, - Annotations: map[string]string{}, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{ + "package": "iam", + }, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -157,8 +161,10 @@ var getCmd = &cobra.Command{ Gets the details for a single service principal define in the Databricks account.`, - Annotations: map[string]string{}, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{ + "package": "iam", + }, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -223,7 +229,9 @@ var listCmd = &cobra.Command{ Gets the set of service principals associated with a Databricks account.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "iam", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -273,8 +281,10 @@ var patchCmd = &cobra.Command{ Partially updates the details of a single service principal in the Databricks account.`, - Annotations: map[string]string{}, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{ + "package": "iam", + }, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -342,8 +352,10 @@ var updateCmd = &cobra.Command{ This action replaces the existing service principal with the same name.`, - Annotations: map[string]string{}, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{ + "package": "iam", + }, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) diff --git a/cmd/account/settings/settings.go b/cmd/account/settings/settings.go index 2c689be7348..ef4a8c111bf 100755 --- a/cmd/account/settings/settings.go +++ b/cmd/account/settings/settings.go @@ -37,7 +37,9 @@ var readPersonalComputeSettingCmd = &cobra.Command{ TBD`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "settings", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { diff --git a/cmd/account/storage-credentials/storage-credentials.go b/cmd/account/storage-credentials/storage-credentials.go index 72e18750037..00e6a7be737 100755 --- a/cmd/account/storage-credentials/storage-credentials.go +++ b/cmd/account/storage-credentials/storage-credentials.go @@ -43,7 +43,9 @@ var createCmd = &cobra.Command{ The caller must be a metastore admin and have the **CREATE_STORAGE_CREDENTIAL** privilege on the metastore.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "catalog", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -92,7 +94,9 @@ var deleteCmd = &cobra.Command{ Deletes a storage credential from the metastore. The caller must be an owner of the storage credential.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "catalog", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -143,7 +147,9 @@ var getCmd = &cobra.Command{ admin, the owner of the storage credential, or have a level of privilege on the storage credential.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "catalog", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -193,7 +199,9 @@ var listCmd = &cobra.Command{ Gets a list of all storage credentials that have been assigned to given metastore.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "catalog", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -245,7 +253,9 @@ var updateCmd = &cobra.Command{ the storage credential. If the caller is a metastore admin, only the __owner__ credential can be changed.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "catalog", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { diff --git a/cmd/account/storage/storage.go b/cmd/account/storage/storage.go index feedab5e23f..82f771f80ac 100755 --- a/cmd/account/storage/storage.go +++ b/cmd/account/storage/storage.go @@ -51,8 +51,10 @@ var createCmd = &cobra.Command{ [Create a new workspace using the Account API]: http://docs.databricks.com/administration-guide/account-api/new-workspace.html`, - Annotations: map[string]string{}, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{ + "package": "provisioning", + }, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -97,8 +99,10 @@ var deleteCmd = &cobra.Command{ Deletes a Databricks storage configuration. You cannot delete a storage configuration that is associated with any workspace.`, - Annotations: map[string]string{}, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{ + "package": "provisioning", + }, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -155,8 +159,10 @@ var getCmd = &cobra.Command{ Gets a Databricks storage configuration for an account, both specified by ID.`, - Annotations: map[string]string{}, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{ + "package": "provisioning", + }, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -209,8 +215,10 @@ var listCmd = &cobra.Command{ Gets a list of all Databricks storage configurations for your account, specified by ID.`, - Annotations: map[string]string{}, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{ + "package": "provisioning", + }, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) diff --git a/cmd/account/users/users.go b/cmd/account/users/users.go index 8d976b9a6ad..c623958234f 100755 --- a/cmd/account/users/users.go +++ b/cmd/account/users/users.go @@ -59,7 +59,9 @@ var createCmd = &cobra.Command{ Creates a new user in the Databricks account. This new user will also be added to the Databricks account.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "iam", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -107,8 +109,10 @@ var deleteCmd = &cobra.Command{ Deletes a user. Deleting a user from a Databricks account also removes objects associated with the user.`, - Annotations: map[string]string{}, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{ + "package": "iam", + }, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -165,8 +169,10 @@ var getCmd = &cobra.Command{ Gets information for a specific user in Databricks account.`, - Annotations: map[string]string{}, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{ + "package": "iam", + }, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -231,7 +237,9 @@ var listCmd = &cobra.Command{ Gets details for all the users associated with a Databricks account.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "iam", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -281,8 +289,10 @@ var patchCmd = &cobra.Command{ Partially updates a user resource by applying the supplied operations on specific user attributes.`, - Annotations: map[string]string{}, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{ + "package": "iam", + }, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -350,8 +360,10 @@ var updateCmd = &cobra.Command{ Replaces a user's information with the data supplied in request.`, - Annotations: map[string]string{}, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{ + "package": "iam", + }, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) diff --git a/cmd/account/vpc-endpoints/vpc-endpoints.go b/cmd/account/vpc-endpoints/vpc-endpoints.go index 1cb72927b8d..51805118089 100755 --- a/cmd/account/vpc-endpoints/vpc-endpoints.go +++ b/cmd/account/vpc-endpoints/vpc-endpoints.go @@ -53,7 +53,9 @@ var createCmd = &cobra.Command{ [VPC endpoint]: https://docs.aws.amazon.com/vpc/latest/privatelink/vpc-endpoints.html [endpoint service]: https://docs.aws.amazon.com/vpc/latest/privatelink/privatelink-share-your-services.html`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "provisioning", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -109,8 +111,10 @@ var deleteCmd = &cobra.Command{ [AWS VPC endpoint]: https://docs.aws.amazon.com/vpc/latest/privatelink/concepts.html [Databricks article about PrivateLink]: https://docs.databricks.com/administration-guide/cloud-configurations/aws/privatelink.html`, - Annotations: map[string]string{}, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{ + "package": "provisioning", + }, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -171,8 +175,10 @@ var getCmd = &cobra.Command{ [AWS PrivateLink]: https://aws.amazon.com/privatelink [VPC endpoint]: https://docs.aws.amazon.com/vpc/latest/privatelink/concepts.html`, - Annotations: map[string]string{}, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{ + "package": "provisioning", + }, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -229,8 +235,10 @@ var listCmd = &cobra.Command{ [Databricks article about PrivateLink]: https://docs.databricks.com/administration-guide/cloud-configurations/aws/privatelink.html`, - Annotations: map[string]string{}, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{ + "package": "provisioning", + }, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) diff --git a/cmd/account/workspace-assignment/workspace-assignment.go b/cmd/account/workspace-assignment/workspace-assignment.go index f9a25badbc5..24c25294800 100755 --- a/cmd/account/workspace-assignment/workspace-assignment.go +++ b/cmd/account/workspace-assignment/workspace-assignment.go @@ -39,7 +39,9 @@ var deleteCmd = &cobra.Command{ Deletes the workspace permissions assignment in a given account and workspace for the specified principal.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "iam", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -94,7 +96,9 @@ var getCmd = &cobra.Command{ Get an array of workspace permissions for the specified account and workspace.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "iam", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -146,7 +150,9 @@ var listCmd = &cobra.Command{ Get the permission assignments for the specified Databricks account and Databricks workspace.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "iam", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -198,8 +204,10 @@ var updateCmd = &cobra.Command{ Creates or updates the workspace permissions assignment in a given account and workspace for the specified principal.`, - Annotations: map[string]string{}, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{ + "package": "iam", + }, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) diff --git a/cmd/account/workspaces/workspaces.go b/cmd/account/workspaces/workspaces.go index 2e2dd0b9c1f..c7597c2fd54 100755 --- a/cmd/account/workspaces/workspaces.go +++ b/cmd/account/workspaces/workspaces.go @@ -71,7 +71,9 @@ var createCmd = &cobra.Command{ repeated GET requests with the workspace ID and check its status. The workspace becomes available when the status changes to RUNNING.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "provisioning", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -138,8 +140,10 @@ var deleteCmd = &cobra.Command{ platform or on a select custom plan that allows multiple workspaces per account.`, - Annotations: map[string]string{}, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{ + "package": "provisioning", + }, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -212,8 +216,10 @@ var getCmd = &cobra.Command{ [Create a new workspace using the Account API]: http://docs.databricks.com/administration-guide/account-api/new-workspace.html`, - Annotations: map[string]string{}, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{ + "package": "provisioning", + }, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -272,8 +278,10 @@ var listCmd = &cobra.Command{ platform or on a select custom plan that allows multiple workspaces per account.`, - Annotations: map[string]string{}, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{ + "package": "provisioning", + }, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -426,8 +434,10 @@ var updateCmd = &cobra.Command{ [Account Console]: https://docs.databricks.com/administration-guide/account-settings-e2/account-console-e2.html [Create a new workspace using the Account API]: http://docs.databricks.com/administration-guide/account-api/new-workspace.html`, - Annotations: map[string]string{}, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{ + "package": "provisioning", + }, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) diff --git a/cmd/workspace/alerts/alerts.go b/cmd/workspace/alerts/alerts.go index 5cdb0d48341..3db956a2745 100755 --- a/cmd/workspace/alerts/alerts.go +++ b/cmd/workspace/alerts/alerts.go @@ -46,8 +46,10 @@ var createCmd = &cobra.Command{ query, evaluates a condition of its result, and notifies users or notification destinations if the condition was met.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "sql", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -94,8 +96,10 @@ var deleteCmd = &cobra.Command{ restored. **Note:** Unlike queries and dashboards, alerts cannot be moved to the trash.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "sql", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -152,8 +156,10 @@ var getCmd = &cobra.Command{ Gets an alert.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "sql", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -205,8 +211,10 @@ var listCmd = &cobra.Command{ Gets a list of alerts.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "sql", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -239,8 +247,10 @@ var updateCmd = &cobra.Command{ Updates an alert.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "sql", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) diff --git a/cmd/workspace/catalogs/catalogs.go b/cmd/workspace/catalogs/catalogs.go index 4e8aa9d717b..f824977180b 100755 --- a/cmd/workspace/catalogs/catalogs.go +++ b/cmd/workspace/catalogs/catalogs.go @@ -49,7 +49,9 @@ var createCmd = &cobra.Command{ Creates a new catalog instance in the parent metastore if the caller is a metastore admin or has the **CREATE_CATALOG** privilege.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "catalog", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -100,7 +102,9 @@ var deleteCmd = &cobra.Command{ Deletes the catalog that matches the supplied name. The caller must be a metastore admin or the owner of the catalog.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "catalog", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -150,7 +154,9 @@ var getCmd = &cobra.Command{ admin, the owner of the catalog, or a user that has the **USE_CATALOG** privilege set for their account.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "catalog", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -197,8 +203,10 @@ var listCmd = &cobra.Command{ retrieved. There is no guarantee of a specific ordering of the elements in the array.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "catalog", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -237,7 +245,9 @@ var updateCmd = &cobra.Command{ the owner of the catalog, or a metastore admin (when changing the owner field of the catalog).`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "catalog", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { diff --git a/cmd/workspace/cluster-policies/cluster-policies.go b/cmd/workspace/cluster-policies/cluster-policies.go index 5de2067dc72..fe760354f65 100755 --- a/cmd/workspace/cluster-policies/cluster-policies.go +++ b/cmd/workspace/cluster-policies/cluster-policies.go @@ -66,7 +66,9 @@ var createCmd = &cobra.Command{ Creates a new policy with prescribed settings.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "compute", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -115,8 +117,10 @@ var deleteCmd = &cobra.Command{ Delete a policy for a cluster. Clusters governed by this policy can still run, but cannot be edited.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "compute", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -180,7 +184,9 @@ var editCmd = &cobra.Command{ Update an existing policy for cluster. This operation may make some clusters governed by the previous policy invalid.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "compute", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -229,8 +235,10 @@ var getCmd = &cobra.Command{ Get a cluster policy entity. Creation and editing is available to admins only.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "compute", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -290,7 +298,9 @@ var listCmd = &cobra.Command{ Returns a list of policies accessible by the requesting user.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "compute", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { diff --git a/cmd/workspace/clusters/clusters.go b/cmd/workspace/clusters/clusters.go index f33914d7734..e3336d2d38c 100755 --- a/cmd/workspace/clusters/clusters.go +++ b/cmd/workspace/clusters/clusters.go @@ -65,7 +65,9 @@ var changeOwnerCmd = &cobra.Command{ Change the owner of the cluster. You must be an admin to perform this operation.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "compute", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -156,7 +158,9 @@ var createCmd = &cobra.Command{ creation will succeed. Otherwise the cluster will terminate with an informative error message.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "compute", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -224,8 +228,10 @@ var deleteCmd = &cobra.Command{ TERMINATED state. If the cluster is already in a TERMINATING or TERMINATED state, nothing will happen.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "compute", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -338,7 +344,9 @@ var editCmd = &cobra.Command{ Clusters created by the Databricks Jobs service cannot be edited.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "compute", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -408,8 +416,10 @@ var eventsCmd = &cobra.Command{ paginated. If there are more events to read, the response includes all the nparameters necessary to request the next page of events.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "compute", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -472,8 +482,10 @@ var getCmd = &cobra.Command{ Retrieves the information for a cluster given its identifier. Clusters can be described while they are running, or up to 60 days after they are terminated.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "compute", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -540,7 +552,9 @@ var listCmd = &cobra.Command{ clusters, all 45 terminated all-purpose clusters, and the 30 most recently terminated job clusters.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "compute", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -583,8 +597,10 @@ var listNodeTypesCmd = &cobra.Command{ Returns a list of supported Spark node types. These node types can be used to launch a cluster.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "compute", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -611,8 +627,10 @@ var listZonesCmd = &cobra.Command{ Returns a list of availability zones where clusters can be created in (For example, us-west-2a). These zones can be used to launch a cluster.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "compute", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -648,8 +666,10 @@ var permanentDeleteCmd = &cobra.Command{ cluster list, and API users can no longer perform any action on permanently deleted clusters.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "compute", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -708,8 +728,10 @@ var pinCmd = &cobra.Command{ ListClusters API. Pinning a cluster that is already pinned will have no effect. This API can only be called by workspace admins.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "compute", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -775,8 +797,10 @@ var resizeCmd = &cobra.Command{ Resizes a cluster to have a desired number of workers. This will fail unless the cluster is in a RUNNING state.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "compute", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -853,8 +877,10 @@ var restartCmd = &cobra.Command{ Restarts a Spark cluster with the supplied ID. If the cluster is not currently in a RUNNING state, nothing will happen.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "compute", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -919,8 +945,10 @@ var sparkVersionsCmd = &cobra.Command{ Returns the list of available Spark versions. These versions can be used to launch a cluster.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "compute", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -963,8 +991,10 @@ var startCmd = &cobra.Command{ nodes. * If the cluster is not currently in a TERMINATED state, nothing will happen. * Clusters launched to run a job cannot be started.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "compute", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -1035,8 +1065,10 @@ var unpinCmd = &cobra.Command{ ListClusters API. Unpinning a cluster that is not pinned will have no effect. This API can only be called by workspace admins.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "compute", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) diff --git a/cmd/workspace/connections/connections.go b/cmd/workspace/connections/connections.go index 6b0f11a6355..35ba8289d25 100755 --- a/cmd/workspace/connections/connections.go +++ b/cmd/workspace/connections/connections.go @@ -56,8 +56,10 @@ var createCmd = &cobra.Command{ specify connection details and configurations for interaction with the external server.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "catalog", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -105,8 +107,10 @@ var deleteCmd = &cobra.Command{ Deletes the connection that matches the supplied name.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "catalog", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -163,8 +167,10 @@ var getCmd = &cobra.Command{ Gets a connection from it's name.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "catalog", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -216,8 +222,10 @@ var listCmd = &cobra.Command{ List all connections.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "catalog", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -248,8 +256,10 @@ var updateCmd = &cobra.Command{ Updates the connection that matches the supplied name.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "catalog", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) diff --git a/cmd/workspace/current-user/current-user.go b/cmd/workspace/current-user/current-user.go index 8dc2e5801e3..a8ad65d355e 100755 --- a/cmd/workspace/current-user/current-user.go +++ b/cmd/workspace/current-user/current-user.go @@ -29,8 +29,10 @@ var meCmd = &cobra.Command{ Get details about the current method caller's identity.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "iam", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) diff --git a/cmd/workspace/dashboards/dashboards.go b/cmd/workspace/dashboards/dashboards.go index 315d1e74043..a2deb92378f 100755 --- a/cmd/workspace/dashboards/dashboards.go +++ b/cmd/workspace/dashboards/dashboards.go @@ -45,7 +45,9 @@ var createCmd = &cobra.Command{ Short: `Create a dashboard object.`, Long: `Create a dashboard object.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "sql", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -93,8 +95,10 @@ var deleteCmd = &cobra.Command{ Moves a dashboard to the trash. Trashed dashboards do not appear in list views or searches, and cannot be shared.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "sql", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -152,8 +156,10 @@ var getCmd = &cobra.Command{ Returns a JSON representation of a dashboard object, including its visualization and query objects.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "sql", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -215,7 +221,9 @@ var listCmd = &cobra.Command{ Fetch a paginated list of dashboard objects.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "sql", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -262,8 +270,10 @@ var restoreCmd = &cobra.Command{ A restored dashboard appears in list views and searches and can be shared.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "sql", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) diff --git a/cmd/workspace/data-sources/data-sources.go b/cmd/workspace/data-sources/data-sources.go index d9983eee6f1..cb889e3d395 100755 --- a/cmd/workspace/data-sources/data-sources.go +++ b/cmd/workspace/data-sources/data-sources.go @@ -39,8 +39,10 @@ var listCmd = &cobra.Command{ fields that appear in this API response are enumerated for clarity. However, you need only a SQL warehouse's id to create new queries against it.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "sql", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) diff --git a/cmd/workspace/experiments/experiments.go b/cmd/workspace/experiments/experiments.go index 97b05c13378..72a3c2f2d39 100755 --- a/cmd/workspace/experiments/experiments.go +++ b/cmd/workspace/experiments/experiments.go @@ -53,7 +53,9 @@ var createExperimentCmd = &cobra.Command{ Throws RESOURCE_ALREADY_EXISTS if a experiment with the given name exists.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "ml", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -109,7 +111,9 @@ var createRunCmd = &cobra.Command{ mlflowParam, mlflowMetric and mlflowRunTag associated with a single execution.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "ml", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -158,7 +162,9 @@ var deleteExperimentCmd = &cobra.Command{ for deletion. If the experiment uses FileStore, artifacts associated with experiment are also deleted.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "ml", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -206,7 +212,9 @@ var deleteRunCmd = &cobra.Command{ Marks a run for deletion.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "ml", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -255,7 +263,9 @@ var deleteTagCmd = &cobra.Command{ Deletes a tag on a run. Tags are run metadata that can be updated during a run and after a run completes.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "ml", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -312,7 +322,9 @@ var getByNameCmd = &cobra.Command{ Throws RESOURCE_DOES_NOT_EXIST if no experiment with the specified name exists.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "ml", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -360,7 +372,9 @@ var getExperimentCmd = &cobra.Command{ Gets metadata for an experiment. This method works on deleted experiments.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "ml", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -413,7 +427,9 @@ var getHistoryCmd = &cobra.Command{ Gets a list of all values for the specified metric for a given run.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "ml", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -468,7 +484,9 @@ var getRunCmd = &cobra.Command{ If there are multiple values with the latest timestamp, return the maximum of these values.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "ml", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -522,7 +540,9 @@ var listArtifactsCmd = &cobra.Command{ List artifacts for a run. Takes an optional artifact_path prefix. If it is specified, the response contains only artifacts with the specified prefix.",`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "ml", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -573,7 +593,9 @@ var listExperimentsCmd = &cobra.Command{ Gets a list of all experiments.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "ml", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -661,7 +683,9 @@ var logBatchCmd = &cobra.Command{ * Metric keyes, param keys, and tag keys can be up to 250 characters in length * Parameter and tag values can be up to 250 characters in length`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "ml", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -712,7 +736,9 @@ var logInputsCmd = &cobra.Command{ **NOTE:** Experimental: This API may change or be removed in a future release without warning.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "ml", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -765,7 +791,9 @@ var logMetricCmd = &cobra.Command{ value) with an associated timestamp. Examples include the various metrics that represent ML model accuracy. A metric can be logged multiple times.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "ml", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(3) if cmd.Flags().Changed("json") { @@ -825,7 +853,9 @@ var logModelCmd = &cobra.Command{ **NOTE:** Experimental: This API may change or be removed in a future release without warning.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "ml", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -878,7 +908,9 @@ var logParamCmd = &cobra.Command{ constant dates and values used in an ETL pipeline. A param can be logged only once for a run.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "ml", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -932,7 +964,9 @@ var restoreExperimentCmd = &cobra.Command{ Throws RESOURCE_DOES_NOT_EXIST if experiment was never created or was permanently deleted.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "ml", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -980,7 +1014,9 @@ var restoreRunCmd = &cobra.Command{ Restores a deleted run.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "ml", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -1034,7 +1070,9 @@ var searchExperimentsCmd = &cobra.Command{ Searches for experiments that satisfy specified search criteria.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "ml", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -1090,7 +1128,9 @@ var searchRunsCmd = &cobra.Command{ Search expressions can use mlflowMetric and mlflowParam keys.",`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "ml", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -1137,7 +1177,9 @@ var setExperimentTagCmd = &cobra.Command{ Sets a tag on an experiment. Experiment tags are metadata that can be updated.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "ml", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(3) if cmd.Flags().Changed("json") { @@ -1191,7 +1233,9 @@ var setTagCmd = &cobra.Command{ Sets a tag on a run. Tags are run metadata that can be updated during a run and after a run completes.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "ml", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -1242,7 +1286,9 @@ var updateExperimentCmd = &cobra.Command{ Updates experiment metadata.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "ml", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -1295,7 +1341,9 @@ var updateRunCmd = &cobra.Command{ Updates run metadata.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "ml", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { diff --git a/cmd/workspace/external-locations/external-locations.go b/cmd/workspace/external-locations/external-locations.go index 947460af241..c769470c30c 100755 --- a/cmd/workspace/external-locations/external-locations.go +++ b/cmd/workspace/external-locations/external-locations.go @@ -53,7 +53,9 @@ var createCmd = &cobra.Command{ metastore admin or have the **CREATE_EXTERNAL_LOCATION** privilege on both the metastore and the associated storage credential.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "catalog", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(3) if cmd.Flags().Changed("json") { @@ -106,7 +108,9 @@ var deleteCmd = &cobra.Command{ Deletes the specified external location from the metastore. The caller must be the owner of the external location.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "catalog", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -156,7 +160,9 @@ var getCmd = &cobra.Command{ metastore admin, the owner of the external location, or a user that has some privilege on the external location.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "catalog", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -202,8 +208,10 @@ var listCmd = &cobra.Command{ location, or a user that has some privilege on the external location. There is no guarantee of a specific ordering of the elements in the array.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "catalog", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -244,7 +252,9 @@ var updateCmd = &cobra.Command{ the external location, or be a metastore admin. In the second case, the admin can only update the name of the external location.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "catalog", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { diff --git a/cmd/workspace/functions/functions.go b/cmd/workspace/functions/functions.go index 34800f3068c..bf935990b52 100755 --- a/cmd/workspace/functions/functions.go +++ b/cmd/workspace/functions/functions.go @@ -52,8 +52,10 @@ var createCmd = &cobra.Command{ created: - **USE_CATALOG** on the function's parent catalog - **USE_SCHEMA** and **CREATE_FUNCTION** on the function's parent schema`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "catalog", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -145,8 +147,10 @@ var deleteCmd = &cobra.Command{ owner of the function itself and have both the **USE_CATALOG** privilege on its parent catalog and the **USE_SCHEMA** privilege on its parent schema`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "catalog", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -209,8 +213,10 @@ var getCmd = &cobra.Command{ catalog, the **USE_SCHEMA** privilege on the function's parent schema, and the **EXECUTE** privilege on the function itself`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "catalog", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -273,7 +279,9 @@ var listCmd = &cobra.Command{ is the owner. There is no guarantee of a specific ordering of the elements in the array.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "catalog", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -331,8 +339,10 @@ var updateCmd = &cobra.Command{ privilege on its parent catalog as well as the **USE_SCHEMA** privilege on the function's parent schema.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "catalog", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) diff --git a/cmd/workspace/git-credentials/git-credentials.go b/cmd/workspace/git-credentials/git-credentials.go index 7ac5b020caf..bf4a3965989 100755 --- a/cmd/workspace/git-credentials/git-credentials.go +++ b/cmd/workspace/git-credentials/git-credentials.go @@ -48,7 +48,9 @@ var createCmd = &cobra.Command{ will fail. Use the PATCH endpoint to update existing credentials, or the DELETE endpoint to delete existing credentials.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "workspace", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -96,8 +98,10 @@ var deleteCmd = &cobra.Command{ Deletes the specified Git credential.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "workspace", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -157,8 +161,10 @@ var getCmd = &cobra.Command{ Gets the Git credential with the specified credential ID.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "workspace", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -214,8 +220,10 @@ var listCmd = &cobra.Command{ Lists the calling user's Git credentials. One credential per user is supported.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "workspace", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -250,8 +258,10 @@ var updateCmd = &cobra.Command{ Updates the specified Git credential.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "workspace", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) diff --git a/cmd/workspace/global-init-scripts/global-init-scripts.go b/cmd/workspace/global-init-scripts/global-init-scripts.go index 3a2c3b64933..17d3b0d461c 100755 --- a/cmd/workspace/global-init-scripts/global-init-scripts.go +++ b/cmd/workspace/global-init-scripts/global-init-scripts.go @@ -48,7 +48,9 @@ var createCmd = &cobra.Command{ Creates a new global init script in this workspace.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "compute", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -97,8 +99,10 @@ var deleteCmd = &cobra.Command{ Deletes a global init script.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "compute", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -155,8 +159,10 @@ var getCmd = &cobra.Command{ Gets all the details of a script, including its Base64-encoded contents.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "compute", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -211,8 +217,10 @@ var listCmd = &cobra.Command{ contents of a script, use the [get a global init script](#operation/get-script) operation.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "compute", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -247,7 +255,9 @@ var updateCmd = &cobra.Command{ Updates a global init script, specifying only the fields to change. All fields are optional. Unspecified fields retain their current value.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "compute", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(3) if cmd.Flags().Changed("json") { diff --git a/cmd/workspace/grants/grants.go b/cmd/workspace/grants/grants.go index c6fa81a771e..84aee577d1a 100755 --- a/cmd/workspace/grants/grants.go +++ b/cmd/workspace/grants/grants.go @@ -49,7 +49,9 @@ var getCmd = &cobra.Command{ Gets the permissions for a securable.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "catalog", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -103,7 +105,9 @@ var getEffectiveCmd = &cobra.Command{ Gets the effective permissions for a securable.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "catalog", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -157,7 +161,9 @@ var updateCmd = &cobra.Command{ Updates the permissions for a securable.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "catalog", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { diff --git a/cmd/workspace/groups/groups.go b/cmd/workspace/groups/groups.go index aa5a7e355aa..4709dfa72c5 100755 --- a/cmd/workspace/groups/groups.go +++ b/cmd/workspace/groups/groups.go @@ -52,7 +52,9 @@ var createCmd = &cobra.Command{ Creates a group in the Databricks workspace with a unique name, using the supplied group details.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "iam", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -99,8 +101,10 @@ var deleteCmd = &cobra.Command{ Deletes a group from the Databricks workspace.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "iam", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -157,8 +161,10 @@ var getCmd = &cobra.Command{ Gets the information for a specific group in the Databricks workspace.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "iam", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -223,7 +229,9 @@ var listCmd = &cobra.Command{ Gets all details of the groups associated with the Databricks workspace.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "iam", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -272,8 +280,10 @@ var patchCmd = &cobra.Command{ Partially updates the details of a group.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "iam", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -338,8 +348,10 @@ var updateCmd = &cobra.Command{ Updates the details of a group by replacing the entire group entity.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "iam", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) diff --git a/cmd/workspace/instance-pools/instance-pools.go b/cmd/workspace/instance-pools/instance-pools.go index c80feb59e76..b2795afcfa6 100755 --- a/cmd/workspace/instance-pools/instance-pools.go +++ b/cmd/workspace/instance-pools/instance-pools.go @@ -66,7 +66,9 @@ var createCmd = &cobra.Command{ Creates a new instance pool using idle and ready-to-use cloud instances.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "compute", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -116,8 +118,10 @@ var deleteCmd = &cobra.Command{ Deletes the instance pool permanently. The idle instances in the pool are terminated asynchronously.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "compute", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -186,7 +190,9 @@ var editCmd = &cobra.Command{ Modifies the configuration of an existing instance pool.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "compute", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(3) if cmd.Flags().Changed("json") { @@ -236,8 +242,10 @@ var getCmd = &cobra.Command{ Retrieve the information for an instance pool based on its identifier.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "compute", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -289,8 +297,10 @@ var listCmd = &cobra.Command{ Gets a list of instance pools with their statistics.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "compute", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) diff --git a/cmd/workspace/instance-profiles/instance-profiles.go b/cmd/workspace/instance-profiles/instance-profiles.go index c68b8f3d83f..55a7fe44125 100755 --- a/cmd/workspace/instance-profiles/instance-profiles.go +++ b/cmd/workspace/instance-profiles/instance-profiles.go @@ -45,7 +45,9 @@ var addCmd = &cobra.Command{ In the UI, you can select the instance profile when launching clusters. This API is only available to admin users.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "compute", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -110,7 +112,9 @@ var editCmd = &cobra.Command{ [Databricks SQL Serverless]: https://docs.databricks.com/sql/admin/serverless.html [Enable serverless SQL warehouses]: https://docs.databricks.com/sql/admin/serverless.html`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "compute", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -155,8 +159,10 @@ var listCmd = &cobra.Command{ This API is available to all users.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "compute", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -190,7 +196,9 @@ var removeCmd = &cobra.Command{ This API is only accessible to admin users.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "compute", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { diff --git a/cmd/workspace/ip-access-lists/ip-access-lists.go b/cmd/workspace/ip-access-lists/ip-access-lists.go index bbefc063a19..017b9c8e139 100755 --- a/cmd/workspace/ip-access-lists/ip-access-lists.go +++ b/cmd/workspace/ip-access-lists/ip-access-lists.go @@ -72,8 +72,10 @@ var createCmd = &cobra.Command{ IP access list has no effect until you enable the feature. See :method:workspaceconf/setStatus`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "settings", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -121,8 +123,10 @@ var deleteCmd = &cobra.Command{ Deletes an IP access list, specified by its list ID.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "settings", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -179,8 +183,10 @@ var getCmd = &cobra.Command{ Gets an IP access list, specified by its list ID.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "settings", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -232,8 +238,10 @@ var listCmd = &cobra.Command{ Gets all IP access lists for the specified workspace.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "settings", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -277,8 +285,10 @@ var replaceCmd = &cobra.Command{ Note that your resulting IP access list has no effect until you enable the feature. See :method:workspaceconf/setStatus.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "settings", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -348,8 +358,10 @@ var updateCmd = &cobra.Command{ resulting IP access list has no effect until you enable the feature. See :method:workspaceconf/setStatus.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "settings", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) diff --git a/cmd/workspace/jobs/jobs.go b/cmd/workspace/jobs/jobs.go index fd79ee869d6..edddae72f16 100755 --- a/cmd/workspace/jobs/jobs.go +++ b/cmd/workspace/jobs/jobs.go @@ -56,8 +56,10 @@ var cancelAllRunsCmd = &cobra.Command{ Cancels all active runs of a job. The runs are canceled asynchronously, so it doesn't prevent new runs from being started.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "jobs", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -123,8 +125,10 @@ var cancelRunCmd = &cobra.Command{ Cancels a job run. The run is canceled asynchronously, so it may still be running when this request completes.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "jobs", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -220,7 +224,9 @@ var createCmd = &cobra.Command{ Create a new job.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "jobs", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -267,8 +273,10 @@ var deleteCmd = &cobra.Command{ Deletes a job.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "jobs", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -328,8 +336,10 @@ var deleteRunCmd = &cobra.Command{ Deletes a non-active run. Returns an error if the run is active.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "jobs", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -391,8 +401,10 @@ var exportRunCmd = &cobra.Command{ Export and retrieve the job run task.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "jobs", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -452,8 +464,10 @@ var getCmd = &cobra.Command{ Retrieves the details for a single job.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "jobs", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -520,8 +534,10 @@ var getRunCmd = &cobra.Command{ Retrieve the metadata of a run.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "jobs", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -590,8 +606,10 @@ var getRunOutputCmd = &cobra.Command{ automatically removed after 60 days. If you to want to reference them beyond 60 days, you must save old run results before they expire.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "jobs", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -657,7 +675,9 @@ var listCmd = &cobra.Command{ Retrieves a list of jobs.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "jobs", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -715,7 +735,9 @@ var listRunsCmd = &cobra.Command{ List runs in descending order by start time.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "jobs", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -781,8 +803,10 @@ var repairRunCmd = &cobra.Command{ They use the current job and task settings, and can be viewed in the history for the original job run.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "jobs", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -862,8 +886,10 @@ var resetCmd = &cobra.Command{ Overwrites all the settings for a specific job. Use the Update endpoint to update job settings partially.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "jobs", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -925,8 +951,10 @@ var runNowCmd = &cobra.Command{ Run a job and return the run_id of the triggered run.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "jobs", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -1022,7 +1050,9 @@ var submitCmd = &cobra.Command{ the UI. Use the jobs/runs/get API to check the run state after the job is submitted.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "jobs", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -1092,8 +1122,10 @@ var updateCmd = &cobra.Command{ Add, update, or remove specific settings of an existing job. Use the ResetJob to overwrite all job settings.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "jobs", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) diff --git a/cmd/workspace/libraries/libraries.go b/cmd/workspace/libraries/libraries.go index 368fe37ea78..2ad795367af 100755 --- a/cmd/workspace/libraries/libraries.go +++ b/cmd/workspace/libraries/libraries.go @@ -53,8 +53,10 @@ var allClusterStatusesCmd = &cobra.Command{ for all libraries installed on this cluster via the API or the libraries UI as well as libraries set to be installed on all clusters via the libraries UI.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "compute", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -99,7 +101,9 @@ var clusterStatusCmd = &cobra.Command{ clusters, but now marked for removal. Within this group there is no order guarantee.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "compute", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -152,8 +156,10 @@ var installCmd = &cobra.Command{ union of the libraries specified via this method and the libraries set to be installed on all clusters via the libraries UI.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "compute", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -199,8 +205,10 @@ var uninstallCmd = &cobra.Command{ uninstalled until the cluster is restarted. Uninstalling libraries that are not installed on the cluster will have no impact but is not an error.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "compute", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) diff --git a/cmd/workspace/metastores/metastores.go b/cmd/workspace/metastores/metastores.go index 4df439d4914..1013956b417 100755 --- a/cmd/workspace/metastores/metastores.go +++ b/cmd/workspace/metastores/metastores.go @@ -51,7 +51,9 @@ var assignCmd = &cobra.Command{ __workspace_id__ exists, it will be overwritten by the new __metastore_id__ and __default_catalog_name__. The caller must be an account admin.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "catalog", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(3) if cmd.Flags().Changed("json") { @@ -106,7 +108,9 @@ var createCmd = &cobra.Command{ Creates a new metastore based on a provided name and storage root path.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "catalog", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -150,8 +154,10 @@ var currentCmd = &cobra.Command{ Gets the metastore assignment for the workspace being accessed.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "catalog", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -184,8 +190,10 @@ var deleteCmd = &cobra.Command{ Deletes a metastore. The caller must be a metastore admin.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "catalog", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -243,8 +251,10 @@ var getCmd = &cobra.Command{ Gets a metastore that matches the supplied ID. The caller must be a metastore admin to retrieve this info.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "catalog", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -298,8 +308,10 @@ var listCmd = &cobra.Command{ caller must be an admin to retrieve this info. There is no guarantee of a specific ordering of the elements in the array.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "catalog", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -330,7 +342,9 @@ var maintenanceCmd = &cobra.Command{ Enables or disables auto maintenance on the metastore.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "catalog", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -378,8 +392,10 @@ var summaryCmd = &cobra.Command{ Gets information about a metastore. This summary includes the storage credential, the cloud vendor, the cloud region, and the global metastore ID.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "catalog", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -410,7 +426,9 @@ var unassignCmd = &cobra.Command{ Deletes a metastore assignment. The caller must be an account administrator.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "catalog", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -471,8 +489,10 @@ var updateCmd = &cobra.Command{ Updates information for a specific metastore. The caller must be a metastore admin.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "catalog", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -535,8 +555,10 @@ var updateAssignmentCmd = &cobra.Command{ Workspace is already assigned a metastore. The caller must be an account admin to update __metastore_id__; otherwise, the caller can be a Workspace admin.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "catalog", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) diff --git a/cmd/workspace/model-registry/model-registry.go b/cmd/workspace/model-registry/model-registry.go index 1bfff481a41..2781ed62e5d 100755 --- a/cmd/workspace/model-registry/model-registry.go +++ b/cmd/workspace/model-registry/model-registry.go @@ -40,7 +40,9 @@ var approveTransitionRequestCmd = &cobra.Command{ Approves a model version stage transition request.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "ml", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(4) if cmd.Flags().Changed("json") { @@ -99,7 +101,9 @@ var createCommentCmd = &cobra.Command{ user or programmatically to display relevant information about the model. For example, test results or deployment errors.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "ml", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(3) if cmd.Flags().Changed("json") { @@ -155,7 +159,9 @@ var createModelCmd = &cobra.Command{ Throws RESOURCE_ALREADY_EXISTS if a registered model with the given name exists.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "ml", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -208,7 +214,9 @@ var createModelVersionCmd = &cobra.Command{ Creates a model version.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "ml", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -259,7 +267,9 @@ var createTransitionRequestCmd = &cobra.Command{ Creates a model version stage transition request.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "ml", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(3) if cmd.Flags().Changed("json") { @@ -320,8 +330,10 @@ var createWebhookCmd = &cobra.Command{ Creates a registry webhook.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "ml", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -364,7 +376,9 @@ var deleteCommentCmd = &cobra.Command{ Deletes a comment on a model version.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "ml", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -412,7 +426,9 @@ var deleteModelCmd = &cobra.Command{ Deletes a registered model.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "ml", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -460,7 +476,9 @@ var deleteModelTagCmd = &cobra.Command{ Deletes the tag for a registered model.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "ml", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -509,7 +527,9 @@ var deleteModelVersionCmd = &cobra.Command{ Deletes a model version.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "ml", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -558,7 +578,9 @@ var deleteModelVersionTagCmd = &cobra.Command{ Deletes a model version tag.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "ml", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(3) if cmd.Flags().Changed("json") { @@ -610,7 +632,9 @@ var deleteTransitionRequestCmd = &cobra.Command{ Cancels a model version stage transition request.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "ml", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(4) if cmd.Flags().Changed("json") { @@ -668,7 +692,9 @@ var deleteWebhookCmd = &cobra.Command{ Deletes a registry webhook.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "ml", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -717,7 +743,9 @@ var getLatestVersionsCmd = &cobra.Command{ Gets the latest version of a registered model.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "ml", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -769,7 +797,9 @@ var getModelCmd = &cobra.Command{ [MLflow endpoint]: https://www.mlflow.org/docs/latest/rest-api.html#get-registeredmodel`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "ml", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -817,7 +847,9 @@ var getModelVersionCmd = &cobra.Command{ Get a model version.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "ml", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -866,7 +898,9 @@ var getModelVersionDownloadUriCmd = &cobra.Command{ Gets a URI to download the model version.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "ml", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -919,7 +953,9 @@ var listModelsCmd = &cobra.Command{ Lists all available registered models, up to the limit specified in __max_results__.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "ml", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -966,7 +1002,9 @@ var listTransitionRequestsCmd = &cobra.Command{ Gets a list of all open stage transition requests for the model version.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "ml", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -1021,7 +1059,9 @@ var listWebhooksCmd = &cobra.Command{ Lists all registry webhooks.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "ml", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -1070,7 +1110,9 @@ var rejectTransitionRequestCmd = &cobra.Command{ Rejects a model version stage transition request.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "ml", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(3) if cmd.Flags().Changed("json") { @@ -1125,7 +1167,9 @@ var renameModelCmd = &cobra.Command{ Renames a registered model.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "ml", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -1178,7 +1222,9 @@ var searchModelVersionsCmd = &cobra.Command{ Searches for specific model versions based on the supplied __filter__.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "ml", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -1230,7 +1276,9 @@ var searchModelsCmd = &cobra.Command{ Search for registered models based on the specified __filter__.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "ml", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -1277,7 +1325,9 @@ var setModelTagCmd = &cobra.Command{ Sets a tag on a registered model.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "ml", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(3) if cmd.Flags().Changed("json") { @@ -1327,7 +1377,9 @@ var setModelVersionTagCmd = &cobra.Command{ Sets a model version tag.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "ml", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(4) if cmd.Flags().Changed("json") { @@ -1382,7 +1434,9 @@ var testRegistryWebhookCmd = &cobra.Command{ Tests a registry webhook.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "ml", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -1436,7 +1490,9 @@ var transitionStageCmd = &cobra.Command{ [MLflow endpoint]: https://www.mlflow.org/docs/latest/rest-api.html#transition-modelversion-stage`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "ml", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(4) if cmd.Flags().Changed("json") { @@ -1493,7 +1549,9 @@ var updateCommentCmd = &cobra.Command{ Post an edit to a comment on a model version.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "ml", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -1544,7 +1602,9 @@ var updateModelCmd = &cobra.Command{ Updates a registered model.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "ml", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -1594,7 +1654,9 @@ var updateModelVersionCmd = &cobra.Command{ Updates the model version.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "ml", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -1651,7 +1713,9 @@ var updateWebhookCmd = &cobra.Command{ Updates a registry webhook.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "ml", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { diff --git a/cmd/workspace/permissions/permissions.go b/cmd/workspace/permissions/permissions.go index e130dc3cef8..c870a9ba8a7 100755 --- a/cmd/workspace/permissions/permissions.go +++ b/cmd/workspace/permissions/permissions.go @@ -37,7 +37,9 @@ var getCmd = &cobra.Command{ Gets the permission of an object. Objects can inherit permissions from their parent objects or root objects.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "iam", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -86,7 +88,9 @@ var getPermissionLevelsCmd = &cobra.Command{ Gets the permission levels that a user can have on an object.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "iam", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -138,7 +142,9 @@ var setCmd = &cobra.Command{ Sets permissions on object. Objects can inherit permissions from their parent objects and root objects.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "iam", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -189,7 +195,9 @@ var updateCmd = &cobra.Command{ Updates the permissions on an object.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "iam", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { diff --git a/cmd/workspace/pipelines/pipelines.go b/cmd/workspace/pipelines/pipelines.go index 95d49db8467..1a4c769a0b4 100755 --- a/cmd/workspace/pipelines/pipelines.go +++ b/cmd/workspace/pipelines/pipelines.go @@ -71,7 +71,9 @@ var createCmd = &cobra.Command{ Creates a new data processing pipeline based on the requested configuration. If successful, this method returns the ID of the new pipeline.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "pipelines", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -118,8 +120,10 @@ var deleteCmd = &cobra.Command{ Deletes a pipeline.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "pipelines", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -179,8 +183,10 @@ var getCmd = &cobra.Command{ Short: `Get a pipeline.`, Long: `Get a pipeline.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "pipelines", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -237,7 +243,9 @@ var getUpdateCmd = &cobra.Command{ Gets an update from an active pipeline.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "pipelines", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -291,8 +299,10 @@ var listPipelineEventsCmd = &cobra.Command{ Retrieves events for a pipeline.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "pipelines", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -354,7 +364,9 @@ var listPipelinesCmd = &cobra.Command{ Lists pipelines defined in the Delta Live Tables system.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "pipelines", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -405,8 +417,10 @@ var listUpdatesCmd = &cobra.Command{ List updates for an active pipeline.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "pipelines", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -468,8 +482,10 @@ var resetCmd = &cobra.Command{ Resets a pipeline.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "pipelines", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -543,8 +559,10 @@ var startUpdateCmd = &cobra.Command{ Starts or queues a pipeline update.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "pipelines", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -606,8 +624,10 @@ var stopCmd = &cobra.Command{ Stops a pipeline.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "pipelines", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -696,8 +716,10 @@ var updateCmd = &cobra.Command{ Updates a pipeline with the supplied configuration.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "pipelines", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) diff --git a/cmd/workspace/policy-families/policy-families.go b/cmd/workspace/policy-families/policy-families.go index 284cfc996ec..72fb8c3639d 100755 --- a/cmd/workspace/policy-families/policy-families.go +++ b/cmd/workspace/policy-families/policy-families.go @@ -39,7 +39,9 @@ func init() { var getCmd = &cobra.Command{ Use: "get POLICY_FAMILY_ID", - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "compute", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -86,7 +88,9 @@ func init() { var listCmd = &cobra.Command{ Use: "list", - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "compute", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { diff --git a/cmd/workspace/providers/providers.go b/cmd/workspace/providers/providers.go index 3fd2375285d..45db9bfe893 100755 --- a/cmd/workspace/providers/providers.go +++ b/cmd/workspace/providers/providers.go @@ -41,7 +41,9 @@ var createCmd = &cobra.Command{ Creates a new authentication provider minimally based on a name and authentication type. The caller must be an admin on the metastore.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "sharing", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -94,8 +96,10 @@ var deleteCmd = &cobra.Command{ Deletes an authentication provider, if the caller is a metastore admin or is the owner of the provider.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "sharing", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -154,8 +158,10 @@ var getCmd = &cobra.Command{ the provider, and must either be a metastore admin or the owner of the provider.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "sharing", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -217,7 +223,9 @@ var listCmd = &cobra.Command{ caller are not included in the response. There is no guarantee of a specific ordering of the elements in the array.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "sharing", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -266,8 +274,10 @@ var listSharesCmd = &cobra.Command{ * the caller is a metastore admin, or * the caller is the owner.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "sharing", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -332,8 +342,10 @@ var updateCmd = &cobra.Command{ provider name, the caller must be both a metastore admin and the owner of the provider.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "sharing", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) diff --git a/cmd/workspace/queries/queries.go b/cmd/workspace/queries/queries.go index ea4d2bac0c8..c50ca7c1dd3 100755 --- a/cmd/workspace/queries/queries.go +++ b/cmd/workspace/queries/queries.go @@ -55,7 +55,9 @@ var createCmd = &cobra.Command{ **Note**: You cannot add a visualization until you create the query.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "sql", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -104,8 +106,10 @@ var deleteCmd = &cobra.Command{ searches and list views, and they cannot be used for alerts. The trash is deleted after 30 days.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "sql", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -163,8 +167,10 @@ var getCmd = &cobra.Command{ Retrieve a query object definition along with contextual permissions information about the currently authenticated user.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "sql", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -227,7 +233,9 @@ var listCmd = &cobra.Command{ Gets a list of queries. Optionally, this list can be filtered by a search term.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "sql", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -275,8 +283,10 @@ var restoreCmd = &cobra.Command{ Restore a query that has been moved to the trash. A restored query appears in list views and searches. You can use restored queries for alerts.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "sql", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -341,8 +351,10 @@ var updateCmd = &cobra.Command{ **Note**: You cannot undo this operation.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "sql", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) diff --git a/cmd/workspace/query-history/query-history.go b/cmd/workspace/query-history/query-history.go index 0f1e83dcad5..b43ea2e8309 100755 --- a/cmd/workspace/query-history/query-history.go +++ b/cmd/workspace/query-history/query-history.go @@ -42,7 +42,9 @@ var listCmd = &cobra.Command{ You can filter by user ID, warehouse ID, status, and time range.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "sql", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { diff --git a/cmd/workspace/recipient-activation/recipient-activation.go b/cmd/workspace/recipient-activation/recipient-activation.go index 8897a61194c..cf41b003241 100755 --- a/cmd/workspace/recipient-activation/recipient-activation.go +++ b/cmd/workspace/recipient-activation/recipient-activation.go @@ -35,7 +35,9 @@ var getActivationUrlInfoCmd = &cobra.Command{ Gets an activation URL for a share.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "sharing", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -84,7 +86,9 @@ var retrieveTokenCmd = &cobra.Command{ Retrieve access token with an activation url. This is a public API without any authentication.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "sharing", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { diff --git a/cmd/workspace/recipients/recipients.go b/cmd/workspace/recipients/recipients.go index 0d615aa4d7f..a77c0fc4901 100755 --- a/cmd/workspace/recipients/recipients.go +++ b/cmd/workspace/recipients/recipients.go @@ -46,7 +46,9 @@ var createCmd = &cobra.Command{ metastore. The caller must be a metastore admin or has the **CREATE_RECIPIENT** privilege on the metastore.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "sharing", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -99,8 +101,10 @@ var deleteCmd = &cobra.Command{ Deletes the specified recipient from the metastore. The caller must be the owner of the recipient.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "sharing", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -159,8 +163,10 @@ var getCmd = &cobra.Command{ * the caller is the owner of the share recipient, or: * is a metastore admin`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "sharing", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -222,7 +228,9 @@ var listCmd = &cobra.Command{ * the caller is a metastore admin, or * the caller is the owner. There is no guarantee of a specific ordering of the elements in the array.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "sharing", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -270,7 +278,9 @@ var rotateTokenCmd = &cobra.Command{ Refreshes the specified recipient's delta sharing authentication token with the provided token info. The caller must be the owner of the recipient.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "sharing", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -323,8 +333,10 @@ var sharePermissionsCmd = &cobra.Command{ Gets the share permissions for the specified Recipient. The caller must be a metastore admin or the owner of the Recipient.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "sharing", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -389,8 +401,10 @@ var updateCmd = &cobra.Command{ admin or the owner of the recipient. If the recipient name will be updated, the user must be both a metastore admin and the owner of the recipient.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "sharing", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) diff --git a/cmd/workspace/repos/repos.go b/cmd/workspace/repos/repos.go index 09e497dfc50..fcf215b52fd 100755 --- a/cmd/workspace/repos/repos.go +++ b/cmd/workspace/repos/repos.go @@ -51,7 +51,9 @@ var createCmd = &cobra.Command{ Note that repos created programmatically must be linked to a remote Git repo, unlike repos created in the browser.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "workspace", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -100,8 +102,10 @@ var deleteCmd = &cobra.Command{ Deletes the specified repo.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "workspace", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -161,8 +165,10 @@ var getCmd = &cobra.Command{ Returns the repo with the given repo ID.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "workspace", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -226,7 +232,9 @@ var listCmd = &cobra.Command{ Returns repos that the calling user has Manage permissions on. Results are paginated with each page containing twenty repos.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "workspace", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -278,8 +286,10 @@ var updateCmd = &cobra.Command{ Updates the repo to a different branch or tag, or updates the repo to the latest commit on the same branch.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "workspace", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) diff --git a/cmd/workspace/schemas/schemas.go b/cmd/workspace/schemas/schemas.go index a1216dfa6b9..afbb94821ba 100755 --- a/cmd/workspace/schemas/schemas.go +++ b/cmd/workspace/schemas/schemas.go @@ -47,7 +47,9 @@ var createCmd = &cobra.Command{ metastore admin, or have the **CREATE_SCHEMA** privilege in the parent catalog.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "catalog", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -97,8 +99,10 @@ var deleteCmd = &cobra.Command{ Deletes the specified schema from the parent catalog. The caller must be the owner of the schema or an owner of the parent catalog.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "catalog", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -157,8 +161,10 @@ var getCmd = &cobra.Command{ admin, the owner of the schema, or a user that has the **USE_SCHEMA** privilege on the schema.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "catalog", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -219,7 +225,9 @@ var listCmd = &cobra.Command{ which the caller has the **USE_SCHEMA** privilege) will be retrieved. There is no guarantee of a specific ordering of the elements in the array.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "catalog", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -276,8 +284,10 @@ var updateCmd = &cobra.Command{ caller must be a metastore admin or have the **CREATE_SCHEMA** privilege on the parent catalog.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "catalog", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) diff --git a/cmd/workspace/secrets/secrets.go b/cmd/workspace/secrets/secrets.go index 75a6b123f13..82e5781c533 100755 --- a/cmd/workspace/secrets/secrets.go +++ b/cmd/workspace/secrets/secrets.go @@ -54,7 +54,9 @@ var createScopeCmd = &cobra.Command{ and periods, and may not exceed 128 characters. The maximum number of scopes in a workspace is 100.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "workspace", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -107,7 +109,9 @@ var deleteAclCmd = &cobra.Command{ Throws PERMISSION_DENIED if the user does not have permission to make this API call.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "workspace", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -160,7 +164,9 @@ var deleteScopeCmd = &cobra.Command{ PERMISSION_DENIED if the user does not have permission to make this API call.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "workspace", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -213,7 +219,9 @@ var deleteSecretCmd = &cobra.Command{ Throws PERMISSION_DENIED if the user does not have permission to make this API call.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "workspace", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -267,7 +275,9 @@ var getAclCmd = &cobra.Command{ PERMISSION_DENIED if the user does not have permission to make this API call.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "workspace", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -321,7 +331,9 @@ var listAclsCmd = &cobra.Command{ PERMISSION_DENIED if the user does not have permission to make this API call.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "workspace", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -367,8 +379,10 @@ var listScopesCmd = &cobra.Command{ Throws PERMISSION_DENIED if the user does not have permission to make this API call.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "workspace", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -406,7 +420,9 @@ var listSecretsCmd = &cobra.Command{ PERMISSION_DENIED if the user does not have permission to make this API call.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "workspace", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -479,7 +495,9 @@ var putAclCmd = &cobra.Command{ PERMISSION_DENIED if the user does not have permission to make this API call.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "workspace", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(3) if cmd.Flags().Changed("json") { diff --git a/cmd/workspace/service-principals/service-principals.go b/cmd/workspace/service-principals/service-principals.go index db03aad097b..37c6d5a21ef 100755 --- a/cmd/workspace/service-principals/service-principals.go +++ b/cmd/workspace/service-principals/service-principals.go @@ -51,7 +51,9 @@ var createCmd = &cobra.Command{ Creates a new service principal in the Databricks workspace.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "iam", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -98,8 +100,10 @@ var deleteCmd = &cobra.Command{ Delete a single service principal in the Databricks workspace.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "iam", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -157,8 +161,10 @@ var getCmd = &cobra.Command{ Gets the details for a single service principal define in the Databricks workspace.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "iam", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -223,7 +229,9 @@ var listCmd = &cobra.Command{ Gets the set of service principals associated with a Databricks workspace.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "iam", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -273,8 +281,10 @@ var patchCmd = &cobra.Command{ Partially updates the details of a single service principal in the Databricks workspace.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "iam", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -342,8 +352,10 @@ var updateCmd = &cobra.Command{ This action replaces the existing service principal with the same name.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "iam", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) diff --git a/cmd/workspace/serving-endpoints/serving-endpoints.go b/cmd/workspace/serving-endpoints/serving-endpoints.go index 08c455f9806..bc41c359355 100755 --- a/cmd/workspace/serving-endpoints/serving-endpoints.go +++ b/cmd/workspace/serving-endpoints/serving-endpoints.go @@ -51,7 +51,9 @@ var buildLogsCmd = &cobra.Command{ Retrieves the build logs associated with the provided served model.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "serving", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -103,8 +105,10 @@ var createCmd = &cobra.Command{ Short: `Create a new serving endpoint.`, Long: `Create a new serving endpoint.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "serving", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -159,7 +163,9 @@ var deleteCmd = &cobra.Command{ Short: `Delete a serving endpoint.`, Long: `Delete a serving endpoint.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "serving", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -209,7 +215,9 @@ var exportMetricsCmd = &cobra.Command{ Retrieves the metrics associated with the provided serving endpoint in either Prometheus or OpenMetrics exposition format.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "serving", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -257,7 +265,9 @@ var getCmd = &cobra.Command{ Retrieves the details for a single serving endpoint.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "serving", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -298,8 +308,10 @@ var listCmd = &cobra.Command{ Short: `Retrieve all serving endpoints.`, Long: `Retrieve all serving endpoints.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "serving", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -331,7 +343,9 @@ var logsCmd = &cobra.Command{ Retrieves the service logs associated with the provided served model.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "serving", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -378,7 +392,9 @@ var queryCmd = &cobra.Command{ Short: `Query a serving endpoint with provided model input.`, Long: `Query a serving endpoint with provided model input.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "serving", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -436,8 +452,10 @@ var updateConfigCmd = &cobra.Command{ endpoint that already has an update in progress can not be updated until the current update completes or fails.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "serving", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) diff --git a/cmd/workspace/shares/shares.go b/cmd/workspace/shares/shares.go index 49d12ff25c3..ff9ca157dfb 100755 --- a/cmd/workspace/shares/shares.go +++ b/cmd/workspace/shares/shares.go @@ -39,7 +39,9 @@ var createCmd = &cobra.Command{ with **update**. The caller must be a metastore admin or have the **CREATE_SHARE** privilege on the metastore.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "sharing", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -88,7 +90,9 @@ var deleteCmd = &cobra.Command{ Deletes a data object share from the metastore. The caller must be an owner of the share.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "sharing", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -139,7 +143,9 @@ var getCmd = &cobra.Command{ Gets a data object share from the metastore. The caller must be a metastore admin or the owner of the share.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "sharing", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -184,8 +190,10 @@ var listCmd = &cobra.Command{ metastore admin or the owner of the share. There is no guarantee of a specific ordering of the elements in the array.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "sharing", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -217,7 +225,9 @@ var sharePermissionsCmd = &cobra.Command{ Gets the permissions for a data share from the metastore. The caller must be a metastore admin or the owner of the share.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "sharing", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -283,7 +293,9 @@ var updateCmd = &cobra.Command{ Table removals through **update** do not require additional privileges.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "sharing", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -337,7 +349,9 @@ var updatePermissionsCmd = &cobra.Command{ For new recipient grants, the user must also be the owner of the recipients. recipient revocations do not require additional privileges.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "sharing", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { diff --git a/cmd/workspace/storage-credentials/storage-credentials.go b/cmd/workspace/storage-credentials/storage-credentials.go index 3532999be95..10ec44dfc43 100755 --- a/cmd/workspace/storage-credentials/storage-credentials.go +++ b/cmd/workspace/storage-credentials/storage-credentials.go @@ -64,7 +64,9 @@ var createCmd = &cobra.Command{ The caller must be a metastore admin and have the **CREATE_STORAGE_CREDENTIAL** privilege on the metastore.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "catalog", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -115,8 +117,10 @@ var deleteCmd = &cobra.Command{ Deletes a storage credential from the metastore. The caller must be an owner of the storage credential.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "catalog", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -175,8 +179,10 @@ var getCmd = &cobra.Command{ admin, the owner of the storage credential, or have some permission on the storage credential.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "catalog", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -232,8 +238,10 @@ var listCmd = &cobra.Command{ credentials will be retrieved. There is no guarantee of a specific ordering of the elements in the array.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "catalog", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -277,8 +285,10 @@ var updateCmd = &cobra.Command{ the storage credential or a metastore admin. If the caller is a metastore admin, only the __owner__ credential can be changed.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "catalog", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -355,7 +365,9 @@ var validateCmd = &cobra.Command{ the **CREATE_EXTERNAL_LOCATION** privilege on the metastore and the storage credential.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "catalog", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { diff --git a/cmd/workspace/system-schemas/system-schemas.go b/cmd/workspace/system-schemas/system-schemas.go index 3e6d0719be4..1fd0b751710 100755 --- a/cmd/workspace/system-schemas/system-schemas.go +++ b/cmd/workspace/system-schemas/system-schemas.go @@ -38,7 +38,9 @@ var disableCmd = &cobra.Command{ Disables the system schema and removes it from the system catalog. The caller must be an account admin or a metastore admin.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "catalog", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -83,8 +85,10 @@ var enableCmd = &cobra.Command{ Enables the system schema and adds it to the system catalog. The caller must be an account admin or a metastore admin.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "catalog", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -116,7 +120,9 @@ var listCmd = &cobra.Command{ Gets an array of system schemas for a metastore. The caller must be an account admin or a metastore admin.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "catalog", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { diff --git a/cmd/workspace/table-constraints/table-constraints.go b/cmd/workspace/table-constraints/table-constraints.go index 2ff19ffd21b..a1b706d4256 100755 --- a/cmd/workspace/table-constraints/table-constraints.go +++ b/cmd/workspace/table-constraints/table-constraints.go @@ -58,8 +58,10 @@ var createCmd = &cobra.Command{ referenced parent table's schema, and be the owner of the referenced parent table.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "catalog", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -111,7 +113,9 @@ var deleteCmd = &cobra.Command{ **USE_CATALOG** privilege on the table's catalog, the **USE_SCHEMA** privilege on the table's schema, and be the owner of the table.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "catalog", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(3) if cmd.Flags().Changed("json") { diff --git a/cmd/workspace/tables/tables.go b/cmd/workspace/tables/tables.go index a8bee878e34..e7991afd907 100755 --- a/cmd/workspace/tables/tables.go +++ b/cmd/workspace/tables/tables.go @@ -49,8 +49,10 @@ var deleteCmd = &cobra.Command{ table and have the **USE_CATALOG** privilege on the parent catalog and the **USE_SCHEMA** privilege on the parent schema.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "catalog", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -113,8 +115,10 @@ var getCmd = &cobra.Command{ privilege on the parent schema, or be the owner of the table and have the **SELECT** privilege on it as well.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "catalog", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -180,7 +184,9 @@ var listCmd = &cobra.Command{ the **USE_SCHEMA** privilege on the parent schema. There is no guarantee of a specific ordering of the elements in the array.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "catalog", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -244,8 +250,10 @@ var listSummariesCmd = &cobra.Command{ There is no guarantee of a specific ordering of the elements in the array.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "catalog", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) diff --git a/cmd/workspace/token-management/token-management.go b/cmd/workspace/token-management/token-management.go index 0b56f7b5828..4d2a55cba2e 100755 --- a/cmd/workspace/token-management/token-management.go +++ b/cmd/workspace/token-management/token-management.go @@ -41,7 +41,9 @@ var createOboTokenCmd = &cobra.Command{ Creates a token on behalf of a service principal.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "settings", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -93,8 +95,10 @@ var deleteCmd = &cobra.Command{ Deletes a token, specified by its ID.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "settings", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -151,8 +155,10 @@ var getCmd = &cobra.Command{ Gets information about a token, specified by its ID.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "settings", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -212,7 +218,9 @@ var listCmd = &cobra.Command{ Lists all tokens associated with the specified workspace or user.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "settings", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { diff --git a/cmd/workspace/tokens/tokens.go b/cmd/workspace/tokens/tokens.go index 7ee5f0c80bd..f04184f5b48 100755 --- a/cmd/workspace/tokens/tokens.go +++ b/cmd/workspace/tokens/tokens.go @@ -44,7 +44,9 @@ var createCmd = &cobra.Command{ authenticated token. If the user's token quota is exceeded, this call returns an error **QUOTA_EXCEEDED**.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "settings", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -94,8 +96,10 @@ var deleteCmd = &cobra.Command{ If a token with the specified ID is not valid, this call returns an error **RESOURCE_DOES_NOT_EXIST**.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "settings", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -147,8 +151,10 @@ var listCmd = &cobra.Command{ Lists all the valid tokens for a user-workspace pair.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "settings", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) diff --git a/cmd/workspace/users/users.go b/cmd/workspace/users/users.go index 95301548aa1..a7f36b7796a 100755 --- a/cmd/workspace/users/users.go +++ b/cmd/workspace/users/users.go @@ -59,7 +59,9 @@ var createCmd = &cobra.Command{ Creates a new user in the Databricks workspace. This new user will also be added to the Databricks account.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "iam", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -107,8 +109,10 @@ var deleteCmd = &cobra.Command{ Deletes a user. Deleting a user from a Databricks workspace also removes objects associated with the user.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "iam", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -165,8 +169,10 @@ var getCmd = &cobra.Command{ Gets information for a specific user in Databricks workspace.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "iam", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -231,7 +237,9 @@ var listCmd = &cobra.Command{ Gets details for all the users associated with a Databricks workspace.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "iam", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -281,8 +289,10 @@ var patchCmd = &cobra.Command{ Partially updates a user resource by applying the supplied operations on specific user attributes.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "iam", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -350,8 +360,10 @@ var updateCmd = &cobra.Command{ Replaces a user's information with the data supplied in request.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "iam", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) diff --git a/cmd/workspace/volumes/volumes.go b/cmd/workspace/volumes/volumes.go index a584dcebefd..24e6221e7c8 100755 --- a/cmd/workspace/volumes/volumes.go +++ b/cmd/workspace/volumes/volumes.go @@ -64,7 +64,9 @@ var createCmd = &cobra.Command{ location. - The specified storage location is not under the location of other tables, nor volumes, or catalogs or schemas.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "catalog", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(4) if cmd.Flags().Changed("json") { @@ -122,8 +124,10 @@ var deleteCmd = &cobra.Command{ case, the caller must also be the owner or have the **USE_CATALOG** privilege on the parent catalog and the **USE_SCHEMA** privilege on the parent schema.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "catalog", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -190,7 +194,9 @@ var listCmd = &cobra.Command{ There is no guarantee of a specific ordering of the elements in the array.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "catalog", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -244,8 +250,10 @@ var readCmd = &cobra.Command{ be the owner or have the **USE_CATALOG** privilege on the parent catalog and the **USE_SCHEMA** privilege on the parent schema.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "catalog", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -313,8 +321,10 @@ var updateCmd = &cobra.Command{ Currently only the name, the owner or the comment of the volume could be updated.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "catalog", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) diff --git a/cmd/workspace/warehouses/warehouses.go b/cmd/workspace/warehouses/warehouses.go index 2b2311ec14f..19c32aa351b 100755 --- a/cmd/workspace/warehouses/warehouses.go +++ b/cmd/workspace/warehouses/warehouses.go @@ -59,7 +59,9 @@ var createCmd = &cobra.Command{ Creates a new SQL warehouse.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "sql", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -125,8 +127,10 @@ var deleteCmd = &cobra.Command{ Deletes a SQL warehouse.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "sql", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -202,8 +206,10 @@ var editCmd = &cobra.Command{ Updates the configuration for a SQL warehouse.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "sql", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -284,8 +290,10 @@ var getCmd = &cobra.Command{ Gets the information for a single SQL warehouse.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "sql", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -338,8 +346,10 @@ var getWorkspaceWarehouseConfigCmd = &cobra.Command{ Gets the workspace level configuration that is shared by all SQL warehouses in a workspace.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "sql", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -372,7 +382,9 @@ var listCmd = &cobra.Command{ Lists all SQL warehouses that a user has manager permissions on.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "sql", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -430,7 +442,9 @@ var setWorkspaceWarehouseConfigCmd = &cobra.Command{ Sets the workspace level configuration that is shared by all SQL warehouses in a workspace.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "sql", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -482,8 +496,10 @@ var startCmd = &cobra.Command{ Starts a SQL warehouse.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "sql", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -564,8 +580,10 @@ var stopCmd = &cobra.Command{ Stops a SQL warehouse.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "sql", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) diff --git a/cmd/workspace/workspace-bindings/workspace-bindings.go b/cmd/workspace/workspace-bindings/workspace-bindings.go index 75ecb396d2c..155d2a08d7d 100755 --- a/cmd/workspace/workspace-bindings/workspace-bindings.go +++ b/cmd/workspace/workspace-bindings/workspace-bindings.go @@ -41,7 +41,9 @@ var getCmd = &cobra.Command{ Gets workspace bindings of the catalog. The caller must be a metastore admin or an owner of the catalog.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "catalog", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -93,7 +95,9 @@ var updateCmd = &cobra.Command{ Updates workspace bindings of the catalog. The caller must be a metastore admin or an owner of the catalog.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "catalog", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { diff --git a/cmd/workspace/workspace-conf/workspace-conf.go b/cmd/workspace/workspace-conf/workspace-conf.go index a9a78f63713..df5c0b37ecd 100755 --- a/cmd/workspace/workspace-conf/workspace-conf.go +++ b/cmd/workspace/workspace-conf/workspace-conf.go @@ -35,7 +35,9 @@ var getStatusCmd = &cobra.Command{ Gets the configuration status for a workspace.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "settings", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -84,7 +86,9 @@ var setStatusCmd = &cobra.Command{ Sets the configuration status for a workspace, including enabling or disabling it.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "settings", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { diff --git a/cmd/workspace/workspace/workspace.go b/cmd/workspace/workspace/workspace.go index 14ce4303b80..d5367a471da 100755 --- a/cmd/workspace/workspace/workspace.go +++ b/cmd/workspace/workspace/workspace.go @@ -50,8 +50,10 @@ var deleteCmd = &cobra.Command{ Object deletion cannot be undone and deleting a directory recursively is not atomic.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "workspace", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -118,8 +120,10 @@ var exportCmd = &cobra.Command{ exceed size limit, this call returns MAX_NOTEBOOK_SIZE_EXCEEDED. Currently, this API does not support exporting a library.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "workspace", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -177,7 +181,9 @@ var getStatusCmd = &cobra.Command{ Gets the status of an object or a directory. If path does not exist, this call returns an error RESOURCE_DOES_NOT_EXIST.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "workspace", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -233,7 +239,9 @@ var importCmd = &cobra.Command{ false, this call returns an error RESOURCE_ALREADY_EXISTS. One can only use DBC format to import a directory.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "workspace", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -285,7 +293,9 @@ var listCmd = &cobra.Command{ the input path does not exist, this call returns an error RESOURCE_DOES_NOT_EXIST.`, - Annotations: map[string]string{}, + Annotations: map[string]string{ + "package": "workspace", + }, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -338,8 +348,10 @@ var mkdirsCmd = &cobra.Command{ Note that if this operation fails it may have succeeded in creating some of the necessary parrent directories.`, - Annotations: map[string]string{}, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{ + "package": "workspace", + }, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) From 26e27cf0a198b06e200a4f8ba83982cad12c014e Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Tue, 13 Jun 2023 11:45:33 +0200 Subject: [PATCH 2/3] Annotate top level service command only --- .codegen/service.go.tmpl | 7 +- cmd/account/access-control/access-control.go | 17 +-- cmd/account/billable-usage/billable-usage.go | 7 +- cmd/account/budgets/budgets.go | 33 ++--- cmd/account/credentials/credentials.go | 27 ++-- .../custom-app-integration.go | 27 ++-- .../encryption-keys/encryption-keys.go | 23 ++- cmd/account/groups/groups.go | 35 ++--- .../ip-access-lists/ip-access-lists.go | 39 ++--- cmd/account/log-delivery/log-delivery.go | 21 ++- .../metastore-assignments.go | 23 ++- cmd/account/metastores/metastores.go | 25 ++-- cmd/account/networks/networks.go | 25 ++-- .../o-auth-enrollment/o-auth-enrollment.go | 13 +- cmd/account/private-access/private-access.go | 29 ++-- .../published-app-integration.go | 25 ++-- .../service-principal-secrets.go | 15 +- .../service-principals/service-principals.go | 35 ++--- cmd/account/settings/settings.go | 7 +- .../storage-credentials.go | 23 ++- cmd/account/storage/storage.go | 27 ++-- cmd/account/users/users.go | 35 ++--- cmd/account/vpc-endpoints/vpc-endpoints.go | 25 ++-- .../workspace-assignment.go | 21 ++- cmd/account/workspaces/workspaces.go | 31 ++-- cmd/workspace/alerts/alerts.go | 33 ++--- cmd/workspace/catalogs/catalogs.go | 25 ++-- .../cluster-policies/cluster-policies.go | 27 ++-- cmd/workspace/clusters/clusters.go | 91 ++++-------- cmd/workspace/connections/connections.go | 33 ++--- cmd/workspace/current-user/current-user.go | 9 +- cmd/workspace/dashboards/dashboards.go | 29 ++-- cmd/workspace/data-sources/data-sources.go | 9 +- cmd/workspace/experiments/experiments.go | 99 ++++--------- .../external-locations/external-locations.go | 25 ++-- cmd/workspace/functions/functions.go | 31 ++-- .../git-credentials/git-credentials.go | 31 ++-- .../global-init-scripts.go | 29 ++-- cmd/workspace/grants/grants.go | 15 +- cmd/workspace/groups/groups.go | 35 ++--- .../instance-pools/instance-pools.go | 29 ++-- .../instance-profiles/instance-profiles.go | 21 ++- .../ip-access-lists/ip-access-lists.go | 39 ++--- cmd/workspace/jobs/jobs.go | 91 ++++-------- cmd/workspace/libraries/libraries.go | 25 ++-- cmd/workspace/metastores/metastores.go | 61 +++----- .../model-registry/model-registry.go | 133 +++++------------- cmd/workspace/permissions/permissions.go | 19 +-- cmd/workspace/pipelines/pipelines.go | 63 +++------ .../policy-families/policy-families.go | 11 +- cmd/workspace/providers/providers.go | 35 ++--- cmd/workspace/queries/queries.go | 35 ++--- cmd/workspace/query-history/query-history.go | 7 +- .../recipient-activation.go | 11 +- cmd/workspace/recipients/recipients.go | 39 ++--- cmd/workspace/repos/repos.go | 29 ++-- cmd/workspace/schemas/schemas.go | 29 ++-- cmd/workspace/secrets/secrets.go | 41 ++---- .../service-principals/service-principals.go | 35 ++--- .../serving-endpoints/serving-endpoints.go | 45 ++---- cmd/workspace/shares/shares.go | 33 ++--- .../storage-credentials.go | 35 ++--- .../system-schemas/system-schemas.go | 17 +-- .../table-constraints/table-constraints.go | 13 +- cmd/workspace/tables/tables.go | 25 ++-- .../token-management/token-management.go | 23 ++- cmd/workspace/tokens/tokens.go | 19 ++- cmd/workspace/users/users.go | 35 ++--- cmd/workspace/volumes/volumes.go | 29 ++-- cmd/workspace/warehouses/warehouses.go | 51 +++---- .../workspace-bindings/workspace-bindings.go | 11 +- .../workspace-conf/workspace-conf.go | 11 +- cmd/workspace/workspace/workspace.go | 33 ++--- 73 files changed, 825 insertions(+), 1424 deletions(-) diff --git a/.codegen/service.go.tmpl b/.codegen/service.go.tmpl index 81c3a68ea04..41a3911c650 100644 --- a/.codegen/service.go.tmpl +++ b/.codegen/service.go.tmpl @@ -24,6 +24,9 @@ var Cmd = &cobra.Command{ Short: `{{.Summary | without "`"}}`, Long: `{{.Comment " " 80 | without "`"}}`, {{- end}} + Annotations: map[string]string{ + "package": {{ .Package.Name | printf "%q" }}, + }, } {{- $serviceName := .KebabName -}} @@ -80,9 +83,7 @@ var {{.CamelName}}Cmd = &cobra.Command{ Short: `{{.Summary | without "`"}}`, Long: `{{.Comment " " 80 | without "`"}}`, {{end}} - Annotations: map[string]string{ - "package": {{ .Service.Package.Name | printf "%q" }}, - }, {{ if $hasRequiredArgs }} + Annotations: map[string]string{},{{if $hasRequiredArgs }} Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs({{len .Request.RequiredFields}}) if cmd.Flags().Changed("json") { diff --git a/cmd/account/access-control/access-control.go b/cmd/account/access-control/access-control.go index 1c125b0da99..2ffa97bf743 100755 --- a/cmd/account/access-control/access-control.go +++ b/cmd/account/access-control/access-control.go @@ -18,6 +18,9 @@ var Cmd = &cobra.Command{ Long: `These APIs manage access rules on resources in an account. Currently, only grant rules are supported. A grant rule specifies a role assigned to a set of principals. A list of rules attached to a resource is called a rule set.`, + Annotations: map[string]string{ + "package": "iam", + }, } // start get command @@ -41,9 +44,7 @@ var getCmd = &cobra.Command{ contains a list of access rules on the said resource. Currently only a default rule set for each resource is supported.`, - Annotations: map[string]string{ - "package": "iam", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -94,9 +95,7 @@ var listCmd = &cobra.Command{ grantable if the rule set on the resource can contain an access rule of the role.`, - Annotations: map[string]string{ - "package": "iam", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -146,10 +145,8 @@ var updateCmd = &cobra.Command{ the rule set before modifying it. This pattern helps prevent conflicts between concurrent updates.`, - Annotations: map[string]string{ - "package": "iam", - }, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{}, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) diff --git a/cmd/account/billable-usage/billable-usage.go b/cmd/account/billable-usage/billable-usage.go index ef6551dc01c..01010483a91 100755 --- a/cmd/account/billable-usage/billable-usage.go +++ b/cmd/account/billable-usage/billable-usage.go @@ -14,6 +14,9 @@ var Cmd = &cobra.Command{ Short: `This API allows you to download billable usage logs for the specified account and date range.`, Long: `This API allows you to download billable usage logs for the specified account and date range. This feature works with all account types.`, + Annotations: map[string]string{ + "package": "billing", + }, } // start download command @@ -41,9 +44,7 @@ var downloadCmd = &cobra.Command{ [CSV file schema]: https://docs.databricks.com/administration-guide/account-settings/usage-analysis.html#schema`, - Annotations: map[string]string{ - "package": "billing", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { diff --git a/cmd/account/budgets/budgets.go b/cmd/account/budgets/budgets.go index ec0b5ab6c99..0793228d545 100755 --- a/cmd/account/budgets/budgets.go +++ b/cmd/account/budgets/budgets.go @@ -17,6 +17,9 @@ var Cmd = &cobra.Command{ Short: `These APIs manage budget configuration including notifications for exceeding a budget for a period.`, Long: `These APIs manage budget configuration including notifications for exceeding a budget for a period. They can also retrieve the status of each budget.`, + Annotations: map[string]string{ + "package": "billing", + }, } // start create command @@ -38,10 +41,8 @@ var createCmd = &cobra.Command{ Creates a new budget in the specified account.`, - Annotations: map[string]string{ - "package": "billing", - }, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{}, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -84,10 +85,8 @@ var deleteCmd = &cobra.Command{ Deletes the budget specified by its UUID.`, - Annotations: map[string]string{ - "package": "billing", - }, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{}, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -145,10 +144,8 @@ var getCmd = &cobra.Command{ Gets the budget specified by its UUID, including noncumulative status for each day that the budget is configured to include.`, - Annotations: map[string]string{ - "package": "billing", - }, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{}, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -201,10 +198,8 @@ var listCmd = &cobra.Command{ Gets all budgets associated with this account, including noncumulative status for each day that the budget is configured to include.`, - Annotations: map[string]string{ - "package": "billing", - }, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{}, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -236,10 +231,8 @@ var updateCmd = &cobra.Command{ Modifies a budget in this account. Budget properties are completely overwritten.`, - Annotations: map[string]string{ - "package": "billing", - }, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{}, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) diff --git a/cmd/account/credentials/credentials.go b/cmd/account/credentials/credentials.go index 7a6a4e9eb22..c94b5d34b1c 100755 --- a/cmd/account/credentials/credentials.go +++ b/cmd/account/credentials/credentials.go @@ -20,6 +20,9 @@ var Cmd = &cobra.Command{ Databricks can deploy clusters in the appropriate VPC for the new workspace. A credential configuration encapsulates this role information, and its ID is used when creating a new workspace.`, + Annotations: map[string]string{ + "package": "provisioning", + }, } // start create command @@ -54,10 +57,8 @@ var createCmd = &cobra.Command{ [Create a new workspace using the Account API]: http://docs.databricks.com/administration-guide/account-api/new-workspace.html`, - Annotations: map[string]string{ - "package": "provisioning", - }, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{}, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -103,10 +104,8 @@ var deleteCmd = &cobra.Command{ specified by ID. You cannot delete a credential that is associated with any workspace.`, - Annotations: map[string]string{ - "package": "provisioning", - }, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{}, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -164,10 +163,8 @@ var getCmd = &cobra.Command{ Gets a Databricks credential configuration object for an account, both specified by ID.`, - Annotations: map[string]string{ - "package": "provisioning", - }, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{}, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -220,10 +217,8 @@ var listCmd = &cobra.Command{ Gets all Databricks credential configurations associated with an account specified by ID.`, - Annotations: map[string]string{ - "package": "provisioning", - }, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{}, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) diff --git a/cmd/account/custom-app-integration/custom-app-integration.go b/cmd/account/custom-app-integration/custom-app-integration.go index ca74d0da0ea..377c02a13d3 100755 --- a/cmd/account/custom-app-integration/custom-app-integration.go +++ b/cmd/account/custom-app-integration/custom-app-integration.go @@ -22,6 +22,9 @@ var Cmd = &cobra.Command{ **Note:** You can only add/use the OAuth custom application integrations when OAuth enrollment status is enabled. For more details see :method:OAuthEnrollment/create`, + Annotations: map[string]string{ + "package": "oauth2", + }, } // start create command @@ -49,10 +52,8 @@ var createCmd = &cobra.Command{ You can retrieve the custom oauth app integration via :method:CustomAppIntegration/get.`, - Annotations: map[string]string{ - "package": "oauth2", - }, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{}, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -97,9 +98,7 @@ var deleteCmd = &cobra.Command{ Delete an existing Custom OAuth App Integration. You can retrieve the custom oauth app integration via :method:CustomAppIntegration/get.`, - Annotations: map[string]string{ - "package": "oauth2", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -147,9 +146,7 @@ var getCmd = &cobra.Command{ Gets the Custom OAuth App Integration for the given integration id.`, - Annotations: map[string]string{ - "package": "oauth2", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -193,10 +190,8 @@ var listCmd = &cobra.Command{ Get the list of custom oauth app integrations for the specified Databricks account`, - Annotations: map[string]string{ - "package": "oauth2", - }, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{}, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -231,9 +226,7 @@ var updateCmd = &cobra.Command{ Updates an existing custom OAuth App Integration. You can retrieve the custom oauth app integration via :method:CustomAppIntegration/get.`, - Annotations: map[string]string{ - "package": "oauth2", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { diff --git a/cmd/account/encryption-keys/encryption-keys.go b/cmd/account/encryption-keys/encryption-keys.go index d8217e6c5d5..b63610b96d4 100755 --- a/cmd/account/encryption-keys/encryption-keys.go +++ b/cmd/account/encryption-keys/encryption-keys.go @@ -31,6 +31,9 @@ var Cmd = &cobra.Command{ encryption requires that the workspace is on the E2 version of the platform. If you have an older workspace, it might not be on the E2 version of the platform. If you are not sure, contact your Databricks representative.`, + Annotations: map[string]string{ + "package": "provisioning", + }, } // start create command @@ -71,10 +74,8 @@ var createCmd = &cobra.Command{ platform or on a select custom plan that allows multiple workspaces per account.`, - Annotations: map[string]string{ - "package": "provisioning", - }, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{}, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -118,9 +119,7 @@ var deleteCmd = &cobra.Command{ Deletes a customer-managed key configuration object for an account. You cannot delete a configuration that is associated with a running workspace.`, - Annotations: map[string]string{ - "package": "provisioning", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -182,9 +181,7 @@ var getCmd = &cobra.Command{ This operation is available only if your account is on the E2 version of the platform.",`, - Annotations: map[string]string{ - "package": "provisioning", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -239,10 +236,8 @@ var listCmd = &cobra.Command{ This operation is available only if your account is on the E2 version of the platform.`, - Annotations: map[string]string{ - "package": "provisioning", - }, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{}, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) diff --git a/cmd/account/groups/groups.go b/cmd/account/groups/groups.go index 399e08d888f..78c6aafe2a6 100755 --- a/cmd/account/groups/groups.go +++ b/cmd/account/groups/groups.go @@ -22,6 +22,9 @@ var Cmd = &cobra.Command{ in Unity Catalog to groups, instead of to users individually. All Databricks account identities can be assigned as members of groups, and members inherit permissions that are assigned to their group.`, + Annotations: map[string]string{ + "package": "iam", + }, } // start create command @@ -52,9 +55,7 @@ var createCmd = &cobra.Command{ Creates a group in the Databricks account with a unique name, using the supplied group details.`, - Annotations: map[string]string{ - "package": "iam", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -101,10 +102,8 @@ var deleteCmd = &cobra.Command{ Deletes a group from the Databricks account.`, - Annotations: map[string]string{ - "package": "iam", - }, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{}, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -161,10 +160,8 @@ var getCmd = &cobra.Command{ Gets the information for a specific group in the Databricks account.`, - Annotations: map[string]string{ - "package": "iam", - }, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{}, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -229,9 +226,7 @@ var listCmd = &cobra.Command{ Gets all details of the groups associated with the Databricks account.`, - Annotations: map[string]string{ - "package": "iam", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -280,10 +275,8 @@ var patchCmd = &cobra.Command{ Partially updates the details of a group.`, - Annotations: map[string]string{ - "package": "iam", - }, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{}, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -348,10 +341,8 @@ var updateCmd = &cobra.Command{ Updates the details of a group by replacing the entire group entity.`, - Annotations: map[string]string{ - "package": "iam", - }, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{}, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) diff --git a/cmd/account/ip-access-lists/ip-access-lists.go b/cmd/account/ip-access-lists/ip-access-lists.go index 34dd4380f9e..2cef636e6b5 100755 --- a/cmd/account/ip-access-lists/ip-access-lists.go +++ b/cmd/account/ip-access-lists/ip-access-lists.go @@ -37,6 +37,9 @@ var Cmd = &cobra.Command{ After changes to the account-level IP access lists, it can take a few minutes for changes to take effect.`, + Annotations: map[string]string{ + "package": "settings", + }, } // start create command @@ -71,10 +74,8 @@ var createCmd = &cobra.Command{ It can take a few minutes for the changes to take effect.`, - Annotations: map[string]string{ - "package": "settings", - }, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{}, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -122,10 +123,8 @@ var deleteCmd = &cobra.Command{ Deletes an IP access list, specified by its list ID.`, - Annotations: map[string]string{ - "package": "settings", - }, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{}, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -182,10 +181,8 @@ var getCmd = &cobra.Command{ Gets an IP access list, specified by its list ID.`, - Annotations: map[string]string{ - "package": "settings", - }, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{}, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -237,10 +234,8 @@ var listCmd = &cobra.Command{ Gets all IP access lists for the specified account.`, - Annotations: map[string]string{ - "package": "settings", - }, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{}, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -282,10 +277,8 @@ var replaceCmd = &cobra.Command{ calling user's current IP, error 400 is returned with error_code value INVALID_STATE. It can take a few minutes for the changes to take effect.`, - Annotations: map[string]string{ - "package": "settings", - }, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{}, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -353,10 +346,8 @@ var updateCmd = &cobra.Command{ It can take a few minutes for the changes to take effect.`, - Annotations: map[string]string{ - "package": "settings", - }, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{}, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) diff --git a/cmd/account/log-delivery/log-delivery.go b/cmd/account/log-delivery/log-delivery.go index 7193595a0c4..79d1a4aee81 100755 --- a/cmd/account/log-delivery/log-delivery.go +++ b/cmd/account/log-delivery/log-delivery.go @@ -75,6 +75,9 @@ var Cmd = &cobra.Command{ [Billable usage log delivery]: https://docs.databricks.com/administration-guide/account-settings/billable-usage-delivery.html [Usage page]: https://docs.databricks.com/administration-guide/account-settings/usage.html [create a new AWS S3 bucket]: https://docs.databricks.com/administration-guide/account-api/aws-storage.html`, + Annotations: map[string]string{ + "package": "billing", + }, } // start create command @@ -123,9 +126,7 @@ var createCmd = &cobra.Command{ [Configure audit logging]: https://docs.databricks.com/administration-guide/account-settings/audit-logs.html [Deliver and access billable usage logs]: https://docs.databricks.com/administration-guide/account-settings/billable-usage-delivery.html`, - Annotations: map[string]string{ - "package": "billing", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -173,10 +174,8 @@ var getCmd = &cobra.Command{ Gets a Databricks log delivery configuration object for an account, both specified by ID.`, - Annotations: map[string]string{ - "package": "billing", - }, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{}, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -238,9 +237,7 @@ var listCmd = &cobra.Command{ Gets all Databricks log delivery configurations associated with an account specified by ID.`, - Annotations: map[string]string{ - "package": "billing", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -291,9 +288,7 @@ var patchStatusCmd = &cobra.Command{ if this would violate the delivery configuration limits described under [Create log delivery](#operation/create-log-delivery-config).`, - Annotations: map[string]string{ - "package": "billing", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { diff --git a/cmd/account/metastore-assignments/metastore-assignments.go b/cmd/account/metastore-assignments/metastore-assignments.go index c923159cccf..8e7468019f7 100755 --- a/cmd/account/metastore-assignments/metastore-assignments.go +++ b/cmd/account/metastore-assignments/metastore-assignments.go @@ -16,6 +16,9 @@ var Cmd = &cobra.Command{ Use: "metastore-assignments", Short: `These APIs manage metastore assignments to a workspace.`, Long: `These APIs manage metastore assignments to a workspace.`, + Annotations: map[string]string{ + "package": "catalog", + }, } // start create command @@ -40,9 +43,7 @@ var createCmd = &cobra.Command{ Creates an assignment to a metastore for a workspace Please add a header X-Databricks-Account-Console-API-Version: 2.0 to access this API.`, - Annotations: map[string]string{ - "package": "catalog", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -96,9 +97,7 @@ var deleteCmd = &cobra.Command{ metastore. Please add a header X-Databricks-Account-Console-API-Version: 2.0 to access this API.`, - Annotations: map[string]string{ - "package": "catalog", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -154,9 +153,7 @@ var getCmd = &cobra.Command{ 404 returned. Please add a header X-Databricks-Account-Console-API-Version: 2.0 to access this API.`, - Annotations: map[string]string{ - "package": "catalog", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -209,9 +206,7 @@ var listCmd = &cobra.Command{ metastore. Please add a header X-Databricks-Account-Console-API-Version: 2.0 to access this API`, - Annotations: map[string]string{ - "package": "catalog", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -263,9 +258,7 @@ var updateCmd = &cobra.Command{ default catalog may be updated. Please add a header X-Databricks-Account-Console-API-Version: 2.0 to access this API.`, - Annotations: map[string]string{ - "package": "catalog", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { diff --git a/cmd/account/metastores/metastores.go b/cmd/account/metastores/metastores.go index 523b6b2c50b..1755e98a354 100755 --- a/cmd/account/metastores/metastores.go +++ b/cmd/account/metastores/metastores.go @@ -15,6 +15,9 @@ var Cmd = &cobra.Command{ Short: `These APIs manage Unity Catalog metastores for an account.`, Long: `These APIs manage Unity Catalog metastores for an account. A metastore contains catalogs that can be associated with workspaces`, + Annotations: map[string]string{ + "package": "catalog", + }, } // start create command @@ -39,9 +42,7 @@ var createCmd = &cobra.Command{ Creates a Unity Catalog metastore. Please add a header X-Databricks-Account-Console-API-Version: 2.0 to access this API.`, - Annotations: map[string]string{ - "package": "catalog", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -89,9 +90,7 @@ var deleteCmd = &cobra.Command{ Deletes a Unity Catalog metastore for an account, both specified by ID. Please add a header X-Databricks-Account-Console-API-Version: 2.0 to access this API.`, - Annotations: map[string]string{ - "package": "catalog", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -140,9 +139,7 @@ var getCmd = &cobra.Command{ Gets a Unity Catalog metastore from an account, both specified by ID. Please add a header X-Databricks-Account-Console-API-Version: 2.0 to access this API.`, - Annotations: map[string]string{ - "package": "catalog", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -187,10 +184,8 @@ var listCmd = &cobra.Command{ Please add a header X-Databricks-Account-Console-API-Version: 2.0 to access this API.`, - Annotations: map[string]string{ - "package": "catalog", - }, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{}, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -224,9 +219,7 @@ var updateCmd = &cobra.Command{ Updates an existing Unity Catalog metastore. Please add a header X-Databricks-Account-Console-API-Version: 2.0 to access this API.`, - Annotations: map[string]string{ - "package": "catalog", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { diff --git a/cmd/account/networks/networks.go b/cmd/account/networks/networks.go index 549895fe734..a1030eaabb3 100755 --- a/cmd/account/networks/networks.go +++ b/cmd/account/networks/networks.go @@ -17,6 +17,9 @@ var Cmd = &cobra.Command{ Short: `These APIs manage network configurations for customer-managed VPCs (optional).`, Long: `These APIs manage network configurations for customer-managed VPCs (optional). Its ID is used when creating a new workspace if you use customer-managed VPCs.`, + Annotations: map[string]string{ + "package": "provisioning", + }, } // start create command @@ -46,9 +49,7 @@ var createCmd = &cobra.Command{ resources. The VPC will be used for new Databricks clusters. This requires a pre-existing VPC and subnets.`, - Annotations: map[string]string{ - "package": "provisioning", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -101,10 +102,8 @@ var deleteCmd = &cobra.Command{ This operation is available only if your account is on the E2 version of the platform.`, - Annotations: map[string]string{ - "package": "provisioning", - }, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{}, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -162,10 +161,8 @@ var getCmd = &cobra.Command{ Gets a Databricks network configuration, which represents a cloud VPC and its resources.`, - Annotations: map[string]string{ - "package": "provisioning", - }, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{}, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -221,10 +218,8 @@ var listCmd = &cobra.Command{ This operation is available only if your account is on the E2 version of the platform.`, - Annotations: map[string]string{ - "package": "provisioning", - }, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{}, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) diff --git a/cmd/account/o-auth-enrollment/o-auth-enrollment.go b/cmd/account/o-auth-enrollment/o-auth-enrollment.go index 83d3200eaf1..44a3b7fa394 100755 --- a/cmd/account/o-auth-enrollment/o-auth-enrollment.go +++ b/cmd/account/o-auth-enrollment/o-auth-enrollment.go @@ -18,6 +18,9 @@ var Cmd = &cobra.Command{ **Note:** Your account must be on the E2 version to use these APIs, this is because OAuth is only supported on the E2 version.`, + Annotations: map[string]string{ + "package": "oauth2", + }, } // start create command @@ -49,9 +52,7 @@ var createCmd = &cobra.Command{ immediately. The actual enrollment take a few minutes, you can check the status via API :method:OAuthEnrollment/get.`, - Annotations: map[string]string{ - "package": "oauth2", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -96,10 +97,8 @@ var getCmd = &cobra.Command{ You can only add/use the OAuth published/custom application integrations when OAuth enrollment status is enabled.`, - Annotations: map[string]string{ - "package": "oauth2", - }, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{}, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) diff --git a/cmd/account/private-access/private-access.go b/cmd/account/private-access/private-access.go index 3fa42fc943f..3c45b30e82f 100755 --- a/cmd/account/private-access/private-access.go +++ b/cmd/account/private-access/private-access.go @@ -16,6 +16,9 @@ var Cmd = &cobra.Command{ Use: "private-access", Short: `These APIs manage private access settings for this account.`, Long: `These APIs manage private access settings for this account.`, + Annotations: map[string]string{ + "package": "provisioning", + }, } // start create command @@ -55,9 +58,7 @@ var createCmd = &cobra.Command{ [AWS PrivateLink]: https://aws.amazon.com/privatelink [Databricks article about PrivateLink]: https://docs.databricks.com/administration-guide/cloud-configurations/aws/privatelink.html`, - Annotations: map[string]string{ - "package": "provisioning", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -113,10 +114,8 @@ var deleteCmd = &cobra.Command{ [AWS PrivateLink]: https://aws.amazon.com/privatelink [Databricks article about PrivateLink]: https://docs.databricks.com/administration-guide/cloud-configurations/aws/privatelink.html`, - Annotations: map[string]string{ - "package": "provisioning", - }, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{}, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -180,10 +179,8 @@ var getCmd = &cobra.Command{ [AWS PrivateLink]: https://aws.amazon.com/privatelink [Databricks article about PrivateLink]: https://docs.databricks.com/administration-guide/cloud-configurations/aws/privatelink.html`, - Annotations: map[string]string{ - "package": "provisioning", - }, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{}, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -236,10 +233,8 @@ var listCmd = &cobra.Command{ Gets a list of all private access settings objects for an account, specified by ID.`, - Annotations: map[string]string{ - "package": "provisioning", - }, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{}, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -294,9 +289,7 @@ var replaceCmd = &cobra.Command{ [AWS PrivateLink]: https://aws.amazon.com/privatelink [Databricks article about PrivateLink]: https://docs.databricks.com/administration-guide/cloud-configurations/aws/privatelink.html`, - Annotations: map[string]string{ - "package": "provisioning", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(3) if cmd.Flags().Changed("json") { diff --git a/cmd/account/published-app-integration/published-app-integration.go b/cmd/account/published-app-integration/published-app-integration.go index 291e79b4991..d7ff8a082de 100755 --- a/cmd/account/published-app-integration/published-app-integration.go +++ b/cmd/account/published-app-integration/published-app-integration.go @@ -20,6 +20,9 @@ var Cmd = &cobra.Command{ **Note:** You can only add/use the OAuth published application integrations when OAuth enrollment status is enabled. For more details see :method:OAuthEnrollment/create`, + Annotations: map[string]string{ + "package": "oauth2", + }, } // start create command @@ -47,9 +50,7 @@ var createCmd = &cobra.Command{ You can retrieve the published oauth app integration via :method:PublishedAppIntegration/get.`, - Annotations: map[string]string{ - "package": "oauth2", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -97,9 +98,7 @@ var deleteCmd = &cobra.Command{ Delete an existing Published OAuth App Integration. You can retrieve the published oauth app integration via :method:PublishedAppIntegration/get.`, - Annotations: map[string]string{ - "package": "oauth2", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -147,9 +146,7 @@ var getCmd = &cobra.Command{ Gets the Published OAuth App Integration for the given integration id.`, - Annotations: map[string]string{ - "package": "oauth2", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -193,10 +190,8 @@ var listCmd = &cobra.Command{ Get the list of published oauth app integrations for the specified Databricks account`, - Annotations: map[string]string{ - "package": "oauth2", - }, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{}, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -230,9 +225,7 @@ var updateCmd = &cobra.Command{ Updates an existing published OAuth App Integration. You can retrieve the published oauth app integration via :method:PublishedAppIntegration/get.`, - Annotations: map[string]string{ - "package": "oauth2", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { diff --git a/cmd/account/service-principal-secrets/service-principal-secrets.go b/cmd/account/service-principal-secrets/service-principal-secrets.go index 09661352c2a..34f7e7d0f6f 100755 --- a/cmd/account/service-principal-secrets/service-principal-secrets.go +++ b/cmd/account/service-principal-secrets/service-principal-secrets.go @@ -28,6 +28,9 @@ var Cmd = &cobra.Command{ [Authentication using OAuth tokens for service principals]: https://docs.databricks.com/dev-tools/authentication-oauth.html [Databricks Terraform Provider]: https://github.com/databricks/terraform-provider-databricks/blob/master/docs/index.md#authenticating-with-service-principal`, + Annotations: map[string]string{ + "package": "oauth2", + }, } // start create command @@ -49,9 +52,7 @@ var createCmd = &cobra.Command{ Create a secret for the given service principal.`, - Annotations: map[string]string{ - "package": "oauth2", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -102,9 +103,7 @@ var deleteCmd = &cobra.Command{ Delete a secret from the given service principal.`, - Annotations: map[string]string{ - "package": "oauth2", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -158,9 +157,7 @@ var listCmd = &cobra.Command{ only returns information about the secrets themselves and does not include the secret values.`, - Annotations: map[string]string{ - "package": "oauth2", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { diff --git a/cmd/account/service-principals/service-principals.go b/cmd/account/service-principals/service-principals.go index ca0cf12033f..9cff5fff2f9 100755 --- a/cmd/account/service-principals/service-principals.go +++ b/cmd/account/service-principals/service-principals.go @@ -21,6 +21,9 @@ var Cmd = &cobra.Command{ production data run with service principals, interactive users do not need any write, delete, or modify privileges in production. This eliminates the risk of a user overwriting production data by accident.`, + Annotations: map[string]string{ + "package": "iam", + }, } // start create command @@ -51,9 +54,7 @@ var createCmd = &cobra.Command{ Creates a new service principal in the Databricks account.`, - Annotations: map[string]string{ - "package": "iam", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -100,10 +101,8 @@ var deleteCmd = &cobra.Command{ Delete a single service principal in the Databricks account.`, - Annotations: map[string]string{ - "package": "iam", - }, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{}, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -161,10 +160,8 @@ var getCmd = &cobra.Command{ Gets the details for a single service principal define in the Databricks account.`, - Annotations: map[string]string{ - "package": "iam", - }, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{}, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -229,9 +226,7 @@ var listCmd = &cobra.Command{ Gets the set of service principals associated with a Databricks account.`, - Annotations: map[string]string{ - "package": "iam", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -281,10 +276,8 @@ var patchCmd = &cobra.Command{ Partially updates the details of a single service principal in the Databricks account.`, - Annotations: map[string]string{ - "package": "iam", - }, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{}, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -352,10 +345,8 @@ var updateCmd = &cobra.Command{ This action replaces the existing service principal with the same name.`, - Annotations: map[string]string{ - "package": "iam", - }, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{}, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) diff --git a/cmd/account/settings/settings.go b/cmd/account/settings/settings.go index ef4a8c111bf..556ceb55546 100755 --- a/cmd/account/settings/settings.go +++ b/cmd/account/settings/settings.go @@ -14,6 +14,9 @@ var Cmd = &cobra.Command{ Use: "settings", Short: `TBD.`, Long: `TBD`, + Annotations: map[string]string{ + "package": "settings", + }, } // start read-personal-compute-setting command @@ -37,9 +40,7 @@ var readPersonalComputeSettingCmd = &cobra.Command{ TBD`, - Annotations: map[string]string{ - "package": "settings", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { diff --git a/cmd/account/storage-credentials/storage-credentials.go b/cmd/account/storage-credentials/storage-credentials.go index 00e6a7be737..1065ba2560b 100755 --- a/cmd/account/storage-credentials/storage-credentials.go +++ b/cmd/account/storage-credentials/storage-credentials.go @@ -14,6 +14,9 @@ var Cmd = &cobra.Command{ Use: "storage-credentials", Short: `These APIs manage storage credentials for a particular metastore.`, Long: `These APIs manage storage credentials for a particular metastore.`, + Annotations: map[string]string{ + "package": "catalog", + }, } // start create command @@ -43,9 +46,7 @@ var createCmd = &cobra.Command{ The caller must be a metastore admin and have the **CREATE_STORAGE_CREDENTIAL** privilege on the metastore.`, - Annotations: map[string]string{ - "package": "catalog", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -94,9 +95,7 @@ var deleteCmd = &cobra.Command{ Deletes a storage credential from the metastore. The caller must be an owner of the storage credential.`, - Annotations: map[string]string{ - "package": "catalog", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -147,9 +146,7 @@ var getCmd = &cobra.Command{ admin, the owner of the storage credential, or have a level of privilege on the storage credential.`, - Annotations: map[string]string{ - "package": "catalog", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -199,9 +196,7 @@ var listCmd = &cobra.Command{ Gets a list of all storage credentials that have been assigned to given metastore.`, - Annotations: map[string]string{ - "package": "catalog", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -253,9 +248,7 @@ var updateCmd = &cobra.Command{ the storage credential. If the caller is a metastore admin, only the __owner__ credential can be changed.`, - Annotations: map[string]string{ - "package": "catalog", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { diff --git a/cmd/account/storage/storage.go b/cmd/account/storage/storage.go index 82f771f80ac..c3cf7ec352b 100755 --- a/cmd/account/storage/storage.go +++ b/cmd/account/storage/storage.go @@ -21,6 +21,9 @@ var Cmd = &cobra.Command{ bucket for storage of non-production DBFS data. A storage configuration encapsulates this bucket information, and its ID is used when creating a new workspace.`, + Annotations: map[string]string{ + "package": "provisioning", + }, } // start create command @@ -51,10 +54,8 @@ var createCmd = &cobra.Command{ [Create a new workspace using the Account API]: http://docs.databricks.com/administration-guide/account-api/new-workspace.html`, - Annotations: map[string]string{ - "package": "provisioning", - }, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{}, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -99,10 +100,8 @@ var deleteCmd = &cobra.Command{ Deletes a Databricks storage configuration. You cannot delete a storage configuration that is associated with any workspace.`, - Annotations: map[string]string{ - "package": "provisioning", - }, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{}, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -159,10 +158,8 @@ var getCmd = &cobra.Command{ Gets a Databricks storage configuration for an account, both specified by ID.`, - Annotations: map[string]string{ - "package": "provisioning", - }, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{}, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -215,10 +212,8 @@ var listCmd = &cobra.Command{ Gets a list of all Databricks storage configurations for your account, specified by ID.`, - Annotations: map[string]string{ - "package": "provisioning", - }, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{}, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) diff --git a/cmd/account/users/users.go b/cmd/account/users/users.go index c623958234f..4f61522cb5c 100755 --- a/cmd/account/users/users.go +++ b/cmd/account/users/users.go @@ -26,6 +26,9 @@ var Cmd = &cobra.Command{ provider and that user’s account will also be removed from Databricks account. This ensures a consistent offboarding process and prevents unauthorized users from accessing sensitive data.`, + Annotations: map[string]string{ + "package": "iam", + }, } // start create command @@ -59,9 +62,7 @@ var createCmd = &cobra.Command{ Creates a new user in the Databricks account. This new user will also be added to the Databricks account.`, - Annotations: map[string]string{ - "package": "iam", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -109,10 +110,8 @@ var deleteCmd = &cobra.Command{ Deletes a user. Deleting a user from a Databricks account also removes objects associated with the user.`, - Annotations: map[string]string{ - "package": "iam", - }, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{}, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -169,10 +168,8 @@ var getCmd = &cobra.Command{ Gets information for a specific user in Databricks account.`, - Annotations: map[string]string{ - "package": "iam", - }, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{}, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -237,9 +234,7 @@ var listCmd = &cobra.Command{ Gets details for all the users associated with a Databricks account.`, - Annotations: map[string]string{ - "package": "iam", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -289,10 +284,8 @@ var patchCmd = &cobra.Command{ Partially updates a user resource by applying the supplied operations on specific user attributes.`, - Annotations: map[string]string{ - "package": "iam", - }, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{}, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -360,10 +353,8 @@ var updateCmd = &cobra.Command{ Replaces a user's information with the data supplied in request.`, - Annotations: map[string]string{ - "package": "iam", - }, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{}, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) diff --git a/cmd/account/vpc-endpoints/vpc-endpoints.go b/cmd/account/vpc-endpoints/vpc-endpoints.go index 51805118089..abdbcfa8a8b 100755 --- a/cmd/account/vpc-endpoints/vpc-endpoints.go +++ b/cmd/account/vpc-endpoints/vpc-endpoints.go @@ -16,6 +16,9 @@ var Cmd = &cobra.Command{ Use: "vpc-endpoints", Short: `These APIs manage VPC endpoint configurations for this account.`, Long: `These APIs manage VPC endpoint configurations for this account.`, + Annotations: map[string]string{ + "package": "provisioning", + }, } // start create command @@ -53,9 +56,7 @@ var createCmd = &cobra.Command{ [VPC endpoint]: https://docs.aws.amazon.com/vpc/latest/privatelink/vpc-endpoints.html [endpoint service]: https://docs.aws.amazon.com/vpc/latest/privatelink/privatelink-share-your-services.html`, - Annotations: map[string]string{ - "package": "provisioning", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -111,10 +112,8 @@ var deleteCmd = &cobra.Command{ [AWS VPC endpoint]: https://docs.aws.amazon.com/vpc/latest/privatelink/concepts.html [Databricks article about PrivateLink]: https://docs.databricks.com/administration-guide/cloud-configurations/aws/privatelink.html`, - Annotations: map[string]string{ - "package": "provisioning", - }, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{}, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -175,10 +174,8 @@ var getCmd = &cobra.Command{ [AWS PrivateLink]: https://aws.amazon.com/privatelink [VPC endpoint]: https://docs.aws.amazon.com/vpc/latest/privatelink/concepts.html`, - Annotations: map[string]string{ - "package": "provisioning", - }, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{}, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -235,10 +232,8 @@ var listCmd = &cobra.Command{ [Databricks article about PrivateLink]: https://docs.databricks.com/administration-guide/cloud-configurations/aws/privatelink.html`, - Annotations: map[string]string{ - "package": "provisioning", - }, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{}, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) diff --git a/cmd/account/workspace-assignment/workspace-assignment.go b/cmd/account/workspace-assignment/workspace-assignment.go index 24c25294800..80f5b2d62e1 100755 --- a/cmd/account/workspace-assignment/workspace-assignment.go +++ b/cmd/account/workspace-assignment/workspace-assignment.go @@ -17,6 +17,9 @@ var Cmd = &cobra.Command{ Short: `The Workspace Permission Assignment API allows you to manage workspace permissions for principals in your account.`, Long: `The Workspace Permission Assignment API allows you to manage workspace permissions for principals in your account.`, + Annotations: map[string]string{ + "package": "iam", + }, } // start delete command @@ -39,9 +42,7 @@ var deleteCmd = &cobra.Command{ Deletes the workspace permissions assignment in a given account and workspace for the specified principal.`, - Annotations: map[string]string{ - "package": "iam", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -96,9 +97,7 @@ var getCmd = &cobra.Command{ Get an array of workspace permissions for the specified account and workspace.`, - Annotations: map[string]string{ - "package": "iam", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -150,9 +149,7 @@ var listCmd = &cobra.Command{ Get the permission assignments for the specified Databricks account and Databricks workspace.`, - Annotations: map[string]string{ - "package": "iam", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -204,10 +201,8 @@ var updateCmd = &cobra.Command{ Creates or updates the workspace permissions assignment in a given account and workspace for the specified principal.`, - Annotations: map[string]string{ - "package": "iam", - }, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{}, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) diff --git a/cmd/account/workspaces/workspaces.go b/cmd/account/workspaces/workspaces.go index c7597c2fd54..621e9e2c2f7 100755 --- a/cmd/account/workspaces/workspaces.go +++ b/cmd/account/workspaces/workspaces.go @@ -24,6 +24,9 @@ var Cmd = &cobra.Command{ These endpoints are available if your account is on the E2 version of the platform or on a select custom plan that allows multiple workspaces per account.`, + Annotations: map[string]string{ + "package": "provisioning", + }, } // start create command @@ -71,9 +74,7 @@ var createCmd = &cobra.Command{ repeated GET requests with the workspace ID and check its status. The workspace becomes available when the status changes to RUNNING.`, - Annotations: map[string]string{ - "package": "provisioning", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -140,10 +141,8 @@ var deleteCmd = &cobra.Command{ platform or on a select custom plan that allows multiple workspaces per account.`, - Annotations: map[string]string{ - "package": "provisioning", - }, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{}, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -216,10 +215,8 @@ var getCmd = &cobra.Command{ [Create a new workspace using the Account API]: http://docs.databricks.com/administration-guide/account-api/new-workspace.html`, - Annotations: map[string]string{ - "package": "provisioning", - }, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{}, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -278,10 +275,8 @@ var listCmd = &cobra.Command{ platform or on a select custom plan that allows multiple workspaces per account.`, - Annotations: map[string]string{ - "package": "provisioning", - }, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{}, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) @@ -434,10 +429,8 @@ var updateCmd = &cobra.Command{ [Account Console]: https://docs.databricks.com/administration-guide/account-settings-e2/account-console-e2.html [Create a new workspace using the Account API]: http://docs.databricks.com/administration-guide/account-api/new-workspace.html`, - Annotations: map[string]string{ - "package": "provisioning", - }, - PreRunE: root.MustAccountClient, + Annotations: map[string]string{}, + PreRunE: root.MustAccountClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() a := root.AccountClient(ctx) diff --git a/cmd/workspace/alerts/alerts.go b/cmd/workspace/alerts/alerts.go index 3db956a2745..2928dfeb404 100755 --- a/cmd/workspace/alerts/alerts.go +++ b/cmd/workspace/alerts/alerts.go @@ -20,6 +20,9 @@ var Cmd = &cobra.Command{ its result, and notifies one or more users and/or notification destinations if the condition was met. Alerts can be scheduled using the sql_task type of the Jobs API, e.g. :method:jobs/create.`, + Annotations: map[string]string{ + "package": "sql", + }, } // start create command @@ -46,10 +49,8 @@ var createCmd = &cobra.Command{ query, evaluates a condition of its result, and notifies users or notification destinations if the condition was met.`, - Annotations: map[string]string{ - "package": "sql", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -96,10 +97,8 @@ var deleteCmd = &cobra.Command{ restored. **Note:** Unlike queries and dashboards, alerts cannot be moved to the trash.`, - Annotations: map[string]string{ - "package": "sql", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -156,10 +155,8 @@ var getCmd = &cobra.Command{ Gets an alert.`, - Annotations: map[string]string{ - "package": "sql", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -211,10 +208,8 @@ var listCmd = &cobra.Command{ Gets a list of alerts.`, - Annotations: map[string]string{ - "package": "sql", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -247,10 +242,8 @@ var updateCmd = &cobra.Command{ Updates an alert.`, - Annotations: map[string]string{ - "package": "sql", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) diff --git a/cmd/workspace/catalogs/catalogs.go b/cmd/workspace/catalogs/catalogs.go index f824977180b..6bb30f59f62 100755 --- a/cmd/workspace/catalogs/catalogs.go +++ b/cmd/workspace/catalogs/catalogs.go @@ -21,6 +21,9 @@ var Cmd = &cobra.Command{ data centrally across all of the workspaces in a Databricks account. Users in different workspaces can share access to the same data, depending on privileges granted centrally in Unity Catalog.`, + Annotations: map[string]string{ + "package": "catalog", + }, } // start create command @@ -49,9 +52,7 @@ var createCmd = &cobra.Command{ Creates a new catalog instance in the parent metastore if the caller is a metastore admin or has the **CREATE_CATALOG** privilege.`, - Annotations: map[string]string{ - "package": "catalog", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -102,9 +103,7 @@ var deleteCmd = &cobra.Command{ Deletes the catalog that matches the supplied name. The caller must be a metastore admin or the owner of the catalog.`, - Annotations: map[string]string{ - "package": "catalog", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -154,9 +153,7 @@ var getCmd = &cobra.Command{ admin, the owner of the catalog, or a user that has the **USE_CATALOG** privilege set for their account.`, - Annotations: map[string]string{ - "package": "catalog", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -203,10 +200,8 @@ var listCmd = &cobra.Command{ retrieved. There is no guarantee of a specific ordering of the elements in the array.`, - Annotations: map[string]string{ - "package": "catalog", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -245,9 +240,7 @@ var updateCmd = &cobra.Command{ the owner of the catalog, or a metastore admin (when changing the owner field of the catalog).`, - Annotations: map[string]string{ - "package": "catalog", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { diff --git a/cmd/workspace/cluster-policies/cluster-policies.go b/cmd/workspace/cluster-policies/cluster-policies.go index fe760354f65..e4a7da0fb77 100755 --- a/cmd/workspace/cluster-policies/cluster-policies.go +++ b/cmd/workspace/cluster-policies/cluster-policies.go @@ -39,6 +39,9 @@ var Cmd = &cobra.Command{ Only admin users can create, edit, and delete policies. Admin users also have access to all policies.`, + Annotations: map[string]string{ + "package": "compute", + }, } // start create command @@ -66,9 +69,7 @@ var createCmd = &cobra.Command{ Creates a new policy with prescribed settings.`, - Annotations: map[string]string{ - "package": "compute", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -117,10 +118,8 @@ var deleteCmd = &cobra.Command{ Delete a policy for a cluster. Clusters governed by this policy can still run, but cannot be edited.`, - Annotations: map[string]string{ - "package": "compute", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -184,9 +183,7 @@ var editCmd = &cobra.Command{ Update an existing policy for cluster. This operation may make some clusters governed by the previous policy invalid.`, - Annotations: map[string]string{ - "package": "compute", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -235,10 +232,8 @@ var getCmd = &cobra.Command{ Get a cluster policy entity. Creation and editing is available to admins only.`, - Annotations: map[string]string{ - "package": "compute", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -298,9 +293,7 @@ var listCmd = &cobra.Command{ Returns a list of policies accessible by the requesting user.`, - Annotations: map[string]string{ - "package": "compute", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { diff --git a/cmd/workspace/clusters/clusters.go b/cmd/workspace/clusters/clusters.go index e3336d2d38c..36862338a4d 100755 --- a/cmd/workspace/clusters/clusters.go +++ b/cmd/workspace/clusters/clusters.go @@ -43,6 +43,9 @@ var Cmd = &cobra.Command{ recently terminated by the job scheduler. To keep an all-purpose cluster configuration even after it has been terminated for more than 30 days, an administrator can pin a cluster to the cluster list.`, + Annotations: map[string]string{ + "package": "compute", + }, } // start change-owner command @@ -65,9 +68,7 @@ var changeOwnerCmd = &cobra.Command{ Change the owner of the cluster. You must be an admin to perform this operation.`, - Annotations: map[string]string{ - "package": "compute", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -158,9 +159,7 @@ var createCmd = &cobra.Command{ creation will succeed. Otherwise the cluster will terminate with an informative error message.`, - Annotations: map[string]string{ - "package": "compute", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -228,10 +227,8 @@ var deleteCmd = &cobra.Command{ TERMINATED state. If the cluster is already in a TERMINATING or TERMINATED state, nothing will happen.`, - Annotations: map[string]string{ - "package": "compute", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -344,9 +341,7 @@ var editCmd = &cobra.Command{ Clusters created by the Databricks Jobs service cannot be edited.`, - Annotations: map[string]string{ - "package": "compute", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -416,10 +411,8 @@ var eventsCmd = &cobra.Command{ paginated. If there are more events to read, the response includes all the nparameters necessary to request the next page of events.`, - Annotations: map[string]string{ - "package": "compute", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -482,10 +475,8 @@ var getCmd = &cobra.Command{ Retrieves the information for a cluster given its identifier. Clusters can be described while they are running, or up to 60 days after they are terminated.`, - Annotations: map[string]string{ - "package": "compute", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -552,9 +543,7 @@ var listCmd = &cobra.Command{ clusters, all 45 terminated all-purpose clusters, and the 30 most recently terminated job clusters.`, - Annotations: map[string]string{ - "package": "compute", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -597,10 +586,8 @@ var listNodeTypesCmd = &cobra.Command{ Returns a list of supported Spark node types. These node types can be used to launch a cluster.`, - Annotations: map[string]string{ - "package": "compute", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -627,10 +614,8 @@ var listZonesCmd = &cobra.Command{ Returns a list of availability zones where clusters can be created in (For example, us-west-2a). These zones can be used to launch a cluster.`, - Annotations: map[string]string{ - "package": "compute", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -666,10 +651,8 @@ var permanentDeleteCmd = &cobra.Command{ cluster list, and API users can no longer perform any action on permanently deleted clusters.`, - Annotations: map[string]string{ - "package": "compute", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -728,10 +711,8 @@ var pinCmd = &cobra.Command{ ListClusters API. Pinning a cluster that is already pinned will have no effect. This API can only be called by workspace admins.`, - Annotations: map[string]string{ - "package": "compute", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -797,10 +778,8 @@ var resizeCmd = &cobra.Command{ Resizes a cluster to have a desired number of workers. This will fail unless the cluster is in a RUNNING state.`, - Annotations: map[string]string{ - "package": "compute", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -877,10 +856,8 @@ var restartCmd = &cobra.Command{ Restarts a Spark cluster with the supplied ID. If the cluster is not currently in a RUNNING state, nothing will happen.`, - Annotations: map[string]string{ - "package": "compute", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -945,10 +922,8 @@ var sparkVersionsCmd = &cobra.Command{ Returns the list of available Spark versions. These versions can be used to launch a cluster.`, - Annotations: map[string]string{ - "package": "compute", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -991,10 +966,8 @@ var startCmd = &cobra.Command{ nodes. * If the cluster is not currently in a TERMINATED state, nothing will happen. * Clusters launched to run a job cannot be started.`, - Annotations: map[string]string{ - "package": "compute", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -1065,10 +1038,8 @@ var unpinCmd = &cobra.Command{ ListClusters API. Unpinning a cluster that is not pinned will have no effect. This API can only be called by workspace admins.`, - Annotations: map[string]string{ - "package": "compute", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) diff --git a/cmd/workspace/connections/connections.go b/cmd/workspace/connections/connections.go index 35ba8289d25..a585013b129 100755 --- a/cmd/workspace/connections/connections.go +++ b/cmd/workspace/connections/connections.go @@ -26,6 +26,9 @@ var Cmd = &cobra.Command{ may create different types of connections with each connection having a unique set of configuration options to support credential management and other settings.`, + Annotations: map[string]string{ + "package": "catalog", + }, } // start create command @@ -56,10 +59,8 @@ var createCmd = &cobra.Command{ specify connection details and configurations for interaction with the external server.`, - Annotations: map[string]string{ - "package": "catalog", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -107,10 +108,8 @@ var deleteCmd = &cobra.Command{ Deletes the connection that matches the supplied name.`, - Annotations: map[string]string{ - "package": "catalog", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -167,10 +166,8 @@ var getCmd = &cobra.Command{ Gets a connection from it's name.`, - Annotations: map[string]string{ - "package": "catalog", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -222,10 +219,8 @@ var listCmd = &cobra.Command{ List all connections.`, - Annotations: map[string]string{ - "package": "catalog", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -256,10 +251,8 @@ var updateCmd = &cobra.Command{ Updates the connection that matches the supplied name.`, - Annotations: map[string]string{ - "package": "catalog", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) diff --git a/cmd/workspace/current-user/current-user.go b/cmd/workspace/current-user/current-user.go index a8ad65d355e..ef4932085d1 100755 --- a/cmd/workspace/current-user/current-user.go +++ b/cmd/workspace/current-user/current-user.go @@ -13,6 +13,9 @@ var Cmd = &cobra.Command{ Short: `This API allows retrieving information about currently authenticated user or service principal.`, Long: `This API allows retrieving information about currently authenticated user or service principal.`, + Annotations: map[string]string{ + "package": "iam", + }, } // start me command @@ -29,10 +32,8 @@ var meCmd = &cobra.Command{ Get details about the current method caller's identity.`, - Annotations: map[string]string{ - "package": "iam", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) diff --git a/cmd/workspace/dashboards/dashboards.go b/cmd/workspace/dashboards/dashboards.go index a2deb92378f..24277603559 100755 --- a/cmd/workspace/dashboards/dashboards.go +++ b/cmd/workspace/dashboards/dashboards.go @@ -21,6 +21,9 @@ var Cmd = &cobra.Command{ since you can get a dashboard definition with a GET request and then POST it to create a new one. Dashboards can be scheduled using the sql_task type of the Jobs API, e.g. :method:jobs/create.`, + Annotations: map[string]string{ + "package": "sql", + }, } // start create command @@ -45,9 +48,7 @@ var createCmd = &cobra.Command{ Short: `Create a dashboard object.`, Long: `Create a dashboard object.`, - Annotations: map[string]string{ - "package": "sql", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -95,10 +96,8 @@ var deleteCmd = &cobra.Command{ Moves a dashboard to the trash. Trashed dashboards do not appear in list views or searches, and cannot be shared.`, - Annotations: map[string]string{ - "package": "sql", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -156,10 +155,8 @@ var getCmd = &cobra.Command{ Returns a JSON representation of a dashboard object, including its visualization and query objects.`, - Annotations: map[string]string{ - "package": "sql", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -221,9 +218,7 @@ var listCmd = &cobra.Command{ Fetch a paginated list of dashboard objects.`, - Annotations: map[string]string{ - "package": "sql", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -270,10 +265,8 @@ var restoreCmd = &cobra.Command{ A restored dashboard appears in list views and searches and can be shared.`, - Annotations: map[string]string{ - "package": "sql", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) diff --git a/cmd/workspace/data-sources/data-sources.go b/cmd/workspace/data-sources/data-sources.go index cb889e3d395..cd1d1ebcff2 100755 --- a/cmd/workspace/data-sources/data-sources.go +++ b/cmd/workspace/data-sources/data-sources.go @@ -21,6 +21,9 @@ var Cmd = &cobra.Command{ in your workspace. We advise you to use any text editor, REST client, or grep to search the response from this API for the name of your SQL warehouse as it appears in Databricks SQL.`, + Annotations: map[string]string{ + "package": "sql", + }, } // start list command @@ -39,10 +42,8 @@ var listCmd = &cobra.Command{ fields that appear in this API response are enumerated for clarity. However, you need only a SQL warehouse's id to create new queries against it.`, - Annotations: map[string]string{ - "package": "sql", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) diff --git a/cmd/workspace/experiments/experiments.go b/cmd/workspace/experiments/experiments.go index 72a3c2f2d39..be5176c91a8 100755 --- a/cmd/workspace/experiments/experiments.go +++ b/cmd/workspace/experiments/experiments.go @@ -24,6 +24,9 @@ var Cmd = &cobra.Command{ Experiments are located in the workspace file tree. You manage experiments using the same tools you use to manage other workspace objects such as folders, notebooks, and libraries.`, + Annotations: map[string]string{ + "package": "ml", + }, } // start create-experiment command @@ -53,9 +56,7 @@ var createExperimentCmd = &cobra.Command{ Throws RESOURCE_ALREADY_EXISTS if a experiment with the given name exists.`, - Annotations: map[string]string{ - "package": "ml", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -111,9 +112,7 @@ var createRunCmd = &cobra.Command{ mlflowParam, mlflowMetric and mlflowRunTag associated with a single execution.`, - Annotations: map[string]string{ - "package": "ml", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -162,9 +161,7 @@ var deleteExperimentCmd = &cobra.Command{ for deletion. If the experiment uses FileStore, artifacts associated with experiment are also deleted.`, - Annotations: map[string]string{ - "package": "ml", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -212,9 +209,7 @@ var deleteRunCmd = &cobra.Command{ Marks a run for deletion.`, - Annotations: map[string]string{ - "package": "ml", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -263,9 +258,7 @@ var deleteTagCmd = &cobra.Command{ Deletes a tag on a run. Tags are run metadata that can be updated during a run and after a run completes.`, - Annotations: map[string]string{ - "package": "ml", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -322,9 +315,7 @@ var getByNameCmd = &cobra.Command{ Throws RESOURCE_DOES_NOT_EXIST if no experiment with the specified name exists.`, - Annotations: map[string]string{ - "package": "ml", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -372,9 +363,7 @@ var getExperimentCmd = &cobra.Command{ Gets metadata for an experiment. This method works on deleted experiments.`, - Annotations: map[string]string{ - "package": "ml", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -427,9 +416,7 @@ var getHistoryCmd = &cobra.Command{ Gets a list of all values for the specified metric for a given run.`, - Annotations: map[string]string{ - "package": "ml", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -484,9 +471,7 @@ var getRunCmd = &cobra.Command{ If there are multiple values with the latest timestamp, return the maximum of these values.`, - Annotations: map[string]string{ - "package": "ml", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -540,9 +525,7 @@ var listArtifactsCmd = &cobra.Command{ List artifacts for a run. Takes an optional artifact_path prefix. If it is specified, the response contains only artifacts with the specified prefix.",`, - Annotations: map[string]string{ - "package": "ml", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -593,9 +576,7 @@ var listExperimentsCmd = &cobra.Command{ Gets a list of all experiments.`, - Annotations: map[string]string{ - "package": "ml", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -683,9 +664,7 @@ var logBatchCmd = &cobra.Command{ * Metric keyes, param keys, and tag keys can be up to 250 characters in length * Parameter and tag values can be up to 250 characters in length`, - Annotations: map[string]string{ - "package": "ml", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -736,9 +715,7 @@ var logInputsCmd = &cobra.Command{ **NOTE:** Experimental: This API may change or be removed in a future release without warning.`, - Annotations: map[string]string{ - "package": "ml", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -791,9 +768,7 @@ var logMetricCmd = &cobra.Command{ value) with an associated timestamp. Examples include the various metrics that represent ML model accuracy. A metric can be logged multiple times.`, - Annotations: map[string]string{ - "package": "ml", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(3) if cmd.Flags().Changed("json") { @@ -853,9 +828,7 @@ var logModelCmd = &cobra.Command{ **NOTE:** Experimental: This API may change or be removed in a future release without warning.`, - Annotations: map[string]string{ - "package": "ml", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -908,9 +881,7 @@ var logParamCmd = &cobra.Command{ constant dates and values used in an ETL pipeline. A param can be logged only once for a run.`, - Annotations: map[string]string{ - "package": "ml", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -964,9 +935,7 @@ var restoreExperimentCmd = &cobra.Command{ Throws RESOURCE_DOES_NOT_EXIST if experiment was never created or was permanently deleted.`, - Annotations: map[string]string{ - "package": "ml", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -1014,9 +983,7 @@ var restoreRunCmd = &cobra.Command{ Restores a deleted run.`, - Annotations: map[string]string{ - "package": "ml", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -1070,9 +1037,7 @@ var searchExperimentsCmd = &cobra.Command{ Searches for experiments that satisfy specified search criteria.`, - Annotations: map[string]string{ - "package": "ml", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -1128,9 +1093,7 @@ var searchRunsCmd = &cobra.Command{ Search expressions can use mlflowMetric and mlflowParam keys.",`, - Annotations: map[string]string{ - "package": "ml", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -1177,9 +1140,7 @@ var setExperimentTagCmd = &cobra.Command{ Sets a tag on an experiment. Experiment tags are metadata that can be updated.`, - Annotations: map[string]string{ - "package": "ml", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(3) if cmd.Flags().Changed("json") { @@ -1233,9 +1194,7 @@ var setTagCmd = &cobra.Command{ Sets a tag on a run. Tags are run metadata that can be updated during a run and after a run completes.`, - Annotations: map[string]string{ - "package": "ml", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -1286,9 +1245,7 @@ var updateExperimentCmd = &cobra.Command{ Updates experiment metadata.`, - Annotations: map[string]string{ - "package": "ml", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -1341,9 +1298,7 @@ var updateRunCmd = &cobra.Command{ Updates run metadata.`, - Annotations: map[string]string{ - "package": "ml", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { diff --git a/cmd/workspace/external-locations/external-locations.go b/cmd/workspace/external-locations/external-locations.go index c769470c30c..2ff6cea9ea8 100755 --- a/cmd/workspace/external-locations/external-locations.go +++ b/cmd/workspace/external-locations/external-locations.go @@ -26,6 +26,9 @@ var Cmd = &cobra.Command{ To create external locations, you must be a metastore admin or a user with the **CREATE_EXTERNAL_LOCATION** privilege.`, + Annotations: map[string]string{ + "package": "catalog", + }, } // start create command @@ -53,9 +56,7 @@ var createCmd = &cobra.Command{ metastore admin or have the **CREATE_EXTERNAL_LOCATION** privilege on both the metastore and the associated storage credential.`, - Annotations: map[string]string{ - "package": "catalog", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(3) if cmd.Flags().Changed("json") { @@ -108,9 +109,7 @@ var deleteCmd = &cobra.Command{ Deletes the specified external location from the metastore. The caller must be the owner of the external location.`, - Annotations: map[string]string{ - "package": "catalog", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -160,9 +159,7 @@ var getCmd = &cobra.Command{ metastore admin, the owner of the external location, or a user that has some privilege on the external location.`, - Annotations: map[string]string{ - "package": "catalog", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -208,10 +205,8 @@ var listCmd = &cobra.Command{ location, or a user that has some privilege on the external location. There is no guarantee of a specific ordering of the elements in the array.`, - Annotations: map[string]string{ - "package": "catalog", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -252,9 +247,7 @@ var updateCmd = &cobra.Command{ the external location, or be a metastore admin. In the second case, the admin can only update the name of the external location.`, - Annotations: map[string]string{ - "package": "catalog", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { diff --git a/cmd/workspace/functions/functions.go b/cmd/workspace/functions/functions.go index bf935990b52..e3c9fef297f 100755 --- a/cmd/workspace/functions/functions.go +++ b/cmd/workspace/functions/functions.go @@ -21,6 +21,9 @@ var Cmd = &cobra.Command{ invoked wherever a table reference is allowed in a query. In Unity Catalog, a function resides at the same level as a table, so it can be referenced with the form __catalog_name__.__schema_name__.__function_name__.`, + Annotations: map[string]string{ + "package": "catalog", + }, } // start create command @@ -52,10 +55,8 @@ var createCmd = &cobra.Command{ created: - **USE_CATALOG** on the function's parent catalog - **USE_SCHEMA** and **CREATE_FUNCTION** on the function's parent schema`, - Annotations: map[string]string{ - "package": "catalog", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -147,10 +148,8 @@ var deleteCmd = &cobra.Command{ owner of the function itself and have both the **USE_CATALOG** privilege on its parent catalog and the **USE_SCHEMA** privilege on its parent schema`, - Annotations: map[string]string{ - "package": "catalog", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -213,10 +212,8 @@ var getCmd = &cobra.Command{ catalog, the **USE_SCHEMA** privilege on the function's parent schema, and the **EXECUTE** privilege on the function itself`, - Annotations: map[string]string{ - "package": "catalog", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -279,9 +276,7 @@ var listCmd = &cobra.Command{ is the owner. There is no guarantee of a specific ordering of the elements in the array.`, - Annotations: map[string]string{ - "package": "catalog", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -339,10 +334,8 @@ var updateCmd = &cobra.Command{ privilege on its parent catalog as well as the **USE_SCHEMA** privilege on the function's parent schema.`, - Annotations: map[string]string{ - "package": "catalog", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) diff --git a/cmd/workspace/git-credentials/git-credentials.go b/cmd/workspace/git-credentials/git-credentials.go index bf4a3965989..69f2c7e8faa 100755 --- a/cmd/workspace/git-credentials/git-credentials.go +++ b/cmd/workspace/git-credentials/git-credentials.go @@ -21,6 +21,9 @@ var Cmd = &cobra.Command{ See [more info]. [more info]: https://docs.databricks.com/repos/get-access-tokens-from-git-provider.html`, + Annotations: map[string]string{ + "package": "workspace", + }, } // start create command @@ -48,9 +51,7 @@ var createCmd = &cobra.Command{ will fail. Use the PATCH endpoint to update existing credentials, or the DELETE endpoint to delete existing credentials.`, - Annotations: map[string]string{ - "package": "workspace", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -98,10 +99,8 @@ var deleteCmd = &cobra.Command{ Deletes the specified Git credential.`, - Annotations: map[string]string{ - "package": "workspace", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -161,10 +160,8 @@ var getCmd = &cobra.Command{ Gets the Git credential with the specified credential ID.`, - Annotations: map[string]string{ - "package": "workspace", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -220,10 +217,8 @@ var listCmd = &cobra.Command{ Lists the calling user's Git credentials. One credential per user is supported.`, - Annotations: map[string]string{ - "package": "workspace", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -258,10 +253,8 @@ var updateCmd = &cobra.Command{ Updates the specified Git credential.`, - Annotations: map[string]string{ - "package": "workspace", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) diff --git a/cmd/workspace/global-init-scripts/global-init-scripts.go b/cmd/workspace/global-init-scripts/global-init-scripts.go index 17d3b0d461c..850539bd18a 100755 --- a/cmd/workspace/global-init-scripts/global-init-scripts.go +++ b/cmd/workspace/global-init-scripts/global-init-scripts.go @@ -24,6 +24,9 @@ var Cmd = &cobra.Command{ script returns with a bad exit code, the Apache Spark container fails to launch and init scripts with later position are skipped. If enough containers fail, the entire cluster fails with a GLOBAL_INIT_SCRIPT_FAILURE error code.`, + Annotations: map[string]string{ + "package": "compute", + }, } // start create command @@ -48,9 +51,7 @@ var createCmd = &cobra.Command{ Creates a new global init script in this workspace.`, - Annotations: map[string]string{ - "package": "compute", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -99,10 +100,8 @@ var deleteCmd = &cobra.Command{ Deletes a global init script.`, - Annotations: map[string]string{ - "package": "compute", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -159,10 +158,8 @@ var getCmd = &cobra.Command{ Gets all the details of a script, including its Base64-encoded contents.`, - Annotations: map[string]string{ - "package": "compute", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -217,10 +214,8 @@ var listCmd = &cobra.Command{ contents of a script, use the [get a global init script](#operation/get-script) operation.`, - Annotations: map[string]string{ - "package": "compute", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -255,9 +250,7 @@ var updateCmd = &cobra.Command{ Updates a global init script, specifying only the fields to change. All fields are optional. Unspecified fields retain their current value.`, - Annotations: map[string]string{ - "package": "compute", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(3) if cmd.Flags().Changed("json") { diff --git a/cmd/workspace/grants/grants.go b/cmd/workspace/grants/grants.go index 84aee577d1a..9204f76013e 100755 --- a/cmd/workspace/grants/grants.go +++ b/cmd/workspace/grants/grants.go @@ -26,6 +26,9 @@ var Cmd = &cobra.Command{ automatically grants the privilege to all current and future objects within the catalog. Similarly, privileges granted on a schema are inherited by all current and future objects within that schema.`, + Annotations: map[string]string{ + "package": "catalog", + }, } // start get command @@ -49,9 +52,7 @@ var getCmd = &cobra.Command{ Gets the permissions for a securable.`, - Annotations: map[string]string{ - "package": "catalog", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -105,9 +106,7 @@ var getEffectiveCmd = &cobra.Command{ Gets the effective permissions for a securable.`, - Annotations: map[string]string{ - "package": "catalog", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -161,9 +160,7 @@ var updateCmd = &cobra.Command{ Updates the permissions for a securable.`, - Annotations: map[string]string{ - "package": "catalog", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { diff --git a/cmd/workspace/groups/groups.go b/cmd/workspace/groups/groups.go index 4709dfa72c5..1aec46657e6 100755 --- a/cmd/workspace/groups/groups.go +++ b/cmd/workspace/groups/groups.go @@ -22,6 +22,9 @@ var Cmd = &cobra.Command{ in Unity Catalog to groups, instead of to users individually. All Databricks workspace identities can be assigned as members of groups, and members inherit permissions that are assigned to their group.`, + Annotations: map[string]string{ + "package": "iam", + }, } // start create command @@ -52,9 +55,7 @@ var createCmd = &cobra.Command{ Creates a group in the Databricks workspace with a unique name, using the supplied group details.`, - Annotations: map[string]string{ - "package": "iam", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -101,10 +102,8 @@ var deleteCmd = &cobra.Command{ Deletes a group from the Databricks workspace.`, - Annotations: map[string]string{ - "package": "iam", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -161,10 +160,8 @@ var getCmd = &cobra.Command{ Gets the information for a specific group in the Databricks workspace.`, - Annotations: map[string]string{ - "package": "iam", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -229,9 +226,7 @@ var listCmd = &cobra.Command{ Gets all details of the groups associated with the Databricks workspace.`, - Annotations: map[string]string{ - "package": "iam", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -280,10 +275,8 @@ var patchCmd = &cobra.Command{ Partially updates the details of a group.`, - Annotations: map[string]string{ - "package": "iam", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -348,10 +341,8 @@ var updateCmd = &cobra.Command{ Updates the details of a group by replacing the entire group entity.`, - Annotations: map[string]string{ - "package": "iam", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) diff --git a/cmd/workspace/instance-pools/instance-pools.go b/cmd/workspace/instance-pools/instance-pools.go index b2795afcfa6..322a5583d68 100755 --- a/cmd/workspace/instance-pools/instance-pools.go +++ b/cmd/workspace/instance-pools/instance-pools.go @@ -33,6 +33,9 @@ var Cmd = &cobra.Command{ Databricks does not charge DBUs while instances are idle in the pool. Instance provider billing does apply. See pricing.`, + Annotations: map[string]string{ + "package": "compute", + }, } // start create command @@ -66,9 +69,7 @@ var createCmd = &cobra.Command{ Creates a new instance pool using idle and ready-to-use cloud instances.`, - Annotations: map[string]string{ - "package": "compute", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -118,10 +119,8 @@ var deleteCmd = &cobra.Command{ Deletes the instance pool permanently. The idle instances in the pool are terminated asynchronously.`, - Annotations: map[string]string{ - "package": "compute", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -190,9 +189,7 @@ var editCmd = &cobra.Command{ Modifies the configuration of an existing instance pool.`, - Annotations: map[string]string{ - "package": "compute", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(3) if cmd.Flags().Changed("json") { @@ -242,10 +239,8 @@ var getCmd = &cobra.Command{ Retrieve the information for an instance pool based on its identifier.`, - Annotations: map[string]string{ - "package": "compute", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -297,10 +292,8 @@ var listCmd = &cobra.Command{ Gets a list of instance pools with their statistics.`, - Annotations: map[string]string{ - "package": "compute", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) diff --git a/cmd/workspace/instance-profiles/instance-profiles.go b/cmd/workspace/instance-profiles/instance-profiles.go index 55a7fe44125..a5bbb6f5aed 100755 --- a/cmd/workspace/instance-profiles/instance-profiles.go +++ b/cmd/workspace/instance-profiles/instance-profiles.go @@ -19,6 +19,9 @@ var Cmd = &cobra.Command{ instance profiles for more information. [Secure access to S3 buckets]: https://docs.databricks.com/administration-guide/cloud-configurations/aws/instance-profiles.html`, + Annotations: map[string]string{ + "package": "compute", + }, } // start add command @@ -45,9 +48,7 @@ var addCmd = &cobra.Command{ In the UI, you can select the instance profile when launching clusters. This API is only available to admin users.`, - Annotations: map[string]string{ - "package": "compute", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -112,9 +113,7 @@ var editCmd = &cobra.Command{ [Databricks SQL Serverless]: https://docs.databricks.com/sql/admin/serverless.html [Enable serverless SQL warehouses]: https://docs.databricks.com/sql/admin/serverless.html`, - Annotations: map[string]string{ - "package": "compute", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -159,10 +158,8 @@ var listCmd = &cobra.Command{ This API is available to all users.`, - Annotations: map[string]string{ - "package": "compute", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -196,9 +193,7 @@ var removeCmd = &cobra.Command{ This API is only accessible to admin users.`, - Annotations: map[string]string{ - "package": "compute", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { diff --git a/cmd/workspace/ip-access-lists/ip-access-lists.go b/cmd/workspace/ip-access-lists/ip-access-lists.go index 017b9c8e139..ad74cd7c485 100755 --- a/cmd/workspace/ip-access-lists/ip-access-lists.go +++ b/cmd/workspace/ip-access-lists/ip-access-lists.go @@ -36,6 +36,9 @@ var Cmd = &cobra.Command{ After changes to the IP access list feature, it can take a few minutes for changes to take effect.`, + Annotations: map[string]string{ + "package": "settings", + }, } // start create command @@ -72,10 +75,8 @@ var createCmd = &cobra.Command{ IP access list has no effect until you enable the feature. See :method:workspaceconf/setStatus`, - Annotations: map[string]string{ - "package": "settings", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -123,10 +124,8 @@ var deleteCmd = &cobra.Command{ Deletes an IP access list, specified by its list ID.`, - Annotations: map[string]string{ - "package": "settings", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -183,10 +182,8 @@ var getCmd = &cobra.Command{ Gets an IP access list, specified by its list ID.`, - Annotations: map[string]string{ - "package": "settings", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -238,10 +235,8 @@ var listCmd = &cobra.Command{ Gets all IP access lists for the specified workspace.`, - Annotations: map[string]string{ - "package": "settings", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -285,10 +280,8 @@ var replaceCmd = &cobra.Command{ Note that your resulting IP access list has no effect until you enable the feature. See :method:workspaceconf/setStatus.`, - Annotations: map[string]string{ - "package": "settings", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -358,10 +351,8 @@ var updateCmd = &cobra.Command{ resulting IP access list has no effect until you enable the feature. See :method:workspaceconf/setStatus.`, - Annotations: map[string]string{ - "package": "settings", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) diff --git a/cmd/workspace/jobs/jobs.go b/cmd/workspace/jobs/jobs.go index edddae72f16..ccf7d94d250 100755 --- a/cmd/workspace/jobs/jobs.go +++ b/cmd/workspace/jobs/jobs.go @@ -34,6 +34,9 @@ var Cmd = &cobra.Command{ [Databricks CLI]: https://docs.databricks.com/dev-tools/cli/index.html [Secrets CLI]: https://docs.databricks.com/dev-tools/cli/secrets-cli.html [Secrets utility]: https://docs.databricks.com/dev-tools/databricks-utils.html#dbutils-secrets`, + Annotations: map[string]string{ + "package": "jobs", + }, } // start cancel-all-runs command @@ -56,10 +59,8 @@ var cancelAllRunsCmd = &cobra.Command{ Cancels all active runs of a job. The runs are canceled asynchronously, so it doesn't prevent new runs from being started.`, - Annotations: map[string]string{ - "package": "jobs", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -125,10 +126,8 @@ var cancelRunCmd = &cobra.Command{ Cancels a job run. The run is canceled asynchronously, so it may still be running when this request completes.`, - Annotations: map[string]string{ - "package": "jobs", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -224,9 +223,7 @@ var createCmd = &cobra.Command{ Create a new job.`, - Annotations: map[string]string{ - "package": "jobs", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -273,10 +270,8 @@ var deleteCmd = &cobra.Command{ Deletes a job.`, - Annotations: map[string]string{ - "package": "jobs", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -336,10 +331,8 @@ var deleteRunCmd = &cobra.Command{ Deletes a non-active run. Returns an error if the run is active.`, - Annotations: map[string]string{ - "package": "jobs", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -401,10 +394,8 @@ var exportRunCmd = &cobra.Command{ Export and retrieve the job run task.`, - Annotations: map[string]string{ - "package": "jobs", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -464,10 +455,8 @@ var getCmd = &cobra.Command{ Retrieves the details for a single job.`, - Annotations: map[string]string{ - "package": "jobs", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -534,10 +523,8 @@ var getRunCmd = &cobra.Command{ Retrieve the metadata of a run.`, - Annotations: map[string]string{ - "package": "jobs", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -606,10 +593,8 @@ var getRunOutputCmd = &cobra.Command{ automatically removed after 60 days. If you to want to reference them beyond 60 days, you must save old run results before they expire.`, - Annotations: map[string]string{ - "package": "jobs", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -675,9 +660,7 @@ var listCmd = &cobra.Command{ Retrieves a list of jobs.`, - Annotations: map[string]string{ - "package": "jobs", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -735,9 +718,7 @@ var listRunsCmd = &cobra.Command{ List runs in descending order by start time.`, - Annotations: map[string]string{ - "package": "jobs", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -803,10 +784,8 @@ var repairRunCmd = &cobra.Command{ They use the current job and task settings, and can be viewed in the history for the original job run.`, - Annotations: map[string]string{ - "package": "jobs", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -886,10 +865,8 @@ var resetCmd = &cobra.Command{ Overwrites all the settings for a specific job. Use the Update endpoint to update job settings partially.`, - Annotations: map[string]string{ - "package": "jobs", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -951,10 +928,8 @@ var runNowCmd = &cobra.Command{ Run a job and return the run_id of the triggered run.`, - Annotations: map[string]string{ - "package": "jobs", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -1050,9 +1025,7 @@ var submitCmd = &cobra.Command{ the UI. Use the jobs/runs/get API to check the run state after the job is submitted.`, - Annotations: map[string]string{ - "package": "jobs", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -1122,10 +1095,8 @@ var updateCmd = &cobra.Command{ Add, update, or remove specific settings of an existing job. Use the ResetJob to overwrite all job settings.`, - Annotations: map[string]string{ - "package": "jobs", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) diff --git a/cmd/workspace/libraries/libraries.go b/cmd/workspace/libraries/libraries.go index 2ad795367af..b2d3badf455 100755 --- a/cmd/workspace/libraries/libraries.go +++ b/cmd/workspace/libraries/libraries.go @@ -35,6 +35,9 @@ var Cmd = &cobra.Command{ When you uninstall a library from a cluster, the library is removed only when you restart the cluster. Until you restart the cluster, the status of the uninstalled library appears as Uninstall pending restart.`, + Annotations: map[string]string{ + "package": "compute", + }, } // start all-cluster-statuses command @@ -53,10 +56,8 @@ var allClusterStatusesCmd = &cobra.Command{ for all libraries installed on this cluster via the API or the libraries UI as well as libraries set to be installed on all clusters via the libraries UI.`, - Annotations: map[string]string{ - "package": "compute", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -101,9 +102,7 @@ var clusterStatusCmd = &cobra.Command{ clusters, but now marked for removal. Within this group there is no order guarantee.`, - Annotations: map[string]string{ - "package": "compute", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -156,10 +155,8 @@ var installCmd = &cobra.Command{ union of the libraries specified via this method and the libraries set to be installed on all clusters via the libraries UI.`, - Annotations: map[string]string{ - "package": "compute", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -205,10 +202,8 @@ var uninstallCmd = &cobra.Command{ uninstalled until the cluster is restarted. Uninstalling libraries that are not installed on the cluster will have no impact but is not an error.`, - Annotations: map[string]string{ - "package": "compute", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) diff --git a/cmd/workspace/metastores/metastores.go b/cmd/workspace/metastores/metastores.go index 1013956b417..b61974ee45d 100755 --- a/cmd/workspace/metastores/metastores.go +++ b/cmd/workspace/metastores/metastores.go @@ -28,6 +28,9 @@ var Cmd = &cobra.Command{ workspaces created before Unity Catalog was released. If your workspace includes a legacy Hive metastore, the data in that metastore is available in a catalog named hive_metastore.`, + Annotations: map[string]string{ + "package": "catalog", + }, } // start assign command @@ -51,9 +54,7 @@ var assignCmd = &cobra.Command{ __workspace_id__ exists, it will be overwritten by the new __metastore_id__ and __default_catalog_name__. The caller must be an account admin.`, - Annotations: map[string]string{ - "package": "catalog", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(3) if cmd.Flags().Changed("json") { @@ -108,9 +109,7 @@ var createCmd = &cobra.Command{ Creates a new metastore based on a provided name and storage root path.`, - Annotations: map[string]string{ - "package": "catalog", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -154,10 +153,8 @@ var currentCmd = &cobra.Command{ Gets the metastore assignment for the workspace being accessed.`, - Annotations: map[string]string{ - "package": "catalog", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -190,10 +187,8 @@ var deleteCmd = &cobra.Command{ Deletes a metastore. The caller must be a metastore admin.`, - Annotations: map[string]string{ - "package": "catalog", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -251,10 +246,8 @@ var getCmd = &cobra.Command{ Gets a metastore that matches the supplied ID. The caller must be a metastore admin to retrieve this info.`, - Annotations: map[string]string{ - "package": "catalog", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -308,10 +301,8 @@ var listCmd = &cobra.Command{ caller must be an admin to retrieve this info. There is no guarantee of a specific ordering of the elements in the array.`, - Annotations: map[string]string{ - "package": "catalog", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -342,9 +333,7 @@ var maintenanceCmd = &cobra.Command{ Enables or disables auto maintenance on the metastore.`, - Annotations: map[string]string{ - "package": "catalog", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -392,10 +381,8 @@ var summaryCmd = &cobra.Command{ Gets information about a metastore. This summary includes the storage credential, the cloud vendor, the cloud region, and the global metastore ID.`, - Annotations: map[string]string{ - "package": "catalog", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -426,9 +413,7 @@ var unassignCmd = &cobra.Command{ Deletes a metastore assignment. The caller must be an account administrator.`, - Annotations: map[string]string{ - "package": "catalog", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -489,10 +474,8 @@ var updateCmd = &cobra.Command{ Updates information for a specific metastore. The caller must be a metastore admin.`, - Annotations: map[string]string{ - "package": "catalog", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -555,10 +538,8 @@ var updateAssignmentCmd = &cobra.Command{ Workspace is already assigned a metastore. The caller must be an account admin to update __metastore_id__; otherwise, the caller can be a Workspace admin.`, - Annotations: map[string]string{ - "package": "catalog", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) diff --git a/cmd/workspace/model-registry/model-registry.go b/cmd/workspace/model-registry/model-registry.go index 2781ed62e5d..e180b869162 100755 --- a/cmd/workspace/model-registry/model-registry.go +++ b/cmd/workspace/model-registry/model-registry.go @@ -17,6 +17,9 @@ var Cmd = &cobra.Command{ Short: `MLflow Model Registry is a centralized model repository and a UI and set of APIs that enable you to manage the full lifecycle of MLflow Models.`, Long: `MLflow Model Registry is a centralized model repository and a UI and set of APIs that enable you to manage the full lifecycle of MLflow Models.`, + Annotations: map[string]string{ + "package": "ml", + }, } // start approve-transition-request command @@ -40,9 +43,7 @@ var approveTransitionRequestCmd = &cobra.Command{ Approves a model version stage transition request.`, - Annotations: map[string]string{ - "package": "ml", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(4) if cmd.Flags().Changed("json") { @@ -101,9 +102,7 @@ var createCommentCmd = &cobra.Command{ user or programmatically to display relevant information about the model. For example, test results or deployment errors.`, - Annotations: map[string]string{ - "package": "ml", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(3) if cmd.Flags().Changed("json") { @@ -159,9 +158,7 @@ var createModelCmd = &cobra.Command{ Throws RESOURCE_ALREADY_EXISTS if a registered model with the given name exists.`, - Annotations: map[string]string{ - "package": "ml", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -214,9 +211,7 @@ var createModelVersionCmd = &cobra.Command{ Creates a model version.`, - Annotations: map[string]string{ - "package": "ml", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -267,9 +262,7 @@ var createTransitionRequestCmd = &cobra.Command{ Creates a model version stage transition request.`, - Annotations: map[string]string{ - "package": "ml", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(3) if cmd.Flags().Changed("json") { @@ -330,10 +323,8 @@ var createWebhookCmd = &cobra.Command{ Creates a registry webhook.`, - Annotations: map[string]string{ - "package": "ml", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -376,9 +367,7 @@ var deleteCommentCmd = &cobra.Command{ Deletes a comment on a model version.`, - Annotations: map[string]string{ - "package": "ml", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -426,9 +415,7 @@ var deleteModelCmd = &cobra.Command{ Deletes a registered model.`, - Annotations: map[string]string{ - "package": "ml", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -476,9 +463,7 @@ var deleteModelTagCmd = &cobra.Command{ Deletes the tag for a registered model.`, - Annotations: map[string]string{ - "package": "ml", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -527,9 +512,7 @@ var deleteModelVersionCmd = &cobra.Command{ Deletes a model version.`, - Annotations: map[string]string{ - "package": "ml", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -578,9 +561,7 @@ var deleteModelVersionTagCmd = &cobra.Command{ Deletes a model version tag.`, - Annotations: map[string]string{ - "package": "ml", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(3) if cmd.Flags().Changed("json") { @@ -632,9 +613,7 @@ var deleteTransitionRequestCmd = &cobra.Command{ Cancels a model version stage transition request.`, - Annotations: map[string]string{ - "package": "ml", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(4) if cmd.Flags().Changed("json") { @@ -692,9 +671,7 @@ var deleteWebhookCmd = &cobra.Command{ Deletes a registry webhook.`, - Annotations: map[string]string{ - "package": "ml", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -743,9 +720,7 @@ var getLatestVersionsCmd = &cobra.Command{ Gets the latest version of a registered model.`, - Annotations: map[string]string{ - "package": "ml", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -797,9 +772,7 @@ var getModelCmd = &cobra.Command{ [MLflow endpoint]: https://www.mlflow.org/docs/latest/rest-api.html#get-registeredmodel`, - Annotations: map[string]string{ - "package": "ml", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -847,9 +820,7 @@ var getModelVersionCmd = &cobra.Command{ Get a model version.`, - Annotations: map[string]string{ - "package": "ml", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -898,9 +869,7 @@ var getModelVersionDownloadUriCmd = &cobra.Command{ Gets a URI to download the model version.`, - Annotations: map[string]string{ - "package": "ml", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -953,9 +922,7 @@ var listModelsCmd = &cobra.Command{ Lists all available registered models, up to the limit specified in __max_results__.`, - Annotations: map[string]string{ - "package": "ml", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -1002,9 +969,7 @@ var listTransitionRequestsCmd = &cobra.Command{ Gets a list of all open stage transition requests for the model version.`, - Annotations: map[string]string{ - "package": "ml", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -1059,9 +1024,7 @@ var listWebhooksCmd = &cobra.Command{ Lists all registry webhooks.`, - Annotations: map[string]string{ - "package": "ml", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -1110,9 +1073,7 @@ var rejectTransitionRequestCmd = &cobra.Command{ Rejects a model version stage transition request.`, - Annotations: map[string]string{ - "package": "ml", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(3) if cmd.Flags().Changed("json") { @@ -1167,9 +1128,7 @@ var renameModelCmd = &cobra.Command{ Renames a registered model.`, - Annotations: map[string]string{ - "package": "ml", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -1222,9 +1181,7 @@ var searchModelVersionsCmd = &cobra.Command{ Searches for specific model versions based on the supplied __filter__.`, - Annotations: map[string]string{ - "package": "ml", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -1276,9 +1233,7 @@ var searchModelsCmd = &cobra.Command{ Search for registered models based on the specified __filter__.`, - Annotations: map[string]string{ - "package": "ml", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -1325,9 +1280,7 @@ var setModelTagCmd = &cobra.Command{ Sets a tag on a registered model.`, - Annotations: map[string]string{ - "package": "ml", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(3) if cmd.Flags().Changed("json") { @@ -1377,9 +1330,7 @@ var setModelVersionTagCmd = &cobra.Command{ Sets a model version tag.`, - Annotations: map[string]string{ - "package": "ml", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(4) if cmd.Flags().Changed("json") { @@ -1434,9 +1385,7 @@ var testRegistryWebhookCmd = &cobra.Command{ Tests a registry webhook.`, - Annotations: map[string]string{ - "package": "ml", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -1490,9 +1439,7 @@ var transitionStageCmd = &cobra.Command{ [MLflow endpoint]: https://www.mlflow.org/docs/latest/rest-api.html#transition-modelversion-stage`, - Annotations: map[string]string{ - "package": "ml", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(4) if cmd.Flags().Changed("json") { @@ -1549,9 +1496,7 @@ var updateCommentCmd = &cobra.Command{ Post an edit to a comment on a model version.`, - Annotations: map[string]string{ - "package": "ml", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -1602,9 +1547,7 @@ var updateModelCmd = &cobra.Command{ Updates a registered model.`, - Annotations: map[string]string{ - "package": "ml", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -1654,9 +1597,7 @@ var updateModelVersionCmd = &cobra.Command{ Updates the model version.`, - Annotations: map[string]string{ - "package": "ml", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -1713,9 +1654,7 @@ var updateWebhookCmd = &cobra.Command{ Updates a registry webhook.`, - Annotations: map[string]string{ - "package": "ml", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { diff --git a/cmd/workspace/permissions/permissions.go b/cmd/workspace/permissions/permissions.go index c870a9ba8a7..d053efacf8f 100755 --- a/cmd/workspace/permissions/permissions.go +++ b/cmd/workspace/permissions/permissions.go @@ -15,6 +15,9 @@ var Cmd = &cobra.Command{ Short: `Permissions API are used to create read, write, edit, update and manage access for various users on different objects and endpoints.`, Long: `Permissions API are used to create read, write, edit, update and manage access for various users on different objects and endpoints.`, + Annotations: map[string]string{ + "package": "iam", + }, } // start get command @@ -37,9 +40,7 @@ var getCmd = &cobra.Command{ Gets the permission of an object. Objects can inherit permissions from their parent objects or root objects.`, - Annotations: map[string]string{ - "package": "iam", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -88,9 +89,7 @@ var getPermissionLevelsCmd = &cobra.Command{ Gets the permission levels that a user can have on an object.`, - Annotations: map[string]string{ - "package": "iam", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -142,9 +141,7 @@ var setCmd = &cobra.Command{ Sets permissions on object. Objects can inherit permissions from their parent objects and root objects.`, - Annotations: map[string]string{ - "package": "iam", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -195,9 +192,7 @@ var updateCmd = &cobra.Command{ Updates the permissions on an object.`, - Annotations: map[string]string{ - "package": "iam", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { diff --git a/cmd/workspace/pipelines/pipelines.go b/cmd/workspace/pipelines/pipelines.go index 1a4c769a0b4..358124f5e8c 100755 --- a/cmd/workspace/pipelines/pipelines.go +++ b/cmd/workspace/pipelines/pipelines.go @@ -30,6 +30,9 @@ var Cmd = &cobra.Command{ quality with Delta Live Tables expectations. Expectations allow you to define expected data quality and specify how to handle records that fail those expectations.`, + Annotations: map[string]string{ + "package": "pipelines", + }, } // start create command @@ -71,9 +74,7 @@ var createCmd = &cobra.Command{ Creates a new data processing pipeline based on the requested configuration. If successful, this method returns the ID of the new pipeline.`, - Annotations: map[string]string{ - "package": "pipelines", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -120,10 +121,8 @@ var deleteCmd = &cobra.Command{ Deletes a pipeline.`, - Annotations: map[string]string{ - "package": "pipelines", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -183,10 +182,8 @@ var getCmd = &cobra.Command{ Short: `Get a pipeline.`, Long: `Get a pipeline.`, - Annotations: map[string]string{ - "package": "pipelines", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -243,9 +240,7 @@ var getUpdateCmd = &cobra.Command{ Gets an update from an active pipeline.`, - Annotations: map[string]string{ - "package": "pipelines", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -299,10 +294,8 @@ var listPipelineEventsCmd = &cobra.Command{ Retrieves events for a pipeline.`, - Annotations: map[string]string{ - "package": "pipelines", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -364,9 +357,7 @@ var listPipelinesCmd = &cobra.Command{ Lists pipelines defined in the Delta Live Tables system.`, - Annotations: map[string]string{ - "package": "pipelines", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -417,10 +408,8 @@ var listUpdatesCmd = &cobra.Command{ List updates for an active pipeline.`, - Annotations: map[string]string{ - "package": "pipelines", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -482,10 +471,8 @@ var resetCmd = &cobra.Command{ Resets a pipeline.`, - Annotations: map[string]string{ - "package": "pipelines", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -559,10 +546,8 @@ var startUpdateCmd = &cobra.Command{ Starts or queues a pipeline update.`, - Annotations: map[string]string{ - "package": "pipelines", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -624,10 +609,8 @@ var stopCmd = &cobra.Command{ Stops a pipeline.`, - Annotations: map[string]string{ - "package": "pipelines", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -716,10 +699,8 @@ var updateCmd = &cobra.Command{ Updates a pipeline with the supplied configuration.`, - Annotations: map[string]string{ - "package": "pipelines", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) diff --git a/cmd/workspace/policy-families/policy-families.go b/cmd/workspace/policy-families/policy-families.go index 72fb8c3639d..fa68c430921 100755 --- a/cmd/workspace/policy-families/policy-families.go +++ b/cmd/workspace/policy-families/policy-families.go @@ -22,6 +22,9 @@ var Cmd = &cobra.Command{ Policy families cannot be used directly to create clusters. Instead, you create cluster policies using a policy family. Cluster policies created using a policy family inherit the policy family's policy definition.`, + Annotations: map[string]string{ + "package": "compute", + }, } // start get command @@ -39,9 +42,7 @@ func init() { var getCmd = &cobra.Command{ Use: "get POLICY_FAMILY_ID", - Annotations: map[string]string{ - "package": "compute", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -88,9 +89,7 @@ func init() { var listCmd = &cobra.Command{ Use: "list", - Annotations: map[string]string{ - "package": "compute", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { diff --git a/cmd/workspace/providers/providers.go b/cmd/workspace/providers/providers.go index 45db9bfe893..b6dc8b3c4eb 100755 --- a/cmd/workspace/providers/providers.go +++ b/cmd/workspace/providers/providers.go @@ -16,6 +16,9 @@ var Cmd = &cobra.Command{ Use: "providers", Short: `Databricks Providers REST API.`, Long: `Databricks Providers REST API`, + Annotations: map[string]string{ + "package": "sharing", + }, } // start create command @@ -41,9 +44,7 @@ var createCmd = &cobra.Command{ Creates a new authentication provider minimally based on a name and authentication type. The caller must be an admin on the metastore.`, - Annotations: map[string]string{ - "package": "sharing", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -96,10 +97,8 @@ var deleteCmd = &cobra.Command{ Deletes an authentication provider, if the caller is a metastore admin or is the owner of the provider.`, - Annotations: map[string]string{ - "package": "sharing", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -158,10 +157,8 @@ var getCmd = &cobra.Command{ the provider, and must either be a metastore admin or the owner of the provider.`, - Annotations: map[string]string{ - "package": "sharing", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -223,9 +220,7 @@ var listCmd = &cobra.Command{ caller are not included in the response. There is no guarantee of a specific ordering of the elements in the array.`, - Annotations: map[string]string{ - "package": "sharing", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -274,10 +269,8 @@ var listSharesCmd = &cobra.Command{ * the caller is a metastore admin, or * the caller is the owner.`, - Annotations: map[string]string{ - "package": "sharing", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -342,10 +335,8 @@ var updateCmd = &cobra.Command{ provider name, the caller must be both a metastore admin and the owner of the provider.`, - Annotations: map[string]string{ - "package": "sharing", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) diff --git a/cmd/workspace/queries/queries.go b/cmd/workspace/queries/queries.go index c50ca7c1dd3..2f314cd8d1d 100755 --- a/cmd/workspace/queries/queries.go +++ b/cmd/workspace/queries/queries.go @@ -19,6 +19,9 @@ var Cmd = &cobra.Command{ definitions include the target SQL warehouse, query text, name, description, tags, parameters, and visualizations. Queries can be scheduled using the sql_task type of the Jobs API, e.g. :method:jobs/create.`, + Annotations: map[string]string{ + "package": "sql", + }, } // start create command @@ -55,9 +58,7 @@ var createCmd = &cobra.Command{ **Note**: You cannot add a visualization until you create the query.`, - Annotations: map[string]string{ - "package": "sql", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -106,10 +107,8 @@ var deleteCmd = &cobra.Command{ searches and list views, and they cannot be used for alerts. The trash is deleted after 30 days.`, - Annotations: map[string]string{ - "package": "sql", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -167,10 +166,8 @@ var getCmd = &cobra.Command{ Retrieve a query object definition along with contextual permissions information about the currently authenticated user.`, - Annotations: map[string]string{ - "package": "sql", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -233,9 +230,7 @@ var listCmd = &cobra.Command{ Gets a list of queries. Optionally, this list can be filtered by a search term.`, - Annotations: map[string]string{ - "package": "sql", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -283,10 +278,8 @@ var restoreCmd = &cobra.Command{ Restore a query that has been moved to the trash. A restored query appears in list views and searches. You can use restored queries for alerts.`, - Annotations: map[string]string{ - "package": "sql", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -351,10 +344,8 @@ var updateCmd = &cobra.Command{ **Note**: You cannot undo this operation.`, - Annotations: map[string]string{ - "package": "sql", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) diff --git a/cmd/workspace/query-history/query-history.go b/cmd/workspace/query-history/query-history.go index b43ea2e8309..76d3a93196b 100755 --- a/cmd/workspace/query-history/query-history.go +++ b/cmd/workspace/query-history/query-history.go @@ -14,6 +14,9 @@ var Cmd = &cobra.Command{ Use: "query-history", Short: `Access the history of queries through SQL warehouses.`, Long: `Access the history of queries through SQL warehouses.`, + Annotations: map[string]string{ + "package": "sql", + }, } // start list command @@ -42,9 +45,7 @@ var listCmd = &cobra.Command{ You can filter by user ID, warehouse ID, status, and time range.`, - Annotations: map[string]string{ - "package": "sql", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { diff --git a/cmd/workspace/recipient-activation/recipient-activation.go b/cmd/workspace/recipient-activation/recipient-activation.go index cf41b003241..873e62d44ba 100755 --- a/cmd/workspace/recipient-activation/recipient-activation.go +++ b/cmd/workspace/recipient-activation/recipient-activation.go @@ -14,6 +14,9 @@ var Cmd = &cobra.Command{ Use: "recipient-activation", Short: `Databricks Recipient Activation REST API.`, Long: `Databricks Recipient Activation REST API`, + Annotations: map[string]string{ + "package": "sharing", + }, } // start get-activation-url-info command @@ -35,9 +38,7 @@ var getActivationUrlInfoCmd = &cobra.Command{ Gets an activation URL for a share.`, - Annotations: map[string]string{ - "package": "sharing", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -86,9 +87,7 @@ var retrieveTokenCmd = &cobra.Command{ Retrieve access token with an activation url. This is a public API without any authentication.`, - Annotations: map[string]string{ - "package": "sharing", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { diff --git a/cmd/workspace/recipients/recipients.go b/cmd/workspace/recipients/recipients.go index a77c0fc4901..87e7ee2d28b 100755 --- a/cmd/workspace/recipients/recipients.go +++ b/cmd/workspace/recipients/recipients.go @@ -16,6 +16,9 @@ var Cmd = &cobra.Command{ Use: "recipients", Short: `Databricks Recipients REST API.`, Long: `Databricks Recipients REST API`, + Annotations: map[string]string{ + "package": "sharing", + }, } // start create command @@ -46,9 +49,7 @@ var createCmd = &cobra.Command{ metastore. The caller must be a metastore admin or has the **CREATE_RECIPIENT** privilege on the metastore.`, - Annotations: map[string]string{ - "package": "sharing", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -101,10 +102,8 @@ var deleteCmd = &cobra.Command{ Deletes the specified recipient from the metastore. The caller must be the owner of the recipient.`, - Annotations: map[string]string{ - "package": "sharing", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -163,10 +162,8 @@ var getCmd = &cobra.Command{ * the caller is the owner of the share recipient, or: * is a metastore admin`, - Annotations: map[string]string{ - "package": "sharing", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -228,9 +225,7 @@ var listCmd = &cobra.Command{ * the caller is a metastore admin, or * the caller is the owner. There is no guarantee of a specific ordering of the elements in the array.`, - Annotations: map[string]string{ - "package": "sharing", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -278,9 +273,7 @@ var rotateTokenCmd = &cobra.Command{ Refreshes the specified recipient's delta sharing authentication token with the provided token info. The caller must be the owner of the recipient.`, - Annotations: map[string]string{ - "package": "sharing", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -333,10 +326,8 @@ var sharePermissionsCmd = &cobra.Command{ Gets the share permissions for the specified Recipient. The caller must be a metastore admin or the owner of the Recipient.`, - Annotations: map[string]string{ - "package": "sharing", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -401,10 +392,8 @@ var updateCmd = &cobra.Command{ admin or the owner of the recipient. If the recipient name will be updated, the user must be both a metastore admin and the owner of the recipient.`, - Annotations: map[string]string{ - "package": "sharing", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) diff --git a/cmd/workspace/repos/repos.go b/cmd/workspace/repos/repos.go index fcf215b52fd..8ab48a43f30 100755 --- a/cmd/workspace/repos/repos.go +++ b/cmd/workspace/repos/repos.go @@ -25,6 +25,9 @@ var Cmd = &cobra.Command{ Within Repos you can develop code in notebooks or other files and follow data science and engineering code development best practices using Git for version control, collaboration, and CI/CD.`, + Annotations: map[string]string{ + "package": "workspace", + }, } // start create command @@ -51,9 +54,7 @@ var createCmd = &cobra.Command{ Note that repos created programmatically must be linked to a remote Git repo, unlike repos created in the browser.`, - Annotations: map[string]string{ - "package": "workspace", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -102,10 +103,8 @@ var deleteCmd = &cobra.Command{ Deletes the specified repo.`, - Annotations: map[string]string{ - "package": "workspace", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -165,10 +164,8 @@ var getCmd = &cobra.Command{ Returns the repo with the given repo ID.`, - Annotations: map[string]string{ - "package": "workspace", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -232,9 +229,7 @@ var listCmd = &cobra.Command{ Returns repos that the calling user has Manage permissions on. Results are paginated with each page containing twenty repos.`, - Annotations: map[string]string{ - "package": "workspace", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -286,10 +281,8 @@ var updateCmd = &cobra.Command{ Updates the repo to a different branch or tag, or updates the repo to the latest commit on the same branch.`, - Annotations: map[string]string{ - "package": "workspace", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) diff --git a/cmd/workspace/schemas/schemas.go b/cmd/workspace/schemas/schemas.go index afbb94821ba..ee73757e3b5 100755 --- a/cmd/workspace/schemas/schemas.go +++ b/cmd/workspace/schemas/schemas.go @@ -20,6 +20,9 @@ var Cmd = &cobra.Command{ access (or list) a table or view in a schema, users must have the USE_SCHEMA data permission on the schema and its parent catalog, and they must have the SELECT permission on the table or view.`, + Annotations: map[string]string{ + "package": "catalog", + }, } // start create command @@ -47,9 +50,7 @@ var createCmd = &cobra.Command{ metastore admin, or have the **CREATE_SCHEMA** privilege in the parent catalog.`, - Annotations: map[string]string{ - "package": "catalog", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -99,10 +100,8 @@ var deleteCmd = &cobra.Command{ Deletes the specified schema from the parent catalog. The caller must be the owner of the schema or an owner of the parent catalog.`, - Annotations: map[string]string{ - "package": "catalog", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -161,10 +160,8 @@ var getCmd = &cobra.Command{ admin, the owner of the schema, or a user that has the **USE_SCHEMA** privilege on the schema.`, - Annotations: map[string]string{ - "package": "catalog", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -225,9 +222,7 @@ var listCmd = &cobra.Command{ which the caller has the **USE_SCHEMA** privilege) will be retrieved. There is no guarantee of a specific ordering of the elements in the array.`, - Annotations: map[string]string{ - "package": "catalog", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -284,10 +279,8 @@ var updateCmd = &cobra.Command{ caller must be a metastore admin or have the **CREATE_SCHEMA** privilege on the parent catalog.`, - Annotations: map[string]string{ - "package": "catalog", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) diff --git a/cmd/workspace/secrets/secrets.go b/cmd/workspace/secrets/secrets.go index 82e5781c533..6438a7f79eb 100755 --- a/cmd/workspace/secrets/secrets.go +++ b/cmd/workspace/secrets/secrets.go @@ -27,6 +27,9 @@ var Cmd = &cobra.Command{ Databricks secrets. While Databricks makes an effort to redact secret values that might be displayed in notebooks, it is not possible to prevent such users from reading secrets.`, + Annotations: map[string]string{ + "package": "workspace", + }, } // start create-scope command @@ -54,9 +57,7 @@ var createScopeCmd = &cobra.Command{ and periods, and may not exceed 128 characters. The maximum number of scopes in a workspace is 100.`, - Annotations: map[string]string{ - "package": "workspace", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -109,9 +110,7 @@ var deleteAclCmd = &cobra.Command{ Throws PERMISSION_DENIED if the user does not have permission to make this API call.`, - Annotations: map[string]string{ - "package": "workspace", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -164,9 +163,7 @@ var deleteScopeCmd = &cobra.Command{ PERMISSION_DENIED if the user does not have permission to make this API call.`, - Annotations: map[string]string{ - "package": "workspace", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -219,9 +216,7 @@ var deleteSecretCmd = &cobra.Command{ Throws PERMISSION_DENIED if the user does not have permission to make this API call.`, - Annotations: map[string]string{ - "package": "workspace", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -275,9 +270,7 @@ var getAclCmd = &cobra.Command{ PERMISSION_DENIED if the user does not have permission to make this API call.`, - Annotations: map[string]string{ - "package": "workspace", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -331,9 +324,7 @@ var listAclsCmd = &cobra.Command{ PERMISSION_DENIED if the user does not have permission to make this API call.`, - Annotations: map[string]string{ - "package": "workspace", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -379,10 +370,8 @@ var listScopesCmd = &cobra.Command{ Throws PERMISSION_DENIED if the user does not have permission to make this API call.`, - Annotations: map[string]string{ - "package": "workspace", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -420,9 +409,7 @@ var listSecretsCmd = &cobra.Command{ PERMISSION_DENIED if the user does not have permission to make this API call.`, - Annotations: map[string]string{ - "package": "workspace", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -495,9 +482,7 @@ var putAclCmd = &cobra.Command{ PERMISSION_DENIED if the user does not have permission to make this API call.`, - Annotations: map[string]string{ - "package": "workspace", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(3) if cmd.Flags().Changed("json") { diff --git a/cmd/workspace/service-principals/service-principals.go b/cmd/workspace/service-principals/service-principals.go index 37c6d5a21ef..15c3ef9f6fa 100755 --- a/cmd/workspace/service-principals/service-principals.go +++ b/cmd/workspace/service-principals/service-principals.go @@ -21,6 +21,9 @@ var Cmd = &cobra.Command{ production data run with service principals, interactive users do not need any write, delete, or modify privileges in production. This eliminates the risk of a user overwriting production data by accident.`, + Annotations: map[string]string{ + "package": "iam", + }, } // start create command @@ -51,9 +54,7 @@ var createCmd = &cobra.Command{ Creates a new service principal in the Databricks workspace.`, - Annotations: map[string]string{ - "package": "iam", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -100,10 +101,8 @@ var deleteCmd = &cobra.Command{ Delete a single service principal in the Databricks workspace.`, - Annotations: map[string]string{ - "package": "iam", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -161,10 +160,8 @@ var getCmd = &cobra.Command{ Gets the details for a single service principal define in the Databricks workspace.`, - Annotations: map[string]string{ - "package": "iam", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -229,9 +226,7 @@ var listCmd = &cobra.Command{ Gets the set of service principals associated with a Databricks workspace.`, - Annotations: map[string]string{ - "package": "iam", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -281,10 +276,8 @@ var patchCmd = &cobra.Command{ Partially updates the details of a single service principal in the Databricks workspace.`, - Annotations: map[string]string{ - "package": "iam", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -352,10 +345,8 @@ var updateCmd = &cobra.Command{ This action replaces the existing service principal with the same name.`, - Annotations: map[string]string{ - "package": "iam", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) diff --git a/cmd/workspace/serving-endpoints/serving-endpoints.go b/cmd/workspace/serving-endpoints/serving-endpoints.go index bc41c359355..28aaaff2e58 100755 --- a/cmd/workspace/serving-endpoints/serving-endpoints.go +++ b/cmd/workspace/serving-endpoints/serving-endpoints.go @@ -29,6 +29,9 @@ var Cmd = &cobra.Command{ define how requests should be routed to your served models behind an endpoint. Additionally, you can configure the scale of resources that should be applied to each served model.`, + Annotations: map[string]string{ + "package": "serving", + }, } // start build-logs command @@ -51,9 +54,7 @@ var buildLogsCmd = &cobra.Command{ Retrieves the build logs associated with the provided served model.`, - Annotations: map[string]string{ - "package": "serving", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -105,10 +106,8 @@ var createCmd = &cobra.Command{ Short: `Create a new serving endpoint.`, Long: `Create a new serving endpoint.`, - Annotations: map[string]string{ - "package": "serving", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -163,9 +162,7 @@ var deleteCmd = &cobra.Command{ Short: `Delete a serving endpoint.`, Long: `Delete a serving endpoint.`, - Annotations: map[string]string{ - "package": "serving", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -215,9 +212,7 @@ var exportMetricsCmd = &cobra.Command{ Retrieves the metrics associated with the provided serving endpoint in either Prometheus or OpenMetrics exposition format.`, - Annotations: map[string]string{ - "package": "serving", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -265,9 +260,7 @@ var getCmd = &cobra.Command{ Retrieves the details for a single serving endpoint.`, - Annotations: map[string]string{ - "package": "serving", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -308,10 +301,8 @@ var listCmd = &cobra.Command{ Short: `Retrieve all serving endpoints.`, Long: `Retrieve all serving endpoints.`, - Annotations: map[string]string{ - "package": "serving", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -343,9 +334,7 @@ var logsCmd = &cobra.Command{ Retrieves the service logs associated with the provided served model.`, - Annotations: map[string]string{ - "package": "serving", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -392,9 +381,7 @@ var queryCmd = &cobra.Command{ Short: `Query a serving endpoint with provided model input.`, Long: `Query a serving endpoint with provided model input.`, - Annotations: map[string]string{ - "package": "serving", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -452,10 +439,8 @@ var updateConfigCmd = &cobra.Command{ endpoint that already has an update in progress can not be updated until the current update completes or fails.`, - Annotations: map[string]string{ - "package": "serving", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) diff --git a/cmd/workspace/shares/shares.go b/cmd/workspace/shares/shares.go index ff9ca157dfb..6347deb1baf 100755 --- a/cmd/workspace/shares/shares.go +++ b/cmd/workspace/shares/shares.go @@ -14,6 +14,9 @@ var Cmd = &cobra.Command{ Use: "shares", Short: `Databricks Shares REST API.`, Long: `Databricks Shares REST API`, + Annotations: map[string]string{ + "package": "sharing", + }, } // start create command @@ -39,9 +42,7 @@ var createCmd = &cobra.Command{ with **update**. The caller must be a metastore admin or have the **CREATE_SHARE** privilege on the metastore.`, - Annotations: map[string]string{ - "package": "sharing", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -90,9 +91,7 @@ var deleteCmd = &cobra.Command{ Deletes a data object share from the metastore. The caller must be an owner of the share.`, - Annotations: map[string]string{ - "package": "sharing", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -143,9 +142,7 @@ var getCmd = &cobra.Command{ Gets a data object share from the metastore. The caller must be a metastore admin or the owner of the share.`, - Annotations: map[string]string{ - "package": "sharing", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -190,10 +187,8 @@ var listCmd = &cobra.Command{ metastore admin or the owner of the share. There is no guarantee of a specific ordering of the elements in the array.`, - Annotations: map[string]string{ - "package": "sharing", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -225,9 +220,7 @@ var sharePermissionsCmd = &cobra.Command{ Gets the permissions for a data share from the metastore. The caller must be a metastore admin or the owner of the share.`, - Annotations: map[string]string{ - "package": "sharing", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -293,9 +286,7 @@ var updateCmd = &cobra.Command{ Table removals through **update** do not require additional privileges.`, - Annotations: map[string]string{ - "package": "sharing", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -349,9 +340,7 @@ var updatePermissionsCmd = &cobra.Command{ For new recipient grants, the user must also be the owner of the recipients. recipient revocations do not require additional privileges.`, - Annotations: map[string]string{ - "package": "sharing", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { diff --git a/cmd/workspace/storage-credentials/storage-credentials.go b/cmd/workspace/storage-credentials/storage-credentials.go index 10ec44dfc43..b018256c8b0 100755 --- a/cmd/workspace/storage-credentials/storage-credentials.go +++ b/cmd/workspace/storage-credentials/storage-credentials.go @@ -28,6 +28,9 @@ var Cmd = &cobra.Command{ To create storage credentials, you must be a Databricks account admin. The account admin who creates the storage credential can delegate ownership to another user or group to manage permissions on it.`, + Annotations: map[string]string{ + "package": "catalog", + }, } // start create command @@ -64,9 +67,7 @@ var createCmd = &cobra.Command{ The caller must be a metastore admin and have the **CREATE_STORAGE_CREDENTIAL** privilege on the metastore.`, - Annotations: map[string]string{ - "package": "catalog", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -117,10 +118,8 @@ var deleteCmd = &cobra.Command{ Deletes a storage credential from the metastore. The caller must be an owner of the storage credential.`, - Annotations: map[string]string{ - "package": "catalog", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -179,10 +178,8 @@ var getCmd = &cobra.Command{ admin, the owner of the storage credential, or have some permission on the storage credential.`, - Annotations: map[string]string{ - "package": "catalog", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -238,10 +235,8 @@ var listCmd = &cobra.Command{ credentials will be retrieved. There is no guarantee of a specific ordering of the elements in the array.`, - Annotations: map[string]string{ - "package": "catalog", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -285,10 +280,8 @@ var updateCmd = &cobra.Command{ the storage credential or a metastore admin. If the caller is a metastore admin, only the __owner__ credential can be changed.`, - Annotations: map[string]string{ - "package": "catalog", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -365,9 +358,7 @@ var validateCmd = &cobra.Command{ the **CREATE_EXTERNAL_LOCATION** privilege on the metastore and the storage credential.`, - Annotations: map[string]string{ - "package": "catalog", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { diff --git a/cmd/workspace/system-schemas/system-schemas.go b/cmd/workspace/system-schemas/system-schemas.go index 1fd0b751710..a8aa750f56d 100755 --- a/cmd/workspace/system-schemas/system-schemas.go +++ b/cmd/workspace/system-schemas/system-schemas.go @@ -16,6 +16,9 @@ var Cmd = &cobra.Command{ Long: `A system schema is a schema that lives within the system catalog. A system schema may contain information about customer usage of Unity Catalog such as audit-logs, billing-logs, lineage information, etc.`, + Annotations: map[string]string{ + "package": "catalog", + }, } // start disable command @@ -38,9 +41,7 @@ var disableCmd = &cobra.Command{ Disables the system schema and removes it from the system catalog. The caller must be an account admin or a metastore admin.`, - Annotations: map[string]string{ - "package": "catalog", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -85,10 +86,8 @@ var enableCmd = &cobra.Command{ Enables the system schema and adds it to the system catalog. The caller must be an account admin or a metastore admin.`, - Annotations: map[string]string{ - "package": "catalog", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -120,9 +119,7 @@ var listCmd = &cobra.Command{ Gets an array of system schemas for a metastore. The caller must be an account admin or a metastore admin.`, - Annotations: map[string]string{ - "package": "catalog", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { diff --git a/cmd/workspace/table-constraints/table-constraints.go b/cmd/workspace/table-constraints/table-constraints.go index a1b706d4256..8de9315e616 100755 --- a/cmd/workspace/table-constraints/table-constraints.go +++ b/cmd/workspace/table-constraints/table-constraints.go @@ -28,6 +28,9 @@ var Cmd = &cobra.Command{ You can declare primary keys and foreign keys as part of the table specification during table creation. You can also add or drop constraints on existing tables.`, + Annotations: map[string]string{ + "package": "catalog", + }, } // start create command @@ -58,10 +61,8 @@ var createCmd = &cobra.Command{ referenced parent table's schema, and be the owner of the referenced parent table.`, - Annotations: map[string]string{ - "package": "catalog", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -113,9 +114,7 @@ var deleteCmd = &cobra.Command{ **USE_CATALOG** privilege on the table's catalog, the **USE_SCHEMA** privilege on the table's schema, and be the owner of the table.`, - Annotations: map[string]string{ - "package": "catalog", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(3) if cmd.Flags().Changed("json") { diff --git a/cmd/workspace/tables/tables.go b/cmd/workspace/tables/tables.go index e7991afd907..bae67fa789a 100755 --- a/cmd/workspace/tables/tables.go +++ b/cmd/workspace/tables/tables.go @@ -24,6 +24,9 @@ var Cmd = &cobra.Command{ A table can be managed or external. From an API perspective, a __VIEW__ is a particular kind of table (rather than a managed or external table).`, + Annotations: map[string]string{ + "package": "catalog", + }, } // start delete command @@ -49,10 +52,8 @@ var deleteCmd = &cobra.Command{ table and have the **USE_CATALOG** privilege on the parent catalog and the **USE_SCHEMA** privilege on the parent schema.`, - Annotations: map[string]string{ - "package": "catalog", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -115,10 +116,8 @@ var getCmd = &cobra.Command{ privilege on the parent schema, or be the owner of the table and have the **SELECT** privilege on it as well.`, - Annotations: map[string]string{ - "package": "catalog", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -184,9 +183,7 @@ var listCmd = &cobra.Command{ the **USE_SCHEMA** privilege on the parent schema. There is no guarantee of a specific ordering of the elements in the array.`, - Annotations: map[string]string{ - "package": "catalog", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -250,10 +247,8 @@ var listSummariesCmd = &cobra.Command{ There is no guarantee of a specific ordering of the elements in the array.`, - Annotations: map[string]string{ - "package": "catalog", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) diff --git a/cmd/workspace/token-management/token-management.go b/cmd/workspace/token-management/token-management.go index 4d2a55cba2e..405224ec8ab 100755 --- a/cmd/workspace/token-management/token-management.go +++ b/cmd/workspace/token-management/token-management.go @@ -18,6 +18,9 @@ var Cmd = &cobra.Command{ Long: `Enables administrators to get all tokens and delete tokens for other users. Admins can either get every token, get a specific token by ID, or get all tokens for a particular user.`, + Annotations: map[string]string{ + "package": "settings", + }, } // start create-obo-token command @@ -41,9 +44,7 @@ var createOboTokenCmd = &cobra.Command{ Creates a token on behalf of a service principal.`, - Annotations: map[string]string{ - "package": "settings", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -95,10 +96,8 @@ var deleteCmd = &cobra.Command{ Deletes a token, specified by its ID.`, - Annotations: map[string]string{ - "package": "settings", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -155,10 +154,8 @@ var getCmd = &cobra.Command{ Gets information about a token, specified by its ID.`, - Annotations: map[string]string{ - "package": "settings", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -218,9 +215,7 @@ var listCmd = &cobra.Command{ Lists all tokens associated with the specified workspace or user.`, - Annotations: map[string]string{ - "package": "settings", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { diff --git a/cmd/workspace/tokens/tokens.go b/cmd/workspace/tokens/tokens.go index f04184f5b48..fbf64f004e4 100755 --- a/cmd/workspace/tokens/tokens.go +++ b/cmd/workspace/tokens/tokens.go @@ -17,6 +17,9 @@ var Cmd = &cobra.Command{ Short: `The Token API allows you to create, list, and revoke tokens that can be used to authenticate and access Databricks REST APIs.`, Long: `The Token API allows you to create, list, and revoke tokens that can be used to authenticate and access Databricks REST APIs.`, + Annotations: map[string]string{ + "package": "settings", + }, } // start create command @@ -44,9 +47,7 @@ var createCmd = &cobra.Command{ authenticated token. If the user's token quota is exceeded, this call returns an error **QUOTA_EXCEEDED**.`, - Annotations: map[string]string{ - "package": "settings", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -96,10 +97,8 @@ var deleteCmd = &cobra.Command{ If a token with the specified ID is not valid, this call returns an error **RESOURCE_DOES_NOT_EXIST**.`, - Annotations: map[string]string{ - "package": "settings", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -151,10 +150,8 @@ var listCmd = &cobra.Command{ Lists all the valid tokens for a user-workspace pair.`, - Annotations: map[string]string{ - "package": "settings", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) diff --git a/cmd/workspace/users/users.go b/cmd/workspace/users/users.go index a7f36b7796a..776a95e6e15 100755 --- a/cmd/workspace/users/users.go +++ b/cmd/workspace/users/users.go @@ -26,6 +26,9 @@ var Cmd = &cobra.Command{ provider and that user’s account will also be removed from Databricks workspace. This ensures a consistent offboarding process and prevents unauthorized users from accessing sensitive data.`, + Annotations: map[string]string{ + "package": "iam", + }, } // start create command @@ -59,9 +62,7 @@ var createCmd = &cobra.Command{ Creates a new user in the Databricks workspace. This new user will also be added to the Databricks account.`, - Annotations: map[string]string{ - "package": "iam", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -109,10 +110,8 @@ var deleteCmd = &cobra.Command{ Deletes a user. Deleting a user from a Databricks workspace also removes objects associated with the user.`, - Annotations: map[string]string{ - "package": "iam", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -169,10 +168,8 @@ var getCmd = &cobra.Command{ Gets information for a specific user in Databricks workspace.`, - Annotations: map[string]string{ - "package": "iam", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -237,9 +234,7 @@ var listCmd = &cobra.Command{ Gets details for all the users associated with a Databricks workspace.`, - Annotations: map[string]string{ - "package": "iam", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -289,10 +284,8 @@ var patchCmd = &cobra.Command{ Partially updates a user resource by applying the supplied operations on specific user attributes.`, - Annotations: map[string]string{ - "package": "iam", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -360,10 +353,8 @@ var updateCmd = &cobra.Command{ Replaces a user's information with the data supplied in request.`, - Annotations: map[string]string{ - "package": "iam", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) diff --git a/cmd/workspace/volumes/volumes.go b/cmd/workspace/volumes/volumes.go index 24e6221e7c8..d3b07399e53 100755 --- a/cmd/workspace/volumes/volumes.go +++ b/cmd/workspace/volumes/volumes.go @@ -23,6 +23,9 @@ var Cmd = &cobra.Command{ storing library and config files of arbitrary formats such as .whl or .txt centrally and providing secure access across workspaces to it, or transforming and querying non-tabular data files in ETL.`, + Annotations: map[string]string{ + "package": "catalog", + }, } // start create command @@ -64,9 +67,7 @@ var createCmd = &cobra.Command{ location. - The specified storage location is not under the location of other tables, nor volumes, or catalogs or schemas.`, - Annotations: map[string]string{ - "package": "catalog", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(4) if cmd.Flags().Changed("json") { @@ -124,10 +125,8 @@ var deleteCmd = &cobra.Command{ case, the caller must also be the owner or have the **USE_CATALOG** privilege on the parent catalog and the **USE_SCHEMA** privilege on the parent schema.`, - Annotations: map[string]string{ - "package": "catalog", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -194,9 +193,7 @@ var listCmd = &cobra.Command{ There is no guarantee of a specific ordering of the elements in the array.`, - Annotations: map[string]string{ - "package": "catalog", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(2) if cmd.Flags().Changed("json") { @@ -250,10 +247,8 @@ var readCmd = &cobra.Command{ be the owner or have the **USE_CATALOG** privilege on the parent catalog and the **USE_SCHEMA** privilege on the parent schema.`, - Annotations: map[string]string{ - "package": "catalog", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -321,10 +316,8 @@ var updateCmd = &cobra.Command{ Currently only the name, the owner or the comment of the volume could be updated.`, - Annotations: map[string]string{ - "package": "catalog", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) diff --git a/cmd/workspace/warehouses/warehouses.go b/cmd/workspace/warehouses/warehouses.go index 19c32aa351b..efea3c48e97 100755 --- a/cmd/workspace/warehouses/warehouses.go +++ b/cmd/workspace/warehouses/warehouses.go @@ -19,6 +19,9 @@ var Cmd = &cobra.Command{ Long: `A SQL warehouse is a compute resource that lets you run SQL commands on data objects within Databricks SQL. Compute resources are infrastructure resources that provide processing capabilities in the cloud.`, + Annotations: map[string]string{ + "package": "sql", + }, } // start create command @@ -59,9 +62,7 @@ var createCmd = &cobra.Command{ Creates a new SQL warehouse.`, - Annotations: map[string]string{ - "package": "sql", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -127,10 +128,8 @@ var deleteCmd = &cobra.Command{ Deletes a SQL warehouse.`, - Annotations: map[string]string{ - "package": "sql", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -206,10 +205,8 @@ var editCmd = &cobra.Command{ Updates the configuration for a SQL warehouse.`, - Annotations: map[string]string{ - "package": "sql", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -290,10 +287,8 @@ var getCmd = &cobra.Command{ Gets the information for a single SQL warehouse.`, - Annotations: map[string]string{ - "package": "sql", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -346,10 +341,8 @@ var getWorkspaceWarehouseConfigCmd = &cobra.Command{ Gets the workspace level configuration that is shared by all SQL warehouses in a workspace.`, - Annotations: map[string]string{ - "package": "sql", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -382,9 +375,7 @@ var listCmd = &cobra.Command{ Lists all SQL warehouses that a user has manager permissions on.`, - Annotations: map[string]string{ - "package": "sql", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -442,9 +433,7 @@ var setWorkspaceWarehouseConfigCmd = &cobra.Command{ Sets the workspace level configuration that is shared by all SQL warehouses in a workspace.`, - Annotations: map[string]string{ - "package": "sql", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { @@ -496,10 +485,8 @@ var startCmd = &cobra.Command{ Starts a SQL warehouse.`, - Annotations: map[string]string{ - "package": "sql", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -580,10 +567,8 @@ var stopCmd = &cobra.Command{ Stops a SQL warehouse.`, - Annotations: map[string]string{ - "package": "sql", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) diff --git a/cmd/workspace/workspace-bindings/workspace-bindings.go b/cmd/workspace/workspace-bindings/workspace-bindings.go index 155d2a08d7d..f29e0d497df 100755 --- a/cmd/workspace/workspace-bindings/workspace-bindings.go +++ b/cmd/workspace/workspace-bindings/workspace-bindings.go @@ -19,6 +19,9 @@ var Cmd = &cobra.Command{ A catalog's workspace bindings can be configured by a metastore admin or the owner of the catalog.`, + Annotations: map[string]string{ + "package": "catalog", + }, } // start get command @@ -41,9 +44,7 @@ var getCmd = &cobra.Command{ Gets workspace bindings of the catalog. The caller must be a metastore admin or an owner of the catalog.`, - Annotations: map[string]string{ - "package": "catalog", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -95,9 +96,7 @@ var updateCmd = &cobra.Command{ Updates workspace bindings of the catalog. The caller must be a metastore admin or an owner of the catalog.`, - Annotations: map[string]string{ - "package": "catalog", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { diff --git a/cmd/workspace/workspace-conf/workspace-conf.go b/cmd/workspace/workspace-conf/workspace-conf.go index df5c0b37ecd..9bd09df538f 100755 --- a/cmd/workspace/workspace-conf/workspace-conf.go +++ b/cmd/workspace/workspace-conf/workspace-conf.go @@ -14,6 +14,9 @@ var Cmd = &cobra.Command{ Use: "workspace-conf", Short: `This API allows updating known workspace settings for advanced users.`, Long: `This API allows updating known workspace settings for advanced users.`, + Annotations: map[string]string{ + "package": "settings", + }, } // start get-status command @@ -35,9 +38,7 @@ var getStatusCmd = &cobra.Command{ Gets the configuration status for a workspace.`, - Annotations: map[string]string{ - "package": "settings", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -86,9 +87,7 @@ var setStatusCmd = &cobra.Command{ Sets the configuration status for a workspace, including enabling or disabling it.`, - Annotations: map[string]string{ - "package": "settings", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(0) if cmd.Flags().Changed("json") { diff --git a/cmd/workspace/workspace/workspace.go b/cmd/workspace/workspace/workspace.go index d5367a471da..3985cffa04d 100755 --- a/cmd/workspace/workspace/workspace.go +++ b/cmd/workspace/workspace/workspace.go @@ -20,6 +20,9 @@ var Cmd = &cobra.Command{ A notebook is a web-based interface to a document that contains runnable code, visualizations, and explanatory text.`, + Annotations: map[string]string{ + "package": "workspace", + }, } // start delete command @@ -50,10 +53,8 @@ var deleteCmd = &cobra.Command{ Object deletion cannot be undone and deleting a directory recursively is not atomic.`, - Annotations: map[string]string{ - "package": "workspace", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -120,10 +121,8 @@ var exportCmd = &cobra.Command{ exceed size limit, this call returns MAX_NOTEBOOK_SIZE_EXCEEDED. Currently, this API does not support exporting a library.`, - Annotations: map[string]string{ - "package": "workspace", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) @@ -181,9 +180,7 @@ var getStatusCmd = &cobra.Command{ Gets the status of an object or a directory. If path does not exist, this call returns an error RESOURCE_DOES_NOT_EXIST.`, - Annotations: map[string]string{ - "package": "workspace", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -239,9 +236,7 @@ var importCmd = &cobra.Command{ false, this call returns an error RESOURCE_ALREADY_EXISTS. One can only use DBC format to import a directory.`, - Annotations: map[string]string{ - "package": "workspace", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -293,9 +288,7 @@ var listCmd = &cobra.Command{ the input path does not exist, this call returns an error RESOURCE_DOES_NOT_EXIST.`, - Annotations: map[string]string{ - "package": "workspace", - }, + Annotations: map[string]string{}, Args: func(cmd *cobra.Command, args []string) error { check := cobra.ExactArgs(1) if cmd.Flags().Changed("json") { @@ -348,10 +341,8 @@ var mkdirsCmd = &cobra.Command{ Note that if this operation fails it may have succeeded in creating some of the necessary parrent directories.`, - Annotations: map[string]string{ - "package": "workspace", - }, - PreRunE: root.MustWorkspaceClient, + Annotations: map[string]string{}, + PreRunE: root.MustWorkspaceClient, RunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() w := root.WorkspaceClient(ctx) From 49467e902c6a2993874c497b5b00e7b875499fb0 Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Tue, 13 Jun 2023 14:32:59 +0200 Subject: [PATCH 3/3] Update .codegen/service.go.tmpl Co-authored-by: Serge Smertin <259697+nfx@users.noreply.github.com> --- .codegen/service.go.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.codegen/service.go.tmpl b/.codegen/service.go.tmpl index 41a3911c650..cdabd196707 100644 --- a/.codegen/service.go.tmpl +++ b/.codegen/service.go.tmpl @@ -25,7 +25,7 @@ var Cmd = &cobra.Command{ Long: `{{.Comment " " 80 | without "`"}}`, {{- end}} Annotations: map[string]string{ - "package": {{ .Package.Name | printf "%q" }}, + "package": "{{ .Package.Name }}", }, }