From 0c374960eee6ea6ff277b86aa824a99dcfa8d263 Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Wed, 6 Mar 2024 08:28:40 +0100 Subject: [PATCH 1/5] Update Go SDK to v0.34.0 --- .codegen/_openapi_sha | 2 +- .gitattributes | 9 + bundle/schema/docs/bundle_descriptions.json | 60 +-- cmd/account/budgets/budgets.go | 8 +- cmd/account/cmd.go | 6 + cmd/account/credentials/credentials.go | 4 +- .../csp-enablement-account.go | 171 +++++++ .../custom-app-integration.go | 8 +- .../encryption-keys/encryption-keys.go | 4 +- .../esm-enablement-account.go | 169 +++++++ cmd/account/groups/groups.go | 12 +- .../ip-access-lists/ip-access-lists.go | 12 +- cmd/account/log-delivery/log-delivery.go | 4 +- .../metastore-assignments.go | 12 +- cmd/account/metastores/metastores.go | 4 +- .../network-connectivity.go | 32 +- cmd/account/networks/networks.go | 4 +- .../personal-compute/personal-compute.go | 236 ++++++++++ cmd/account/private-access/private-access.go | 8 +- .../published-app-integration.go | 8 +- .../service-principal-secrets.go | 4 +- .../service-principals/service-principals.go | 12 +- cmd/account/settings/settings.go | 207 +-------- .../storage-credentials.go | 4 +- cmd/account/storage/storage.go | 4 +- cmd/account/users/users.go | 12 +- cmd/account/vpc-endpoints/vpc-endpoints.go | 4 +- .../workspace-assignment.go | 8 +- cmd/account/workspaces/workspaces.go | 65 +-- cmd/workspace/alerts/alerts.go | 8 +- cmd/workspace/apps/apps.go | 2 +- .../automatic-cluster-update.go | 169 +++++++ cmd/workspace/catalogs/catalogs.go | 4 +- cmd/workspace/clean-rooms/clean-rooms.go | 4 +- .../cluster-policies/cluster-policies.go | 8 +- cmd/workspace/clusters/clusters.go | 26 +- cmd/workspace/cmd.go | 12 + cmd/workspace/connections/connections.go | 4 +- .../csp-enablement/csp-enablement.go | 172 +++++++ .../dashboard-widgets/dashboard-widgets.go | 4 +- cmd/workspace/dashboards/dashboards.go | 8 +- .../default-namespace/default-namespace.go | 246 +++++++++++ .../esm-enablement/esm-enablement.go | 174 ++++++++ cmd/workspace/experiments/experiments.go | 52 +-- .../external-locations/external-locations.go | 4 +- cmd/workspace/functions/functions.go | 4 +- .../git-credentials/git-credentials.go | 8 +- .../global-init-scripts.go | 8 +- cmd/workspace/groups/groups.go | 12 +- .../instance-pools/instance-pools.go | 8 +- .../instance-profiles/instance-profiles.go | 12 +- .../ip-access-lists/ip-access-lists.go | 12 +- cmd/workspace/jobs/jobs.go | 22 +- .../lakehouse-monitors/lakehouse-monitors.go | 8 +- cmd/workspace/lakeview/lakeview.go | 5 +- cmd/workspace/libraries/libraries.go | 8 +- cmd/workspace/metastores/metastores.go | 16 +- .../model-registry/model-registry.go | 48 +- .../model-versions/model-versions.go | 4 +- cmd/workspace/online-tables/online-tables.go | 4 +- .../permission-migration.go | 139 ++++++ cmd/workspace/pipelines/pipelines.go | 10 +- cmd/workspace/providers/providers.go | 4 +- cmd/workspace/queries/queries.go | 8 +- .../query-visualizations.go | 4 +- .../recipient-activation.go | 4 +- cmd/workspace/recipients/recipients.go | 8 +- .../registered-models/registered-models.go | 8 +- cmd/workspace/repos/repos.go | 8 +- .../restrict-workspace-admins.go | 244 ++++++++++ cmd/workspace/schemas/schemas.go | 4 +- cmd/workspace/secrets/secrets.go | 20 +- .../service-principals/service-principals.go | 12 +- .../serving-endpoints/serving-endpoints.go | 8 +- cmd/workspace/settings/settings.go | 418 +----------------- cmd/workspace/shares/shares.go | 8 +- .../storage-credentials.go | 6 +- .../system-schemas/system-schemas.go | 8 +- .../table-constraints/table-constraints.go | 4 +- cmd/workspace/tables/tables.go | 8 +- .../token-management/token-management.go | 4 +- cmd/workspace/tokens/tokens.go | 4 +- cmd/workspace/users/users.go | 12 +- .../vector-search-endpoints.go | 12 +- .../vector-search-indexes.go | 39 +- cmd/workspace/volumes/volumes.go | 4 +- cmd/workspace/warehouses/warehouses.go | 14 +- .../workspace-conf/workspace-conf.go | 4 +- cmd/workspace/workspace/workspace.go | 12 +- go.mod | 20 +- go.sum | 52 +-- 91 files changed, 2202 insertions(+), 1077 deletions(-) create mode 100755 cmd/account/csp-enablement-account/csp-enablement-account.go create mode 100755 cmd/account/esm-enablement-account/esm-enablement-account.go create mode 100755 cmd/account/personal-compute/personal-compute.go create mode 100755 cmd/workspace/automatic-cluster-update/automatic-cluster-update.go create mode 100755 cmd/workspace/csp-enablement/csp-enablement.go create mode 100755 cmd/workspace/default-namespace/default-namespace.go create mode 100755 cmd/workspace/esm-enablement/esm-enablement.go create mode 100755 cmd/workspace/permission-migration/permission-migration.go create mode 100755 cmd/workspace/restrict-workspace-admins/restrict-workspace-admins.go diff --git a/.codegen/_openapi_sha b/.codegen/_openapi_sha index 013e5ffe8d..fb91589e95 100644 --- a/.codegen/_openapi_sha +++ b/.codegen/_openapi_sha @@ -1 +1 @@ -cdd76a98a4fca7008572b3a94427566dd286c63b \ No newline at end of file +d855b30f25a06fe84f25214efa20e7f1fffcdf9e \ No newline at end of file diff --git a/.gitattributes b/.gitattributes index 09aac5e751..c7d6051306 100755 --- a/.gitattributes +++ b/.gitattributes @@ -4,8 +4,10 @@ cmd/account/billable-usage/billable-usage.go linguist-generated=true cmd/account/budgets/budgets.go linguist-generated=true cmd/account/cmd.go linguist-generated=true cmd/account/credentials/credentials.go linguist-generated=true +cmd/account/csp-enablement-account/csp-enablement-account.go linguist-generated=true cmd/account/custom-app-integration/custom-app-integration.go linguist-generated=true cmd/account/encryption-keys/encryption-keys.go linguist-generated=true +cmd/account/esm-enablement-account/esm-enablement-account.go linguist-generated=true cmd/account/groups/groups.go linguist-generated=true cmd/account/ip-access-lists/ip-access-lists.go linguist-generated=true cmd/account/log-delivery/log-delivery.go linguist-generated=true @@ -14,6 +16,7 @@ cmd/account/metastores/metastores.go linguist-generated=true cmd/account/network-connectivity/network-connectivity.go linguist-generated=true cmd/account/networks/networks.go linguist-generated=true cmd/account/o-auth-published-apps/o-auth-published-apps.go linguist-generated=true +cmd/account/personal-compute/personal-compute.go linguist-generated=true cmd/account/private-access/private-access.go linguist-generated=true cmd/account/published-app-integration/published-app-integration.go linguist-generated=true cmd/account/service-principal-secrets/service-principal-secrets.go linguist-generated=true @@ -28,6 +31,7 @@ cmd/account/workspaces/workspaces.go linguist-generated=true cmd/workspace/alerts/alerts.go linguist-generated=true cmd/workspace/apps/apps.go linguist-generated=true cmd/workspace/artifact-allowlists/artifact-allowlists.go linguist-generated=true +cmd/workspace/automatic-cluster-update/automatic-cluster-update.go linguist-generated=true cmd/workspace/catalogs/catalogs.go linguist-generated=true cmd/workspace/clean-rooms/clean-rooms.go linguist-generated=true cmd/workspace/cluster-policies/cluster-policies.go linguist-generated=true @@ -35,10 +39,13 @@ cmd/workspace/clusters/clusters.go linguist-generated=true cmd/workspace/cmd.go linguist-generated=true cmd/workspace/connections/connections.go linguist-generated=true cmd/workspace/credentials-manager/credentials-manager.go linguist-generated=true +cmd/workspace/csp-enablement/csp-enablement.go linguist-generated=true cmd/workspace/current-user/current-user.go linguist-generated=true cmd/workspace/dashboard-widgets/dashboard-widgets.go linguist-generated=true cmd/workspace/dashboards/dashboards.go linguist-generated=true cmd/workspace/data-sources/data-sources.go linguist-generated=true +cmd/workspace/default-namespace/default-namespace.go linguist-generated=true +cmd/workspace/esm-enablement/esm-enablement.go linguist-generated=true cmd/workspace/experiments/experiments.go linguist-generated=true cmd/workspace/external-locations/external-locations.go linguist-generated=true cmd/workspace/functions/functions.go linguist-generated=true @@ -57,6 +64,7 @@ cmd/workspace/metastores/metastores.go linguist-generated=true cmd/workspace/model-registry/model-registry.go linguist-generated=true cmd/workspace/model-versions/model-versions.go linguist-generated=true cmd/workspace/online-tables/online-tables.go linguist-generated=true +cmd/workspace/permission-migration/permission-migration.go linguist-generated=true cmd/workspace/permissions/permissions.go linguist-generated=true cmd/workspace/pipelines/pipelines.go linguist-generated=true cmd/workspace/policy-families/policy-families.go linguist-generated=true @@ -68,6 +76,7 @@ cmd/workspace/recipient-activation/recipient-activation.go linguist-generated=tr cmd/workspace/recipients/recipients.go linguist-generated=true cmd/workspace/registered-models/registered-models.go linguist-generated=true cmd/workspace/repos/repos.go linguist-generated=true +cmd/workspace/restrict-workspace-admins/restrict-workspace-admins.go linguist-generated=true cmd/workspace/schemas/schemas.go linguist-generated=true cmd/workspace/secrets/secrets.go linguist-generated=true cmd/workspace/service-principals/service-principals.go linguist-generated=true diff --git a/bundle/schema/docs/bundle_descriptions.json b/bundle/schema/docs/bundle_descriptions.json index 982dd4eb7f..68db758066 100644 --- a/bundle/schema/docs/bundle_descriptions.json +++ b/bundle/schema/docs/bundle_descriptions.json @@ -193,7 +193,7 @@ "description": "An optional continuous property for this job. The continuous property will ensure that there is always one run executing. Only one of `schedule` and `continuous` can be used.", "properties": { "pause_status": { - "description": "Indicate whether this schedule is paused or not." + "description": "Indicate whether the continuous execution of the job is paused or not. Defaults to UNPAUSED." } } }, @@ -322,7 +322,7 @@ "description": "A unique name for the job cluster. This field is required and must be unique within the job.\n`JobTaskSettings` may refer to this field to determine which cluster to launch for the task execution." }, "new_cluster": { - "description": "If new_cluster, a description of a cluster that is created for only for this task.", + "description": "If new_cluster, a description of a cluster that is created for each task.", "properties": { "apply_policy_default_values": { "description": "" @@ -351,13 +351,13 @@ "description": "The number of volumes launched for each instance. Users can choose up to 10 volumes.\nThis feature is only enabled for supported node types. Legacy node types cannot specify\ncustom EBS volumes.\nFor node types with no instance store, at least one EBS volume needs to be specified;\notherwise, cluster creation will fail.\n\nThese EBS volumes will be mounted at `/ebs0`, `/ebs1`, and etc.\nInstance store volumes will be mounted at `/local_disk0`, `/local_disk1`, and etc.\n\nIf EBS volumes are attached, Databricks will configure Spark to use only the EBS volumes for\nscratch storage because heterogenously sized scratch devices can lead to inefficient disk\nutilization. If no EBS volumes are attached, Databricks will configure Spark to use instance\nstore volumes.\n\nPlease note that if EBS volumes are specified, then the Spark configuration `spark.local.dir`\nwill be overridden." }, "ebs_volume_iops": { - "description": "\u003cneeds content added\u003e" + "description": "If using gp3 volumes, what IOPS to use for the disk. If this is not set, the maximum performance of a gp2 volume with the same volume size will be used." }, "ebs_volume_size": { "description": "The size of each EBS volume (in GiB) launched for each instance. For general purpose\nSSD, this value must be within the range 100 - 4096. For throughput optimized HDD,\nthis value must be within the range 500 - 4096." }, "ebs_volume_throughput": { - "description": "\u003cneeds content added\u003e" + "description": "If using gp3 volumes, what throughput to use for the disk. If this is not set, the maximum performance of a gp2 volume with the same volume size will be used." }, "ebs_volume_type": { "description": "" @@ -725,7 +725,7 @@ "description": "An optional periodic schedule for this job. The default behavior is that the job only runs when triggered by clicking “Run Now” in the Jobs UI or sending an API request to `runNow`.", "properties": { "pause_status": { - "description": "Indicate whether this schedule is paused or not." + "description": "Indicate whether the continuous execution of the job is paused or not. Defaults to UNPAUSED." }, "quartz_cron_expression": { "description": "A Cron expression using Quartz syntax that describes the schedule for a job.\nSee [Cron Trigger](http://www.quartz-scheduler.org/documentation/quartz-2.3.0/tutorials/crontrigger.html)\nfor details. This field is required.\"\n" @@ -785,7 +785,7 @@ "description": "Optional schema to write to. This parameter is only used when a warehouse_id is also provided. If not provided, the `default` schema is used." }, "source": { - "description": "Optional location type of the project directory. When set to `WORKSPACE`, the project will be retrieved\nfrom the local \u003cDatabricks\u003e workspace. When set to `GIT`, the project will be retrieved from a Git repository\ndefined in `git_source`. If the value is empty, the task will use `GIT` if `git_source` is defined and `WORKSPACE` otherwise.\n\n* `WORKSPACE`: Project is located in \u003cDatabricks\u003e workspace.\n* `GIT`: Project is located in cloud Git provider.\n" + "description": "Optional location type of the SQL file. When set to `WORKSPACE`, the SQL file will be retrieved\nfrom the local \u003cDatabricks\u003e workspace. When set to `GIT`, the SQL file will be retrieved from a Git repository\ndefined in `git_source`. If the value is empty, the task will use `GIT` if `git_source` is defined and `WORKSPACE` otherwise.\n\n* `WORKSPACE`: SQL file is located in \u003cDatabricks\u003e workspace.\n* `GIT`: SQL file is located in cloud Git provider.\n" }, "warehouse_id": { "description": "ID of the SQL warehouse to connect to. If provided, we automatically generate and provide the profile and connection details to dbt. It can be overridden on a per-command basis by using the `--profiles-dir` command line argument." @@ -930,7 +930,7 @@ "description": "An optional minimal interval in milliseconds between the start of the failed run and the subsequent retry run. The default behavior is that unsuccessful runs are immediately retried." }, "new_cluster": { - "description": "If new_cluster, a description of a cluster that is created for only for this task.", + "description": "If new_cluster, a description of a cluster that is created for each task.", "properties": { "apply_policy_default_values": { "description": "" @@ -959,13 +959,13 @@ "description": "The number of volumes launched for each instance. Users can choose up to 10 volumes.\nThis feature is only enabled for supported node types. Legacy node types cannot specify\ncustom EBS volumes.\nFor node types with no instance store, at least one EBS volume needs to be specified;\notherwise, cluster creation will fail.\n\nThese EBS volumes will be mounted at `/ebs0`, `/ebs1`, and etc.\nInstance store volumes will be mounted at `/local_disk0`, `/local_disk1`, and etc.\n\nIf EBS volumes are attached, Databricks will configure Spark to use only the EBS volumes for\nscratch storage because heterogenously sized scratch devices can lead to inefficient disk\nutilization. If no EBS volumes are attached, Databricks will configure Spark to use instance\nstore volumes.\n\nPlease note that if EBS volumes are specified, then the Spark configuration `spark.local.dir`\nwill be overridden." }, "ebs_volume_iops": { - "description": "\u003cneeds content added\u003e" + "description": "If using gp3 volumes, what IOPS to use for the disk. If this is not set, the maximum performance of a gp2 volume with the same volume size will be used." }, "ebs_volume_size": { "description": "The size of each EBS volume (in GiB) launched for each instance. For general purpose\nSSD, this value must be within the range 100 - 4096. For throughput optimized HDD,\nthis value must be within the range 500 - 4096." }, "ebs_volume_throughput": { - "description": "\u003cneeds content added\u003e" + "description": "If using gp3 volumes, what throughput to use for the disk. If this is not set, the maximum performance of a gp2 volume with the same volume size will be used." }, "ebs_volume_type": { "description": "" @@ -1269,7 +1269,7 @@ "description": "The path of the notebook to be run in the Databricks workspace or remote repository.\nFor notebooks stored in the Databricks workspace, the path must be absolute and begin with a slash.\nFor notebooks stored in a remote repository, the path must be relative. This field is required.\n" }, "source": { - "description": "Optional location type of the project directory. When set to `WORKSPACE`, the project will be retrieved\nfrom the local \u003cDatabricks\u003e workspace. When set to `GIT`, the project will be retrieved from a Git repository\ndefined in `git_source`. If the value is empty, the task will use `GIT` if `git_source` is defined and `WORKSPACE` otherwise.\n\n* `WORKSPACE`: Project is located in \u003cDatabricks\u003e workspace.\n* `GIT`: Project is located in cloud Git provider.\n" + "description": "Optional location type of the SQL file. When set to `WORKSPACE`, the SQL file will be retrieved\nfrom the local \u003cDatabricks\u003e workspace. When set to `GIT`, the SQL file will be retrieved from a Git repository\ndefined in `git_source`. If the value is empty, the task will use `GIT` if `git_source` is defined and `WORKSPACE` otherwise.\n\n* `WORKSPACE`: SQL file is located in \u003cDatabricks\u003e workspace.\n* `GIT`: SQL file is located in cloud Git provider.\n" } } }, @@ -1371,7 +1371,7 @@ "description": "The Python file to be executed. Cloud file URIs (such as dbfs:/, s3:/, adls:/, gcs:/) and workspace paths are supported. For python files stored in the Databricks workspace, the path must be absolute and begin with `/`. For files stored in a remote repository, the path must be relative. This field is required." }, "source": { - "description": "Optional location type of the project directory. When set to `WORKSPACE`, the project will be retrieved\nfrom the local \u003cDatabricks\u003e workspace. When set to `GIT`, the project will be retrieved from a Git repository\ndefined in `git_source`. If the value is empty, the task will use `GIT` if `git_source` is defined and `WORKSPACE` otherwise.\n\n* `WORKSPACE`: Project is located in \u003cDatabricks\u003e workspace.\n* `GIT`: Project is located in cloud Git provider.\n" + "description": "Optional location type of the SQL file. When set to `WORKSPACE`, the SQL file will be retrieved\nfrom the local \u003cDatabricks\u003e workspace. When set to `GIT`, the SQL file will be retrieved from a Git repository\ndefined in `git_source`. If the value is empty, the task will use `GIT` if `git_source` is defined and `WORKSPACE` otherwise.\n\n* `WORKSPACE`: SQL file is located in \u003cDatabricks\u003e workspace.\n* `GIT`: SQL file is located in cloud Git provider.\n" } } }, @@ -1449,7 +1449,7 @@ "description": "Path of the SQL file. Must be relative if the source is a remote Git repository and absolute for workspace paths." }, "source": { - "description": "Optional location type of the project directory. When set to `WORKSPACE`, the project will be retrieved\nfrom the local \u003cDatabricks\u003e workspace. When set to `GIT`, the project will be retrieved from a Git repository\ndefined in `git_source`. If the value is empty, the task will use `GIT` if `git_source` is defined and `WORKSPACE` otherwise.\n\n* `WORKSPACE`: Project is located in \u003cDatabricks\u003e workspace.\n* `GIT`: Project is located in cloud Git provider.\n" + "description": "Optional location type of the SQL file. When set to `WORKSPACE`, the SQL file will be retrieved\nfrom the local \u003cDatabricks\u003e workspace. When set to `GIT`, the SQL file will be retrieved from a Git repository\ndefined in `git_source`. If the value is empty, the task will use `GIT` if `git_source` is defined and `WORKSPACE` otherwise.\n\n* `WORKSPACE`: SQL file is located in \u003cDatabricks\u003e workspace.\n* `GIT`: SQL file is located in cloud Git provider.\n" } } }, @@ -1551,7 +1551,7 @@ } }, "pause_status": { - "description": "Indicate whether this schedule is paused or not." + "description": "Indicate whether the continuous execution of the job is paused or not. Defaults to UNPAUSED." }, "table": { "description": "Table trigger settings.", @@ -2061,13 +2061,13 @@ "description": "The number of volumes launched for each instance. Users can choose up to 10 volumes.\nThis feature is only enabled for supported node types. Legacy node types cannot specify\ncustom EBS volumes.\nFor node types with no instance store, at least one EBS volume needs to be specified;\notherwise, cluster creation will fail.\n\nThese EBS volumes will be mounted at `/ebs0`, `/ebs1`, and etc.\nInstance store volumes will be mounted at `/local_disk0`, `/local_disk1`, and etc.\n\nIf EBS volumes are attached, Databricks will configure Spark to use only the EBS volumes for\nscratch storage because heterogenously sized scratch devices can lead to inefficient disk\nutilization. If no EBS volumes are attached, Databricks will configure Spark to use instance\nstore volumes.\n\nPlease note that if EBS volumes are specified, then the Spark configuration `spark.local.dir`\nwill be overridden." }, "ebs_volume_iops": { - "description": "\u003cneeds content added\u003e" + "description": "If using gp3 volumes, what IOPS to use for the disk. If this is not set, the maximum performance of a gp2 volume with the same volume size will be used." }, "ebs_volume_size": { "description": "The size of each EBS volume (in GiB) launched for each instance. For general purpose\nSSD, this value must be within the range 100 - 4096. For throughput optimized HDD,\nthis value must be within the range 500 - 4096." }, "ebs_volume_throughput": { - "description": "\u003cneeds content added\u003e" + "description": "If using gp3 volumes, what throughput to use for the disk. If this is not set, the maximum performance of a gp2 volume with the same volume size will be used." }, "ebs_volume_type": { "description": "" @@ -2726,7 +2726,7 @@ "description": "An optional continuous property for this job. The continuous property will ensure that there is always one run executing. Only one of `schedule` and `continuous` can be used.", "properties": { "pause_status": { - "description": "Indicate whether this schedule is paused or not." + "description": "Indicate whether the continuous execution of the job is paused or not. Defaults to UNPAUSED." } } }, @@ -2855,7 +2855,7 @@ "description": "A unique name for the job cluster. This field is required and must be unique within the job.\n`JobTaskSettings` may refer to this field to determine which cluster to launch for the task execution." }, "new_cluster": { - "description": "If new_cluster, a description of a cluster that is created for only for this task.", + "description": "If new_cluster, a description of a cluster that is created for each task.", "properties": { "apply_policy_default_values": { "description": "" @@ -2884,13 +2884,13 @@ "description": "The number of volumes launched for each instance. Users can choose up to 10 volumes.\nThis feature is only enabled for supported node types. Legacy node types cannot specify\ncustom EBS volumes.\nFor node types with no instance store, at least one EBS volume needs to be specified;\notherwise, cluster creation will fail.\n\nThese EBS volumes will be mounted at `/ebs0`, `/ebs1`, and etc.\nInstance store volumes will be mounted at `/local_disk0`, `/local_disk1`, and etc.\n\nIf EBS volumes are attached, Databricks will configure Spark to use only the EBS volumes for\nscratch storage because heterogenously sized scratch devices can lead to inefficient disk\nutilization. If no EBS volumes are attached, Databricks will configure Spark to use instance\nstore volumes.\n\nPlease note that if EBS volumes are specified, then the Spark configuration `spark.local.dir`\nwill be overridden." }, "ebs_volume_iops": { - "description": "\u003cneeds content added\u003e" + "description": "If using gp3 volumes, what IOPS to use for the disk. If this is not set, the maximum performance of a gp2 volume with the same volume size will be used." }, "ebs_volume_size": { "description": "The size of each EBS volume (in GiB) launched for each instance. For general purpose\nSSD, this value must be within the range 100 - 4096. For throughput optimized HDD,\nthis value must be within the range 500 - 4096." }, "ebs_volume_throughput": { - "description": "\u003cneeds content added\u003e" + "description": "If using gp3 volumes, what throughput to use for the disk. If this is not set, the maximum performance of a gp2 volume with the same volume size will be used." }, "ebs_volume_type": { "description": "" @@ -3258,7 +3258,7 @@ "description": "An optional periodic schedule for this job. The default behavior is that the job only runs when triggered by clicking “Run Now” in the Jobs UI or sending an API request to `runNow`.", "properties": { "pause_status": { - "description": "Indicate whether this schedule is paused or not." + "description": "Indicate whether the continuous execution of the job is paused or not. Defaults to UNPAUSED." }, "quartz_cron_expression": { "description": "A Cron expression using Quartz syntax that describes the schedule for a job.\nSee [Cron Trigger](http://www.quartz-scheduler.org/documentation/quartz-2.3.0/tutorials/crontrigger.html)\nfor details. This field is required.\"\n" @@ -3318,7 +3318,7 @@ "description": "Optional schema to write to. This parameter is only used when a warehouse_id is also provided. If not provided, the `default` schema is used." }, "source": { - "description": "Optional location type of the project directory. When set to `WORKSPACE`, the project will be retrieved\nfrom the local \u003cDatabricks\u003e workspace. When set to `GIT`, the project will be retrieved from a Git repository\ndefined in `git_source`. If the value is empty, the task will use `GIT` if `git_source` is defined and `WORKSPACE` otherwise.\n\n* `WORKSPACE`: Project is located in \u003cDatabricks\u003e workspace.\n* `GIT`: Project is located in cloud Git provider.\n" + "description": "Optional location type of the SQL file. When set to `WORKSPACE`, the SQL file will be retrieved\nfrom the local \u003cDatabricks\u003e workspace. When set to `GIT`, the SQL file will be retrieved from a Git repository\ndefined in `git_source`. If the value is empty, the task will use `GIT` if `git_source` is defined and `WORKSPACE` otherwise.\n\n* `WORKSPACE`: SQL file is located in \u003cDatabricks\u003e workspace.\n* `GIT`: SQL file is located in cloud Git provider.\n" }, "warehouse_id": { "description": "ID of the SQL warehouse to connect to. If provided, we automatically generate and provide the profile and connection details to dbt. It can be overridden on a per-command basis by using the `--profiles-dir` command line argument." @@ -3463,7 +3463,7 @@ "description": "An optional minimal interval in milliseconds between the start of the failed run and the subsequent retry run. The default behavior is that unsuccessful runs are immediately retried." }, "new_cluster": { - "description": "If new_cluster, a description of a cluster that is created for only for this task.", + "description": "If new_cluster, a description of a cluster that is created for each task.", "properties": { "apply_policy_default_values": { "description": "" @@ -3492,13 +3492,13 @@ "description": "The number of volumes launched for each instance. Users can choose up to 10 volumes.\nThis feature is only enabled for supported node types. Legacy node types cannot specify\ncustom EBS volumes.\nFor node types with no instance store, at least one EBS volume needs to be specified;\notherwise, cluster creation will fail.\n\nThese EBS volumes will be mounted at `/ebs0`, `/ebs1`, and etc.\nInstance store volumes will be mounted at `/local_disk0`, `/local_disk1`, and etc.\n\nIf EBS volumes are attached, Databricks will configure Spark to use only the EBS volumes for\nscratch storage because heterogenously sized scratch devices can lead to inefficient disk\nutilization. If no EBS volumes are attached, Databricks will configure Spark to use instance\nstore volumes.\n\nPlease note that if EBS volumes are specified, then the Spark configuration `spark.local.dir`\nwill be overridden." }, "ebs_volume_iops": { - "description": "\u003cneeds content added\u003e" + "description": "If using gp3 volumes, what IOPS to use for the disk. If this is not set, the maximum performance of a gp2 volume with the same volume size will be used." }, "ebs_volume_size": { "description": "The size of each EBS volume (in GiB) launched for each instance. For general purpose\nSSD, this value must be within the range 100 - 4096. For throughput optimized HDD,\nthis value must be within the range 500 - 4096." }, "ebs_volume_throughput": { - "description": "\u003cneeds content added\u003e" + "description": "If using gp3 volumes, what throughput to use for the disk. If this is not set, the maximum performance of a gp2 volume with the same volume size will be used." }, "ebs_volume_type": { "description": "" @@ -3802,7 +3802,7 @@ "description": "The path of the notebook to be run in the Databricks workspace or remote repository.\nFor notebooks stored in the Databricks workspace, the path must be absolute and begin with a slash.\nFor notebooks stored in a remote repository, the path must be relative. This field is required.\n" }, "source": { - "description": "Optional location type of the project directory. When set to `WORKSPACE`, the project will be retrieved\nfrom the local \u003cDatabricks\u003e workspace. When set to `GIT`, the project will be retrieved from a Git repository\ndefined in `git_source`. If the value is empty, the task will use `GIT` if `git_source` is defined and `WORKSPACE` otherwise.\n\n* `WORKSPACE`: Project is located in \u003cDatabricks\u003e workspace.\n* `GIT`: Project is located in cloud Git provider.\n" + "description": "Optional location type of the SQL file. When set to `WORKSPACE`, the SQL file will be retrieved\nfrom the local \u003cDatabricks\u003e workspace. When set to `GIT`, the SQL file will be retrieved from a Git repository\ndefined in `git_source`. If the value is empty, the task will use `GIT` if `git_source` is defined and `WORKSPACE` otherwise.\n\n* `WORKSPACE`: SQL file is located in \u003cDatabricks\u003e workspace.\n* `GIT`: SQL file is located in cloud Git provider.\n" } } }, @@ -3904,7 +3904,7 @@ "description": "The Python file to be executed. Cloud file URIs (such as dbfs:/, s3:/, adls:/, gcs:/) and workspace paths are supported. For python files stored in the Databricks workspace, the path must be absolute and begin with `/`. For files stored in a remote repository, the path must be relative. This field is required." }, "source": { - "description": "Optional location type of the project directory. When set to `WORKSPACE`, the project will be retrieved\nfrom the local \u003cDatabricks\u003e workspace. When set to `GIT`, the project will be retrieved from a Git repository\ndefined in `git_source`. If the value is empty, the task will use `GIT` if `git_source` is defined and `WORKSPACE` otherwise.\n\n* `WORKSPACE`: Project is located in \u003cDatabricks\u003e workspace.\n* `GIT`: Project is located in cloud Git provider.\n" + "description": "Optional location type of the SQL file. When set to `WORKSPACE`, the SQL file will be retrieved\nfrom the local \u003cDatabricks\u003e workspace. When set to `GIT`, the SQL file will be retrieved from a Git repository\ndefined in `git_source`. If the value is empty, the task will use `GIT` if `git_source` is defined and `WORKSPACE` otherwise.\n\n* `WORKSPACE`: SQL file is located in \u003cDatabricks\u003e workspace.\n* `GIT`: SQL file is located in cloud Git provider.\n" } } }, @@ -3982,7 +3982,7 @@ "description": "Path of the SQL file. Must be relative if the source is a remote Git repository and absolute for workspace paths." }, "source": { - "description": "Optional location type of the project directory. When set to `WORKSPACE`, the project will be retrieved\nfrom the local \u003cDatabricks\u003e workspace. When set to `GIT`, the project will be retrieved from a Git repository\ndefined in `git_source`. If the value is empty, the task will use `GIT` if `git_source` is defined and `WORKSPACE` otherwise.\n\n* `WORKSPACE`: Project is located in \u003cDatabricks\u003e workspace.\n* `GIT`: Project is located in cloud Git provider.\n" + "description": "Optional location type of the SQL file. When set to `WORKSPACE`, the SQL file will be retrieved\nfrom the local \u003cDatabricks\u003e workspace. When set to `GIT`, the SQL file will be retrieved from a Git repository\ndefined in `git_source`. If the value is empty, the task will use `GIT` if `git_source` is defined and `WORKSPACE` otherwise.\n\n* `WORKSPACE`: SQL file is located in \u003cDatabricks\u003e workspace.\n* `GIT`: SQL file is located in cloud Git provider.\n" } } }, @@ -4084,7 +4084,7 @@ } }, "pause_status": { - "description": "Indicate whether this schedule is paused or not." + "description": "Indicate whether the continuous execution of the job is paused or not. Defaults to UNPAUSED." }, "table": { "description": "Table trigger settings.", @@ -4594,13 +4594,13 @@ "description": "The number of volumes launched for each instance. Users can choose up to 10 volumes.\nThis feature is only enabled for supported node types. Legacy node types cannot specify\ncustom EBS volumes.\nFor node types with no instance store, at least one EBS volume needs to be specified;\notherwise, cluster creation will fail.\n\nThese EBS volumes will be mounted at `/ebs0`, `/ebs1`, and etc.\nInstance store volumes will be mounted at `/local_disk0`, `/local_disk1`, and etc.\n\nIf EBS volumes are attached, Databricks will configure Spark to use only the EBS volumes for\nscratch storage because heterogenously sized scratch devices can lead to inefficient disk\nutilization. If no EBS volumes are attached, Databricks will configure Spark to use instance\nstore volumes.\n\nPlease note that if EBS volumes are specified, then the Spark configuration `spark.local.dir`\nwill be overridden." }, "ebs_volume_iops": { - "description": "\u003cneeds content added\u003e" + "description": "If using gp3 volumes, what IOPS to use for the disk. If this is not set, the maximum performance of a gp2 volume with the same volume size will be used." }, "ebs_volume_size": { "description": "The size of each EBS volume (in GiB) launched for each instance. For general purpose\nSSD, this value must be within the range 100 - 4096. For throughput optimized HDD,\nthis value must be within the range 500 - 4096." }, "ebs_volume_throughput": { - "description": "\u003cneeds content added\u003e" + "description": "If using gp3 volumes, what throughput to use for the disk. If this is not set, the maximum performance of a gp2 volume with the same volume size will be used." }, "ebs_volume_type": { "description": "" diff --git a/cmd/account/budgets/budgets.go b/cmd/account/budgets/budgets.go index dfa2f6bc4c..215ba8f0ce 100755 --- a/cmd/account/budgets/budgets.go +++ b/cmd/account/budgets/budgets.go @@ -155,11 +155,11 @@ func newDelete() *cobra.Command { } deleteReq.BudgetId = args[0] - err = a.Budgets.Delete(ctx, deleteReq) + response, err := a.Budgets.Delete(ctx, deleteReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -353,11 +353,11 @@ func newUpdate() *cobra.Command { } updateReq.BudgetId = args[0] - err = a.Budgets.Update(ctx, updateReq) + response, err := a.Budgets.Update(ctx, updateReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. diff --git a/cmd/account/cmd.go b/cmd/account/cmd.go index 627d6d5906..795bbc1810 100644 --- a/cmd/account/cmd.go +++ b/cmd/account/cmd.go @@ -9,8 +9,10 @@ import ( billable_usage "github.com/databricks/cli/cmd/account/billable-usage" budgets "github.com/databricks/cli/cmd/account/budgets" credentials "github.com/databricks/cli/cmd/account/credentials" + csp_enablement_account "github.com/databricks/cli/cmd/account/csp-enablement-account" custom_app_integration "github.com/databricks/cli/cmd/account/custom-app-integration" encryption_keys "github.com/databricks/cli/cmd/account/encryption-keys" + esm_enablement_account "github.com/databricks/cli/cmd/account/esm-enablement-account" account_groups "github.com/databricks/cli/cmd/account/groups" account_ip_access_lists "github.com/databricks/cli/cmd/account/ip-access-lists" log_delivery "github.com/databricks/cli/cmd/account/log-delivery" @@ -19,6 +21,7 @@ import ( network_connectivity "github.com/databricks/cli/cmd/account/network-connectivity" networks "github.com/databricks/cli/cmd/account/networks" o_auth_published_apps "github.com/databricks/cli/cmd/account/o-auth-published-apps" + personal_compute "github.com/databricks/cli/cmd/account/personal-compute" private_access "github.com/databricks/cli/cmd/account/private-access" published_app_integration "github.com/databricks/cli/cmd/account/published-app-integration" service_principal_secrets "github.com/databricks/cli/cmd/account/service-principal-secrets" @@ -41,8 +44,10 @@ func New() *cobra.Command { cmd.AddCommand(account_access_control.New()) cmd.AddCommand(billable_usage.New()) cmd.AddCommand(budgets.New()) + cmd.AddCommand(csp_enablement_account.New()) cmd.AddCommand(credentials.New()) cmd.AddCommand(custom_app_integration.New()) + cmd.AddCommand(esm_enablement_account.New()) cmd.AddCommand(encryption_keys.New()) cmd.AddCommand(account_groups.New()) cmd.AddCommand(account_ip_access_lists.New()) @@ -52,6 +57,7 @@ func New() *cobra.Command { cmd.AddCommand(network_connectivity.New()) cmd.AddCommand(networks.New()) cmd.AddCommand(o_auth_published_apps.New()) + cmd.AddCommand(personal_compute.New()) cmd.AddCommand(private_access.New()) cmd.AddCommand(published_app_integration.New()) cmd.AddCommand(service_principal_secrets.New()) diff --git a/cmd/account/credentials/credentials.go b/cmd/account/credentials/credentials.go index 72fcd70bd1..38167cf6b5 100755 --- a/cmd/account/credentials/credentials.go +++ b/cmd/account/credentials/credentials.go @@ -170,11 +170,11 @@ func newDelete() *cobra.Command { } deleteReq.CredentialsId = args[0] - err = a.Credentials.Delete(ctx, deleteReq) + response, err := a.Credentials.Delete(ctx, deleteReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. diff --git a/cmd/account/csp-enablement-account/csp-enablement-account.go b/cmd/account/csp-enablement-account/csp-enablement-account.go new file mode 100755 index 0000000000..4fb26cac51 --- /dev/null +++ b/cmd/account/csp-enablement-account/csp-enablement-account.go @@ -0,0 +1,171 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package csp_enablement_account + +import ( + "fmt" + + "github.com/databricks/cli/cmd/root" + "github.com/databricks/cli/libs/cmdio" + "github.com/databricks/cli/libs/flags" + "github.com/databricks/databricks-sdk-go/service/settings" + "github.com/spf13/cobra" +) + +// Slice with functions to override default command behavior. +// Functions can be added from the `init()` function in manually curated files in this directory. +var cmdOverrides []func(*cobra.Command) + +func New() *cobra.Command { + cmd := &cobra.Command{ + Use: "csp-enablement-account", + Short: `The compliance security profile settings at the account level control whether to enable it for new workspaces.`, + Long: `The compliance security profile settings at the account level control whether + to enable it for new workspaces. By default, this account-level setting is + disabled for new workspaces. After workspace creation, account admins can + enable the compliance security profile individually for each workspace. + + This settings can be disabled so that new workspaces do not have compliance + security profile enabled by default.`, + GroupID: "settings", + Annotations: map[string]string{ + "package": "settings", + }, + } + + // Apply optional overrides to this command. + for _, fn := range cmdOverrides { + fn(cmd) + } + + return cmd +} + +// start get command + +// Slice with functions to override default command behavior. +// Functions can be added from the `init()` function in manually curated files in this directory. +var getOverrides []func( + *cobra.Command, + *settings.GetCspEnablementAccountRequest, +) + +func newGet() *cobra.Command { + cmd := &cobra.Command{} + + var getReq settings.GetCspEnablementAccountRequest + + // TODO: short flags + + cmd.Flags().StringVar(&getReq.Etag, "etag", getReq.Etag, `etag used for versioning.`) + + cmd.Use = "get" + cmd.Short = `Get the compliance security profile setting for new workspaces.` + cmd.Long = `Get the compliance security profile setting for new workspaces. + + Gets the compliance security profile setting for new workspaces.` + + cmd.Annotations = make(map[string]string) + + cmd.Args = func(cmd *cobra.Command, args []string) error { + check := cobra.ExactArgs(0) + return check(cmd, args) + } + + cmd.PreRunE = root.MustAccountClient + cmd.RunE = func(cmd *cobra.Command, args []string) (err error) { + ctx := cmd.Context() + a := root.AccountClient(ctx) + + response, err := a.CspEnablementAccount.Get(ctx, getReq) + if err != nil { + return err + } + return cmdio.Render(ctx, response) + } + + // Disable completions since they are not applicable. + // Can be overridden by manual implementation in `override.go`. + cmd.ValidArgsFunction = cobra.NoFileCompletions + + // Apply optional overrides to this command. + for _, fn := range getOverrides { + fn(cmd, &getReq) + } + + return cmd +} + +func init() { + cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { + cmd.AddCommand(newGet()) + }) +} + +// start update command + +// Slice with functions to override default command behavior. +// Functions can be added from the `init()` function in manually curated files in this directory. +var updateOverrides []func( + *cobra.Command, + *settings.UpdateCspEnablementAccountSettingRequest, +) + +func newUpdate() *cobra.Command { + cmd := &cobra.Command{} + + var updateReq settings.UpdateCspEnablementAccountSettingRequest + var updateJson flags.JsonFlag + + // TODO: short flags + cmd.Flags().Var(&updateJson, "json", `either inline JSON string or @path/to/file.json with request body`) + + cmd.Use = "update" + cmd.Short = `Update the compliance security profile setting for new workspaces.` + cmd.Long = `Update the compliance security profile setting for new workspaces. + + Updates the value of the compliance security profile setting for new + workspaces.` + + cmd.Annotations = make(map[string]string) + + cmd.PreRunE = root.MustAccountClient + cmd.RunE = func(cmd *cobra.Command, args []string) (err error) { + ctx := cmd.Context() + a := root.AccountClient(ctx) + + if cmd.Flags().Changed("json") { + err = updateJson.Unmarshal(&updateReq) + if err != nil { + return err + } + } else { + return fmt.Errorf("please provide command input in JSON format by specifying the --json flag") + } + + response, err := a.CspEnablementAccount.Update(ctx, updateReq) + if err != nil { + return err + } + return cmdio.Render(ctx, response) + } + + // Disable completions since they are not applicable. + // Can be overridden by manual implementation in `override.go`. + cmd.ValidArgsFunction = cobra.NoFileCompletions + + // Apply optional overrides to this command. + for _, fn := range updateOverrides { + fn(cmd, &updateReq) + } + + return cmd +} + +func init() { + cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { + cmd.AddCommand(newUpdate()) + }) +} + +// end service CSPEnablementAccount diff --git a/cmd/account/custom-app-integration/custom-app-integration.go b/cmd/account/custom-app-integration/custom-app-integration.go index 79c0f8373f..bfddb9d199 100755 --- a/cmd/account/custom-app-integration/custom-app-integration.go +++ b/cmd/account/custom-app-integration/custom-app-integration.go @@ -149,11 +149,11 @@ func newDelete() *cobra.Command { deleteReq.IntegrationId = args[0] - err = a.CustomAppIntegration.Delete(ctx, deleteReq) + response, err := a.CustomAppIntegration.Delete(ctx, deleteReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -335,11 +335,11 @@ func newUpdate() *cobra.Command { } updateReq.IntegrationId = args[0] - err = a.CustomAppIntegration.Update(ctx, updateReq) + response, err := a.CustomAppIntegration.Update(ctx, updateReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. diff --git a/cmd/account/encryption-keys/encryption-keys.go b/cmd/account/encryption-keys/encryption-keys.go index 3977f58375..b849a1d43f 100755 --- a/cmd/account/encryption-keys/encryption-keys.go +++ b/cmd/account/encryption-keys/encryption-keys.go @@ -174,11 +174,11 @@ func newDelete() *cobra.Command { deleteReq.CustomerManagedKeyId = args[0] - err = a.EncryptionKeys.Delete(ctx, deleteReq) + response, err := a.EncryptionKeys.Delete(ctx, deleteReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. diff --git a/cmd/account/esm-enablement-account/esm-enablement-account.go b/cmd/account/esm-enablement-account/esm-enablement-account.go new file mode 100755 index 0000000000..fc488e20f7 --- /dev/null +++ b/cmd/account/esm-enablement-account/esm-enablement-account.go @@ -0,0 +1,169 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package esm_enablement_account + +import ( + "fmt" + + "github.com/databricks/cli/cmd/root" + "github.com/databricks/cli/libs/cmdio" + "github.com/databricks/cli/libs/flags" + "github.com/databricks/databricks-sdk-go/service/settings" + "github.com/spf13/cobra" +) + +// Slice with functions to override default command behavior. +// Functions can be added from the `init()` function in manually curated files in this directory. +var cmdOverrides []func(*cobra.Command) + +func New() *cobra.Command { + cmd := &cobra.Command{ + Use: "esm-enablement-account", + Short: `The enhanced security monitoring setting at the account level controls whether to enable the feature on new workspaces.`, + Long: `The enhanced security monitoring setting at the account level controls whether + to enable the feature on new workspaces. By default, this account-level + setting is disabled for new workspaces. After workspace creation, account + admins can enable enhanced security monitoring individually for each + workspace.`, + GroupID: "settings", + Annotations: map[string]string{ + "package": "settings", + }, + } + + // Apply optional overrides to this command. + for _, fn := range cmdOverrides { + fn(cmd) + } + + return cmd +} + +// start get command + +// Slice with functions to override default command behavior. +// Functions can be added from the `init()` function in manually curated files in this directory. +var getOverrides []func( + *cobra.Command, + *settings.GetEsmEnablementAccountRequest, +) + +func newGet() *cobra.Command { + cmd := &cobra.Command{} + + var getReq settings.GetEsmEnablementAccountRequest + + // TODO: short flags + + cmd.Flags().StringVar(&getReq.Etag, "etag", getReq.Etag, `etag used for versioning.`) + + cmd.Use = "get" + cmd.Short = `Get the enhanced security monitoring setting for new workspaces.` + cmd.Long = `Get the enhanced security monitoring setting for new workspaces. + + Gets the enhanced security monitoring setting for new workspaces.` + + cmd.Annotations = make(map[string]string) + + cmd.Args = func(cmd *cobra.Command, args []string) error { + check := cobra.ExactArgs(0) + return check(cmd, args) + } + + cmd.PreRunE = root.MustAccountClient + cmd.RunE = func(cmd *cobra.Command, args []string) (err error) { + ctx := cmd.Context() + a := root.AccountClient(ctx) + + response, err := a.EsmEnablementAccount.Get(ctx, getReq) + if err != nil { + return err + } + return cmdio.Render(ctx, response) + } + + // Disable completions since they are not applicable. + // Can be overridden by manual implementation in `override.go`. + cmd.ValidArgsFunction = cobra.NoFileCompletions + + // Apply optional overrides to this command. + for _, fn := range getOverrides { + fn(cmd, &getReq) + } + + return cmd +} + +func init() { + cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { + cmd.AddCommand(newGet()) + }) +} + +// start update command + +// Slice with functions to override default command behavior. +// Functions can be added from the `init()` function in manually curated files in this directory. +var updateOverrides []func( + *cobra.Command, + *settings.UpdateEsmEnablementAccountSettingRequest, +) + +func newUpdate() *cobra.Command { + cmd := &cobra.Command{} + + var updateReq settings.UpdateEsmEnablementAccountSettingRequest + var updateJson flags.JsonFlag + + // TODO: short flags + cmd.Flags().Var(&updateJson, "json", `either inline JSON string or @path/to/file.json with request body`) + + cmd.Use = "update" + cmd.Short = `Update the enhanced security monitoring setting for new workspaces.` + cmd.Long = `Update the enhanced security monitoring setting for new workspaces. + + Updates the value of the enhanced security monitoring setting for new + workspaces.` + + cmd.Annotations = make(map[string]string) + + cmd.PreRunE = root.MustAccountClient + cmd.RunE = func(cmd *cobra.Command, args []string) (err error) { + ctx := cmd.Context() + a := root.AccountClient(ctx) + + if cmd.Flags().Changed("json") { + err = updateJson.Unmarshal(&updateReq) + if err != nil { + return err + } + } else { + return fmt.Errorf("please provide command input in JSON format by specifying the --json flag") + } + + response, err := a.EsmEnablementAccount.Update(ctx, updateReq) + if err != nil { + return err + } + return cmdio.Render(ctx, response) + } + + // Disable completions since they are not applicable. + // Can be overridden by manual implementation in `override.go`. + cmd.ValidArgsFunction = cobra.NoFileCompletions + + // Apply optional overrides to this command. + for _, fn := range updateOverrides { + fn(cmd, &updateReq) + } + + return cmd +} + +func init() { + cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { + cmd.AddCommand(newUpdate()) + }) +} + +// end service ESMEnablementAccount diff --git a/cmd/account/groups/groups.go b/cmd/account/groups/groups.go index a068fba45c..324b902322 100755 --- a/cmd/account/groups/groups.go +++ b/cmd/account/groups/groups.go @@ -171,11 +171,11 @@ func newDelete() *cobra.Command { } deleteReq.Id = args[0] - err = a.Groups.Delete(ctx, deleteReq) + response, err := a.Groups.Delete(ctx, deleteReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -398,11 +398,11 @@ func newPatch() *cobra.Command { } patchReq.Id = args[0] - err = a.Groups.Patch(ctx, patchReq) + response, err := a.Groups.Patch(ctx, patchReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -492,11 +492,11 @@ func newUpdate() *cobra.Command { } updateReq.Id = args[0] - err = a.Groups.Update(ctx, updateReq) + response, err := a.Groups.Update(ctx, updateReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. diff --git a/cmd/account/ip-access-lists/ip-access-lists.go b/cmd/account/ip-access-lists/ip-access-lists.go index dd836c90aa..58b5899002 100755 --- a/cmd/account/ip-access-lists/ip-access-lists.go +++ b/cmd/account/ip-access-lists/ip-access-lists.go @@ -215,11 +215,11 @@ func newDelete() *cobra.Command { } deleteReq.IpAccessListId = args[0] - err = a.IpAccessLists.Delete(ctx, deleteReq) + response, err := a.IpAccessLists.Delete(ctx, deleteReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -449,11 +449,11 @@ func newReplace() *cobra.Command { } } - err = a.IpAccessLists.Replace(ctx, replaceReq) + response, err := a.IpAccessLists.Replace(ctx, replaceReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -551,11 +551,11 @@ func newUpdate() *cobra.Command { } updateReq.IpAccessListId = args[0] - err = a.IpAccessLists.Update(ctx, updateReq) + response, err := a.IpAccessLists.Update(ctx, updateReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. diff --git a/cmd/account/log-delivery/log-delivery.go b/cmd/account/log-delivery/log-delivery.go index eed8942b8f..e64c3e4d8b 100755 --- a/cmd/account/log-delivery/log-delivery.go +++ b/cmd/account/log-delivery/log-delivery.go @@ -394,11 +394,11 @@ func newPatchStatus() *cobra.Command { } } - err = a.LogDelivery.PatchStatus(ctx, patchStatusReq) + response, err := a.LogDelivery.PatchStatus(ctx, patchStatusReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. diff --git a/cmd/account/metastore-assignments/metastore-assignments.go b/cmd/account/metastore-assignments/metastore-assignments.go index b1d0508b34..45a3c1d968 100755 --- a/cmd/account/metastore-assignments/metastore-assignments.go +++ b/cmd/account/metastore-assignments/metastore-assignments.go @@ -89,11 +89,11 @@ func newCreate() *cobra.Command { } createReq.MetastoreId = args[1] - err = a.MetastoreAssignments.Create(ctx, createReq) + response, err := a.MetastoreAssignments.Create(ctx, createReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -159,11 +159,11 @@ func newDelete() *cobra.Command { } deleteReq.MetastoreId = args[1] - err = a.MetastoreAssignments.Delete(ctx, deleteReq) + response, err := a.MetastoreAssignments.Delete(ctx, deleteReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -371,11 +371,11 @@ func newUpdate() *cobra.Command { } updateReq.MetastoreId = args[1] - err = a.MetastoreAssignments.Update(ctx, updateReq) + response, err := a.MetastoreAssignments.Update(ctx, updateReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. diff --git a/cmd/account/metastores/metastores.go b/cmd/account/metastores/metastores.go index e8b7c8f702..fac404a6fa 100755 --- a/cmd/account/metastores/metastores.go +++ b/cmd/account/metastores/metastores.go @@ -145,11 +145,11 @@ func newDelete() *cobra.Command { deleteReq.MetastoreId = args[0] - err = a.Metastores.Delete(ctx, deleteReq) + response, err := a.Metastores.Delete(ctx, deleteReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. diff --git a/cmd/account/network-connectivity/network-connectivity.go b/cmd/account/network-connectivity/network-connectivity.go index bfe116f28e..c153f28b9a 100755 --- a/cmd/account/network-connectivity/network-connectivity.go +++ b/cmd/account/network-connectivity/network-connectivity.go @@ -21,14 +21,7 @@ func New() *cobra.Command { Use: "network-connectivity", Short: `These APIs provide configurations for the network connectivity of your workspaces for serverless compute resources.`, Long: `These APIs provide configurations for the network connectivity of your - workspaces for serverless compute resources. This API provides stable subnets - for your workspace so that you can configure your firewalls on your Azure - Storage accounts to allow access from Databricks. You can also use the API to - provision private endpoints for Databricks to privately connect serverless - compute resources to your Azure resources using Azure Private Link. See - [configure serverless secure connectivity]. - - [configure serverless secure connectivity]: https://learn.microsoft.com/azure/databricks/security/network/serverless-network-security`, + workspaces for serverless compute resources.`, GroupID: "settings", Annotations: map[string]string{ "package": "settings", @@ -64,29 +57,14 @@ func newCreateNetworkConnectivityConfiguration() *cobra.Command { cmd.Use = "create-network-connectivity-configuration NAME REGION" cmd.Short = `Create a network connectivity configuration.` cmd.Long = `Create a network connectivity configuration. - - Creates a network connectivity configuration (NCC), which provides stable - Azure service subnets when accessing your Azure Storage accounts. You can also - use a network connectivity configuration to create Databricks-managed private - endpoints so that Databricks serverless compute resources privately access - your resources. - - **IMPORTANT**: After you create the network connectivity configuration, you - must assign one or more workspaces to the new network connectivity - configuration. You can share one network connectivity configuration with - multiple workspaces from the same Azure region within the same Databricks - account. See [configure serverless secure connectivity]. - - [configure serverless secure connectivity]: https://learn.microsoft.com/azure/databricks/security/network/serverless-network-security Arguments: NAME: The name of the network connectivity configuration. The name can contain alphanumeric characters, hyphens, and underscores. The length must be between 3 and 30 characters. The name must match the regular expression ^[0-9a-zA-Z-_]{3,30}$. - REGION: The Azure region for this network connectivity configuration. Only - workspaces in the same Azure region can be attached to this network - connectivity configuration.` + REGION: The region for the network connectivity configuration. Only workspaces in + the same region can be attached to the network connectivity configuration.` cmd.Annotations = make(map[string]string) @@ -285,11 +263,11 @@ func newDeleteNetworkConnectivityConfiguration() *cobra.Command { deleteNetworkConnectivityConfigurationReq.NetworkConnectivityConfigId = args[0] - err = a.NetworkConnectivity.DeleteNetworkConnectivityConfiguration(ctx, deleteNetworkConnectivityConfigurationReq) + response, err := a.NetworkConnectivity.DeleteNetworkConnectivityConfiguration(ctx, deleteNetworkConnectivityConfigurationReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. diff --git a/cmd/account/networks/networks.go b/cmd/account/networks/networks.go index 15586bdc98..2c09e2b10a 100755 --- a/cmd/account/networks/networks.go +++ b/cmd/account/networks/networks.go @@ -181,11 +181,11 @@ func newDelete() *cobra.Command { } deleteReq.NetworkId = args[0] - err = a.Networks.Delete(ctx, deleteReq) + response, err := a.Networks.Delete(ctx, deleteReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. diff --git a/cmd/account/personal-compute/personal-compute.go b/cmd/account/personal-compute/personal-compute.go new file mode 100755 index 0000000000..d0fef1eed5 --- /dev/null +++ b/cmd/account/personal-compute/personal-compute.go @@ -0,0 +1,236 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package personal_compute + +import ( + "fmt" + + "github.com/databricks/cli/cmd/root" + "github.com/databricks/cli/libs/cmdio" + "github.com/databricks/cli/libs/flags" + "github.com/databricks/databricks-sdk-go/service/settings" + "github.com/spf13/cobra" +) + +// Slice with functions to override default command behavior. +// Functions can be added from the `init()` function in manually curated files in this directory. +var cmdOverrides []func(*cobra.Command) + +func New() *cobra.Command { + cmd := &cobra.Command{ + Use: "personal-compute", + Short: `The Personal Compute enablement setting lets you control which users can use the Personal Compute default policy to create compute resources.`, + Long: `The Personal Compute enablement setting lets you control which users can use + the Personal Compute default policy to create compute resources. By default + all users in all workspaces have access (ON), but you can change the setting + to instead let individual workspaces configure access control (DELEGATE). + + There is only one instance of this setting per account. Since this setting has + a default value, this setting is present on all accounts even though it's + never set on a given account. Deletion reverts the value of the setting back + to the default value.`, + GroupID: "settings", + Annotations: map[string]string{ + "package": "settings", + }, + + // This service is being previewed; hide from help output. + Hidden: true, + } + + // Apply optional overrides to this command. + for _, fn := range cmdOverrides { + fn(cmd) + } + + return cmd +} + +// start delete command + +// Slice with functions to override default command behavior. +// Functions can be added from the `init()` function in manually curated files in this directory. +var deleteOverrides []func( + *cobra.Command, + *settings.DeletePersonalComputeRequest, +) + +func newDelete() *cobra.Command { + cmd := &cobra.Command{} + + var deleteReq settings.DeletePersonalComputeRequest + + // TODO: short flags + + cmd.Flags().StringVar(&deleteReq.Etag, "etag", deleteReq.Etag, `etag used for versioning.`) + + cmd.Use = "delete" + cmd.Short = `Delete Personal Compute setting.` + cmd.Long = `Delete Personal Compute setting. + + Reverts back the Personal Compute setting value to default (ON)` + + cmd.Annotations = make(map[string]string) + + cmd.Args = func(cmd *cobra.Command, args []string) error { + check := cobra.ExactArgs(0) + return check(cmd, args) + } + + cmd.PreRunE = root.MustAccountClient + cmd.RunE = func(cmd *cobra.Command, args []string) (err error) { + ctx := cmd.Context() + a := root.AccountClient(ctx) + + response, err := a.PersonalCompute.Delete(ctx, deleteReq) + if err != nil { + return err + } + return cmdio.Render(ctx, response) + } + + // Disable completions since they are not applicable. + // Can be overridden by manual implementation in `override.go`. + cmd.ValidArgsFunction = cobra.NoFileCompletions + + // Apply optional overrides to this command. + for _, fn := range deleteOverrides { + fn(cmd, &deleteReq) + } + + return cmd +} + +func init() { + cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { + cmd.AddCommand(newDelete()) + }) +} + +// start get command + +// Slice with functions to override default command behavior. +// Functions can be added from the `init()` function in manually curated files in this directory. +var getOverrides []func( + *cobra.Command, + *settings.GetPersonalComputeRequest, +) + +func newGet() *cobra.Command { + cmd := &cobra.Command{} + + var getReq settings.GetPersonalComputeRequest + + // TODO: short flags + + cmd.Flags().StringVar(&getReq.Etag, "etag", getReq.Etag, `etag used for versioning.`) + + cmd.Use = "get" + cmd.Short = `Get Personal Compute setting.` + cmd.Long = `Get Personal Compute setting. + + Gets the value of the Personal Compute setting.` + + cmd.Annotations = make(map[string]string) + + cmd.Args = func(cmd *cobra.Command, args []string) error { + check := cobra.ExactArgs(0) + return check(cmd, args) + } + + cmd.PreRunE = root.MustAccountClient + cmd.RunE = func(cmd *cobra.Command, args []string) (err error) { + ctx := cmd.Context() + a := root.AccountClient(ctx) + + response, err := a.PersonalCompute.Get(ctx, getReq) + if err != nil { + return err + } + return cmdio.Render(ctx, response) + } + + // Disable completions since they are not applicable. + // Can be overridden by manual implementation in `override.go`. + cmd.ValidArgsFunction = cobra.NoFileCompletions + + // Apply optional overrides to this command. + for _, fn := range getOverrides { + fn(cmd, &getReq) + } + + return cmd +} + +func init() { + cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { + cmd.AddCommand(newGet()) + }) +} + +// start update command + +// Slice with functions to override default command behavior. +// Functions can be added from the `init()` function in manually curated files in this directory. +var updateOverrides []func( + *cobra.Command, + *settings.UpdatePersonalComputeSettingRequest, +) + +func newUpdate() *cobra.Command { + cmd := &cobra.Command{} + + var updateReq settings.UpdatePersonalComputeSettingRequest + var updateJson flags.JsonFlag + + // TODO: short flags + cmd.Flags().Var(&updateJson, "json", `either inline JSON string or @path/to/file.json with request body`) + + cmd.Use = "update" + cmd.Short = `Update Personal Compute setting.` + cmd.Long = `Update Personal Compute setting. + + Updates the value of the Personal Compute setting.` + + cmd.Annotations = make(map[string]string) + + cmd.PreRunE = root.MustAccountClient + cmd.RunE = func(cmd *cobra.Command, args []string) (err error) { + ctx := cmd.Context() + a := root.AccountClient(ctx) + + if cmd.Flags().Changed("json") { + err = updateJson.Unmarshal(&updateReq) + if err != nil { + return err + } + } else { + return fmt.Errorf("please provide command input in JSON format by specifying the --json flag") + } + + response, err := a.PersonalCompute.Update(ctx, updateReq) + if err != nil { + return err + } + return cmdio.Render(ctx, response) + } + + // Disable completions since they are not applicable. + // Can be overridden by manual implementation in `override.go`. + cmd.ValidArgsFunction = cobra.NoFileCompletions + + // Apply optional overrides to this command. + for _, fn := range updateOverrides { + fn(cmd, &updateReq) + } + + return cmd +} + +func init() { + cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { + cmd.AddCommand(newUpdate()) + }) +} + +// end service PersonalCompute diff --git a/cmd/account/private-access/private-access.go b/cmd/account/private-access/private-access.go index 458ff827e2..7ee9d0d85a 100755 --- a/cmd/account/private-access/private-access.go +++ b/cmd/account/private-access/private-access.go @@ -197,11 +197,11 @@ func newDelete() *cobra.Command { } deleteReq.PrivateAccessSettingsId = args[0] - err = a.PrivateAccess.Delete(ctx, deleteReq) + response, err := a.PrivateAccess.Delete(ctx, deleteReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -441,11 +441,11 @@ func newReplace() *cobra.Command { replaceReq.Region = args[2] } - err = a.PrivateAccess.Replace(ctx, replaceReq) + response, err := a.PrivateAccess.Replace(ctx, replaceReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. diff --git a/cmd/account/published-app-integration/published-app-integration.go b/cmd/account/published-app-integration/published-app-integration.go index 54cf633714..5502aa095b 100755 --- a/cmd/account/published-app-integration/published-app-integration.go +++ b/cmd/account/published-app-integration/published-app-integration.go @@ -149,11 +149,11 @@ func newDelete() *cobra.Command { deleteReq.IntegrationId = args[0] - err = a.PublishedAppIntegration.Delete(ctx, deleteReq) + response, err := a.PublishedAppIntegration.Delete(ctx, deleteReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -334,11 +334,11 @@ func newUpdate() *cobra.Command { } updateReq.IntegrationId = args[0] - err = a.PublishedAppIntegration.Update(ctx, updateReq) + response, err := a.PublishedAppIntegration.Update(ctx, updateReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. diff --git a/cmd/account/service-principal-secrets/service-principal-secrets.go b/cmd/account/service-principal-secrets/service-principal-secrets.go index 1a646e25c3..a62a7b6792 100755 --- a/cmd/account/service-principal-secrets/service-principal-secrets.go +++ b/cmd/account/service-principal-secrets/service-principal-secrets.go @@ -157,11 +157,11 @@ func newDelete() *cobra.Command { } deleteReq.SecretId = args[1] - err = a.ServicePrincipalSecrets.Delete(ctx, deleteReq) + response, err := a.ServicePrincipalSecrets.Delete(ctx, deleteReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. diff --git a/cmd/account/service-principals/service-principals.go b/cmd/account/service-principals/service-principals.go index af18d53415..7ffb7f8bb5 100755 --- a/cmd/account/service-principals/service-principals.go +++ b/cmd/account/service-principals/service-principals.go @@ -169,11 +169,11 @@ func newDelete() *cobra.Command { } deleteReq.Id = args[0] - err = a.ServicePrincipals.Delete(ctx, deleteReq) + response, err := a.ServicePrincipals.Delete(ctx, deleteReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -398,11 +398,11 @@ func newPatch() *cobra.Command { } patchReq.Id = args[0] - err = a.ServicePrincipals.Patch(ctx, patchReq) + response, err := a.ServicePrincipals.Patch(ctx, patchReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -494,11 +494,11 @@ func newUpdate() *cobra.Command { } updateReq.Id = args[0] - err = a.ServicePrincipals.Update(ctx, updateReq) + response, err := a.ServicePrincipals.Update(ctx, updateReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. diff --git a/cmd/account/settings/settings.go b/cmd/account/settings/settings.go index adeda73d9b..4ba3ca780d 100755 --- a/cmd/account/settings/settings.go +++ b/cmd/account/settings/settings.go @@ -3,12 +3,6 @@ package settings import ( - "fmt" - - "github.com/databricks/cli/cmd/root" - "github.com/databricks/cli/libs/cmdio" - "github.com/databricks/cli/libs/flags" - "github.com/databricks/databricks-sdk-go/service/settings" "github.com/spf13/cobra" ) @@ -18,17 +12,9 @@ var cmdOverrides []func(*cobra.Command) func New() *cobra.Command { cmd := &cobra.Command{ - Use: "settings", - Short: `The Personal Compute enablement setting lets you control which users can use the Personal Compute default policy to create compute resources.`, - Long: `The Personal Compute enablement setting lets you control which users can use - the Personal Compute default policy to create compute resources. By default - all users in all workspaces have access (ON), but you can change the setting - to instead let individual workspaces configure access control (DELEGATE). - - There is only one instance of this setting per account. Since this setting has - a default value, this setting is present on all accounts even though it's - never set on a given account. Deletion reverts the value of the setting back - to the default value.`, + Use: "settings", + Short: `Accounts Settings API allows users to manage settings at the account level.`, + Long: `Accounts Settings API allows users to manage settings at the account level.`, GroupID: "settings", Annotations: map[string]string{ "package": "settings", @@ -46,191 +32,4 @@ func New() *cobra.Command { return cmd } -// start delete-personal-compute-setting command - -// Slice with functions to override default command behavior. -// Functions can be added from the `init()` function in manually curated files in this directory. -var deletePersonalComputeSettingOverrides []func( - *cobra.Command, - *settings.DeletePersonalComputeSettingRequest, -) - -func newDeletePersonalComputeSetting() *cobra.Command { - cmd := &cobra.Command{} - - var deletePersonalComputeSettingReq settings.DeletePersonalComputeSettingRequest - - // TODO: short flags - - cmd.Flags().StringVar(&deletePersonalComputeSettingReq.Etag, "etag", deletePersonalComputeSettingReq.Etag, `etag used for versioning.`) - - cmd.Use = "delete-personal-compute-setting" - cmd.Short = `Delete Personal Compute setting.` - cmd.Long = `Delete Personal Compute setting. - - Reverts back the Personal Compute setting value to default (ON)` - - cmd.Annotations = make(map[string]string) - - cmd.Args = func(cmd *cobra.Command, args []string) error { - check := cobra.ExactArgs(0) - return check(cmd, args) - } - - cmd.PreRunE = root.MustAccountClient - cmd.RunE = func(cmd *cobra.Command, args []string) (err error) { - ctx := cmd.Context() - a := root.AccountClient(ctx) - - response, err := a.Settings.DeletePersonalComputeSetting(ctx, deletePersonalComputeSettingReq) - if err != nil { - return err - } - return cmdio.Render(ctx, response) - } - - // Disable completions since they are not applicable. - // Can be overridden by manual implementation in `override.go`. - cmd.ValidArgsFunction = cobra.NoFileCompletions - - // Apply optional overrides to this command. - for _, fn := range deletePersonalComputeSettingOverrides { - fn(cmd, &deletePersonalComputeSettingReq) - } - - return cmd -} - -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDeletePersonalComputeSetting()) - }) -} - -// start get-personal-compute-setting command - -// Slice with functions to override default command behavior. -// Functions can be added from the `init()` function in manually curated files in this directory. -var getPersonalComputeSettingOverrides []func( - *cobra.Command, - *settings.GetPersonalComputeSettingRequest, -) - -func newGetPersonalComputeSetting() *cobra.Command { - cmd := &cobra.Command{} - - var getPersonalComputeSettingReq settings.GetPersonalComputeSettingRequest - - // TODO: short flags - - cmd.Flags().StringVar(&getPersonalComputeSettingReq.Etag, "etag", getPersonalComputeSettingReq.Etag, `etag used for versioning.`) - - cmd.Use = "get-personal-compute-setting" - cmd.Short = `Get Personal Compute setting.` - cmd.Long = `Get Personal Compute setting. - - Gets the value of the Personal Compute setting.` - - cmd.Annotations = make(map[string]string) - - cmd.Args = func(cmd *cobra.Command, args []string) error { - check := cobra.ExactArgs(0) - return check(cmd, args) - } - - cmd.PreRunE = root.MustAccountClient - cmd.RunE = func(cmd *cobra.Command, args []string) (err error) { - ctx := cmd.Context() - a := root.AccountClient(ctx) - - response, err := a.Settings.GetPersonalComputeSetting(ctx, getPersonalComputeSettingReq) - if err != nil { - return err - } - return cmdio.Render(ctx, response) - } - - // Disable completions since they are not applicable. - // Can be overridden by manual implementation in `override.go`. - cmd.ValidArgsFunction = cobra.NoFileCompletions - - // Apply optional overrides to this command. - for _, fn := range getPersonalComputeSettingOverrides { - fn(cmd, &getPersonalComputeSettingReq) - } - - return cmd -} - -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGetPersonalComputeSetting()) - }) -} - -// start update-personal-compute-setting command - -// Slice with functions to override default command behavior. -// Functions can be added from the `init()` function in manually curated files in this directory. -var updatePersonalComputeSettingOverrides []func( - *cobra.Command, - *settings.UpdatePersonalComputeSettingRequest, -) - -func newUpdatePersonalComputeSetting() *cobra.Command { - cmd := &cobra.Command{} - - var updatePersonalComputeSettingReq settings.UpdatePersonalComputeSettingRequest - var updatePersonalComputeSettingJson flags.JsonFlag - - // TODO: short flags - cmd.Flags().Var(&updatePersonalComputeSettingJson, "json", `either inline JSON string or @path/to/file.json with request body`) - - cmd.Use = "update-personal-compute-setting" - cmd.Short = `Update Personal Compute setting.` - cmd.Long = `Update Personal Compute setting. - - Updates the value of the Personal Compute setting.` - - cmd.Annotations = make(map[string]string) - - cmd.PreRunE = root.MustAccountClient - cmd.RunE = func(cmd *cobra.Command, args []string) (err error) { - ctx := cmd.Context() - a := root.AccountClient(ctx) - - if cmd.Flags().Changed("json") { - err = updatePersonalComputeSettingJson.Unmarshal(&updatePersonalComputeSettingReq) - if err != nil { - return err - } - } else { - return fmt.Errorf("please provide command input in JSON format by specifying the --json flag") - } - - response, err := a.Settings.UpdatePersonalComputeSetting(ctx, updatePersonalComputeSettingReq) - if err != nil { - return err - } - return cmdio.Render(ctx, response) - } - - // Disable completions since they are not applicable. - // Can be overridden by manual implementation in `override.go`. - cmd.ValidArgsFunction = cobra.NoFileCompletions - - // Apply optional overrides to this command. - for _, fn := range updatePersonalComputeSettingOverrides { - fn(cmd, &updatePersonalComputeSettingReq) - } - - return cmd -} - -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdatePersonalComputeSetting()) - }) -} - // end service AccountSettings diff --git a/cmd/account/storage-credentials/storage-credentials.go b/cmd/account/storage-credentials/storage-credentials.go index 35b865c7fd..fa1ff10e82 100755 --- a/cmd/account/storage-credentials/storage-credentials.go +++ b/cmd/account/storage-credentials/storage-credentials.go @@ -157,11 +157,11 @@ func newDelete() *cobra.Command { deleteReq.MetastoreId = args[0] deleteReq.StorageCredentialName = args[1] - err = a.StorageCredentials.Delete(ctx, deleteReq) + response, err := a.StorageCredentials.Delete(ctx, deleteReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. diff --git a/cmd/account/storage/storage.go b/cmd/account/storage/storage.go index d671355d6c..b8704b96b3 100755 --- a/cmd/account/storage/storage.go +++ b/cmd/account/storage/storage.go @@ -166,11 +166,11 @@ func newDelete() *cobra.Command { } deleteReq.StorageConfigurationId = args[0] - err = a.Storage.Delete(ctx, deleteReq) + response, err := a.Storage.Delete(ctx, deleteReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. diff --git a/cmd/account/users/users.go b/cmd/account/users/users.go index f5b81f219d..b0ffeb5a7e 100755 --- a/cmd/account/users/users.go +++ b/cmd/account/users/users.go @@ -178,11 +178,11 @@ func newDelete() *cobra.Command { } deleteReq.Id = args[0] - err = a.Users.Delete(ctx, deleteReq) + response, err := a.Users.Delete(ctx, deleteReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -414,11 +414,11 @@ func newPatch() *cobra.Command { } patchReq.Id = args[0] - err = a.Users.Patch(ctx, patchReq) + response, err := a.Users.Patch(ctx, patchReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -511,11 +511,11 @@ func newUpdate() *cobra.Command { } updateReq.Id = args[0] - err = a.Users.Update(ctx, updateReq) + response, err := a.Users.Update(ctx, updateReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. diff --git a/cmd/account/vpc-endpoints/vpc-endpoints.go b/cmd/account/vpc-endpoints/vpc-endpoints.go index 6d80e73141..da8ad7c575 100755 --- a/cmd/account/vpc-endpoints/vpc-endpoints.go +++ b/cmd/account/vpc-endpoints/vpc-endpoints.go @@ -191,11 +191,11 @@ func newDelete() *cobra.Command { } deleteReq.VpcEndpointId = args[0] - err = a.VpcEndpoints.Delete(ctx, deleteReq) + response, err := a.VpcEndpoints.Delete(ctx, deleteReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. diff --git a/cmd/account/workspace-assignment/workspace-assignment.go b/cmd/account/workspace-assignment/workspace-assignment.go index ab82cd39fa..3cc2b8e96f 100755 --- a/cmd/account/workspace-assignment/workspace-assignment.go +++ b/cmd/account/workspace-assignment/workspace-assignment.go @@ -84,11 +84,11 @@ func newDelete() *cobra.Command { return fmt.Errorf("invalid PRINCIPAL_ID: %s", args[1]) } - err = a.WorkspaceAssignment.Delete(ctx, deleteReq) + response, err := a.WorkspaceAssignment.Delete(ctx, deleteReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -299,11 +299,11 @@ func newUpdate() *cobra.Command { return fmt.Errorf("invalid PRINCIPAL_ID: %s", args[1]) } - err = a.WorkspaceAssignment.Update(ctx, updateReq) + response, err := a.WorkspaceAssignment.Update(ctx, updateReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. diff --git a/cmd/account/workspaces/workspaces.go b/cmd/account/workspaces/workspaces.go index 500a7b771c..d728c0e4c9 100755 --- a/cmd/account/workspaces/workspaces.go +++ b/cmd/account/workspaces/workspaces.go @@ -233,11 +233,11 @@ func newDelete() *cobra.Command { return fmt.Errorf("invalid WORKSPACE_ID: %s", args[0]) } - err = a.Workspaces.Delete(ctx, deleteReq) + response, err := a.Workspaces.Delete(ctx, deleteReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -429,7 +429,7 @@ func newUpdate() *cobra.Command { cmd.Flags().StringVar(&updateReq.CredentialsId, "credentials-id", updateReq.CredentialsId, `ID of the workspace's credential configuration object.`) // TODO: map via StringToStringVar: custom_tags cmd.Flags().StringVar(&updateReq.ManagedServicesCustomerManagedKeyId, "managed-services-customer-managed-key-id", updateReq.ManagedServicesCustomerManagedKeyId, `The ID of the workspace's managed services encryption key configuration object.`) - cmd.Flags().StringVar(&updateReq.NetworkConnectivityConfigId, "network-connectivity-config-id", updateReq.NetworkConnectivityConfigId, `The ID of the network connectivity configuration object, which is the parent resource of this private endpoint rule object.`) + cmd.Flags().StringVar(&updateReq.NetworkConnectivityConfigId, "network-connectivity-config-id", updateReq.NetworkConnectivityConfigId, ``) cmd.Flags().StringVar(&updateReq.NetworkId, "network-id", updateReq.NetworkId, `The ID of the workspace's network configuration object.`) cmd.Flags().StringVar(&updateReq.StorageConfigurationId, "storage-configuration-id", updateReq.StorageConfigurationId, `The ID of the workspace's storage configuration object.`) cmd.Flags().StringVar(&updateReq.StorageCustomerManagedKeyId, "storage-customer-managed-key-id", updateReq.StorageCustomerManagedKeyId, `The ID of the key configuration object for workspace storage.`) @@ -464,7 +464,12 @@ func newUpdate() *cobra.Command { workspace to add support for front-end, back-end, or both types of connectivity. You cannot remove (downgrade) any existing front-end or back-end PrivateLink support on a workspace. - Custom tags. Given you provide an empty - custom tags, the update would not be applied. + custom tags, the update would not be applied. - Network connectivity + configuration ID to add serverless stable IP support. You can add or update + the network connectivity configuration ID to ensure the workspace uses the + same set of stable IP CIDR blocks to access your resources. You cannot remove + a network connectivity configuration from the workspace once attached, you can + only switch to another one. After calling the PATCH operation to update the workspace configuration, make repeated GET requests with the workspace ID and check the workspace @@ -476,25 +481,22 @@ func newUpdate() *cobra.Command { ### Update a running workspace You can update a Databricks workspace configuration for running workspaces for some fields, but not all fields. For a running workspace, this request supports updating the following fields only: - - Credential configuration ID - - - Network configuration ID. Used only if you already use a customer-managed - VPC. You cannot convert a running workspace from a Databricks-managed VPC to a - customer-managed VPC. You can use a network configuration update in this API - for a failed or running workspace to add support for PrivateLink, although you - also need to add a private access settings object. - - - Key configuration ID for managed services (control plane storage, such as - notebook source and Databricks SQL queries). Databricks does not directly - encrypt the data with the customer-managed key (CMK). Databricks uses both the - CMK and the Databricks managed key (DMK) that is unique to your workspace to - encrypt the Data Encryption Key (DEK). Databricks uses the DEK to encrypt your - workspace's managed services persisted data. If the workspace does not already - have a CMK for managed services, adding this ID enables managed services - encryption for new or updated data. Existing managed services data that - existed before adding the key remains not encrypted with the DEK until it is - modified. If the workspace already has customer-managed keys for managed - services, this request rotates (changes) the CMK keys and the DEK is + - Credential configuration ID - Network configuration ID. Used only if you + already use a customer-managed VPC. You cannot convert a running workspace + from a Databricks-managed VPC to a customer-managed VPC. You can use a network + configuration update in this API for a failed or running workspace to add + support for PrivateLink, although you also need to add a private access + settings object. - Key configuration ID for managed services (control plane + storage, such as notebook source and Databricks SQL queries). Databricks does + not directly encrypt the data with the customer-managed key (CMK). Databricks + uses both the CMK and the Databricks managed key (DMK) that is unique to your + workspace to encrypt the Data Encryption Key (DEK). Databricks uses the DEK to + encrypt your workspace's managed services persisted data. If the workspace + does not already have a CMK for managed services, adding this ID enables + managed services encryption for new or updated data. Existing managed services + data that existed before adding the key remains not encrypted with the DEK + until it is modified. If the workspace already has customer-managed keys for + managed services, this request rotates (changes) the CMK keys and the DEK is re-encrypted with the DMK and the new CMK. - Key configuration ID for workspace storage (root S3 bucket and, optionally, EBS volumes). You can set this only if the workspace does not already have a customer-managed key @@ -503,7 +505,12 @@ func newUpdate() *cobra.Command { upgrade a workspace to add support for front-end, back-end, or both types of connectivity. You cannot remove (downgrade) any existing front-end or back-end PrivateLink support on a workspace. - Custom tags. Given you provide an empty - custom tags, the update would not be applied. + custom tags, the update would not be applied. - Network connectivity + configuration ID to add serverless stable IP support. You can add or update + the network connectivity configuration ID to ensure the workspace uses the + same set of stable IP CIDR blocks to access your resources. You cannot remove + a network connectivity configuration from the workspace once attached, you can + only switch to another one. **Important**: To update a running workspace, your workspace must have no running compute resources that run in your workspace's VPC in the Classic data @@ -523,11 +530,9 @@ func newUpdate() *cobra.Command { This results in a total of up to 40 minutes in which you cannot create clusters. If you create or use clusters before this time interval elapses, clusters do not launch successfully, fail, or could cause other unexpected - behavior. - - * For workspaces with a customer-managed VPC, the workspace status stays at - status RUNNING and the VPC change happens immediately. A change to the - storage customer-managed key configuration ID might take a few minutes to + behavior. * For workspaces with a customer-managed VPC, the workspace status + stays at status RUNNING and the VPC change happens immediately. A change to + the storage customer-managed key configuration ID might take a few minutes to update, so continue to check the workspace until you observe that it has been updated. If the update fails, the workspace might revert silently to its original configuration. After the workspace has been updated, you cannot use @@ -595,7 +600,7 @@ func newUpdate() *cobra.Command { return err } if updateSkipWait { - return nil + return cmdio.Render(ctx, wait.Response) } spinner := cmdio.Spinner(ctx) info, err := wait.OnProgress(func(i *provisioning.Workspace) { diff --git a/cmd/workspace/alerts/alerts.go b/cmd/workspace/alerts/alerts.go index 773a34876a..70ff68edd2 100755 --- a/cmd/workspace/alerts/alerts.go +++ b/cmd/workspace/alerts/alerts.go @@ -159,11 +159,11 @@ func newDelete() *cobra.Command { } deleteReq.AlertId = args[0] - err = w.Alerts.Delete(ctx, deleteReq) + response, err := w.Alerts.Delete(ctx, deleteReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -353,11 +353,11 @@ func newUpdate() *cobra.Command { } updateReq.AlertId = args[0] - err = w.Alerts.Update(ctx, updateReq) + response, err := w.Alerts.Update(ctx, updateReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. diff --git a/cmd/workspace/apps/apps.go b/cmd/workspace/apps/apps.go index f0bd6acf89..3b08626790 100755 --- a/cmd/workspace/apps/apps.go +++ b/cmd/workspace/apps/apps.go @@ -58,7 +58,7 @@ func newCreate() *cobra.Command { // TODO: short flags cmd.Flags().Var(&createJson, "json", `either inline JSON string or @path/to/file.json with request body`) - // TODO: output-only field + // TODO: any: resources cmd.Use = "create" cmd.Short = `Create and deploy an application.` diff --git a/cmd/workspace/automatic-cluster-update/automatic-cluster-update.go b/cmd/workspace/automatic-cluster-update/automatic-cluster-update.go new file mode 100755 index 0000000000..4bb19cda98 --- /dev/null +++ b/cmd/workspace/automatic-cluster-update/automatic-cluster-update.go @@ -0,0 +1,169 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package automatic_cluster_update + +import ( + "fmt" + + "github.com/databricks/cli/cmd/root" + "github.com/databricks/cli/libs/cmdio" + "github.com/databricks/cli/libs/flags" + "github.com/databricks/databricks-sdk-go/service/settings" + "github.com/spf13/cobra" +) + +// Slice with functions to override default command behavior. +// Functions can be added from the `init()` function in manually curated files in this directory. +var cmdOverrides []func(*cobra.Command) + +func New() *cobra.Command { + cmd := &cobra.Command{ + Use: "automatic-cluster-update", + Short: `Controls whether automatic cluster update is enabled for the current workspace.`, + Long: `Controls whether automatic cluster update is enabled for the current + workspace. By default, it is turned off.`, + GroupID: "settings", + Annotations: map[string]string{ + "package": "settings", + }, + } + + // Apply optional overrides to this command. + for _, fn := range cmdOverrides { + fn(cmd) + } + + return cmd +} + +// start get command + +// Slice with functions to override default command behavior. +// Functions can be added from the `init()` function in manually curated files in this directory. +var getOverrides []func( + *cobra.Command, + *settings.GetAutomaticClusterUpdateRequest, +) + +func newGet() *cobra.Command { + cmd := &cobra.Command{} + + var getReq settings.GetAutomaticClusterUpdateRequest + + // TODO: short flags + + cmd.Flags().StringVar(&getReq.Etag, "etag", getReq.Etag, `etag used for versioning.`) + + cmd.Use = "get" + cmd.Short = `Get the automatic cluster update setting.` + cmd.Long = `Get the automatic cluster update setting. + + Gets the automatic cluster update setting.` + + cmd.Annotations = make(map[string]string) + + cmd.Args = func(cmd *cobra.Command, args []string) error { + check := cobra.ExactArgs(0) + return check(cmd, args) + } + + cmd.PreRunE = root.MustWorkspaceClient + cmd.RunE = func(cmd *cobra.Command, args []string) (err error) { + ctx := cmd.Context() + w := root.WorkspaceClient(ctx) + + response, err := w.AutomaticClusterUpdate.Get(ctx, getReq) + if err != nil { + return err + } + return cmdio.Render(ctx, response) + } + + // Disable completions since they are not applicable. + // Can be overridden by manual implementation in `override.go`. + cmd.ValidArgsFunction = cobra.NoFileCompletions + + // Apply optional overrides to this command. + for _, fn := range getOverrides { + fn(cmd, &getReq) + } + + return cmd +} + +func init() { + cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { + cmd.AddCommand(newGet()) + }) +} + +// start update command + +// Slice with functions to override default command behavior. +// Functions can be added from the `init()` function in manually curated files in this directory. +var updateOverrides []func( + *cobra.Command, + *settings.UpdateAutomaticClusterUpdateSettingRequest, +) + +func newUpdate() *cobra.Command { + cmd := &cobra.Command{} + + var updateReq settings.UpdateAutomaticClusterUpdateSettingRequest + var updateJson flags.JsonFlag + + // TODO: short flags + cmd.Flags().Var(&updateJson, "json", `either inline JSON string or @path/to/file.json with request body`) + + cmd.Use = "update" + cmd.Short = `Update the automatic cluster update setting.` + cmd.Long = `Update the automatic cluster update setting. + + Updates the automatic cluster update setting for the workspace. A fresh etag + needs to be provided in PATCH requests (as part of the setting field). The + etag can be retrieved by making a GET request before the PATCH request. If + the setting is updated concurrently, PATCH fails with 409 and the request + must be retried by using the fresh etag in the 409 response.` + + cmd.Annotations = make(map[string]string) + + cmd.PreRunE = root.MustWorkspaceClient + cmd.RunE = func(cmd *cobra.Command, args []string) (err error) { + ctx := cmd.Context() + w := root.WorkspaceClient(ctx) + + if cmd.Flags().Changed("json") { + err = updateJson.Unmarshal(&updateReq) + if err != nil { + return err + } + } else { + return fmt.Errorf("please provide command input in JSON format by specifying the --json flag") + } + + response, err := w.AutomaticClusterUpdate.Update(ctx, updateReq) + if err != nil { + return err + } + return cmdio.Render(ctx, response) + } + + // Disable completions since they are not applicable. + // Can be overridden by manual implementation in `override.go`. + cmd.ValidArgsFunction = cobra.NoFileCompletions + + // Apply optional overrides to this command. + for _, fn := range updateOverrides { + fn(cmd, &updateReq) + } + + return cmd +} + +func init() { + cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { + cmd.AddCommand(newUpdate()) + }) +} + +// end service AutomaticClusterUpdate diff --git a/cmd/workspace/catalogs/catalogs.go b/cmd/workspace/catalogs/catalogs.go index 8e639023f5..d27566842a 100755 --- a/cmd/workspace/catalogs/catalogs.go +++ b/cmd/workspace/catalogs/catalogs.go @@ -174,11 +174,11 @@ func newDelete() *cobra.Command { deleteReq.Name = args[0] - err = w.Catalogs.Delete(ctx, deleteReq) + response, err := w.Catalogs.Delete(ctx, deleteReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. diff --git a/cmd/workspace/clean-rooms/clean-rooms.go b/cmd/workspace/clean-rooms/clean-rooms.go index 4cee2ce6cf..f69dc59229 100755 --- a/cmd/workspace/clean-rooms/clean-rooms.go +++ b/cmd/workspace/clean-rooms/clean-rooms.go @@ -151,11 +151,11 @@ func newDelete() *cobra.Command { deleteReq.Name = args[0] - err = w.CleanRooms.Delete(ctx, deleteReq) + response, err := w.CleanRooms.Delete(ctx, deleteReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. diff --git a/cmd/workspace/cluster-policies/cluster-policies.go b/cmd/workspace/cluster-policies/cluster-policies.go index f6edee2b3d..41fce23a82 100755 --- a/cmd/workspace/cluster-policies/cluster-policies.go +++ b/cmd/workspace/cluster-policies/cluster-policies.go @@ -218,11 +218,11 @@ func newDelete() *cobra.Command { deleteReq.PolicyId = args[0] } - err = w.ClusterPolicies.Delete(ctx, deleteReq) + response, err := w.ClusterPolicies.Delete(ctx, deleteReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -312,11 +312,11 @@ func newEdit() *cobra.Command { editReq.Name = args[1] } - err = w.ClusterPolicies.Edit(ctx, editReq) + response, err := w.ClusterPolicies.Edit(ctx, editReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. diff --git a/cmd/workspace/clusters/clusters.go b/cmd/workspace/clusters/clusters.go index cf35b28375..ef9034c012 100755 --- a/cmd/workspace/clusters/clusters.go +++ b/cmd/workspace/clusters/clusters.go @@ -124,11 +124,11 @@ func newChangeOwner() *cobra.Command { changeOwnerReq.OwnerUsername = args[1] } - err = w.Clusters.ChangeOwner(ctx, changeOwnerReq) + response, err := w.Clusters.ChangeOwner(ctx, changeOwnerReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -383,7 +383,7 @@ func newDelete() *cobra.Command { return err } if deleteSkipWait { - return nil + return cmdio.Render(ctx, wait.Response) } spinner := cmdio.Spinner(ctx) info, err := wait.OnProgress(func(i *compute.ClusterDetails) { @@ -541,7 +541,7 @@ func newEdit() *cobra.Command { return err } if editSkipWait { - return nil + return cmdio.Render(ctx, wait.Response) } spinner := cmdio.Spinner(ctx) info, err := wait.OnProgress(func(i *compute.ClusterDetails) { @@ -1150,11 +1150,11 @@ func newPermanentDelete() *cobra.Command { permanentDeleteReq.ClusterId = args[0] } - err = w.Clusters.PermanentDelete(ctx, permanentDeleteReq) + response, err := w.Clusters.PermanentDelete(ctx, permanentDeleteReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -1248,11 +1248,11 @@ func newPin() *cobra.Command { pinReq.ClusterId = args[0] } - err = w.Clusters.Pin(ctx, pinReq) + response, err := w.Clusters.Pin(ctx, pinReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -1358,7 +1358,7 @@ func newResize() *cobra.Command { return err } if resizeSkipWait { - return nil + return cmdio.Render(ctx, wait.Response) } spinner := cmdio.Spinner(ctx) info, err := wait.OnProgress(func(i *compute.ClusterDetails) { @@ -1474,7 +1474,7 @@ func newRestart() *cobra.Command { return err } if restartSkipWait { - return nil + return cmdio.Render(ctx, wait.Response) } spinner := cmdio.Spinner(ctx) info, err := wait.OnProgress(func(i *compute.ClusterDetails) { @@ -1730,7 +1730,7 @@ func newStart() *cobra.Command { return err } if startSkipWait { - return nil + return cmdio.Render(ctx, wait.Response) } spinner := cmdio.Spinner(ctx) info, err := wait.OnProgress(func(i *compute.ClusterDetails) { @@ -1835,11 +1835,11 @@ func newUnpin() *cobra.Command { unpinReq.ClusterId = args[0] } - err = w.Clusters.Unpin(ctx, unpinReq) + response, err := w.Clusters.Unpin(ctx, unpinReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. diff --git a/cmd/workspace/cmd.go b/cmd/workspace/cmd.go index e365be7d1e..14fc7428d7 100755 --- a/cmd/workspace/cmd.go +++ b/cmd/workspace/cmd.go @@ -6,16 +6,20 @@ import ( alerts "github.com/databricks/cli/cmd/workspace/alerts" apps "github.com/databricks/cli/cmd/workspace/apps" artifact_allowlists "github.com/databricks/cli/cmd/workspace/artifact-allowlists" + automatic_cluster_update "github.com/databricks/cli/cmd/workspace/automatic-cluster-update" catalogs "github.com/databricks/cli/cmd/workspace/catalogs" clean_rooms "github.com/databricks/cli/cmd/workspace/clean-rooms" cluster_policies "github.com/databricks/cli/cmd/workspace/cluster-policies" clusters "github.com/databricks/cli/cmd/workspace/clusters" connections "github.com/databricks/cli/cmd/workspace/connections" credentials_manager "github.com/databricks/cli/cmd/workspace/credentials-manager" + csp_enablement "github.com/databricks/cli/cmd/workspace/csp-enablement" current_user "github.com/databricks/cli/cmd/workspace/current-user" dashboard_widgets "github.com/databricks/cli/cmd/workspace/dashboard-widgets" dashboards "github.com/databricks/cli/cmd/workspace/dashboards" data_sources "github.com/databricks/cli/cmd/workspace/data-sources" + default_namespace "github.com/databricks/cli/cmd/workspace/default-namespace" + esm_enablement "github.com/databricks/cli/cmd/workspace/esm-enablement" experiments "github.com/databricks/cli/cmd/workspace/experiments" external_locations "github.com/databricks/cli/cmd/workspace/external-locations" functions "github.com/databricks/cli/cmd/workspace/functions" @@ -34,6 +38,7 @@ import ( model_registry "github.com/databricks/cli/cmd/workspace/model-registry" model_versions "github.com/databricks/cli/cmd/workspace/model-versions" online_tables "github.com/databricks/cli/cmd/workspace/online-tables" + permission_migration "github.com/databricks/cli/cmd/workspace/permission-migration" permissions "github.com/databricks/cli/cmd/workspace/permissions" pipelines "github.com/databricks/cli/cmd/workspace/pipelines" policy_families "github.com/databricks/cli/cmd/workspace/policy-families" @@ -45,6 +50,7 @@ import ( recipients "github.com/databricks/cli/cmd/workspace/recipients" registered_models "github.com/databricks/cli/cmd/workspace/registered-models" repos "github.com/databricks/cli/cmd/workspace/repos" + restrict_workspace_admins "github.com/databricks/cli/cmd/workspace/restrict-workspace-admins" schemas "github.com/databricks/cli/cmd/workspace/schemas" secrets "github.com/databricks/cli/cmd/workspace/secrets" service_principals "github.com/databricks/cli/cmd/workspace/service-principals" @@ -74,6 +80,8 @@ func All() []*cobra.Command { out = append(out, alerts.New()) out = append(out, apps.New()) out = append(out, artifact_allowlists.New()) + out = append(out, automatic_cluster_update.New()) + out = append(out, csp_enablement.New()) out = append(out, catalogs.New()) out = append(out, clean_rooms.New()) out = append(out, cluster_policies.New()) @@ -84,6 +92,8 @@ func All() []*cobra.Command { out = append(out, dashboard_widgets.New()) out = append(out, dashboards.New()) out = append(out, data_sources.New()) + out = append(out, default_namespace.New()) + out = append(out, esm_enablement.New()) out = append(out, experiments.New()) out = append(out, external_locations.New()) out = append(out, functions.New()) @@ -102,6 +112,7 @@ func All() []*cobra.Command { out = append(out, model_registry.New()) out = append(out, model_versions.New()) out = append(out, online_tables.New()) + out = append(out, permission_migration.New()) out = append(out, permissions.New()) out = append(out, pipelines.New()) out = append(out, policy_families.New()) @@ -113,6 +124,7 @@ func All() []*cobra.Command { out = append(out, recipients.New()) out = append(out, registered_models.New()) out = append(out, repos.New()) + out = append(out, restrict_workspace_admins.New()) out = append(out, schemas.New()) out = append(out, secrets.New()) out = append(out, service_principals.New()) diff --git a/cmd/workspace/connections/connections.go b/cmd/workspace/connections/connections.go index f740c7789f..b7c324adbb 100755 --- a/cmd/workspace/connections/connections.go +++ b/cmd/workspace/connections/connections.go @@ -169,11 +169,11 @@ func newDelete() *cobra.Command { } deleteReq.Name = args[0] - err = w.Connections.Delete(ctx, deleteReq) + response, err := w.Connections.Delete(ctx, deleteReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. diff --git a/cmd/workspace/csp-enablement/csp-enablement.go b/cmd/workspace/csp-enablement/csp-enablement.go new file mode 100755 index 0000000000..51238de4ba --- /dev/null +++ b/cmd/workspace/csp-enablement/csp-enablement.go @@ -0,0 +1,172 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package csp_enablement + +import ( + "fmt" + + "github.com/databricks/cli/cmd/root" + "github.com/databricks/cli/libs/cmdio" + "github.com/databricks/cli/libs/flags" + "github.com/databricks/databricks-sdk-go/service/settings" + "github.com/spf13/cobra" +) + +// Slice with functions to override default command behavior. +// Functions can be added from the `init()` function in manually curated files in this directory. +var cmdOverrides []func(*cobra.Command) + +func New() *cobra.Command { + cmd := &cobra.Command{ + Use: "csp-enablement", + Short: `Controls whether to enable the compliance security profile for the current workspace.`, + Long: `Controls whether to enable the compliance security profile for the current + workspace. Enabling it on a workspace is permanent. By default, it is turned + off. + + This settings can NOT be disabled once it is enabled.`, + GroupID: "settings", + Annotations: map[string]string{ + "package": "settings", + }, + } + + // Apply optional overrides to this command. + for _, fn := range cmdOverrides { + fn(cmd) + } + + return cmd +} + +// start get command + +// Slice with functions to override default command behavior. +// Functions can be added from the `init()` function in manually curated files in this directory. +var getOverrides []func( + *cobra.Command, + *settings.GetCspEnablementRequest, +) + +func newGet() *cobra.Command { + cmd := &cobra.Command{} + + var getReq settings.GetCspEnablementRequest + + // TODO: short flags + + cmd.Flags().StringVar(&getReq.Etag, "etag", getReq.Etag, `etag used for versioning.`) + + cmd.Use = "get" + cmd.Short = `Get the compliance security profile setting.` + cmd.Long = `Get the compliance security profile setting. + + Gets the compliance security profile setting.` + + cmd.Annotations = make(map[string]string) + + cmd.Args = func(cmd *cobra.Command, args []string) error { + check := cobra.ExactArgs(0) + return check(cmd, args) + } + + cmd.PreRunE = root.MustWorkspaceClient + cmd.RunE = func(cmd *cobra.Command, args []string) (err error) { + ctx := cmd.Context() + w := root.WorkspaceClient(ctx) + + response, err := w.CspEnablement.Get(ctx, getReq) + if err != nil { + return err + } + return cmdio.Render(ctx, response) + } + + // Disable completions since they are not applicable. + // Can be overridden by manual implementation in `override.go`. + cmd.ValidArgsFunction = cobra.NoFileCompletions + + // Apply optional overrides to this command. + for _, fn := range getOverrides { + fn(cmd, &getReq) + } + + return cmd +} + +func init() { + cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { + cmd.AddCommand(newGet()) + }) +} + +// start update command + +// Slice with functions to override default command behavior. +// Functions can be added from the `init()` function in manually curated files in this directory. +var updateOverrides []func( + *cobra.Command, + *settings.UpdateCspEnablementSettingRequest, +) + +func newUpdate() *cobra.Command { + cmd := &cobra.Command{} + + var updateReq settings.UpdateCspEnablementSettingRequest + var updateJson flags.JsonFlag + + // TODO: short flags + cmd.Flags().Var(&updateJson, "json", `either inline JSON string or @path/to/file.json with request body`) + + cmd.Use = "update" + cmd.Short = `Update the compliance security profile setting.` + cmd.Long = `Update the compliance security profile setting. + + Updates the compliance security profile setting for the workspace. A fresh + etag needs to be provided in PATCH requests (as part of the setting field). + The etag can be retrieved by making a GET request before the PATCH + request. If the setting is updated concurrently, PATCH fails with 409 and + the request must be retried by using the fresh etag in the 409 response.` + + cmd.Annotations = make(map[string]string) + + cmd.PreRunE = root.MustWorkspaceClient + cmd.RunE = func(cmd *cobra.Command, args []string) (err error) { + ctx := cmd.Context() + w := root.WorkspaceClient(ctx) + + if cmd.Flags().Changed("json") { + err = updateJson.Unmarshal(&updateReq) + if err != nil { + return err + } + } else { + return fmt.Errorf("please provide command input in JSON format by specifying the --json flag") + } + + response, err := w.CspEnablement.Update(ctx, updateReq) + if err != nil { + return err + } + return cmdio.Render(ctx, response) + } + + // Disable completions since they are not applicable. + // Can be overridden by manual implementation in `override.go`. + cmd.ValidArgsFunction = cobra.NoFileCompletions + + // Apply optional overrides to this command. + for _, fn := range updateOverrides { + fn(cmd, &updateReq) + } + + return cmd +} + +func init() { + cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { + cmd.AddCommand(newUpdate()) + }) +} + +// end service CSPEnablement diff --git a/cmd/workspace/dashboard-widgets/dashboard-widgets.go b/cmd/workspace/dashboard-widgets/dashboard-widgets.go index 43a972e03a..35f5150ced 100755 --- a/cmd/workspace/dashboard-widgets/dashboard-widgets.go +++ b/cmd/workspace/dashboard-widgets/dashboard-widgets.go @@ -140,11 +140,11 @@ func newDelete() *cobra.Command { deleteReq.Id = args[0] - err = w.DashboardWidgets.Delete(ctx, deleteReq) + response, err := w.DashboardWidgets.Delete(ctx, deleteReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. diff --git a/cmd/workspace/dashboards/dashboards.go b/cmd/workspace/dashboards/dashboards.go index e07f739261..2e0dfb6f16 100755 --- a/cmd/workspace/dashboards/dashboards.go +++ b/cmd/workspace/dashboards/dashboards.go @@ -152,11 +152,11 @@ func newDelete() *cobra.Command { } deleteReq.DashboardId = args[0] - err = w.Dashboards.Delete(ctx, deleteReq) + response, err := w.Dashboards.Delete(ctx, deleteReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -363,11 +363,11 @@ func newRestore() *cobra.Command { } restoreReq.DashboardId = args[0] - err = w.Dashboards.Restore(ctx, restoreReq) + response, err := w.Dashboards.Restore(ctx, restoreReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. diff --git a/cmd/workspace/default-namespace/default-namespace.go b/cmd/workspace/default-namespace/default-namespace.go new file mode 100755 index 0000000000..7386791ffe --- /dev/null +++ b/cmd/workspace/default-namespace/default-namespace.go @@ -0,0 +1,246 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package default_namespace + +import ( + "fmt" + + "github.com/databricks/cli/cmd/root" + "github.com/databricks/cli/libs/cmdio" + "github.com/databricks/cli/libs/flags" + "github.com/databricks/databricks-sdk-go/service/settings" + "github.com/spf13/cobra" +) + +// Slice with functions to override default command behavior. +// Functions can be added from the `init()` function in manually curated files in this directory. +var cmdOverrides []func(*cobra.Command) + +func New() *cobra.Command { + cmd := &cobra.Command{ + Use: "default-namespace", + Short: `The default namespace setting API allows users to configure the default namespace for a Databricks workspace.`, + Long: `The default namespace setting API allows users to configure the default + namespace for a Databricks workspace. + + Through this API, users can retrieve, set, or modify the default namespace + used when queries do not reference a fully qualified three-level name. For + example, if you use the API to set 'retail_prod' as the default catalog, then + a query 'SELECT * FROM myTable' would reference the object + 'retail_prod.default.myTable' (the schema 'default' is always assumed). + + This setting requires a restart of clusters and SQL warehouses to take effect. + Additionally, the default namespace only applies when using Unity + Catalog-enabled compute.`, + GroupID: "settings", + Annotations: map[string]string{ + "package": "settings", + }, + } + + // Apply optional overrides to this command. + for _, fn := range cmdOverrides { + fn(cmd) + } + + return cmd +} + +// start delete command + +// Slice with functions to override default command behavior. +// Functions can be added from the `init()` function in manually curated files in this directory. +var deleteOverrides []func( + *cobra.Command, + *settings.DeleteDefaultNamespaceRequest, +) + +func newDelete() *cobra.Command { + cmd := &cobra.Command{} + + var deleteReq settings.DeleteDefaultNamespaceRequest + + // TODO: short flags + + cmd.Flags().StringVar(&deleteReq.Etag, "etag", deleteReq.Etag, `etag used for versioning.`) + + cmd.Use = "delete" + cmd.Short = `Delete the default namespace setting.` + cmd.Long = `Delete the default namespace setting. + + Deletes the default namespace setting for the workspace. A fresh etag needs to + be provided in DELETE requests (as a query parameter). The etag can be + retrieved by making a GET request before the DELETE request. If the + setting is updated/deleted concurrently, DELETE fails with 409 and the + request must be retried by using the fresh etag in the 409 response.` + + cmd.Annotations = make(map[string]string) + + cmd.Args = func(cmd *cobra.Command, args []string) error { + check := cobra.ExactArgs(0) + return check(cmd, args) + } + + cmd.PreRunE = root.MustWorkspaceClient + cmd.RunE = func(cmd *cobra.Command, args []string) (err error) { + ctx := cmd.Context() + w := root.WorkspaceClient(ctx) + + response, err := w.DefaultNamespace.Delete(ctx, deleteReq) + if err != nil { + return err + } + return cmdio.Render(ctx, response) + } + + // Disable completions since they are not applicable. + // Can be overridden by manual implementation in `override.go`. + cmd.ValidArgsFunction = cobra.NoFileCompletions + + // Apply optional overrides to this command. + for _, fn := range deleteOverrides { + fn(cmd, &deleteReq) + } + + return cmd +} + +func init() { + cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { + cmd.AddCommand(newDelete()) + }) +} + +// start get command + +// Slice with functions to override default command behavior. +// Functions can be added from the `init()` function in manually curated files in this directory. +var getOverrides []func( + *cobra.Command, + *settings.GetDefaultNamespaceRequest, +) + +func newGet() *cobra.Command { + cmd := &cobra.Command{} + + var getReq settings.GetDefaultNamespaceRequest + + // TODO: short flags + + cmd.Flags().StringVar(&getReq.Etag, "etag", getReq.Etag, `etag used for versioning.`) + + cmd.Use = "get" + cmd.Short = `Get the default namespace setting.` + cmd.Long = `Get the default namespace setting. + + Gets the default namespace setting.` + + cmd.Annotations = make(map[string]string) + + cmd.Args = func(cmd *cobra.Command, args []string) error { + check := cobra.ExactArgs(0) + return check(cmd, args) + } + + cmd.PreRunE = root.MustWorkspaceClient + cmd.RunE = func(cmd *cobra.Command, args []string) (err error) { + ctx := cmd.Context() + w := root.WorkspaceClient(ctx) + + response, err := w.DefaultNamespace.Get(ctx, getReq) + if err != nil { + return err + } + return cmdio.Render(ctx, response) + } + + // Disable completions since they are not applicable. + // Can be overridden by manual implementation in `override.go`. + cmd.ValidArgsFunction = cobra.NoFileCompletions + + // Apply optional overrides to this command. + for _, fn := range getOverrides { + fn(cmd, &getReq) + } + + return cmd +} + +func init() { + cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { + cmd.AddCommand(newGet()) + }) +} + +// start update command + +// Slice with functions to override default command behavior. +// Functions can be added from the `init()` function in manually curated files in this directory. +var updateOverrides []func( + *cobra.Command, + *settings.UpdateDefaultNamespaceSettingRequest, +) + +func newUpdate() *cobra.Command { + cmd := &cobra.Command{} + + var updateReq settings.UpdateDefaultNamespaceSettingRequest + var updateJson flags.JsonFlag + + // TODO: short flags + cmd.Flags().Var(&updateJson, "json", `either inline JSON string or @path/to/file.json with request body`) + + cmd.Use = "update" + cmd.Short = `Update the default namespace setting.` + cmd.Long = `Update the default namespace setting. + + Updates the default namespace setting for the workspace. A fresh etag needs to + be provided in PATCH requests (as part of the setting field). The etag can + be retrieved by making a GET request before the PATCH request. Note that + if the setting does not exist, GET returns a NOT_FOUND error and the etag is + present in the error response, which should be set in the PATCH request. If + the setting is updated concurrently, PATCH fails with 409 and the request + must be retried by using the fresh etag in the 409 response.` + + cmd.Annotations = make(map[string]string) + + cmd.PreRunE = root.MustWorkspaceClient + cmd.RunE = func(cmd *cobra.Command, args []string) (err error) { + ctx := cmd.Context() + w := root.WorkspaceClient(ctx) + + if cmd.Flags().Changed("json") { + err = updateJson.Unmarshal(&updateReq) + if err != nil { + return err + } + } else { + return fmt.Errorf("please provide command input in JSON format by specifying the --json flag") + } + + response, err := w.DefaultNamespace.Update(ctx, updateReq) + if err != nil { + return err + } + return cmdio.Render(ctx, response) + } + + // Disable completions since they are not applicable. + // Can be overridden by manual implementation in `override.go`. + cmd.ValidArgsFunction = cobra.NoFileCompletions + + // Apply optional overrides to this command. + for _, fn := range updateOverrides { + fn(cmd, &updateReq) + } + + return cmd +} + +func init() { + cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { + cmd.AddCommand(newUpdate()) + }) +} + +// end service DefaultNamespace diff --git a/cmd/workspace/esm-enablement/esm-enablement.go b/cmd/workspace/esm-enablement/esm-enablement.go new file mode 100755 index 0000000000..16c56fd590 --- /dev/null +++ b/cmd/workspace/esm-enablement/esm-enablement.go @@ -0,0 +1,174 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package esm_enablement + +import ( + "fmt" + + "github.com/databricks/cli/cmd/root" + "github.com/databricks/cli/libs/cmdio" + "github.com/databricks/cli/libs/flags" + "github.com/databricks/databricks-sdk-go/service/settings" + "github.com/spf13/cobra" +) + +// Slice with functions to override default command behavior. +// Functions can be added from the `init()` function in manually curated files in this directory. +var cmdOverrides []func(*cobra.Command) + +func New() *cobra.Command { + cmd := &cobra.Command{ + Use: "esm-enablement", + Short: `Controls whether enhanced security monitoring is enabled for the current workspace.`, + Long: `Controls whether enhanced security monitoring is enabled for the current + workspace. If the compliance security profile is enabled, this is + automatically enabled. By default, it is disabled. However, if the compliance + security profile is enabled, this is automatically enabled. + + If the compliance security profile is disabled, you can enable or disable this + setting and it is not permanent.`, + GroupID: "settings", + Annotations: map[string]string{ + "package": "settings", + }, + } + + // Apply optional overrides to this command. + for _, fn := range cmdOverrides { + fn(cmd) + } + + return cmd +} + +// start get command + +// Slice with functions to override default command behavior. +// Functions can be added from the `init()` function in manually curated files in this directory. +var getOverrides []func( + *cobra.Command, + *settings.GetEsmEnablementRequest, +) + +func newGet() *cobra.Command { + cmd := &cobra.Command{} + + var getReq settings.GetEsmEnablementRequest + + // TODO: short flags + + cmd.Flags().StringVar(&getReq.Etag, "etag", getReq.Etag, `etag used for versioning.`) + + cmd.Use = "get" + cmd.Short = `Get the enhanced security monitoring setting.` + cmd.Long = `Get the enhanced security monitoring setting. + + Gets the enhanced security monitoring setting.` + + cmd.Annotations = make(map[string]string) + + cmd.Args = func(cmd *cobra.Command, args []string) error { + check := cobra.ExactArgs(0) + return check(cmd, args) + } + + cmd.PreRunE = root.MustWorkspaceClient + cmd.RunE = func(cmd *cobra.Command, args []string) (err error) { + ctx := cmd.Context() + w := root.WorkspaceClient(ctx) + + response, err := w.EsmEnablement.Get(ctx, getReq) + if err != nil { + return err + } + return cmdio.Render(ctx, response) + } + + // Disable completions since they are not applicable. + // Can be overridden by manual implementation in `override.go`. + cmd.ValidArgsFunction = cobra.NoFileCompletions + + // Apply optional overrides to this command. + for _, fn := range getOverrides { + fn(cmd, &getReq) + } + + return cmd +} + +func init() { + cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { + cmd.AddCommand(newGet()) + }) +} + +// start update command + +// Slice with functions to override default command behavior. +// Functions can be added from the `init()` function in manually curated files in this directory. +var updateOverrides []func( + *cobra.Command, + *settings.UpdateEsmEnablementSettingRequest, +) + +func newUpdate() *cobra.Command { + cmd := &cobra.Command{} + + var updateReq settings.UpdateEsmEnablementSettingRequest + var updateJson flags.JsonFlag + + // TODO: short flags + cmd.Flags().Var(&updateJson, "json", `either inline JSON string or @path/to/file.json with request body`) + + cmd.Use = "update" + cmd.Short = `Update the enhanced security monitoring setting.` + cmd.Long = `Update the enhanced security monitoring setting. + + Updates the enhanced security monitoring setting for the workspace. A fresh + etag needs to be provided in PATCH requests (as part of the setting field). + The etag can be retrieved by making a GET request before the PATCH + request. If the setting is updated concurrently, PATCH fails with 409 and + the request must be retried by using the fresh etag in the 409 response.` + + cmd.Annotations = make(map[string]string) + + cmd.PreRunE = root.MustWorkspaceClient + cmd.RunE = func(cmd *cobra.Command, args []string) (err error) { + ctx := cmd.Context() + w := root.WorkspaceClient(ctx) + + if cmd.Flags().Changed("json") { + err = updateJson.Unmarshal(&updateReq) + if err != nil { + return err + } + } else { + return fmt.Errorf("please provide command input in JSON format by specifying the --json flag") + } + + response, err := w.EsmEnablement.Update(ctx, updateReq) + if err != nil { + return err + } + return cmdio.Render(ctx, response) + } + + // Disable completions since they are not applicable. + // Can be overridden by manual implementation in `override.go`. + cmd.ValidArgsFunction = cobra.NoFileCompletions + + // Apply optional overrides to this command. + for _, fn := range updateOverrides { + fn(cmd, &updateReq) + } + + return cmd +} + +func init() { + cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { + cmd.AddCommand(newUpdate()) + }) +} + +// end service ESMEnablement diff --git a/cmd/workspace/experiments/experiments.go b/cmd/workspace/experiments/experiments.go index 368ec7f946..7a18d2b213 100755 --- a/cmd/workspace/experiments/experiments.go +++ b/cmd/workspace/experiments/experiments.go @@ -266,11 +266,11 @@ func newDeleteExperiment() *cobra.Command { deleteExperimentReq.ExperimentId = args[0] } - err = w.Experiments.DeleteExperiment(ctx, deleteExperimentReq) + response, err := w.Experiments.DeleteExperiment(ctx, deleteExperimentReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -347,11 +347,11 @@ func newDeleteRun() *cobra.Command { deleteRunReq.RunId = args[0] } - err = w.Experiments.DeleteRun(ctx, deleteRunReq) + response, err := w.Experiments.DeleteRun(ctx, deleteRunReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -528,11 +528,11 @@ func newDeleteTag() *cobra.Command { deleteTagReq.Key = args[1] } - err = w.Experiments.DeleteTag(ctx, deleteTagReq) + response, err := w.Experiments.DeleteTag(ctx, deleteTagReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -1161,11 +1161,11 @@ func newLogBatch() *cobra.Command { } } - err = w.Experiments.LogBatch(ctx, logBatchReq) + response, err := w.Experiments.LogBatch(ctx, logBatchReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -1233,11 +1233,11 @@ func newLogInputs() *cobra.Command { } } - err = w.Experiments.LogInputs(ctx, logInputsReq) + response, err := w.Experiments.LogInputs(ctx, logInputsReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -1334,11 +1334,11 @@ func newLogMetric() *cobra.Command { } } - err = w.Experiments.LogMetric(ctx, logMetricReq) + response, err := w.Experiments.LogMetric(ctx, logMetricReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -1406,11 +1406,11 @@ func newLogModel() *cobra.Command { } } - err = w.Experiments.LogModel(ctx, logModelReq) + response, err := w.Experiments.LogModel(ctx, logModelReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -1497,11 +1497,11 @@ func newLogParam() *cobra.Command { logParamReq.Value = args[1] } - err = w.Experiments.LogParam(ctx, logParamReq) + response, err := w.Experiments.LogParam(ctx, logParamReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -1583,11 +1583,11 @@ func newRestoreExperiment() *cobra.Command { restoreExperimentReq.ExperimentId = args[0] } - err = w.Experiments.RestoreExperiment(ctx, restoreExperimentReq) + response, err := w.Experiments.RestoreExperiment(ctx, restoreExperimentReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -1664,11 +1664,11 @@ func newRestoreRun() *cobra.Command { restoreRunReq.RunId = args[0] } - err = w.Experiments.RestoreRun(ctx, restoreRunReq) + response, err := w.Experiments.RestoreRun(ctx, restoreRunReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -1996,11 +1996,11 @@ func newSetExperimentTag() *cobra.Command { setExperimentTagReq.Value = args[2] } - err = w.Experiments.SetExperimentTag(ctx, setExperimentTagReq) + response, err := w.Experiments.SetExperimentTag(ctx, setExperimentTagReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -2163,11 +2163,11 @@ func newSetTag() *cobra.Command { setTagReq.Value = args[1] } - err = w.Experiments.SetTag(ctx, setTagReq) + response, err := w.Experiments.SetTag(ctx, setTagReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -2246,11 +2246,11 @@ func newUpdateExperiment() *cobra.Command { updateExperimentReq.ExperimentId = args[0] } - err = w.Experiments.UpdateExperiment(ctx, updateExperimentReq) + response, err := w.Experiments.UpdateExperiment(ctx, updateExperimentReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. diff --git a/cmd/workspace/external-locations/external-locations.go b/cmd/workspace/external-locations/external-locations.go index 7ddc0d8425..5608d7a976 100755 --- a/cmd/workspace/external-locations/external-locations.go +++ b/cmd/workspace/external-locations/external-locations.go @@ -186,11 +186,11 @@ func newDelete() *cobra.Command { deleteReq.Name = args[0] - err = w.ExternalLocations.Delete(ctx, deleteReq) + response, err := w.ExternalLocations.Delete(ctx, deleteReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. diff --git a/cmd/workspace/functions/functions.go b/cmd/workspace/functions/functions.go index d1db1ec970..35e8ba8a44 100755 --- a/cmd/workspace/functions/functions.go +++ b/cmd/workspace/functions/functions.go @@ -168,11 +168,11 @@ func newDelete() *cobra.Command { } deleteReq.Name = args[0] - err = w.Functions.Delete(ctx, deleteReq) + response, err := w.Functions.Delete(ctx, deleteReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. diff --git a/cmd/workspace/git-credentials/git-credentials.go b/cmd/workspace/git-credentials/git-credentials.go index 8984a95387..c0e404f472 100755 --- a/cmd/workspace/git-credentials/git-credentials.go +++ b/cmd/workspace/git-credentials/git-credentials.go @@ -183,11 +183,11 @@ func newDelete() *cobra.Command { return fmt.Errorf("invalid CREDENTIAL_ID: %s", args[0]) } - err = w.GitCredentials.Delete(ctx, deleteReq) + response, err := w.GitCredentials.Delete(ctx, deleteReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -399,11 +399,11 @@ func newUpdate() *cobra.Command { return fmt.Errorf("invalid CREDENTIAL_ID: %s", args[0]) } - err = w.GitCredentials.Update(ctx, updateReq) + response, err := w.GitCredentials.Update(ctx, updateReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. diff --git a/cmd/workspace/global-init-scripts/global-init-scripts.go b/cmd/workspace/global-init-scripts/global-init-scripts.go index de08614fed..b24e82b15c 100755 --- a/cmd/workspace/global-init-scripts/global-init-scripts.go +++ b/cmd/workspace/global-init-scripts/global-init-scripts.go @@ -182,11 +182,11 @@ func newDelete() *cobra.Command { } deleteReq.ScriptId = args[0] - err = w.GlobalInitScripts.Delete(ctx, deleteReq) + response, err := w.GlobalInitScripts.Delete(ctx, deleteReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -397,11 +397,11 @@ func newUpdate() *cobra.Command { updateReq.Script = args[2] } - err = w.GlobalInitScripts.Update(ctx, updateReq) + response, err := w.GlobalInitScripts.Update(ctx, updateReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. diff --git a/cmd/workspace/groups/groups.go b/cmd/workspace/groups/groups.go index aba54b8be6..0c06aefb8f 100755 --- a/cmd/workspace/groups/groups.go +++ b/cmd/workspace/groups/groups.go @@ -171,11 +171,11 @@ func newDelete() *cobra.Command { } deleteReq.Id = args[0] - err = w.Groups.Delete(ctx, deleteReq) + response, err := w.Groups.Delete(ctx, deleteReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -398,11 +398,11 @@ func newPatch() *cobra.Command { } patchReq.Id = args[0] - err = w.Groups.Patch(ctx, patchReq) + response, err := w.Groups.Patch(ctx, patchReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -492,11 +492,11 @@ func newUpdate() *cobra.Command { } updateReq.Id = args[0] - err = w.Groups.Update(ctx, updateReq) + response, err := w.Groups.Update(ctx, updateReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. diff --git a/cmd/workspace/instance-pools/instance-pools.go b/cmd/workspace/instance-pools/instance-pools.go index c9389fef86..b901ad9edb 100755 --- a/cmd/workspace/instance-pools/instance-pools.go +++ b/cmd/workspace/instance-pools/instance-pools.go @@ -226,11 +226,11 @@ func newDelete() *cobra.Command { deleteReq.InstancePoolId = args[0] } - err = w.InstancePools.Delete(ctx, deleteReq) + response, err := w.InstancePools.Delete(ctx, deleteReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -325,11 +325,11 @@ func newEdit() *cobra.Command { editReq.NodeTypeId = args[2] } - err = w.InstancePools.Edit(ctx, editReq) + response, err := w.InstancePools.Edit(ctx, editReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. diff --git a/cmd/workspace/instance-profiles/instance-profiles.go b/cmd/workspace/instance-profiles/instance-profiles.go index 2077c4bfc5..5bd6280cd2 100755 --- a/cmd/workspace/instance-profiles/instance-profiles.go +++ b/cmd/workspace/instance-profiles/instance-profiles.go @@ -102,11 +102,11 @@ func newAdd() *cobra.Command { addReq.InstanceProfileArn = args[0] } - err = w.InstanceProfiles.Add(ctx, addReq) + response, err := w.InstanceProfiles.Add(ctx, addReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -201,11 +201,11 @@ func newEdit() *cobra.Command { editReq.InstanceProfileArn = args[0] } - err = w.InstanceProfiles.Edit(ctx, editReq) + response, err := w.InstanceProfiles.Edit(ctx, editReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -332,11 +332,11 @@ func newRemove() *cobra.Command { removeReq.InstanceProfileArn = args[0] } - err = w.InstanceProfiles.Remove(ctx, removeReq) + response, err := w.InstanceProfiles.Remove(ctx, removeReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. diff --git a/cmd/workspace/ip-access-lists/ip-access-lists.go b/cmd/workspace/ip-access-lists/ip-access-lists.go index 9eb08cb438..fc10a66e22 100755 --- a/cmd/workspace/ip-access-lists/ip-access-lists.go +++ b/cmd/workspace/ip-access-lists/ip-access-lists.go @@ -216,11 +216,11 @@ func newDelete() *cobra.Command { } deleteReq.IpAccessListId = args[0] - err = w.IpAccessLists.Delete(ctx, deleteReq) + response, err := w.IpAccessLists.Delete(ctx, deleteReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -452,11 +452,11 @@ func newReplace() *cobra.Command { } } - err = w.IpAccessLists.Replace(ctx, replaceReq) + response, err := w.IpAccessLists.Replace(ctx, replaceReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -556,11 +556,11 @@ func newUpdate() *cobra.Command { } updateReq.IpAccessListId = args[0] - err = w.IpAccessLists.Update(ctx, updateReq) + response, err := w.IpAccessLists.Update(ctx, updateReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. diff --git a/cmd/workspace/jobs/jobs.go b/cmd/workspace/jobs/jobs.go index 957aa60934..edbb3e08a5 100755 --- a/cmd/workspace/jobs/jobs.go +++ b/cmd/workspace/jobs/jobs.go @@ -100,11 +100,11 @@ func newCancelAllRuns() *cobra.Command { } } - err = w.Jobs.CancelAllRuns(ctx, cancelAllRunsReq) + response, err := w.Jobs.CancelAllRuns(ctx, cancelAllRunsReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -210,7 +210,7 @@ func newCancelRun() *cobra.Command { return err } if cancelRunSkipWait { - return nil + return cmdio.Render(ctx, wait.Response) } spinner := cmdio.Spinner(ctx) info, err := wait.OnProgress(func(i *jobs.Run) { @@ -388,11 +388,11 @@ func newDelete() *cobra.Command { } } - err = w.Jobs.Delete(ctx, deleteReq) + response, err := w.Jobs.Delete(ctx, deleteReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -487,11 +487,11 @@ func newDeleteRun() *cobra.Command { } } - err = w.Jobs.DeleteRun(ctx, deleteRunReq) + response, err := w.Jobs.DeleteRun(ctx, deleteRunReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -1311,11 +1311,11 @@ func newReset() *cobra.Command { return fmt.Errorf("please provide command input in JSON format by specifying the --json flag") } - err = w.Jobs.Reset(ctx, resetReq) + response, err := w.Jobs.Reset(ctx, resetReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -1743,11 +1743,11 @@ func newUpdate() *cobra.Command { } } - err = w.Jobs.Update(ctx, updateReq) + response, err := w.Jobs.Update(ctx, updateReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. diff --git a/cmd/workspace/lakehouse-monitors/lakehouse-monitors.go b/cmd/workspace/lakehouse-monitors/lakehouse-monitors.go index 13383f36f7..427d0e6c63 100755 --- a/cmd/workspace/lakehouse-monitors/lakehouse-monitors.go +++ b/cmd/workspace/lakehouse-monitors/lakehouse-monitors.go @@ -95,11 +95,11 @@ func newCancelRefresh() *cobra.Command { cancelRefreshReq.FullName = args[0] cancelRefreshReq.RefreshId = args[1] - err = w.LakehouseMonitors.CancelRefresh(ctx, cancelRefreshReq) + response, err := w.LakehouseMonitors.CancelRefresh(ctx, cancelRefreshReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -280,11 +280,11 @@ func newDelete() *cobra.Command { deleteReq.FullName = args[0] - err = w.LakehouseMonitors.Delete(ctx, deleteReq) + response, err := w.LakehouseMonitors.Delete(ctx, deleteReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. diff --git a/cmd/workspace/lakeview/lakeview.go b/cmd/workspace/lakeview/lakeview.go index a6dddd0de2..0d47ed2216 100755 --- a/cmd/workspace/lakeview/lakeview.go +++ b/cmd/workspace/lakeview/lakeview.go @@ -4,6 +4,7 @@ package lakeview import ( "github.com/databricks/cli/cmd/root" + "github.com/databricks/cli/libs/cmdio" "github.com/databricks/cli/libs/flags" "github.com/databricks/databricks-sdk-go/service/dashboards" "github.com/spf13/cobra" @@ -84,11 +85,11 @@ func newPublish() *cobra.Command { } publishReq.DashboardId = args[0] - err = w.Lakeview.Publish(ctx, publishReq) + response, err := w.Lakeview.Publish(ctx, publishReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. diff --git a/cmd/workspace/libraries/libraries.go b/cmd/workspace/libraries/libraries.go index fef81c25f6..12d773c28c 100755 --- a/cmd/workspace/libraries/libraries.go +++ b/cmd/workspace/libraries/libraries.go @@ -224,11 +224,11 @@ func newInstall() *cobra.Command { return fmt.Errorf("please provide command input in JSON format by specifying the --json flag") } - err = w.Libraries.Install(ctx, installReq) + response, err := w.Libraries.Install(ctx, installReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -291,11 +291,11 @@ func newUninstall() *cobra.Command { return fmt.Errorf("please provide command input in JSON format by specifying the --json flag") } - err = w.Libraries.Uninstall(ctx, uninstallReq) + response, err := w.Libraries.Uninstall(ctx, uninstallReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. diff --git a/cmd/workspace/metastores/metastores.go b/cmd/workspace/metastores/metastores.go index d63576d4ea..bd61802a6f 100755 --- a/cmd/workspace/metastores/metastores.go +++ b/cmd/workspace/metastores/metastores.go @@ -114,11 +114,11 @@ func newAssign() *cobra.Command { assignReq.DefaultCatalogName = args[2] } - err = w.Metastores.Assign(ctx, assignReq) + response, err := w.Metastores.Assign(ctx, assignReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -328,11 +328,11 @@ func newDelete() *cobra.Command { } deleteReq.Id = args[0] - err = w.Metastores.Delete(ctx, deleteReq) + response, err := w.Metastores.Delete(ctx, deleteReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -570,11 +570,11 @@ func newUnassign() *cobra.Command { } unassignReq.MetastoreId = args[1] - err = w.Metastores.Unassign(ctx, unassignReq) + response, err := w.Metastores.Unassign(ctx, unassignReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -757,11 +757,11 @@ func newUpdateAssignment() *cobra.Command { return fmt.Errorf("invalid WORKSPACE_ID: %s", args[0]) } - err = w.Metastores.UpdateAssignment(ctx, updateAssignmentReq) + response, err := w.Metastores.UpdateAssignment(ctx, updateAssignmentReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. diff --git a/cmd/workspace/model-registry/model-registry.go b/cmd/workspace/model-registry/model-registry.go index 9c6034b56b..a3cfd6aaa1 100755 --- a/cmd/workspace/model-registry/model-registry.go +++ b/cmd/workspace/model-registry/model-registry.go @@ -631,11 +631,11 @@ func newDeleteComment() *cobra.Command { deleteCommentReq.Id = args[0] - err = w.ModelRegistry.DeleteComment(ctx, deleteCommentReq) + response, err := w.ModelRegistry.DeleteComment(ctx, deleteCommentReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -695,11 +695,11 @@ func newDeleteModel() *cobra.Command { deleteModelReq.Name = args[0] - err = w.ModelRegistry.DeleteModel(ctx, deleteModelReq) + response, err := w.ModelRegistry.DeleteModel(ctx, deleteModelReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -762,11 +762,11 @@ func newDeleteModelTag() *cobra.Command { deleteModelTagReq.Name = args[0] deleteModelTagReq.Key = args[1] - err = w.ModelRegistry.DeleteModelTag(ctx, deleteModelTagReq) + response, err := w.ModelRegistry.DeleteModelTag(ctx, deleteModelTagReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -828,11 +828,11 @@ func newDeleteModelVersion() *cobra.Command { deleteModelVersionReq.Name = args[0] deleteModelVersionReq.Version = args[1] - err = w.ModelRegistry.DeleteModelVersion(ctx, deleteModelVersionReq) + response, err := w.ModelRegistry.DeleteModelVersion(ctx, deleteModelVersionReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -897,11 +897,11 @@ func newDeleteModelVersionTag() *cobra.Command { deleteModelVersionTagReq.Version = args[1] deleteModelVersionTagReq.Key = args[2] - err = w.ModelRegistry.DeleteModelVersionTag(ctx, deleteModelVersionTagReq) + response, err := w.ModelRegistry.DeleteModelVersionTag(ctx, deleteModelVersionTagReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -982,11 +982,11 @@ func newDeleteTransitionRequest() *cobra.Command { } deleteTransitionRequestReq.Creator = args[3] - err = w.ModelRegistry.DeleteTransitionRequest(ctx, deleteTransitionRequestReq) + response, err := w.ModelRegistry.DeleteTransitionRequest(ctx, deleteTransitionRequestReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -1045,11 +1045,11 @@ func newDeleteWebhook() *cobra.Command { ctx := cmd.Context() w := root.WorkspaceClient(ctx) - err = w.ModelRegistry.DeleteWebhook(ctx, deleteWebhookReq) + response, err := w.ModelRegistry.DeleteWebhook(ctx, deleteWebhookReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -2040,11 +2040,11 @@ func newSetModelTag() *cobra.Command { setModelTagReq.Value = args[2] } - err = w.ModelRegistry.SetModelTag(ctx, setModelTagReq) + response, err := w.ModelRegistry.SetModelTag(ctx, setModelTagReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -2138,11 +2138,11 @@ func newSetModelVersionTag() *cobra.Command { setModelVersionTagReq.Value = args[3] } - err = w.ModelRegistry.SetModelVersionTag(ctx, setModelVersionTagReq) + response, err := w.ModelRegistry.SetModelVersionTag(ctx, setModelVersionTagReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -2593,11 +2593,11 @@ func newUpdateModel() *cobra.Command { updateModelReq.Name = args[0] } - err = w.ModelRegistry.UpdateModel(ctx, updateModelReq) + response, err := w.ModelRegistry.UpdateModel(ctx, updateModelReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -2680,11 +2680,11 @@ func newUpdateModelVersion() *cobra.Command { updateModelVersionReq.Version = args[1] } - err = w.ModelRegistry.UpdateModelVersion(ctx, updateModelVersionReq) + response, err := w.ModelRegistry.UpdateModelVersion(ctx, updateModelVersionReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -2844,11 +2844,11 @@ func newUpdateWebhook() *cobra.Command { updateWebhookReq.Id = args[0] } - err = w.ModelRegistry.UpdateWebhook(ctx, updateWebhookReq) + response, err := w.ModelRegistry.UpdateWebhook(ctx, updateWebhookReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. diff --git a/cmd/workspace/model-versions/model-versions.go b/cmd/workspace/model-versions/model-versions.go index b4492cb369..7daea5f45d 100755 --- a/cmd/workspace/model-versions/model-versions.go +++ b/cmd/workspace/model-versions/model-versions.go @@ -91,11 +91,11 @@ func newDelete() *cobra.Command { return fmt.Errorf("invalid VERSION: %s", args[1]) } - err = w.ModelVersions.Delete(ctx, deleteReq) + response, err := w.ModelVersions.Delete(ctx, deleteReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. diff --git a/cmd/workspace/online-tables/online-tables.go b/cmd/workspace/online-tables/online-tables.go index d97c52837e..151ba4756f 100755 --- a/cmd/workspace/online-tables/online-tables.go +++ b/cmd/workspace/online-tables/online-tables.go @@ -146,11 +146,11 @@ func newDelete() *cobra.Command { deleteReq.Name = args[0] - err = w.OnlineTables.Delete(ctx, deleteReq) + response, err := w.OnlineTables.Delete(ctx, deleteReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. diff --git a/cmd/workspace/permission-migration/permission-migration.go b/cmd/workspace/permission-migration/permission-migration.go new file mode 100755 index 0000000000..e24ad193e1 --- /dev/null +++ b/cmd/workspace/permission-migration/permission-migration.go @@ -0,0 +1,139 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package permission_migration + +import ( + "fmt" + + "github.com/databricks/cli/cmd/root" + "github.com/databricks/cli/libs/cmdio" + "github.com/databricks/cli/libs/flags" + "github.com/databricks/databricks-sdk-go/service/iam" + "github.com/spf13/cobra" +) + +// Slice with functions to override default command behavior. +// Functions can be added from the `init()` function in manually curated files in this directory. +var cmdOverrides []func(*cobra.Command) + +func New() *cobra.Command { + cmd := &cobra.Command{ + Use: "permission-migration", + Short: `This spec contains undocumented permission migration APIs used in https://github.com/databrickslabs/ucx.`, + Long: `This spec contains undocumented permission migration APIs used in + https://github.com/databrickslabs/ucx.`, + GroupID: "iam", + Annotations: map[string]string{ + "package": "iam", + }, + + // This service is being previewed; hide from help output. + Hidden: true, + } + + // Apply optional overrides to this command. + for _, fn := range cmdOverrides { + fn(cmd) + } + + return cmd +} + +// start migrate-permissions command + +// Slice with functions to override default command behavior. +// Functions can be added from the `init()` function in manually curated files in this directory. +var migratePermissionsOverrides []func( + *cobra.Command, + *iam.PermissionMigrationRequest, +) + +func newMigratePermissions() *cobra.Command { + cmd := &cobra.Command{} + + var migratePermissionsReq iam.PermissionMigrationRequest + var migratePermissionsJson flags.JsonFlag + + // TODO: short flags + cmd.Flags().Var(&migratePermissionsJson, "json", `either inline JSON string or @path/to/file.json with request body`) + + cmd.Flags().IntVar(&migratePermissionsReq.Size, "size", migratePermissionsReq.Size, `The maximum number of permissions that will be migrated.`) + + cmd.Use = "migrate-permissions WORKSPACE_ID FROM_WORKSPACE_GROUP_NAME TO_ACCOUNT_GROUP_NAME" + cmd.Short = `Migrate Permissions.` + cmd.Long = `Migrate Permissions. + + Migrate a batch of permissions from a workspace local group to an account + group. + + Arguments: + WORKSPACE_ID: WorkspaceId of the associated workspace where the permission migration + will occur. Both workspace group and account group must be in this + workspace. + FROM_WORKSPACE_GROUP_NAME: The name of the workspace group that permissions will be migrated from. + TO_ACCOUNT_GROUP_NAME: The name of the account group that permissions will be migrated to.` + + cmd.Annotations = make(map[string]string) + + cmd.Args = func(cmd *cobra.Command, args []string) error { + if cmd.Flags().Changed("json") { + err := cobra.ExactArgs(0)(cmd, args) + if err != nil { + return fmt.Errorf("when --json flag is specified, no positional arguments are required. Provide 'workspace_id', 'from_workspace_group_name', 'to_account_group_name' in your JSON input") + } + return nil + } + check := cobra.ExactArgs(3) + return check(cmd, args) + } + + cmd.PreRunE = root.MustWorkspaceClient + cmd.RunE = func(cmd *cobra.Command, args []string) (err error) { + ctx := cmd.Context() + w := root.WorkspaceClient(ctx) + + if cmd.Flags().Changed("json") { + err = migratePermissionsJson.Unmarshal(&migratePermissionsReq) + if err != nil { + return err + } + } + if !cmd.Flags().Changed("json") { + _, err = fmt.Sscan(args[0], &migratePermissionsReq.WorkspaceId) + if err != nil { + return fmt.Errorf("invalid WORKSPACE_ID: %s", args[0]) + } + } + if !cmd.Flags().Changed("json") { + migratePermissionsReq.FromWorkspaceGroupName = args[1] + } + if !cmd.Flags().Changed("json") { + migratePermissionsReq.ToAccountGroupName = args[2] + } + + response, err := w.PermissionMigration.MigratePermissions(ctx, migratePermissionsReq) + if err != nil { + return err + } + return cmdio.Render(ctx, response) + } + + // Disable completions since they are not applicable. + // Can be overridden by manual implementation in `override.go`. + cmd.ValidArgsFunction = cobra.NoFileCompletions + + // Apply optional overrides to this command. + for _, fn := range migratePermissionsOverrides { + fn(cmd, &migratePermissionsReq) + } + + return cmd +} + +func init() { + cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { + cmd.AddCommand(newMigratePermissions()) + }) +} + +// end service PermissionMigration diff --git a/cmd/workspace/pipelines/pipelines.go b/cmd/workspace/pipelines/pipelines.go index 4c2db6aa38..69fb7d5900 100755 --- a/cmd/workspace/pipelines/pipelines.go +++ b/cmd/workspace/pipelines/pipelines.go @@ -163,11 +163,11 @@ func newDelete() *cobra.Command { } deleteReq.PipelineId = args[0] - err = w.Pipelines.Delete(ctx, deleteReq) + response, err := w.Pipelines.Delete(ctx, deleteReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -940,7 +940,7 @@ func newStop() *cobra.Command { return err } if stopSkipWait { - return nil + return cmdio.Render(ctx, wait.Response) } spinner := cmdio.Spinner(ctx) info, err := wait.OnProgress(func(i *pipelines.GetPipelineResponse) { @@ -1052,11 +1052,11 @@ func newUpdate() *cobra.Command { } updateReq.PipelineId = args[0] - err = w.Pipelines.Update(ctx, updateReq) + response, err := w.Pipelines.Update(ctx, updateReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. diff --git a/cmd/workspace/providers/providers.go b/cmd/workspace/providers/providers.go index 2552964883..0c62080d37 100755 --- a/cmd/workspace/providers/providers.go +++ b/cmd/workspace/providers/providers.go @@ -181,11 +181,11 @@ func newDelete() *cobra.Command { } deleteReq.Name = args[0] - err = w.Providers.Delete(ctx, deleteReq) + response, err := w.Providers.Delete(ctx, deleteReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. diff --git a/cmd/workspace/queries/queries.go b/cmd/workspace/queries/queries.go index ef2de44667..ea02e4e2b6 100755 --- a/cmd/workspace/queries/queries.go +++ b/cmd/workspace/queries/queries.go @@ -161,11 +161,11 @@ func newDelete() *cobra.Command { } deleteReq.QueryId = args[0] - err = w.Queries.Delete(ctx, deleteReq) + response, err := w.Queries.Delete(ctx, deleteReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -374,11 +374,11 @@ func newRestore() *cobra.Command { } restoreReq.QueryId = args[0] - err = w.Queries.Restore(ctx, restoreReq) + response, err := w.Queries.Restore(ctx, restoreReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. diff --git a/cmd/workspace/query-visualizations/query-visualizations.go b/cmd/workspace/query-visualizations/query-visualizations.go index 4f04c42613..ca628e1a9b 100755 --- a/cmd/workspace/query-visualizations/query-visualizations.go +++ b/cmd/workspace/query-visualizations/query-visualizations.go @@ -140,11 +140,11 @@ func newDelete() *cobra.Command { deleteReq.Id = args[0] - err = w.QueryVisualizations.Delete(ctx, deleteReq) + response, err := w.QueryVisualizations.Delete(ctx, deleteReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. diff --git a/cmd/workspace/recipient-activation/recipient-activation.go b/cmd/workspace/recipient-activation/recipient-activation.go index 5fb5c7b9ef..cb787cf792 100755 --- a/cmd/workspace/recipient-activation/recipient-activation.go +++ b/cmd/workspace/recipient-activation/recipient-activation.go @@ -80,11 +80,11 @@ func newGetActivationUrlInfo() *cobra.Command { getActivationUrlInfoReq.ActivationUrl = args[0] - err = w.RecipientActivation.GetActivationUrlInfo(ctx, getActivationUrlInfoReq) + response, err := w.RecipientActivation.GetActivationUrlInfo(ctx, getActivationUrlInfoReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. diff --git a/cmd/workspace/recipients/recipients.go b/cmd/workspace/recipients/recipients.go index d7d432b9ce..5c03b1521a 100755 --- a/cmd/workspace/recipients/recipients.go +++ b/cmd/workspace/recipients/recipients.go @@ -200,11 +200,11 @@ func newDelete() *cobra.Command { } deleteReq.Name = args[0] - err = w.Recipients.Delete(ctx, deleteReq) + response, err := w.Recipients.Delete(ctx, deleteReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -598,11 +598,11 @@ func newUpdate() *cobra.Command { } updateReq.Name = args[0] - err = w.Recipients.Update(ctx, updateReq) + response, err := w.Recipients.Update(ctx, updateReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. diff --git a/cmd/workspace/registered-models/registered-models.go b/cmd/workspace/registered-models/registered-models.go index 98aec3bb31..864dbafc1a 100755 --- a/cmd/workspace/registered-models/registered-models.go +++ b/cmd/workspace/registered-models/registered-models.go @@ -223,11 +223,11 @@ func newDelete() *cobra.Command { } deleteReq.FullName = args[0] - err = w.RegisteredModels.Delete(ctx, deleteReq) + response, err := w.RegisteredModels.Delete(ctx, deleteReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -294,11 +294,11 @@ func newDeleteAlias() *cobra.Command { deleteAliasReq.FullName = args[0] deleteAliasReq.Alias = args[1] - err = w.RegisteredModels.DeleteAlias(ctx, deleteAliasReq) + response, err := w.RegisteredModels.DeleteAlias(ctx, deleteAliasReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. diff --git a/cmd/workspace/repos/repos.go b/cmd/workspace/repos/repos.go index 0c38183aa2..89668582c3 100755 --- a/cmd/workspace/repos/repos.go +++ b/cmd/workspace/repos/repos.go @@ -190,11 +190,11 @@ func newDelete() *cobra.Command { return fmt.Errorf("invalid REPO_ID: %s", args[0]) } - err = w.Repos.Delete(ctx, deleteReq) + response, err := w.Repos.Delete(ctx, deleteReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -661,11 +661,11 @@ func newUpdate() *cobra.Command { return fmt.Errorf("invalid REPO_ID: %s", args[0]) } - err = w.Repos.Update(ctx, updateReq) + response, err := w.Repos.Update(ctx, updateReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. diff --git a/cmd/workspace/restrict-workspace-admins/restrict-workspace-admins.go b/cmd/workspace/restrict-workspace-admins/restrict-workspace-admins.go new file mode 100755 index 0000000000..4bbfe21dba --- /dev/null +++ b/cmd/workspace/restrict-workspace-admins/restrict-workspace-admins.go @@ -0,0 +1,244 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package restrict_workspace_admins + +import ( + "fmt" + + "github.com/databricks/cli/cmd/root" + "github.com/databricks/cli/libs/cmdio" + "github.com/databricks/cli/libs/flags" + "github.com/databricks/databricks-sdk-go/service/settings" + "github.com/spf13/cobra" +) + +// Slice with functions to override default command behavior. +// Functions can be added from the `init()` function in manually curated files in this directory. +var cmdOverrides []func(*cobra.Command) + +func New() *cobra.Command { + cmd := &cobra.Command{ + Use: "restrict-workspace-admins", + Short: `The Restrict Workspace Admins setting lets you control the capabilities of workspace admins.`, + Long: `The Restrict Workspace Admins setting lets you control the capabilities of + workspace admins. With the setting status set to ALLOW_ALL, workspace admins + can create service principal personal access tokens on behalf of any service + principal in their workspace. Workspace admins can also change a job owner to + any user in their workspace. And they can change the job run_as setting to any + user in their workspace or to a service principal on which they have the + Service Principal User role. With the setting status set to + RESTRICT_TOKENS_AND_JOB_RUN_AS, workspace admins can only create personal + access tokens on behalf of service principals they have the Service Principal + User role on. They can also only change a job owner to themselves. And they + can change the job run_as setting to themselves or to a service principal on + which they have the Service Principal User role.`, + GroupID: "settings", + Annotations: map[string]string{ + "package": "settings", + }, + } + + // Apply optional overrides to this command. + for _, fn := range cmdOverrides { + fn(cmd) + } + + return cmd +} + +// start delete command + +// Slice with functions to override default command behavior. +// Functions can be added from the `init()` function in manually curated files in this directory. +var deleteOverrides []func( + *cobra.Command, + *settings.DeleteRestrictWorkspaceAdminRequest, +) + +func newDelete() *cobra.Command { + cmd := &cobra.Command{} + + var deleteReq settings.DeleteRestrictWorkspaceAdminRequest + + // TODO: short flags + + cmd.Flags().StringVar(&deleteReq.Etag, "etag", deleteReq.Etag, `etag used for versioning.`) + + cmd.Use = "delete" + cmd.Short = `Delete the restrict workspace admins setting.` + cmd.Long = `Delete the restrict workspace admins setting. + + Reverts the restrict workspace admins setting status for the workspace. A + fresh etag needs to be provided in DELETE requests (as a query parameter). + The etag can be retrieved by making a GET request before the DELETE request. + If the setting is updated/deleted concurrently, DELETE fails with 409 and + the request must be retried by using the fresh etag in the 409 response.` + + cmd.Annotations = make(map[string]string) + + cmd.Args = func(cmd *cobra.Command, args []string) error { + check := cobra.ExactArgs(0) + return check(cmd, args) + } + + cmd.PreRunE = root.MustWorkspaceClient + cmd.RunE = func(cmd *cobra.Command, args []string) (err error) { + ctx := cmd.Context() + w := root.WorkspaceClient(ctx) + + response, err := w.RestrictWorkspaceAdmins.Delete(ctx, deleteReq) + if err != nil { + return err + } + return cmdio.Render(ctx, response) + } + + // Disable completions since they are not applicable. + // Can be overridden by manual implementation in `override.go`. + cmd.ValidArgsFunction = cobra.NoFileCompletions + + // Apply optional overrides to this command. + for _, fn := range deleteOverrides { + fn(cmd, &deleteReq) + } + + return cmd +} + +func init() { + cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { + cmd.AddCommand(newDelete()) + }) +} + +// start get command + +// Slice with functions to override default command behavior. +// Functions can be added from the `init()` function in manually curated files in this directory. +var getOverrides []func( + *cobra.Command, + *settings.GetRestrictWorkspaceAdminRequest, +) + +func newGet() *cobra.Command { + cmd := &cobra.Command{} + + var getReq settings.GetRestrictWorkspaceAdminRequest + + // TODO: short flags + + cmd.Flags().StringVar(&getReq.Etag, "etag", getReq.Etag, `etag used for versioning.`) + + cmd.Use = "get" + cmd.Short = `Get the restrict workspace admins setting.` + cmd.Long = `Get the restrict workspace admins setting. + + Gets the restrict workspace admins setting.` + + cmd.Annotations = make(map[string]string) + + cmd.Args = func(cmd *cobra.Command, args []string) error { + check := cobra.ExactArgs(0) + return check(cmd, args) + } + + cmd.PreRunE = root.MustWorkspaceClient + cmd.RunE = func(cmd *cobra.Command, args []string) (err error) { + ctx := cmd.Context() + w := root.WorkspaceClient(ctx) + + response, err := w.RestrictWorkspaceAdmins.Get(ctx, getReq) + if err != nil { + return err + } + return cmdio.Render(ctx, response) + } + + // Disable completions since they are not applicable. + // Can be overridden by manual implementation in `override.go`. + cmd.ValidArgsFunction = cobra.NoFileCompletions + + // Apply optional overrides to this command. + for _, fn := range getOverrides { + fn(cmd, &getReq) + } + + return cmd +} + +func init() { + cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { + cmd.AddCommand(newGet()) + }) +} + +// start update command + +// Slice with functions to override default command behavior. +// Functions can be added from the `init()` function in manually curated files in this directory. +var updateOverrides []func( + *cobra.Command, + *settings.UpdateRestrictWorkspaceAdminsSettingRequest, +) + +func newUpdate() *cobra.Command { + cmd := &cobra.Command{} + + var updateReq settings.UpdateRestrictWorkspaceAdminsSettingRequest + var updateJson flags.JsonFlag + + // TODO: short flags + cmd.Flags().Var(&updateJson, "json", `either inline JSON string or @path/to/file.json with request body`) + + cmd.Use = "update" + cmd.Short = `Update the restrict workspace admins setting.` + cmd.Long = `Update the restrict workspace admins setting. + + Updates the restrict workspace admins setting for the workspace. A fresh etag + needs to be provided in PATCH requests (as part of the setting field). The + etag can be retrieved by making a GET request before the PATCH request. If + the setting is updated concurrently, PATCH fails with 409 and the request + must be retried by using the fresh etag in the 409 response.` + + cmd.Annotations = make(map[string]string) + + cmd.PreRunE = root.MustWorkspaceClient + cmd.RunE = func(cmd *cobra.Command, args []string) (err error) { + ctx := cmd.Context() + w := root.WorkspaceClient(ctx) + + if cmd.Flags().Changed("json") { + err = updateJson.Unmarshal(&updateReq) + if err != nil { + return err + } + } else { + return fmt.Errorf("please provide command input in JSON format by specifying the --json flag") + } + + response, err := w.RestrictWorkspaceAdmins.Update(ctx, updateReq) + if err != nil { + return err + } + return cmdio.Render(ctx, response) + } + + // Disable completions since they are not applicable. + // Can be overridden by manual implementation in `override.go`. + cmd.ValidArgsFunction = cobra.NoFileCompletions + + // Apply optional overrides to this command. + for _, fn := range updateOverrides { + fn(cmd, &updateReq) + } + + return cmd +} + +func init() { + cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { + cmd.AddCommand(newUpdate()) + }) +} + +// end service RestrictWorkspaceAdmins diff --git a/cmd/workspace/schemas/schemas.go b/cmd/workspace/schemas/schemas.go index ebdab2ab50..a5df090fba 100755 --- a/cmd/workspace/schemas/schemas.go +++ b/cmd/workspace/schemas/schemas.go @@ -182,11 +182,11 @@ func newDelete() *cobra.Command { } deleteReq.FullName = args[0] - err = w.Schemas.Delete(ctx, deleteReq) + response, err := w.Schemas.Delete(ctx, deleteReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. diff --git a/cmd/workspace/secrets/secrets.go b/cmd/workspace/secrets/secrets.go index ec6423d06a..b0c4d2210c 100755 --- a/cmd/workspace/secrets/secrets.go +++ b/cmd/workspace/secrets/secrets.go @@ -108,11 +108,11 @@ func newCreateScope() *cobra.Command { createScopeReq.Scope = args[0] } - err = w.Secrets.CreateScope(ctx, createScopeReq) + response, err := w.Secrets.CreateScope(ctx, createScopeReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -198,11 +198,11 @@ func newDeleteAcl() *cobra.Command { deleteAclReq.Principal = args[1] } - err = w.Secrets.DeleteAcl(ctx, deleteAclReq) + response, err := w.Secrets.DeleteAcl(ctx, deleteAclReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -283,11 +283,11 @@ func newDeleteScope() *cobra.Command { deleteScopeReq.Scope = args[0] } - err = w.Secrets.DeleteScope(ctx, deleteScopeReq) + response, err := w.Secrets.DeleteScope(ctx, deleteScopeReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -373,11 +373,11 @@ func newDeleteSecret() *cobra.Command { deleteSecretReq.Key = args[1] } - err = w.Secrets.DeleteSecret(ctx, deleteSecretReq) + response, err := w.Secrets.DeleteSecret(ctx, deleteSecretReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -820,11 +820,11 @@ func newPutAcl() *cobra.Command { } } - err = w.Secrets.PutAcl(ctx, putAclReq) + response, err := w.Secrets.PutAcl(ctx, putAclReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. diff --git a/cmd/workspace/service-principals/service-principals.go b/cmd/workspace/service-principals/service-principals.go index 353c087611..ebc06419f9 100755 --- a/cmd/workspace/service-principals/service-principals.go +++ b/cmd/workspace/service-principals/service-principals.go @@ -169,11 +169,11 @@ func newDelete() *cobra.Command { } deleteReq.Id = args[0] - err = w.ServicePrincipals.Delete(ctx, deleteReq) + response, err := w.ServicePrincipals.Delete(ctx, deleteReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -398,11 +398,11 @@ func newPatch() *cobra.Command { } patchReq.Id = args[0] - err = w.ServicePrincipals.Patch(ctx, patchReq) + response, err := w.ServicePrincipals.Patch(ctx, patchReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -494,11 +494,11 @@ func newUpdate() *cobra.Command { } updateReq.Id = args[0] - err = w.ServicePrincipals.Update(ctx, updateReq) + response, err := w.ServicePrincipals.Update(ctx, updateReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. diff --git a/cmd/workspace/serving-endpoints/serving-endpoints.go b/cmd/workspace/serving-endpoints/serving-endpoints.go index 9424c5e4e7..f565b5269c 100755 --- a/cmd/workspace/serving-endpoints/serving-endpoints.go +++ b/cmd/workspace/serving-endpoints/serving-endpoints.go @@ -238,11 +238,11 @@ func newDelete() *cobra.Command { deleteReq.Name = args[0] - err = w.ServingEndpoints.Delete(ctx, deleteReq) + response, err := w.ServingEndpoints.Delete(ctx, deleteReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -304,11 +304,11 @@ func newExportMetrics() *cobra.Command { exportMetricsReq.Name = args[0] - err = w.ServingEndpoints.ExportMetrics(ctx, exportMetricsReq) + response, err := w.ServingEndpoints.ExportMetrics(ctx, exportMetricsReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. diff --git a/cmd/workspace/settings/settings.go b/cmd/workspace/settings/settings.go index 35b65eb648..f3ff41f0e7 100755 --- a/cmd/workspace/settings/settings.go +++ b/cmd/workspace/settings/settings.go @@ -3,12 +3,6 @@ package settings import ( - "fmt" - - "github.com/databricks/cli/cmd/root" - "github.com/databricks/cli/libs/cmdio" - "github.com/databricks/cli/libs/flags" - "github.com/databricks/databricks-sdk-go/service/settings" "github.com/spf13/cobra" ) @@ -18,24 +12,16 @@ var cmdOverrides []func(*cobra.Command) func New() *cobra.Command { cmd := &cobra.Command{ - Use: "settings", - Short: `The default namespace setting API allows users to configure the default namespace for a Databricks workspace.`, - Long: `The default namespace setting API allows users to configure the default - namespace for a Databricks workspace. - - Through this API, users can retrieve, set, or modify the default namespace - used when queries do not reference a fully qualified three-level name. For - example, if you use the API to set 'retail_prod' as the default catalog, then - a query 'SELECT * FROM myTable' would reference the object - 'retail_prod.default.myTable' (the schema 'default' is always assumed). - - This setting requires a restart of clusters and SQL warehouses to take effect. - Additionally, the default namespace only applies when using Unity - Catalog-enabled compute.`, + Use: "settings", + Short: `Workspace Settings API allows users to manage settings at the workspace level.`, + Long: `Workspace Settings API allows users to manage settings at the workspace level.`, GroupID: "settings", Annotations: map[string]string{ "package": "settings", }, + + // This service is being previewed; hide from help output. + Hidden: true, } // Apply optional overrides to this command. @@ -46,396 +32,4 @@ func New() *cobra.Command { return cmd } -// start delete-default-namespace-setting command - -// Slice with functions to override default command behavior. -// Functions can be added from the `init()` function in manually curated files in this directory. -var deleteDefaultNamespaceSettingOverrides []func( - *cobra.Command, - *settings.DeleteDefaultNamespaceSettingRequest, -) - -func newDeleteDefaultNamespaceSetting() *cobra.Command { - cmd := &cobra.Command{} - - var deleteDefaultNamespaceSettingReq settings.DeleteDefaultNamespaceSettingRequest - - // TODO: short flags - - cmd.Flags().StringVar(&deleteDefaultNamespaceSettingReq.Etag, "etag", deleteDefaultNamespaceSettingReq.Etag, `etag used for versioning.`) - - cmd.Use = "delete-default-namespace-setting" - cmd.Short = `Delete the default namespace setting.` - cmd.Long = `Delete the default namespace setting. - - Deletes the default namespace setting for the workspace. A fresh etag needs to - be provided in DELETE requests (as a query parameter). The etag can be - retrieved by making a GET request before the DELETE request. If the setting is - updated/deleted concurrently, DELETE will fail with 409 and the request will - need to be retried by using the fresh etag in the 409 response.` - - cmd.Annotations = make(map[string]string) - - cmd.Args = func(cmd *cobra.Command, args []string) error { - check := cobra.ExactArgs(0) - return check(cmd, args) - } - - cmd.PreRunE = root.MustWorkspaceClient - cmd.RunE = func(cmd *cobra.Command, args []string) (err error) { - ctx := cmd.Context() - w := root.WorkspaceClient(ctx) - - response, err := w.Settings.DeleteDefaultNamespaceSetting(ctx, deleteDefaultNamespaceSettingReq) - if err != nil { - return err - } - return cmdio.Render(ctx, response) - } - - // Disable completions since they are not applicable. - // Can be overridden by manual implementation in `override.go`. - cmd.ValidArgsFunction = cobra.NoFileCompletions - - // Apply optional overrides to this command. - for _, fn := range deleteDefaultNamespaceSettingOverrides { - fn(cmd, &deleteDefaultNamespaceSettingReq) - } - - return cmd -} - -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDeleteDefaultNamespaceSetting()) - }) -} - -// start delete-restrict-workspace-admins-setting command - -// Slice with functions to override default command behavior. -// Functions can be added from the `init()` function in manually curated files in this directory. -var deleteRestrictWorkspaceAdminsSettingOverrides []func( - *cobra.Command, - *settings.DeleteRestrictWorkspaceAdminsSettingRequest, -) - -func newDeleteRestrictWorkspaceAdminsSetting() *cobra.Command { - cmd := &cobra.Command{} - - var deleteRestrictWorkspaceAdminsSettingReq settings.DeleteRestrictWorkspaceAdminsSettingRequest - - // TODO: short flags - - cmd.Flags().StringVar(&deleteRestrictWorkspaceAdminsSettingReq.Etag, "etag", deleteRestrictWorkspaceAdminsSettingReq.Etag, `etag used for versioning.`) - - cmd.Use = "delete-restrict-workspace-admins-setting" - cmd.Short = `Delete the restrict workspace admins setting.` - cmd.Long = `Delete the restrict workspace admins setting. - - Reverts the restrict workspace admins setting status for the workspace. A - fresh etag needs to be provided in DELETE requests (as a query parameter). The - etag can be retrieved by making a GET request before the DELETE request. If - the setting is updated/deleted concurrently, DELETE will fail with 409 and the - request will need to be retried by using the fresh etag in the 409 response.` - - cmd.Annotations = make(map[string]string) - - cmd.Args = func(cmd *cobra.Command, args []string) error { - check := cobra.ExactArgs(0) - return check(cmd, args) - } - - cmd.PreRunE = root.MustWorkspaceClient - cmd.RunE = func(cmd *cobra.Command, args []string) (err error) { - ctx := cmd.Context() - w := root.WorkspaceClient(ctx) - - response, err := w.Settings.DeleteRestrictWorkspaceAdminsSetting(ctx, deleteRestrictWorkspaceAdminsSettingReq) - if err != nil { - return err - } - return cmdio.Render(ctx, response) - } - - // Disable completions since they are not applicable. - // Can be overridden by manual implementation in `override.go`. - cmd.ValidArgsFunction = cobra.NoFileCompletions - - // Apply optional overrides to this command. - for _, fn := range deleteRestrictWorkspaceAdminsSettingOverrides { - fn(cmd, &deleteRestrictWorkspaceAdminsSettingReq) - } - - return cmd -} - -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDeleteRestrictWorkspaceAdminsSetting()) - }) -} - -// start get-default-namespace-setting command - -// Slice with functions to override default command behavior. -// Functions can be added from the `init()` function in manually curated files in this directory. -var getDefaultNamespaceSettingOverrides []func( - *cobra.Command, - *settings.GetDefaultNamespaceSettingRequest, -) - -func newGetDefaultNamespaceSetting() *cobra.Command { - cmd := &cobra.Command{} - - var getDefaultNamespaceSettingReq settings.GetDefaultNamespaceSettingRequest - - // TODO: short flags - - cmd.Flags().StringVar(&getDefaultNamespaceSettingReq.Etag, "etag", getDefaultNamespaceSettingReq.Etag, `etag used for versioning.`) - - cmd.Use = "get-default-namespace-setting" - cmd.Short = `Get the default namespace setting.` - cmd.Long = `Get the default namespace setting. - - Gets the default namespace setting.` - - cmd.Annotations = make(map[string]string) - - cmd.Args = func(cmd *cobra.Command, args []string) error { - check := cobra.ExactArgs(0) - return check(cmd, args) - } - - cmd.PreRunE = root.MustWorkspaceClient - cmd.RunE = func(cmd *cobra.Command, args []string) (err error) { - ctx := cmd.Context() - w := root.WorkspaceClient(ctx) - - response, err := w.Settings.GetDefaultNamespaceSetting(ctx, getDefaultNamespaceSettingReq) - if err != nil { - return err - } - return cmdio.Render(ctx, response) - } - - // Disable completions since they are not applicable. - // Can be overridden by manual implementation in `override.go`. - cmd.ValidArgsFunction = cobra.NoFileCompletions - - // Apply optional overrides to this command. - for _, fn := range getDefaultNamespaceSettingOverrides { - fn(cmd, &getDefaultNamespaceSettingReq) - } - - return cmd -} - -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGetDefaultNamespaceSetting()) - }) -} - -// start get-restrict-workspace-admins-setting command - -// Slice with functions to override default command behavior. -// Functions can be added from the `init()` function in manually curated files in this directory. -var getRestrictWorkspaceAdminsSettingOverrides []func( - *cobra.Command, - *settings.GetRestrictWorkspaceAdminsSettingRequest, -) - -func newGetRestrictWorkspaceAdminsSetting() *cobra.Command { - cmd := &cobra.Command{} - - var getRestrictWorkspaceAdminsSettingReq settings.GetRestrictWorkspaceAdminsSettingRequest - - // TODO: short flags - - cmd.Flags().StringVar(&getRestrictWorkspaceAdminsSettingReq.Etag, "etag", getRestrictWorkspaceAdminsSettingReq.Etag, `etag used for versioning.`) - - cmd.Use = "get-restrict-workspace-admins-setting" - cmd.Short = `Get the restrict workspace admins setting.` - cmd.Long = `Get the restrict workspace admins setting. - - Gets the restrict workspace admins setting.` - - cmd.Annotations = make(map[string]string) - - cmd.Args = func(cmd *cobra.Command, args []string) error { - check := cobra.ExactArgs(0) - return check(cmd, args) - } - - cmd.PreRunE = root.MustWorkspaceClient - cmd.RunE = func(cmd *cobra.Command, args []string) (err error) { - ctx := cmd.Context() - w := root.WorkspaceClient(ctx) - - response, err := w.Settings.GetRestrictWorkspaceAdminsSetting(ctx, getRestrictWorkspaceAdminsSettingReq) - if err != nil { - return err - } - return cmdio.Render(ctx, response) - } - - // Disable completions since they are not applicable. - // Can be overridden by manual implementation in `override.go`. - cmd.ValidArgsFunction = cobra.NoFileCompletions - - // Apply optional overrides to this command. - for _, fn := range getRestrictWorkspaceAdminsSettingOverrides { - fn(cmd, &getRestrictWorkspaceAdminsSettingReq) - } - - return cmd -} - -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGetRestrictWorkspaceAdminsSetting()) - }) -} - -// start update-default-namespace-setting command - -// Slice with functions to override default command behavior. -// Functions can be added from the `init()` function in manually curated files in this directory. -var updateDefaultNamespaceSettingOverrides []func( - *cobra.Command, - *settings.UpdateDefaultNamespaceSettingRequest, -) - -func newUpdateDefaultNamespaceSetting() *cobra.Command { - cmd := &cobra.Command{} - - var updateDefaultNamespaceSettingReq settings.UpdateDefaultNamespaceSettingRequest - var updateDefaultNamespaceSettingJson flags.JsonFlag - - // TODO: short flags - cmd.Flags().Var(&updateDefaultNamespaceSettingJson, "json", `either inline JSON string or @path/to/file.json with request body`) - - cmd.Use = "update-default-namespace-setting" - cmd.Short = `Update the default namespace setting.` - cmd.Long = `Update the default namespace setting. - - Updates the default namespace setting for the workspace. A fresh etag needs to - be provided in PATCH requests (as part of the setting field). The etag can be - retrieved by making a GET request before the PATCH request. Note that if the - setting does not exist, GET will return a NOT_FOUND error and the etag will be - present in the error response, which should be set in the PATCH request. If - the setting is updated concurrently, PATCH will fail with 409 and the request - will need to be retried by using the fresh etag in the 409 response.` - - cmd.Annotations = make(map[string]string) - - cmd.PreRunE = root.MustWorkspaceClient - cmd.RunE = func(cmd *cobra.Command, args []string) (err error) { - ctx := cmd.Context() - w := root.WorkspaceClient(ctx) - - if cmd.Flags().Changed("json") { - err = updateDefaultNamespaceSettingJson.Unmarshal(&updateDefaultNamespaceSettingReq) - if err != nil { - return err - } - } else { - return fmt.Errorf("please provide command input in JSON format by specifying the --json flag") - } - - response, err := w.Settings.UpdateDefaultNamespaceSetting(ctx, updateDefaultNamespaceSettingReq) - if err != nil { - return err - } - return cmdio.Render(ctx, response) - } - - // Disable completions since they are not applicable. - // Can be overridden by manual implementation in `override.go`. - cmd.ValidArgsFunction = cobra.NoFileCompletions - - // Apply optional overrides to this command. - for _, fn := range updateDefaultNamespaceSettingOverrides { - fn(cmd, &updateDefaultNamespaceSettingReq) - } - - return cmd -} - -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdateDefaultNamespaceSetting()) - }) -} - -// start update-restrict-workspace-admins-setting command - -// Slice with functions to override default command behavior. -// Functions can be added from the `init()` function in manually curated files in this directory. -var updateRestrictWorkspaceAdminsSettingOverrides []func( - *cobra.Command, - *settings.UpdateRestrictWorkspaceAdminsSettingRequest, -) - -func newUpdateRestrictWorkspaceAdminsSetting() *cobra.Command { - cmd := &cobra.Command{} - - var updateRestrictWorkspaceAdminsSettingReq settings.UpdateRestrictWorkspaceAdminsSettingRequest - var updateRestrictWorkspaceAdminsSettingJson flags.JsonFlag - - // TODO: short flags - cmd.Flags().Var(&updateRestrictWorkspaceAdminsSettingJson, "json", `either inline JSON string or @path/to/file.json with request body`) - - cmd.Use = "update-restrict-workspace-admins-setting" - cmd.Short = `Update the restrict workspace admins setting.` - cmd.Long = `Update the restrict workspace admins setting. - - Updates the restrict workspace admins setting for the workspace. A fresh etag - needs to be provided in PATCH requests (as part of the setting field). The - etag can be retrieved by making a GET request before the PATCH request. If the - setting is updated concurrently, PATCH will fail with 409 and the request will - need to be retried by using the fresh etag in the 409 response.` - - cmd.Annotations = make(map[string]string) - - cmd.PreRunE = root.MustWorkspaceClient - cmd.RunE = func(cmd *cobra.Command, args []string) (err error) { - ctx := cmd.Context() - w := root.WorkspaceClient(ctx) - - if cmd.Flags().Changed("json") { - err = updateRestrictWorkspaceAdminsSettingJson.Unmarshal(&updateRestrictWorkspaceAdminsSettingReq) - if err != nil { - return err - } - } else { - return fmt.Errorf("please provide command input in JSON format by specifying the --json flag") - } - - response, err := w.Settings.UpdateRestrictWorkspaceAdminsSetting(ctx, updateRestrictWorkspaceAdminsSettingReq) - if err != nil { - return err - } - return cmdio.Render(ctx, response) - } - - // Disable completions since they are not applicable. - // Can be overridden by manual implementation in `override.go`. - cmd.ValidArgsFunction = cobra.NoFileCompletions - - // Apply optional overrides to this command. - for _, fn := range updateRestrictWorkspaceAdminsSettingOverrides { - fn(cmd, &updateRestrictWorkspaceAdminsSettingReq) - } - - return cmd -} - -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdateRestrictWorkspaceAdminsSetting()) - }) -} - // end service Settings diff --git a/cmd/workspace/shares/shares.go b/cmd/workspace/shares/shares.go index 2c0479a0a5..6cfee46822 100755 --- a/cmd/workspace/shares/shares.go +++ b/cmd/workspace/shares/shares.go @@ -164,11 +164,11 @@ func newDelete() *cobra.Command { deleteReq.Name = args[0] - err = w.Shares.Delete(ctx, deleteReq) + response, err := w.Shares.Delete(ctx, deleteReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -511,11 +511,11 @@ func newUpdatePermissions() *cobra.Command { } updatePermissionsReq.Name = args[0] - err = w.Shares.UpdatePermissions(ctx, updatePermissionsReq) + response, err := w.Shares.UpdatePermissions(ctx, updatePermissionsReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. diff --git a/cmd/workspace/storage-credentials/storage-credentials.go b/cmd/workspace/storage-credentials/storage-credentials.go index 4a0d8f309c..c849629f6c 100755 --- a/cmd/workspace/storage-credentials/storage-credentials.go +++ b/cmd/workspace/storage-credentials/storage-credentials.go @@ -191,11 +191,11 @@ func newDelete() *cobra.Command { } deleteReq.Name = args[0] - err = w.StorageCredentials.Delete(ctx, deleteReq) + response, err := w.StorageCredentials.Delete(ctx, deleteReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -479,7 +479,7 @@ func newValidate() *cobra.Command { // TODO: output-only field cmd.Flags().StringVar(&validateReq.ExternalLocationName, "external-location-name", validateReq.ExternalLocationName, `The name of an existing external location to validate.`) cmd.Flags().BoolVar(&validateReq.ReadOnly, "read-only", validateReq.ReadOnly, `Whether the storage credential is only usable for read operations.`) - // TODO: any: storage_credential_name + cmd.Flags().StringVar(&validateReq.StorageCredentialName, "storage-credential-name", validateReq.StorageCredentialName, `The name of the storage credential to validate.`) cmd.Flags().StringVar(&validateReq.Url, "url", validateReq.Url, `The external location url to validate.`) cmd.Use = "validate" diff --git a/cmd/workspace/system-schemas/system-schemas.go b/cmd/workspace/system-schemas/system-schemas.go index 9b2392a6e9..326840d106 100755 --- a/cmd/workspace/system-schemas/system-schemas.go +++ b/cmd/workspace/system-schemas/system-schemas.go @@ -81,11 +81,11 @@ func newDisable() *cobra.Command { return fmt.Errorf("invalid SCHEMA_NAME: %s", args[1]) } - err = w.SystemSchemas.Disable(ctx, disableReq) + response, err := w.SystemSchemas.Disable(ctx, disableReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -151,11 +151,11 @@ func newEnable() *cobra.Command { return fmt.Errorf("invalid SCHEMA_NAME: %s", args[1]) } - err = w.SystemSchemas.Enable(ctx, enableReq) + response, err := w.SystemSchemas.Enable(ctx, enableReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. diff --git a/cmd/workspace/table-constraints/table-constraints.go b/cmd/workspace/table-constraints/table-constraints.go index e17b95404a..85638cb1fd 100755 --- a/cmd/workspace/table-constraints/table-constraints.go +++ b/cmd/workspace/table-constraints/table-constraints.go @@ -177,11 +177,11 @@ func newDelete() *cobra.Command { return fmt.Errorf("invalid CASCADE: %s", args[2]) } - err = w.TableConstraints.Delete(ctx, deleteReq) + response, err := w.TableConstraints.Delete(ctx, deleteReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. diff --git a/cmd/workspace/tables/tables.go b/cmd/workspace/tables/tables.go index d4e76587d8..ed41f499c0 100755 --- a/cmd/workspace/tables/tables.go +++ b/cmd/workspace/tables/tables.go @@ -98,11 +98,11 @@ func newDelete() *cobra.Command { } deleteReq.FullName = args[0] - err = w.Tables.Delete(ctx, deleteReq) + response, err := w.Tables.Delete(ctx, deleteReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -520,11 +520,11 @@ func newUpdate() *cobra.Command { } updateReq.FullName = args[0] - err = w.Tables.Update(ctx, updateReq) + response, err := w.Tables.Update(ctx, updateReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. diff --git a/cmd/workspace/token-management/token-management.go b/cmd/workspace/token-management/token-management.go index 1c2e2c37c0..052ecab3f5 100755 --- a/cmd/workspace/token-management/token-management.go +++ b/cmd/workspace/token-management/token-management.go @@ -187,11 +187,11 @@ func newDelete() *cobra.Command { } deleteReq.TokenId = args[0] - err = w.TokenManagement.Delete(ctx, deleteReq) + response, err := w.TokenManagement.Delete(ctx, deleteReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. diff --git a/cmd/workspace/tokens/tokens.go b/cmd/workspace/tokens/tokens.go index 5550acfa5d..5af8648d9b 100755 --- a/cmd/workspace/tokens/tokens.go +++ b/cmd/workspace/tokens/tokens.go @@ -184,11 +184,11 @@ func newDelete() *cobra.Command { deleteReq.TokenId = args[0] } - err = w.Tokens.Delete(ctx, deleteReq) + response, err := w.Tokens.Delete(ctx, deleteReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. diff --git a/cmd/workspace/users/users.go b/cmd/workspace/users/users.go index 078a712e4c..1c1e5e416f 100755 --- a/cmd/workspace/users/users.go +++ b/cmd/workspace/users/users.go @@ -178,11 +178,11 @@ func newDelete() *cobra.Command { } deleteReq.Id = args[0] - err = w.Users.Delete(ctx, deleteReq) + response, err := w.Users.Delete(ctx, deleteReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -511,11 +511,11 @@ func newPatch() *cobra.Command { } patchReq.Id = args[0] - err = w.Users.Patch(ctx, patchReq) + response, err := w.Users.Patch(ctx, patchReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -679,11 +679,11 @@ func newUpdate() *cobra.Command { } updateReq.Id = args[0] - err = w.Users.Update(ctx, updateReq) + response, err := w.Users.Update(ctx, updateReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. diff --git a/cmd/workspace/vector-search-endpoints/vector-search-endpoints.go b/cmd/workspace/vector-search-endpoints/vector-search-endpoints.go index d6863b6606..287b775a3b 100755 --- a/cmd/workspace/vector-search-endpoints/vector-search-endpoints.go +++ b/cmd/workspace/vector-search-endpoints/vector-search-endpoints.go @@ -164,18 +164,17 @@ func newDeleteEndpoint() *cobra.Command { // TODO: short flags - cmd.Use = "delete-endpoint ENDPOINT_NAME NAME" + cmd.Use = "delete-endpoint ENDPOINT_NAME" cmd.Short = `Delete an endpoint.` cmd.Long = `Delete an endpoint. Arguments: - ENDPOINT_NAME: Name of the endpoint - NAME: Name of the endpoint to delete` + ENDPOINT_NAME: Name of the endpoint` cmd.Annotations = make(map[string]string) cmd.Args = func(cmd *cobra.Command, args []string) error { - check := cobra.ExactArgs(2) + check := cobra.ExactArgs(1) return check(cmd, args) } @@ -185,13 +184,12 @@ func newDeleteEndpoint() *cobra.Command { w := root.WorkspaceClient(ctx) deleteEndpointReq.EndpointName = args[0] - deleteEndpointReq.Name = args[1] - err = w.VectorSearchEndpoints.DeleteEndpoint(ctx, deleteEndpointReq) + response, err := w.VectorSearchEndpoints.DeleteEndpoint(ctx, deleteEndpointReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. diff --git a/cmd/workspace/vector-search-indexes/vector-search-indexes.go b/cmd/workspace/vector-search-indexes/vector-search-indexes.go index 6beca7d219..740681bd3d 100755 --- a/cmd/workspace/vector-search-indexes/vector-search-indexes.go +++ b/cmd/workspace/vector-search-indexes/vector-search-indexes.go @@ -63,9 +63,8 @@ func newCreateIndex() *cobra.Command { // TODO: complex arg: delta_sync_index_spec // TODO: complex arg: direct_access_index_spec - cmd.Flags().StringVar(&createIndexReq.EndpointName, "endpoint-name", createIndexReq.EndpointName, `Name of the endpoint to be used for serving the index.`) - cmd.Use = "create-index NAME PRIMARY_KEY INDEX_TYPE" + cmd.Use = "create-index NAME ENDPOINT_NAME PRIMARY_KEY INDEX_TYPE" cmd.Short = `Create an index.` cmd.Long = `Create an index. @@ -73,6 +72,7 @@ func newCreateIndex() *cobra.Command { Arguments: NAME: Name of the index + ENDPOINT_NAME: Name of the endpoint to be used for serving the index PRIMARY_KEY: Primary key of the index INDEX_TYPE: There are 2 types of Vector Search indexes: @@ -88,11 +88,11 @@ func newCreateIndex() *cobra.Command { if cmd.Flags().Changed("json") { err := cobra.ExactArgs(0)(cmd, args) if err != nil { - return fmt.Errorf("when --json flag is specified, no positional arguments are required. Provide 'name', 'primary_key', 'index_type' in your JSON input") + return fmt.Errorf("when --json flag is specified, no positional arguments are required. Provide 'name', 'endpoint_name', 'primary_key', 'index_type' in your JSON input") } return nil } - check := cobra.ExactArgs(3) + check := cobra.ExactArgs(4) return check(cmd, args) } @@ -111,12 +111,15 @@ func newCreateIndex() *cobra.Command { createIndexReq.Name = args[0] } if !cmd.Flags().Changed("json") { - createIndexReq.PrimaryKey = args[1] + createIndexReq.EndpointName = args[1] } if !cmd.Flags().Changed("json") { - _, err = fmt.Sscan(args[2], &createIndexReq.IndexType) + createIndexReq.PrimaryKey = args[2] + } + if !cmd.Flags().Changed("json") { + _, err = fmt.Sscan(args[3], &createIndexReq.IndexType) if err != nil { - return fmt.Errorf("invalid INDEX_TYPE: %s", args[2]) + return fmt.Errorf("invalid INDEX_TYPE: %s", args[3]) } } @@ -163,14 +166,14 @@ func newDeleteDataVectorIndex() *cobra.Command { // TODO: short flags cmd.Flags().Var(&deleteDataVectorIndexJson, "json", `either inline JSON string or @path/to/file.json with request body`) - cmd.Use = "delete-data-vector-index NAME" + cmd.Use = "delete-data-vector-index INDEX_NAME" cmd.Short = `Delete data from index.` cmd.Long = `Delete data from index. Handles the deletion of data from a specified vector index. Arguments: - NAME: Name of the vector index where data is to be deleted. Must be a Direct + INDEX_NAME: Name of the vector index where data is to be deleted. Must be a Direct Vector Access Index.` cmd.Annotations = make(map[string]string) @@ -193,7 +196,7 @@ func newDeleteDataVectorIndex() *cobra.Command { } else { return fmt.Errorf("please provide command input in JSON format by specifying the --json flag") } - deleteDataVectorIndexReq.Name = args[0] + deleteDataVectorIndexReq.IndexName = args[0] response, err := w.VectorSearchIndexes.DeleteDataVectorIndex(ctx, deleteDataVectorIndexReq) if err != nil { @@ -259,11 +262,11 @@ func newDeleteIndex() *cobra.Command { deleteIndexReq.IndexName = args[0] - err = w.VectorSearchIndexes.DeleteIndex(ctx, deleteIndexReq) + response, err := w.VectorSearchIndexes.DeleteIndex(ctx, deleteIndexReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -529,11 +532,11 @@ func newSyncIndex() *cobra.Command { syncIndexReq.IndexName = args[0] - err = w.VectorSearchIndexes.SyncIndex(ctx, syncIndexReq) + response, err := w.VectorSearchIndexes.SyncIndex(ctx, syncIndexReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -572,14 +575,14 @@ func newUpsertDataVectorIndex() *cobra.Command { // TODO: short flags cmd.Flags().Var(&upsertDataVectorIndexJson, "json", `either inline JSON string or @path/to/file.json with request body`) - cmd.Use = "upsert-data-vector-index NAME INPUTS_JSON" + cmd.Use = "upsert-data-vector-index INDEX_NAME INPUTS_JSON" cmd.Short = `Upsert data into an index.` cmd.Long = `Upsert data into an index. Handles the upserting of data into a specified vector index. Arguments: - NAME: Name of the vector index where data is to be upserted. Must be a Direct + INDEX_NAME: Name of the vector index where data is to be upserted. Must be a Direct Vector Access Index. INPUTS_JSON: JSON string representing the data to be upserted.` @@ -589,7 +592,7 @@ func newUpsertDataVectorIndex() *cobra.Command { if cmd.Flags().Changed("json") { err := cobra.ExactArgs(1)(cmd, args) if err != nil { - return fmt.Errorf("when --json flag is specified, provide only NAME as positional arguments. Provide 'inputs_json' in your JSON input") + return fmt.Errorf("when --json flag is specified, provide only INDEX_NAME as positional arguments. Provide 'inputs_json' in your JSON input") } return nil } @@ -608,7 +611,7 @@ func newUpsertDataVectorIndex() *cobra.Command { return err } } - upsertDataVectorIndexReq.Name = args[0] + upsertDataVectorIndexReq.IndexName = args[0] if !cmd.Flags().Changed("json") { upsertDataVectorIndexReq.InputsJson = args[1] } diff --git a/cmd/workspace/volumes/volumes.go b/cmd/workspace/volumes/volumes.go index 12cafeaf86..01fc52db1d 100755 --- a/cmd/workspace/volumes/volumes.go +++ b/cmd/workspace/volumes/volumes.go @@ -213,11 +213,11 @@ func newDelete() *cobra.Command { } deleteReq.Name = args[0] - err = w.Volumes.Delete(ctx, deleteReq) + response, err := w.Volumes.Delete(ctx, deleteReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. diff --git a/cmd/workspace/warehouses/warehouses.go b/cmd/workspace/warehouses/warehouses.go index 2e9282a853..79d4979fe2 100755 --- a/cmd/workspace/warehouses/warehouses.go +++ b/cmd/workspace/warehouses/warehouses.go @@ -195,11 +195,11 @@ func newDelete() *cobra.Command { } deleteReq.Id = args[0] - err = w.Warehouses.Delete(ctx, deleteReq) + response, err := w.Warehouses.Delete(ctx, deleteReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -303,7 +303,7 @@ func newEdit() *cobra.Command { return err } if editSkipWait { - return nil + return cmdio.Render(ctx, wait.Response) } spinner := cmdio.Spinner(ctx) info, err := wait.OnProgress(func(i *sql.GetWarehouseResponse) { @@ -824,11 +824,11 @@ func newSetWorkspaceWarehouseConfig() *cobra.Command { } } - err = w.Warehouses.SetWorkspaceWarehouseConfig(ctx, setWorkspaceWarehouseConfigReq) + response, err := w.Warehouses.SetWorkspaceWarehouseConfig(ctx, setWorkspaceWarehouseConfigReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -910,7 +910,7 @@ func newStart() *cobra.Command { return err } if startSkipWait { - return nil + return cmdio.Render(ctx, wait.Response) } spinner := cmdio.Spinner(ctx) info, err := wait.OnProgress(func(i *sql.GetWarehouseResponse) { @@ -1010,7 +1010,7 @@ func newStop() *cobra.Command { return err } if stopSkipWait { - return nil + return cmdio.Render(ctx, wait.Response) } spinner := cmdio.Spinner(ctx) info, err := wait.OnProgress(func(i *sql.GetWarehouseResponse) { diff --git a/cmd/workspace/workspace-conf/workspace-conf.go b/cmd/workspace/workspace-conf/workspace-conf.go index 99207ffadc..6fb67af3ee 100755 --- a/cmd/workspace/workspace-conf/workspace-conf.go +++ b/cmd/workspace/workspace-conf/workspace-conf.go @@ -137,11 +137,11 @@ func newSetStatus() *cobra.Command { return fmt.Errorf("please provide command input in JSON format by specifying the --json flag") } - err = w.WorkspaceConf.SetStatus(ctx, setStatusReq) + response, err := w.WorkspaceConf.SetStatus(ctx, setStatusReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. diff --git a/cmd/workspace/workspace/workspace.go b/cmd/workspace/workspace/workspace.go index 4fb63f0c02..50985ade68 100755 --- a/cmd/workspace/workspace/workspace.go +++ b/cmd/workspace/workspace/workspace.go @@ -119,11 +119,11 @@ func newDelete() *cobra.Command { deleteReq.Path = args[0] } - err = w.Workspace.Delete(ctx, deleteReq) + response, err := w.Workspace.Delete(ctx, deleteReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -509,11 +509,11 @@ func newImport() *cobra.Command { importReq.Path = args[0] } - err = w.Workspace.Import(ctx, importReq) + response, err := w.Workspace.Import(ctx, importReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. @@ -677,11 +677,11 @@ func newMkdirs() *cobra.Command { mkdirsReq.Path = args[0] } - err = w.Workspace.Mkdirs(ctx, mkdirsReq) + response, err := w.Workspace.Mkdirs(ctx, mkdirsReq) if err != nil { return err } - return nil + return cmdio.Render(ctx, response) } // Disable completions since they are not applicable. diff --git a/go.mod b/go.mod index 49521f64cc..1f040cda0a 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.21 require ( github.com/briandowns/spinner v1.23.0 // Apache 2.0 - github.com/databricks/databricks-sdk-go v0.33.0 // Apache 2.0 + github.com/databricks/databricks-sdk-go v0.34.0 // Apache 2.0 github.com/fatih/color v1.16.0 // MIT github.com/ghodss/yaml v1.0.0 // MIT + NOTICE github.com/google/uuid v1.6.0 // BSD-3-Clause @@ -20,7 +20,7 @@ require ( github.com/spf13/cobra v1.8.0 // Apache 2.0 github.com/spf13/pflag v1.0.5 // BSD-3-Clause github.com/stretchr/testify v1.9.0 // MIT - golang.org/x/exp v0.0.0-20231006140011-7918f672742d + golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 golang.org/x/mod v0.15.0 golang.org/x/oauth2 v0.17.0 golang.org/x/sync v0.6.0 @@ -32,7 +32,7 @@ require ( require gopkg.in/yaml.v3 v3.0.1 require ( - cloud.google.com/go/compute v1.23.3 // indirect + cloud.google.com/go/compute v1.23.4 // indirect cloud.google.com/go/compute/metadata v0.2.3 // indirect github.com/ProtonMail/go-crypto v1.1.0-alpha.0 // indirect github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect @@ -54,18 +54,18 @@ require ( github.com/stretchr/objx v0.5.2 // indirect github.com/zclconf/go-cty v1.14.1 // indirect go.opencensus.io v0.24.0 // indirect - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0 // indirect - go.opentelemetry.io/otel v1.22.0 // indirect - go.opentelemetry.io/otel/metric v1.22.0 // indirect - go.opentelemetry.io/otel/trace v1.22.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.48.0 // indirect + go.opentelemetry.io/otel v1.23.0 // indirect + go.opentelemetry.io/otel/metric v1.23.0 // indirect + go.opentelemetry.io/otel/trace v1.23.0 // indirect golang.org/x/crypto v0.19.0 // indirect golang.org/x/net v0.21.0 // indirect golang.org/x/sys v0.17.0 // indirect golang.org/x/time v0.5.0 // indirect - google.golang.org/api v0.161.0 // indirect + google.golang.org/api v0.166.0 // indirect google.golang.org/appengine v1.6.8 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240116215550-a9fa1716bcac // indirect - google.golang.org/grpc v1.60.1 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240213162025-012b6fc9bca9 // indirect + google.golang.org/grpc v1.61.1 // indirect google.golang.org/protobuf v1.32.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect ) diff --git a/go.sum b/go.sum index 4b273bc3ca..de5f07cf77 100644 --- a/go.sum +++ b/go.sum @@ -1,6 +1,6 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go/compute v1.23.3 h1:6sVlXXBmbd7jNX0Ipq0trII3e4n1/MsADLK6a+aiVlk= -cloud.google.com/go/compute v1.23.3/go.mod h1:VCgBUoMnIVIR0CscqQiPJLAG25E3ZRZMzcFZeQ+h8CI= +cloud.google.com/go/compute v1.23.4 h1:EBT9Nw4q3zyE7G45Wvv3MzolIrCJEuHys5muLY0wvAw= +cloud.google.com/go/compute v1.23.4/go.mod h1:/EJMj55asU6kAFnuZET8zqgwgJ9FvXWXOkkfQZa4ioI= cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= @@ -28,8 +28,8 @@ github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGX github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg= github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= -github.com/databricks/databricks-sdk-go v0.33.0 h1:0ldeP8aPnpKLV/mvNKsOVijOaLLo6TxRGdIwrEf2rlQ= -github.com/databricks/databricks-sdk-go v0.33.0/go.mod h1:yyXGdhEfXBBsIoTm0mdl8QN0xzCQPUVZTozMM/7wVuI= +github.com/databricks/databricks-sdk-go v0.34.0 h1:z4JjgcCk99jAGxx3JgkMsniJFtReWhtAxkgyvtdFqCs= +github.com/databricks/databricks-sdk-go v0.34.0/go.mod h1:MGNWVPqxYCW1vj/xD7DeLT8uChi4lgTFum+iIwDxd/Q= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -94,8 +94,8 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/enterprise-certificate-proxy v0.3.2 h1:Vie5ybvEvT75RniqhfFxPRy3Bf7vr3h0cechB90XaQs= github.com/googleapis/enterprise-certificate-proxy v0.3.2/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0= -github.com/googleapis/gax-go/v2 v2.12.0 h1:A+gCJKdRfqXkr+BIRGtZLibNXf0m1f9E4HG56etFpas= -github.com/googleapis/gax-go/v2 v2.12.0/go.mod h1:y+aIqrI5eb1YGMVJfuV3185Ts/D7qKpsEkdD5+I6QGU= +github.com/googleapis/gax-go/v2 v2.12.1 h1:9F8GV9r9ztXyAi00gsMQHNoF51xPZm8uj1dpYt2ZETM= +github.com/googleapis/gax-go/v2 v2.12.1/go.mod h1:61M8vcyyXR2kqKFxKrfA22jaA8JGF7Dc8App1U3H6jc= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= @@ -160,24 +160,24 @@ github.com/zclconf/go-cty v1.14.1 h1:t9fyA35fwjjUMcmL5hLER+e/rEPqrbCK1/OSE4SI9KA github.com/zclconf/go-cty v1.14.1/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.47.0 h1:UNQQKPfTDe1J81ViolILjTKPr9WetKW6uei2hFgJmFs= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.47.0/go.mod h1:r9vWsPS/3AQItv3OSlEJ/E4mbrhUbbw18meOjArPtKQ= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0 h1:sv9kVfal0MK0wBMCOGr+HeJm9v803BkJxGrk2au7j08= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0/go.mod h1:SK2UL73Zy1quvRPonmOmRDiWk1KBV3LyIeeIxcEApWw= -go.opentelemetry.io/otel v1.22.0 h1:xS7Ku+7yTFvDfDraDIJVpw7XPyuHlB9MCiqqX5mcJ6Y= -go.opentelemetry.io/otel v1.22.0/go.mod h1:eoV4iAi3Ea8LkAEI9+GFT44O6T/D0GWAVFyZVCC6pMI= -go.opentelemetry.io/otel/metric v1.22.0 h1:lypMQnGyJYeuYPhOM/bgjbFM6WE44W1/T45er4d8Hhg= -go.opentelemetry.io/otel/metric v1.22.0/go.mod h1:evJGjVpZv0mQ5QBRJoBF64yMuOf4xCWdXjK8pzFvliY= -go.opentelemetry.io/otel/trace v1.22.0 h1:Hg6pPujv0XG9QaVbGOBVHunyuLcCC3jN7WEhPx83XD0= -go.opentelemetry.io/otel/trace v1.22.0/go.mod h1:RbbHXVqKES9QhzZq/fE5UnOSILqRt40a21sPw2He1xo= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.48.0 h1:P+/g8GpuJGYbOp2tAdKrIPUX9JO02q8Q0YNlHolpibA= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.48.0/go.mod h1:tIKj3DbO8N9Y2xo52og3irLsPI4GW02DSMtrVgNMgxg= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.48.0 h1:doUP+ExOpH3spVTLS0FcWGLnQrPct/hD/bCPbDRUEAU= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.48.0/go.mod h1:rdENBZMT2OE6Ne/KLwpiXudnAsbdrdBaqBvTN8M8BgA= +go.opentelemetry.io/otel v1.23.0 h1:Df0pqjqExIywbMCMTxkAwzjLZtRf+bBKLbUcpxO2C9E= +go.opentelemetry.io/otel v1.23.0/go.mod h1:YCycw9ZeKhcJFrb34iVSkyT0iczq/zYDtZYFufObyB0= +go.opentelemetry.io/otel/metric v1.23.0 h1:pazkx7ss4LFVVYSxYew7L5I6qvLXHA0Ap2pwV+9Cnpo= +go.opentelemetry.io/otel/metric v1.23.0/go.mod h1:MqUW2X2a6Q8RN96E2/nqNoT+z9BSms20Jb7Bbp+HiTo= +go.opentelemetry.io/otel/trace v1.23.0 h1:37Ik5Ib7xfYVb4V1UtnT97T1jI+AoIYkJyPkuL4iJgI= +go.opentelemetry.io/otel/trace v1.23.0/go.mod h1:GSGTbIClEsuZrGIzoEHqsVfxgn5UkggkflQwDScNUsk= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo= golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20231006140011-7918f672742d h1:jtJma62tbqLibJ5sFQz8bKtEM8rJBtfilJ2qTU199MI= -golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQzzkH36rKxoZW1tw7ZJpeKx+hdo= +golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 h1:LfspQV/FYTatPTr/3HzIcmiUFH7PGP+OQ6mgDYo3yuQ= +golang.org/x/exp v0.0.0-20240222234643-814bf88cf225/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -239,12 +239,12 @@ golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3 golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.14.0 h1:jvNa2pY0M4r62jkRQ6RwEZZyPcymeL9XZMLBbV7U2nc= -golang.org/x/tools v0.14.0/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg= +golang.org/x/tools v0.18.0 h1:k8NLag8AGHnn+PHbl7g43CtqZAwG60vZkLqgyZgIHgQ= +golang.org/x/tools v0.18.0/go.mod h1:GL7B4CwcLLeo59yx/9UWWuNOW1n3VZ4f5axWfML7Lcg= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/api v0.161.0 h1:oYzk/bs26WN10AV7iU7MVJVXBH8oCPS2hHyBiEeFoSU= -google.golang.org/api v0.161.0/go.mod h1:0mu0TpK33qnydLvWqbImq2b1eQ5FHRSDCBzAxX9ZHyw= +google.golang.org/api v0.166.0 h1:6m4NUwrZYhAaVIHZWxaKjw1L1vNAjtMwORmKRyEEo24= +google.golang.org/api v0.166.0/go.mod h1:4FcBc686KFi7QI/U51/2GKKevfZMpM17sCdibqe/bSA= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= @@ -252,15 +252,15 @@ google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJ google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240116215550-a9fa1716bcac h1:nUQEQmH/csSvFECKYRv6HWEyypysidKl2I6Qpsglq/0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240116215550-a9fa1716bcac/go.mod h1:daQN87bsDqDoe316QbbvX60nMoJQa4r6Ds0ZuoAe5yA= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240213162025-012b6fc9bca9 h1:hZB7eLIaYlW9qXRfCq/qDaPdbeY3757uARz5Vvfv+cY= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:YUWgXUFRPfoYK1IHMuxH5K6nPEXSCzIMljnQ59lLRCk= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= -google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= +google.golang.org/grpc v1.61.1 h1:kLAiWrZs7YeDM6MumDe7m3y4aM6wacLzM1Y/wiLP9XY= +google.golang.org/grpc v1.61.1/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= From b1d8cabc8ce80aa26ea8e64b0ce23ce1cc374d2c Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Wed, 6 Mar 2024 08:50:10 +0100 Subject: [PATCH 2/5] Incorporate model changes --- .codegen/cmds-account.go.tmpl | 4 +- .codegen/cmds-workspace.go.tmpl | 4 +- .codegen/service.go.tmpl | 6 +-- bundle/schema/docs/bundle_descriptions.json | 16 +++--- cmd/account/budgets/budgets.go | 8 +-- cmd/account/cmd.go | 6 --- cmd/account/credentials/credentials.go | 4 +- .../custom-app-integration.go | 8 +-- .../encryption-keys/encryption-keys.go | 4 +- cmd/account/groups/groups.go | 12 ++--- .../ip-access-lists/ip-access-lists.go | 12 ++--- cmd/account/log-delivery/log-delivery.go | 4 +- .../metastore-assignments.go | 12 ++--- cmd/account/metastores/metastores.go | 4 +- .../network-connectivity.go | 4 +- cmd/account/networks/networks.go | 4 +- cmd/account/private-access/private-access.go | 8 +-- .../published-app-integration.go | 8 +-- .../service-principal-secrets.go | 4 +- .../service-principals/service-principals.go | 12 ++--- .../storage-credentials.go | 4 +- cmd/account/storage/storage.go | 4 +- cmd/account/users/users.go | 12 ++--- cmd/account/vpc-endpoints/vpc-endpoints.go | 4 +- .../workspace-assignment.go | 8 +-- cmd/account/workspaces/workspaces.go | 6 +-- cmd/workspace/alerts/alerts.go | 8 +-- cmd/workspace/catalogs/catalogs.go | 4 +- cmd/workspace/clean-rooms/clean-rooms.go | 4 +- .../cluster-policies/cluster-policies.go | 8 +-- cmd/workspace/clusters/clusters.go | 26 +++++----- cmd/workspace/cmd.go | 10 ---- cmd/workspace/connections/connections.go | 4 +- .../dashboard-widgets/dashboard-widgets.go | 4 +- cmd/workspace/dashboards/dashboards.go | 8 +-- cmd/workspace/experiments/experiments.go | 52 +++++++++---------- .../external-locations/external-locations.go | 4 +- cmd/workspace/functions/functions.go | 4 +- .../git-credentials/git-credentials.go | 8 +-- .../global-init-scripts.go | 8 +-- cmd/workspace/groups/groups.go | 12 ++--- .../instance-pools/instance-pools.go | 8 +-- .../instance-profiles/instance-profiles.go | 12 ++--- .../ip-access-lists/ip-access-lists.go | 12 ++--- cmd/workspace/jobs/jobs.go | 22 ++++---- .../lakehouse-monitors/lakehouse-monitors.go | 12 ++--- cmd/workspace/lakeview/lakeview.go | 5 +- cmd/workspace/libraries/libraries.go | 8 +-- cmd/workspace/metastores/metastores.go | 16 +++--- .../model-registry/model-registry.go | 48 ++++++++--------- .../model-versions/model-versions.go | 4 +- cmd/workspace/online-tables/online-tables.go | 4 +- cmd/workspace/pipelines/pipelines.go | 10 ++-- cmd/workspace/providers/providers.go | 4 +- cmd/workspace/queries/queries.go | 8 +-- .../query-visualizations.go | 4 +- .../recipient-activation.go | 4 +- cmd/workspace/recipients/recipients.go | 8 +-- .../registered-models/registered-models.go | 8 +-- cmd/workspace/repos/repos.go | 8 +-- cmd/workspace/schemas/schemas.go | 4 +- cmd/workspace/secrets/secrets.go | 20 +++---- .../service-principals/service-principals.go | 12 ++--- .../serving-endpoints/serving-endpoints.go | 8 +-- cmd/workspace/shares/shares.go | 8 +-- .../storage-credentials.go | 10 ++-- .../system-schemas/system-schemas.go | 8 +-- .../table-constraints/table-constraints.go | 4 +- cmd/workspace/tables/tables.go | 8 +-- .../token-management/token-management.go | 4 +- cmd/workspace/tokens/tokens.go | 4 +- cmd/workspace/users/users.go | 12 ++--- .../vector-search-endpoints.go | 4 +- .../vector-search-indexes.go | 8 +-- cmd/workspace/volumes/volumes.go | 4 +- cmd/workspace/warehouses/warehouses.go | 14 ++--- .../workspace-conf/workspace-conf.go | 4 +- cmd/workspace/workspace/workspace.go | 12 ++--- 78 files changed, 341 insertions(+), 358 deletions(-) diff --git a/.codegen/cmds-account.go.tmpl b/.codegen/cmds-account.go.tmpl index f3da7e2c87..24b6bdd7cb 100644 --- a/.codegen/cmds-account.go.tmpl +++ b/.codegen/cmds-account.go.tmpl @@ -7,7 +7,7 @@ package account import ( "github.com/databricks/cli/cmd/root" "github.com/spf13/cobra" - {{range .Services}}{{if .IsAccounts}}{{if not (in $excludes .KebabName) }} + {{range .Services}}{{if and .IsAccounts (not .HasParent)}}{{if not (in $excludes .KebabName) }} {{.SnakeName}} "github.com/databricks/cli/cmd/account/{{(.TrimPrefix "account").KebabName}}"{{end}}{{end}}{{end}} ) @@ -17,7 +17,7 @@ func New() *cobra.Command { Short: `Databricks Account Commands`, } - {{range .Services}}{{if .IsAccounts}}{{if not (in $excludes .KebabName) -}} + {{range .Services}}{{if and .IsAccounts (not .HasParent)}}{{if not (in $excludes .KebabName) -}} cmd.AddCommand({{.SnakeName}}.New()) {{end}}{{end}}{{end}} diff --git a/.codegen/cmds-workspace.go.tmpl b/.codegen/cmds-workspace.go.tmpl index a9daa05d8c..244dde61a2 100644 --- a/.codegen/cmds-workspace.go.tmpl +++ b/.codegen/cmds-workspace.go.tmpl @@ -14,14 +14,14 @@ package workspace import ( "github.com/databricks/cli/cmd/root" - {{range .Services}}{{if not .IsAccounts}}{{if not (in $excludes .KebabName) }} + {{range .Services}}{{if and (not .IsAccounts) (not .HasParent)}}{{if not (in $excludes .KebabName) }} {{.SnakeName}} "github.com/databricks/cli/cmd/workspace/{{.KebabName}}"{{end}}{{end}}{{end}} ) func All() []*cobra.Command { var out []*cobra.Command - {{range .Services}}{{if not .IsAccounts}}{{if not (in $excludes .KebabName) -}} + {{range .Services}}{{if and (not .IsAccounts) (not .HasParent)}}{{if not (in $excludes .KebabName) -}} out = append(out, {{.SnakeName}}.New()) {{end}}{{end}}{{end}} diff --git a/.codegen/service.go.tmpl b/.codegen/service.go.tmpl index ad25135aeb..d4a5bb7fd4 100644 --- a/.codegen/service.go.tmpl +++ b/.codegen/service.go.tmpl @@ -242,7 +242,7 @@ func new{{.PascalName}}() *cobra.Command { return err } if {{.CamelName}}SkipWait { - {{if .Response -}} + {{if not .Response.IsEmpty -}} return cmdio.Render(ctx, wait.Response) {{- else -}} return nil @@ -300,7 +300,7 @@ func init() { // end service {{.Name}}{{end}} {{- define "method-call" -}} - {{if .Response -}} + {{if not .Response.IsEmpty -}} response{{ if not .Pagination}}, err{{end}} := {{- else -}} err = @@ -310,7 +310,7 @@ func init() { return err } {{- end}} - {{ if .Response -}} + {{ if not .Response.IsEmpty -}} {{- if .IsResponseByteStream -}} defer response.{{.ResponseBodyField.PascalName}}.Close() return cmdio.Render{{ if .Pagination}}Iterator{{end}}(ctx, response.{{.ResponseBodyField.PascalName}}) diff --git a/bundle/schema/docs/bundle_descriptions.json b/bundle/schema/docs/bundle_descriptions.json index 68db758066..818cc73911 100644 --- a/bundle/schema/docs/bundle_descriptions.json +++ b/bundle/schema/docs/bundle_descriptions.json @@ -322,7 +322,7 @@ "description": "A unique name for the job cluster. This field is required and must be unique within the job.\n`JobTaskSettings` may refer to this field to determine which cluster to launch for the task execution." }, "new_cluster": { - "description": "If new_cluster, a description of a cluster that is created for each task.", + "description": "If new_cluster, a description of a cluster that is created for only for this task.", "properties": { "apply_policy_default_values": { "description": "" @@ -930,7 +930,7 @@ "description": "An optional minimal interval in milliseconds between the start of the failed run and the subsequent retry run. The default behavior is that unsuccessful runs are immediately retried." }, "new_cluster": { - "description": "If new_cluster, a description of a cluster that is created for each task.", + "description": "If new_cluster, a description of a cluster that is created for only for this task.", "properties": { "apply_policy_default_values": { "description": "" @@ -1479,7 +1479,7 @@ "description": "An optional timeout applied to each run of this job task. A value of `0` means no timeout." }, "webhook_notifications": { - "description": "A collection of system notification IDs to notify when runs of this job begin or complete.", + "description": "A collection of system notification IDs to notify when runs of this task begin or complete. The default behavior is to not send any system notifications.", "properties": { "on_duration_warning_threshold_exceeded": { "description": "An optional list of system notification IDs to call when the duration of a run exceeds the threshold specified for the `RUN_DURATION_SECONDS` metric in the `health` field. A maximum of 3 destinations can be specified for the `on_duration_warning_threshold_exceeded` property.", @@ -1576,7 +1576,7 @@ } }, "webhook_notifications": { - "description": "A collection of system notification IDs to notify when runs of this job begin or complete.", + "description": "A collection of system notification IDs to notify when runs of this task begin or complete. The default behavior is to not send any system notifications.", "properties": { "on_duration_warning_threshold_exceeded": { "description": "An optional list of system notification IDs to call when the duration of a run exceeds the threshold specified for the `RUN_DURATION_SECONDS` metric in the `health` field. A maximum of 3 destinations can be specified for the `on_duration_warning_threshold_exceeded` property.", @@ -2855,7 +2855,7 @@ "description": "A unique name for the job cluster. This field is required and must be unique within the job.\n`JobTaskSettings` may refer to this field to determine which cluster to launch for the task execution." }, "new_cluster": { - "description": "If new_cluster, a description of a cluster that is created for each task.", + "description": "If new_cluster, a description of a cluster that is created for only for this task.", "properties": { "apply_policy_default_values": { "description": "" @@ -3463,7 +3463,7 @@ "description": "An optional minimal interval in milliseconds between the start of the failed run and the subsequent retry run. The default behavior is that unsuccessful runs are immediately retried." }, "new_cluster": { - "description": "If new_cluster, a description of a cluster that is created for each task.", + "description": "If new_cluster, a description of a cluster that is created for only for this task.", "properties": { "apply_policy_default_values": { "description": "" @@ -4012,7 +4012,7 @@ "description": "An optional timeout applied to each run of this job task. A value of `0` means no timeout." }, "webhook_notifications": { - "description": "A collection of system notification IDs to notify when runs of this job begin or complete.", + "description": "A collection of system notification IDs to notify when runs of this task begin or complete. The default behavior is to not send any system notifications.", "properties": { "on_duration_warning_threshold_exceeded": { "description": "An optional list of system notification IDs to call when the duration of a run exceeds the threshold specified for the `RUN_DURATION_SECONDS` metric in the `health` field. A maximum of 3 destinations can be specified for the `on_duration_warning_threshold_exceeded` property.", @@ -4109,7 +4109,7 @@ } }, "webhook_notifications": { - "description": "A collection of system notification IDs to notify when runs of this job begin or complete.", + "description": "A collection of system notification IDs to notify when runs of this task begin or complete. The default behavior is to not send any system notifications.", "properties": { "on_duration_warning_threshold_exceeded": { "description": "An optional list of system notification IDs to call when the duration of a run exceeds the threshold specified for the `RUN_DURATION_SECONDS` metric in the `health` field. A maximum of 3 destinations can be specified for the `on_duration_warning_threshold_exceeded` property.", diff --git a/cmd/account/budgets/budgets.go b/cmd/account/budgets/budgets.go index 215ba8f0ce..dfa2f6bc4c 100755 --- a/cmd/account/budgets/budgets.go +++ b/cmd/account/budgets/budgets.go @@ -155,11 +155,11 @@ func newDelete() *cobra.Command { } deleteReq.BudgetId = args[0] - response, err := a.Budgets.Delete(ctx, deleteReq) + err = a.Budgets.Delete(ctx, deleteReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -353,11 +353,11 @@ func newUpdate() *cobra.Command { } updateReq.BudgetId = args[0] - response, err := a.Budgets.Update(ctx, updateReq) + err = a.Budgets.Update(ctx, updateReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. diff --git a/cmd/account/cmd.go b/cmd/account/cmd.go index 795bbc1810..627d6d5906 100644 --- a/cmd/account/cmd.go +++ b/cmd/account/cmd.go @@ -9,10 +9,8 @@ import ( billable_usage "github.com/databricks/cli/cmd/account/billable-usage" budgets "github.com/databricks/cli/cmd/account/budgets" credentials "github.com/databricks/cli/cmd/account/credentials" - csp_enablement_account "github.com/databricks/cli/cmd/account/csp-enablement-account" custom_app_integration "github.com/databricks/cli/cmd/account/custom-app-integration" encryption_keys "github.com/databricks/cli/cmd/account/encryption-keys" - esm_enablement_account "github.com/databricks/cli/cmd/account/esm-enablement-account" account_groups "github.com/databricks/cli/cmd/account/groups" account_ip_access_lists "github.com/databricks/cli/cmd/account/ip-access-lists" log_delivery "github.com/databricks/cli/cmd/account/log-delivery" @@ -21,7 +19,6 @@ import ( network_connectivity "github.com/databricks/cli/cmd/account/network-connectivity" networks "github.com/databricks/cli/cmd/account/networks" o_auth_published_apps "github.com/databricks/cli/cmd/account/o-auth-published-apps" - personal_compute "github.com/databricks/cli/cmd/account/personal-compute" private_access "github.com/databricks/cli/cmd/account/private-access" published_app_integration "github.com/databricks/cli/cmd/account/published-app-integration" service_principal_secrets "github.com/databricks/cli/cmd/account/service-principal-secrets" @@ -44,10 +41,8 @@ func New() *cobra.Command { cmd.AddCommand(account_access_control.New()) cmd.AddCommand(billable_usage.New()) cmd.AddCommand(budgets.New()) - cmd.AddCommand(csp_enablement_account.New()) cmd.AddCommand(credentials.New()) cmd.AddCommand(custom_app_integration.New()) - cmd.AddCommand(esm_enablement_account.New()) cmd.AddCommand(encryption_keys.New()) cmd.AddCommand(account_groups.New()) cmd.AddCommand(account_ip_access_lists.New()) @@ -57,7 +52,6 @@ func New() *cobra.Command { cmd.AddCommand(network_connectivity.New()) cmd.AddCommand(networks.New()) cmd.AddCommand(o_auth_published_apps.New()) - cmd.AddCommand(personal_compute.New()) cmd.AddCommand(private_access.New()) cmd.AddCommand(published_app_integration.New()) cmd.AddCommand(service_principal_secrets.New()) diff --git a/cmd/account/credentials/credentials.go b/cmd/account/credentials/credentials.go index 38167cf6b5..72fcd70bd1 100755 --- a/cmd/account/credentials/credentials.go +++ b/cmd/account/credentials/credentials.go @@ -170,11 +170,11 @@ func newDelete() *cobra.Command { } deleteReq.CredentialsId = args[0] - response, err := a.Credentials.Delete(ctx, deleteReq) + err = a.Credentials.Delete(ctx, deleteReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. diff --git a/cmd/account/custom-app-integration/custom-app-integration.go b/cmd/account/custom-app-integration/custom-app-integration.go index bfddb9d199..79c0f8373f 100755 --- a/cmd/account/custom-app-integration/custom-app-integration.go +++ b/cmd/account/custom-app-integration/custom-app-integration.go @@ -149,11 +149,11 @@ func newDelete() *cobra.Command { deleteReq.IntegrationId = args[0] - response, err := a.CustomAppIntegration.Delete(ctx, deleteReq) + err = a.CustomAppIntegration.Delete(ctx, deleteReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -335,11 +335,11 @@ func newUpdate() *cobra.Command { } updateReq.IntegrationId = args[0] - response, err := a.CustomAppIntegration.Update(ctx, updateReq) + err = a.CustomAppIntegration.Update(ctx, updateReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. diff --git a/cmd/account/encryption-keys/encryption-keys.go b/cmd/account/encryption-keys/encryption-keys.go index b849a1d43f..3977f58375 100755 --- a/cmd/account/encryption-keys/encryption-keys.go +++ b/cmd/account/encryption-keys/encryption-keys.go @@ -174,11 +174,11 @@ func newDelete() *cobra.Command { deleteReq.CustomerManagedKeyId = args[0] - response, err := a.EncryptionKeys.Delete(ctx, deleteReq) + err = a.EncryptionKeys.Delete(ctx, deleteReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. diff --git a/cmd/account/groups/groups.go b/cmd/account/groups/groups.go index 324b902322..a068fba45c 100755 --- a/cmd/account/groups/groups.go +++ b/cmd/account/groups/groups.go @@ -171,11 +171,11 @@ func newDelete() *cobra.Command { } deleteReq.Id = args[0] - response, err := a.Groups.Delete(ctx, deleteReq) + err = a.Groups.Delete(ctx, deleteReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -398,11 +398,11 @@ func newPatch() *cobra.Command { } patchReq.Id = args[0] - response, err := a.Groups.Patch(ctx, patchReq) + err = a.Groups.Patch(ctx, patchReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -492,11 +492,11 @@ func newUpdate() *cobra.Command { } updateReq.Id = args[0] - response, err := a.Groups.Update(ctx, updateReq) + err = a.Groups.Update(ctx, updateReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. diff --git a/cmd/account/ip-access-lists/ip-access-lists.go b/cmd/account/ip-access-lists/ip-access-lists.go index 58b5899002..dd836c90aa 100755 --- a/cmd/account/ip-access-lists/ip-access-lists.go +++ b/cmd/account/ip-access-lists/ip-access-lists.go @@ -215,11 +215,11 @@ func newDelete() *cobra.Command { } deleteReq.IpAccessListId = args[0] - response, err := a.IpAccessLists.Delete(ctx, deleteReq) + err = a.IpAccessLists.Delete(ctx, deleteReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -449,11 +449,11 @@ func newReplace() *cobra.Command { } } - response, err := a.IpAccessLists.Replace(ctx, replaceReq) + err = a.IpAccessLists.Replace(ctx, replaceReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -551,11 +551,11 @@ func newUpdate() *cobra.Command { } updateReq.IpAccessListId = args[0] - response, err := a.IpAccessLists.Update(ctx, updateReq) + err = a.IpAccessLists.Update(ctx, updateReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. diff --git a/cmd/account/log-delivery/log-delivery.go b/cmd/account/log-delivery/log-delivery.go index e64c3e4d8b..eed8942b8f 100755 --- a/cmd/account/log-delivery/log-delivery.go +++ b/cmd/account/log-delivery/log-delivery.go @@ -394,11 +394,11 @@ func newPatchStatus() *cobra.Command { } } - response, err := a.LogDelivery.PatchStatus(ctx, patchStatusReq) + err = a.LogDelivery.PatchStatus(ctx, patchStatusReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. diff --git a/cmd/account/metastore-assignments/metastore-assignments.go b/cmd/account/metastore-assignments/metastore-assignments.go index 45a3c1d968..b1d0508b34 100755 --- a/cmd/account/metastore-assignments/metastore-assignments.go +++ b/cmd/account/metastore-assignments/metastore-assignments.go @@ -89,11 +89,11 @@ func newCreate() *cobra.Command { } createReq.MetastoreId = args[1] - response, err := a.MetastoreAssignments.Create(ctx, createReq) + err = a.MetastoreAssignments.Create(ctx, createReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -159,11 +159,11 @@ func newDelete() *cobra.Command { } deleteReq.MetastoreId = args[1] - response, err := a.MetastoreAssignments.Delete(ctx, deleteReq) + err = a.MetastoreAssignments.Delete(ctx, deleteReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -371,11 +371,11 @@ func newUpdate() *cobra.Command { } updateReq.MetastoreId = args[1] - response, err := a.MetastoreAssignments.Update(ctx, updateReq) + err = a.MetastoreAssignments.Update(ctx, updateReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. diff --git a/cmd/account/metastores/metastores.go b/cmd/account/metastores/metastores.go index fac404a6fa..e8b7c8f702 100755 --- a/cmd/account/metastores/metastores.go +++ b/cmd/account/metastores/metastores.go @@ -145,11 +145,11 @@ func newDelete() *cobra.Command { deleteReq.MetastoreId = args[0] - response, err := a.Metastores.Delete(ctx, deleteReq) + err = a.Metastores.Delete(ctx, deleteReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. diff --git a/cmd/account/network-connectivity/network-connectivity.go b/cmd/account/network-connectivity/network-connectivity.go index c153f28b9a..e21f3bd7f4 100755 --- a/cmd/account/network-connectivity/network-connectivity.go +++ b/cmd/account/network-connectivity/network-connectivity.go @@ -263,11 +263,11 @@ func newDeleteNetworkConnectivityConfiguration() *cobra.Command { deleteNetworkConnectivityConfigurationReq.NetworkConnectivityConfigId = args[0] - response, err := a.NetworkConnectivity.DeleteNetworkConnectivityConfiguration(ctx, deleteNetworkConnectivityConfigurationReq) + err = a.NetworkConnectivity.DeleteNetworkConnectivityConfiguration(ctx, deleteNetworkConnectivityConfigurationReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. diff --git a/cmd/account/networks/networks.go b/cmd/account/networks/networks.go index 2c09e2b10a..15586bdc98 100755 --- a/cmd/account/networks/networks.go +++ b/cmd/account/networks/networks.go @@ -181,11 +181,11 @@ func newDelete() *cobra.Command { } deleteReq.NetworkId = args[0] - response, err := a.Networks.Delete(ctx, deleteReq) + err = a.Networks.Delete(ctx, deleteReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. diff --git a/cmd/account/private-access/private-access.go b/cmd/account/private-access/private-access.go index 7ee9d0d85a..458ff827e2 100755 --- a/cmd/account/private-access/private-access.go +++ b/cmd/account/private-access/private-access.go @@ -197,11 +197,11 @@ func newDelete() *cobra.Command { } deleteReq.PrivateAccessSettingsId = args[0] - response, err := a.PrivateAccess.Delete(ctx, deleteReq) + err = a.PrivateAccess.Delete(ctx, deleteReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -441,11 +441,11 @@ func newReplace() *cobra.Command { replaceReq.Region = args[2] } - response, err := a.PrivateAccess.Replace(ctx, replaceReq) + err = a.PrivateAccess.Replace(ctx, replaceReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. diff --git a/cmd/account/published-app-integration/published-app-integration.go b/cmd/account/published-app-integration/published-app-integration.go index 5502aa095b..54cf633714 100755 --- a/cmd/account/published-app-integration/published-app-integration.go +++ b/cmd/account/published-app-integration/published-app-integration.go @@ -149,11 +149,11 @@ func newDelete() *cobra.Command { deleteReq.IntegrationId = args[0] - response, err := a.PublishedAppIntegration.Delete(ctx, deleteReq) + err = a.PublishedAppIntegration.Delete(ctx, deleteReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -334,11 +334,11 @@ func newUpdate() *cobra.Command { } updateReq.IntegrationId = args[0] - response, err := a.PublishedAppIntegration.Update(ctx, updateReq) + err = a.PublishedAppIntegration.Update(ctx, updateReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. diff --git a/cmd/account/service-principal-secrets/service-principal-secrets.go b/cmd/account/service-principal-secrets/service-principal-secrets.go index a62a7b6792..1a646e25c3 100755 --- a/cmd/account/service-principal-secrets/service-principal-secrets.go +++ b/cmd/account/service-principal-secrets/service-principal-secrets.go @@ -157,11 +157,11 @@ func newDelete() *cobra.Command { } deleteReq.SecretId = args[1] - response, err := a.ServicePrincipalSecrets.Delete(ctx, deleteReq) + err = a.ServicePrincipalSecrets.Delete(ctx, deleteReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. diff --git a/cmd/account/service-principals/service-principals.go b/cmd/account/service-principals/service-principals.go index 7ffb7f8bb5..af18d53415 100755 --- a/cmd/account/service-principals/service-principals.go +++ b/cmd/account/service-principals/service-principals.go @@ -169,11 +169,11 @@ func newDelete() *cobra.Command { } deleteReq.Id = args[0] - response, err := a.ServicePrincipals.Delete(ctx, deleteReq) + err = a.ServicePrincipals.Delete(ctx, deleteReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -398,11 +398,11 @@ func newPatch() *cobra.Command { } patchReq.Id = args[0] - response, err := a.ServicePrincipals.Patch(ctx, patchReq) + err = a.ServicePrincipals.Patch(ctx, patchReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -494,11 +494,11 @@ func newUpdate() *cobra.Command { } updateReq.Id = args[0] - response, err := a.ServicePrincipals.Update(ctx, updateReq) + err = a.ServicePrincipals.Update(ctx, updateReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. diff --git a/cmd/account/storage-credentials/storage-credentials.go b/cmd/account/storage-credentials/storage-credentials.go index fa1ff10e82..35b865c7fd 100755 --- a/cmd/account/storage-credentials/storage-credentials.go +++ b/cmd/account/storage-credentials/storage-credentials.go @@ -157,11 +157,11 @@ func newDelete() *cobra.Command { deleteReq.MetastoreId = args[0] deleteReq.StorageCredentialName = args[1] - response, err := a.StorageCredentials.Delete(ctx, deleteReq) + err = a.StorageCredentials.Delete(ctx, deleteReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. diff --git a/cmd/account/storage/storage.go b/cmd/account/storage/storage.go index b8704b96b3..d671355d6c 100755 --- a/cmd/account/storage/storage.go +++ b/cmd/account/storage/storage.go @@ -166,11 +166,11 @@ func newDelete() *cobra.Command { } deleteReq.StorageConfigurationId = args[0] - response, err := a.Storage.Delete(ctx, deleteReq) + err = a.Storage.Delete(ctx, deleteReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. diff --git a/cmd/account/users/users.go b/cmd/account/users/users.go index b0ffeb5a7e..f5b81f219d 100755 --- a/cmd/account/users/users.go +++ b/cmd/account/users/users.go @@ -178,11 +178,11 @@ func newDelete() *cobra.Command { } deleteReq.Id = args[0] - response, err := a.Users.Delete(ctx, deleteReq) + err = a.Users.Delete(ctx, deleteReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -414,11 +414,11 @@ func newPatch() *cobra.Command { } patchReq.Id = args[0] - response, err := a.Users.Patch(ctx, patchReq) + err = a.Users.Patch(ctx, patchReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -511,11 +511,11 @@ func newUpdate() *cobra.Command { } updateReq.Id = args[0] - response, err := a.Users.Update(ctx, updateReq) + err = a.Users.Update(ctx, updateReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. diff --git a/cmd/account/vpc-endpoints/vpc-endpoints.go b/cmd/account/vpc-endpoints/vpc-endpoints.go index da8ad7c575..6d80e73141 100755 --- a/cmd/account/vpc-endpoints/vpc-endpoints.go +++ b/cmd/account/vpc-endpoints/vpc-endpoints.go @@ -191,11 +191,11 @@ func newDelete() *cobra.Command { } deleteReq.VpcEndpointId = args[0] - response, err := a.VpcEndpoints.Delete(ctx, deleteReq) + err = a.VpcEndpoints.Delete(ctx, deleteReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. diff --git a/cmd/account/workspace-assignment/workspace-assignment.go b/cmd/account/workspace-assignment/workspace-assignment.go index 3cc2b8e96f..ab82cd39fa 100755 --- a/cmd/account/workspace-assignment/workspace-assignment.go +++ b/cmd/account/workspace-assignment/workspace-assignment.go @@ -84,11 +84,11 @@ func newDelete() *cobra.Command { return fmt.Errorf("invalid PRINCIPAL_ID: %s", args[1]) } - response, err := a.WorkspaceAssignment.Delete(ctx, deleteReq) + err = a.WorkspaceAssignment.Delete(ctx, deleteReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -299,11 +299,11 @@ func newUpdate() *cobra.Command { return fmt.Errorf("invalid PRINCIPAL_ID: %s", args[1]) } - response, err := a.WorkspaceAssignment.Update(ctx, updateReq) + err = a.WorkspaceAssignment.Update(ctx, updateReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. diff --git a/cmd/account/workspaces/workspaces.go b/cmd/account/workspaces/workspaces.go index d728c0e4c9..f95b3d5417 100755 --- a/cmd/account/workspaces/workspaces.go +++ b/cmd/account/workspaces/workspaces.go @@ -233,11 +233,11 @@ func newDelete() *cobra.Command { return fmt.Errorf("invalid WORKSPACE_ID: %s", args[0]) } - response, err := a.Workspaces.Delete(ctx, deleteReq) + err = a.Workspaces.Delete(ctx, deleteReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -600,7 +600,7 @@ func newUpdate() *cobra.Command { return err } if updateSkipWait { - return cmdio.Render(ctx, wait.Response) + return nil } spinner := cmdio.Spinner(ctx) info, err := wait.OnProgress(func(i *provisioning.Workspace) { diff --git a/cmd/workspace/alerts/alerts.go b/cmd/workspace/alerts/alerts.go index 70ff68edd2..773a34876a 100755 --- a/cmd/workspace/alerts/alerts.go +++ b/cmd/workspace/alerts/alerts.go @@ -159,11 +159,11 @@ func newDelete() *cobra.Command { } deleteReq.AlertId = args[0] - response, err := w.Alerts.Delete(ctx, deleteReq) + err = w.Alerts.Delete(ctx, deleteReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -353,11 +353,11 @@ func newUpdate() *cobra.Command { } updateReq.AlertId = args[0] - response, err := w.Alerts.Update(ctx, updateReq) + err = w.Alerts.Update(ctx, updateReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. diff --git a/cmd/workspace/catalogs/catalogs.go b/cmd/workspace/catalogs/catalogs.go index d27566842a..8e639023f5 100755 --- a/cmd/workspace/catalogs/catalogs.go +++ b/cmd/workspace/catalogs/catalogs.go @@ -174,11 +174,11 @@ func newDelete() *cobra.Command { deleteReq.Name = args[0] - response, err := w.Catalogs.Delete(ctx, deleteReq) + err = w.Catalogs.Delete(ctx, deleteReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. diff --git a/cmd/workspace/clean-rooms/clean-rooms.go b/cmd/workspace/clean-rooms/clean-rooms.go index f69dc59229..4cee2ce6cf 100755 --- a/cmd/workspace/clean-rooms/clean-rooms.go +++ b/cmd/workspace/clean-rooms/clean-rooms.go @@ -151,11 +151,11 @@ func newDelete() *cobra.Command { deleteReq.Name = args[0] - response, err := w.CleanRooms.Delete(ctx, deleteReq) + err = w.CleanRooms.Delete(ctx, deleteReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. diff --git a/cmd/workspace/cluster-policies/cluster-policies.go b/cmd/workspace/cluster-policies/cluster-policies.go index 41fce23a82..f6edee2b3d 100755 --- a/cmd/workspace/cluster-policies/cluster-policies.go +++ b/cmd/workspace/cluster-policies/cluster-policies.go @@ -218,11 +218,11 @@ func newDelete() *cobra.Command { deleteReq.PolicyId = args[0] } - response, err := w.ClusterPolicies.Delete(ctx, deleteReq) + err = w.ClusterPolicies.Delete(ctx, deleteReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -312,11 +312,11 @@ func newEdit() *cobra.Command { editReq.Name = args[1] } - response, err := w.ClusterPolicies.Edit(ctx, editReq) + err = w.ClusterPolicies.Edit(ctx, editReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. diff --git a/cmd/workspace/clusters/clusters.go b/cmd/workspace/clusters/clusters.go index ef9034c012..cf35b28375 100755 --- a/cmd/workspace/clusters/clusters.go +++ b/cmd/workspace/clusters/clusters.go @@ -124,11 +124,11 @@ func newChangeOwner() *cobra.Command { changeOwnerReq.OwnerUsername = args[1] } - response, err := w.Clusters.ChangeOwner(ctx, changeOwnerReq) + err = w.Clusters.ChangeOwner(ctx, changeOwnerReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -383,7 +383,7 @@ func newDelete() *cobra.Command { return err } if deleteSkipWait { - return cmdio.Render(ctx, wait.Response) + return nil } spinner := cmdio.Spinner(ctx) info, err := wait.OnProgress(func(i *compute.ClusterDetails) { @@ -541,7 +541,7 @@ func newEdit() *cobra.Command { return err } if editSkipWait { - return cmdio.Render(ctx, wait.Response) + return nil } spinner := cmdio.Spinner(ctx) info, err := wait.OnProgress(func(i *compute.ClusterDetails) { @@ -1150,11 +1150,11 @@ func newPermanentDelete() *cobra.Command { permanentDeleteReq.ClusterId = args[0] } - response, err := w.Clusters.PermanentDelete(ctx, permanentDeleteReq) + err = w.Clusters.PermanentDelete(ctx, permanentDeleteReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -1248,11 +1248,11 @@ func newPin() *cobra.Command { pinReq.ClusterId = args[0] } - response, err := w.Clusters.Pin(ctx, pinReq) + err = w.Clusters.Pin(ctx, pinReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -1358,7 +1358,7 @@ func newResize() *cobra.Command { return err } if resizeSkipWait { - return cmdio.Render(ctx, wait.Response) + return nil } spinner := cmdio.Spinner(ctx) info, err := wait.OnProgress(func(i *compute.ClusterDetails) { @@ -1474,7 +1474,7 @@ func newRestart() *cobra.Command { return err } if restartSkipWait { - return cmdio.Render(ctx, wait.Response) + return nil } spinner := cmdio.Spinner(ctx) info, err := wait.OnProgress(func(i *compute.ClusterDetails) { @@ -1730,7 +1730,7 @@ func newStart() *cobra.Command { return err } if startSkipWait { - return cmdio.Render(ctx, wait.Response) + return nil } spinner := cmdio.Spinner(ctx) info, err := wait.OnProgress(func(i *compute.ClusterDetails) { @@ -1835,11 +1835,11 @@ func newUnpin() *cobra.Command { unpinReq.ClusterId = args[0] } - response, err := w.Clusters.Unpin(ctx, unpinReq) + err = w.Clusters.Unpin(ctx, unpinReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. diff --git a/cmd/workspace/cmd.go b/cmd/workspace/cmd.go index 14fc7428d7..8b0022dccc 100755 --- a/cmd/workspace/cmd.go +++ b/cmd/workspace/cmd.go @@ -6,20 +6,16 @@ import ( alerts "github.com/databricks/cli/cmd/workspace/alerts" apps "github.com/databricks/cli/cmd/workspace/apps" artifact_allowlists "github.com/databricks/cli/cmd/workspace/artifact-allowlists" - automatic_cluster_update "github.com/databricks/cli/cmd/workspace/automatic-cluster-update" catalogs "github.com/databricks/cli/cmd/workspace/catalogs" clean_rooms "github.com/databricks/cli/cmd/workspace/clean-rooms" cluster_policies "github.com/databricks/cli/cmd/workspace/cluster-policies" clusters "github.com/databricks/cli/cmd/workspace/clusters" connections "github.com/databricks/cli/cmd/workspace/connections" credentials_manager "github.com/databricks/cli/cmd/workspace/credentials-manager" - csp_enablement "github.com/databricks/cli/cmd/workspace/csp-enablement" current_user "github.com/databricks/cli/cmd/workspace/current-user" dashboard_widgets "github.com/databricks/cli/cmd/workspace/dashboard-widgets" dashboards "github.com/databricks/cli/cmd/workspace/dashboards" data_sources "github.com/databricks/cli/cmd/workspace/data-sources" - default_namespace "github.com/databricks/cli/cmd/workspace/default-namespace" - esm_enablement "github.com/databricks/cli/cmd/workspace/esm-enablement" experiments "github.com/databricks/cli/cmd/workspace/experiments" external_locations "github.com/databricks/cli/cmd/workspace/external-locations" functions "github.com/databricks/cli/cmd/workspace/functions" @@ -50,7 +46,6 @@ import ( recipients "github.com/databricks/cli/cmd/workspace/recipients" registered_models "github.com/databricks/cli/cmd/workspace/registered-models" repos "github.com/databricks/cli/cmd/workspace/repos" - restrict_workspace_admins "github.com/databricks/cli/cmd/workspace/restrict-workspace-admins" schemas "github.com/databricks/cli/cmd/workspace/schemas" secrets "github.com/databricks/cli/cmd/workspace/secrets" service_principals "github.com/databricks/cli/cmd/workspace/service-principals" @@ -80,8 +75,6 @@ func All() []*cobra.Command { out = append(out, alerts.New()) out = append(out, apps.New()) out = append(out, artifact_allowlists.New()) - out = append(out, automatic_cluster_update.New()) - out = append(out, csp_enablement.New()) out = append(out, catalogs.New()) out = append(out, clean_rooms.New()) out = append(out, cluster_policies.New()) @@ -92,8 +85,6 @@ func All() []*cobra.Command { out = append(out, dashboard_widgets.New()) out = append(out, dashboards.New()) out = append(out, data_sources.New()) - out = append(out, default_namespace.New()) - out = append(out, esm_enablement.New()) out = append(out, experiments.New()) out = append(out, external_locations.New()) out = append(out, functions.New()) @@ -124,7 +115,6 @@ func All() []*cobra.Command { out = append(out, recipients.New()) out = append(out, registered_models.New()) out = append(out, repos.New()) - out = append(out, restrict_workspace_admins.New()) out = append(out, schemas.New()) out = append(out, secrets.New()) out = append(out, service_principals.New()) diff --git a/cmd/workspace/connections/connections.go b/cmd/workspace/connections/connections.go index b7c324adbb..f740c7789f 100755 --- a/cmd/workspace/connections/connections.go +++ b/cmd/workspace/connections/connections.go @@ -169,11 +169,11 @@ func newDelete() *cobra.Command { } deleteReq.Name = args[0] - response, err := w.Connections.Delete(ctx, deleteReq) + err = w.Connections.Delete(ctx, deleteReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. diff --git a/cmd/workspace/dashboard-widgets/dashboard-widgets.go b/cmd/workspace/dashboard-widgets/dashboard-widgets.go index 35f5150ced..43a972e03a 100755 --- a/cmd/workspace/dashboard-widgets/dashboard-widgets.go +++ b/cmd/workspace/dashboard-widgets/dashboard-widgets.go @@ -140,11 +140,11 @@ func newDelete() *cobra.Command { deleteReq.Id = args[0] - response, err := w.DashboardWidgets.Delete(ctx, deleteReq) + err = w.DashboardWidgets.Delete(ctx, deleteReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. diff --git a/cmd/workspace/dashboards/dashboards.go b/cmd/workspace/dashboards/dashboards.go index 2e0dfb6f16..e07f739261 100755 --- a/cmd/workspace/dashboards/dashboards.go +++ b/cmd/workspace/dashboards/dashboards.go @@ -152,11 +152,11 @@ func newDelete() *cobra.Command { } deleteReq.DashboardId = args[0] - response, err := w.Dashboards.Delete(ctx, deleteReq) + err = w.Dashboards.Delete(ctx, deleteReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -363,11 +363,11 @@ func newRestore() *cobra.Command { } restoreReq.DashboardId = args[0] - response, err := w.Dashboards.Restore(ctx, restoreReq) + err = w.Dashboards.Restore(ctx, restoreReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. diff --git a/cmd/workspace/experiments/experiments.go b/cmd/workspace/experiments/experiments.go index 7a18d2b213..368ec7f946 100755 --- a/cmd/workspace/experiments/experiments.go +++ b/cmd/workspace/experiments/experiments.go @@ -266,11 +266,11 @@ func newDeleteExperiment() *cobra.Command { deleteExperimentReq.ExperimentId = args[0] } - response, err := w.Experiments.DeleteExperiment(ctx, deleteExperimentReq) + err = w.Experiments.DeleteExperiment(ctx, deleteExperimentReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -347,11 +347,11 @@ func newDeleteRun() *cobra.Command { deleteRunReq.RunId = args[0] } - response, err := w.Experiments.DeleteRun(ctx, deleteRunReq) + err = w.Experiments.DeleteRun(ctx, deleteRunReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -528,11 +528,11 @@ func newDeleteTag() *cobra.Command { deleteTagReq.Key = args[1] } - response, err := w.Experiments.DeleteTag(ctx, deleteTagReq) + err = w.Experiments.DeleteTag(ctx, deleteTagReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -1161,11 +1161,11 @@ func newLogBatch() *cobra.Command { } } - response, err := w.Experiments.LogBatch(ctx, logBatchReq) + err = w.Experiments.LogBatch(ctx, logBatchReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -1233,11 +1233,11 @@ func newLogInputs() *cobra.Command { } } - response, err := w.Experiments.LogInputs(ctx, logInputsReq) + err = w.Experiments.LogInputs(ctx, logInputsReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -1334,11 +1334,11 @@ func newLogMetric() *cobra.Command { } } - response, err := w.Experiments.LogMetric(ctx, logMetricReq) + err = w.Experiments.LogMetric(ctx, logMetricReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -1406,11 +1406,11 @@ func newLogModel() *cobra.Command { } } - response, err := w.Experiments.LogModel(ctx, logModelReq) + err = w.Experiments.LogModel(ctx, logModelReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -1497,11 +1497,11 @@ func newLogParam() *cobra.Command { logParamReq.Value = args[1] } - response, err := w.Experiments.LogParam(ctx, logParamReq) + err = w.Experiments.LogParam(ctx, logParamReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -1583,11 +1583,11 @@ func newRestoreExperiment() *cobra.Command { restoreExperimentReq.ExperimentId = args[0] } - response, err := w.Experiments.RestoreExperiment(ctx, restoreExperimentReq) + err = w.Experiments.RestoreExperiment(ctx, restoreExperimentReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -1664,11 +1664,11 @@ func newRestoreRun() *cobra.Command { restoreRunReq.RunId = args[0] } - response, err := w.Experiments.RestoreRun(ctx, restoreRunReq) + err = w.Experiments.RestoreRun(ctx, restoreRunReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -1996,11 +1996,11 @@ func newSetExperimentTag() *cobra.Command { setExperimentTagReq.Value = args[2] } - response, err := w.Experiments.SetExperimentTag(ctx, setExperimentTagReq) + err = w.Experiments.SetExperimentTag(ctx, setExperimentTagReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -2163,11 +2163,11 @@ func newSetTag() *cobra.Command { setTagReq.Value = args[1] } - response, err := w.Experiments.SetTag(ctx, setTagReq) + err = w.Experiments.SetTag(ctx, setTagReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -2246,11 +2246,11 @@ func newUpdateExperiment() *cobra.Command { updateExperimentReq.ExperimentId = args[0] } - response, err := w.Experiments.UpdateExperiment(ctx, updateExperimentReq) + err = w.Experiments.UpdateExperiment(ctx, updateExperimentReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. diff --git a/cmd/workspace/external-locations/external-locations.go b/cmd/workspace/external-locations/external-locations.go index 5608d7a976..7ddc0d8425 100755 --- a/cmd/workspace/external-locations/external-locations.go +++ b/cmd/workspace/external-locations/external-locations.go @@ -186,11 +186,11 @@ func newDelete() *cobra.Command { deleteReq.Name = args[0] - response, err := w.ExternalLocations.Delete(ctx, deleteReq) + err = w.ExternalLocations.Delete(ctx, deleteReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. diff --git a/cmd/workspace/functions/functions.go b/cmd/workspace/functions/functions.go index 35e8ba8a44..d1db1ec970 100755 --- a/cmd/workspace/functions/functions.go +++ b/cmd/workspace/functions/functions.go @@ -168,11 +168,11 @@ func newDelete() *cobra.Command { } deleteReq.Name = args[0] - response, err := w.Functions.Delete(ctx, deleteReq) + err = w.Functions.Delete(ctx, deleteReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. diff --git a/cmd/workspace/git-credentials/git-credentials.go b/cmd/workspace/git-credentials/git-credentials.go index c0e404f472..8984a95387 100755 --- a/cmd/workspace/git-credentials/git-credentials.go +++ b/cmd/workspace/git-credentials/git-credentials.go @@ -183,11 +183,11 @@ func newDelete() *cobra.Command { return fmt.Errorf("invalid CREDENTIAL_ID: %s", args[0]) } - response, err := w.GitCredentials.Delete(ctx, deleteReq) + err = w.GitCredentials.Delete(ctx, deleteReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -399,11 +399,11 @@ func newUpdate() *cobra.Command { return fmt.Errorf("invalid CREDENTIAL_ID: %s", args[0]) } - response, err := w.GitCredentials.Update(ctx, updateReq) + err = w.GitCredentials.Update(ctx, updateReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. diff --git a/cmd/workspace/global-init-scripts/global-init-scripts.go b/cmd/workspace/global-init-scripts/global-init-scripts.go index b24e82b15c..de08614fed 100755 --- a/cmd/workspace/global-init-scripts/global-init-scripts.go +++ b/cmd/workspace/global-init-scripts/global-init-scripts.go @@ -182,11 +182,11 @@ func newDelete() *cobra.Command { } deleteReq.ScriptId = args[0] - response, err := w.GlobalInitScripts.Delete(ctx, deleteReq) + err = w.GlobalInitScripts.Delete(ctx, deleteReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -397,11 +397,11 @@ func newUpdate() *cobra.Command { updateReq.Script = args[2] } - response, err := w.GlobalInitScripts.Update(ctx, updateReq) + err = w.GlobalInitScripts.Update(ctx, updateReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. diff --git a/cmd/workspace/groups/groups.go b/cmd/workspace/groups/groups.go index 0c06aefb8f..aba54b8be6 100755 --- a/cmd/workspace/groups/groups.go +++ b/cmd/workspace/groups/groups.go @@ -171,11 +171,11 @@ func newDelete() *cobra.Command { } deleteReq.Id = args[0] - response, err := w.Groups.Delete(ctx, deleteReq) + err = w.Groups.Delete(ctx, deleteReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -398,11 +398,11 @@ func newPatch() *cobra.Command { } patchReq.Id = args[0] - response, err := w.Groups.Patch(ctx, patchReq) + err = w.Groups.Patch(ctx, patchReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -492,11 +492,11 @@ func newUpdate() *cobra.Command { } updateReq.Id = args[0] - response, err := w.Groups.Update(ctx, updateReq) + err = w.Groups.Update(ctx, updateReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. diff --git a/cmd/workspace/instance-pools/instance-pools.go b/cmd/workspace/instance-pools/instance-pools.go index b901ad9edb..c9389fef86 100755 --- a/cmd/workspace/instance-pools/instance-pools.go +++ b/cmd/workspace/instance-pools/instance-pools.go @@ -226,11 +226,11 @@ func newDelete() *cobra.Command { deleteReq.InstancePoolId = args[0] } - response, err := w.InstancePools.Delete(ctx, deleteReq) + err = w.InstancePools.Delete(ctx, deleteReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -325,11 +325,11 @@ func newEdit() *cobra.Command { editReq.NodeTypeId = args[2] } - response, err := w.InstancePools.Edit(ctx, editReq) + err = w.InstancePools.Edit(ctx, editReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. diff --git a/cmd/workspace/instance-profiles/instance-profiles.go b/cmd/workspace/instance-profiles/instance-profiles.go index 5bd6280cd2..2077c4bfc5 100755 --- a/cmd/workspace/instance-profiles/instance-profiles.go +++ b/cmd/workspace/instance-profiles/instance-profiles.go @@ -102,11 +102,11 @@ func newAdd() *cobra.Command { addReq.InstanceProfileArn = args[0] } - response, err := w.InstanceProfiles.Add(ctx, addReq) + err = w.InstanceProfiles.Add(ctx, addReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -201,11 +201,11 @@ func newEdit() *cobra.Command { editReq.InstanceProfileArn = args[0] } - response, err := w.InstanceProfiles.Edit(ctx, editReq) + err = w.InstanceProfiles.Edit(ctx, editReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -332,11 +332,11 @@ func newRemove() *cobra.Command { removeReq.InstanceProfileArn = args[0] } - response, err := w.InstanceProfiles.Remove(ctx, removeReq) + err = w.InstanceProfiles.Remove(ctx, removeReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. diff --git a/cmd/workspace/ip-access-lists/ip-access-lists.go b/cmd/workspace/ip-access-lists/ip-access-lists.go index fc10a66e22..9eb08cb438 100755 --- a/cmd/workspace/ip-access-lists/ip-access-lists.go +++ b/cmd/workspace/ip-access-lists/ip-access-lists.go @@ -216,11 +216,11 @@ func newDelete() *cobra.Command { } deleteReq.IpAccessListId = args[0] - response, err := w.IpAccessLists.Delete(ctx, deleteReq) + err = w.IpAccessLists.Delete(ctx, deleteReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -452,11 +452,11 @@ func newReplace() *cobra.Command { } } - response, err := w.IpAccessLists.Replace(ctx, replaceReq) + err = w.IpAccessLists.Replace(ctx, replaceReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -556,11 +556,11 @@ func newUpdate() *cobra.Command { } updateReq.IpAccessListId = args[0] - response, err := w.IpAccessLists.Update(ctx, updateReq) + err = w.IpAccessLists.Update(ctx, updateReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. diff --git a/cmd/workspace/jobs/jobs.go b/cmd/workspace/jobs/jobs.go index edbb3e08a5..957aa60934 100755 --- a/cmd/workspace/jobs/jobs.go +++ b/cmd/workspace/jobs/jobs.go @@ -100,11 +100,11 @@ func newCancelAllRuns() *cobra.Command { } } - response, err := w.Jobs.CancelAllRuns(ctx, cancelAllRunsReq) + err = w.Jobs.CancelAllRuns(ctx, cancelAllRunsReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -210,7 +210,7 @@ func newCancelRun() *cobra.Command { return err } if cancelRunSkipWait { - return cmdio.Render(ctx, wait.Response) + return nil } spinner := cmdio.Spinner(ctx) info, err := wait.OnProgress(func(i *jobs.Run) { @@ -388,11 +388,11 @@ func newDelete() *cobra.Command { } } - response, err := w.Jobs.Delete(ctx, deleteReq) + err = w.Jobs.Delete(ctx, deleteReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -487,11 +487,11 @@ func newDeleteRun() *cobra.Command { } } - response, err := w.Jobs.DeleteRun(ctx, deleteRunReq) + err = w.Jobs.DeleteRun(ctx, deleteRunReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -1311,11 +1311,11 @@ func newReset() *cobra.Command { return fmt.Errorf("please provide command input in JSON format by specifying the --json flag") } - response, err := w.Jobs.Reset(ctx, resetReq) + err = w.Jobs.Reset(ctx, resetReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -1743,11 +1743,11 @@ func newUpdate() *cobra.Command { } } - response, err := w.Jobs.Update(ctx, updateReq) + err = w.Jobs.Update(ctx, updateReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. diff --git a/cmd/workspace/lakehouse-monitors/lakehouse-monitors.go b/cmd/workspace/lakehouse-monitors/lakehouse-monitors.go index 427d0e6c63..fc0a317fad 100755 --- a/cmd/workspace/lakehouse-monitors/lakehouse-monitors.go +++ b/cmd/workspace/lakehouse-monitors/lakehouse-monitors.go @@ -95,11 +95,11 @@ func newCancelRefresh() *cobra.Command { cancelRefreshReq.FullName = args[0] cancelRefreshReq.RefreshId = args[1] - response, err := w.LakehouseMonitors.CancelRefresh(ctx, cancelRefreshReq) + err = w.LakehouseMonitors.CancelRefresh(ctx, cancelRefreshReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -146,7 +146,7 @@ func newCreate() *cobra.Command { // TODO: complex arg: schedule cmd.Flags().BoolVar(&createReq.SkipBuiltinDashboard, "skip-builtin-dashboard", createReq.SkipBuiltinDashboard, `Whether to skip creating a default dashboard summarizing data quality metrics.`) // TODO: array: slicing_exprs - // TODO: output-only field + // TODO: complex arg: snapshot // TODO: complex arg: time_series cmd.Flags().StringVar(&createReq.WarehouseId, "warehouse-id", createReq.WarehouseId, `Optional argument to specify the warehouse for dashboard creation.`) @@ -280,11 +280,11 @@ func newDelete() *cobra.Command { deleteReq.FullName = args[0] - response, err := w.LakehouseMonitors.Delete(ctx, deleteReq) + err = w.LakehouseMonitors.Delete(ctx, deleteReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -628,7 +628,7 @@ func newUpdate() *cobra.Command { // TODO: array: notifications // TODO: complex arg: schedule // TODO: array: slicing_exprs - // TODO: output-only field + // TODO: complex arg: snapshot // TODO: complex arg: time_series cmd.Use = "update FULL_NAME OUTPUT_SCHEMA_NAME" diff --git a/cmd/workspace/lakeview/lakeview.go b/cmd/workspace/lakeview/lakeview.go index 0d47ed2216..a6dddd0de2 100755 --- a/cmd/workspace/lakeview/lakeview.go +++ b/cmd/workspace/lakeview/lakeview.go @@ -4,7 +4,6 @@ package lakeview import ( "github.com/databricks/cli/cmd/root" - "github.com/databricks/cli/libs/cmdio" "github.com/databricks/cli/libs/flags" "github.com/databricks/databricks-sdk-go/service/dashboards" "github.com/spf13/cobra" @@ -85,11 +84,11 @@ func newPublish() *cobra.Command { } publishReq.DashboardId = args[0] - response, err := w.Lakeview.Publish(ctx, publishReq) + err = w.Lakeview.Publish(ctx, publishReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. diff --git a/cmd/workspace/libraries/libraries.go b/cmd/workspace/libraries/libraries.go index 12d773c28c..fef81c25f6 100755 --- a/cmd/workspace/libraries/libraries.go +++ b/cmd/workspace/libraries/libraries.go @@ -224,11 +224,11 @@ func newInstall() *cobra.Command { return fmt.Errorf("please provide command input in JSON format by specifying the --json flag") } - response, err := w.Libraries.Install(ctx, installReq) + err = w.Libraries.Install(ctx, installReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -291,11 +291,11 @@ func newUninstall() *cobra.Command { return fmt.Errorf("please provide command input in JSON format by specifying the --json flag") } - response, err := w.Libraries.Uninstall(ctx, uninstallReq) + err = w.Libraries.Uninstall(ctx, uninstallReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. diff --git a/cmd/workspace/metastores/metastores.go b/cmd/workspace/metastores/metastores.go index bd61802a6f..d63576d4ea 100755 --- a/cmd/workspace/metastores/metastores.go +++ b/cmd/workspace/metastores/metastores.go @@ -114,11 +114,11 @@ func newAssign() *cobra.Command { assignReq.DefaultCatalogName = args[2] } - response, err := w.Metastores.Assign(ctx, assignReq) + err = w.Metastores.Assign(ctx, assignReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -328,11 +328,11 @@ func newDelete() *cobra.Command { } deleteReq.Id = args[0] - response, err := w.Metastores.Delete(ctx, deleteReq) + err = w.Metastores.Delete(ctx, deleteReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -570,11 +570,11 @@ func newUnassign() *cobra.Command { } unassignReq.MetastoreId = args[1] - response, err := w.Metastores.Unassign(ctx, unassignReq) + err = w.Metastores.Unassign(ctx, unassignReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -757,11 +757,11 @@ func newUpdateAssignment() *cobra.Command { return fmt.Errorf("invalid WORKSPACE_ID: %s", args[0]) } - response, err := w.Metastores.UpdateAssignment(ctx, updateAssignmentReq) + err = w.Metastores.UpdateAssignment(ctx, updateAssignmentReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. diff --git a/cmd/workspace/model-registry/model-registry.go b/cmd/workspace/model-registry/model-registry.go index a3cfd6aaa1..9c6034b56b 100755 --- a/cmd/workspace/model-registry/model-registry.go +++ b/cmd/workspace/model-registry/model-registry.go @@ -631,11 +631,11 @@ func newDeleteComment() *cobra.Command { deleteCommentReq.Id = args[0] - response, err := w.ModelRegistry.DeleteComment(ctx, deleteCommentReq) + err = w.ModelRegistry.DeleteComment(ctx, deleteCommentReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -695,11 +695,11 @@ func newDeleteModel() *cobra.Command { deleteModelReq.Name = args[0] - response, err := w.ModelRegistry.DeleteModel(ctx, deleteModelReq) + err = w.ModelRegistry.DeleteModel(ctx, deleteModelReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -762,11 +762,11 @@ func newDeleteModelTag() *cobra.Command { deleteModelTagReq.Name = args[0] deleteModelTagReq.Key = args[1] - response, err := w.ModelRegistry.DeleteModelTag(ctx, deleteModelTagReq) + err = w.ModelRegistry.DeleteModelTag(ctx, deleteModelTagReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -828,11 +828,11 @@ func newDeleteModelVersion() *cobra.Command { deleteModelVersionReq.Name = args[0] deleteModelVersionReq.Version = args[1] - response, err := w.ModelRegistry.DeleteModelVersion(ctx, deleteModelVersionReq) + err = w.ModelRegistry.DeleteModelVersion(ctx, deleteModelVersionReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -897,11 +897,11 @@ func newDeleteModelVersionTag() *cobra.Command { deleteModelVersionTagReq.Version = args[1] deleteModelVersionTagReq.Key = args[2] - response, err := w.ModelRegistry.DeleteModelVersionTag(ctx, deleteModelVersionTagReq) + err = w.ModelRegistry.DeleteModelVersionTag(ctx, deleteModelVersionTagReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -982,11 +982,11 @@ func newDeleteTransitionRequest() *cobra.Command { } deleteTransitionRequestReq.Creator = args[3] - response, err := w.ModelRegistry.DeleteTransitionRequest(ctx, deleteTransitionRequestReq) + err = w.ModelRegistry.DeleteTransitionRequest(ctx, deleteTransitionRequestReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -1045,11 +1045,11 @@ func newDeleteWebhook() *cobra.Command { ctx := cmd.Context() w := root.WorkspaceClient(ctx) - response, err := w.ModelRegistry.DeleteWebhook(ctx, deleteWebhookReq) + err = w.ModelRegistry.DeleteWebhook(ctx, deleteWebhookReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -2040,11 +2040,11 @@ func newSetModelTag() *cobra.Command { setModelTagReq.Value = args[2] } - response, err := w.ModelRegistry.SetModelTag(ctx, setModelTagReq) + err = w.ModelRegistry.SetModelTag(ctx, setModelTagReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -2138,11 +2138,11 @@ func newSetModelVersionTag() *cobra.Command { setModelVersionTagReq.Value = args[3] } - response, err := w.ModelRegistry.SetModelVersionTag(ctx, setModelVersionTagReq) + err = w.ModelRegistry.SetModelVersionTag(ctx, setModelVersionTagReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -2593,11 +2593,11 @@ func newUpdateModel() *cobra.Command { updateModelReq.Name = args[0] } - response, err := w.ModelRegistry.UpdateModel(ctx, updateModelReq) + err = w.ModelRegistry.UpdateModel(ctx, updateModelReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -2680,11 +2680,11 @@ func newUpdateModelVersion() *cobra.Command { updateModelVersionReq.Version = args[1] } - response, err := w.ModelRegistry.UpdateModelVersion(ctx, updateModelVersionReq) + err = w.ModelRegistry.UpdateModelVersion(ctx, updateModelVersionReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -2844,11 +2844,11 @@ func newUpdateWebhook() *cobra.Command { updateWebhookReq.Id = args[0] } - response, err := w.ModelRegistry.UpdateWebhook(ctx, updateWebhookReq) + err = w.ModelRegistry.UpdateWebhook(ctx, updateWebhookReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. diff --git a/cmd/workspace/model-versions/model-versions.go b/cmd/workspace/model-versions/model-versions.go index 7daea5f45d..b4492cb369 100755 --- a/cmd/workspace/model-versions/model-versions.go +++ b/cmd/workspace/model-versions/model-versions.go @@ -91,11 +91,11 @@ func newDelete() *cobra.Command { return fmt.Errorf("invalid VERSION: %s", args[1]) } - response, err := w.ModelVersions.Delete(ctx, deleteReq) + err = w.ModelVersions.Delete(ctx, deleteReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. diff --git a/cmd/workspace/online-tables/online-tables.go b/cmd/workspace/online-tables/online-tables.go index 151ba4756f..d97c52837e 100755 --- a/cmd/workspace/online-tables/online-tables.go +++ b/cmd/workspace/online-tables/online-tables.go @@ -146,11 +146,11 @@ func newDelete() *cobra.Command { deleteReq.Name = args[0] - response, err := w.OnlineTables.Delete(ctx, deleteReq) + err = w.OnlineTables.Delete(ctx, deleteReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. diff --git a/cmd/workspace/pipelines/pipelines.go b/cmd/workspace/pipelines/pipelines.go index 69fb7d5900..4c2db6aa38 100755 --- a/cmd/workspace/pipelines/pipelines.go +++ b/cmd/workspace/pipelines/pipelines.go @@ -163,11 +163,11 @@ func newDelete() *cobra.Command { } deleteReq.PipelineId = args[0] - response, err := w.Pipelines.Delete(ctx, deleteReq) + err = w.Pipelines.Delete(ctx, deleteReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -940,7 +940,7 @@ func newStop() *cobra.Command { return err } if stopSkipWait { - return cmdio.Render(ctx, wait.Response) + return nil } spinner := cmdio.Spinner(ctx) info, err := wait.OnProgress(func(i *pipelines.GetPipelineResponse) { @@ -1052,11 +1052,11 @@ func newUpdate() *cobra.Command { } updateReq.PipelineId = args[0] - response, err := w.Pipelines.Update(ctx, updateReq) + err = w.Pipelines.Update(ctx, updateReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. diff --git a/cmd/workspace/providers/providers.go b/cmd/workspace/providers/providers.go index 0c62080d37..2552964883 100755 --- a/cmd/workspace/providers/providers.go +++ b/cmd/workspace/providers/providers.go @@ -181,11 +181,11 @@ func newDelete() *cobra.Command { } deleteReq.Name = args[0] - response, err := w.Providers.Delete(ctx, deleteReq) + err = w.Providers.Delete(ctx, deleteReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. diff --git a/cmd/workspace/queries/queries.go b/cmd/workspace/queries/queries.go index ea02e4e2b6..ef2de44667 100755 --- a/cmd/workspace/queries/queries.go +++ b/cmd/workspace/queries/queries.go @@ -161,11 +161,11 @@ func newDelete() *cobra.Command { } deleteReq.QueryId = args[0] - response, err := w.Queries.Delete(ctx, deleteReq) + err = w.Queries.Delete(ctx, deleteReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -374,11 +374,11 @@ func newRestore() *cobra.Command { } restoreReq.QueryId = args[0] - response, err := w.Queries.Restore(ctx, restoreReq) + err = w.Queries.Restore(ctx, restoreReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. diff --git a/cmd/workspace/query-visualizations/query-visualizations.go b/cmd/workspace/query-visualizations/query-visualizations.go index ca628e1a9b..4f04c42613 100755 --- a/cmd/workspace/query-visualizations/query-visualizations.go +++ b/cmd/workspace/query-visualizations/query-visualizations.go @@ -140,11 +140,11 @@ func newDelete() *cobra.Command { deleteReq.Id = args[0] - response, err := w.QueryVisualizations.Delete(ctx, deleteReq) + err = w.QueryVisualizations.Delete(ctx, deleteReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. diff --git a/cmd/workspace/recipient-activation/recipient-activation.go b/cmd/workspace/recipient-activation/recipient-activation.go index cb787cf792..5fb5c7b9ef 100755 --- a/cmd/workspace/recipient-activation/recipient-activation.go +++ b/cmd/workspace/recipient-activation/recipient-activation.go @@ -80,11 +80,11 @@ func newGetActivationUrlInfo() *cobra.Command { getActivationUrlInfoReq.ActivationUrl = args[0] - response, err := w.RecipientActivation.GetActivationUrlInfo(ctx, getActivationUrlInfoReq) + err = w.RecipientActivation.GetActivationUrlInfo(ctx, getActivationUrlInfoReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. diff --git a/cmd/workspace/recipients/recipients.go b/cmd/workspace/recipients/recipients.go index 5c03b1521a..d7d432b9ce 100755 --- a/cmd/workspace/recipients/recipients.go +++ b/cmd/workspace/recipients/recipients.go @@ -200,11 +200,11 @@ func newDelete() *cobra.Command { } deleteReq.Name = args[0] - response, err := w.Recipients.Delete(ctx, deleteReq) + err = w.Recipients.Delete(ctx, deleteReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -598,11 +598,11 @@ func newUpdate() *cobra.Command { } updateReq.Name = args[0] - response, err := w.Recipients.Update(ctx, updateReq) + err = w.Recipients.Update(ctx, updateReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. diff --git a/cmd/workspace/registered-models/registered-models.go b/cmd/workspace/registered-models/registered-models.go index 864dbafc1a..98aec3bb31 100755 --- a/cmd/workspace/registered-models/registered-models.go +++ b/cmd/workspace/registered-models/registered-models.go @@ -223,11 +223,11 @@ func newDelete() *cobra.Command { } deleteReq.FullName = args[0] - response, err := w.RegisteredModels.Delete(ctx, deleteReq) + err = w.RegisteredModels.Delete(ctx, deleteReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -294,11 +294,11 @@ func newDeleteAlias() *cobra.Command { deleteAliasReq.FullName = args[0] deleteAliasReq.Alias = args[1] - response, err := w.RegisteredModels.DeleteAlias(ctx, deleteAliasReq) + err = w.RegisteredModels.DeleteAlias(ctx, deleteAliasReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. diff --git a/cmd/workspace/repos/repos.go b/cmd/workspace/repos/repos.go index 89668582c3..0c38183aa2 100755 --- a/cmd/workspace/repos/repos.go +++ b/cmd/workspace/repos/repos.go @@ -190,11 +190,11 @@ func newDelete() *cobra.Command { return fmt.Errorf("invalid REPO_ID: %s", args[0]) } - response, err := w.Repos.Delete(ctx, deleteReq) + err = w.Repos.Delete(ctx, deleteReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -661,11 +661,11 @@ func newUpdate() *cobra.Command { return fmt.Errorf("invalid REPO_ID: %s", args[0]) } - response, err := w.Repos.Update(ctx, updateReq) + err = w.Repos.Update(ctx, updateReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. diff --git a/cmd/workspace/schemas/schemas.go b/cmd/workspace/schemas/schemas.go index a5df090fba..ebdab2ab50 100755 --- a/cmd/workspace/schemas/schemas.go +++ b/cmd/workspace/schemas/schemas.go @@ -182,11 +182,11 @@ func newDelete() *cobra.Command { } deleteReq.FullName = args[0] - response, err := w.Schemas.Delete(ctx, deleteReq) + err = w.Schemas.Delete(ctx, deleteReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. diff --git a/cmd/workspace/secrets/secrets.go b/cmd/workspace/secrets/secrets.go index b0c4d2210c..ec6423d06a 100755 --- a/cmd/workspace/secrets/secrets.go +++ b/cmd/workspace/secrets/secrets.go @@ -108,11 +108,11 @@ func newCreateScope() *cobra.Command { createScopeReq.Scope = args[0] } - response, err := w.Secrets.CreateScope(ctx, createScopeReq) + err = w.Secrets.CreateScope(ctx, createScopeReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -198,11 +198,11 @@ func newDeleteAcl() *cobra.Command { deleteAclReq.Principal = args[1] } - response, err := w.Secrets.DeleteAcl(ctx, deleteAclReq) + err = w.Secrets.DeleteAcl(ctx, deleteAclReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -283,11 +283,11 @@ func newDeleteScope() *cobra.Command { deleteScopeReq.Scope = args[0] } - response, err := w.Secrets.DeleteScope(ctx, deleteScopeReq) + err = w.Secrets.DeleteScope(ctx, deleteScopeReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -373,11 +373,11 @@ func newDeleteSecret() *cobra.Command { deleteSecretReq.Key = args[1] } - response, err := w.Secrets.DeleteSecret(ctx, deleteSecretReq) + err = w.Secrets.DeleteSecret(ctx, deleteSecretReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -820,11 +820,11 @@ func newPutAcl() *cobra.Command { } } - response, err := w.Secrets.PutAcl(ctx, putAclReq) + err = w.Secrets.PutAcl(ctx, putAclReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. diff --git a/cmd/workspace/service-principals/service-principals.go b/cmd/workspace/service-principals/service-principals.go index ebc06419f9..353c087611 100755 --- a/cmd/workspace/service-principals/service-principals.go +++ b/cmd/workspace/service-principals/service-principals.go @@ -169,11 +169,11 @@ func newDelete() *cobra.Command { } deleteReq.Id = args[0] - response, err := w.ServicePrincipals.Delete(ctx, deleteReq) + err = w.ServicePrincipals.Delete(ctx, deleteReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -398,11 +398,11 @@ func newPatch() *cobra.Command { } patchReq.Id = args[0] - response, err := w.ServicePrincipals.Patch(ctx, patchReq) + err = w.ServicePrincipals.Patch(ctx, patchReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -494,11 +494,11 @@ func newUpdate() *cobra.Command { } updateReq.Id = args[0] - response, err := w.ServicePrincipals.Update(ctx, updateReq) + err = w.ServicePrincipals.Update(ctx, updateReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. diff --git a/cmd/workspace/serving-endpoints/serving-endpoints.go b/cmd/workspace/serving-endpoints/serving-endpoints.go index f565b5269c..9424c5e4e7 100755 --- a/cmd/workspace/serving-endpoints/serving-endpoints.go +++ b/cmd/workspace/serving-endpoints/serving-endpoints.go @@ -238,11 +238,11 @@ func newDelete() *cobra.Command { deleteReq.Name = args[0] - response, err := w.ServingEndpoints.Delete(ctx, deleteReq) + err = w.ServingEndpoints.Delete(ctx, deleteReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -304,11 +304,11 @@ func newExportMetrics() *cobra.Command { exportMetricsReq.Name = args[0] - response, err := w.ServingEndpoints.ExportMetrics(ctx, exportMetricsReq) + err = w.ServingEndpoints.ExportMetrics(ctx, exportMetricsReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. diff --git a/cmd/workspace/shares/shares.go b/cmd/workspace/shares/shares.go index 6cfee46822..2c0479a0a5 100755 --- a/cmd/workspace/shares/shares.go +++ b/cmd/workspace/shares/shares.go @@ -164,11 +164,11 @@ func newDelete() *cobra.Command { deleteReq.Name = args[0] - response, err := w.Shares.Delete(ctx, deleteReq) + err = w.Shares.Delete(ctx, deleteReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -511,11 +511,11 @@ func newUpdatePermissions() *cobra.Command { } updatePermissionsReq.Name = args[0] - response, err := w.Shares.UpdatePermissions(ctx, updatePermissionsReq) + err = w.Shares.UpdatePermissions(ctx, updatePermissionsReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. diff --git a/cmd/workspace/storage-credentials/storage-credentials.go b/cmd/workspace/storage-credentials/storage-credentials.go index c849629f6c..5f9f89be14 100755 --- a/cmd/workspace/storage-credentials/storage-credentials.go +++ b/cmd/workspace/storage-credentials/storage-credentials.go @@ -70,7 +70,7 @@ func newCreate() *cobra.Command { // TODO: complex arg: azure_service_principal // TODO: complex arg: cloudflare_api_token cmd.Flags().StringVar(&createReq.Comment, "comment", createReq.Comment, `Comment associated with the credential.`) - // TODO: output-only field + // TODO: complex arg: databricks_gcp_service_account cmd.Flags().BoolVar(&createReq.ReadOnly, "read-only", createReq.ReadOnly, `Whether the storage credential is only usable for read operations.`) cmd.Flags().BoolVar(&createReq.SkipValidation, "skip-validation", createReq.SkipValidation, `Supplying true to this argument skips validation of the created credential.`) @@ -191,11 +191,11 @@ func newDelete() *cobra.Command { } deleteReq.Name = args[0] - response, err := w.StorageCredentials.Delete(ctx, deleteReq) + err = w.StorageCredentials.Delete(ctx, deleteReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -381,7 +381,7 @@ func newUpdate() *cobra.Command { // TODO: complex arg: azure_service_principal // TODO: complex arg: cloudflare_api_token cmd.Flags().StringVar(&updateReq.Comment, "comment", updateReq.Comment, `Comment associated with the credential.`) - // TODO: output-only field + // TODO: complex arg: databricks_gcp_service_account cmd.Flags().BoolVar(&updateReq.Force, "force", updateReq.Force, `Force update even if there are dependent external locations or external tables.`) cmd.Flags().StringVar(&updateReq.NewName, "new-name", updateReq.NewName, `New name for the storage credential.`) cmd.Flags().StringVar(&updateReq.Owner, "owner", updateReq.Owner, `Username of current owner of credential.`) @@ -476,7 +476,7 @@ func newValidate() *cobra.Command { // TODO: complex arg: azure_managed_identity // TODO: complex arg: azure_service_principal // TODO: complex arg: cloudflare_api_token - // TODO: output-only field + // TODO: complex arg: databricks_gcp_service_account cmd.Flags().StringVar(&validateReq.ExternalLocationName, "external-location-name", validateReq.ExternalLocationName, `The name of an existing external location to validate.`) cmd.Flags().BoolVar(&validateReq.ReadOnly, "read-only", validateReq.ReadOnly, `Whether the storage credential is only usable for read operations.`) cmd.Flags().StringVar(&validateReq.StorageCredentialName, "storage-credential-name", validateReq.StorageCredentialName, `The name of the storage credential to validate.`) diff --git a/cmd/workspace/system-schemas/system-schemas.go b/cmd/workspace/system-schemas/system-schemas.go index 326840d106..9b2392a6e9 100755 --- a/cmd/workspace/system-schemas/system-schemas.go +++ b/cmd/workspace/system-schemas/system-schemas.go @@ -81,11 +81,11 @@ func newDisable() *cobra.Command { return fmt.Errorf("invalid SCHEMA_NAME: %s", args[1]) } - response, err := w.SystemSchemas.Disable(ctx, disableReq) + err = w.SystemSchemas.Disable(ctx, disableReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -151,11 +151,11 @@ func newEnable() *cobra.Command { return fmt.Errorf("invalid SCHEMA_NAME: %s", args[1]) } - response, err := w.SystemSchemas.Enable(ctx, enableReq) + err = w.SystemSchemas.Enable(ctx, enableReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. diff --git a/cmd/workspace/table-constraints/table-constraints.go b/cmd/workspace/table-constraints/table-constraints.go index 85638cb1fd..e17b95404a 100755 --- a/cmd/workspace/table-constraints/table-constraints.go +++ b/cmd/workspace/table-constraints/table-constraints.go @@ -177,11 +177,11 @@ func newDelete() *cobra.Command { return fmt.Errorf("invalid CASCADE: %s", args[2]) } - response, err := w.TableConstraints.Delete(ctx, deleteReq) + err = w.TableConstraints.Delete(ctx, deleteReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. diff --git a/cmd/workspace/tables/tables.go b/cmd/workspace/tables/tables.go index ed41f499c0..d4e76587d8 100755 --- a/cmd/workspace/tables/tables.go +++ b/cmd/workspace/tables/tables.go @@ -98,11 +98,11 @@ func newDelete() *cobra.Command { } deleteReq.FullName = args[0] - response, err := w.Tables.Delete(ctx, deleteReq) + err = w.Tables.Delete(ctx, deleteReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -520,11 +520,11 @@ func newUpdate() *cobra.Command { } updateReq.FullName = args[0] - response, err := w.Tables.Update(ctx, updateReq) + err = w.Tables.Update(ctx, updateReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. diff --git a/cmd/workspace/token-management/token-management.go b/cmd/workspace/token-management/token-management.go index 052ecab3f5..1c2e2c37c0 100755 --- a/cmd/workspace/token-management/token-management.go +++ b/cmd/workspace/token-management/token-management.go @@ -187,11 +187,11 @@ func newDelete() *cobra.Command { } deleteReq.TokenId = args[0] - response, err := w.TokenManagement.Delete(ctx, deleteReq) + err = w.TokenManagement.Delete(ctx, deleteReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. diff --git a/cmd/workspace/tokens/tokens.go b/cmd/workspace/tokens/tokens.go index 5af8648d9b..5550acfa5d 100755 --- a/cmd/workspace/tokens/tokens.go +++ b/cmd/workspace/tokens/tokens.go @@ -184,11 +184,11 @@ func newDelete() *cobra.Command { deleteReq.TokenId = args[0] } - response, err := w.Tokens.Delete(ctx, deleteReq) + err = w.Tokens.Delete(ctx, deleteReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. diff --git a/cmd/workspace/users/users.go b/cmd/workspace/users/users.go index 1c1e5e416f..078a712e4c 100755 --- a/cmd/workspace/users/users.go +++ b/cmd/workspace/users/users.go @@ -178,11 +178,11 @@ func newDelete() *cobra.Command { } deleteReq.Id = args[0] - response, err := w.Users.Delete(ctx, deleteReq) + err = w.Users.Delete(ctx, deleteReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -511,11 +511,11 @@ func newPatch() *cobra.Command { } patchReq.Id = args[0] - response, err := w.Users.Patch(ctx, patchReq) + err = w.Users.Patch(ctx, patchReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -679,11 +679,11 @@ func newUpdate() *cobra.Command { } updateReq.Id = args[0] - response, err := w.Users.Update(ctx, updateReq) + err = w.Users.Update(ctx, updateReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. diff --git a/cmd/workspace/vector-search-endpoints/vector-search-endpoints.go b/cmd/workspace/vector-search-endpoints/vector-search-endpoints.go index 287b775a3b..dec1938a5c 100755 --- a/cmd/workspace/vector-search-endpoints/vector-search-endpoints.go +++ b/cmd/workspace/vector-search-endpoints/vector-search-endpoints.go @@ -185,11 +185,11 @@ func newDeleteEndpoint() *cobra.Command { deleteEndpointReq.EndpointName = args[0] - response, err := w.VectorSearchEndpoints.DeleteEndpoint(ctx, deleteEndpointReq) + err = w.VectorSearchEndpoints.DeleteEndpoint(ctx, deleteEndpointReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. diff --git a/cmd/workspace/vector-search-indexes/vector-search-indexes.go b/cmd/workspace/vector-search-indexes/vector-search-indexes.go index 740681bd3d..a230ba080c 100755 --- a/cmd/workspace/vector-search-indexes/vector-search-indexes.go +++ b/cmd/workspace/vector-search-indexes/vector-search-indexes.go @@ -262,11 +262,11 @@ func newDeleteIndex() *cobra.Command { deleteIndexReq.IndexName = args[0] - response, err := w.VectorSearchIndexes.DeleteIndex(ctx, deleteIndexReq) + err = w.VectorSearchIndexes.DeleteIndex(ctx, deleteIndexReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -532,11 +532,11 @@ func newSyncIndex() *cobra.Command { syncIndexReq.IndexName = args[0] - response, err := w.VectorSearchIndexes.SyncIndex(ctx, syncIndexReq) + err = w.VectorSearchIndexes.SyncIndex(ctx, syncIndexReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. diff --git a/cmd/workspace/volumes/volumes.go b/cmd/workspace/volumes/volumes.go index 01fc52db1d..12cafeaf86 100755 --- a/cmd/workspace/volumes/volumes.go +++ b/cmd/workspace/volumes/volumes.go @@ -213,11 +213,11 @@ func newDelete() *cobra.Command { } deleteReq.Name = args[0] - response, err := w.Volumes.Delete(ctx, deleteReq) + err = w.Volumes.Delete(ctx, deleteReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. diff --git a/cmd/workspace/warehouses/warehouses.go b/cmd/workspace/warehouses/warehouses.go index 79d4979fe2..2e9282a853 100755 --- a/cmd/workspace/warehouses/warehouses.go +++ b/cmd/workspace/warehouses/warehouses.go @@ -195,11 +195,11 @@ func newDelete() *cobra.Command { } deleteReq.Id = args[0] - response, err := w.Warehouses.Delete(ctx, deleteReq) + err = w.Warehouses.Delete(ctx, deleteReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -303,7 +303,7 @@ func newEdit() *cobra.Command { return err } if editSkipWait { - return cmdio.Render(ctx, wait.Response) + return nil } spinner := cmdio.Spinner(ctx) info, err := wait.OnProgress(func(i *sql.GetWarehouseResponse) { @@ -824,11 +824,11 @@ func newSetWorkspaceWarehouseConfig() *cobra.Command { } } - response, err := w.Warehouses.SetWorkspaceWarehouseConfig(ctx, setWorkspaceWarehouseConfigReq) + err = w.Warehouses.SetWorkspaceWarehouseConfig(ctx, setWorkspaceWarehouseConfigReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -910,7 +910,7 @@ func newStart() *cobra.Command { return err } if startSkipWait { - return cmdio.Render(ctx, wait.Response) + return nil } spinner := cmdio.Spinner(ctx) info, err := wait.OnProgress(func(i *sql.GetWarehouseResponse) { @@ -1010,7 +1010,7 @@ func newStop() *cobra.Command { return err } if stopSkipWait { - return cmdio.Render(ctx, wait.Response) + return nil } spinner := cmdio.Spinner(ctx) info, err := wait.OnProgress(func(i *sql.GetWarehouseResponse) { diff --git a/cmd/workspace/workspace-conf/workspace-conf.go b/cmd/workspace/workspace-conf/workspace-conf.go index 6fb67af3ee..99207ffadc 100755 --- a/cmd/workspace/workspace-conf/workspace-conf.go +++ b/cmd/workspace/workspace-conf/workspace-conf.go @@ -137,11 +137,11 @@ func newSetStatus() *cobra.Command { return fmt.Errorf("please provide command input in JSON format by specifying the --json flag") } - response, err := w.WorkspaceConf.SetStatus(ctx, setStatusReq) + err = w.WorkspaceConf.SetStatus(ctx, setStatusReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. diff --git a/cmd/workspace/workspace/workspace.go b/cmd/workspace/workspace/workspace.go index 50985ade68..4fb63f0c02 100755 --- a/cmd/workspace/workspace/workspace.go +++ b/cmd/workspace/workspace/workspace.go @@ -119,11 +119,11 @@ func newDelete() *cobra.Command { deleteReq.Path = args[0] } - response, err := w.Workspace.Delete(ctx, deleteReq) + err = w.Workspace.Delete(ctx, deleteReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -509,11 +509,11 @@ func newImport() *cobra.Command { importReq.Path = args[0] } - response, err := w.Workspace.Import(ctx, importReq) + err = w.Workspace.Import(ctx, importReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. @@ -677,11 +677,11 @@ func newMkdirs() *cobra.Command { mkdirsReq.Path = args[0] } - response, err := w.Workspace.Mkdirs(ctx, mkdirsReq) + err = w.Workspace.Mkdirs(ctx, mkdirsReq) if err != nil { return err } - return cmdio.Render(ctx, response) + return nil } // Disable completions since they are not applicable. From 00a96ac73c7876f240cf381faeca2d59986f72c9 Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Wed, 6 Mar 2024 09:23:40 +0100 Subject: [PATCH 3/5] Make subservices work --- .codegen/service.go.tmpl | 41 ++- bundle/schema/docs/bundle_descriptions.json | 36 +-- cmd/account/access-control/access-control.go | 23 +- cmd/account/billable-usage/billable-usage.go | 9 +- cmd/account/budgets/budgets.go | 37 +-- cmd/account/credentials/credentials.go | 30 +-- .../csp-enablement-account.go | 20 +- .../custom-app-integration.go | 37 +-- .../encryption-keys/encryption-keys.go | 30 +-- .../esm-enablement-account.go | 20 +- cmd/account/groups/groups.go | 44 +-- .../ip-access-lists/ip-access-lists.go | 44 +-- cmd/account/log-delivery/log-delivery.go | 30 +-- .../metastore-assignments.go | 37 +-- cmd/account/metastores/metastores.go | 37 +-- .../network-connectivity.go | 58 +--- cmd/account/networks/networks.go | 30 +-- .../o-auth-published-apps.go | 9 +- .../personal-compute/personal-compute.go | 29 +- cmd/account/private-access/private-access.go | 37 +-- .../published-app-integration.go | 37 +-- .../service-principal-secrets.go | 23 +- .../service-principals/service-principals.go | 44 +-- cmd/account/settings/settings.go | 9 + .../storage-credentials.go | 37 +-- cmd/account/storage/storage.go | 30 +-- cmd/account/users/users.go | 44 +-- cmd/account/vpc-endpoints/vpc-endpoints.go | 30 +-- .../workspace-assignment.go | 30 +-- cmd/account/workspaces/workspaces.go | 37 +-- cmd/workspace/alerts/alerts.go | 37 +-- cmd/workspace/apps/apps.go | 44 +-- .../artifact-allowlists.go | 16 +- .../automatic-cluster-update.go | 20 +- cmd/workspace/catalogs/catalogs.go | 37 +-- cmd/workspace/clean-rooms/clean-rooms.go | 37 +-- .../cluster-policies/cluster-policies.go | 65 +---- cmd/workspace/clusters/clusters.go | 142 ++-------- cmd/workspace/connections/connections.go | 37 +-- .../credentials-manager.go | 9 +- .../csp-enablement/csp-enablement.go | 20 +- cmd/workspace/current-user/current-user.go | 9 +- .../dashboard-widgets/dashboard-widgets.go | 23 +- cmd/workspace/dashboards/dashboards.go | 44 +-- cmd/workspace/data-sources/data-sources.go | 9 +- .../default-namespace/default-namespace.go | 29 +- .../esm-enablement/esm-enablement.go | 20 +- cmd/workspace/experiments/experiments.go | 212 +++------------ .../external-locations/external-locations.go | 37 +-- cmd/workspace/functions/functions.go | 37 +-- .../git-credentials/git-credentials.go | 37 +-- .../global-init-scripts.go | 37 +-- cmd/workspace/grants/grants.go | 23 +- cmd/workspace/groups/groups.go | 44 +-- .../instance-pools/instance-pools.go | 65 +---- .../instance-profiles/instance-profiles.go | 30 +-- .../ip-access-lists/ip-access-lists.go | 44 +-- cmd/workspace/jobs/jobs.go | 142 ++-------- .../lakehouse-monitors/lakehouse-monitors.go | 58 +--- cmd/workspace/lakeview/lakeview.go | 9 +- cmd/workspace/libraries/libraries.go | 30 +-- cmd/workspace/metastores/metastores.go | 72 +---- .../model-registry/model-registry.go | 254 +++--------------- .../model-versions/model-versions.go | 37 +-- cmd/workspace/online-tables/online-tables.go | 23 +- .../permission-migration.go | 9 +- cmd/workspace/permissions/permissions.go | 30 +-- cmd/workspace/pipelines/pipelines.go | 100 ++----- .../policy-families/policy-families.go | 16 +- cmd/workspace/providers/providers.go | 44 +-- cmd/workspace/queries/queries.go | 44 +-- cmd/workspace/query-history/query-history.go | 9 +- .../query-visualizations.go | 23 +- .../recipient-activation.go | 16 +- cmd/workspace/recipients/recipients.go | 51 +--- .../registered-models/registered-models.go | 51 +--- cmd/workspace/repos/repos.go | 65 +---- .../restrict-workspace-admins.go | 29 +- cmd/workspace/schemas/schemas.go | 37 +-- cmd/workspace/secrets/secrets.go | 72 +---- .../service-principals/service-principals.go | 44 +-- .../serving-endpoints/serving-endpoints.go | 107 ++------ cmd/workspace/settings/settings.go | 13 + cmd/workspace/shares/shares.go | 51 +--- .../storage-credentials.go | 44 +-- .../system-schemas/system-schemas.go | 23 +- .../table-constraints/table-constraints.go | 16 +- cmd/workspace/tables/tables.go | 44 +-- .../token-management/token-management.go | 58 +--- cmd/workspace/tokens/tokens.go | 23 +- cmd/workspace/users/users.go | 72 +---- .../vector-search-endpoints.go | 30 +-- .../vector-search-indexes.go | 58 +--- cmd/workspace/volumes/volumes.go | 37 +-- cmd/workspace/warehouses/warehouses.go | 93 ++----- .../workspace-bindings/workspace-bindings.go | 30 +-- .../workspace-conf/workspace-conf.go | 16 +- cmd/workspace/workspace/workspace.go | 72 +---- 98 files changed, 830 insertions(+), 3345 deletions(-) diff --git a/.codegen/service.go.tmpl b/.codegen/service.go.tmpl index d4a5bb7fd4..a404c4c128 100644 --- a/.codegen/service.go.tmpl +++ b/.codegen/service.go.tmpl @@ -8,6 +8,10 @@ import ( "github.com/databricks/cli/cmd/root" "github.com/databricks/databricks-sdk-go/service/{{.Package.Name}}" "github.com/spf13/cobra" + + {{range .Subservices -}} + {{.SnakeName}} "github.com/databricks/cli/cmd/{{ if .ParentService.IsAccounts }}account{{ else }}workspace{{ end }}/{{.KebabName}}" + {{end}} ) {{ $excludes := @@ -34,6 +38,8 @@ import ( ]{{end}}{{end}} {{define "service"}} +{{- $excludeMethods := list "put-secret" -}} + // Slice with functions to override default command behavior. // Functions can be added from the `init()` function in manually curated files in this directory. var cmdOverrides []func(*cobra.Command) @@ -56,6 +62,23 @@ func New() *cobra.Command { {{- end }} } + {{ if gt (len .Methods) 0 -}} + // Add methods + {{- range .Methods}} + {{- if in $excludeMethods .KebabName }} + {{- continue}} + {{- end}} + cmd.AddCommand(new{{.PascalName}}()) + {{- end}} + {{- end}} + + {{ if .HasSubservices }} + // Add subservices + {{- range .Subservices}} + cmd.AddCommand({{.SnakeName}}.New()) + {{- end}} + {{- end}} + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -67,8 +90,7 @@ func New() *cobra.Command { {{- $serviceName := .KebabName -}} {{range .Methods}} -{{- $excludes := list "put-secret" -}} -{{if in $excludes .KebabName }} +{{if in $excludeMethods .KebabName }} {{continue}} {{end}} // start {{.KebabName}} command @@ -291,11 +313,6 @@ func new{{.PascalName}}() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(new{{.PascalName}}()) - }) -} {{end}} // end service {{.Name}}{{end}} @@ -304,7 +321,15 @@ func init() { response{{ if not .Pagination}}, err{{end}} := {{- else -}} err = - {{- end}} {{if .Service.IsAccounts}}a{{else}}w{{end}}.{{(.Service.TrimPrefix "account").PascalName}}.{{.PascalName}}(ctx{{if .Request}}, {{.CamelName}}Req{{end}}) + {{- end}} + {{- if .Service.IsAccounts}}a{{else}}w{{end}}. + {{- if .Service.HasParent }} + {{- (.Service.ParentService.TrimPrefix "account").PascalName }}. + {{- (.Service.TrimPrefix "account").PascalName}}(). + {{- else}} + {{- (.Service.TrimPrefix "account").PascalName}}. + {{- end}} + {{- .PascalName}}(ctx{{if .Request}}, {{.CamelName}}Req{{end}}) {{- if not (and .Response .Pagination) }} if err != nil { return err diff --git a/bundle/schema/docs/bundle_descriptions.json b/bundle/schema/docs/bundle_descriptions.json index 818cc73911..494c8c7527 100644 --- a/bundle/schema/docs/bundle_descriptions.json +++ b/bundle/schema/docs/bundle_descriptions.json @@ -193,7 +193,7 @@ "description": "An optional continuous property for this job. The continuous property will ensure that there is always one run executing. Only one of `schedule` and `continuous` can be used.", "properties": { "pause_status": { - "description": "Indicate whether the continuous execution of the job is paused or not. Defaults to UNPAUSED." + "description": "Whether this trigger is paused or not." } } }, @@ -725,7 +725,7 @@ "description": "An optional periodic schedule for this job. The default behavior is that the job only runs when triggered by clicking “Run Now” in the Jobs UI or sending an API request to `runNow`.", "properties": { "pause_status": { - "description": "Indicate whether the continuous execution of the job is paused or not. Defaults to UNPAUSED." + "description": "Whether this trigger is paused or not." }, "quartz_cron_expression": { "description": "A Cron expression using Quartz syntax that describes the schedule for a job.\nSee [Cron Trigger](http://www.quartz-scheduler.org/documentation/quartz-2.3.0/tutorials/crontrigger.html)\nfor details. This field is required.\"\n" @@ -785,7 +785,7 @@ "description": "Optional schema to write to. This parameter is only used when a warehouse_id is also provided. If not provided, the `default` schema is used." }, "source": { - "description": "Optional location type of the SQL file. When set to `WORKSPACE`, the SQL file will be retrieved\nfrom the local \u003cDatabricks\u003e workspace. When set to `GIT`, the SQL file will be retrieved from a Git repository\ndefined in `git_source`. If the value is empty, the task will use `GIT` if `git_source` is defined and `WORKSPACE` otherwise.\n\n* `WORKSPACE`: SQL file is located in \u003cDatabricks\u003e workspace.\n* `GIT`: SQL file is located in cloud Git provider.\n" + "description": "Optional location type of the Python file. When set to `WORKSPACE` or not specified, the file will be retrieved\nfrom the local \u003cDatabricks\u003e workspace or cloud location (if the `python_file` has a URI format). When set to `GIT`,\nthe Python file will be retrieved from a Git repository defined in `git_source`.\n\n* `WORKSPACE`: The Python file is located in a \u003cDatabricks\u003e workspace or at a cloud filesystem URI.\n* `GIT`: The Python file is located in a remote Git repository.\n" }, "warehouse_id": { "description": "ID of the SQL warehouse to connect to. If provided, we automatically generate and provide the profile and connection details to dbt. It can be overridden on a per-command basis by using the `--profiles-dir` command line argument." @@ -1269,7 +1269,7 @@ "description": "The path of the notebook to be run in the Databricks workspace or remote repository.\nFor notebooks stored in the Databricks workspace, the path must be absolute and begin with a slash.\nFor notebooks stored in a remote repository, the path must be relative. This field is required.\n" }, "source": { - "description": "Optional location type of the SQL file. When set to `WORKSPACE`, the SQL file will be retrieved\nfrom the local \u003cDatabricks\u003e workspace. When set to `GIT`, the SQL file will be retrieved from a Git repository\ndefined in `git_source`. If the value is empty, the task will use `GIT` if `git_source` is defined and `WORKSPACE` otherwise.\n\n* `WORKSPACE`: SQL file is located in \u003cDatabricks\u003e workspace.\n* `GIT`: SQL file is located in cloud Git provider.\n" + "description": "Optional location type of the Python file. When set to `WORKSPACE` or not specified, the file will be retrieved\nfrom the local \u003cDatabricks\u003e workspace or cloud location (if the `python_file` has a URI format). When set to `GIT`,\nthe Python file will be retrieved from a Git repository defined in `git_source`.\n\n* `WORKSPACE`: The Python file is located in a \u003cDatabricks\u003e workspace or at a cloud filesystem URI.\n* `GIT`: The Python file is located in a remote Git repository.\n" } } }, @@ -1371,7 +1371,7 @@ "description": "The Python file to be executed. Cloud file URIs (such as dbfs:/, s3:/, adls:/, gcs:/) and workspace paths are supported. For python files stored in the Databricks workspace, the path must be absolute and begin with `/`. For files stored in a remote repository, the path must be relative. This field is required." }, "source": { - "description": "Optional location type of the SQL file. When set to `WORKSPACE`, the SQL file will be retrieved\nfrom the local \u003cDatabricks\u003e workspace. When set to `GIT`, the SQL file will be retrieved from a Git repository\ndefined in `git_source`. If the value is empty, the task will use `GIT` if `git_source` is defined and `WORKSPACE` otherwise.\n\n* `WORKSPACE`: SQL file is located in \u003cDatabricks\u003e workspace.\n* `GIT`: SQL file is located in cloud Git provider.\n" + "description": "Optional location type of the Python file. When set to `WORKSPACE` or not specified, the file will be retrieved\nfrom the local \u003cDatabricks\u003e workspace or cloud location (if the `python_file` has a URI format). When set to `GIT`,\nthe Python file will be retrieved from a Git repository defined in `git_source`.\n\n* `WORKSPACE`: The Python file is located in a \u003cDatabricks\u003e workspace or at a cloud filesystem URI.\n* `GIT`: The Python file is located in a remote Git repository.\n" } } }, @@ -1449,7 +1449,7 @@ "description": "Path of the SQL file. Must be relative if the source is a remote Git repository and absolute for workspace paths." }, "source": { - "description": "Optional location type of the SQL file. When set to `WORKSPACE`, the SQL file will be retrieved\nfrom the local \u003cDatabricks\u003e workspace. When set to `GIT`, the SQL file will be retrieved from a Git repository\ndefined in `git_source`. If the value is empty, the task will use `GIT` if `git_source` is defined and `WORKSPACE` otherwise.\n\n* `WORKSPACE`: SQL file is located in \u003cDatabricks\u003e workspace.\n* `GIT`: SQL file is located in cloud Git provider.\n" + "description": "Optional location type of the Python file. When set to `WORKSPACE` or not specified, the file will be retrieved\nfrom the local \u003cDatabricks\u003e workspace or cloud location (if the `python_file` has a URI format). When set to `GIT`,\nthe Python file will be retrieved from a Git repository defined in `git_source`.\n\n* `WORKSPACE`: The Python file is located in a \u003cDatabricks\u003e workspace or at a cloud filesystem URI.\n* `GIT`: The Python file is located in a remote Git repository.\n" } } }, @@ -1479,7 +1479,7 @@ "description": "An optional timeout applied to each run of this job task. A value of `0` means no timeout." }, "webhook_notifications": { - "description": "A collection of system notification IDs to notify when runs of this task begin or complete. The default behavior is to not send any system notifications.", + "description": "A collection of system notification IDs to notify when runs of this job begin or complete.", "properties": { "on_duration_warning_threshold_exceeded": { "description": "An optional list of system notification IDs to call when the duration of a run exceeds the threshold specified for the `RUN_DURATION_SECONDS` metric in the `health` field. A maximum of 3 destinations can be specified for the `on_duration_warning_threshold_exceeded` property.", @@ -1551,7 +1551,7 @@ } }, "pause_status": { - "description": "Indicate whether the continuous execution of the job is paused or not. Defaults to UNPAUSED." + "description": "Whether this trigger is paused or not." }, "table": { "description": "Table trigger settings.", @@ -1576,7 +1576,7 @@ } }, "webhook_notifications": { - "description": "A collection of system notification IDs to notify when runs of this task begin or complete. The default behavior is to not send any system notifications.", + "description": "A collection of system notification IDs to notify when runs of this job begin or complete.", "properties": { "on_duration_warning_threshold_exceeded": { "description": "An optional list of system notification IDs to call when the duration of a run exceeds the threshold specified for the `RUN_DURATION_SECONDS` metric in the `health` field. A maximum of 3 destinations can be specified for the `on_duration_warning_threshold_exceeded` property.", @@ -2726,7 +2726,7 @@ "description": "An optional continuous property for this job. The continuous property will ensure that there is always one run executing. Only one of `schedule` and `continuous` can be used.", "properties": { "pause_status": { - "description": "Indicate whether the continuous execution of the job is paused or not. Defaults to UNPAUSED." + "description": "Whether this trigger is paused or not." } } }, @@ -3258,7 +3258,7 @@ "description": "An optional periodic schedule for this job. The default behavior is that the job only runs when triggered by clicking “Run Now” in the Jobs UI or sending an API request to `runNow`.", "properties": { "pause_status": { - "description": "Indicate whether the continuous execution of the job is paused or not. Defaults to UNPAUSED." + "description": "Whether this trigger is paused or not." }, "quartz_cron_expression": { "description": "A Cron expression using Quartz syntax that describes the schedule for a job.\nSee [Cron Trigger](http://www.quartz-scheduler.org/documentation/quartz-2.3.0/tutorials/crontrigger.html)\nfor details. This field is required.\"\n" @@ -3318,7 +3318,7 @@ "description": "Optional schema to write to. This parameter is only used when a warehouse_id is also provided. If not provided, the `default` schema is used." }, "source": { - "description": "Optional location type of the SQL file. When set to `WORKSPACE`, the SQL file will be retrieved\nfrom the local \u003cDatabricks\u003e workspace. When set to `GIT`, the SQL file will be retrieved from a Git repository\ndefined in `git_source`. If the value is empty, the task will use `GIT` if `git_source` is defined and `WORKSPACE` otherwise.\n\n* `WORKSPACE`: SQL file is located in \u003cDatabricks\u003e workspace.\n* `GIT`: SQL file is located in cloud Git provider.\n" + "description": "Optional location type of the Python file. When set to `WORKSPACE` or not specified, the file will be retrieved\nfrom the local \u003cDatabricks\u003e workspace or cloud location (if the `python_file` has a URI format). When set to `GIT`,\nthe Python file will be retrieved from a Git repository defined in `git_source`.\n\n* `WORKSPACE`: The Python file is located in a \u003cDatabricks\u003e workspace or at a cloud filesystem URI.\n* `GIT`: The Python file is located in a remote Git repository.\n" }, "warehouse_id": { "description": "ID of the SQL warehouse to connect to. If provided, we automatically generate and provide the profile and connection details to dbt. It can be overridden on a per-command basis by using the `--profiles-dir` command line argument." @@ -3802,7 +3802,7 @@ "description": "The path of the notebook to be run in the Databricks workspace or remote repository.\nFor notebooks stored in the Databricks workspace, the path must be absolute and begin with a slash.\nFor notebooks stored in a remote repository, the path must be relative. This field is required.\n" }, "source": { - "description": "Optional location type of the SQL file. When set to `WORKSPACE`, the SQL file will be retrieved\nfrom the local \u003cDatabricks\u003e workspace. When set to `GIT`, the SQL file will be retrieved from a Git repository\ndefined in `git_source`. If the value is empty, the task will use `GIT` if `git_source` is defined and `WORKSPACE` otherwise.\n\n* `WORKSPACE`: SQL file is located in \u003cDatabricks\u003e workspace.\n* `GIT`: SQL file is located in cloud Git provider.\n" + "description": "Optional location type of the Python file. When set to `WORKSPACE` or not specified, the file will be retrieved\nfrom the local \u003cDatabricks\u003e workspace or cloud location (if the `python_file` has a URI format). When set to `GIT`,\nthe Python file will be retrieved from a Git repository defined in `git_source`.\n\n* `WORKSPACE`: The Python file is located in a \u003cDatabricks\u003e workspace or at a cloud filesystem URI.\n* `GIT`: The Python file is located in a remote Git repository.\n" } } }, @@ -3904,7 +3904,7 @@ "description": "The Python file to be executed. Cloud file URIs (such as dbfs:/, s3:/, adls:/, gcs:/) and workspace paths are supported. For python files stored in the Databricks workspace, the path must be absolute and begin with `/`. For files stored in a remote repository, the path must be relative. This field is required." }, "source": { - "description": "Optional location type of the SQL file. When set to `WORKSPACE`, the SQL file will be retrieved\nfrom the local \u003cDatabricks\u003e workspace. When set to `GIT`, the SQL file will be retrieved from a Git repository\ndefined in `git_source`. If the value is empty, the task will use `GIT` if `git_source` is defined and `WORKSPACE` otherwise.\n\n* `WORKSPACE`: SQL file is located in \u003cDatabricks\u003e workspace.\n* `GIT`: SQL file is located in cloud Git provider.\n" + "description": "Optional location type of the Python file. When set to `WORKSPACE` or not specified, the file will be retrieved\nfrom the local \u003cDatabricks\u003e workspace or cloud location (if the `python_file` has a URI format). When set to `GIT`,\nthe Python file will be retrieved from a Git repository defined in `git_source`.\n\n* `WORKSPACE`: The Python file is located in a \u003cDatabricks\u003e workspace or at a cloud filesystem URI.\n* `GIT`: The Python file is located in a remote Git repository.\n" } } }, @@ -3982,7 +3982,7 @@ "description": "Path of the SQL file. Must be relative if the source is a remote Git repository and absolute for workspace paths." }, "source": { - "description": "Optional location type of the SQL file. When set to `WORKSPACE`, the SQL file will be retrieved\nfrom the local \u003cDatabricks\u003e workspace. When set to `GIT`, the SQL file will be retrieved from a Git repository\ndefined in `git_source`. If the value is empty, the task will use `GIT` if `git_source` is defined and `WORKSPACE` otherwise.\n\n* `WORKSPACE`: SQL file is located in \u003cDatabricks\u003e workspace.\n* `GIT`: SQL file is located in cloud Git provider.\n" + "description": "Optional location type of the Python file. When set to `WORKSPACE` or not specified, the file will be retrieved\nfrom the local \u003cDatabricks\u003e workspace or cloud location (if the `python_file` has a URI format). When set to `GIT`,\nthe Python file will be retrieved from a Git repository defined in `git_source`.\n\n* `WORKSPACE`: The Python file is located in a \u003cDatabricks\u003e workspace or at a cloud filesystem URI.\n* `GIT`: The Python file is located in a remote Git repository.\n" } } }, @@ -4012,7 +4012,7 @@ "description": "An optional timeout applied to each run of this job task. A value of `0` means no timeout." }, "webhook_notifications": { - "description": "A collection of system notification IDs to notify when runs of this task begin or complete. The default behavior is to not send any system notifications.", + "description": "A collection of system notification IDs to notify when runs of this job begin or complete.", "properties": { "on_duration_warning_threshold_exceeded": { "description": "An optional list of system notification IDs to call when the duration of a run exceeds the threshold specified for the `RUN_DURATION_SECONDS` metric in the `health` field. A maximum of 3 destinations can be specified for the `on_duration_warning_threshold_exceeded` property.", @@ -4084,7 +4084,7 @@ } }, "pause_status": { - "description": "Indicate whether the continuous execution of the job is paused or not. Defaults to UNPAUSED." + "description": "Whether this trigger is paused or not." }, "table": { "description": "Table trigger settings.", @@ -4109,7 +4109,7 @@ } }, "webhook_notifications": { - "description": "A collection of system notification IDs to notify when runs of this task begin or complete. The default behavior is to not send any system notifications.", + "description": "A collection of system notification IDs to notify when runs of this job begin or complete.", "properties": { "on_duration_warning_threshold_exceeded": { "description": "An optional list of system notification IDs to call when the duration of a run exceeds the threshold specified for the `RUN_DURATION_SECONDS` metric in the `health` field. A maximum of 3 destinations can be specified for the `on_duration_warning_threshold_exceeded` property.", diff --git a/cmd/account/access-control/access-control.go b/cmd/account/access-control/access-control.go index 36b69d01df..76ad4b51f2 100755 --- a/cmd/account/access-control/access-control.go +++ b/cmd/account/access-control/access-control.go @@ -29,6 +29,11 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newGetAssignableRolesForResource()) + cmd.AddCommand(newGetRuleSet()) + cmd.AddCommand(newUpdateRuleSet()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -97,12 +102,6 @@ func newGetAssignableRolesForResource() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGetAssignableRolesForResource()) - }) -} - // start get-rule-set command // Slice with functions to override default command behavior. @@ -172,12 +171,6 @@ func newGetRuleSet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGetRuleSet()) - }) -} - // start update-rule-set command // Slice with functions to override default command behavior. @@ -239,10 +232,4 @@ func newUpdateRuleSet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdateRuleSet()) - }) -} - // end service AccountAccessControl diff --git a/cmd/account/billable-usage/billable-usage.go b/cmd/account/billable-usage/billable-usage.go index bbbc9af231..d8d36bacce 100755 --- a/cmd/account/billable-usage/billable-usage.go +++ b/cmd/account/billable-usage/billable-usage.go @@ -25,6 +25,9 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newDownload()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -107,10 +110,4 @@ func newDownload() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDownload()) - }) -} - // end service BillableUsage diff --git a/cmd/account/budgets/budgets.go b/cmd/account/budgets/budgets.go index dfa2f6bc4c..e6f87a953c 100755 --- a/cmd/account/budgets/budgets.go +++ b/cmd/account/budgets/budgets.go @@ -31,6 +31,13 @@ func New() *cobra.Command { Hidden: true, } + // Add methods + cmd.AddCommand(newCreate()) + cmd.AddCommand(newDelete()) + cmd.AddCommand(newGet()) + cmd.AddCommand(newList()) + cmd.AddCommand(newUpdate()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -98,12 +105,6 @@ func newCreate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreate()) - }) -} - // start delete command // Slice with functions to override default command behavior. @@ -174,12 +175,6 @@ func newDelete() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDelete()) - }) -} - // start get command // Slice with functions to override default command behavior. @@ -251,12 +246,6 @@ func newGet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGet()) - }) -} - // start list command // Slice with functions to override default command behavior. @@ -297,12 +286,6 @@ func newList() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newList()) - }) -} - // start update command // Slice with functions to override default command behavior. @@ -372,10 +355,4 @@ func newUpdate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdate()) - }) -} - // end service Budgets diff --git a/cmd/account/credentials/credentials.go b/cmd/account/credentials/credentials.go index 72fcd70bd1..ed071cda35 100755 --- a/cmd/account/credentials/credentials.go +++ b/cmd/account/credentials/credentials.go @@ -31,6 +31,12 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newCreate()) + cmd.AddCommand(newDelete()) + cmd.AddCommand(newGet()) + cmd.AddCommand(newList()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -111,12 +117,6 @@ func newCreate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreate()) - }) -} - // start delete command // Slice with functions to override default command behavior. @@ -189,12 +189,6 @@ func newDelete() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDelete()) - }) -} - // start get command // Slice with functions to override default command behavior. @@ -266,12 +260,6 @@ func newGet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGet()) - }) -} - // start list command // Slice with functions to override default command behavior. @@ -315,10 +303,4 @@ func newList() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newList()) - }) -} - // end service Credentials diff --git a/cmd/account/csp-enablement-account/csp-enablement-account.go b/cmd/account/csp-enablement-account/csp-enablement-account.go index 4fb26cac51..7e5c35fb6a 100755 --- a/cmd/account/csp-enablement-account/csp-enablement-account.go +++ b/cmd/account/csp-enablement-account/csp-enablement-account.go @@ -33,6 +33,10 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newGet()) + cmd.AddCommand(newUpdate()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -77,7 +81,7 @@ func newGet() *cobra.Command { ctx := cmd.Context() a := root.AccountClient(ctx) - response, err := a.CspEnablementAccount.Get(ctx, getReq) + response, err := a.Settings.CspEnablementAccount().Get(ctx, getReq) if err != nil { return err } @@ -96,12 +100,6 @@ func newGet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGet()) - }) -} - // start update command // Slice with functions to override default command behavior. @@ -143,7 +141,7 @@ func newUpdate() *cobra.Command { return fmt.Errorf("please provide command input in JSON format by specifying the --json flag") } - response, err := a.CspEnablementAccount.Update(ctx, updateReq) + response, err := a.Settings.CspEnablementAccount().Update(ctx, updateReq) if err != nil { return err } @@ -162,10 +160,4 @@ func newUpdate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdate()) - }) -} - // end service CSPEnablementAccount diff --git a/cmd/account/custom-app-integration/custom-app-integration.go b/cmd/account/custom-app-integration/custom-app-integration.go index 79c0f8373f..79dd50c1f4 100755 --- a/cmd/account/custom-app-integration/custom-app-integration.go +++ b/cmd/account/custom-app-integration/custom-app-integration.go @@ -29,6 +29,13 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newCreate()) + cmd.AddCommand(newDelete()) + cmd.AddCommand(newGet()) + cmd.AddCommand(newList()) + cmd.AddCommand(newUpdate()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -103,12 +110,6 @@ func newCreate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreate()) - }) -} - // start delete command // Slice with functions to override default command behavior. @@ -168,12 +169,6 @@ func newDelete() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDelete()) - }) -} - // start get command // Slice with functions to override default command behavior. @@ -232,12 +227,6 @@ func newGet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGet()) - }) -} - // start list command // Slice with functions to override default command behavior. @@ -278,12 +267,6 @@ func newList() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newList()) - }) -} - // start update command // Slice with functions to override default command behavior. @@ -354,10 +337,4 @@ func newUpdate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdate()) - }) -} - // end service CustomAppIntegration diff --git a/cmd/account/encryption-keys/encryption-keys.go b/cmd/account/encryption-keys/encryption-keys.go index 3977f58375..c82f385ed8 100755 --- a/cmd/account/encryption-keys/encryption-keys.go +++ b/cmd/account/encryption-keys/encryption-keys.go @@ -42,6 +42,12 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newCreate()) + cmd.AddCommand(newDelete()) + cmd.AddCommand(newGet()) + cmd.AddCommand(newList()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -128,12 +134,6 @@ func newCreate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreate()) - }) -} - // start delete command // Slice with functions to override default command behavior. @@ -193,12 +193,6 @@ func newDelete() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDelete()) - }) -} - // start get command // Slice with functions to override default command behavior. @@ -271,12 +265,6 @@ func newGet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGet()) - }) -} - // start list command // Slice with functions to override default command behavior. @@ -331,10 +319,4 @@ func newList() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newList()) - }) -} - // end service EncryptionKeys diff --git a/cmd/account/esm-enablement-account/esm-enablement-account.go b/cmd/account/esm-enablement-account/esm-enablement-account.go index fc488e20f7..4b7cc441af 100755 --- a/cmd/account/esm-enablement-account/esm-enablement-account.go +++ b/cmd/account/esm-enablement-account/esm-enablement-account.go @@ -31,6 +31,10 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newGet()) + cmd.AddCommand(newUpdate()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -75,7 +79,7 @@ func newGet() *cobra.Command { ctx := cmd.Context() a := root.AccountClient(ctx) - response, err := a.EsmEnablementAccount.Get(ctx, getReq) + response, err := a.Settings.EsmEnablementAccount().Get(ctx, getReq) if err != nil { return err } @@ -94,12 +98,6 @@ func newGet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGet()) - }) -} - // start update command // Slice with functions to override default command behavior. @@ -141,7 +139,7 @@ func newUpdate() *cobra.Command { return fmt.Errorf("please provide command input in JSON format by specifying the --json flag") } - response, err := a.EsmEnablementAccount.Update(ctx, updateReq) + response, err := a.Settings.EsmEnablementAccount().Update(ctx, updateReq) if err != nil { return err } @@ -160,10 +158,4 @@ func newUpdate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdate()) - }) -} - // end service ESMEnablementAccount diff --git a/cmd/account/groups/groups.go b/cmd/account/groups/groups.go index a068fba45c..68ae1b2af4 100755 --- a/cmd/account/groups/groups.go +++ b/cmd/account/groups/groups.go @@ -33,6 +33,14 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newCreate()) + cmd.AddCommand(newDelete()) + cmd.AddCommand(newGet()) + cmd.AddCommand(newList()) + cmd.AddCommand(newPatch()) + cmd.AddCommand(newUpdate()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -114,12 +122,6 @@ func newCreate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreate()) - }) -} - // start delete command // Slice with functions to override default command behavior. @@ -190,12 +192,6 @@ func newDelete() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDelete()) - }) -} - // start get command // Slice with functions to override default command behavior. @@ -266,12 +262,6 @@ func newGet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGet()) - }) -} - // start list command // Slice with functions to override default command behavior. @@ -330,12 +320,6 @@ func newList() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newList()) - }) -} - // start patch command // Slice with functions to override default command behavior. @@ -417,12 +401,6 @@ func newPatch() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newPatch()) - }) -} - // start update command // Slice with functions to override default command behavior. @@ -511,10 +489,4 @@ func newUpdate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdate()) - }) -} - // end service AccountGroups diff --git a/cmd/account/ip-access-lists/ip-access-lists.go b/cmd/account/ip-access-lists/ip-access-lists.go index dd836c90aa..364c5a9193 100755 --- a/cmd/account/ip-access-lists/ip-access-lists.go +++ b/cmd/account/ip-access-lists/ip-access-lists.go @@ -48,6 +48,14 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newCreate()) + cmd.AddCommand(newDelete()) + cmd.AddCommand(newGet()) + cmd.AddCommand(newList()) + cmd.AddCommand(newReplace()) + cmd.AddCommand(newUpdate()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -158,12 +166,6 @@ func newCreate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreate()) - }) -} - // start delete command // Slice with functions to override default command behavior. @@ -234,12 +236,6 @@ func newDelete() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDelete()) - }) -} - // start get command // Slice with functions to override default command behavior. @@ -310,12 +306,6 @@ func newGet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGet()) - }) -} - // start list command // Slice with functions to override default command behavior. @@ -355,12 +345,6 @@ func newList() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newList()) - }) -} - // start replace command // Slice with functions to override default command behavior. @@ -468,12 +452,6 @@ func newReplace() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newReplace()) - }) -} - // start update command // Slice with functions to override default command behavior. @@ -570,10 +548,4 @@ func newUpdate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdate()) - }) -} - // end service AccountIpAccessLists diff --git a/cmd/account/log-delivery/log-delivery.go b/cmd/account/log-delivery/log-delivery.go index eed8942b8f..f51573e9f5 100755 --- a/cmd/account/log-delivery/log-delivery.go +++ b/cmd/account/log-delivery/log-delivery.go @@ -85,6 +85,12 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newCreate()) + cmd.AddCommand(newGet()) + cmd.AddCommand(newList()) + cmd.AddCommand(newPatchStatus()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -181,12 +187,6 @@ func newCreate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreate()) - }) -} - // start get command // Slice with functions to override default command behavior. @@ -258,12 +258,6 @@ func newGet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGet()) - }) -} - // start list command // Slice with functions to override default command behavior. @@ -319,12 +313,6 @@ func newList() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newList()) - }) -} - // start patch-status command // Slice with functions to override default command behavior. @@ -413,10 +401,4 @@ func newPatchStatus() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newPatchStatus()) - }) -} - // end service LogDelivery diff --git a/cmd/account/metastore-assignments/metastore-assignments.go b/cmd/account/metastore-assignments/metastore-assignments.go index b1d0508b34..013d25cff8 100755 --- a/cmd/account/metastore-assignments/metastore-assignments.go +++ b/cmd/account/metastore-assignments/metastore-assignments.go @@ -27,6 +27,13 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newCreate()) + cmd.AddCommand(newDelete()) + cmd.AddCommand(newGet()) + cmd.AddCommand(newList()) + cmd.AddCommand(newUpdate()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -108,12 +115,6 @@ func newCreate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreate()) - }) -} - // start delete command // Slice with functions to override default command behavior. @@ -178,12 +179,6 @@ func newDelete() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDelete()) - }) -} - // start get command // Slice with functions to override default command behavior. @@ -248,12 +243,6 @@ func newGet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGet()) - }) -} - // start list command // Slice with functions to override default command behavior. @@ -310,12 +299,6 @@ func newList() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newList()) - }) -} - // start update command // Slice with functions to override default command behavior. @@ -390,10 +373,4 @@ func newUpdate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdate()) - }) -} - // end service AccountMetastoreAssignments diff --git a/cmd/account/metastores/metastores.go b/cmd/account/metastores/metastores.go index e8b7c8f702..bcccff8123 100755 --- a/cmd/account/metastores/metastores.go +++ b/cmd/account/metastores/metastores.go @@ -26,6 +26,13 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newCreate()) + cmd.AddCommand(newDelete()) + cmd.AddCommand(newGet()) + cmd.AddCommand(newList()) + cmd.AddCommand(newUpdate()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -98,12 +105,6 @@ func newCreate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreate()) - }) -} - // start delete command // Slice with functions to override default command behavior. @@ -164,12 +165,6 @@ func newDelete() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDelete()) - }) -} - // start get command // Slice with functions to override default command behavior. @@ -228,12 +223,6 @@ func newGet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGet()) - }) -} - // start list command // Slice with functions to override default command behavior. @@ -273,12 +262,6 @@ func newList() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newList()) - }) -} - // start update command // Slice with functions to override default command behavior. @@ -347,10 +330,4 @@ func newUpdate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdate()) - }) -} - // end service AccountMetastores diff --git a/cmd/account/network-connectivity/network-connectivity.go b/cmd/account/network-connectivity/network-connectivity.go index e21f3bd7f4..fbde0694e5 100755 --- a/cmd/account/network-connectivity/network-connectivity.go +++ b/cmd/account/network-connectivity/network-connectivity.go @@ -28,6 +28,16 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newCreateNetworkConnectivityConfiguration()) + cmd.AddCommand(newCreatePrivateEndpointRule()) + cmd.AddCommand(newDeleteNetworkConnectivityConfiguration()) + cmd.AddCommand(newDeletePrivateEndpointRule()) + cmd.AddCommand(newGetNetworkConnectivityConfiguration()) + cmd.AddCommand(newGetPrivateEndpointRule()) + cmd.AddCommand(newListNetworkConnectivityConfigurations()) + cmd.AddCommand(newListPrivateEndpointRules()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -117,12 +127,6 @@ func newCreateNetworkConnectivityConfiguration() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreateNetworkConnectivityConfiguration()) - }) -} - // start create-private-endpoint-rule command // Slice with functions to override default command behavior. @@ -218,12 +222,6 @@ func newCreatePrivateEndpointRule() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreatePrivateEndpointRule()) - }) -} - // start delete-network-connectivity-configuration command // Slice with functions to override default command behavior. @@ -282,12 +280,6 @@ func newDeleteNetworkConnectivityConfiguration() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDeleteNetworkConnectivityConfiguration()) - }) -} - // start delete-private-endpoint-rule command // Slice with functions to override default command behavior. @@ -352,12 +344,6 @@ func newDeletePrivateEndpointRule() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDeletePrivateEndpointRule()) - }) -} - // start get-network-connectivity-configuration command // Slice with functions to override default command behavior. @@ -416,12 +402,6 @@ func newGetNetworkConnectivityConfiguration() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGetNetworkConnectivityConfiguration()) - }) -} - // start get-private-endpoint-rule command // Slice with functions to override default command behavior. @@ -482,12 +462,6 @@ func newGetPrivateEndpointRule() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGetPrivateEndpointRule()) - }) -} - // start list-network-connectivity-configurations command // Slice with functions to override default command behavior. @@ -540,12 +514,6 @@ func newListNetworkConnectivityConfigurations() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newListNetworkConnectivityConfigurations()) - }) -} - // start list-private-endpoint-rules command // Slice with functions to override default command behavior. @@ -603,10 +571,4 @@ func newListPrivateEndpointRules() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newListPrivateEndpointRules()) - }) -} - // end service NetworkConnectivity diff --git a/cmd/account/networks/networks.go b/cmd/account/networks/networks.go index 15586bdc98..6dc7729733 100755 --- a/cmd/account/networks/networks.go +++ b/cmd/account/networks/networks.go @@ -28,6 +28,12 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newCreate()) + cmd.AddCommand(newDelete()) + cmd.AddCommand(newGet()) + cmd.AddCommand(newList()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -119,12 +125,6 @@ func newCreate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreate()) - }) -} - // start delete command // Slice with functions to override default command behavior. @@ -200,12 +200,6 @@ func newDelete() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDelete()) - }) -} - // start get command // Slice with functions to override default command behavior. @@ -277,12 +271,6 @@ func newGet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGet()) - }) -} - // start list command // Slice with functions to override default command behavior. @@ -329,10 +317,4 @@ func newList() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newList()) - }) -} - // end service Networks diff --git a/cmd/account/o-auth-published-apps/o-auth-published-apps.go b/cmd/account/o-auth-published-apps/o-auth-published-apps.go index 1ce363ac92..a9e94e5aa6 100755 --- a/cmd/account/o-auth-published-apps/o-auth-published-apps.go +++ b/cmd/account/o-auth-published-apps/o-auth-published-apps.go @@ -27,6 +27,9 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newList()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -88,10 +91,4 @@ func newList() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newList()) - }) -} - // end service OAuthPublishedApps diff --git a/cmd/account/personal-compute/personal-compute.go b/cmd/account/personal-compute/personal-compute.go index d0fef1eed5..7931ccfb94 100755 --- a/cmd/account/personal-compute/personal-compute.go +++ b/cmd/account/personal-compute/personal-compute.go @@ -38,6 +38,11 @@ func New() *cobra.Command { Hidden: true, } + // Add methods + cmd.AddCommand(newDelete()) + cmd.AddCommand(newGet()) + cmd.AddCommand(newUpdate()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -82,7 +87,7 @@ func newDelete() *cobra.Command { ctx := cmd.Context() a := root.AccountClient(ctx) - response, err := a.PersonalCompute.Delete(ctx, deleteReq) + response, err := a.Settings.PersonalCompute().Delete(ctx, deleteReq) if err != nil { return err } @@ -101,12 +106,6 @@ func newDelete() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDelete()) - }) -} - // start get command // Slice with functions to override default command behavior. @@ -143,7 +142,7 @@ func newGet() *cobra.Command { ctx := cmd.Context() a := root.AccountClient(ctx) - response, err := a.PersonalCompute.Get(ctx, getReq) + response, err := a.Settings.PersonalCompute().Get(ctx, getReq) if err != nil { return err } @@ -162,12 +161,6 @@ func newGet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGet()) - }) -} - // start update command // Slice with functions to override default command behavior. @@ -208,7 +201,7 @@ func newUpdate() *cobra.Command { return fmt.Errorf("please provide command input in JSON format by specifying the --json flag") } - response, err := a.PersonalCompute.Update(ctx, updateReq) + response, err := a.Settings.PersonalCompute().Update(ctx, updateReq) if err != nil { return err } @@ -227,10 +220,4 @@ func newUpdate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdate()) - }) -} - // end service PersonalCompute diff --git a/cmd/account/private-access/private-access.go b/cmd/account/private-access/private-access.go index 458ff827e2..4641223c80 100755 --- a/cmd/account/private-access/private-access.go +++ b/cmd/account/private-access/private-access.go @@ -27,6 +27,13 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newCreate()) + cmd.AddCommand(newDelete()) + cmd.AddCommand(newGet()) + cmd.AddCommand(newList()) + cmd.AddCommand(newReplace()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -133,12 +140,6 @@ func newCreate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreate()) - }) -} - // start delete command // Slice with functions to override default command behavior. @@ -216,12 +217,6 @@ func newDelete() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDelete()) - }) -} - // start get command // Slice with functions to override default command behavior. @@ -299,12 +294,6 @@ func newGet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGet()) - }) -} - // start list command // Slice with functions to override default command behavior. @@ -348,12 +337,6 @@ func newList() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newList()) - }) -} - // start replace command // Slice with functions to override default command behavior. @@ -460,10 +443,4 @@ func newReplace() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newReplace()) - }) -} - // end service PrivateAccess diff --git a/cmd/account/published-app-integration/published-app-integration.go b/cmd/account/published-app-integration/published-app-integration.go index 54cf633714..8befd39ba5 100755 --- a/cmd/account/published-app-integration/published-app-integration.go +++ b/cmd/account/published-app-integration/published-app-integration.go @@ -27,6 +27,13 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newCreate()) + cmd.AddCommand(newDelete()) + cmd.AddCommand(newGet()) + cmd.AddCommand(newList()) + cmd.AddCommand(newUpdate()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -103,12 +110,6 @@ func newCreate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreate()) - }) -} - // start delete command // Slice with functions to override default command behavior. @@ -168,12 +169,6 @@ func newDelete() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDelete()) - }) -} - // start get command // Slice with functions to override default command behavior. @@ -232,12 +227,6 @@ func newGet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGet()) - }) -} - // start list command // Slice with functions to override default command behavior. @@ -278,12 +267,6 @@ func newList() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newList()) - }) -} - // start update command // Slice with functions to override default command behavior. @@ -353,10 +336,4 @@ func newUpdate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdate()) - }) -} - // end service PublishedAppIntegration diff --git a/cmd/account/service-principal-secrets/service-principal-secrets.go b/cmd/account/service-principal-secrets/service-principal-secrets.go index 1a646e25c3..0239df6642 100755 --- a/cmd/account/service-principal-secrets/service-principal-secrets.go +++ b/cmd/account/service-principal-secrets/service-principal-secrets.go @@ -38,6 +38,11 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newCreate()) + cmd.AddCommand(newDelete()) + cmd.AddCommand(newList()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -107,12 +112,6 @@ func newCreate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreate()) - }) -} - // start delete command // Slice with functions to override default command behavior. @@ -176,12 +175,6 @@ func newDelete() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDelete()) - }) -} - // start list command // Slice with functions to override default command behavior. @@ -242,10 +235,4 @@ func newList() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newList()) - }) -} - // end service ServicePrincipalSecrets diff --git a/cmd/account/service-principals/service-principals.go b/cmd/account/service-principals/service-principals.go index af18d53415..b9ad194cf8 100755 --- a/cmd/account/service-principals/service-principals.go +++ b/cmd/account/service-principals/service-principals.go @@ -32,6 +32,14 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newCreate()) + cmd.AddCommand(newDelete()) + cmd.AddCommand(newGet()) + cmd.AddCommand(newList()) + cmd.AddCommand(newPatch()) + cmd.AddCommand(newUpdate()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -112,12 +120,6 @@ func newCreate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreate()) - }) -} - // start delete command // Slice with functions to override default command behavior. @@ -188,12 +190,6 @@ func newDelete() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDelete()) - }) -} - // start get command // Slice with functions to override default command behavior. @@ -265,12 +261,6 @@ func newGet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGet()) - }) -} - // start list command // Slice with functions to override default command behavior. @@ -329,12 +319,6 @@ func newList() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newList()) - }) -} - // start patch command // Slice with functions to override default command behavior. @@ -417,12 +401,6 @@ func newPatch() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newPatch()) - }) -} - // start update command // Slice with functions to override default command behavior. @@ -513,10 +491,4 @@ func newUpdate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdate()) - }) -} - // end service AccountServicePrincipals diff --git a/cmd/account/settings/settings.go b/cmd/account/settings/settings.go index 4ba3ca780d..29bb6ad159 100755 --- a/cmd/account/settings/settings.go +++ b/cmd/account/settings/settings.go @@ -4,6 +4,10 @@ package settings import ( "github.com/spf13/cobra" + + csp_enablement_account "github.com/databricks/cli/cmd/account/csp-enablement-account" + esm_enablement_account "github.com/databricks/cli/cmd/account/esm-enablement-account" + personal_compute "github.com/databricks/cli/cmd/account/personal-compute" ) // Slice with functions to override default command behavior. @@ -24,6 +28,11 @@ func New() *cobra.Command { Hidden: true, } + // Add subservices + cmd.AddCommand(csp_enablement_account.New()) + cmd.AddCommand(esm_enablement_account.New()) + cmd.AddCommand(personal_compute.New()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) diff --git a/cmd/account/storage-credentials/storage-credentials.go b/cmd/account/storage-credentials/storage-credentials.go index 35b865c7fd..61f8521bc8 100755 --- a/cmd/account/storage-credentials/storage-credentials.go +++ b/cmd/account/storage-credentials/storage-credentials.go @@ -25,6 +25,13 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newCreate()) + cmd.AddCommand(newDelete()) + cmd.AddCommand(newGet()) + cmd.AddCommand(newList()) + cmd.AddCommand(newUpdate()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -107,12 +114,6 @@ func newCreate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreate()) - }) -} - // start delete command // Slice with functions to override default command behavior. @@ -176,12 +177,6 @@ func newDelete() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDelete()) - }) -} - // start get command // Slice with functions to override default command behavior. @@ -244,12 +239,6 @@ func newGet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGet()) - }) -} - // start list command // Slice with functions to override default command behavior. @@ -309,12 +298,6 @@ func newList() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newList()) - }) -} - // start update command // Slice with functions to override default command behavior. @@ -387,10 +370,4 @@ func newUpdate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdate()) - }) -} - // end service AccountStorageCredentials diff --git a/cmd/account/storage/storage.go b/cmd/account/storage/storage.go index d671355d6c..50460ed0a7 100755 --- a/cmd/account/storage/storage.go +++ b/cmd/account/storage/storage.go @@ -32,6 +32,12 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newCreate()) + cmd.AddCommand(newDelete()) + cmd.AddCommand(newGet()) + cmd.AddCommand(newList()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -108,12 +114,6 @@ func newCreate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreate()) - }) -} - // start delete command // Slice with functions to override default command behavior. @@ -185,12 +185,6 @@ func newDelete() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDelete()) - }) -} - // start get command // Slice with functions to override default command behavior. @@ -261,12 +255,6 @@ func newGet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGet()) - }) -} - // start list command // Slice with functions to override default command behavior. @@ -310,10 +298,4 @@ func newList() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newList()) - }) -} - // end service Storage diff --git a/cmd/account/users/users.go b/cmd/account/users/users.go index f5b81f219d..ab4bd95bb5 100755 --- a/cmd/account/users/users.go +++ b/cmd/account/users/users.go @@ -37,6 +37,14 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newCreate()) + cmd.AddCommand(newDelete()) + cmd.AddCommand(newGet()) + cmd.AddCommand(newList()) + cmd.AddCommand(newPatch()) + cmd.AddCommand(newUpdate()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -120,12 +128,6 @@ func newCreate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreate()) - }) -} - // start delete command // Slice with functions to override default command behavior. @@ -197,12 +199,6 @@ func newDelete() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDelete()) - }) -} - // start get command // Slice with functions to override default command behavior. @@ -281,12 +277,6 @@ func newGet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGet()) - }) -} - // start list command // Slice with functions to override default command behavior. @@ -345,12 +335,6 @@ func newList() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newList()) - }) -} - // start patch command // Slice with functions to override default command behavior. @@ -433,12 +417,6 @@ func newPatch() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newPatch()) - }) -} - // start update command // Slice with functions to override default command behavior. @@ -530,10 +508,4 @@ func newUpdate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdate()) - }) -} - // end service AccountUsers diff --git a/cmd/account/vpc-endpoints/vpc-endpoints.go b/cmd/account/vpc-endpoints/vpc-endpoints.go index 6d80e73141..0c15ca9c66 100755 --- a/cmd/account/vpc-endpoints/vpc-endpoints.go +++ b/cmd/account/vpc-endpoints/vpc-endpoints.go @@ -27,6 +27,12 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newCreate()) + cmd.AddCommand(newDelete()) + cmd.AddCommand(newGet()) + cmd.AddCommand(newList()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -126,12 +132,6 @@ func newCreate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreate()) - }) -} - // start delete command // Slice with functions to override default command behavior. @@ -210,12 +210,6 @@ func newDelete() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDelete()) - }) -} - // start get command // Slice with functions to override default command behavior. @@ -290,12 +284,6 @@ func newGet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGet()) - }) -} - // start list command // Slice with functions to override default command behavior. @@ -343,10 +331,4 @@ func newList() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newList()) - }) -} - // end service VpcEndpoints diff --git a/cmd/account/workspace-assignment/workspace-assignment.go b/cmd/account/workspace-assignment/workspace-assignment.go index ab82cd39fa..20f885249e 100755 --- a/cmd/account/workspace-assignment/workspace-assignment.go +++ b/cmd/account/workspace-assignment/workspace-assignment.go @@ -28,6 +28,12 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newDelete()) + cmd.AddCommand(newGet()) + cmd.AddCommand(newList()) + cmd.AddCommand(newUpdate()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -103,12 +109,6 @@ func newDelete() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDelete()) - }) -} - // start get command // Slice with functions to override default command behavior. @@ -170,12 +170,6 @@ func newGet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGet()) - }) -} - // start list command // Slice with functions to override default command behavior. @@ -235,12 +229,6 @@ func newList() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newList()) - }) -} - // start update command // Slice with functions to override default command behavior. @@ -318,10 +306,4 @@ func newUpdate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdate()) - }) -} - // end service WorkspaceAssignment diff --git a/cmd/account/workspaces/workspaces.go b/cmd/account/workspaces/workspaces.go index f95b3d5417..2cc0cb1a76 100755 --- a/cmd/account/workspaces/workspaces.go +++ b/cmd/account/workspaces/workspaces.go @@ -35,6 +35,13 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newCreate()) + cmd.AddCommand(newDelete()) + cmd.AddCommand(newGet()) + cmd.AddCommand(newList()) + cmd.AddCommand(newUpdate()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -166,12 +173,6 @@ func newCreate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreate()) - }) -} - // start delete command // Slice with functions to override default command behavior. @@ -252,12 +253,6 @@ func newDelete() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDelete()) - }) -} - // start get command // Slice with functions to override default command behavior. @@ -344,12 +339,6 @@ func newGet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGet()) - }) -} - // start list command // Slice with functions to override default command behavior. @@ -396,12 +385,6 @@ func newList() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newList()) - }) -} - // start update command // Slice with functions to override default command behavior. @@ -626,10 +609,4 @@ func newUpdate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdate()) - }) -} - // end service Workspaces diff --git a/cmd/workspace/alerts/alerts.go b/cmd/workspace/alerts/alerts.go index 773a34876a..695fa6a942 100755 --- a/cmd/workspace/alerts/alerts.go +++ b/cmd/workspace/alerts/alerts.go @@ -31,6 +31,13 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newCreate()) + cmd.AddCommand(newDelete()) + cmd.AddCommand(newGet()) + cmd.AddCommand(newList()) + cmd.AddCommand(newUpdate()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -103,12 +110,6 @@ func newCreate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreate()) - }) -} - // start delete command // Slice with functions to override default command behavior. @@ -178,12 +179,6 @@ func newDelete() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDelete()) - }) -} - // start get command // Slice with functions to override default command behavior. @@ -251,12 +246,6 @@ func newGet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGet()) - }) -} - // start list command // Slice with functions to override default command behavior. @@ -299,12 +288,6 @@ func newList() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newList()) - }) -} - // start update command // Slice with functions to override default command behavior. @@ -372,10 +355,4 @@ func newUpdate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdate()) - }) -} - // end service Alerts diff --git a/cmd/workspace/apps/apps.go b/cmd/workspace/apps/apps.go index 3b08626790..691584db72 100755 --- a/cmd/workspace/apps/apps.go +++ b/cmd/workspace/apps/apps.go @@ -32,6 +32,14 @@ func New() *cobra.Command { Hidden: true, } + // Add methods + cmd.AddCommand(newCreate()) + cmd.AddCommand(newDeleteApp()) + cmd.AddCommand(newGetApp()) + cmd.AddCommand(newGetAppDeploymentStatus()) + cmd.AddCommand(newGetApps()) + cmd.AddCommand(newGetEvents()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -101,12 +109,6 @@ func newCreate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreate()) - }) -} - // start delete-app command // Slice with functions to override default command behavior. @@ -165,12 +167,6 @@ func newDeleteApp() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDeleteApp()) - }) -} - // start get-app command // Slice with functions to override default command behavior. @@ -229,12 +225,6 @@ func newGetApp() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGetApp()) - }) -} - // start get-app-deployment-status command // Slice with functions to override default command behavior. @@ -295,12 +285,6 @@ func newGetAppDeploymentStatus() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGetAppDeploymentStatus()) - }) -} - // start get-apps command // Slice with functions to override default command behavior. @@ -343,12 +327,6 @@ func newGetApps() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGetApps()) - }) -} - // start get-events command // Slice with functions to override default command behavior. @@ -407,10 +385,4 @@ func newGetEvents() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGetEvents()) - }) -} - // end service Apps diff --git a/cmd/workspace/artifact-allowlists/artifact-allowlists.go b/cmd/workspace/artifact-allowlists/artifact-allowlists.go index e0b36ff925..329ca9c3da 100755 --- a/cmd/workspace/artifact-allowlists/artifact-allowlists.go +++ b/cmd/workspace/artifact-allowlists/artifact-allowlists.go @@ -29,6 +29,10 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newGet()) + cmd.AddCommand(newUpdate()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -99,12 +103,6 @@ func newGet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGet()) - }) -} - // start update command // Slice with functions to override default command behavior. @@ -178,10 +176,4 @@ func newUpdate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdate()) - }) -} - // end service ArtifactAllowlists diff --git a/cmd/workspace/automatic-cluster-update/automatic-cluster-update.go b/cmd/workspace/automatic-cluster-update/automatic-cluster-update.go index 4bb19cda98..fb3c3d0315 100755 --- a/cmd/workspace/automatic-cluster-update/automatic-cluster-update.go +++ b/cmd/workspace/automatic-cluster-update/automatic-cluster-update.go @@ -28,6 +28,10 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newGet()) + cmd.AddCommand(newUpdate()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -72,7 +76,7 @@ func newGet() *cobra.Command { ctx := cmd.Context() w := root.WorkspaceClient(ctx) - response, err := w.AutomaticClusterUpdate.Get(ctx, getReq) + response, err := w.Settings.AutomaticClusterUpdate().Get(ctx, getReq) if err != nil { return err } @@ -91,12 +95,6 @@ func newGet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGet()) - }) -} - // start update command // Slice with functions to override default command behavior. @@ -141,7 +139,7 @@ func newUpdate() *cobra.Command { return fmt.Errorf("please provide command input in JSON format by specifying the --json flag") } - response, err := w.AutomaticClusterUpdate.Update(ctx, updateReq) + response, err := w.Settings.AutomaticClusterUpdate().Update(ctx, updateReq) if err != nil { return err } @@ -160,10 +158,4 @@ func newUpdate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdate()) - }) -} - // end service AutomaticClusterUpdate diff --git a/cmd/workspace/catalogs/catalogs.go b/cmd/workspace/catalogs/catalogs.go index 8e639023f5..b08769420f 100755 --- a/cmd/workspace/catalogs/catalogs.go +++ b/cmd/workspace/catalogs/catalogs.go @@ -34,6 +34,13 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newCreate()) + cmd.AddCommand(newDelete()) + cmd.AddCommand(newGet()) + cmd.AddCommand(newList()) + cmd.AddCommand(newUpdate()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -126,12 +133,6 @@ func newCreate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreate()) - }) -} - // start delete command // Slice with functions to override default command behavior. @@ -193,12 +194,6 @@ func newDelete() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDelete()) - }) -} - // start get command // Slice with functions to override default command behavior. @@ -259,12 +254,6 @@ func newGet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGet()) - }) -} - // start list command // Slice with functions to override default command behavior. @@ -308,12 +297,6 @@ func newList() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newList()) - }) -} - // start update command // Slice with functions to override default command behavior. @@ -389,10 +372,4 @@ func newUpdate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdate()) - }) -} - // end service Catalogs diff --git a/cmd/workspace/clean-rooms/clean-rooms.go b/cmd/workspace/clean-rooms/clean-rooms.go index 4cee2ce6cf..33facfb957 100755 --- a/cmd/workspace/clean-rooms/clean-rooms.go +++ b/cmd/workspace/clean-rooms/clean-rooms.go @@ -35,6 +35,13 @@ func New() *cobra.Command { Hidden: true, } + // Add methods + cmd.AddCommand(newCreate()) + cmd.AddCommand(newDelete()) + cmd.AddCommand(newGet()) + cmd.AddCommand(newList()) + cmd.AddCommand(newUpdate()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -105,12 +112,6 @@ func newCreate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreate()) - }) -} - // start delete command // Slice with functions to override default command behavior. @@ -170,12 +171,6 @@ func newDelete() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDelete()) - }) -} - // start get command // Slice with functions to override default command behavior. @@ -237,12 +232,6 @@ func newGet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGet()) - }) -} - // start list command // Slice with functions to override default command behavior. @@ -298,12 +287,6 @@ func newList() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newList()) - }) -} - // start update command // Slice with functions to override default command behavior. @@ -387,10 +370,4 @@ func newUpdate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdate()) - }) -} - // end service CleanRooms diff --git a/cmd/workspace/cluster-policies/cluster-policies.go b/cmd/workspace/cluster-policies/cluster-policies.go index f6edee2b3d..15a75b1f76 100755 --- a/cmd/workspace/cluster-policies/cluster-policies.go +++ b/cmd/workspace/cluster-policies/cluster-policies.go @@ -49,6 +49,17 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newCreate()) + cmd.AddCommand(newDelete()) + cmd.AddCommand(newEdit()) + cmd.AddCommand(newGet()) + cmd.AddCommand(newGetPermissionLevels()) + cmd.AddCommand(newGetPermissions()) + cmd.AddCommand(newList()) + cmd.AddCommand(newSetPermissions()) + cmd.AddCommand(newUpdatePermissions()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -140,12 +151,6 @@ func newCreate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreate()) - }) -} - // start delete command // Slice with functions to override default command behavior. @@ -237,12 +242,6 @@ func newDelete() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDelete()) - }) -} - // start edit command // Slice with functions to override default command behavior. @@ -331,12 +330,6 @@ func newEdit() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newEdit()) - }) -} - // start get command // Slice with functions to override default command behavior. @@ -407,12 +400,6 @@ func newGet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGet()) - }) -} - // start get-permission-levels command // Slice with functions to override default command behavior. @@ -483,12 +470,6 @@ func newGetPermissionLevels() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGetPermissionLevels()) - }) -} - // start get-permissions command // Slice with functions to override default command behavior. @@ -560,12 +541,6 @@ func newGetPermissions() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGetPermissions()) - }) -} - // start list command // Slice with functions to override default command behavior. @@ -619,12 +594,6 @@ func newList() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newList()) - }) -} - // start set-permissions command // Slice with functions to override default command behavior. @@ -706,12 +675,6 @@ func newSetPermissions() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newSetPermissions()) - }) -} - // start update-permissions command // Slice with functions to override default command behavior. @@ -793,10 +756,4 @@ func newUpdatePermissions() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdatePermissions()) - }) -} - // end service ClusterPolicies diff --git a/cmd/workspace/clusters/clusters.go b/cmd/workspace/clusters/clusters.go index cf35b28375..8d77375522 100755 --- a/cmd/workspace/clusters/clusters.go +++ b/cmd/workspace/clusters/clusters.go @@ -54,6 +54,28 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newChangeOwner()) + cmd.AddCommand(newCreate()) + cmd.AddCommand(newDelete()) + cmd.AddCommand(newEdit()) + cmd.AddCommand(newEvents()) + cmd.AddCommand(newGet()) + cmd.AddCommand(newGetPermissionLevels()) + cmd.AddCommand(newGetPermissions()) + cmd.AddCommand(newList()) + cmd.AddCommand(newListNodeTypes()) + cmd.AddCommand(newListZones()) + cmd.AddCommand(newPermanentDelete()) + cmd.AddCommand(newPin()) + cmd.AddCommand(newResize()) + cmd.AddCommand(newRestart()) + cmd.AddCommand(newSetPermissions()) + cmd.AddCommand(newSparkVersions()) + cmd.AddCommand(newStart()) + cmd.AddCommand(newUnpin()) + cmd.AddCommand(newUpdatePermissions()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -143,12 +165,6 @@ func newChangeOwner() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newChangeOwner()) - }) -} - // start create command // Slice with functions to override default command behavior. @@ -293,12 +309,6 @@ func newCreate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreate()) - }) -} - // start delete command // Slice with functions to override default command behavior. @@ -409,12 +419,6 @@ func newDelete() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDelete()) - }) -} - // start edit command // Slice with functions to override default command behavior. @@ -567,12 +571,6 @@ func newEdit() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newEdit()) - }) -} - // start events command // Slice with functions to override default command behavior. @@ -669,12 +667,6 @@ func newEvents() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newEvents()) - }) -} - // start get command // Slice with functions to override default command behavior. @@ -751,12 +743,6 @@ func newGet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGet()) - }) -} - // start get-permission-levels command // Slice with functions to override default command behavior. @@ -827,12 +813,6 @@ func newGetPermissionLevels() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGetPermissionLevels()) - }) -} - // start get-permissions command // Slice with functions to override default command behavior. @@ -904,12 +884,6 @@ func newGetPermissions() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGetPermissions()) - }) -} - // start list command // Slice with functions to override default command behavior. @@ -970,12 +944,6 @@ func newList() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newList()) - }) -} - // start list-node-types command // Slice with functions to override default command behavior. @@ -1019,12 +987,6 @@ func newListNodeTypes() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newListNodeTypes()) - }) -} - // start list-zones command // Slice with functions to override default command behavior. @@ -1068,12 +1030,6 @@ func newListZones() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newListZones()) - }) -} - // start permanent-delete command // Slice with functions to override default command behavior. @@ -1169,12 +1125,6 @@ func newPermanentDelete() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newPermanentDelete()) - }) -} - // start pin command // Slice with functions to override default command behavior. @@ -1267,12 +1217,6 @@ func newPin() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newPin()) - }) -} - // start resize command // Slice with functions to override default command behavior. @@ -1384,12 +1328,6 @@ func newResize() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newResize()) - }) -} - // start restart command // Slice with functions to override default command behavior. @@ -1500,12 +1438,6 @@ func newRestart() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newRestart()) - }) -} - // start set-permissions command // Slice with functions to override default command behavior. @@ -1587,12 +1519,6 @@ func newSetPermissions() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newSetPermissions()) - }) -} - // start spark-versions command // Slice with functions to override default command behavior. @@ -1636,12 +1562,6 @@ func newSparkVersions() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newSparkVersions()) - }) -} - // start start command // Slice with functions to override default command behavior. @@ -1756,12 +1676,6 @@ func newStart() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newStart()) - }) -} - // start unpin command // Slice with functions to override default command behavior. @@ -1854,12 +1768,6 @@ func newUnpin() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUnpin()) - }) -} - // start update-permissions command // Slice with functions to override default command behavior. @@ -1941,10 +1849,4 @@ func newUpdatePermissions() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdatePermissions()) - }) -} - // end service Clusters diff --git a/cmd/workspace/connections/connections.go b/cmd/workspace/connections/connections.go index f740c7789f..87ec52beb8 100755 --- a/cmd/workspace/connections/connections.go +++ b/cmd/workspace/connections/connections.go @@ -37,6 +37,13 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newCreate()) + cmd.AddCommand(newDelete()) + cmd.AddCommand(newGet()) + cmd.AddCommand(newList()) + cmd.AddCommand(newUpdate()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -112,12 +119,6 @@ func newCreate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreate()) - }) -} - // start delete command // Slice with functions to override default command behavior. @@ -188,12 +189,6 @@ func newDelete() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDelete()) - }) -} - // start get command // Slice with functions to override default command behavior. @@ -264,12 +259,6 @@ func newGet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGet()) - }) -} - // start list command // Slice with functions to override default command behavior. @@ -309,12 +298,6 @@ func newList() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newList()) - }) -} - // start update command // Slice with functions to override default command behavior. @@ -386,10 +369,4 @@ func newUpdate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdate()) - }) -} - // end service Connections diff --git a/cmd/workspace/credentials-manager/credentials-manager.go b/cmd/workspace/credentials-manager/credentials-manager.go index 132ba51ee8..5a40232b3a 100755 --- a/cmd/workspace/credentials-manager/credentials-manager.go +++ b/cmd/workspace/credentials-manager/credentials-manager.go @@ -31,6 +31,9 @@ func New() *cobra.Command { Hidden: true, } + // Add methods + cmd.AddCommand(newExchangeToken()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -99,10 +102,4 @@ func newExchangeToken() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newExchangeToken()) - }) -} - // end service CredentialsManager diff --git a/cmd/workspace/csp-enablement/csp-enablement.go b/cmd/workspace/csp-enablement/csp-enablement.go index 51238de4ba..b0db05bdc9 100755 --- a/cmd/workspace/csp-enablement/csp-enablement.go +++ b/cmd/workspace/csp-enablement/csp-enablement.go @@ -31,6 +31,10 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newGet()) + cmd.AddCommand(newUpdate()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -75,7 +79,7 @@ func newGet() *cobra.Command { ctx := cmd.Context() w := root.WorkspaceClient(ctx) - response, err := w.CspEnablement.Get(ctx, getReq) + response, err := w.Settings.CspEnablement().Get(ctx, getReq) if err != nil { return err } @@ -94,12 +98,6 @@ func newGet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGet()) - }) -} - // start update command // Slice with functions to override default command behavior. @@ -144,7 +142,7 @@ func newUpdate() *cobra.Command { return fmt.Errorf("please provide command input in JSON format by specifying the --json flag") } - response, err := w.CspEnablement.Update(ctx, updateReq) + response, err := w.Settings.CspEnablement().Update(ctx, updateReq) if err != nil { return err } @@ -163,10 +161,4 @@ func newUpdate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdate()) - }) -} - // end service CSPEnablement diff --git a/cmd/workspace/current-user/current-user.go b/cmd/workspace/current-user/current-user.go index cb18e71d28..a42c3ead54 100755 --- a/cmd/workspace/current-user/current-user.go +++ b/cmd/workspace/current-user/current-user.go @@ -24,6 +24,9 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newMe()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -74,10 +77,4 @@ func newMe() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newMe()) - }) -} - // end service CurrentUser diff --git a/cmd/workspace/dashboard-widgets/dashboard-widgets.go b/cmd/workspace/dashboard-widgets/dashboard-widgets.go index 43a972e03a..90463dd00b 100755 --- a/cmd/workspace/dashboard-widgets/dashboard-widgets.go +++ b/cmd/workspace/dashboard-widgets/dashboard-widgets.go @@ -32,6 +32,11 @@ func New() *cobra.Command { Hidden: true, } + // Add methods + cmd.AddCommand(newCreate()) + cmd.AddCommand(newDelete()) + cmd.AddCommand(newUpdate()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -97,12 +102,6 @@ func newCreate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreate()) - }) -} - // start delete command // Slice with functions to override default command behavior. @@ -159,12 +158,6 @@ func newDelete() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDelete()) - }) -} - // start update command // Slice with functions to override default command behavior. @@ -231,10 +224,4 @@ func newUpdate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdate()) - }) -} - // end service DashboardWidgets diff --git a/cmd/workspace/dashboards/dashboards.go b/cmd/workspace/dashboards/dashboards.go index e07f739261..3020cb6069 100755 --- a/cmd/workspace/dashboards/dashboards.go +++ b/cmd/workspace/dashboards/dashboards.go @@ -32,6 +32,14 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newCreate()) + cmd.AddCommand(newDelete()) + cmd.AddCommand(newGet()) + cmd.AddCommand(newList()) + cmd.AddCommand(newRestore()) + cmd.AddCommand(newUpdate()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -97,12 +105,6 @@ func newCreate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreate()) - }) -} - // start delete command // Slice with functions to override default command behavior. @@ -171,12 +173,6 @@ func newDelete() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDelete()) - }) -} - // start get command // Slice with functions to override default command behavior. @@ -245,12 +241,6 @@ func newGet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGet()) - }) -} - // start list command // Slice with functions to override default command behavior. @@ -309,12 +299,6 @@ func newList() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newList()) - }) -} - // start restore command // Slice with functions to override default command behavior. @@ -382,12 +366,6 @@ func newRestore() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newRestore()) - }) -} - // start update command // Slice with functions to override default command behavior. @@ -469,10 +447,4 @@ func newUpdate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdate()) - }) -} - // end service Dashboards diff --git a/cmd/workspace/data-sources/data-sources.go b/cmd/workspace/data-sources/data-sources.go index 969399f420..0f0f8541e2 100755 --- a/cmd/workspace/data-sources/data-sources.go +++ b/cmd/workspace/data-sources/data-sources.go @@ -32,6 +32,9 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newList()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -84,10 +87,4 @@ func newList() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newList()) - }) -} - // end service DataSources diff --git a/cmd/workspace/default-namespace/default-namespace.go b/cmd/workspace/default-namespace/default-namespace.go index 7386791ffe..4d5b190864 100755 --- a/cmd/workspace/default-namespace/default-namespace.go +++ b/cmd/workspace/default-namespace/default-namespace.go @@ -38,6 +38,11 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newDelete()) + cmd.AddCommand(newGet()) + cmd.AddCommand(newUpdate()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -86,7 +91,7 @@ func newDelete() *cobra.Command { ctx := cmd.Context() w := root.WorkspaceClient(ctx) - response, err := w.DefaultNamespace.Delete(ctx, deleteReq) + response, err := w.Settings.DefaultNamespace().Delete(ctx, deleteReq) if err != nil { return err } @@ -105,12 +110,6 @@ func newDelete() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDelete()) - }) -} - // start get command // Slice with functions to override default command behavior. @@ -147,7 +146,7 @@ func newGet() *cobra.Command { ctx := cmd.Context() w := root.WorkspaceClient(ctx) - response, err := w.DefaultNamespace.Get(ctx, getReq) + response, err := w.Settings.DefaultNamespace().Get(ctx, getReq) if err != nil { return err } @@ -166,12 +165,6 @@ func newGet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGet()) - }) -} - // start update command // Slice with functions to override default command behavior. @@ -218,7 +211,7 @@ func newUpdate() *cobra.Command { return fmt.Errorf("please provide command input in JSON format by specifying the --json flag") } - response, err := w.DefaultNamespace.Update(ctx, updateReq) + response, err := w.Settings.DefaultNamespace().Update(ctx, updateReq) if err != nil { return err } @@ -237,10 +230,4 @@ func newUpdate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdate()) - }) -} - // end service DefaultNamespace diff --git a/cmd/workspace/esm-enablement/esm-enablement.go b/cmd/workspace/esm-enablement/esm-enablement.go index 16c56fd590..874cb5d4b8 100755 --- a/cmd/workspace/esm-enablement/esm-enablement.go +++ b/cmd/workspace/esm-enablement/esm-enablement.go @@ -33,6 +33,10 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newGet()) + cmd.AddCommand(newUpdate()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -77,7 +81,7 @@ func newGet() *cobra.Command { ctx := cmd.Context() w := root.WorkspaceClient(ctx) - response, err := w.EsmEnablement.Get(ctx, getReq) + response, err := w.Settings.EsmEnablement().Get(ctx, getReq) if err != nil { return err } @@ -96,12 +100,6 @@ func newGet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGet()) - }) -} - // start update command // Slice with functions to override default command behavior. @@ -146,7 +144,7 @@ func newUpdate() *cobra.Command { return fmt.Errorf("please provide command input in JSON format by specifying the --json flag") } - response, err := w.EsmEnablement.Update(ctx, updateReq) + response, err := w.Settings.EsmEnablement().Update(ctx, updateReq) if err != nil { return err } @@ -165,10 +163,4 @@ func newUpdate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdate()) - }) -} - // end service ESMEnablement diff --git a/cmd/workspace/experiments/experiments.go b/cmd/workspace/experiments/experiments.go index 368ec7f946..50337390a0 100755 --- a/cmd/workspace/experiments/experiments.go +++ b/cmd/workspace/experiments/experiments.go @@ -35,6 +35,38 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newCreateExperiment()) + cmd.AddCommand(newCreateRun()) + cmd.AddCommand(newDeleteExperiment()) + cmd.AddCommand(newDeleteRun()) + cmd.AddCommand(newDeleteRuns()) + cmd.AddCommand(newDeleteTag()) + cmd.AddCommand(newGetByName()) + cmd.AddCommand(newGetExperiment()) + cmd.AddCommand(newGetHistory()) + cmd.AddCommand(newGetPermissionLevels()) + cmd.AddCommand(newGetPermissions()) + cmd.AddCommand(newGetRun()) + cmd.AddCommand(newListArtifacts()) + cmd.AddCommand(newListExperiments()) + cmd.AddCommand(newLogBatch()) + cmd.AddCommand(newLogInputs()) + cmd.AddCommand(newLogMetric()) + cmd.AddCommand(newLogModel()) + cmd.AddCommand(newLogParam()) + cmd.AddCommand(newRestoreExperiment()) + cmd.AddCommand(newRestoreRun()) + cmd.AddCommand(newRestoreRuns()) + cmd.AddCommand(newSearchExperiments()) + cmd.AddCommand(newSearchRuns()) + cmd.AddCommand(newSetExperimentTag()) + cmd.AddCommand(newSetPermissions()) + cmd.AddCommand(newSetTag()) + cmd.AddCommand(newUpdateExperiment()) + cmd.AddCommand(newUpdatePermissions()) + cmd.AddCommand(newUpdateRun()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -126,12 +158,6 @@ func newCreateExperiment() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreateExperiment()) - }) -} - // start create-run command // Slice with functions to override default command behavior. @@ -202,12 +228,6 @@ func newCreateRun() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreateRun()) - }) -} - // start delete-experiment command // Slice with functions to override default command behavior. @@ -285,12 +305,6 @@ func newDeleteExperiment() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDeleteExperiment()) - }) -} - // start delete-run command // Slice with functions to override default command behavior. @@ -366,12 +380,6 @@ func newDeleteRun() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDeleteRun()) - }) -} - // start delete-runs command // Slice with functions to override default command behavior. @@ -461,12 +469,6 @@ func newDeleteRuns() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDeleteRuns()) - }) -} - // start delete-tag command // Slice with functions to override default command behavior. @@ -547,12 +549,6 @@ func newDeleteTag() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDeleteTag()) - }) -} - // start get-by-name command // Slice with functions to override default command behavior. @@ -619,12 +615,6 @@ func newGetByName() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGetByName()) - }) -} - // start get-experiment command // Slice with functions to override default command behavior. @@ -683,12 +673,6 @@ func newGetExperiment() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGetExperiment()) - }) -} - // start get-history command // Slice with functions to override default command behavior. @@ -749,12 +733,6 @@ func newGetHistory() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGetHistory()) - }) -} - // start get-permission-levels command // Slice with functions to override default command behavior. @@ -813,12 +791,6 @@ func newGetPermissionLevels() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGetPermissionLevels()) - }) -} - // start get-permissions command // Slice with functions to override default command behavior. @@ -878,12 +850,6 @@ func newGetPermissions() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGetPermissions()) - }) -} - // start get-run command // Slice with functions to override default command behavior. @@ -949,12 +915,6 @@ func newGetRun() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGetRun()) - }) -} - // start list-artifacts command // Slice with functions to override default command behavior. @@ -1011,12 +971,6 @@ func newListArtifacts() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newListArtifacts()) - }) -} - // start list-experiments command // Slice with functions to override default command behavior. @@ -1071,12 +1025,6 @@ func newListExperiments() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newListExperiments()) - }) -} - // start log-batch command // Slice with functions to override default command behavior. @@ -1180,12 +1128,6 @@ func newLogBatch() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newLogBatch()) - }) -} - // start log-inputs command // Slice with functions to override default command behavior. @@ -1252,12 +1194,6 @@ func newLogInputs() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newLogInputs()) - }) -} - // start log-metric command // Slice with functions to override default command behavior. @@ -1353,12 +1289,6 @@ func newLogMetric() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newLogMetric()) - }) -} - // start log-model command // Slice with functions to override default command behavior. @@ -1425,12 +1355,6 @@ func newLogModel() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newLogModel()) - }) -} - // start log-param command // Slice with functions to override default command behavior. @@ -1516,12 +1440,6 @@ func newLogParam() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newLogParam()) - }) -} - // start restore-experiment command // Slice with functions to override default command behavior. @@ -1602,12 +1520,6 @@ func newRestoreExperiment() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newRestoreExperiment()) - }) -} - // start restore-run command // Slice with functions to override default command behavior. @@ -1683,12 +1595,6 @@ func newRestoreRun() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newRestoreRun()) - }) -} - // start restore-runs command // Slice with functions to override default command behavior. @@ -1778,12 +1684,6 @@ func newRestoreRuns() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newRestoreRuns()) - }) -} - // start search-experiments command // Slice with functions to override default command behavior. @@ -1849,12 +1749,6 @@ func newSearchExperiments() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newSearchExperiments()) - }) -} - // start search-runs command // Slice with functions to override default command behavior. @@ -1923,12 +1817,6 @@ func newSearchRuns() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newSearchRuns()) - }) -} - // start set-experiment-tag command // Slice with functions to override default command behavior. @@ -2015,12 +1903,6 @@ func newSetExperimentTag() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newSetExperimentTag()) - }) -} - // start set-permissions command // Slice with functions to override default command behavior. @@ -2090,12 +1972,6 @@ func newSetPermissions() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newSetPermissions()) - }) -} - // start set-tag command // Slice with functions to override default command behavior. @@ -2182,12 +2058,6 @@ func newSetTag() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newSetTag()) - }) -} - // start update-experiment command // Slice with functions to override default command behavior. @@ -2265,12 +2135,6 @@ func newUpdateExperiment() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdateExperiment()) - }) -} - // start update-permissions command // Slice with functions to override default command behavior. @@ -2340,12 +2204,6 @@ func newUpdatePermissions() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdatePermissions()) - }) -} - // start update-run command // Slice with functions to override default command behavior. @@ -2413,10 +2271,4 @@ func newUpdateRun() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdateRun()) - }) -} - // end service Experiments diff --git a/cmd/workspace/external-locations/external-locations.go b/cmd/workspace/external-locations/external-locations.go index 7ddc0d8425..76e460050d 100755 --- a/cmd/workspace/external-locations/external-locations.go +++ b/cmd/workspace/external-locations/external-locations.go @@ -39,6 +39,13 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newCreate()) + cmd.AddCommand(newDelete()) + cmd.AddCommand(newGet()) + cmd.AddCommand(newList()) + cmd.AddCommand(newUpdate()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -138,12 +145,6 @@ func newCreate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreate()) - }) -} - // start delete command // Slice with functions to override default command behavior. @@ -205,12 +206,6 @@ func newDelete() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDelete()) - }) -} - // start get command // Slice with functions to override default command behavior. @@ -271,12 +266,6 @@ func newGet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGet()) - }) -} - // start list command // Slice with functions to override default command behavior. @@ -335,12 +324,6 @@ func newList() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newList()) - }) -} - // start update command // Slice with functions to override default command behavior. @@ -420,10 +403,4 @@ func newUpdate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdate()) - }) -} - // end service ExternalLocations diff --git a/cmd/workspace/functions/functions.go b/cmd/workspace/functions/functions.go index d1db1ec970..5b1b90241d 100755 --- a/cmd/workspace/functions/functions.go +++ b/cmd/workspace/functions/functions.go @@ -32,6 +32,13 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newCreate()) + cmd.AddCommand(newDelete()) + cmd.AddCommand(newGet()) + cmd.AddCommand(newList()) + cmd.AddCommand(newUpdate()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -103,12 +110,6 @@ func newCreate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreate()) - }) -} - // start delete command // Slice with functions to override default command behavior. @@ -187,12 +188,6 @@ func newDelete() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDelete()) - }) -} - // start get command // Slice with functions to override default command behavior. @@ -270,12 +265,6 @@ func newGet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGet()) - }) -} - // start list command // Slice with functions to override default command behavior. @@ -343,12 +332,6 @@ func newList() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newList()) - }) -} - // start update command // Slice with functions to override default command behavior. @@ -437,10 +420,4 @@ func newUpdate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdate()) - }) -} - // end service Functions diff --git a/cmd/workspace/git-credentials/git-credentials.go b/cmd/workspace/git-credentials/git-credentials.go index 8984a95387..ca8a1c274c 100755 --- a/cmd/workspace/git-credentials/git-credentials.go +++ b/cmd/workspace/git-credentials/git-credentials.go @@ -32,6 +32,13 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newCreate()) + cmd.AddCommand(newDelete()) + cmd.AddCommand(newGet()) + cmd.AddCommand(newList()) + cmd.AddCommand(newUpdate()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -123,12 +130,6 @@ func newCreate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreate()) - }) -} - // start delete command // Slice with functions to override default command behavior. @@ -202,12 +203,6 @@ func newDelete() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDelete()) - }) -} - // start get command // Slice with functions to override default command behavior. @@ -281,12 +276,6 @@ func newGet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGet()) - }) -} - // start list command // Slice with functions to override default command behavior. @@ -327,12 +316,6 @@ func newList() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newList()) - }) -} - // start update command // Slice with functions to override default command behavior. @@ -418,10 +401,4 @@ func newUpdate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdate()) - }) -} - // end service GitCredentials diff --git a/cmd/workspace/global-init-scripts/global-init-scripts.go b/cmd/workspace/global-init-scripts/global-init-scripts.go index de08614fed..0461b45148 100755 --- a/cmd/workspace/global-init-scripts/global-init-scripts.go +++ b/cmd/workspace/global-init-scripts/global-init-scripts.go @@ -35,6 +35,13 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newCreate()) + cmd.AddCommand(newDelete()) + cmd.AddCommand(newGet()) + cmd.AddCommand(newList()) + cmd.AddCommand(newUpdate()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -125,12 +132,6 @@ func newCreate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreate()) - }) -} - // start delete command // Slice with functions to override default command behavior. @@ -201,12 +202,6 @@ func newDelete() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDelete()) - }) -} - // start get command // Slice with functions to override default command behavior. @@ -277,12 +272,6 @@ func newGet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGet()) - }) -} - // start list command // Slice with functions to override default command behavior. @@ -325,12 +314,6 @@ func newList() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newList()) - }) -} - // start update command // Slice with functions to override default command behavior. @@ -416,10 +399,4 @@ func newUpdate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdate()) - }) -} - // end service GlobalInitScripts diff --git a/cmd/workspace/grants/grants.go b/cmd/workspace/grants/grants.go index 020e0bf8bf..851c3cfbe6 100755 --- a/cmd/workspace/grants/grants.go +++ b/cmd/workspace/grants/grants.go @@ -37,6 +37,11 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newGet()) + cmd.AddCommand(newGetEffective()) + cmd.AddCommand(newUpdate()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -110,12 +115,6 @@ func newGet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGet()) - }) -} - // start get-effective command // Slice with functions to override default command behavior. @@ -181,12 +180,6 @@ func newGetEffective() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGetEffective()) - }) -} - // start update command // Slice with functions to override default command behavior. @@ -260,10 +253,4 @@ func newUpdate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdate()) - }) -} - // end service Grants diff --git a/cmd/workspace/groups/groups.go b/cmd/workspace/groups/groups.go index aba54b8be6..2fc632201d 100755 --- a/cmd/workspace/groups/groups.go +++ b/cmd/workspace/groups/groups.go @@ -33,6 +33,14 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newCreate()) + cmd.AddCommand(newDelete()) + cmd.AddCommand(newGet()) + cmd.AddCommand(newList()) + cmd.AddCommand(newPatch()) + cmd.AddCommand(newUpdate()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -114,12 +122,6 @@ func newCreate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreate()) - }) -} - // start delete command // Slice with functions to override default command behavior. @@ -190,12 +192,6 @@ func newDelete() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDelete()) - }) -} - // start get command // Slice with functions to override default command behavior. @@ -266,12 +262,6 @@ func newGet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGet()) - }) -} - // start list command // Slice with functions to override default command behavior. @@ -330,12 +320,6 @@ func newList() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newList()) - }) -} - // start patch command // Slice with functions to override default command behavior. @@ -417,12 +401,6 @@ func newPatch() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newPatch()) - }) -} - // start update command // Slice with functions to override default command behavior. @@ -511,10 +489,4 @@ func newUpdate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdate()) - }) -} - // end service Groups diff --git a/cmd/workspace/instance-pools/instance-pools.go b/cmd/workspace/instance-pools/instance-pools.go index c9389fef86..8000365b02 100755 --- a/cmd/workspace/instance-pools/instance-pools.go +++ b/cmd/workspace/instance-pools/instance-pools.go @@ -44,6 +44,17 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newCreate()) + cmd.AddCommand(newDelete()) + cmd.AddCommand(newEdit()) + cmd.AddCommand(newGet()) + cmd.AddCommand(newGetPermissionLevels()) + cmd.AddCommand(newGetPermissions()) + cmd.AddCommand(newList()) + cmd.AddCommand(newSetPermissions()) + cmd.AddCommand(newUpdatePermissions()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -148,12 +159,6 @@ func newCreate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreate()) - }) -} - // start delete command // Slice with functions to override default command behavior. @@ -245,12 +250,6 @@ func newDelete() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDelete()) - }) -} - // start edit command // Slice with functions to override default command behavior. @@ -344,12 +343,6 @@ func newEdit() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newEdit()) - }) -} - // start get command // Slice with functions to override default command behavior. @@ -420,12 +413,6 @@ func newGet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGet()) - }) -} - // start get-permission-levels command // Slice with functions to override default command behavior. @@ -496,12 +483,6 @@ func newGetPermissionLevels() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGetPermissionLevels()) - }) -} - // start get-permissions command // Slice with functions to override default command behavior. @@ -573,12 +554,6 @@ func newGetPermissions() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGetPermissions()) - }) -} - // start list command // Slice with functions to override default command behavior. @@ -618,12 +593,6 @@ func newList() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newList()) - }) -} - // start set-permissions command // Slice with functions to override default command behavior. @@ -705,12 +674,6 @@ func newSetPermissions() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newSetPermissions()) - }) -} - // start update-permissions command // Slice with functions to override default command behavior. @@ -792,10 +755,4 @@ func newUpdatePermissions() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdatePermissions()) - }) -} - // end service InstancePools diff --git a/cmd/workspace/instance-profiles/instance-profiles.go b/cmd/workspace/instance-profiles/instance-profiles.go index 2077c4bfc5..919ec511d0 100755 --- a/cmd/workspace/instance-profiles/instance-profiles.go +++ b/cmd/workspace/instance-profiles/instance-profiles.go @@ -32,6 +32,12 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newAdd()) + cmd.AddCommand(newEdit()) + cmd.AddCommand(newList()) + cmd.AddCommand(newRemove()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -121,12 +127,6 @@ func newAdd() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newAdd()) - }) -} - // start edit command // Slice with functions to override default command behavior. @@ -220,12 +220,6 @@ func newEdit() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newEdit()) - }) -} - // start list command // Slice with functions to override default command behavior. @@ -267,12 +261,6 @@ func newList() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newList()) - }) -} - // start remove command // Slice with functions to override default command behavior. @@ -351,10 +339,4 @@ func newRemove() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newRemove()) - }) -} - // end service InstanceProfiles diff --git a/cmd/workspace/ip-access-lists/ip-access-lists.go b/cmd/workspace/ip-access-lists/ip-access-lists.go index 9eb08cb438..2b6ddfa230 100755 --- a/cmd/workspace/ip-access-lists/ip-access-lists.go +++ b/cmd/workspace/ip-access-lists/ip-access-lists.go @@ -47,6 +47,14 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newCreate()) + cmd.AddCommand(newDelete()) + cmd.AddCommand(newGet()) + cmd.AddCommand(newList()) + cmd.AddCommand(newReplace()) + cmd.AddCommand(newUpdate()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -159,12 +167,6 @@ func newCreate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreate()) - }) -} - // start delete command // Slice with functions to override default command behavior. @@ -235,12 +237,6 @@ func newDelete() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDelete()) - }) -} - // start get command // Slice with functions to override default command behavior. @@ -311,12 +307,6 @@ func newGet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGet()) - }) -} - // start list command // Slice with functions to override default command behavior. @@ -356,12 +346,6 @@ func newList() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newList()) - }) -} - // start replace command // Slice with functions to override default command behavior. @@ -471,12 +455,6 @@ func newReplace() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newReplace()) - }) -} - // start update command // Slice with functions to override default command behavior. @@ -575,10 +553,4 @@ func newUpdate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdate()) - }) -} - // end service IpAccessLists diff --git a/cmd/workspace/jobs/jobs.go b/cmd/workspace/jobs/jobs.go index 957aa60934..8a98e1c850 100755 --- a/cmd/workspace/jobs/jobs.go +++ b/cmd/workspace/jobs/jobs.go @@ -45,6 +45,28 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newCancelAllRuns()) + cmd.AddCommand(newCancelRun()) + cmd.AddCommand(newCreate()) + cmd.AddCommand(newDelete()) + cmd.AddCommand(newDeleteRun()) + cmd.AddCommand(newExportRun()) + cmd.AddCommand(newGet()) + cmd.AddCommand(newGetPermissionLevels()) + cmd.AddCommand(newGetPermissions()) + cmd.AddCommand(newGetRun()) + cmd.AddCommand(newGetRunOutput()) + cmd.AddCommand(newList()) + cmd.AddCommand(newListRuns()) + cmd.AddCommand(newRepairRun()) + cmd.AddCommand(newReset()) + cmd.AddCommand(newRunNow()) + cmd.AddCommand(newSetPermissions()) + cmd.AddCommand(newSubmit()) + cmd.AddCommand(newUpdate()) + cmd.AddCommand(newUpdatePermissions()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -119,12 +141,6 @@ func newCancelAllRuns() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCancelAllRuns()) - }) -} - // start cancel-run command // Slice with functions to override default command behavior. @@ -243,12 +259,6 @@ func newCancelRun() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCancelRun()) - }) -} - // start create command // Slice with functions to override default command behavior. @@ -308,12 +318,6 @@ func newCreate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreate()) - }) -} - // start delete command // Slice with functions to override default command behavior. @@ -407,12 +411,6 @@ func newDelete() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDelete()) - }) -} - // start delete-run command // Slice with functions to override default command behavior. @@ -506,12 +504,6 @@ func newDeleteRun() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDeleteRun()) - }) -} - // start export-run command // Slice with functions to override default command behavior. @@ -587,12 +579,6 @@ func newExportRun() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newExportRun()) - }) -} - // start get command // Slice with functions to override default command behavior. @@ -667,12 +653,6 @@ func newGet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGet()) - }) -} - // start get-permission-levels command // Slice with functions to override default command behavior. @@ -743,12 +723,6 @@ func newGetPermissionLevels() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGetPermissionLevels()) - }) -} - // start get-permissions command // Slice with functions to override default command behavior. @@ -820,12 +794,6 @@ func newGetPermissions() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGetPermissions()) - }) -} - // start get-run command // Slice with functions to override default command behavior. @@ -908,12 +876,6 @@ func newGetRun() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGetRun()) - }) -} - // start get-run-output command // Slice with functions to override default command behavior. @@ -996,12 +958,6 @@ func newGetRunOutput() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGetRunOutput()) - }) -} - // start list command // Slice with functions to override default command behavior. @@ -1058,12 +1014,6 @@ func newList() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newList()) - }) -} - // start list-runs command // Slice with functions to override default command behavior. @@ -1125,12 +1075,6 @@ func newListRuns() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newListRuns()) - }) -} - // start repair-run command // Slice with functions to override default command behavior. @@ -1264,12 +1208,6 @@ func newRepairRun() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newRepairRun()) - }) -} - // start reset command // Slice with functions to override default command behavior. @@ -1330,12 +1268,6 @@ func newReset() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newReset()) - }) -} - // start run-now command // Slice with functions to override default command behavior. @@ -1465,12 +1397,6 @@ func newRunNow() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newRunNow()) - }) -} - // start set-permissions command // Slice with functions to override default command behavior. @@ -1552,12 +1478,6 @@ func newSetPermissions() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newSetPermissions()) - }) -} - // start submit command // Slice with functions to override default command behavior. @@ -1659,12 +1579,6 @@ func newSubmit() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newSubmit()) - }) -} - // start update command // Slice with functions to override default command behavior. @@ -1762,12 +1676,6 @@ func newUpdate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdate()) - }) -} - // start update-permissions command // Slice with functions to override default command behavior. @@ -1849,10 +1757,4 @@ func newUpdatePermissions() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdatePermissions()) - }) -} - // end service Jobs diff --git a/cmd/workspace/lakehouse-monitors/lakehouse-monitors.go b/cmd/workspace/lakehouse-monitors/lakehouse-monitors.go index fc0a317fad..9559d036de 100755 --- a/cmd/workspace/lakehouse-monitors/lakehouse-monitors.go +++ b/cmd/workspace/lakehouse-monitors/lakehouse-monitors.go @@ -34,6 +34,16 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newCancelRefresh()) + cmd.AddCommand(newCreate()) + cmd.AddCommand(newDelete()) + cmd.AddCommand(newGet()) + cmd.AddCommand(newGetRefresh()) + cmd.AddCommand(newListRefreshes()) + cmd.AddCommand(newRunRefresh()) + cmd.AddCommand(newUpdate()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -114,12 +124,6 @@ func newCancelRefresh() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCancelRefresh()) - }) -} - // start create command // Slice with functions to override default command behavior. @@ -223,12 +227,6 @@ func newCreate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreate()) - }) -} - // start delete command // Slice with functions to override default command behavior. @@ -299,12 +297,6 @@ func newDelete() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDelete()) - }) -} - // start get command // Slice with functions to override default command behavior. @@ -374,12 +366,6 @@ func newGet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGet()) - }) -} - // start get-refresh command // Slice with functions to override default command behavior. @@ -449,12 +435,6 @@ func newGetRefresh() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGetRefresh()) - }) -} - // start list-refreshes command // Slice with functions to override default command behavior. @@ -523,12 +503,6 @@ func newListRefreshes() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newListRefreshes()) - }) -} - // start run-refresh command // Slice with functions to override default command behavior. @@ -597,12 +571,6 @@ func newRunRefresh() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newRunRefresh()) - }) -} - // start update command // Slice with functions to override default command behavior. @@ -702,10 +670,4 @@ func newUpdate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdate()) - }) -} - // end service LakehouseMonitors diff --git a/cmd/workspace/lakeview/lakeview.go b/cmd/workspace/lakeview/lakeview.go index a6dddd0de2..a81483997f 100755 --- a/cmd/workspace/lakeview/lakeview.go +++ b/cmd/workspace/lakeview/lakeview.go @@ -26,6 +26,9 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newPublish()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -103,10 +106,4 @@ func newPublish() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newPublish()) - }) -} - // end service Lakeview diff --git a/cmd/workspace/libraries/libraries.go b/cmd/workspace/libraries/libraries.go index fef81c25f6..d6761a8214 100755 --- a/cmd/workspace/libraries/libraries.go +++ b/cmd/workspace/libraries/libraries.go @@ -46,6 +46,12 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newAllClusterStatuses()) + cmd.AddCommand(newClusterStatus()) + cmd.AddCommand(newInstall()) + cmd.AddCommand(newUninstall()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -98,12 +104,6 @@ func newAllClusterStatuses() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newAllClusterStatuses()) - }) -} - // start cluster-status command // Slice with functions to override default command behavior. @@ -173,12 +173,6 @@ func newClusterStatus() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newClusterStatus()) - }) -} - // start install command // Slice with functions to override default command behavior. @@ -243,12 +237,6 @@ func newInstall() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newInstall()) - }) -} - // start uninstall command // Slice with functions to override default command behavior. @@ -310,10 +298,4 @@ func newUninstall() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUninstall()) - }) -} - // end service Libraries diff --git a/cmd/workspace/metastores/metastores.go b/cmd/workspace/metastores/metastores.go index d63576d4ea..97e77a4797 100755 --- a/cmd/workspace/metastores/metastores.go +++ b/cmd/workspace/metastores/metastores.go @@ -39,6 +39,18 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newAssign()) + cmd.AddCommand(newCreate()) + cmd.AddCommand(newCurrent()) + cmd.AddCommand(newDelete()) + cmd.AddCommand(newGet()) + cmd.AddCommand(newList()) + cmd.AddCommand(newSummary()) + cmd.AddCommand(newUnassign()) + cmd.AddCommand(newUpdate()) + cmd.AddCommand(newUpdateAssignment()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -133,12 +145,6 @@ func newAssign() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newAssign()) - }) -} - // start create command // Slice with functions to override default command behavior. @@ -221,12 +227,6 @@ func newCreate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreate()) - }) -} - // start current command // Slice with functions to override default command behavior. @@ -269,12 +269,6 @@ func newCurrent() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCurrent()) - }) -} - // start delete command // Slice with functions to override default command behavior. @@ -347,12 +341,6 @@ func newDelete() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDelete()) - }) -} - // start get command // Slice with functions to override default command behavior. @@ -424,12 +412,6 @@ func newGet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGet()) - }) -} - // start list command // Slice with functions to override default command behavior. @@ -471,12 +453,6 @@ func newList() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newList()) - }) -} - // start summary command // Slice with functions to override default command behavior. @@ -520,12 +496,6 @@ func newSummary() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newSummary()) - }) -} - // start unassign command // Slice with functions to override default command behavior. @@ -589,12 +559,6 @@ func newUnassign() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUnassign()) - }) -} - // start update command // Slice with functions to override default command behavior. @@ -683,12 +647,6 @@ func newUpdate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdate()) - }) -} - // start update-assignment command // Slice with functions to override default command behavior. @@ -776,10 +734,4 @@ func newUpdateAssignment() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdateAssignment()) - }) -} - // end service Metastores diff --git a/cmd/workspace/model-registry/model-registry.go b/cmd/workspace/model-registry/model-registry.go index 9c6034b56b..74e5e66e33 100755 --- a/cmd/workspace/model-registry/model-registry.go +++ b/cmd/workspace/model-registry/model-registry.go @@ -34,6 +34,44 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newApproveTransitionRequest()) + cmd.AddCommand(newCreateComment()) + cmd.AddCommand(newCreateModel()) + cmd.AddCommand(newCreateModelVersion()) + cmd.AddCommand(newCreateTransitionRequest()) + cmd.AddCommand(newCreateWebhook()) + cmd.AddCommand(newDeleteComment()) + cmd.AddCommand(newDeleteModel()) + cmd.AddCommand(newDeleteModelTag()) + cmd.AddCommand(newDeleteModelVersion()) + cmd.AddCommand(newDeleteModelVersionTag()) + cmd.AddCommand(newDeleteTransitionRequest()) + cmd.AddCommand(newDeleteWebhook()) + cmd.AddCommand(newGetLatestVersions()) + cmd.AddCommand(newGetModel()) + cmd.AddCommand(newGetModelVersion()) + cmd.AddCommand(newGetModelVersionDownloadUri()) + cmd.AddCommand(newGetPermissionLevels()) + cmd.AddCommand(newGetPermissions()) + cmd.AddCommand(newListModels()) + cmd.AddCommand(newListTransitionRequests()) + cmd.AddCommand(newListWebhooks()) + cmd.AddCommand(newRejectTransitionRequest()) + cmd.AddCommand(newRenameModel()) + cmd.AddCommand(newSearchModelVersions()) + cmd.AddCommand(newSearchModels()) + cmd.AddCommand(newSetModelTag()) + cmd.AddCommand(newSetModelVersionTag()) + cmd.AddCommand(newSetPermissions()) + cmd.AddCommand(newTestRegistryWebhook()) + cmd.AddCommand(newTransitionStage()) + cmd.AddCommand(newUpdateComment()) + cmd.AddCommand(newUpdateModel()) + cmd.AddCommand(newUpdateModelVersion()) + cmd.AddCommand(newUpdatePermissions()) + cmd.AddCommand(newUpdateWebhook()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -146,12 +184,6 @@ func newApproveTransitionRequest() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newApproveTransitionRequest()) - }) -} - // start create-comment command // Slice with functions to override default command behavior. @@ -237,12 +269,6 @@ func newCreateComment() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreateComment()) - }) -} - // start create-model command // Slice with functions to override default command behavior. @@ -324,12 +350,6 @@ func newCreateModel() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreateModel()) - }) -} - // start create-model-version command // Slice with functions to override default command behavior. @@ -414,12 +434,6 @@ func newCreateModelVersion() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreateModelVersion()) - }) -} - // start create-transition-request command // Slice with functions to override default command behavior. @@ -516,12 +530,6 @@ func newCreateTransitionRequest() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreateTransitionRequest()) - }) -} - // start create-webhook command // Slice with functions to override default command behavior. @@ -589,12 +597,6 @@ func newCreateWebhook() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreateWebhook()) - }) -} - // start delete-comment command // Slice with functions to override default command behavior. @@ -650,12 +652,6 @@ func newDeleteComment() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDeleteComment()) - }) -} - // start delete-model command // Slice with functions to override default command behavior. @@ -714,12 +710,6 @@ func newDeleteModel() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDeleteModel()) - }) -} - // start delete-model-tag command // Slice with functions to override default command behavior. @@ -781,12 +771,6 @@ func newDeleteModelTag() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDeleteModelTag()) - }) -} - // start delete-model-version command // Slice with functions to override default command behavior. @@ -847,12 +831,6 @@ func newDeleteModelVersion() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDeleteModelVersion()) - }) -} - // start delete-model-version-tag command // Slice with functions to override default command behavior. @@ -916,12 +894,6 @@ func newDeleteModelVersionTag() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDeleteModelVersionTag()) - }) -} - // start delete-transition-request command // Slice with functions to override default command behavior. @@ -1001,12 +973,6 @@ func newDeleteTransitionRequest() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDeleteTransitionRequest()) - }) -} - // start delete-webhook command // Slice with functions to override default command behavior. @@ -1064,12 +1030,6 @@ func newDeleteWebhook() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDeleteWebhook()) - }) -} - // start get-latest-versions command // Slice with functions to override default command behavior. @@ -1144,12 +1104,6 @@ func newGetLatestVersions() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGetLatestVersions()) - }) -} - // start get-model command // Slice with functions to override default command behavior. @@ -1212,12 +1166,6 @@ func newGetModel() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGetModel()) - }) -} - // start get-model-version command // Slice with functions to override default command behavior. @@ -1278,12 +1226,6 @@ func newGetModelVersion() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGetModelVersion()) - }) -} - // start get-model-version-download-uri command // Slice with functions to override default command behavior. @@ -1344,12 +1286,6 @@ func newGetModelVersionDownloadUri() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGetModelVersionDownloadUri()) - }) -} - // start get-permission-levels command // Slice with functions to override default command behavior. @@ -1408,12 +1344,6 @@ func newGetPermissionLevels() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGetPermissionLevels()) - }) -} - // start get-permissions command // Slice with functions to override default command behavior. @@ -1473,12 +1403,6 @@ func newGetPermissions() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGetPermissions()) - }) -} - // start list-models command // Slice with functions to override default command behavior. @@ -1533,12 +1457,6 @@ func newListModels() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newListModels()) - }) -} - // start list-transition-requests command // Slice with functions to override default command behavior. @@ -1596,12 +1514,6 @@ func newListTransitionRequests() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newListTransitionRequests()) - }) -} - // start list-webhooks command // Slice with functions to override default command behavior. @@ -1658,12 +1570,6 @@ func newListWebhooks() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newListWebhooks()) - }) -} - // start reject-transition-request command // Slice with functions to override default command behavior. @@ -1760,12 +1666,6 @@ func newRejectTransitionRequest() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newRejectTransitionRequest()) - }) -} - // start rename-model command // Slice with functions to override default command behavior. @@ -1843,12 +1743,6 @@ func newRenameModel() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newRenameModel()) - }) -} - // start search-model-versions command // Slice with functions to override default command behavior. @@ -1904,12 +1798,6 @@ func newSearchModelVersions() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newSearchModelVersions()) - }) -} - // start search-models command // Slice with functions to override default command behavior. @@ -1965,12 +1853,6 @@ func newSearchModels() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newSearchModels()) - }) -} - // start set-model-tag command // Slice with functions to override default command behavior. @@ -2059,12 +1941,6 @@ func newSetModelTag() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newSetModelTag()) - }) -} - // start set-model-version-tag command // Slice with functions to override default command behavior. @@ -2157,12 +2033,6 @@ func newSetModelVersionTag() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newSetModelVersionTag()) - }) -} - // start set-permissions command // Slice with functions to override default command behavior. @@ -2232,12 +2102,6 @@ func newSetPermissions() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newSetPermissions()) - }) -} - // start test-registry-webhook command // Slice with functions to override default command behavior. @@ -2330,12 +2194,6 @@ func newTestRegistryWebhook() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newTestRegistryWebhook()) - }) -} - // start transition-stage command // Slice with functions to override default command behavior. @@ -2444,12 +2302,6 @@ func newTransitionStage() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newTransitionStage()) - }) -} - // start update-comment command // Slice with functions to override default command behavior. @@ -2529,12 +2381,6 @@ func newUpdateComment() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdateComment()) - }) -} - // start update-model command // Slice with functions to override default command behavior. @@ -2612,12 +2458,6 @@ func newUpdateModel() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdateModel()) - }) -} - // start update-model-version command // Slice with functions to override default command behavior. @@ -2699,12 +2539,6 @@ func newUpdateModelVersion() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdateModelVersion()) - }) -} - // start update-permissions command // Slice with functions to override default command behavior. @@ -2774,12 +2608,6 @@ func newUpdatePermissions() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdatePermissions()) - }) -} - // start update-webhook command // Slice with functions to override default command behavior. @@ -2863,10 +2691,4 @@ func newUpdateWebhook() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdateWebhook()) - }) -} - // end service ModelRegistry diff --git a/cmd/workspace/model-versions/model-versions.go b/cmd/workspace/model-versions/model-versions.go index b4492cb369..b322e88076 100755 --- a/cmd/workspace/model-versions/model-versions.go +++ b/cmd/workspace/model-versions/model-versions.go @@ -33,6 +33,13 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newDelete()) + cmd.AddCommand(newGet()) + cmd.AddCommand(newGetByAlias()) + cmd.AddCommand(newList()) + cmd.AddCommand(newUpdate()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -110,12 +117,6 @@ func newDelete() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDelete()) - }) -} - // start get command // Slice with functions to override default command behavior. @@ -184,12 +185,6 @@ func newGet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGet()) - }) -} - // start get-by-alias command // Slice with functions to override default command behavior. @@ -255,12 +250,6 @@ func newGetByAlias() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGetByAlias()) - }) -} - // start list command // Slice with functions to override default command behavior. @@ -331,12 +320,6 @@ func newList() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newList()) - }) -} - // start update command // Slice with functions to override default command behavior. @@ -417,10 +400,4 @@ func newUpdate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdate()) - }) -} - // end service ModelVersions diff --git a/cmd/workspace/online-tables/online-tables.go b/cmd/workspace/online-tables/online-tables.go index d97c52837e..2a5574da93 100755 --- a/cmd/workspace/online-tables/online-tables.go +++ b/cmd/workspace/online-tables/online-tables.go @@ -26,6 +26,11 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newCreate()) + cmd.AddCommand(newDelete()) + cmd.AddCommand(newGet()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -99,12 +104,6 @@ func newCreate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreate()) - }) -} - // start delete command // Slice with functions to override default command behavior. @@ -165,12 +164,6 @@ func newDelete() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDelete()) - }) -} - // start get command // Slice with functions to override default command behavior. @@ -229,10 +222,4 @@ func newGet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGet()) - }) -} - // end service OnlineTables diff --git a/cmd/workspace/permission-migration/permission-migration.go b/cmd/workspace/permission-migration/permission-migration.go index e24ad193e1..a957d5ca32 100755 --- a/cmd/workspace/permission-migration/permission-migration.go +++ b/cmd/workspace/permission-migration/permission-migration.go @@ -31,6 +31,9 @@ func New() *cobra.Command { Hidden: true, } + // Add methods + cmd.AddCommand(newMigratePermissions()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -130,10 +133,4 @@ func newMigratePermissions() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newMigratePermissions()) - }) -} - // end service PermissionMigration diff --git a/cmd/workspace/permissions/permissions.go b/cmd/workspace/permissions/permissions.go index 8aeb3fc734..5bf837e35b 100755 --- a/cmd/workspace/permissions/permissions.go +++ b/cmd/workspace/permissions/permissions.go @@ -71,6 +71,12 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newGet()) + cmd.AddCommand(newGetPermissionLevels()) + cmd.AddCommand(newSet()) + cmd.AddCommand(newUpdate()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -143,12 +149,6 @@ func newGet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGet()) - }) -} - // start get-permission-levels command // Slice with functions to override default command behavior. @@ -209,12 +209,6 @@ func newGetPermissionLevels() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGetPermissionLevels()) - }) -} - // start set command // Slice with functions to override default command behavior. @@ -289,12 +283,6 @@ func newSet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newSet()) - }) -} - // start update command // Slice with functions to override default command behavior. @@ -369,10 +357,4 @@ func newUpdate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdate()) - }) -} - // end service Permissions diff --git a/cmd/workspace/pipelines/pipelines.go b/cmd/workspace/pipelines/pipelines.go index 4c2db6aa38..78f42d6cdb 100755 --- a/cmd/workspace/pipelines/pipelines.go +++ b/cmd/workspace/pipelines/pipelines.go @@ -41,6 +41,22 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newCreate()) + cmd.AddCommand(newDelete()) + cmd.AddCommand(newGet()) + cmd.AddCommand(newGetPermissionLevels()) + cmd.AddCommand(newGetPermissions()) + cmd.AddCommand(newGetUpdate()) + cmd.AddCommand(newListPipelineEvents()) + cmd.AddCommand(newListPipelines()) + cmd.AddCommand(newListUpdates()) + cmd.AddCommand(newSetPermissions()) + cmd.AddCommand(newStartUpdate()) + cmd.AddCommand(newStop()) + cmd.AddCommand(newUpdate()) + cmd.AddCommand(newUpdatePermissions()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -109,12 +125,6 @@ func newCreate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreate()) - }) -} - // start delete command // Slice with functions to override default command behavior. @@ -182,12 +192,6 @@ func newDelete() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDelete()) - }) -} - // start get command // Slice with functions to override default command behavior. @@ -258,12 +262,6 @@ func newGet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGet()) - }) -} - // start get-permission-levels command // Slice with functions to override default command behavior. @@ -334,12 +332,6 @@ func newGetPermissionLevels() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGetPermissionLevels()) - }) -} - // start get-permissions command // Slice with functions to override default command behavior. @@ -411,12 +403,6 @@ func newGetPermissions() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGetPermissions()) - }) -} - // start get-update command // Slice with functions to override default command behavior. @@ -477,12 +463,6 @@ func newGetUpdate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGetUpdate()) - }) -} - // start list-pipeline-events command // Slice with functions to override default command behavior. @@ -552,12 +532,6 @@ func newListPipelineEvents() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newListPipelineEvents()) - }) -} - // start list-pipelines command // Slice with functions to override default command behavior. @@ -613,12 +587,6 @@ func newListPipelines() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newListPipelines()) - }) -} - // start list-updates command // Slice with functions to override default command behavior. @@ -693,12 +661,6 @@ func newListUpdates() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newListUpdates()) - }) -} - // start set-permissions command // Slice with functions to override default command behavior. @@ -780,12 +742,6 @@ func newSetPermissions() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newSetPermissions()) - }) -} - // start start-update command // Slice with functions to override default command behavior. @@ -875,12 +831,6 @@ func newStartUpdate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newStartUpdate()) - }) -} - // start stop command // Slice with functions to override default command behavior. @@ -966,12 +916,6 @@ func newStop() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newStop()) - }) -} - // start update command // Slice with functions to override default command behavior. @@ -1071,12 +1015,6 @@ func newUpdate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdate()) - }) -} - // start update-permissions command // Slice with functions to override default command behavior. @@ -1158,10 +1096,4 @@ func newUpdatePermissions() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdatePermissions()) - }) -} - // end service Pipelines diff --git a/cmd/workspace/policy-families/policy-families.go b/cmd/workspace/policy-families/policy-families.go index c81d2e92c9..f6c07bf709 100755 --- a/cmd/workspace/policy-families/policy-families.go +++ b/cmd/workspace/policy-families/policy-families.go @@ -32,6 +32,10 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newGet()) + cmd.AddCommand(newList()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -95,12 +99,6 @@ func newGet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGet()) - }) -} - // start list command // Slice with functions to override default command behavior. @@ -154,10 +152,4 @@ func newList() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newList()) - }) -} - // end service PolicyFamilies diff --git a/cmd/workspace/providers/providers.go b/cmd/workspace/providers/providers.go index 2552964883..93f89c981b 100755 --- a/cmd/workspace/providers/providers.go +++ b/cmd/workspace/providers/providers.go @@ -29,6 +29,14 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newCreate()) + cmd.AddCommand(newDelete()) + cmd.AddCommand(newGet()) + cmd.AddCommand(newList()) + cmd.AddCommand(newListShares()) + cmd.AddCommand(newUpdate()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -123,12 +131,6 @@ func newCreate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreate()) - }) -} - // start delete command // Slice with functions to override default command behavior. @@ -200,12 +202,6 @@ func newDelete() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDelete()) - }) -} - // start get command // Slice with functions to override default command behavior. @@ -278,12 +274,6 @@ func newGet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGet()) - }) -} - // start list command // Slice with functions to override default command behavior. @@ -339,12 +329,6 @@ func newList() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newList()) - }) -} - // start list-shares command // Slice with functions to override default command behavior. @@ -414,12 +398,6 @@ func newListShares() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newListShares()) - }) -} - // start update command // Slice with functions to override default command behavior. @@ -506,10 +484,4 @@ func newUpdate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdate()) - }) -} - // end service Providers diff --git a/cmd/workspace/queries/queries.go b/cmd/workspace/queries/queries.go index ef2de44667..f2ab6f59c4 100755 --- a/cmd/workspace/queries/queries.go +++ b/cmd/workspace/queries/queries.go @@ -30,6 +30,14 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newCreate()) + cmd.AddCommand(newDelete()) + cmd.AddCommand(newGet()) + cmd.AddCommand(newList()) + cmd.AddCommand(newRestore()) + cmd.AddCommand(newUpdate()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -105,12 +113,6 @@ func newCreate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreate()) - }) -} - // start delete command // Slice with functions to override default command behavior. @@ -180,12 +182,6 @@ func newDelete() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDelete()) - }) -} - // start get command // Slice with functions to override default command behavior. @@ -254,12 +250,6 @@ func newGet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGet()) - }) -} - // start list command // Slice with functions to override default command behavior. @@ -319,12 +309,6 @@ func newList() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newList()) - }) -} - // start restore command // Slice with functions to override default command behavior. @@ -393,12 +377,6 @@ func newRestore() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newRestore()) - }) -} - // start update command // Slice with functions to override default command behavior. @@ -483,10 +461,4 @@ func newUpdate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdate()) - }) -} - // end service Queries diff --git a/cmd/workspace/query-history/query-history.go b/cmd/workspace/query-history/query-history.go index 847461058e..a0402e6d08 100755 --- a/cmd/workspace/query-history/query-history.go +++ b/cmd/workspace/query-history/query-history.go @@ -24,6 +24,9 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newList()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -89,10 +92,4 @@ func newList() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newList()) - }) -} - // end service QueryHistory diff --git a/cmd/workspace/query-visualizations/query-visualizations.go b/cmd/workspace/query-visualizations/query-visualizations.go index 4f04c42613..4161ac7d52 100755 --- a/cmd/workspace/query-visualizations/query-visualizations.go +++ b/cmd/workspace/query-visualizations/query-visualizations.go @@ -32,6 +32,11 @@ func New() *cobra.Command { Hidden: true, } + // Add methods + cmd.AddCommand(newCreate()) + cmd.AddCommand(newDelete()) + cmd.AddCommand(newUpdate()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -97,12 +102,6 @@ func newCreate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreate()) - }) -} - // start delete command // Slice with functions to override default command behavior. @@ -159,12 +158,6 @@ func newDelete() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDelete()) - }) -} - // start update command // Slice with functions to override default command behavior. @@ -231,10 +224,4 @@ func newUpdate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdate()) - }) -} - // end service QueryVisualizations diff --git a/cmd/workspace/recipient-activation/recipient-activation.go b/cmd/workspace/recipient-activation/recipient-activation.go index 5fb5c7b9ef..068e6bb107 100755 --- a/cmd/workspace/recipient-activation/recipient-activation.go +++ b/cmd/workspace/recipient-activation/recipient-activation.go @@ -33,6 +33,10 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newGetActivationUrlInfo()) + cmd.AddCommand(newRetrieveToken()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -99,12 +103,6 @@ func newGetActivationUrlInfo() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGetActivationUrlInfo()) - }) -} - // start retrieve-token command // Slice with functions to override default command behavior. @@ -164,10 +162,4 @@ func newRetrieveToken() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newRetrieveToken()) - }) -} - // end service RecipientActivation diff --git a/cmd/workspace/recipients/recipients.go b/cmd/workspace/recipients/recipients.go index d7d432b9ce..797863137e 100755 --- a/cmd/workspace/recipients/recipients.go +++ b/cmd/workspace/recipients/recipients.go @@ -43,6 +43,15 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newCreate()) + cmd.AddCommand(newDelete()) + cmd.AddCommand(newGet()) + cmd.AddCommand(newList()) + cmd.AddCommand(newRotateToken()) + cmd.AddCommand(newSharePermissions()) + cmd.AddCommand(newUpdate()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -142,12 +151,6 @@ func newCreate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreate()) - }) -} - // start delete command // Slice with functions to override default command behavior. @@ -219,12 +222,6 @@ func newDelete() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDelete()) - }) -} - // start get command // Slice with functions to override default command behavior. @@ -297,12 +294,6 @@ func newGet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGet()) - }) -} - // start list command // Slice with functions to override default command behavior. @@ -358,12 +349,6 @@ func newList() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newList()) - }) -} - // start rotate-token command // Slice with functions to override default command behavior. @@ -448,12 +433,6 @@ func newRotateToken() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newRotateToken()) - }) -} - // start share-permissions command // Slice with functions to override default command behavior. @@ -525,12 +504,6 @@ func newSharePermissions() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newSharePermissions()) - }) -} - // start update command // Slice with functions to override default command behavior. @@ -617,10 +590,4 @@ func newUpdate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdate()) - }) -} - // end service Recipients diff --git a/cmd/workspace/registered-models/registered-models.go b/cmd/workspace/registered-models/registered-models.go index 98aec3bb31..6cd01c1370 100755 --- a/cmd/workspace/registered-models/registered-models.go +++ b/cmd/workspace/registered-models/registered-models.go @@ -55,6 +55,15 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newCreate()) + cmd.AddCommand(newDelete()) + cmd.AddCommand(newDeleteAlias()) + cmd.AddCommand(newGet()) + cmd.AddCommand(newList()) + cmd.AddCommand(newSetAlias()) + cmd.AddCommand(newUpdate()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -160,12 +169,6 @@ func newCreate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreate()) - }) -} - // start delete command // Slice with functions to override default command behavior. @@ -242,12 +245,6 @@ func newDelete() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDelete()) - }) -} - // start delete-alias command // Slice with functions to override default command behavior. @@ -313,12 +310,6 @@ func newDeleteAlias() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDeleteAlias()) - }) -} - // start get command // Slice with functions to override default command behavior. @@ -394,12 +385,6 @@ func newGet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGet()) - }) -} - // start list command // Slice with functions to override default command behavior. @@ -466,12 +451,6 @@ func newList() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newList()) - }) -} - // start set-alias command // Slice with functions to override default command behavior. @@ -559,12 +538,6 @@ func newSetAlias() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newSetAlias()) - }) -} - // start update command // Slice with functions to override default command behavior. @@ -655,10 +628,4 @@ func newUpdate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdate()) - }) -} - // end service RegisteredModels diff --git a/cmd/workspace/repos/repos.go b/cmd/workspace/repos/repos.go index 0c38183aa2..6a989437a3 100755 --- a/cmd/workspace/repos/repos.go +++ b/cmd/workspace/repos/repos.go @@ -36,6 +36,17 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newCreate()) + cmd.AddCommand(newDelete()) + cmd.AddCommand(newGet()) + cmd.AddCommand(newGetPermissionLevels()) + cmd.AddCommand(newGetPermissions()) + cmd.AddCommand(newList()) + cmd.AddCommand(newSetPermissions()) + cmd.AddCommand(newUpdate()) + cmd.AddCommand(newUpdatePermissions()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -130,12 +141,6 @@ func newCreate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreate()) - }) -} - // start delete command // Slice with functions to override default command behavior. @@ -209,12 +214,6 @@ func newDelete() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDelete()) - }) -} - // start get command // Slice with functions to override default command behavior. @@ -288,12 +287,6 @@ func newGet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGet()) - }) -} - // start get-permission-levels command // Slice with functions to override default command behavior. @@ -364,12 +357,6 @@ func newGetPermissionLevels() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGetPermissionLevels()) - }) -} - // start get-permissions command // Slice with functions to override default command behavior. @@ -441,12 +428,6 @@ func newGetPermissions() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGetPermissions()) - }) -} - // start list command // Slice with functions to override default command behavior. @@ -501,12 +482,6 @@ func newList() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newList()) - }) -} - // start set-permissions command // Slice with functions to override default command behavior. @@ -588,12 +563,6 @@ func newSetPermissions() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newSetPermissions()) - }) -} - // start update command // Slice with functions to override default command behavior. @@ -680,12 +649,6 @@ func newUpdate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdate()) - }) -} - // start update-permissions command // Slice with functions to override default command behavior. @@ -767,10 +730,4 @@ func newUpdatePermissions() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdatePermissions()) - }) -} - // end service Repos diff --git a/cmd/workspace/restrict-workspace-admins/restrict-workspace-admins.go b/cmd/workspace/restrict-workspace-admins/restrict-workspace-admins.go index 4bbfe21dba..e181a2f3dc 100755 --- a/cmd/workspace/restrict-workspace-admins/restrict-workspace-admins.go +++ b/cmd/workspace/restrict-workspace-admins/restrict-workspace-admins.go @@ -38,6 +38,11 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newDelete()) + cmd.AddCommand(newGet()) + cmd.AddCommand(newUpdate()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -86,7 +91,7 @@ func newDelete() *cobra.Command { ctx := cmd.Context() w := root.WorkspaceClient(ctx) - response, err := w.RestrictWorkspaceAdmins.Delete(ctx, deleteReq) + response, err := w.Settings.RestrictWorkspaceAdmins().Delete(ctx, deleteReq) if err != nil { return err } @@ -105,12 +110,6 @@ func newDelete() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDelete()) - }) -} - // start get command // Slice with functions to override default command behavior. @@ -147,7 +146,7 @@ func newGet() *cobra.Command { ctx := cmd.Context() w := root.WorkspaceClient(ctx) - response, err := w.RestrictWorkspaceAdmins.Get(ctx, getReq) + response, err := w.Settings.RestrictWorkspaceAdmins().Get(ctx, getReq) if err != nil { return err } @@ -166,12 +165,6 @@ func newGet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGet()) - }) -} - // start update command // Slice with functions to override default command behavior. @@ -216,7 +209,7 @@ func newUpdate() *cobra.Command { return fmt.Errorf("please provide command input in JSON format by specifying the --json flag") } - response, err := w.RestrictWorkspaceAdmins.Update(ctx, updateReq) + response, err := w.Settings.RestrictWorkspaceAdmins().Update(ctx, updateReq) if err != nil { return err } @@ -235,10 +228,4 @@ func newUpdate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdate()) - }) -} - // end service RestrictWorkspaceAdmins diff --git a/cmd/workspace/schemas/schemas.go b/cmd/workspace/schemas/schemas.go index ebdab2ab50..a5efeed374 100755 --- a/cmd/workspace/schemas/schemas.go +++ b/cmd/workspace/schemas/schemas.go @@ -31,6 +31,13 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newCreate()) + cmd.AddCommand(newDelete()) + cmd.AddCommand(newGet()) + cmd.AddCommand(newList()) + cmd.AddCommand(newUpdate()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -124,12 +131,6 @@ func newCreate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreate()) - }) -} - // start delete command // Slice with functions to override default command behavior. @@ -201,12 +202,6 @@ func newDelete() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDelete()) - }) -} - // start get command // Slice with functions to override default command behavior. @@ -279,12 +274,6 @@ func newGet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGet()) - }) -} - // start list command // Slice with functions to override default command behavior. @@ -349,12 +338,6 @@ func newList() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newList()) - }) -} - // start update command // Slice with functions to override default command behavior. @@ -443,10 +426,4 @@ func newUpdate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdate()) - }) -} - // end service Schemas diff --git a/cmd/workspace/secrets/secrets.go b/cmd/workspace/secrets/secrets.go index ec6423d06a..35b84907ef 100755 --- a/cmd/workspace/secrets/secrets.go +++ b/cmd/workspace/secrets/secrets.go @@ -38,6 +38,18 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newCreateScope()) + cmd.AddCommand(newDeleteAcl()) + cmd.AddCommand(newDeleteScope()) + cmd.AddCommand(newDeleteSecret()) + cmd.AddCommand(newGetAcl()) + cmd.AddCommand(newGetSecret()) + cmd.AddCommand(newListAcls()) + cmd.AddCommand(newListScopes()) + cmd.AddCommand(newListSecrets()) + cmd.AddCommand(newPutAcl()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -127,12 +139,6 @@ func newCreateScope() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreateScope()) - }) -} - // start delete-acl command // Slice with functions to override default command behavior. @@ -217,12 +223,6 @@ func newDeleteAcl() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDeleteAcl()) - }) -} - // start delete-scope command // Slice with functions to override default command behavior. @@ -302,12 +302,6 @@ func newDeleteScope() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDeleteScope()) - }) -} - // start delete-secret command // Slice with functions to override default command behavior. @@ -392,12 +386,6 @@ func newDeleteSecret() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDeleteSecret()) - }) -} - // start get-acl command // Slice with functions to override default command behavior. @@ -463,12 +451,6 @@ func newGetAcl() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGetAcl()) - }) -} - // start get-secret command // Slice with functions to override default command behavior. @@ -540,12 +522,6 @@ func newGetSecret() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGetSecret()) - }) -} - // start list-acls command // Slice with functions to override default command behavior. @@ -606,12 +582,6 @@ func newListAcls() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newListAcls()) - }) -} - // start list-scopes command // Slice with functions to override default command behavior. @@ -654,12 +624,6 @@ func newListScopes() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newListScopes()) - }) -} - // start list-secrets command // Slice with functions to override default command behavior. @@ -722,12 +686,6 @@ func newListSecrets() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newListSecrets()) - }) -} - // start put-acl command // Slice with functions to override default command behavior. @@ -839,10 +797,4 @@ func newPutAcl() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newPutAcl()) - }) -} - // end service Secrets diff --git a/cmd/workspace/service-principals/service-principals.go b/cmd/workspace/service-principals/service-principals.go index 353c087611..d363a1ba1e 100755 --- a/cmd/workspace/service-principals/service-principals.go +++ b/cmd/workspace/service-principals/service-principals.go @@ -32,6 +32,14 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newCreate()) + cmd.AddCommand(newDelete()) + cmd.AddCommand(newGet()) + cmd.AddCommand(newList()) + cmd.AddCommand(newPatch()) + cmd.AddCommand(newUpdate()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -112,12 +120,6 @@ func newCreate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreate()) - }) -} - // start delete command // Slice with functions to override default command behavior. @@ -188,12 +190,6 @@ func newDelete() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDelete()) - }) -} - // start get command // Slice with functions to override default command behavior. @@ -265,12 +261,6 @@ func newGet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGet()) - }) -} - // start list command // Slice with functions to override default command behavior. @@ -329,12 +319,6 @@ func newList() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newList()) - }) -} - // start patch command // Slice with functions to override default command behavior. @@ -417,12 +401,6 @@ func newPatch() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newPatch()) - }) -} - // start update command // Slice with functions to override default command behavior. @@ -513,10 +491,4 @@ func newUpdate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdate()) - }) -} - // end service ServicePrincipals diff --git a/cmd/workspace/serving-endpoints/serving-endpoints.go b/cmd/workspace/serving-endpoints/serving-endpoints.go index 9424c5e4e7..c4ca7d62d8 100755 --- a/cmd/workspace/serving-endpoints/serving-endpoints.go +++ b/cmd/workspace/serving-endpoints/serving-endpoints.go @@ -40,6 +40,23 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newBuildLogs()) + cmd.AddCommand(newCreate()) + cmd.AddCommand(newDelete()) + cmd.AddCommand(newExportMetrics()) + cmd.AddCommand(newGet()) + cmd.AddCommand(newGetPermissionLevels()) + cmd.AddCommand(newGetPermissions()) + cmd.AddCommand(newList()) + cmd.AddCommand(newLogs()) + cmd.AddCommand(newPatch()) + cmd.AddCommand(newPut()) + cmd.AddCommand(newQuery()) + cmd.AddCommand(newSetPermissions()) + cmd.AddCommand(newUpdateConfig()) + cmd.AddCommand(newUpdatePermissions()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -111,12 +128,6 @@ func newBuildLogs() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newBuildLogs()) - }) -} - // start create command // Slice with functions to override default command behavior. @@ -195,12 +206,6 @@ func newCreate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreate()) - }) -} - // start delete command // Slice with functions to override default command behavior. @@ -257,12 +262,6 @@ func newDelete() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDelete()) - }) -} - // start export-metrics command // Slice with functions to override default command behavior. @@ -323,12 +322,6 @@ func newExportMetrics() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newExportMetrics()) - }) -} - // start get command // Slice with functions to override default command behavior. @@ -387,12 +380,6 @@ func newGet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGet()) - }) -} - // start get-permission-levels command // Slice with functions to override default command behavior. @@ -451,12 +438,6 @@ func newGetPermissionLevels() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGetPermissionLevels()) - }) -} - // start get-permissions command // Slice with functions to override default command behavior. @@ -516,12 +497,6 @@ func newGetPermissions() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGetPermissions()) - }) -} - // start list command // Slice with functions to override default command behavior. @@ -559,12 +534,6 @@ func newList() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newList()) - }) -} - // start logs command // Slice with functions to override default command behavior. @@ -628,12 +597,6 @@ func newLogs() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newLogs()) - }) -} - // start patch command // Slice with functions to override default command behavior. @@ -705,12 +668,6 @@ func newPatch() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newPatch()) - }) -} - // start put command // Slice with functions to override default command behavior. @@ -781,12 +738,6 @@ func newPut() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newPut()) - }) -} - // start query command // Slice with functions to override default command behavior. @@ -865,12 +816,6 @@ func newQuery() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newQuery()) - }) -} - // start set-permissions command // Slice with functions to override default command behavior. @@ -940,12 +885,6 @@ func newSetPermissions() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newSetPermissions()) - }) -} - // start update-config command // Slice with functions to override default command behavior. @@ -1038,12 +977,6 @@ func newUpdateConfig() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdateConfig()) - }) -} - // start update-permissions command // Slice with functions to override default command behavior. @@ -1113,10 +1046,4 @@ func newUpdatePermissions() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdatePermissions()) - }) -} - // end service ServingEndpoints diff --git a/cmd/workspace/settings/settings.go b/cmd/workspace/settings/settings.go index f3ff41f0e7..8ba0335fb1 100755 --- a/cmd/workspace/settings/settings.go +++ b/cmd/workspace/settings/settings.go @@ -4,6 +4,12 @@ package settings import ( "github.com/spf13/cobra" + + automatic_cluster_update "github.com/databricks/cli/cmd/workspace/automatic-cluster-update" + csp_enablement "github.com/databricks/cli/cmd/workspace/csp-enablement" + default_namespace "github.com/databricks/cli/cmd/workspace/default-namespace" + esm_enablement "github.com/databricks/cli/cmd/workspace/esm-enablement" + restrict_workspace_admins "github.com/databricks/cli/cmd/workspace/restrict-workspace-admins" ) // Slice with functions to override default command behavior. @@ -24,6 +30,13 @@ func New() *cobra.Command { Hidden: true, } + // Add subservices + cmd.AddCommand(automatic_cluster_update.New()) + cmd.AddCommand(csp_enablement.New()) + cmd.AddCommand(default_namespace.New()) + cmd.AddCommand(esm_enablement.New()) + cmd.AddCommand(restrict_workspace_admins.New()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) diff --git a/cmd/workspace/shares/shares.go b/cmd/workspace/shares/shares.go index 2c0479a0a5..b849f84f73 100755 --- a/cmd/workspace/shares/shares.go +++ b/cmd/workspace/shares/shares.go @@ -31,6 +31,15 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newCreate()) + cmd.AddCommand(newDelete()) + cmd.AddCommand(newGet()) + cmd.AddCommand(newList()) + cmd.AddCommand(newSharePermissions()) + cmd.AddCommand(newUpdate()) + cmd.AddCommand(newUpdatePermissions()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -118,12 +127,6 @@ func newCreate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreate()) - }) -} - // start delete command // Slice with functions to override default command behavior. @@ -183,12 +186,6 @@ func newDelete() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDelete()) - }) -} - // start get command // Slice with functions to override default command behavior. @@ -250,12 +247,6 @@ func newGet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGet()) - }) -} - // start list command // Slice with functions to override default command behavior. @@ -297,12 +288,6 @@ func newList() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newList()) - }) -} - // start share-permissions command // Slice with functions to override default command behavior. @@ -362,12 +347,6 @@ func newSharePermissions() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newSharePermissions()) - }) -} - // start update command // Slice with functions to override default command behavior. @@ -452,12 +431,6 @@ func newUpdate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdate()) - }) -} - // start update-permissions command // Slice with functions to override default command behavior. @@ -530,10 +503,4 @@ func newUpdatePermissions() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdatePermissions()) - }) -} - // end service Shares diff --git a/cmd/workspace/storage-credentials/storage-credentials.go b/cmd/workspace/storage-credentials/storage-credentials.go index 5f9f89be14..b763d19345 100755 --- a/cmd/workspace/storage-credentials/storage-credentials.go +++ b/cmd/workspace/storage-credentials/storage-credentials.go @@ -39,6 +39,14 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newCreate()) + cmd.AddCommand(newDelete()) + cmd.AddCommand(newGet()) + cmd.AddCommand(newList()) + cmd.AddCommand(newUpdate()) + cmd.AddCommand(newValidate()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -131,12 +139,6 @@ func newCreate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreate()) - }) -} - // start delete command // Slice with functions to override default command behavior. @@ -210,12 +212,6 @@ func newDelete() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDelete()) - }) -} - // start get command // Slice with functions to override default command behavior. @@ -288,12 +284,6 @@ func newGet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGet()) - }) -} - // start list command // Slice with functions to override default command behavior. @@ -352,12 +342,6 @@ func newList() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newList()) - }) -} - // start update command // Slice with functions to override default command behavior. @@ -448,12 +432,6 @@ func newUpdate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdate()) - }) -} - // start validate command // Slice with functions to override default command behavior. @@ -537,10 +515,4 @@ func newValidate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newValidate()) - }) -} - // end service StorageCredentials diff --git a/cmd/workspace/system-schemas/system-schemas.go b/cmd/workspace/system-schemas/system-schemas.go index 9b2392a6e9..d8135ac2a3 100755 --- a/cmd/workspace/system-schemas/system-schemas.go +++ b/cmd/workspace/system-schemas/system-schemas.go @@ -28,6 +28,11 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newDisable()) + cmd.AddCommand(newEnable()) + cmd.AddCommand(newList()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -100,12 +105,6 @@ func newDisable() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDisable()) - }) -} - // start enable command // Slice with functions to override default command behavior. @@ -170,12 +169,6 @@ func newEnable() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newEnable()) - }) -} - // start list command // Slice with functions to override default command behavior. @@ -232,10 +225,4 @@ func newList() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newList()) - }) -} - // end service SystemSchemas diff --git a/cmd/workspace/table-constraints/table-constraints.go b/cmd/workspace/table-constraints/table-constraints.go index e17b95404a..d5597ab334 100755 --- a/cmd/workspace/table-constraints/table-constraints.go +++ b/cmd/workspace/table-constraints/table-constraints.go @@ -39,6 +39,10 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newCreate()) + cmd.AddCommand(newDelete()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -115,12 +119,6 @@ func newCreate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreate()) - }) -} - // start delete command // Slice with functions to override default command behavior. @@ -196,10 +194,4 @@ func newDelete() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDelete()) - }) -} - // end service TableConstraints diff --git a/cmd/workspace/tables/tables.go b/cmd/workspace/tables/tables.go index d4e76587d8..1ee6b0d525 100755 --- a/cmd/workspace/tables/tables.go +++ b/cmd/workspace/tables/tables.go @@ -35,6 +35,14 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newDelete()) + cmd.AddCommand(newExists()) + cmd.AddCommand(newGet()) + cmd.AddCommand(newList()) + cmd.AddCommand(newListSummaries()) + cmd.AddCommand(newUpdate()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -117,12 +125,6 @@ func newDelete() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDelete()) - }) -} - // start exists command // Slice with functions to override default command behavior. @@ -200,12 +202,6 @@ func newExists() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newExists()) - }) -} - // start get command // Slice with functions to override default command behavior. @@ -284,12 +280,6 @@ func newGet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGet()) - }) -} - // start list command // Slice with functions to override default command behavior. @@ -358,12 +348,6 @@ func newList() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newList()) - }) -} - // start list-summaries command // Slice with functions to override default command behavior. @@ -446,12 +430,6 @@ func newListSummaries() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newListSummaries()) - }) -} - // start update command // Slice with functions to override default command behavior. @@ -539,10 +517,4 @@ func newUpdate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdate()) - }) -} - // end service Tables diff --git a/cmd/workspace/token-management/token-management.go b/cmd/workspace/token-management/token-management.go index 1c2e2c37c0..5209ff16d4 100755 --- a/cmd/workspace/token-management/token-management.go +++ b/cmd/workspace/token-management/token-management.go @@ -29,6 +29,16 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newCreateOboToken()) + cmd.AddCommand(newDelete()) + cmd.AddCommand(newGet()) + cmd.AddCommand(newGetPermissionLevels()) + cmd.AddCommand(newGetPermissions()) + cmd.AddCommand(newList()) + cmd.AddCommand(newSetPermissions()) + cmd.AddCommand(newUpdatePermissions()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -130,12 +140,6 @@ func newCreateOboToken() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreateOboToken()) - }) -} - // start delete command // Slice with functions to override default command behavior. @@ -206,12 +210,6 @@ func newDelete() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDelete()) - }) -} - // start get command // Slice with functions to override default command behavior. @@ -282,12 +280,6 @@ func newGet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGet()) - }) -} - // start get-permission-levels command // Slice with functions to override default command behavior. @@ -330,12 +322,6 @@ func newGetPermissionLevels() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGetPermissionLevels()) - }) -} - // start get-permissions command // Slice with functions to override default command behavior. @@ -379,12 +365,6 @@ func newGetPermissions() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGetPermissions()) - }) -} - // start list command // Slice with functions to override default command behavior. @@ -438,12 +418,6 @@ func newList() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newList()) - }) -} - // start set-permissions command // Slice with functions to override default command behavior. @@ -509,12 +483,6 @@ func newSetPermissions() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newSetPermissions()) - }) -} - // start update-permissions command // Slice with functions to override default command behavior. @@ -580,10 +548,4 @@ func newUpdatePermissions() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdatePermissions()) - }) -} - // end service TokenManagement diff --git a/cmd/workspace/tokens/tokens.go b/cmd/workspace/tokens/tokens.go index 5550acfa5d..bdb99d601b 100755 --- a/cmd/workspace/tokens/tokens.go +++ b/cmd/workspace/tokens/tokens.go @@ -28,6 +28,11 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newCreate()) + cmd.AddCommand(newDelete()) + cmd.AddCommand(newList()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -104,12 +109,6 @@ func newCreate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreate()) - }) -} - // start delete command // Slice with functions to override default command behavior. @@ -203,12 +202,6 @@ func newDelete() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDelete()) - }) -} - // start list command // Slice with functions to override default command behavior. @@ -248,10 +241,4 @@ func newList() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newList()) - }) -} - // end service Tokens diff --git a/cmd/workspace/users/users.go b/cmd/workspace/users/users.go index 078a712e4c..676b10a08e 100755 --- a/cmd/workspace/users/users.go +++ b/cmd/workspace/users/users.go @@ -37,6 +37,18 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newCreate()) + cmd.AddCommand(newDelete()) + cmd.AddCommand(newGet()) + cmd.AddCommand(newGetPermissionLevels()) + cmd.AddCommand(newGetPermissions()) + cmd.AddCommand(newList()) + cmd.AddCommand(newPatch()) + cmd.AddCommand(newSetPermissions()) + cmd.AddCommand(newUpdate()) + cmd.AddCommand(newUpdatePermissions()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -120,12 +132,6 @@ func newCreate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreate()) - }) -} - // start delete command // Slice with functions to override default command behavior. @@ -197,12 +203,6 @@ func newDelete() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDelete()) - }) -} - // start get command // Slice with functions to override default command behavior. @@ -281,12 +281,6 @@ func newGet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGet()) - }) -} - // start get-permission-levels command // Slice with functions to override default command behavior. @@ -329,12 +323,6 @@ func newGetPermissionLevels() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGetPermissionLevels()) - }) -} - // start get-permissions command // Slice with functions to override default command behavior. @@ -378,12 +366,6 @@ func newGetPermissions() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGetPermissions()) - }) -} - // start list command // Slice with functions to override default command behavior. @@ -442,12 +424,6 @@ func newList() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newList()) - }) -} - // start patch command // Slice with functions to override default command behavior. @@ -530,12 +506,6 @@ func newPatch() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newPatch()) - }) -} - // start set-permissions command // Slice with functions to override default command behavior. @@ -601,12 +571,6 @@ func newSetPermissions() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newSetPermissions()) - }) -} - // start update command // Slice with functions to override default command behavior. @@ -698,12 +662,6 @@ func newUpdate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdate()) - }) -} - // start update-permissions command // Slice with functions to override default command behavior. @@ -769,10 +727,4 @@ func newUpdatePermissions() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdatePermissions()) - }) -} - // end service Users diff --git a/cmd/workspace/vector-search-endpoints/vector-search-endpoints.go b/cmd/workspace/vector-search-endpoints/vector-search-endpoints.go index dec1938a5c..a8d3d3ee8d 100755 --- a/cmd/workspace/vector-search-endpoints/vector-search-endpoints.go +++ b/cmd/workspace/vector-search-endpoints/vector-search-endpoints.go @@ -28,6 +28,12 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newCreateEndpoint()) + cmd.AddCommand(newDeleteEndpoint()) + cmd.AddCommand(newGetEndpoint()) + cmd.AddCommand(newListEndpoints()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -142,12 +148,6 @@ func newCreateEndpoint() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreateEndpoint()) - }) -} - // start delete-endpoint command // Slice with functions to override default command behavior. @@ -204,12 +204,6 @@ func newDeleteEndpoint() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDeleteEndpoint()) - }) -} - // start get-endpoint command // Slice with functions to override default command behavior. @@ -266,12 +260,6 @@ func newGetEndpoint() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGetEndpoint()) - }) -} - // start list-endpoints command // Slice with functions to override default command behavior. @@ -322,10 +310,4 @@ func newListEndpoints() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newListEndpoints()) - }) -} - // end service VectorSearchEndpoints diff --git a/cmd/workspace/vector-search-indexes/vector-search-indexes.go b/cmd/workspace/vector-search-indexes/vector-search-indexes.go index a230ba080c..a9b9f51df8 100755 --- a/cmd/workspace/vector-search-indexes/vector-search-indexes.go +++ b/cmd/workspace/vector-search-indexes/vector-search-indexes.go @@ -35,6 +35,16 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newCreateIndex()) + cmd.AddCommand(newDeleteDataVectorIndex()) + cmd.AddCommand(newDeleteIndex()) + cmd.AddCommand(newGetIndex()) + cmd.AddCommand(newListIndexes()) + cmd.AddCommand(newQueryIndex()) + cmd.AddCommand(newSyncIndex()) + cmd.AddCommand(newUpsertDataVectorIndex()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -142,12 +152,6 @@ func newCreateIndex() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreateIndex()) - }) -} - // start delete-data-vector-index command // Slice with functions to override default command behavior. @@ -217,12 +221,6 @@ func newDeleteDataVectorIndex() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDeleteDataVectorIndex()) - }) -} - // start delete-index command // Slice with functions to override default command behavior. @@ -281,12 +279,6 @@ func newDeleteIndex() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDeleteIndex()) - }) -} - // start get-index command // Slice with functions to override default command behavior. @@ -345,12 +337,6 @@ func newGetIndex() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGetIndex()) - }) -} - // start list-indexes command // Slice with functions to override default command behavior. @@ -408,12 +394,6 @@ func newListIndexes() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newListIndexes()) - }) -} - // start query-index command // Slice with functions to override default command behavior. @@ -487,12 +467,6 @@ func newQueryIndex() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newQueryIndex()) - }) -} - // start sync-index command // Slice with functions to override default command behavior. @@ -551,12 +525,6 @@ func newSyncIndex() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newSyncIndex()) - }) -} - // start upsert-data-vector-index command // Slice with functions to override default command behavior. @@ -635,10 +603,4 @@ func newUpsertDataVectorIndex() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpsertDataVectorIndex()) - }) -} - // end service VectorSearchIndexes diff --git a/cmd/workspace/volumes/volumes.go b/cmd/workspace/volumes/volumes.go index 12cafeaf86..5a2991b905 100755 --- a/cmd/workspace/volumes/volumes.go +++ b/cmd/workspace/volumes/volumes.go @@ -34,6 +34,13 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newCreate()) + cmd.AddCommand(newDelete()) + cmd.AddCommand(newList()) + cmd.AddCommand(newRead()) + cmd.AddCommand(newUpdate()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -152,12 +159,6 @@ func newCreate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreate()) - }) -} - // start delete command // Slice with functions to override default command behavior. @@ -232,12 +233,6 @@ func newDelete() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDelete()) - }) -} - // start list command // Slice with functions to override default command behavior. @@ -308,12 +303,6 @@ func newList() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newList()) - }) -} - // start read command // Slice with functions to override default command behavior. @@ -389,12 +378,6 @@ func newRead() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newRead()) - }) -} - // start update command // Slice with functions to override default command behavior. @@ -484,10 +467,4 @@ func newUpdate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdate()) - }) -} - // end service Volumes diff --git a/cmd/workspace/warehouses/warehouses.go b/cmd/workspace/warehouses/warehouses.go index 2e9282a853..3d1f05439d 100755 --- a/cmd/workspace/warehouses/warehouses.go +++ b/cmd/workspace/warehouses/warehouses.go @@ -30,6 +30,21 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newCreate()) + cmd.AddCommand(newDelete()) + cmd.AddCommand(newEdit()) + cmd.AddCommand(newGet()) + cmd.AddCommand(newGetPermissionLevels()) + cmd.AddCommand(newGetPermissions()) + cmd.AddCommand(newGetWorkspaceWarehouseConfig()) + cmd.AddCommand(newList()) + cmd.AddCommand(newSetPermissions()) + cmd.AddCommand(newSetWorkspaceWarehouseConfig()) + cmd.AddCommand(newStart()) + cmd.AddCommand(newStop()) + cmd.AddCommand(newUpdatePermissions()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -138,12 +153,6 @@ func newCreate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newCreate()) - }) -} - // start delete command // Slice with functions to override default command behavior. @@ -214,12 +223,6 @@ func newDelete() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDelete()) - }) -} - // start edit command // Slice with functions to override default command behavior. @@ -336,12 +339,6 @@ func newEdit() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newEdit()) - }) -} - // start get command // Slice with functions to override default command behavior. @@ -417,12 +414,6 @@ func newGet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGet()) - }) -} - // start get-permission-levels command // Slice with functions to override default command behavior. @@ -493,12 +484,6 @@ func newGetPermissionLevels() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGetPermissionLevels()) - }) -} - // start get-permissions command // Slice with functions to override default command behavior. @@ -570,12 +555,6 @@ func newGetPermissions() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGetPermissions()) - }) -} - // start get-workspace-warehouse-config command // Slice with functions to override default command behavior. @@ -619,12 +598,6 @@ func newGetWorkspaceWarehouseConfig() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGetWorkspaceWarehouseConfig()) - }) -} - // start list command // Slice with functions to override default command behavior. @@ -677,12 +650,6 @@ func newList() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newList()) - }) -} - // start set-permissions command // Slice with functions to override default command behavior. @@ -764,12 +731,6 @@ func newSetPermissions() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newSetPermissions()) - }) -} - // start set-workspace-warehouse-config command // Slice with functions to override default command behavior. @@ -843,12 +804,6 @@ func newSetWorkspaceWarehouseConfig() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newSetWorkspaceWarehouseConfig()) - }) -} - // start start command // Slice with functions to override default command behavior. @@ -943,12 +898,6 @@ func newStart() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newStart()) - }) -} - // start stop command // Slice with functions to override default command behavior. @@ -1043,12 +992,6 @@ func newStop() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newStop()) - }) -} - // start update-permissions command // Slice with functions to override default command behavior. @@ -1130,10 +1073,4 @@ func newUpdatePermissions() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdatePermissions()) - }) -} - // end service Warehouses diff --git a/cmd/workspace/workspace-bindings/workspace-bindings.go b/cmd/workspace/workspace-bindings/workspace-bindings.go index f8d31fa450..3543f1e9de 100755 --- a/cmd/workspace/workspace-bindings/workspace-bindings.go +++ b/cmd/workspace/workspace-bindings/workspace-bindings.go @@ -42,6 +42,12 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newGet()) + cmd.AddCommand(newGetBindings()) + cmd.AddCommand(newUpdate()) + cmd.AddCommand(newUpdateBindings()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -109,12 +115,6 @@ func newGet() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGet()) - }) -} - // start get-bindings command // Slice with functions to override default command behavior. @@ -176,12 +176,6 @@ func newGetBindings() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGetBindings()) - }) -} - // start update command // Slice with functions to override default command behavior. @@ -252,12 +246,6 @@ func newUpdate() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdate()) - }) -} - // start update-bindings command // Slice with functions to override default command behavior. @@ -330,10 +318,4 @@ func newUpdateBindings() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdateBindings()) - }) -} - // end service WorkspaceBindings diff --git a/cmd/workspace/workspace-conf/workspace-conf.go b/cmd/workspace/workspace-conf/workspace-conf.go index 99207ffadc..87ea86c8ee 100755 --- a/cmd/workspace/workspace-conf/workspace-conf.go +++ b/cmd/workspace/workspace-conf/workspace-conf.go @@ -27,6 +27,10 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newGetStatus()) + cmd.AddCommand(newSetStatus()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -90,12 +94,6 @@ func newGetStatus() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGetStatus()) - }) -} - // start set-status command // Slice with functions to override default command behavior. @@ -156,10 +154,4 @@ func newSetStatus() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newSetStatus()) - }) -} - // end service WorkspaceConf diff --git a/cmd/workspace/workspace/workspace.go b/cmd/workspace/workspace/workspace.go index 4fb63f0c02..42517c4323 100755 --- a/cmd/workspace/workspace/workspace.go +++ b/cmd/workspace/workspace/workspace.go @@ -31,6 +31,18 @@ func New() *cobra.Command { }, } + // Add methods + cmd.AddCommand(newDelete()) + cmd.AddCommand(newExport()) + cmd.AddCommand(newGetPermissionLevels()) + cmd.AddCommand(newGetPermissions()) + cmd.AddCommand(newGetStatus()) + cmd.AddCommand(newImport()) + cmd.AddCommand(newList()) + cmd.AddCommand(newMkdirs()) + cmd.AddCommand(newSetPermissions()) + cmd.AddCommand(newUpdatePermissions()) + // Apply optional overrides to this command. for _, fn := range cmdOverrides { fn(cmd) @@ -138,12 +150,6 @@ func newDelete() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newDelete()) - }) -} - // start export command // Slice with functions to override default command behavior. @@ -231,12 +237,6 @@ func newExport() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newExport()) - }) -} - // start get-permission-levels command // Slice with functions to override default command behavior. @@ -297,12 +297,6 @@ func newGetPermissionLevels() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGetPermissionLevels()) - }) -} - // start get-permissions command // Slice with functions to override default command behavior. @@ -364,12 +358,6 @@ func newGetPermissions() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGetPermissions()) - }) -} - // start get-status command // Slice with functions to override default command behavior. @@ -429,12 +417,6 @@ func newGetStatus() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newGetStatus()) - }) -} - // start import command // Slice with functions to override default command behavior. @@ -528,12 +510,6 @@ func newImport() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newImport()) - }) -} - // start list command // Slice with functions to override default command behavior. @@ -593,12 +569,6 @@ func newList() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newList()) - }) -} - // start mkdirs command // Slice with functions to override default command behavior. @@ -696,12 +666,6 @@ func newMkdirs() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newMkdirs()) - }) -} - // start set-permissions command // Slice with functions to override default command behavior. @@ -773,12 +737,6 @@ func newSetPermissions() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newSetPermissions()) - }) -} - // start update-permissions command // Slice with functions to override default command behavior. @@ -850,10 +808,4 @@ func newUpdatePermissions() *cobra.Command { return cmd } -func init() { - cmdOverrides = append(cmdOverrides, func(cmd *cobra.Command) { - cmd.AddCommand(newUpdatePermissions()) - }) -} - // end service Workspace From 2a9362af0eea1d84a679218354479b4a66def2e0 Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Wed, 6 Mar 2024 09:32:32 +0100 Subject: [PATCH 4/5] Don't annotate subservices with a GroupID --- .codegen/service.go.tmpl | 2 ++ cmd/account/csp-enablement-account/csp-enablement-account.go | 4 ---- cmd/account/esm-enablement-account/esm-enablement-account.go | 4 ---- cmd/account/personal-compute/personal-compute.go | 4 ---- .../automatic-cluster-update/automatic-cluster-update.go | 4 ---- cmd/workspace/csp-enablement/csp-enablement.go | 4 ---- cmd/workspace/default-namespace/default-namespace.go | 4 ---- cmd/workspace/esm-enablement/esm-enablement.go | 4 ---- .../restrict-workspace-admins/restrict-workspace-admins.go | 4 ---- 9 files changed, 2 insertions(+), 32 deletions(-) diff --git a/.codegen/service.go.tmpl b/.codegen/service.go.tmpl index a404c4c128..0665b661fc 100644 --- a/.codegen/service.go.tmpl +++ b/.codegen/service.go.tmpl @@ -51,10 +51,12 @@ func New() *cobra.Command { Short: `{{.Summary | without "`"}}`, Long: `{{.Comment " " 80 | without "`"}}`, {{- end }} + {{- if not .HasParent }} GroupID: "{{ .Package.Name }}", Annotations: map[string]string{ "package": "{{ .Package.Name }}", }, + {{- end }} {{- if .IsPrivatePreview }} // This service is being previewed; hide from help output. diff --git a/cmd/account/csp-enablement-account/csp-enablement-account.go b/cmd/account/csp-enablement-account/csp-enablement-account.go index 7e5c35fb6a..ca2170fad9 100755 --- a/cmd/account/csp-enablement-account/csp-enablement-account.go +++ b/cmd/account/csp-enablement-account/csp-enablement-account.go @@ -27,10 +27,6 @@ func New() *cobra.Command { This settings can be disabled so that new workspaces do not have compliance security profile enabled by default.`, - GroupID: "settings", - Annotations: map[string]string{ - "package": "settings", - }, } // Add methods diff --git a/cmd/account/esm-enablement-account/esm-enablement-account.go b/cmd/account/esm-enablement-account/esm-enablement-account.go index 4b7cc441af..fc793d60a4 100755 --- a/cmd/account/esm-enablement-account/esm-enablement-account.go +++ b/cmd/account/esm-enablement-account/esm-enablement-account.go @@ -25,10 +25,6 @@ func New() *cobra.Command { setting is disabled for new workspaces. After workspace creation, account admins can enable enhanced security monitoring individually for each workspace.`, - GroupID: "settings", - Annotations: map[string]string{ - "package": "settings", - }, } // Add methods diff --git a/cmd/account/personal-compute/personal-compute.go b/cmd/account/personal-compute/personal-compute.go index 7931ccfb94..79090faf2f 100755 --- a/cmd/account/personal-compute/personal-compute.go +++ b/cmd/account/personal-compute/personal-compute.go @@ -29,10 +29,6 @@ func New() *cobra.Command { a default value, this setting is present on all accounts even though it's never set on a given account. Deletion reverts the value of the setting back to the default value.`, - GroupID: "settings", - Annotations: map[string]string{ - "package": "settings", - }, // This service is being previewed; hide from help output. Hidden: true, diff --git a/cmd/workspace/automatic-cluster-update/automatic-cluster-update.go b/cmd/workspace/automatic-cluster-update/automatic-cluster-update.go index fb3c3d0315..4c6e643dea 100755 --- a/cmd/workspace/automatic-cluster-update/automatic-cluster-update.go +++ b/cmd/workspace/automatic-cluster-update/automatic-cluster-update.go @@ -22,10 +22,6 @@ func New() *cobra.Command { Short: `Controls whether automatic cluster update is enabled for the current workspace.`, Long: `Controls whether automatic cluster update is enabled for the current workspace. By default, it is turned off.`, - GroupID: "settings", - Annotations: map[string]string{ - "package": "settings", - }, } // Add methods diff --git a/cmd/workspace/csp-enablement/csp-enablement.go b/cmd/workspace/csp-enablement/csp-enablement.go index b0db05bdc9..5e037f2abe 100755 --- a/cmd/workspace/csp-enablement/csp-enablement.go +++ b/cmd/workspace/csp-enablement/csp-enablement.go @@ -25,10 +25,6 @@ func New() *cobra.Command { off. This settings can NOT be disabled once it is enabled.`, - GroupID: "settings", - Annotations: map[string]string{ - "package": "settings", - }, } // Add methods diff --git a/cmd/workspace/default-namespace/default-namespace.go b/cmd/workspace/default-namespace/default-namespace.go index 4d5b190864..38880dd57e 100755 --- a/cmd/workspace/default-namespace/default-namespace.go +++ b/cmd/workspace/default-namespace/default-namespace.go @@ -32,10 +32,6 @@ func New() *cobra.Command { This setting requires a restart of clusters and SQL warehouses to take effect. Additionally, the default namespace only applies when using Unity Catalog-enabled compute.`, - GroupID: "settings", - Annotations: map[string]string{ - "package": "settings", - }, } // Add methods diff --git a/cmd/workspace/esm-enablement/esm-enablement.go b/cmd/workspace/esm-enablement/esm-enablement.go index 874cb5d4b8..a3da246fe4 100755 --- a/cmd/workspace/esm-enablement/esm-enablement.go +++ b/cmd/workspace/esm-enablement/esm-enablement.go @@ -27,10 +27,6 @@ func New() *cobra.Command { If the compliance security profile is disabled, you can enable or disable this setting and it is not permanent.`, - GroupID: "settings", - Annotations: map[string]string{ - "package": "settings", - }, } // Add methods diff --git a/cmd/workspace/restrict-workspace-admins/restrict-workspace-admins.go b/cmd/workspace/restrict-workspace-admins/restrict-workspace-admins.go index e181a2f3dc..d6b8a84240 100755 --- a/cmd/workspace/restrict-workspace-admins/restrict-workspace-admins.go +++ b/cmd/workspace/restrict-workspace-admins/restrict-workspace-admins.go @@ -32,10 +32,6 @@ func New() *cobra.Command { User role on. They can also only change a job owner to themselves. And they can change the job run_as setting to themselves or to a service principal on which they have the Service Principal User role.`, - GroupID: "settings", - Annotations: map[string]string{ - "package": "settings", - }, } // Add methods From 85a5e2eec8960199970e760bdecf9160041e87f2 Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Wed, 6 Mar 2024 10:07:41 +0100 Subject: [PATCH 5/5] Manually unhide settings services --- cmd/account/settings/settings.go | 3 --- cmd/workspace/settings/settings.go | 3 --- 2 files changed, 6 deletions(-) diff --git a/cmd/account/settings/settings.go b/cmd/account/settings/settings.go index 29bb6ad159..a750e81e0e 100755 --- a/cmd/account/settings/settings.go +++ b/cmd/account/settings/settings.go @@ -23,9 +23,6 @@ func New() *cobra.Command { Annotations: map[string]string{ "package": "settings", }, - - // This service is being previewed; hide from help output. - Hidden: true, } // Add subservices diff --git a/cmd/workspace/settings/settings.go b/cmd/workspace/settings/settings.go index 8ba0335fb1..38e19e8390 100755 --- a/cmd/workspace/settings/settings.go +++ b/cmd/workspace/settings/settings.go @@ -25,9 +25,6 @@ func New() *cobra.Command { Annotations: map[string]string{ "package": "settings", }, - - // This service is being previewed; hide from help output. - Hidden: true, } // Add subservices