databricks-cli/cmd/workspace
Andrew Nester 17ed7a317b
Fixed ignoring required positional parameters when --json flag is provided (#535)
## Changes
When there are positional required parameters in the command which can't
be unmarshalled from JSON, we should require them despite the fact
`--json` flag is provided.

The reason is that for some of the command, for example, `databricks
groups patch ID` these arguments are actually path arguments in API and
can't be set as part of `--json` body provided.

Original change which introduced this ignore logic is here:
https://github.com/databricks/cli/pull/405

Fixes https://github.com/databricks/cli/issues/533,
https://github.com/databricks/cli/issues/537

Note: Code generation is based on the change in this PR:
https://github.com/databricks/databricks-sdk-go/pull/536

## Tests
1. Running `cli groups patch 123 --json {...}` works correctly

Backward compatibility tests with previous changes from
https://github.com/databricks/cli/pull/405
1. `cli clusters events --json '{"cluster_id": "1029-xxxx"}'` - works,
returns list of events
2. `cli clusters events 1029-xxxx` - works, returns list of events
3. `cli clusters events` - works, first prompts for Cluster ID and then
returns the list of events
2023-07-03 13:20:30 +02:00
..
alerts Fixed ignoring required positional parameters when --json flag is provided (#535) 2023-07-03 13:20:30 +02:00
catalogs Fixed ignoring required positional parameters when --json flag is provided (#535) 2023-07-03 13:20:30 +02:00
cluster-policies Fixed ignoring required positional parameters when --json flag is provided (#535) 2023-07-03 13:20:30 +02:00
clusters Fixed ignoring required positional parameters when --json flag is provided (#535) 2023-07-03 13:20:30 +02:00
connections Fixed ignoring required positional parameters when --json flag is provided (#535) 2023-07-03 13:20:30 +02:00
current-user Disable shell completions for generated commands (#483) 2023-06-15 14:56:36 +00:00
dashboards Fixed ignoring required positional parameters when --json flag is provided (#535) 2023-07-03 13:20:30 +02:00
data-sources Disable shell completions for generated commands (#483) 2023-06-15 14:56:36 +00:00
experiments Fixed ignoring required positional parameters when --json flag is provided (#535) 2023-07-03 13:20:30 +02:00
external-locations Fixed ignoring required positional parameters when --json flag is provided (#535) 2023-07-03 13:20:30 +02:00
functions Fixed ignoring required positional parameters when --json flag is provided (#535) 2023-07-03 13:20:30 +02:00
git-credentials Fixed ignoring required positional parameters when --json flag is provided (#535) 2023-07-03 13:20:30 +02:00
global-init-scripts Fixed ignoring required positional parameters when --json flag is provided (#535) 2023-07-03 13:20:30 +02:00
grants Fixed ignoring required positional parameters when --json flag is provided (#535) 2023-07-03 13:20:30 +02:00
groups Fixed ignoring required positional parameters when --json flag is provided (#535) 2023-07-03 13:20:30 +02:00
instance-pools Fixed ignoring required positional parameters when --json flag is provided (#535) 2023-07-03 13:20:30 +02:00
instance-profiles Fixed ignoring required positional parameters when --json flag is provided (#535) 2023-07-03 13:20:30 +02:00
ip-access-lists Fixed ignoring required positional parameters when --json flag is provided (#535) 2023-07-03 13:20:30 +02:00
jobs Fixed ignoring required positional parameters when --json flag is provided (#535) 2023-07-03 13:20:30 +02:00
libraries Fixed ignoring required positional parameters when --json flag is provided (#535) 2023-07-03 13:20:30 +02:00
metastores Fixed ignoring required positional parameters when --json flag is provided (#535) 2023-07-03 13:20:30 +02:00
model-registry Fixed ignoring required positional parameters when --json flag is provided (#535) 2023-07-03 13:20:30 +02:00
permissions Fixed ignoring required positional parameters when --json flag is provided (#535) 2023-07-03 13:20:30 +02:00
pipelines Fixed ignoring required positional parameters when --json flag is provided (#535) 2023-07-03 13:20:30 +02:00
policy-families Fixed ignoring required positional parameters when --json flag is provided (#535) 2023-07-03 13:20:30 +02:00
providers Fixed ignoring required positional parameters when --json flag is provided (#535) 2023-07-03 13:20:30 +02:00
queries Fixed ignoring required positional parameters when --json flag is provided (#535) 2023-07-03 13:20:30 +02:00
query-history Fixed ignoring required positional parameters when --json flag is provided (#535) 2023-07-03 13:20:30 +02:00
recipient-activation Fixed ignoring required positional parameters when --json flag is provided (#535) 2023-07-03 13:20:30 +02:00
recipients Fixed ignoring required positional parameters when --json flag is provided (#535) 2023-07-03 13:20:30 +02:00
repos Fixed ignoring required positional parameters when --json flag is provided (#535) 2023-07-03 13:20:30 +02:00
schemas Fixed ignoring required positional parameters when --json flag is provided (#535) 2023-07-03 13:20:30 +02:00
secrets Fixed ignoring required positional parameters when --json flag is provided (#535) 2023-07-03 13:20:30 +02:00
service-principals Fixed ignoring required positional parameters when --json flag is provided (#535) 2023-07-03 13:20:30 +02:00
serving-endpoints Fixed ignoring required positional parameters when --json flag is provided (#535) 2023-07-03 13:20:30 +02:00
shares Fixed ignoring required positional parameters when --json flag is provided (#535) 2023-07-03 13:20:30 +02:00
storage-credentials Fixed ignoring required positional parameters when --json flag is provided (#535) 2023-07-03 13:20:30 +02:00
system-schemas Fixed ignoring required positional parameters when --json flag is provided (#535) 2023-07-03 13:20:30 +02:00
table-constraints Fixed ignoring required positional parameters when --json flag is provided (#535) 2023-07-03 13:20:30 +02:00
tables Fixed ignoring required positional parameters when --json flag is provided (#535) 2023-07-03 13:20:30 +02:00
token-management Fixed ignoring required positional parameters when --json flag is provided (#535) 2023-07-03 13:20:30 +02:00
tokens Fixed ignoring required positional parameters when --json flag is provided (#535) 2023-07-03 13:20:30 +02:00
users Fixed ignoring required positional parameters when --json flag is provided (#535) 2023-07-03 13:20:30 +02:00
volumes Fixed ignoring required positional parameters when --json flag is provided (#535) 2023-07-03 13:20:30 +02:00
warehouses Fixed ignoring required positional parameters when --json flag is provided (#535) 2023-07-03 13:20:30 +02:00
workspace Fixed ignoring required positional parameters when --json flag is provided (#535) 2023-07-03 13:20:30 +02:00
workspace-bindings Fixed ignoring required positional parameters when --json flag is provided (#535) 2023-07-03 13:20:30 +02:00
workspace-conf Fixed ignoring required positional parameters when --json flag is provided (#535) 2023-07-03 13:20:30 +02:00
cmd.go Associate generated commands with command groups (#475) 2023-06-15 14:47:24 +00:00
groups.go Associate generated commands with command groups (#475) 2023-06-15 14:47:24 +00:00