diff --git a/.codegen/_openapi_sha b/.codegen/_openapi_sha index 20842dcedb..b7f56b6d8a 100644 --- a/.codegen/_openapi_sha +++ b/.codegen/_openapi_sha @@ -1 +1 @@ -c4784cea599325a13472b1455e7434d639362d8b \ No newline at end of file +e2018bb00cba203508f8afe5a6d41bd49789ba25 \ No newline at end of file diff --git a/NEXT_CHANGELOG.md b/NEXT_CHANGELOG.md index 632a600329..82e8922504 100644 --- a/NEXT_CHANGELOG.md +++ b/NEXT_CHANGELOG.md @@ -5,6 +5,7 @@ ### Notable Changes ### CLI +* Remove previously added flags from the `jobs create` and `pipelines create` commands. ([#3870](https://github.com/databricks/cli/pull/3870)) ### Dependency updates diff --git a/acceptance/bundle/refschema/out.fields.txt b/acceptance/bundle/refschema/out.fields.txt index 90e526923a..f2baea69b1 100644 --- a/acceptance/bundle/refschema/out.fields.txt +++ b/acceptance/bundle/refschema/out.fields.txt @@ -5,7 +5,7 @@ resources.alerts.*.display_name string ALL resources.alerts.*.effective_run_as *sql.AlertV2RunAs ALL resources.alerts.*.effective_run_as.service_principal_name string ALL resources.alerts.*.effective_run_as.user_name string ALL -resources.alerts.*.evaluation *sql.AlertV2Evaluation ALL +resources.alerts.*.evaluation sql.AlertV2Evaluation ALL resources.alerts.*.evaluation.comparison_operator sql.ComparisonOperator ALL resources.alerts.*.evaluation.empty_result_state sql.AlertEvaluationState ALL resources.alerts.*.evaluation.last_evaluated_at string ALL @@ -16,7 +16,7 @@ resources.alerts.*.evaluation.notification.subscriptions []sql.AlertV2Subscripti resources.alerts.*.evaluation.notification.subscriptions[*] sql.AlertV2Subscription ALL resources.alerts.*.evaluation.notification.subscriptions[*].destination_id string ALL resources.alerts.*.evaluation.notification.subscriptions[*].user_email string ALL -resources.alerts.*.evaluation.source *sql.AlertV2OperandColumn ALL +resources.alerts.*.evaluation.source sql.AlertV2OperandColumn ALL resources.alerts.*.evaluation.source.aggregation sql.Aggregation ALL resources.alerts.*.evaluation.source.display string ALL resources.alerts.*.evaluation.source.name string ALL @@ -33,7 +33,7 @@ resources.alerts.*.evaluation.threshold.value.string_value string ALL resources.alerts.*.id string ALL resources.alerts.*.lifecycle resources.Lifecycle INPUT resources.alerts.*.lifecycle.prevent_destroy bool INPUT -resources.alerts.*.lifecycle_state sql.LifecycleState ALL +resources.alerts.*.lifecycle_state sql.AlertLifecycleState ALL resources.alerts.*.modified_status string INPUT resources.alerts.*.owner_user_name string ALL resources.alerts.*.parent_path string ALL @@ -48,7 +48,7 @@ resources.alerts.*.run_as *sql.AlertV2RunAs ALL resources.alerts.*.run_as.service_principal_name string ALL resources.alerts.*.run_as.user_name string ALL resources.alerts.*.run_as_user_name string ALL -resources.alerts.*.schedule *sql.CronSchedule ALL +resources.alerts.*.schedule sql.CronSchedule ALL resources.alerts.*.schedule.pause_status sql.SchedulePauseStatus ALL resources.alerts.*.schedule.quartz_cron_schedule string ALL resources.alerts.*.schedule.timezone_id string ALL @@ -1523,12 +1523,6 @@ resources.jobs.*.settings.trigger.pause_status jobs.PauseStatus REMOTE resources.jobs.*.settings.trigger.periodic *jobs.PeriodicTriggerConfiguration REMOTE resources.jobs.*.settings.trigger.periodic.interval int REMOTE resources.jobs.*.settings.trigger.periodic.unit jobs.PeriodicTriggerConfigurationTimeUnit REMOTE -resources.jobs.*.settings.trigger.table *jobs.TableUpdateTriggerConfiguration REMOTE -resources.jobs.*.settings.trigger.table.condition jobs.Condition REMOTE -resources.jobs.*.settings.trigger.table.min_time_between_triggers_seconds int REMOTE -resources.jobs.*.settings.trigger.table.table_names []string REMOTE -resources.jobs.*.settings.trigger.table.table_names[*] string REMOTE -resources.jobs.*.settings.trigger.table.wait_after_last_change_seconds int REMOTE resources.jobs.*.settings.trigger.table_update *jobs.TableUpdateTriggerConfiguration REMOTE resources.jobs.*.settings.trigger.table_update.condition jobs.Condition REMOTE resources.jobs.*.settings.trigger.table_update.min_time_between_triggers_seconds int REMOTE @@ -2194,12 +2188,6 @@ resources.jobs.*.trigger.pause_status jobs.PauseStatus INPUT STATE resources.jobs.*.trigger.periodic *jobs.PeriodicTriggerConfiguration INPUT STATE resources.jobs.*.trigger.periodic.interval int INPUT STATE resources.jobs.*.trigger.periodic.unit jobs.PeriodicTriggerConfigurationTimeUnit INPUT STATE -resources.jobs.*.trigger.table *jobs.TableUpdateTriggerConfiguration INPUT STATE -resources.jobs.*.trigger.table.condition jobs.Condition INPUT STATE -resources.jobs.*.trigger.table.min_time_between_triggers_seconds int INPUT STATE -resources.jobs.*.trigger.table.table_names []string INPUT STATE -resources.jobs.*.trigger.table.table_names[*] string INPUT STATE -resources.jobs.*.trigger.table.wait_after_last_change_seconds int INPUT STATE resources.jobs.*.trigger.table_update *jobs.TableUpdateTriggerConfiguration INPUT STATE resources.jobs.*.trigger.table_update.condition jobs.Condition INPUT STATE resources.jobs.*.trigger.table_update.min_time_between_triggers_seconds int INPUT STATE @@ -2869,6 +2857,7 @@ resources.pipelines.*.spec.trigger.cron *pipelines.CronTrigger REMOTE resources.pipelines.*.spec.trigger.cron.quartz_cron_schedule string REMOTE resources.pipelines.*.spec.trigger.cron.timezone_id string REMOTE resources.pipelines.*.spec.trigger.manual *pipelines.ManualTrigger REMOTE +resources.pipelines.*.spec.usage_policy_id string REMOTE resources.pipelines.*.state pipelines.PipelineState REMOTE resources.pipelines.*.storage string INPUT STATE resources.pipelines.*.tags map[string]string INPUT STATE @@ -2880,6 +2869,7 @@ resources.pipelines.*.trigger.cron.quartz_cron_schedule string INPUT STATE resources.pipelines.*.trigger.cron.timezone_id string INPUT STATE resources.pipelines.*.trigger.manual *pipelines.ManualTrigger INPUT STATE resources.pipelines.*.url string INPUT +resources.pipelines.*.usage_policy_id string INPUT STATE resources.pipelines.*.permissions.object_id string ALL resources.pipelines.*.permissions.permissions []iam.AccessControlRequest ALL resources.pipelines.*.permissions.permissions[*] iam.AccessControlRequest ALL diff --git a/acceptance/cmd/account/account-help/output.txt b/acceptance/cmd/account/account-help/output.txt index 87378fab32..007525f3e9 100644 --- a/acceptance/cmd/account/account-help/output.txt +++ b/acceptance/cmd/account/account-help/output.txt @@ -7,8 +7,11 @@ Usage: Identity and Access Management access-control These APIs manage access rules on resources in an account. + groups Groups simplify identity management, making it easier to assign access to Databricks account, data, and other securable objects. groups-v2 Groups simplify identity management, making it easier to assign access to Databricks account, data, and other securable objects. + service-principals Identities for use with jobs, automated tools, and systems such as scripts, apps, and CI/CD platforms. service-principals-v2 Identities for use with jobs, automated tools, and systems such as scripts, apps, and CI/CD platforms. + users User identities recognized by Databricks and represented by email addresses. users-v2 User identities recognized by Databricks and represented by email addresses. workspace-assignment The Workspace Permission Assignment API allows you to manage workspace permissions for principals in your account. diff --git a/acceptance/help/output.txt b/acceptance/help/output.txt index 4e80539a7e..cc52a59a22 100644 --- a/acceptance/help/output.txt +++ b/acceptance/help/output.txt @@ -87,6 +87,7 @@ Unity Catalog Delta Sharing providers A data provider is an object representing the organization in the real world who shares the data. recipient-activation The Recipient Activation API is only applicable in the open sharing model where the recipient object has the authentication type of TOKEN. + recipient-federation-policies The Recipient Federation Policies APIs are only applicable in the open sharing model where the recipient object has the authentication type of OIDC_RECIPIENT, enabling data sharing from Databricks to non-Databricks recipients. recipients A recipient is an object you create using :method:recipients/create to represent an organization which you want to allow access shares. shares A share is a container instantiated with :method:shares/create. @@ -154,6 +155,7 @@ Additional Commands: auth Authentication related commands completion Generate the autocompletion script for the specified shell configure Configure authentication + data-quality Manage the data quality of Unity Catalog objects (currently support schema and table). help Help about any command labs Manage Databricks Labs installations tag-policies The Tag Policy API allows you to manage policies for governed tags in Databricks. diff --git a/bundle/direct/dresources/pipeline.go b/bundle/direct/dresources/pipeline.go index 71cac76a1b..fb2d63bda9 100644 --- a/bundle/direct/dresources/pipeline.go +++ b/bundle/direct/dresources/pipeline.go @@ -58,6 +58,7 @@ func (*ResourcePipeline) RemapState(p *pipelines.GetPipelineResponse) *pipelines Tags: spec.Tags, Target: spec.Target, Trigger: spec.Trigger, + UsagePolicyId: spec.UsagePolicyId, ForceSendFields: filterFields[pipelines.CreatePipeline](spec.ForceSendFields, "AllowDuplicateNames", "DryRun", "RunAs", "Id"), } } @@ -106,6 +107,7 @@ func (r *ResourcePipeline) DoUpdate(ctx context.Context, id string, config *pipe Tags: config.Tags, Target: config.Target, Trigger: config.Trigger, + UsagePolicyId: config.UsagePolicyId, PipelineId: id, ForceSendFields: filterFields[pipelines.EditPipeline](config.ForceSendFields), } diff --git a/bundle/internal/schema/annotations_openapi.yml b/bundle/internal/schema/annotations_openapi.yml index 10a05e4368..9c8a8e413a 100644 --- a/bundle/internal/schema/annotations_openapi.yml +++ b/bundle/internal/schema/annotations_openapi.yml @@ -589,8 +589,6 @@ github.com/databricks/cli/bundle/config/resources.Pipeline: "budget_policy_id": "description": |- Budget policy of this pipeline. - "x-databricks-preview": |- - PRIVATE "catalog": "description": |- A catalog in Unity Catalog to publish data from this pipeline to. If `target` is specified, tables in this pipeline are published to a `target` schema inside `catalog` (for example, `catalog`.`target`.`table`). If `target` is not specified, no data is published to Unity Catalog. @@ -687,6 +685,11 @@ github.com/databricks/cli/bundle/config/resources.Pipeline: Which pipeline trigger to use. Deprecated: Use `continuous` instead. "deprecation_message": |- This field is deprecated + "usage_policy_id": + "description": |- + Usage policy of this pipeline. + "x-databricks-preview": |- + PRIVATE github.com/databricks/cli/bundle/config/resources.QualityMonitor: "assets_dir": "description": |- @@ -2462,6 +2465,10 @@ github.com/databricks/databricks-sdk-go/service/jobs.AuthenticationMethod: - |- PAT github.com/databricks/databricks-sdk-go/service/jobs.CleanRoomsNotebookTask: + "_": + "description": |- + Clean Rooms notebook task for V1 Clean Room service (GA). + Replaces the deprecated CleanRoomNotebookTask (defined above) which was for V0 service. "clean_room_name": "description": |- The clean room that the notebook belongs to. @@ -3060,6 +3067,8 @@ github.com/databricks/databricks-sdk-go/service/jobs.RunJobTask: "dbt_commands": "description": |- An array of commands to execute for jobs with the dbt task, for example `"dbt_commands": ["dbt deps", "dbt seed", "dbt deps", "dbt seed", "dbt run"]` + + ⚠ **Deprecation note** Use [job parameters](https://docs.databricks.com/jobs/job-parameters.html#job-parameter-pushdown) to pass information down to tasks. "deprecation_message": |- This field is deprecated "x-databricks-preview": |- @@ -3072,7 +3081,7 @@ github.com/databricks/databricks-sdk-go/service/jobs.RunJobTask: jar_params cannot be specified in conjunction with notebook_params. The JSON representation of this field (for example `{"jar_params":["john doe","35"]}`) cannot exceed 10,000 bytes. - Use [Task parameter variables](https://docs.databricks.com/jobs.html#parameter-variables) to set parameters containing information about job runs. + ⚠ **Deprecation note** Use [job parameters](https://docs.databricks.com/jobs/job-parameters.html#job-parameter-pushdown) to pass information down to tasks. "deprecation_message": |- This field is deprecated "x-databricks-preview": |- @@ -3092,7 +3101,7 @@ github.com/databricks/databricks-sdk-go/service/jobs.RunJobTask: notebook_params cannot be specified in conjunction with jar_params. - Use [Task parameter variables](https://docs.databricks.com/jobs.html#parameter-variables) to set parameters containing information about job runs. + ⚠ **Deprecation note** Use [job parameters](https://docs.databricks.com/jobs/job-parameters.html#job-parameter-pushdown) to pass information down to tasks. The JSON representation of this field (for example `{"notebook_params":{"name":"john doe","age":"35"}}`) cannot exceed 10,000 bytes. "deprecation_message": |- @@ -3114,7 +3123,7 @@ github.com/databricks/databricks-sdk-go/service/jobs.RunJobTask: the parameters specified in job setting. The JSON representation of this field (for example `{"python_params":["john doe","35"]}`) cannot exceed 10,000 bytes. - Use [Task parameter variables](https://docs.databricks.com/jobs.html#parameter-variables) to set parameters containing information about job runs. + ⚠ **Deprecation note** Use [job parameters](https://docs.databricks.com/jobs/job-parameters.html#job-parameter-pushdown) to pass information down to tasks. Important @@ -3131,7 +3140,7 @@ github.com/databricks/databricks-sdk-go/service/jobs.RunJobTask: parameters specified in job setting. The JSON representation of this field (for example `{"python_params":["john doe","35"]}`) cannot exceed 10,000 bytes. - Use [Task parameter variables](https://docs.databricks.com/jobs.html#parameter-variables) to set parameters containing information about job runs + ⚠ **Deprecation note** Use [job parameters](https://docs.databricks.com/jobs/job-parameters.html#job-parameter-pushdown) to pass information down to tasks. Important @@ -3144,6 +3153,8 @@ github.com/databricks/databricks-sdk-go/service/jobs.RunJobTask: "sql_params": "description": |- A map from keys to values for jobs with SQL task, for example `"sql_params": {"name": "john doe", "age": "35"}`. The SQL alert task does not support custom parameters. + + ⚠ **Deprecation note** Use [job parameters](https://docs.databricks.com/jobs/job-parameters.html#job-parameter-pushdown) to pass information down to tasks. "deprecation_message": |- This field is deprecated "x-databricks-preview": |- @@ -3511,13 +3522,6 @@ github.com/databricks/databricks-sdk-go/service/jobs.TriggerSettings: "periodic": "description": |- Periodic trigger settings. - "table": - "description": |- - Old table trigger settings name. Deprecated in favor of `table_update`. - "deprecation_message": |- - This field is deprecated - "x-databricks-preview": |- - PRIVATE "table_update": {} github.com/databricks/databricks-sdk-go/service/jobs.Webhook: "id": {} @@ -3566,7 +3570,7 @@ github.com/databricks/databricks-sdk-go/service/pipelines.CronTrigger: github.com/databricks/databricks-sdk-go/service/pipelines.DayOfWeek: "_": "description": |- - Days of week in which the restart is allowed to happen (within a five-hour window starting at start_hour). + Days of week in which the window is allowed to happen. If not specified all days of the week will be used. "enum": - |- diff --git a/bundle/internal/validation/generated/enum_fields.go b/bundle/internal/validation/generated/enum_fields.go index 4216b90ee7..9975314ffc 100644 --- a/bundle/internal/validation/generated/enum_fields.go +++ b/bundle/internal/validation/generated/enum_fields.go @@ -94,7 +94,6 @@ var EnumFields = map[string][]string{ "resources.jobs.*.tasks[*].sql_task.file.source": {"GIT", "WORKSPACE"}, "resources.jobs.*.trigger.pause_status": {"PAUSED", "UNPAUSED"}, "resources.jobs.*.trigger.periodic.unit": {"DAYS", "HOURS", "WEEKS"}, - "resources.jobs.*.trigger.table.condition": {"ALL_UPDATED", "ANY_UPDATED"}, "resources.jobs.*.trigger.table_update.condition": {"ALL_UPDATED", "ANY_UPDATED"}, "resources.model_serving_endpoints.*.ai_gateway.guardrails.input.pii.behavior": {"BLOCK", "MASK", "NONE"}, diff --git a/bundle/schema/jsonschema.json b/bundle/schema/jsonschema.json index 4d6fa20fec..053a2e3c25 100644 --- a/bundle/schema/jsonschema.json +++ b/bundle/schema/jsonschema.json @@ -1289,9 +1289,7 @@ }, "budget_policy_id": { "description": "Budget policy of this pipeline.", - "$ref": "#/$defs/string", - "x-databricks-preview": "PRIVATE", - "doNotSuggest": true + "$ref": "#/$defs/string" }, "catalog": { "description": "A catalog in Unity Catalog to publish data from this pipeline to. If `target` is specified, tables in this pipeline are published to a `target` schema inside `catalog` (for example, `catalog`.`target`.`table`). If `target` is not specified, no data is published to Unity Catalog.", @@ -1410,6 +1408,12 @@ "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.PipelineTrigger", "deprecationMessage": "Use continuous instead", "deprecated": true + }, + "usage_policy_id": { + "description": "Usage policy of this pipeline.", + "$ref": "#/$defs/string", + "x-databricks-preview": "PRIVATE", + "doNotSuggest": true } }, "additionalProperties": false, @@ -5129,6 +5133,7 @@ "oneOf": [ { "type": "object", + "description": "Clean Rooms notebook task for V1 Clean Room service (GA).\nReplaces the deprecated CleanRoomNotebookTask (defined above) which was for V0 service.", "properties": { "clean_room_name": { "description": "The clean room that the notebook belongs to.", @@ -6295,7 +6300,7 @@ "type": "object", "properties": { "dbt_commands": { - "description": "An array of commands to execute for jobs with the dbt task, for example `\"dbt_commands\": [\"dbt deps\", \"dbt seed\", \"dbt deps\", \"dbt seed\", \"dbt run\"]`", + "description": "An array of commands to execute for jobs with the dbt task, for example `\"dbt_commands\": [\"dbt deps\", \"dbt seed\", \"dbt deps\", \"dbt seed\", \"dbt run\"]`\n\n⚠ **Deprecation note** Use [job parameters](https://docs.databricks.com/jobs/job-parameters.html#job-parameter-pushdown) to pass information down to tasks.", "$ref": "#/$defs/slice/string", "x-databricks-preview": "PRIVATE", "deprecationMessage": "This field is deprecated", @@ -6303,7 +6308,7 @@ "deprecated": true }, "jar_params": { - "description": "A list of parameters for jobs with Spark JAR tasks, for example `\"jar_params\": [\"john doe\", \"35\"]`.\nThe parameters are used to invoke the main function of the main class specified in the Spark JAR task.\nIf not specified upon `run-now`, it defaults to an empty list.\njar_params cannot be specified in conjunction with notebook_params.\nThe JSON representation of this field (for example `{\"jar_params\":[\"john doe\",\"35\"]}`) cannot exceed 10,000 bytes.\n\nUse [Task parameter variables](https://docs.databricks.com/jobs.html#parameter-variables) to set parameters containing information about job runs.", + "description": "A list of parameters for jobs with Spark JAR tasks, for example `\"jar_params\": [\"john doe\", \"35\"]`.\nThe parameters are used to invoke the main function of the main class specified in the Spark JAR task.\nIf not specified upon `run-now`, it defaults to an empty list.\njar_params cannot be specified in conjunction with notebook_params.\nThe JSON representation of this field (for example `{\"jar_params\":[\"john doe\",\"35\"]}`) cannot exceed 10,000 bytes.\n\n⚠ **Deprecation note** Use [job parameters](https://docs.databricks.com/jobs/job-parameters.html#job-parameter-pushdown) to pass information down to tasks.", "$ref": "#/$defs/slice/string", "x-databricks-preview": "PRIVATE", "deprecationMessage": "This field is deprecated", @@ -6319,7 +6324,7 @@ "$ref": "#/$defs/map/string" }, "notebook_params": { - "description": "A map from keys to values for jobs with notebook task, for example `\"notebook_params\": {\"name\": \"john doe\", \"age\": \"35\"}`.\nThe map is passed to the notebook and is accessible through the [dbutils.widgets.get](https://docs.databricks.com/dev-tools/databricks-utils.html) function.\n\nIf not specified upon `run-now`, the triggered run uses the job’s base parameters.\n\nnotebook_params cannot be specified in conjunction with jar_params.\n\nUse [Task parameter variables](https://docs.databricks.com/jobs.html#parameter-variables) to set parameters containing information about job runs.\n\nThe JSON representation of this field (for example `{\"notebook_params\":{\"name\":\"john doe\",\"age\":\"35\"}}`) cannot exceed 10,000 bytes.", + "description": "A map from keys to values for jobs with notebook task, for example `\"notebook_params\": {\"name\": \"john doe\", \"age\": \"35\"}`.\nThe map is passed to the notebook and is accessible through the [dbutils.widgets.get](https://docs.databricks.com/dev-tools/databricks-utils.html) function.\n\nIf not specified upon `run-now`, the triggered run uses the job’s base parameters.\n\nnotebook_params cannot be specified in conjunction with jar_params.\n\n⚠ **Deprecation note** Use [job parameters](https://docs.databricks.com/jobs/job-parameters.html#job-parameter-pushdown) to pass information down to tasks.\n\nThe JSON representation of this field (for example `{\"notebook_params\":{\"name\":\"john doe\",\"age\":\"35\"}}`) cannot exceed 10,000 bytes.", "$ref": "#/$defs/map/string", "x-databricks-preview": "PRIVATE", "deprecationMessage": "This field is deprecated", @@ -6338,7 +6343,7 @@ "deprecated": true }, "python_params": { - "description": "A list of parameters for jobs with Python tasks, for example `\"python_params\": [\"john doe\", \"35\"]`.\nThe parameters are passed to Python file as command-line parameters. If specified upon `run-now`, it would overwrite\nthe parameters specified in job setting. The JSON representation of this field (for example `{\"python_params\":[\"john doe\",\"35\"]}`)\ncannot exceed 10,000 bytes.\n\nUse [Task parameter variables](https://docs.databricks.com/jobs.html#parameter-variables) to set parameters containing information about job runs.\n\nImportant\n\nThese parameters accept only Latin characters (ASCII character set). Using non-ASCII characters returns an error.\nExamples of invalid, non-ASCII characters are Chinese, Japanese kanjis, and emojis.", + "description": "A list of parameters for jobs with Python tasks, for example `\"python_params\": [\"john doe\", \"35\"]`.\nThe parameters are passed to Python file as command-line parameters. If specified upon `run-now`, it would overwrite\nthe parameters specified in job setting. The JSON representation of this field (for example `{\"python_params\":[\"john doe\",\"35\"]}`)\ncannot exceed 10,000 bytes.\n\n⚠ **Deprecation note** Use [job parameters](https://docs.databricks.com/jobs/job-parameters.html#job-parameter-pushdown) to pass information down to tasks.\n\nImportant\n\nThese parameters accept only Latin characters (ASCII character set). Using non-ASCII characters returns an error.\nExamples of invalid, non-ASCII characters are Chinese, Japanese kanjis, and emojis.", "$ref": "#/$defs/slice/string", "x-databricks-preview": "PRIVATE", "deprecationMessage": "This field is deprecated", @@ -6346,7 +6351,7 @@ "deprecated": true }, "spark_submit_params": { - "description": "A list of parameters for jobs with spark submit task, for example `\"spark_submit_params\": [\"--class\", \"org.apache.spark.examples.SparkPi\"]`.\nThe parameters are passed to spark-submit script as command-line parameters. If specified upon `run-now`, it would overwrite the\nparameters specified in job setting. The JSON representation of this field (for example `{\"python_params\":[\"john doe\",\"35\"]}`)\ncannot exceed 10,000 bytes.\n\nUse [Task parameter variables](https://docs.databricks.com/jobs.html#parameter-variables) to set parameters containing information about job runs\n\nImportant\n\nThese parameters accept only Latin characters (ASCII character set). Using non-ASCII characters returns an error.\nExamples of invalid, non-ASCII characters are Chinese, Japanese kanjis, and emojis.", + "description": "A list of parameters for jobs with spark submit task, for example `\"spark_submit_params\": [\"--class\", \"org.apache.spark.examples.SparkPi\"]`.\nThe parameters are passed to spark-submit script as command-line parameters. If specified upon `run-now`, it would overwrite the\nparameters specified in job setting. The JSON representation of this field (for example `{\"python_params\":[\"john doe\",\"35\"]}`)\ncannot exceed 10,000 bytes.\n\n⚠ **Deprecation note** Use [job parameters](https://docs.databricks.com/jobs/job-parameters.html#job-parameter-pushdown) to pass information down to tasks.\n\nImportant\n\nThese parameters accept only Latin characters (ASCII character set). Using non-ASCII characters returns an error.\nExamples of invalid, non-ASCII characters are Chinese, Japanese kanjis, and emojis.", "$ref": "#/$defs/slice/string", "x-databricks-preview": "PRIVATE", "deprecationMessage": "This field is deprecated", @@ -6354,7 +6359,7 @@ "deprecated": true }, "sql_params": { - "description": "A map from keys to values for jobs with SQL task, for example `\"sql_params\": {\"name\": \"john doe\", \"age\": \"35\"}`. The SQL alert task does not support custom parameters.", + "description": "A map from keys to values for jobs with SQL task, for example `\"sql_params\": {\"name\": \"john doe\", \"age\": \"35\"}`. The SQL alert task does not support custom parameters.\n\n⚠ **Deprecation note** Use [job parameters](https://docs.databricks.com/jobs/job-parameters.html#job-parameter-pushdown) to pass information down to tasks.", "$ref": "#/$defs/map/string", "x-databricks-preview": "PRIVATE", "deprecationMessage": "This field is deprecated", @@ -7026,14 +7031,6 @@ "description": "Periodic trigger settings.", "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.PeriodicTriggerConfiguration" }, - "table": { - "description": "Old table trigger settings name. Deprecated in favor of `table_update`.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.TableUpdateTriggerConfiguration", - "x-databricks-preview": "PRIVATE", - "deprecationMessage": "This field is deprecated", - "doNotSuggest": true, - "deprecated": true - }, "table_update": { "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.TableUpdateTriggerConfiguration" } @@ -7170,7 +7167,7 @@ "oneOf": [ { "type": "string", - "description": "Days of week in which the restart is allowed to happen (within a five-hour window starting at start_hour).\nIf not specified all days of the week will be used.", + "description": "Days of week in which the window is allowed to happen.\nIf not specified all days of the week will be used.", "enum": [ "MONDAY", "TUESDAY", diff --git a/cmd/account/budgets/budgets.go b/cmd/account/budgets/budgets.go index c2911784a3..71c4621801 100755 --- a/cmd/account/budgets/budgets.go +++ b/cmd/account/budgets/budgets.go @@ -350,4 +350,4 @@ func newUpdate() *cobra.Command { return cmd } -// end service budgets +// end service Budgets diff --git a/cmd/account/cmd.go b/cmd/account/cmd.go index 077151954f..b0630a6428 100644 --- a/cmd/account/cmd.go +++ b/cmd/account/cmd.go @@ -39,6 +39,10 @@ import ( workspace_assignment "github.com/databricks/cli/cmd/account/workspace-assignment" workspace_network_configuration "github.com/databricks/cli/cmd/account/workspace-network-configuration" workspaces "github.com/databricks/cli/cmd/account/workspaces" + + account_groups "github.com/databricks/cli/cmd/account/groups" + account_service_principals "github.com/databricks/cli/cmd/account/service-principals" + account_users "github.com/databricks/cli/cmd/account/users" ) func New() *cobra.Command { @@ -50,11 +54,13 @@ func New() *cobra.Command { cmd.AddCommand(account_access_control.New()) cmd.AddCommand(billable_usage.New()) cmd.AddCommand(budget_policy.New()) + cmd.AddCommand(budgets.New()) cmd.AddCommand(credentials.New()) cmd.AddCommand(custom_app_integration.New()) cmd.AddCommand(encryption_keys.New()) cmd.AddCommand(account_federation_policy.New()) cmd.AddCommand(account_groups_v2.New()) + cmd.AddCommand(account_iam_v2.New()) cmd.AddCommand(account_ip_access_lists.New()) cmd.AddCommand(log_delivery.New()) cmd.AddCommand(account_metastore_assignments.New()) @@ -78,8 +84,10 @@ func New() *cobra.Command { cmd.AddCommand(workspace_assignment.New()) cmd.AddCommand(workspace_network_configuration.New()) cmd.AddCommand(workspaces.New()) - cmd.AddCommand(account_iam_v2.New()) - cmd.AddCommand(budgets.New()) + + cmd.AddCommand(account_groups.New()) + cmd.AddCommand(account_service_principals.New()) + cmd.AddCommand(account_users.New()) // Register command groups, filtering out empty groups or groups with only hidden commands. allGroups := Groups() diff --git a/cmd/account/iam-v2/iam-v2.go b/cmd/account/iam-v2/iam-v2.go index 528f8efcc9..89e7a2836e 100755 --- a/cmd/account/iam-v2/iam-v2.go +++ b/cmd/account/iam-v2/iam-v2.go @@ -93,6 +93,7 @@ func newGetWorkspaceAccessDetail() *cobra.Command { if err != nil { return fmt.Errorf("invalid WORKSPACE_ID: %s", args[0]) } + _, err = fmt.Sscan(args[1], &getWorkspaceAccessDetailReq.PrincipalId) if err != nil { return fmt.Errorf("invalid PRINCIPAL_ID: %s", args[1]) @@ -364,4 +365,4 @@ func newResolveUser() *cobra.Command { return cmd } -// end service account_iamV2 +// end service AccountIamV2 diff --git a/cmd/account/ip-access-lists/ip-access-lists.go b/cmd/account/ip-access-lists/ip-access-lists.go index 2063c5f86c..80b7d72857 100755 --- a/cmd/account/ip-access-lists/ip-access-lists.go +++ b/cmd/account/ip-access-lists/ip-access-lists.go @@ -148,6 +148,7 @@ func newCreate() *cobra.Command { if err != nil { return fmt.Errorf("invalid LIST_TYPE: %s", args[1]) } + } response, err := a.IpAccessLists.Create(ctx, createReq) @@ -425,12 +426,14 @@ func newReplace() *cobra.Command { if err != nil { return fmt.Errorf("invalid LIST_TYPE: %s", args[2]) } + } if !cmd.Flags().Changed("json") { _, err = fmt.Sscan(args[3], &replaceReq.Enabled) if err != nil { return fmt.Errorf("invalid ENABLED: %s", args[3]) } + } err = a.IpAccessLists.Replace(ctx, replaceReq) diff --git a/cmd/account/log-delivery/log-delivery.go b/cmd/account/log-delivery/log-delivery.go index 92b0c09b6e..747d183666 100755 --- a/cmd/account/log-delivery/log-delivery.go +++ b/cmd/account/log-delivery/log-delivery.go @@ -390,6 +390,7 @@ func newPatchStatus() *cobra.Command { if err != nil { return fmt.Errorf("invalid STATUS: %s", args[1]) } + } err = a.LogDelivery.PatchStatus(ctx, patchStatusReq) diff --git a/cmd/account/metastore-assignments/metastore-assignments.go b/cmd/account/metastore-assignments/metastore-assignments.go index 86fcc37120..b2b6886c75 100755 --- a/cmd/account/metastore-assignments/metastore-assignments.go +++ b/cmd/account/metastore-assignments/metastore-assignments.go @@ -101,6 +101,7 @@ func newCreate() *cobra.Command { if err != nil { return fmt.Errorf("invalid WORKSPACE_ID: %s", args[0]) } + createReq.MetastoreId = args[1] response, err := a.MetastoreAssignments.Create(ctx, createReq) @@ -163,6 +164,7 @@ func newDelete() *cobra.Command { if err != nil { return fmt.Errorf("invalid WORKSPACE_ID: %s", args[0]) } + deleteReq.MetastoreId = args[1] response, err := a.MetastoreAssignments.Delete(ctx, deleteReq) @@ -358,6 +360,7 @@ func newUpdate() *cobra.Command { if err != nil { return fmt.Errorf("invalid WORKSPACE_ID: %s", args[0]) } + updateReq.MetastoreId = args[1] response, err := a.MetastoreAssignments.Update(ctx, updateReq) diff --git a/cmd/account/service-principal-federation-policy/service-principal-federation-policy.go b/cmd/account/service-principal-federation-policy/service-principal-federation-policy.go index 132be7e958..e3968e27e9 100755 --- a/cmd/account/service-principal-federation-policy/service-principal-federation-policy.go +++ b/cmd/account/service-principal-federation-policy/service-principal-federation-policy.go @@ -216,6 +216,7 @@ func newDelete() *cobra.Command { if err != nil { return fmt.Errorf("invalid SERVICE_PRINCIPAL_ID: %s", args[0]) } + deleteReq.PolicyId = args[1] err = a.ServicePrincipalFederationPolicy.Delete(ctx, deleteReq) @@ -277,6 +278,7 @@ func newGet() *cobra.Command { if err != nil { return fmt.Errorf("invalid SERVICE_PRINCIPAL_ID: %s", args[0]) } + getReq.PolicyId = args[1] response, err := a.ServicePrincipalFederationPolicy.Get(ctx, getReq) @@ -417,6 +419,7 @@ func newUpdate() *cobra.Command { if err != nil { return fmt.Errorf("invalid SERVICE_PRINCIPAL_ID: %s", args[0]) } + updateReq.PolicyId = args[1] response, err := a.ServicePrincipalFederationPolicy.Update(ctx, updateReq) diff --git a/cmd/account/workspace-assignment/workspace-assignment.go b/cmd/account/workspace-assignment/workspace-assignment.go index ce6ff71765..340e11069d 100755 --- a/cmd/account/workspace-assignment/workspace-assignment.go +++ b/cmd/account/workspace-assignment/workspace-assignment.go @@ -85,6 +85,7 @@ func newDelete() *cobra.Command { if err != nil { return fmt.Errorf("invalid WORKSPACE_ID: %s", args[0]) } + _, err = fmt.Sscan(args[1], &deleteReq.PrincipalId) if err != nil { return fmt.Errorf("invalid PRINCIPAL_ID: %s", args[1]) @@ -283,6 +284,7 @@ func newUpdate() *cobra.Command { if err != nil { return fmt.Errorf("invalid WORKSPACE_ID: %s", args[0]) } + _, err = fmt.Sscan(args[1], &updateReq.PrincipalId) if err != nil { return fmt.Errorf("invalid PRINCIPAL_ID: %s", args[1]) diff --git a/cmd/account/workspaces/workspaces.go b/cmd/account/workspaces/workspaces.go index 5fc50b7385..6a360bcd48 100755 --- a/cmd/account/workspaces/workspaces.go +++ b/cmd/account/workspaces/workspaces.go @@ -86,6 +86,7 @@ func newCreate() *cobra.Command { // TODO: complex arg: gke_config cmd.Flags().StringVar(&createReq.Location, "location", createReq.Location, `The Google Cloud region of the workspace data plane in your Google account (for example, us-east4).`) cmd.Flags().StringVar(&createReq.ManagedServicesCustomerManagedKeyId, "managed-services-customer-managed-key-id", createReq.ManagedServicesCustomerManagedKeyId, `The ID of the workspace's managed services encryption key configuration object.`) + cmd.Flags().StringVar(&createReq.NetworkConnectivityConfigId, "network-connectivity-config-id", createReq.NetworkConnectivityConfigId, `The object ID of network connectivity config.`) cmd.Flags().StringVar(&createReq.NetworkId, "network-id", createReq.NetworkId, `The ID of the workspace's network configuration object.`) cmd.Flags().Var(&createReq.PricingTier, "pricing-tier", `Supported values: [ COMMUNITY_EDITION, diff --git a/cmd/workspace/alerts-v2/alerts-v2.go b/cmd/workspace/alerts-v2/alerts-v2.go index a02196ff0e..5101177c24 100755 --- a/cmd/workspace/alerts-v2/alerts-v2.go +++ b/cmd/workspace/alerts-v2/alerts-v2.go @@ -64,26 +64,35 @@ func newCreateAlert() *cobra.Command { cmd.Flags().StringVar(&createAlertReq.Alert.CustomDescription, "custom-description", createAlertReq.Alert.CustomDescription, `Custom description for the alert.`) cmd.Flags().StringVar(&createAlertReq.Alert.CustomSummary, "custom-summary", createAlertReq.Alert.CustomSummary, `Custom summary for the alert.`) - cmd.Flags().StringVar(&createAlertReq.Alert.DisplayName, "display-name", createAlertReq.Alert.DisplayName, `The display name of the alert.`) // TODO: complex arg: effective_run_as - // TODO: complex arg: evaluation cmd.Flags().StringVar(&createAlertReq.Alert.ParentPath, "parent-path", createAlertReq.Alert.ParentPath, `The workspace path of the folder containing the alert.`) - cmd.Flags().StringVar(&createAlertReq.Alert.QueryText, "query-text", createAlertReq.Alert.QueryText, `Text of the query to be run.`) // TODO: complex arg: run_as cmd.Flags().StringVar(&createAlertReq.Alert.RunAsUserName, "run-as-user-name", createAlertReq.Alert.RunAsUserName, `The run as username or application ID of service principal.`) - // TODO: complex arg: schedule - cmd.Flags().StringVar(&createAlertReq.Alert.WarehouseId, "warehouse-id", createAlertReq.Alert.WarehouseId, `ID of the SQL warehouse attached to the alert.`) - cmd.Use = "create-alert" + cmd.Use = "create-alert DISPLAY_NAME QUERY_TEXT WAREHOUSE_ID EVALUATION SCHEDULE" cmd.Short = `Create an alert.` cmd.Long = `Create an alert. - Create Alert` + Create Alert + + Arguments: + DISPLAY_NAME: The display name of the alert. + QUERY_TEXT: Text of the query to be run. + WAREHOUSE_ID: ID of the SQL warehouse attached to the alert. + EVALUATION: + SCHEDULE: ` cmd.Annotations = make(map[string]string) cmd.Args = func(cmd *cobra.Command, args []string) error { - check := root.ExactArgs(0) + if cmd.Flags().Changed("json") { + err := root.ExactArgs(0)(cmd, args) + if err != nil { + return fmt.Errorf("when --json flag is specified, no positional arguments are required. Provide 'display_name', 'query_text', 'warehouse_id', 'evaluation', 'schedule' in your JSON input") + } + return nil + } + check := root.ExactArgs(5) return check(cmd, args) } @@ -104,6 +113,29 @@ func newCreateAlert() *cobra.Command { } } } + if !cmd.Flags().Changed("json") { + createAlertReq.Alert.DisplayName = args[0] + } + if !cmd.Flags().Changed("json") { + createAlertReq.Alert.QueryText = args[1] + } + if !cmd.Flags().Changed("json") { + createAlertReq.Alert.WarehouseId = args[2] + } + if !cmd.Flags().Changed("json") { + _, err = fmt.Sscan(args[3], &createAlertReq.Alert.Evaluation) + if err != nil { + return fmt.Errorf("invalid EVALUATION: %s", args[3]) + } + + } + if !cmd.Flags().Changed("json") { + _, err = fmt.Sscan(args[4], &createAlertReq.Alert.Schedule) + if err != nil { + return fmt.Errorf("invalid SCHEDULE: %s", args[4]) + } + + } response, err := w.AlertsV2.CreateAlert(ctx, createAlertReq) if err != nil { @@ -327,17 +359,12 @@ func newUpdateAlert() *cobra.Command { cmd.Flags().StringVar(&updateAlertReq.Alert.CustomDescription, "custom-description", updateAlertReq.Alert.CustomDescription, `Custom description for the alert.`) cmd.Flags().StringVar(&updateAlertReq.Alert.CustomSummary, "custom-summary", updateAlertReq.Alert.CustomSummary, `Custom summary for the alert.`) - cmd.Flags().StringVar(&updateAlertReq.Alert.DisplayName, "display-name", updateAlertReq.Alert.DisplayName, `The display name of the alert.`) // TODO: complex arg: effective_run_as - // TODO: complex arg: evaluation cmd.Flags().StringVar(&updateAlertReq.Alert.ParentPath, "parent-path", updateAlertReq.Alert.ParentPath, `The workspace path of the folder containing the alert.`) - cmd.Flags().StringVar(&updateAlertReq.Alert.QueryText, "query-text", updateAlertReq.Alert.QueryText, `Text of the query to be run.`) // TODO: complex arg: run_as cmd.Flags().StringVar(&updateAlertReq.Alert.RunAsUserName, "run-as-user-name", updateAlertReq.Alert.RunAsUserName, `The run as username or application ID of service principal.`) - // TODO: complex arg: schedule - cmd.Flags().StringVar(&updateAlertReq.Alert.WarehouseId, "warehouse-id", updateAlertReq.Alert.WarehouseId, `ID of the SQL warehouse attached to the alert.`) - cmd.Use = "update-alert ID UPDATE_MASK" + cmd.Use = "update-alert ID UPDATE_MASK DISPLAY_NAME QUERY_TEXT WAREHOUSE_ID EVALUATION SCHEDULE" cmd.Short = `Update an alert.` cmd.Long = `Update an alert. @@ -355,12 +382,24 @@ func newUpdateAlert() *cobra.Command { A field mask of * indicates full replacement. It’s recommended to always explicitly list the fields being updated and avoid using * wildcards, as it can lead to unintended results if the API changes in the - future.` + future. + DISPLAY_NAME: The display name of the alert. + QUERY_TEXT: Text of the query to be run. + WAREHOUSE_ID: ID of the SQL warehouse attached to the alert. + EVALUATION: + SCHEDULE: ` cmd.Annotations = make(map[string]string) cmd.Args = func(cmd *cobra.Command, args []string) error { - check := root.ExactArgs(2) + if cmd.Flags().Changed("json") { + err := root.ExactArgs(2)(cmd, args) + if err != nil { + return fmt.Errorf("when --json flag is specified, provide only ID, UPDATE_MASK as positional arguments. Provide 'display_name', 'query_text', 'warehouse_id', 'evaluation', 'schedule' in your JSON input") + } + return nil + } + check := root.ExactArgs(7) return check(cmd, args) } @@ -383,6 +422,29 @@ func newUpdateAlert() *cobra.Command { } updateAlertReq.Id = args[0] updateAlertReq.UpdateMask = args[1] + if !cmd.Flags().Changed("json") { + updateAlertReq.Alert.DisplayName = args[2] + } + if !cmd.Flags().Changed("json") { + updateAlertReq.Alert.QueryText = args[3] + } + if !cmd.Flags().Changed("json") { + updateAlertReq.Alert.WarehouseId = args[4] + } + if !cmd.Flags().Changed("json") { + _, err = fmt.Sscan(args[5], &updateAlertReq.Alert.Evaluation) + if err != nil { + return fmt.Errorf("invalid EVALUATION: %s", args[5]) + } + + } + if !cmd.Flags().Changed("json") { + _, err = fmt.Sscan(args[6], &updateAlertReq.Alert.Schedule) + if err != nil { + return fmt.Errorf("invalid SCHEDULE: %s", args[6]) + } + + } response, err := w.AlertsV2.UpdateAlert(ctx, updateAlertReq) if err != nil { diff --git a/cmd/workspace/apps-settings/apps-settings.go b/cmd/workspace/apps-settings/apps-settings.go index 94cbd13299..23a6438e20 100755 --- a/cmd/workspace/apps-settings/apps-settings.go +++ b/cmd/workspace/apps-settings/apps-settings.go @@ -129,6 +129,7 @@ func newCreateCustomTemplate() *cobra.Command { if err != nil { return fmt.Errorf("invalid MANIFEST: %s", args[3]) } + } if !cmd.Flags().Changed("json") { createCustomTemplateReq.Template.GitProvider = args[4] @@ -396,6 +397,7 @@ func newUpdateCustomTemplate() *cobra.Command { if err != nil { return fmt.Errorf("invalid MANIFEST: %s", args[3]) } + } if !cmd.Flags().Changed("json") { updateCustomTemplateReq.Template.GitProvider = args[4] diff --git a/cmd/workspace/catalogs/catalogs.go b/cmd/workspace/catalogs/catalogs.go index f6234fd1e0..1beb5b2de8 100755 --- a/cmd/workspace/catalogs/catalogs.go +++ b/cmd/workspace/catalogs/catalogs.go @@ -294,8 +294,7 @@ func newList() *cobra.Command { PAGINATION BEHAVIOR: When using pagination (max_results >= 0), a page may contain zero results while still providing a next_page_token. Clients must continue reading pages until next_page_token is absent, which is the only - indication that the end of results has been reached. This behavior follows - Google AIP-158 guidelines.` + indication that the end of results has been reached.` cmd.Annotations = make(map[string]string) diff --git a/cmd/workspace/clean-room-asset-revisions/clean-room-asset-revisions.go b/cmd/workspace/clean-room-asset-revisions/clean-room-asset-revisions.go index 6900d7415f..69094be382 100755 --- a/cmd/workspace/clean-room-asset-revisions/clean-room-asset-revisions.go +++ b/cmd/workspace/clean-room-asset-revisions/clean-room-asset-revisions.go @@ -86,6 +86,7 @@ func newGet() *cobra.Command { if err != nil { return fmt.Errorf("invalid ASSET_TYPE: %s", args[1]) } + getReq.Name = args[2] getReq.Etag = args[3] @@ -154,6 +155,7 @@ func newList() *cobra.Command { if err != nil { return fmt.Errorf("invalid ASSET_TYPE: %s", args[1]) } + listReq.Name = args[2] response := w.CleanRoomAssetRevisions.List(ctx, listReq) diff --git a/cmd/workspace/clean-room-assets/clean-room-assets.go b/cmd/workspace/clean-room-assets/clean-room-assets.go index 5a1904550c..43a6af91ab 100755 --- a/cmd/workspace/clean-room-assets/clean-room-assets.go +++ b/cmd/workspace/clean-room-assets/clean-room-assets.go @@ -138,6 +138,7 @@ func newCreate() *cobra.Command { if err != nil { return fmt.Errorf("invalid ASSET_TYPE: %s", args[2]) } + } response, err := w.CleanRoomAssets.Create(ctx, createReq) @@ -219,6 +220,7 @@ func newCreateCleanRoomAssetReview() *cobra.Command { if err != nil { return fmt.Errorf("invalid ASSET_TYPE: %s", args[1]) } + createCleanRoomAssetReviewReq.Name = args[2] response, err := w.CleanRoomAssets.CreateCleanRoomAssetReview(ctx, createCleanRoomAssetReviewReq) @@ -284,6 +286,7 @@ func newDelete() *cobra.Command { if err != nil { return fmt.Errorf("invalid ASSET_TYPE: %s", args[1]) } + deleteReq.Name = args[2] err = w.CleanRoomAssets.Delete(ctx, deleteReq) @@ -349,6 +352,7 @@ func newGet() *cobra.Command { if err != nil { return fmt.Errorf("invalid ASSET_TYPE: %s", args[1]) } + getReq.Name = args[2] response, err := w.CleanRoomAssets.Get(ctx, getReq) @@ -500,6 +504,7 @@ func newUpdate() *cobra.Command { if err != nil { return fmt.Errorf("invalid ASSET_TYPE: %s", args[1]) } + updateReq.Name = args[2] response, err := w.CleanRoomAssets.Update(ctx, updateReq) diff --git a/cmd/workspace/cluster-policies/cluster-policies.go b/cmd/workspace/cluster-policies/cluster-policies.go index 03fc1f5d76..5423ec37c4 100755 --- a/cmd/workspace/cluster-policies/cluster-policies.go +++ b/cmd/workspace/cluster-policies/cluster-policies.go @@ -324,6 +324,7 @@ func newEdit() *cobra.Command { return fmt.Errorf("expected to have the id of the policy to update") } editReq.PolicyId = args[0] + } err = w.ClusterPolicies.Edit(ctx, editReq) diff --git a/cmd/workspace/clusters/clusters.go b/cmd/workspace/clusters/clusters.go index 72cbe890d3..9d99e81062 100755 --- a/cmd/workspace/clusters/clusters.go +++ b/cmd/workspace/clusters/clusters.go @@ -691,6 +691,7 @@ func newEvents() *cobra.Command { return fmt.Errorf("expected to have the id of the cluster to retrieve events about") } eventsReq.ClusterId = args[0] + } response := w.Clusters.Events(ctx, eventsReq) @@ -1334,6 +1335,7 @@ func newResize() *cobra.Command { return fmt.Errorf("expected to have the cluster to be resized") } resizeReq.ClusterId = args[0] + } wait, err := w.Clusters.Resize(ctx, resizeReq) @@ -1450,6 +1452,7 @@ func newRestart() *cobra.Command { return fmt.Errorf("expected to have the cluster to be started") } restartReq.ClusterId = args[0] + } wait, err := w.Clusters.Restart(ctx, restartReq) diff --git a/cmd/workspace/cmd.go b/cmd/workspace/cmd.go index 14d8901f09..fbe23fb6c5 100755 --- a/cmd/workspace/cmd.go +++ b/cmd/workspace/cmd.go @@ -163,6 +163,7 @@ func All() []*cobra.Command { out = append(out, external_metadata.New()) out = append(out, feature_engineering.New()) out = append(out, feature_store.New()) + out = append(out, forecasting.New()) out = append(out, functions.New()) out = append(out, genie.New()) out = append(out, git_credentials.New()) @@ -236,9 +237,8 @@ func All() []*cobra.Command { out = append(out, workspace.New()) out = append(out, workspace_bindings.New()) out = append(out, workspace_conf.New()) - out = append(out, workspace_settings_v2.New()) - out = append(out, forecasting.New()) out = append(out, workspace_iam_v2.New()) + out = append(out, workspace_settings_v2.New()) out = append(out, groups.New()) out = append(out, service_principals.New()) diff --git a/cmd/workspace/connections/connections.go b/cmd/workspace/connections/connections.go index 71ec58f7c2..7698c5d9e9 100755 --- a/cmd/workspace/connections/connections.go +++ b/cmd/workspace/connections/connections.go @@ -291,8 +291,7 @@ func newList() *cobra.Command { PAGINATION BEHAVIOR: When using pagination (max_results >= 0), a page may contain zero results while still providing a next_page_token. Clients must continue reading pages until next_page_token is absent, which is the only - indication that the end of results has been reached. This behavior follows - Google AIP-158 guidelines.` + indication that the end of results has been reached.` cmd.Annotations = make(map[string]string) diff --git a/cmd/workspace/credentials/credentials.go b/cmd/workspace/credentials/credentials.go index 2f7504ed23..578e4fdf22 100755 --- a/cmd/workspace/credentials/credentials.go +++ b/cmd/workspace/credentials/credentials.go @@ -378,7 +378,12 @@ func newListCredentials() *cobra.Command { The array is limited to only the credentials that the caller has permission to access. If the caller is a metastore admin, retrieval of credentials is unrestricted. There is no guarantee of a specific ordering of the elements in - the array.` + the array. + + PAGINATION BEHAVIOR: The API is by default paginated, a page may contain zero + results while still providing a next_page_token. Clients must continue reading + pages until next_page_token is absent, which is the only indication that the + end of results has been reached.` cmd.Annotations = make(map[string]string) diff --git a/cmd/workspace/data-quality/data-quality.go b/cmd/workspace/data-quality/data-quality.go index 2d25620380..304bd231c8 100755 --- a/cmd/workspace/data-quality/data-quality.go +++ b/cmd/workspace/data-quality/data-quality.go @@ -27,10 +27,7 @@ func New() *cobra.Command { Annotations: map[string]string{ "package": "dataquality", }, - - // This service is being previewed; hide from help output. - Hidden: true, - RunE: root.ReportUnknownSubcommand, + RunE: root.ReportUnknownSubcommand, } // Add methods @@ -73,12 +70,33 @@ func newCancelRefresh() *cobra.Command { cmd.Long = `Cancel a refresh. Cancels a data quality monitor refresh. Currently only supported for the - table object_type. + table object_type. The call must be made in the same workspace as where + the monitor was created. + + The caller must have either of the following sets of permissions: 1. + **MANAGE** and **USE_CATALOG** on the table's parent catalog. 2. + **USE_CATALOG** on the table's parent catalog, and **MANAGE** and + **USE_SCHEMA** on the table's parent schema. 3. **USE_CATALOG** on the table's + parent catalog, **USE_SCHEMA** on the table's parent schema, and **MANAGE** on + the table. Arguments: OBJECT_TYPE: The type of the monitored object. Can be one of the following: schema or table. - OBJECT_ID: The UUID of the request object. For example, schema id. + OBJECT_ID: The UUID of the request object. It is schema_id for schema, and + table_id for table. + + Find the schema_id from either: 1. The [schema_id] of the Schemas + resource. 2. In [Catalog Explorer] > select the schema > go to the + Details tab > the Schema ID field. + + Find the table_id from either: 1. The [table_id] of the Tables + resource. 2. In [Catalog Explorer] > select the table > go to the + Details tab > the Table ID field. + + [Catalog Explorer]: https://docs.databricks.com/aws/en/catalog-explorer/ + [schema_id]: https://docs.databricks.com/api/workspace/schemas/get#schema_id + [table_id]: https://docs.databricks.com/api/workspace/tables/get#table_id REFRESH_ID: Unique id of the refresh operation.` cmd.Annotations = make(map[string]string) @@ -148,21 +166,39 @@ func newCreateMonitor() *cobra.Command { provide either anomaly_detection_config for a schema monitor or data_profiling_config for a table monitor. - For the table object_type, the caller must either: 1. be an owner of the - table's parent catalog, have **USE_SCHEMA** on the table's parent schema, and - have **SELECT** access on the table 2. have **USE_CATALOG** on the table's - parent catalog, be an owner of the table's parent schema, and have **SELECT** - access on the table. 3. have the following permissions: - **USE_CATALOG** on - the table's parent catalog - **USE_SCHEMA** on the table's parent schema - be - an owner of the table. + For the table object_type, the caller must have either of the following + sets of permissions: 1. **MANAGE** and **USE_CATALOG** on the table's parent + catalog, **USE_SCHEMA** on the table's parent schema, and **SELECT** on the + table 2. **USE_CATALOG** on the table's parent catalog, **MANAGE** and + **USE_SCHEMA** on the table's parent schema, and **SELECT** on the table. 3. + **USE_CATALOG** on the table's parent catalog, **USE_SCHEMA** on the table's + parent schema, and **MANAGE** and **SELECT** on the table. Workspace assets, such as the dashboard, will be created in the workspace where this call was made. + + For the schema object_type, the caller must have either of the following + sets of permissions: 1. **MANAGE** and **USE_CATALOG** on the schema's parent + catalog. 2. **USE_CATALOG** on the schema's parent catalog, and **MANAGE** and + **USE_SCHEMA** on the schema. Arguments: OBJECT_TYPE: The type of the monitored object. Can be one of the following: schema or table. - OBJECT_ID: The UUID of the request object. For example, schema id.` + OBJECT_ID: The UUID of the request object. It is schema_id for schema, and + table_id for table. + + Find the schema_id from either: 1. The [schema_id] of the Schemas + resource. 2. In [Catalog Explorer] > select the schema > go to the + Details tab > the Schema ID field. + + Find the table_id from either: 1. The [table_id] of the Tables + resource. 2. In [Catalog Explorer] > select the table > go to the + Details tab > the Table ID field. + + [Catalog Explorer]: https://docs.databricks.com/aws/en/catalog-explorer/ + [schema_id]: https://docs.databricks.com/api/workspace/schemas/get#schema_id + [table_id]: https://docs.databricks.com/api/workspace/tables/get#table_id` cmd.Annotations = make(map[string]string) @@ -243,18 +279,33 @@ func newCreateRefresh() *cobra.Command { cmd.Short = `Create a refresh.` cmd.Long = `Create a refresh. - Creates a refresh. Currently only supported for the table object_type. + Creates a refresh. Currently only supported for the table object_type. The + call must be made in the same workspace as where the monitor was created. - The caller must either: 1. be an owner of the table's parent catalog 2. have - **USE_CATALOG** on the table's parent catalog and be an owner of the table's - parent schema 3. have the following permissions: - **USE_CATALOG** on the - table's parent catalog - **USE_SCHEMA** on the table's parent schema - be an - owner of the table + The caller must have either of the following sets of permissions: 1. + **MANAGE** and **USE_CATALOG** on the table's parent catalog. 2. + **USE_CATALOG** on the table's parent catalog, and **MANAGE** and + **USE_SCHEMA** on the table's parent schema. 3. **USE_CATALOG** on the table's + parent catalog, **USE_SCHEMA** on the table's parent schema, and **MANAGE** on + the table. Arguments: OBJECT_TYPE: The type of the monitored object. Can be one of the following: schemaor table. - OBJECT_ID: The UUID of the request object. For example, table id.` + OBJECT_ID: The UUID of the request object. It is schema_id for schema, and + table_id for table. + + Find the schema_id from either: 1. The [schema_id] of the Schemas + resource. 2. In [Catalog Explorer] > select the schema > go to the + Details tab > the Schema ID field. + + Find the table_id from either: 1. The [table_id] of the Tables + resource. 2. In [Catalog Explorer] > select the table > go to the + Details tab > the Table ID field. + + [Catalog Explorer]: https://docs.databricks.com/aws/en/catalog-explorer/ + [schema_id]: https://docs.databricks.com/api/workspace/schemas/get#schema_id + [table_id]: https://docs.databricks.com/api/workspace/tables/get#table_id` cmd.Annotations = make(map[string]string) @@ -322,19 +373,38 @@ func newDeleteMonitor() *cobra.Command { Delete a data quality monitor on Unity Catalog object. - For the table object_type, the caller must either: 1. be an owner of the - table's parent catalog 2. have **USE_CATALOG** on the table's parent catalog - and be an owner of the table's parent schema 3. have the following - permissions: - **USE_CATALOG** on the table's parent catalog - **USE_SCHEMA** - on the table's parent schema - be an owner of the table. + For the table object_type, the caller must have either of the following + sets of permissions: **MANAGE** and **USE_CATALOG** on the table's parent + catalog. **USE_CATALOG** on the table's parent catalog, and **MANAGE** and + **USE_SCHEMA** on the table's parent schema. **USE_CATALOG** on the table's + parent catalog, **USE_SCHEMA** on the table's parent schema, and **MANAGE** on + the table. Note that the metric tables and dashboard will not be deleted as part of this call; those assets must be manually cleaned up (if desired). + + For the schema object_type, the caller must have either of the following + sets of permissions: 1. **MANAGE** and **USE_CATALOG** on the schema's parent + catalog. 2. **USE_CATALOG** on the schema's parent catalog, and **MANAGE** and + **USE_SCHEMA** on the schema. Arguments: OBJECT_TYPE: The type of the monitored object. Can be one of the following: schema or table. - OBJECT_ID: The UUID of the request object. For example, schema id.` + OBJECT_ID: The UUID of the request object. It is schema_id for schema, and + table_id for table. + + Find the schema_id from either: 1. The [schema_id] of the Schemas + resource. 2. In [Catalog Explorer] > select the schema > go to the + Details tab > the Schema ID field. + + Find the table_id from either: 1. The [table_id] of the Tables + resource. 2. In [Catalog Explorer] > select the table > go to the + Details tab > the Table ID field. + + [Catalog Explorer]: https://docs.databricks.com/aws/en/catalog-explorer/ + [schema_id]: https://docs.databricks.com/api/workspace/schemas/get#schema_id + [table_id]: https://docs.databricks.com/api/workspace/tables/get#table_id` cmd.Annotations = make(map[string]string) @@ -393,7 +463,20 @@ func newDeleteRefresh() *cobra.Command { Arguments: OBJECT_TYPE: The type of the monitored object. Can be one of the following: schema or table. - OBJECT_ID: The UUID of the request object. For example, schema id. + OBJECT_ID: The UUID of the request object. It is schema_id for schema, and + table_id for table. + + Find the schema_id from either: 1. The [schema_id] of the Schemas + resource. 2. In [Catalog Explorer] > select the schema > go to the + Details tab > the Schema ID field. + + Find the table_id from either: 1. The [table_id] of the Tables + resource. 2. In [Catalog Explorer] > select the table > go to the + Details tab > the Table ID field. + + [Catalog Explorer]: https://docs.databricks.com/aws/en/catalog-explorer/ + [schema_id]: https://docs.databricks.com/api/workspace/schemas/get#schema_id + [table_id]: https://docs.databricks.com/api/workspace/tables/get#table_id REFRESH_ID: Unique id of the refresh operation.` cmd.Annotations = make(map[string]string) @@ -452,23 +535,42 @@ func newGetMonitor() *cobra.Command { cmd.Short = `Read a monitor.` cmd.Long = `Read a monitor. - Read a data quality monitor on Unity Catalog object. + Read a data quality monitor on a Unity Catalog object. + + For the table object_type, the caller must have either of the following + sets of permissions: 1. **MANAGE** and **USE_CATALOG** on the table's parent + catalog. 2. **USE_CATALOG** on the table's parent catalog, and **MANAGE** and + **USE_SCHEMA** on the table's parent schema. 3. **USE_CATALOG** on the table's + parent catalog, **USE_SCHEMA** on the table's parent schema, and **SELECT** on + the table. - For the table object_type, the caller must either: 1. be an owner of the - table's parent catalog 2. have **USE_CATALOG** on the table's parent catalog - and be an owner of the table's parent schema. 3. have the following - permissions: - **USE_CATALOG** on the table's parent catalog - **USE_SCHEMA** - on the table's parent schema - **SELECT** privilege on the table. + For the schema object_type, the caller must have either of the following + sets of permissions: 1. **MANAGE** and **USE_CATALOG** on the schema's parent + catalog. 2. **USE_CATALOG** on the schema's parent catalog, and **USE_SCHEMA** + on the schema. - The returned information includes configuration values, as well as information - on assets created by the monitor. Some information (e.g., dashboard) may be - filtered out if the caller is in a different workspace than where the monitor - was created. + The returned information includes configuration values on the entity and + parent entity as well as information on assets created by the monitor. Some + information (e.g. dashboard) may be filtered out if the caller is in a + different workspace than where the monitor was created. Arguments: OBJECT_TYPE: The type of the monitored object. Can be one of the following: schema or table. - OBJECT_ID: The UUID of the request object. For example, schema id.` + OBJECT_ID: The UUID of the request object. It is schema_id for schema, and + table_id for table. + + Find the schema_id from either: 1. The [schema_id] of the Schemas + resource. 2. In [Catalog Explorer] > select the schema > go to the + Details tab > the Schema ID field. + + Find the table_id from either: 1. The [table_id] of the Tables + resource. 2. In [Catalog Explorer] > select the table > go to the + Details tab > the Table ID field. + + [Catalog Explorer]: https://docs.databricks.com/aws/en/catalog-explorer/ + [schema_id]: https://docs.databricks.com/api/workspace/schemas/get#schema_id + [table_id]: https://docs.databricks.com/api/workspace/tables/get#table_id` cmd.Annotations = make(map[string]string) @@ -522,18 +624,38 @@ func newGetRefresh() *cobra.Command { cmd.Short = `Get a refresh.` cmd.Long = `Get a refresh. - Get data quality monitor refresh. + Get data quality monitor refresh. The call must be made in the same workspace + as where the monitor was created. - For the table object_type, the caller must either: 1. be an owner of the - table's parent catalog 2. have **USE_CATALOG** on the table's parent catalog - and be an owner of the table's parent schema 3. have the following - permissions: - **USE_CATALOG** on the table's parent catalog - **USE_SCHEMA** - on the table's parent schema - **SELECT** privilege on the table. + For the table object_type, the caller must have either of the following + sets of permissions: 1. **MANAGE** and **USE_CATALOG** on the table's parent + catalog. 2. **USE_CATALOG** on the table's parent catalog, and **MANAGE** and + **USE_SCHEMA** on the table's parent schema. 3. **USE_CATALOG** on the table's + parent catalog, **USE_SCHEMA** on the table's parent schema, and **SELECT** on + the table. + + For the schema object_type, the caller must have either of the following + sets of permissions: 1. **MANAGE** and **USE_CATALOG** on the schema's parent + catalog. 2. **USE_CATALOG** on the schema's parent catalog, and **USE_SCHEMA** + on the schema. Arguments: OBJECT_TYPE: The type of the monitored object. Can be one of the following: schema or table. - OBJECT_ID: The UUID of the request object. For example, schema id. + OBJECT_ID: The UUID of the request object. It is schema_id for schema, and + table_id for table. + + Find the schema_id from either: 1. The [schema_id] of the Schemas + resource. 2. In [Catalog Explorer] > select the schema > go to the + Details tab > the Schema ID field. + + Find the table_id from either: 1. The [table_id] of the Tables + resource. 2. In [Catalog Explorer] > select the table > go to the + Details tab > the Table ID field. + + [Catalog Explorer]: https://docs.databricks.com/aws/en/catalog-explorer/ + [schema_id]: https://docs.databricks.com/api/workspace/schemas/get#schema_id + [table_id]: https://docs.databricks.com/api/workspace/tables/get#table_id REFRESH_ID: Unique id of the refresh operation.` cmd.Annotations = make(map[string]string) @@ -646,18 +768,38 @@ func newListRefresh() *cobra.Command { cmd.Short = `List refreshes.` cmd.Long = `List refreshes. - List data quality monitor refreshes. + List data quality monitor refreshes. The call must be made in the same + workspace as where the monitor was created. + + For the table object_type, the caller must have either of the following + sets of permissions: 1. **MANAGE** and **USE_CATALOG** on the table's parent + catalog. 2. **USE_CATALOG** on the table's parent catalog, and **MANAGE** and + **USE_SCHEMA** on the table's parent schema. 3. **USE_CATALOG** on the table's + parent catalog, **USE_SCHEMA** on the table's parent schema, and **SELECT** on + the table. - For the table object_type, the caller must either: 1. be an owner of the - table's parent catalog 2. have **USE_CATALOG** on the table's parent catalog - and be an owner of the table's parent schema 3. have the following - permissions: - **USE_CATALOG** on the table's parent catalog - **USE_SCHEMA** - on the table's parent schema - **SELECT** privilege on the table. + For the schema object_type, the caller must have either of the following + sets of permissions: 1. **MANAGE** and **USE_CATALOG** on the schema's parent + catalog. 2. **USE_CATALOG** on the schema's parent catalog, and **USE_SCHEMA** + on the schema. Arguments: OBJECT_TYPE: The type of the monitored object. Can be one of the following: schema or table. - OBJECT_ID: The UUID of the request object. For example, schema id.` + OBJECT_ID: The UUID of the request object. It is schema_id for schema, and + table_id for table. + + Find the schema_id from either: 1. The [schema_id] of the Schemas + resource. 2. In [Catalog Explorer] > select the schema > go to the + Details tab > the Schema ID field. + + Find the table_id from either: 1. The [table_id] of the Tables + resource. 2. In [Catalog Explorer] > select the table > go to the + Details tab > the Table ID field. + + [Catalog Explorer]: https://docs.databricks.com/aws/en/catalog-explorer/ + [schema_id]: https://docs.databricks.com/api/workspace/schemas/get#schema_id + [table_id]: https://docs.databricks.com/api/workspace/tables/get#table_id` cmd.Annotations = make(map[string]string) @@ -717,22 +859,54 @@ func newUpdateMonitor() *cobra.Command { Update a data quality monitor on Unity Catalog object. - For the table object_type, The caller must either: 1. be an owner of the - table's parent catalog 2. have **USE_CATALOG** on the table's parent catalog - and be an owner of the table's parent schema 3. have the following - permissions: - **USE_CATALOG** on the table's parent catalog - **USE_SCHEMA** - on the table's parent schema - be an owner of the table. + For the table object_type, the caller must have either of the following + sets of permissions: 1. **MANAGE** and **USE_CATALOG** on the table's parent + catalog. 2. **USE_CATALOG** on the table's parent catalog, and **MANAGE** and + **USE_SCHEMA** on the table's parent schema. 3. **USE_CATALOG** on the table's + parent catalog, **USE_SCHEMA** on the table's parent schema, and **MANAGE** on + the table. + + For the schema object_type, the caller must have either of the following + sets of permissions: 1. **MANAGE** and **USE_CATALOG** on the schema's parent + catalog. 2. **USE_CATALOG** on the schema's parent catalog, and **MANAGE** and + **USE_SCHEMA** on the schema. Arguments: OBJECT_TYPE: The type of the monitored object. Can be one of the following: schema or table. - OBJECT_ID: The UUID of the request object. For example, schema id. + OBJECT_ID: The UUID of the request object. It is schema_id for schema, and + table_id for table. + + Find the schema_id from either: 1. The [schema_id] of the Schemas + resource. 2. In [Catalog Explorer] > select the schema > go to the + Details tab > the Schema ID field. + + Find the table_id from either: 1. The [table_id] of the Tables + resource. 2. In [Catalog Explorer] > select the table > go to the + Details tab > the Table ID field. + + [Catalog Explorer]: https://docs.databricks.com/aws/en/catalog-explorer/ + [schema_id]: https://docs.databricks.com/api/workspace/schemas/get#schema_id + [table_id]: https://docs.databricks.com/api/workspace/tables/get#table_id UPDATE_MASK: The field mask to specify which fields to update as a comma-separated list. Example value: data_profiling_config.custom_metrics,data_profiling_config.schedule.quartz_cron_expression OBJECT_TYPE: The type of the monitored object. Can be one of the following: schema or table. - OBJECT_ID: The UUID of the request object. For example, schema id.` + OBJECT_ID: The UUID of the request object. It is schema_id for schema, and + table_id for table. + + Find the schema_id from either: 1. The [schema_id] of the Schemas + resource. 2. In [Catalog Explorer] > select the schema > go to the + Details tab > the Schema ID field. + + Find the table_id from either: 1. The [table_id] of the Tables + resource. 2. In [Catalog Explorer] > select the table > go to the + Details tab > the Table ID field. + + [Catalog Explorer]: https://docs.databricks.com/aws/en/catalog-explorer/ + [schema_id]: https://docs.databricks.com/api/workspace/schemas/get#schema_id + [table_id]: https://docs.databricks.com/api/workspace/tables/get#table_id` cmd.Annotations = make(map[string]string) @@ -821,12 +995,38 @@ func newUpdateRefresh() *cobra.Command { Arguments: OBJECT_TYPE: The type of the monitored object. Can be one of the following: schema or table. - OBJECT_ID: The UUID of the request object. For example, schema id. + OBJECT_ID: The UUID of the request object. It is schema_id for schema, and + table_id for table. + + Find the schema_id from either: 1. The [schema_id] of the Schemas + resource. 2. In [Catalog Explorer] > select the schema > go to the + Details tab > the Schema ID field. + + Find the table_id from either: 1. The [table_id] of the Tables + resource. 2. In [Catalog Explorer] > select the table > go to the + Details tab > the Table ID field. + + [Catalog Explorer]: https://docs.databricks.com/aws/en/catalog-explorer/ + [schema_id]: https://docs.databricks.com/api/workspace/schemas/get#schema_id + [table_id]: https://docs.databricks.com/api/workspace/tables/get#table_id REFRESH_ID: Unique id of the refresh operation. UPDATE_MASK: The field mask to specify which fields to update. OBJECT_TYPE: The type of the monitored object. Can be one of the following: schemaor table. - OBJECT_ID: The UUID of the request object. For example, table id.` + OBJECT_ID: The UUID of the request object. It is schema_id for schema, and + table_id for table. + + Find the schema_id from either: 1. The [schema_id] of the Schemas + resource. 2. In [Catalog Explorer] > select the schema > go to the + Details tab > the Schema ID field. + + Find the table_id from either: 1. The [table_id] of the Tables + resource. 2. In [Catalog Explorer] > select the table > go to the + Details tab > the Table ID field. + + [Catalog Explorer]: https://docs.databricks.com/aws/en/catalog-explorer/ + [schema_id]: https://docs.databricks.com/api/workspace/schemas/get#schema_id + [table_id]: https://docs.databricks.com/api/workspace/tables/get#table_id` cmd.Annotations = make(map[string]string) @@ -865,6 +1065,7 @@ func newUpdateRefresh() *cobra.Command { if err != nil { return fmt.Errorf("invalid REFRESH_ID: %s", args[2]) } + updateRefreshReq.UpdateMask = args[3] if !cmd.Flags().Changed("json") { updateRefreshReq.Refresh.ObjectType = args[4] diff --git a/cmd/workspace/entity-tag-assignments/entity-tag-assignments.go b/cmd/workspace/entity-tag-assignments/entity-tag-assignments.go index 392f9728d5..7dffa32804 100755 --- a/cmd/workspace/entity-tag-assignments/entity-tag-assignments.go +++ b/cmd/workspace/entity-tag-assignments/entity-tag-assignments.go @@ -304,6 +304,11 @@ func newList() *cobra.Command { cmd.Long = `List entity tag assignments. List tag assignments for an Unity Catalog entity + + PAGINATION BEHAVIOR: The API is by default paginated, a page may contain zero + results while still providing a next_page_token. Clients must continue reading + pages until next_page_token is absent, which is the only indication that the + end of results has been reached. Arguments: ENTITY_TYPE: The type of the entity to which the tag is assigned. Allowed values are: diff --git a/cmd/workspace/experiments/experiments.go b/cmd/workspace/experiments/experiments.go index 56c3fd1374..3b877589e7 100755 --- a/cmd/workspace/experiments/experiments.go +++ b/cmd/workspace/experiments/experiments.go @@ -678,6 +678,7 @@ func newDeleteRuns() *cobra.Command { if err != nil { return fmt.Errorf("invalid MAX_TIMESTAMP_MILLIS: %s", args[1]) } + } response, err := w.Experiments.DeleteRuns(ctx, deleteRunsReq) @@ -849,6 +850,7 @@ func newFinalizeLoggedModel() *cobra.Command { if err != nil { return fmt.Errorf("invalid STATUS: %s", args[1]) } + } response, err := w.Experiments.FinalizeLoggedModel(ctx, finalizeLoggedModelReq) @@ -1737,12 +1739,14 @@ func newLogMetric() *cobra.Command { if err != nil { return fmt.Errorf("invalid VALUE: %s", args[1]) } + } if !cmd.Flags().Changed("json") { _, err = fmt.Sscan(args[2], &logMetricReq.Timestamp) if err != nil { return fmt.Errorf("invalid TIMESTAMP: %s", args[2]) } + } err = w.Experiments.LogMetric(ctx, logMetricReq) @@ -2251,6 +2255,7 @@ func newRestoreRuns() *cobra.Command { if err != nil { return fmt.Errorf("invalid MIN_TIMESTAMP_MILLIS: %s", args[1]) } + } response, err := w.Experiments.RestoreRuns(ctx, restoreRunsReq) diff --git a/cmd/workspace/external-lineage/external-lineage.go b/cmd/workspace/external-lineage/external-lineage.go index 53c6b83834..ea0e7a6ef7 100755 --- a/cmd/workspace/external-lineage/external-lineage.go +++ b/cmd/workspace/external-lineage/external-lineage.go @@ -117,12 +117,14 @@ func newCreateExternalLineageRelationship() *cobra.Command { if err != nil { return fmt.Errorf("invalid SOURCE: %s", args[0]) } + } if !cmd.Flags().Changed("json") { _, err = fmt.Sscan(args[1], &createExternalLineageRelationshipReq.ExternalLineageRelationship.Target) if err != nil { return fmt.Errorf("invalid TARGET: %s", args[1]) } + } response, err := w.ExternalLineage.CreateExternalLineageRelationship(ctx, createExternalLineageRelationshipReq) @@ -354,12 +356,14 @@ func newUpdateExternalLineageRelationship() *cobra.Command { if err != nil { return fmt.Errorf("invalid SOURCE: %s", args[1]) } + } if !cmd.Flags().Changed("json") { _, err = fmt.Sscan(args[2], &updateExternalLineageRelationshipReq.ExternalLineageRelationship.Target) if err != nil { return fmt.Errorf("invalid TARGET: %s", args[2]) } + } response, err := w.ExternalLineage.UpdateExternalLineageRelationship(ctx, updateExternalLineageRelationshipReq) diff --git a/cmd/workspace/external-locations/external-locations.go b/cmd/workspace/external-locations/external-locations.go index 14dffa1769..63c6f4e8c6 100755 --- a/cmd/workspace/external-locations/external-locations.go +++ b/cmd/workspace/external-locations/external-locations.go @@ -307,8 +307,7 @@ func newList() *cobra.Command { PAGINATION BEHAVIOR: When using pagination (max_results >= 0), a page may contain zero results while still providing a next_page_token. Clients must continue reading pages until next_page_token is absent, which is the only - indication that the end of results has been reached. This behavior follows - Google AIP-158 guidelines.` + indication that the end of results has been reached.` cmd.Annotations = make(map[string]string) diff --git a/cmd/workspace/external-metadata/external-metadata.go b/cmd/workspace/external-metadata/external-metadata.go index d11a36387c..0c3cb1211f 100755 --- a/cmd/workspace/external-metadata/external-metadata.go +++ b/cmd/workspace/external-metadata/external-metadata.go @@ -151,6 +151,7 @@ func newCreateExternalMetadata() *cobra.Command { if err != nil { return fmt.Errorf("invalid SYSTEM_TYPE: %s", args[1]) } + } if !cmd.Flags().Changed("json") { createExternalMetadataReq.ExternalMetadata.EntityType = args[2] @@ -453,6 +454,7 @@ func newUpdateExternalMetadata() *cobra.Command { if err != nil { return fmt.Errorf("invalid SYSTEM_TYPE: %s", args[2]) } + } if !cmd.Flags().Changed("json") { updateExternalMetadataReq.ExternalMetadata.EntityType = args[3] diff --git a/cmd/workspace/feature-engineering/feature-engineering.go b/cmd/workspace/feature-engineering/feature-engineering.go index e69ce789d0..39d003a1f2 100755 --- a/cmd/workspace/feature-engineering/feature-engineering.go +++ b/cmd/workspace/feature-engineering/feature-engineering.go @@ -34,10 +34,15 @@ func New() *cobra.Command { // Add methods cmd.AddCommand(newCreateFeature()) + cmd.AddCommand(newCreateMaterializedFeature()) cmd.AddCommand(newDeleteFeature()) + cmd.AddCommand(newDeleteMaterializedFeature()) cmd.AddCommand(newGetFeature()) + cmd.AddCommand(newGetMaterializedFeature()) cmd.AddCommand(newListFeatures()) + cmd.AddCommand(newListMaterializedFeatures()) cmd.AddCommand(newUpdateFeature()) + cmd.AddCommand(newUpdateMaterializedFeature()) // Apply optional overrides to this command. for _, fn := range cmdOverrides { @@ -66,6 +71,7 @@ func newCreateFeature() *cobra.Command { cmd.Flags().Var(&createFeatureJson, "json", `either inline JSON string or @path/to/file.json with request body`) cmd.Flags().StringVar(&createFeatureReq.Feature.Description, "description", createFeatureReq.Feature.Description, `The description of the feature.`) + cmd.Flags().StringVar(&createFeatureReq.Feature.FilterCondition, "filter-condition", createFeatureReq.Feature.FilterCondition, `The filter condition applied to the source data before aggregation.`) cmd.Use = "create-feature FULL_NAME SOURCE INPUTS FUNCTION TIME_WINDOW" cmd.Short = `Create a feature.` @@ -119,24 +125,28 @@ func newCreateFeature() *cobra.Command { if err != nil { return fmt.Errorf("invalid SOURCE: %s", args[1]) } + } if !cmd.Flags().Changed("json") { _, err = fmt.Sscan(args[2], &createFeatureReq.Feature.Inputs) if err != nil { return fmt.Errorf("invalid INPUTS: %s", args[2]) } + } if !cmd.Flags().Changed("json") { _, err = fmt.Sscan(args[3], &createFeatureReq.Feature.Function) if err != nil { return fmt.Errorf("invalid FUNCTION: %s", args[3]) } + } if !cmd.Flags().Changed("json") { _, err = fmt.Sscan(args[4], &createFeatureReq.Feature.TimeWindow) if err != nil { return fmt.Errorf("invalid TIME_WINDOW: %s", args[4]) } + } response, err := w.FeatureEngineering.CreateFeature(ctx, createFeatureReq) @@ -158,6 +168,89 @@ func newCreateFeature() *cobra.Command { return cmd } +// start create-materialized-feature 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 createMaterializedFeatureOverrides []func( + *cobra.Command, + *ml.CreateMaterializedFeatureRequest, +) + +func newCreateMaterializedFeature() *cobra.Command { + cmd := &cobra.Command{} + + var createMaterializedFeatureReq ml.CreateMaterializedFeatureRequest + createMaterializedFeatureReq.MaterializedFeature = ml.MaterializedFeature{} + var createMaterializedFeatureJson flags.JsonFlag + + cmd.Flags().Var(&createMaterializedFeatureJson, "json", `either inline JSON string or @path/to/file.json with request body`) + + // TODO: complex arg: offline_store_config + // TODO: complex arg: online_store_config + cmd.Flags().Var(&createMaterializedFeatureReq.MaterializedFeature.PipelineScheduleState, "pipeline-schedule-state", `The schedule state of the materialization pipeline. Supported values: [ACTIVE, PAUSED, SNAPSHOT]`) + + cmd.Use = "create-materialized-feature FEATURE_NAME" + cmd.Short = `Create a materialized feature.` + cmd.Long = `Create a materialized feature. + + Arguments: + FEATURE_NAME: The full name of the feature in Unity Catalog.` + + cmd.Annotations = make(map[string]string) + + cmd.Args = func(cmd *cobra.Command, args []string) error { + if cmd.Flags().Changed("json") { + err := root.ExactArgs(0)(cmd, args) + if err != nil { + return fmt.Errorf("when --json flag is specified, no positional arguments are required. Provide 'feature_name' in your JSON input") + } + return nil + } + check := root.ExactArgs(1) + return check(cmd, args) + } + + cmd.PreRunE = root.MustWorkspaceClient + cmd.RunE = func(cmd *cobra.Command, args []string) (err error) { + ctx := cmd.Context() + w := cmdctx.WorkspaceClient(ctx) + + if cmd.Flags().Changed("json") { + diags := createMaterializedFeatureJson.Unmarshal(&createMaterializedFeatureReq.MaterializedFeature) + if diags.HasError() { + return diags.Error() + } + if len(diags) > 0 { + err := cmdio.RenderDiagnosticsToErrorOut(ctx, diags) + if err != nil { + return err + } + } + } + if !cmd.Flags().Changed("json") { + createMaterializedFeatureReq.MaterializedFeature.FeatureName = args[0] + } + + response, err := w.FeatureEngineering.CreateMaterializedFeature(ctx, createMaterializedFeatureReq) + 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 createMaterializedFeatureOverrides { + fn(cmd, &createMaterializedFeatureReq) + } + + return cmd +} + // start delete-feature command // Slice with functions to override default command behavior. @@ -214,6 +307,60 @@ func newDeleteFeature() *cobra.Command { return cmd } +// start delete-materialized-feature 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 deleteMaterializedFeatureOverrides []func( + *cobra.Command, + *ml.DeleteMaterializedFeatureRequest, +) + +func newDeleteMaterializedFeature() *cobra.Command { + cmd := &cobra.Command{} + + var deleteMaterializedFeatureReq ml.DeleteMaterializedFeatureRequest + + cmd.Use = "delete-materialized-feature MATERIALIZED_FEATURE_ID" + cmd.Short = `Delete a materialized feature.` + cmd.Long = `Delete a materialized feature. + + Arguments: + MATERIALIZED_FEATURE_ID: The ID of the materialized feature to delete.` + + cmd.Annotations = make(map[string]string) + + cmd.Args = func(cmd *cobra.Command, args []string) error { + check := root.ExactArgs(1) + return check(cmd, args) + } + + cmd.PreRunE = root.MustWorkspaceClient + cmd.RunE = func(cmd *cobra.Command, args []string) (err error) { + ctx := cmd.Context() + w := cmdctx.WorkspaceClient(ctx) + + deleteMaterializedFeatureReq.MaterializedFeatureId = args[0] + + err = w.FeatureEngineering.DeleteMaterializedFeature(ctx, deleteMaterializedFeatureReq) + if err != nil { + return err + } + return nil + } + + // 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 deleteMaterializedFeatureOverrides { + fn(cmd, &deleteMaterializedFeatureReq) + } + + return cmd +} + // start get-feature command // Slice with functions to override default command behavior. @@ -270,6 +417,60 @@ func newGetFeature() *cobra.Command { return cmd } +// start get-materialized-feature 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 getMaterializedFeatureOverrides []func( + *cobra.Command, + *ml.GetMaterializedFeatureRequest, +) + +func newGetMaterializedFeature() *cobra.Command { + cmd := &cobra.Command{} + + var getMaterializedFeatureReq ml.GetMaterializedFeatureRequest + + cmd.Use = "get-materialized-feature MATERIALIZED_FEATURE_ID" + cmd.Short = `Get a materialized feature.` + cmd.Long = `Get a materialized feature. + + Arguments: + MATERIALIZED_FEATURE_ID: The ID of the materialized feature.` + + cmd.Annotations = make(map[string]string) + + cmd.Args = func(cmd *cobra.Command, args []string) error { + check := root.ExactArgs(1) + return check(cmd, args) + } + + cmd.PreRunE = root.MustWorkspaceClient + cmd.RunE = func(cmd *cobra.Command, args []string) (err error) { + ctx := cmd.Context() + w := cmdctx.WorkspaceClient(ctx) + + getMaterializedFeatureReq.MaterializedFeatureId = args[0] + + response, err := w.FeatureEngineering.GetMaterializedFeature(ctx, getMaterializedFeatureReq) + 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 getMaterializedFeatureOverrides { + fn(cmd, &getMaterializedFeatureReq) + } + + return cmd +} + // start list-features command // Slice with functions to override default command behavior. @@ -321,6 +522,56 @@ func newListFeatures() *cobra.Command { return cmd } +// start list-materialized-features 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 listMaterializedFeaturesOverrides []func( + *cobra.Command, + *ml.ListMaterializedFeaturesRequest, +) + +func newListMaterializedFeatures() *cobra.Command { + cmd := &cobra.Command{} + + var listMaterializedFeaturesReq ml.ListMaterializedFeaturesRequest + + cmd.Flags().StringVar(&listMaterializedFeaturesReq.FeatureName, "feature-name", listMaterializedFeaturesReq.FeatureName, `Filter by feature name.`) + cmd.Flags().IntVar(&listMaterializedFeaturesReq.PageSize, "page-size", listMaterializedFeaturesReq.PageSize, `The maximum number of results to return.`) + cmd.Flags().StringVar(&listMaterializedFeaturesReq.PageToken, "page-token", listMaterializedFeaturesReq.PageToken, `Pagination token to go to the next page based on a previous query.`) + + cmd.Use = "list-materialized-features" + cmd.Short = `List materialized features.` + cmd.Long = `List materialized features.` + + cmd.Annotations = make(map[string]string) + + cmd.Args = func(cmd *cobra.Command, args []string) error { + check := root.ExactArgs(0) + return check(cmd, args) + } + + cmd.PreRunE = root.MustWorkspaceClient + cmd.RunE = func(cmd *cobra.Command, args []string) (err error) { + ctx := cmd.Context() + w := cmdctx.WorkspaceClient(ctx) + + response := w.FeatureEngineering.ListMaterializedFeatures(ctx, listMaterializedFeaturesReq) + return cmdio.RenderIterator(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 listMaterializedFeaturesOverrides { + fn(cmd, &listMaterializedFeaturesReq) + } + + return cmd +} + // start update-feature command // Slice with functions to override default command behavior. @@ -340,6 +591,7 @@ func newUpdateFeature() *cobra.Command { cmd.Flags().Var(&updateFeatureJson, "json", `either inline JSON string or @path/to/file.json with request body`) cmd.Flags().StringVar(&updateFeatureReq.Feature.Description, "description", updateFeatureReq.Feature.Description, `The description of the feature.`) + cmd.Flags().StringVar(&updateFeatureReq.Feature.FilterCondition, "filter-condition", updateFeatureReq.Feature.FilterCondition, `The filter condition applied to the source data before aggregation.`) cmd.Use = "update-feature FULL_NAME UPDATE_MASK SOURCE INPUTS FUNCTION TIME_WINDOW" cmd.Short = `Update a feature's description (all other fields are immutable).` @@ -393,24 +645,28 @@ func newUpdateFeature() *cobra.Command { if err != nil { return fmt.Errorf("invalid SOURCE: %s", args[2]) } + } if !cmd.Flags().Changed("json") { _, err = fmt.Sscan(args[3], &updateFeatureReq.Feature.Inputs) if err != nil { return fmt.Errorf("invalid INPUTS: %s", args[3]) } + } if !cmd.Flags().Changed("json") { _, err = fmt.Sscan(args[4], &updateFeatureReq.Feature.Function) if err != nil { return fmt.Errorf("invalid FUNCTION: %s", args[4]) } + } if !cmd.Flags().Changed("json") { _, err = fmt.Sscan(args[5], &updateFeatureReq.Feature.TimeWindow) if err != nil { return fmt.Errorf("invalid TIME_WINDOW: %s", args[5]) } + } response, err := w.FeatureEngineering.UpdateFeature(ctx, updateFeatureReq) @@ -432,4 +688,94 @@ func newUpdateFeature() *cobra.Command { return cmd } +// start update-materialized-feature 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 updateMaterializedFeatureOverrides []func( + *cobra.Command, + *ml.UpdateMaterializedFeatureRequest, +) + +func newUpdateMaterializedFeature() *cobra.Command { + cmd := &cobra.Command{} + + var updateMaterializedFeatureReq ml.UpdateMaterializedFeatureRequest + updateMaterializedFeatureReq.MaterializedFeature = ml.MaterializedFeature{} + var updateMaterializedFeatureJson flags.JsonFlag + + cmd.Flags().Var(&updateMaterializedFeatureJson, "json", `either inline JSON string or @path/to/file.json with request body`) + + // TODO: complex arg: offline_store_config + // TODO: complex arg: online_store_config + cmd.Flags().Var(&updateMaterializedFeatureReq.MaterializedFeature.PipelineScheduleState, "pipeline-schedule-state", `The schedule state of the materialization pipeline. Supported values: [ACTIVE, PAUSED, SNAPSHOT]`) + + cmd.Use = "update-materialized-feature MATERIALIZED_FEATURE_ID UPDATE_MASK FEATURE_NAME" + cmd.Short = `Update a materialized feature.` + cmd.Long = `Update a materialized feature. + + Update a materialized feature (pause/resume). + + Arguments: + MATERIALIZED_FEATURE_ID: Unique identifier for the materialized feature. + UPDATE_MASK: Provide the materialization feature fields which should be updated. + Currently, only the pipeline_state field can be updated. + FEATURE_NAME: The full name of the feature in Unity Catalog.` + + cmd.Annotations = make(map[string]string) + + cmd.Args = func(cmd *cobra.Command, args []string) error { + if cmd.Flags().Changed("json") { + err := root.ExactArgs(2)(cmd, args) + if err != nil { + return fmt.Errorf("when --json flag is specified, provide only MATERIALIZED_FEATURE_ID, UPDATE_MASK as positional arguments. Provide 'feature_name' in your JSON input") + } + return nil + } + check := root.ExactArgs(3) + return check(cmd, args) + } + + cmd.PreRunE = root.MustWorkspaceClient + cmd.RunE = func(cmd *cobra.Command, args []string) (err error) { + ctx := cmd.Context() + w := cmdctx.WorkspaceClient(ctx) + + if cmd.Flags().Changed("json") { + diags := updateMaterializedFeatureJson.Unmarshal(&updateMaterializedFeatureReq.MaterializedFeature) + if diags.HasError() { + return diags.Error() + } + if len(diags) > 0 { + err := cmdio.RenderDiagnosticsToErrorOut(ctx, diags) + if err != nil { + return err + } + } + } + updateMaterializedFeatureReq.MaterializedFeatureId = args[0] + updateMaterializedFeatureReq.UpdateMask = args[1] + if !cmd.Flags().Changed("json") { + updateMaterializedFeatureReq.MaterializedFeature.FeatureName = args[2] + } + + response, err := w.FeatureEngineering.UpdateMaterializedFeature(ctx, updateMaterializedFeatureReq) + 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 updateMaterializedFeatureOverrides { + fn(cmd, &updateMaterializedFeatureReq) + } + + return cmd +} + // end service FeatureEngineering diff --git a/cmd/workspace/forecasting/forecasting.go b/cmd/workspace/forecasting/forecasting.go index 383c135a0d..188a2709fe 100755 --- a/cmd/workspace/forecasting/forecasting.go +++ b/cmd/workspace/forecasting/forecasting.go @@ -153,6 +153,7 @@ func newCreateExperiment() *cobra.Command { if err != nil { return fmt.Errorf("invalid FORECAST_HORIZON: %s", args[4]) } + } wait, err := w.Forecasting.CreateExperiment(ctx, createExperimentReq) @@ -243,4 +244,4 @@ func newGetExperiment() *cobra.Command { return cmd } -// end service forecasting +// end service Forecasting diff --git a/cmd/workspace/functions/functions.go b/cmd/workspace/functions/functions.go index bd104fedb2..078a168b96 100755 --- a/cmd/workspace/functions/functions.go +++ b/cmd/workspace/functions/functions.go @@ -308,8 +308,7 @@ func newList() *cobra.Command { PAGINATION BEHAVIOR: When using pagination (max_results >= 0), a page may contain zero results while still providing a next_page_token. Clients must continue reading pages until next_page_token is absent, which is the only - indication that the end of results has been reached. This behavior follows - Google AIP-158 guidelines. + indication that the end of results has been reached. Arguments: CATALOG_NAME: Name of parent catalog for functions of interest. diff --git a/cmd/workspace/genie/genie.go b/cmd/workspace/genie/genie.go index d2a402342b..ce6e01279b 100755 --- a/cmd/workspace/genie/genie.go +++ b/cmd/workspace/genie/genie.go @@ -966,6 +966,7 @@ func newSendMessageFeedback() *cobra.Command { if err != nil { return fmt.Errorf("invalid RATING: %s", args[3]) } + } err = w.Genie.SendMessageFeedback(ctx, sendMessageFeedbackReq) diff --git a/cmd/workspace/git-credentials/git-credentials.go b/cmd/workspace/git-credentials/git-credentials.go index fd16bc3744..02b60cc2e6 100755 --- a/cmd/workspace/git-credentials/git-credentials.go +++ b/cmd/workspace/git-credentials/git-credentials.go @@ -394,6 +394,7 @@ func newUpdate() *cobra.Command { if err != nil { return fmt.Errorf("invalid CREDENTIAL_ID: %s", args[0]) } + if !cmd.Flags().Changed("json") { updateReq.GitProvider = args[1] } diff --git a/cmd/workspace/grants/grants.go b/cmd/workspace/grants/grants.go index 3aabdae525..fef4b74614 100755 --- a/cmd/workspace/grants/grants.go +++ b/cmd/workspace/grants/grants.go @@ -73,6 +73,14 @@ func newGet() *cobra.Command { cmd.Long = `Get permissions. Gets the permissions for a securable. Does not include inherited permissions. + + NOTE: we recommend using max_results=0 to use the paginated version of this + API. Unpaginated calls will be deprecated soon. + + PAGINATION BEHAVIOR: When using pagination (max_results >= 0), a page may + contain zero results while still providing a next_page_token. Clients must + continue reading pages until next_page_token is absent, which is the only + indication that the end of results has been reached. Arguments: SECURABLE_TYPE: Type of securable. @@ -136,6 +144,14 @@ func newGetEffective() *cobra.Command { Gets the effective permissions for a securable. Includes inherited permissions from any parent securables. + + NOTE: we recommend using max_results=0 to use the paginated version of this + API. Unpaginated calls will be deprecated soon. + + PAGINATION BEHAVIOR: When using pagination (max_results >= 0), a page may + contain zero results while still providing a next_page_token. Clients must + continue reading pages until next_page_token is absent, which is the only + indication that the end of results has been reached. Arguments: SECURABLE_TYPE: Type of securable. diff --git a/cmd/workspace/ip-access-lists/ip-access-lists.go b/cmd/workspace/ip-access-lists/ip-access-lists.go index c1646a4cb3..d29d7b98c4 100755 --- a/cmd/workspace/ip-access-lists/ip-access-lists.go +++ b/cmd/workspace/ip-access-lists/ip-access-lists.go @@ -149,6 +149,7 @@ func newCreate() *cobra.Command { if err != nil { return fmt.Errorf("invalid LIST_TYPE: %s", args[1]) } + } response, err := w.IpAccessLists.Create(ctx, createReq) @@ -428,12 +429,14 @@ func newReplace() *cobra.Command { if err != nil { return fmt.Errorf("invalid LIST_TYPE: %s", args[2]) } + } if !cmd.Flags().Changed("json") { _, err = fmt.Sscan(args[3], &replaceReq.Enabled) if err != nil { return fmt.Errorf("invalid ENABLED: %s", args[3]) } + } err = w.IpAccessLists.Replace(ctx, replaceReq) diff --git a/cmd/workspace/jobs/jobs.go b/cmd/workspace/jobs/jobs.go index 2ca23080ea..6a6ae772b2 100755 --- a/cmd/workspace/jobs/jobs.go +++ b/cmd/workspace/jobs/jobs.go @@ -232,6 +232,7 @@ func newCancelRun() *cobra.Command { if err != nil { return fmt.Errorf("invalid RUN_ID: %s", args[0]) } + } wait, err := w.Jobs.CancelRun(ctx, cancelRunReq) @@ -289,44 +290,12 @@ func newCreate() *cobra.Command { cmd.Flags().Var(&createJson, "json", `either inline JSON string or @path/to/file.json with request body`) - // TODO: array: access_control_list - cmd.Flags().StringVar(&createReq.BudgetPolicyId, "budget-policy-id", createReq.BudgetPolicyId, `The id of the user specified budget policy to use for this job.`) - // TODO: complex arg: continuous - // TODO: complex arg: deployment - cmd.Flags().StringVar(&createReq.Description, "description", createReq.Description, `An optional description for the job.`) - cmd.Flags().Var(&createReq.EditMode, "edit-mode", `Edit mode of the job. Supported values: [EDITABLE, UI_LOCKED]`) - // TODO: complex arg: email_notifications - // TODO: array: environments - cmd.Flags().Var(&createReq.Format, "format", `Used to tell what is the format of the job. Supported values: [MULTI_TASK, SINGLE_TASK]`) - // TODO: complex arg: git_source - // TODO: complex arg: health - // TODO: array: job_clusters - cmd.Flags().IntVar(&createReq.MaxConcurrentRuns, "max-concurrent-runs", createReq.MaxConcurrentRuns, `An optional maximum allowed number of concurrent runs of the job.`) - cmd.Flags().StringVar(&createReq.Name, "name", createReq.Name, `An optional name for the job.`) - // TODO: complex arg: notification_settings - // TODO: array: parameters - cmd.Flags().Var(&createReq.PerformanceTarget, "performance-target", `The performance mode on a serverless job. Supported values: [PERFORMANCE_OPTIMIZED, STANDARD]`) - // TODO: complex arg: queue - // TODO: complex arg: run_as - // TODO: complex arg: schedule - // TODO: map via StringToStringVar: tags - // TODO: array: tasks - cmd.Flags().IntVar(&createReq.TimeoutSeconds, "timeout-seconds", createReq.TimeoutSeconds, `An optional timeout applied to each run of this job.`) - // TODO: complex arg: trigger - cmd.Flags().StringVar(&createReq.UsagePolicyId, "usage-policy-id", createReq.UsagePolicyId, `The id of the user specified usage policy to use for this job.`) - // TODO: complex arg: webhook_notifications - cmd.Use = "create" cmd.Short = `Create a new job.` cmd.Long = `Create a new job.` cmd.Annotations = make(map[string]string) - cmd.Args = func(cmd *cobra.Command, args []string) error { - check := root.ExactArgs(0) - return check(cmd, args) - } - cmd.PreRunE = root.MustWorkspaceClient cmd.RunE = func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() @@ -343,6 +312,8 @@ func newCreate() *cobra.Command { return err } } + } else { + return fmt.Errorf("please provide command input in JSON format by specifying the --json flag") } response, err := w.Jobs.Create(ctx, createReq) @@ -441,6 +412,7 @@ func newDelete() *cobra.Command { if err != nil { return fmt.Errorf("invalid JOB_ID: %s", args[0]) } + } err = w.Jobs.Delete(ctx, deleteReq) @@ -539,6 +511,7 @@ func newDeleteRun() *cobra.Command { if err != nil { return fmt.Errorf("invalid RUN_ID: %s", args[0]) } + } err = w.Jobs.DeleteRun(ctx, deleteRunReq) @@ -1231,6 +1204,7 @@ func newRepairRun() *cobra.Command { if err != nil { return fmt.Errorf("invalid RUN_ID: %s", args[0]) } + } wait, err := w.Jobs.RepairRun(ctx, repairRunReq) @@ -1433,6 +1407,7 @@ func newRunNow() *cobra.Command { if err != nil { return fmt.Errorf("invalid JOB_ID: %s", args[0]) } + } wait, err := w.Jobs.RunNow(ctx, runNowReq) @@ -1752,6 +1727,7 @@ func newUpdate() *cobra.Command { if err != nil { return fmt.Errorf("invalid JOB_ID: %s", args[0]) } + } err = w.Jobs.Update(ctx, updateReq) diff --git a/cmd/workspace/lakeview/lakeview.go b/cmd/workspace/lakeview/lakeview.go index 777ad5cf63..b3b0997855 100755 --- a/cmd/workspace/lakeview/lakeview.go +++ b/cmd/workspace/lakeview/lakeview.go @@ -199,6 +199,7 @@ func newCreateSchedule() *cobra.Command { if err != nil { return fmt.Errorf("invalid CRON_SCHEDULE: %s", args[1]) } + } response, err := w.Lakeview.CreateSchedule(ctx, createScheduleReq) @@ -286,6 +287,7 @@ func newCreateSubscription() *cobra.Command { if err != nil { return fmt.Errorf("invalid SUBSCRIBER: %s", args[2]) } + } response, err := w.Lakeview.CreateSubscription(ctx, createSubscriptionReq) @@ -1228,6 +1230,7 @@ func newUpdateSchedule() *cobra.Command { if err != nil { return fmt.Errorf("invalid CRON_SCHEDULE: %s", args[2]) } + } response, err := w.Lakeview.UpdateSchedule(ctx, updateScheduleReq) diff --git a/cmd/workspace/metastores/metastores.go b/cmd/workspace/metastores/metastores.go index 7a3740f718..a407975d6f 100755 --- a/cmd/workspace/metastores/metastores.go +++ b/cmd/workspace/metastores/metastores.go @@ -128,6 +128,7 @@ func newAssign() *cobra.Command { if err != nil { return fmt.Errorf("invalid WORKSPACE_ID: %s", args[0]) } + if !cmd.Flags().Changed("json") { assignReq.MetastoreId = args[1] } @@ -429,8 +430,7 @@ func newList() *cobra.Command { PAGINATION BEHAVIOR: When using pagination (max_results >= 0), a page may contain zero results while still providing a next_page_token. Clients must continue reading pages until next_page_token is absent, which is the only - indication that the end of results has been reached. This behavior follows - Google AIP-158 guidelines.` + indication that the end of results has been reached.` cmd.Annotations = make(map[string]string) @@ -543,6 +543,7 @@ func newUnassign() *cobra.Command { if err != nil { return fmt.Errorf("invalid WORKSPACE_ID: %s", args[0]) } + unassignReq.MetastoreId = args[1] err = w.Metastores.Unassign(ctx, unassignReq) diff --git a/cmd/workspace/model-registry/model-registry.go b/cmd/workspace/model-registry/model-registry.go index 6087b50ff8..8340a80cc9 100755 --- a/cmd/workspace/model-registry/model-registry.go +++ b/cmd/workspace/model-registry/model-registry.go @@ -167,6 +167,7 @@ func newApproveTransitionRequest() *cobra.Command { if err != nil { return fmt.Errorf("invalid ARCHIVE_EXISTING_VERSIONS: %s", args[3]) } + } response, err := w.ModelRegistry.ApproveTransitionRequest(ctx, approveTransitionRequestReq) @@ -2301,6 +2302,7 @@ func newTransitionStage() *cobra.Command { if err != nil { return fmt.Errorf("invalid ARCHIVE_EXISTING_VERSIONS: %s", args[3]) } + } response, err := w.ModelRegistry.TransitionStage(ctx, transitionStageReq) diff --git a/cmd/workspace/model-versions/model-versions.go b/cmd/workspace/model-versions/model-versions.go index 77f2302fea..5219bd5f09 100755 --- a/cmd/workspace/model-versions/model-versions.go +++ b/cmd/workspace/model-versions/model-versions.go @@ -286,6 +286,11 @@ func newList() *cobra.Command { There is no guarantee of a specific ordering of the elements in the response. The elements in the response will not contain any aliases or tags. + + PAGINATION BEHAVIOR: The API is by default paginated, a page may contain zero + results while still providing a next_page_token. Clients must continue reading + pages until next_page_token is absent, which is the only indication that the + end of results has been reached. Arguments: FULL_NAME: The full three-level name of the registered model under which to list diff --git a/cmd/workspace/permission-migration/permission-migration.go b/cmd/workspace/permission-migration/permission-migration.go index f56a0ed6f8..7f22f0883a 100755 --- a/cmd/workspace/permission-migration/permission-migration.go +++ b/cmd/workspace/permission-migration/permission-migration.go @@ -109,6 +109,7 @@ func newMigratePermissions() *cobra.Command { if err != nil { return fmt.Errorf("invalid WORKSPACE_ID: %s", args[0]) } + } if !cmd.Flags().Changed("json") { migratePermissionsReq.FromWorkspaceGroupName = args[1] diff --git a/cmd/workspace/pipelines/pipelines.go b/cmd/workspace/pipelines/pipelines.go index e054630331..d58dd5f605 100755 --- a/cmd/workspace/pipelines/pipelines.go +++ b/cmd/workspace/pipelines/pipelines.go @@ -84,37 +84,6 @@ func newCreate() *cobra.Command { cmd.Flags().Var(&createJson, "json", `either inline JSON string or @path/to/file.json with request body`) - cmd.Flags().BoolVar(&createReq.AllowDuplicateNames, "allow-duplicate-names", createReq.AllowDuplicateNames, `If false, deployment will fail if name conflicts with that of another pipeline.`) - cmd.Flags().StringVar(&createReq.BudgetPolicyId, "budget-policy-id", createReq.BudgetPolicyId, `Budget policy of this pipeline.`) - cmd.Flags().StringVar(&createReq.Catalog, "catalog", createReq.Catalog, `A catalog in Unity Catalog to publish data from this pipeline to.`) - cmd.Flags().StringVar(&createReq.Channel, "channel", createReq.Channel, `DLT Release Channel that specifies which version to use.`) - // TODO: array: clusters - // TODO: map via StringToStringVar: configuration - cmd.Flags().BoolVar(&createReq.Continuous, "continuous", createReq.Continuous, `Whether the pipeline is continuous or triggered.`) - // TODO: complex arg: deployment - cmd.Flags().BoolVar(&createReq.Development, "development", createReq.Development, `Whether the pipeline is in Development mode.`) - cmd.Flags().BoolVar(&createReq.DryRun, "dry-run", createReq.DryRun, ``) - cmd.Flags().StringVar(&createReq.Edition, "edition", createReq.Edition, `Pipeline product edition.`) - // TODO: complex arg: environment - // TODO: complex arg: event_log - // TODO: complex arg: filters - // TODO: complex arg: gateway_definition - cmd.Flags().StringVar(&createReq.Id, "id", createReq.Id, `Unique identifier for this pipeline.`) - // TODO: complex arg: ingestion_definition - // TODO: array: libraries - cmd.Flags().StringVar(&createReq.Name, "name", createReq.Name, `Friendly identifier for this pipeline.`) - // TODO: array: notifications - cmd.Flags().BoolVar(&createReq.Photon, "photon", createReq.Photon, `Whether Photon is enabled for this pipeline.`) - // TODO: complex arg: restart_window - cmd.Flags().StringVar(&createReq.RootPath, "root-path", createReq.RootPath, `Root path for this pipeline.`) - // TODO: complex arg: run_as - cmd.Flags().StringVar(&createReq.Schema, "schema", createReq.Schema, `The default schema (database) where tables are read from or published to.`) - cmd.Flags().BoolVar(&createReq.Serverless, "serverless", createReq.Serverless, `Whether serverless compute is enabled for this pipeline.`) - cmd.Flags().StringVar(&createReq.Storage, "storage", createReq.Storage, `DBFS root directory for storing checkpoints and tables.`) - // TODO: map via StringToStringVar: tags - cmd.Flags().StringVar(&createReq.Target, "target", createReq.Target, `Target schema (database) to add tables in this pipeline to.`) - // TODO: complex arg: trigger - cmd.Use = "create" cmd.Short = `Create a pipeline.` cmd.Long = `Create a pipeline. @@ -124,11 +93,6 @@ func newCreate() *cobra.Command { cmd.Annotations = make(map[string]string) - cmd.Args = func(cmd *cobra.Command, args []string) error { - check := root.ExactArgs(0) - return check(cmd, args) - } - cmd.PreRunE = root.MustWorkspaceClient cmd.RunE = func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() @@ -145,6 +109,8 @@ func newCreate() *cobra.Command { return err } } + } else { + return fmt.Errorf("please provide command input in JSON format by specifying the --json flag") } response, err := w.Pipelines.Create(ctx, createReq) @@ -998,6 +964,7 @@ func newUpdate() *cobra.Command { // TODO: map via StringToStringVar: tags cmd.Flags().StringVar(&updateReq.Target, "target", updateReq.Target, `Target schema (database) to add tables in this pipeline to.`) // TODO: complex arg: trigger + cmd.Flags().StringVar(&updateReq.UsagePolicyId, "usage-policy-id", updateReq.UsagePolicyId, `Usage policy of this pipeline.`) cmd.Use = "update PIPELINE_ID" cmd.Short = `Edit a pipeline.` diff --git a/cmd/workspace/policies/policies.go b/cmd/workspace/policies/policies.go index d915bf7809..15a45238f9 100755 --- a/cmd/workspace/policies/policies.go +++ b/cmd/workspace/policies/policies.go @@ -167,18 +167,21 @@ func newCreatePolicy() *cobra.Command { if err != nil { return fmt.Errorf("invalid TO_PRINCIPALS: %s", args[0]) } + } if !cmd.Flags().Changed("json") { _, err = fmt.Sscan(args[1], &createPolicyReq.PolicyInfo.ForSecurableType) if err != nil { return fmt.Errorf("invalid FOR_SECURABLE_TYPE: %s", args[1]) } + } if !cmd.Flags().Changed("json") { _, err = fmt.Sscan(args[2], &createPolicyReq.PolicyInfo.PolicyType) if err != nil { return fmt.Errorf("invalid POLICY_TYPE: %s", args[2]) } + } response, err := w.Policies.CreatePolicy(ctx, createPolicyReq) @@ -345,6 +348,11 @@ func newListPolicies() *cobra.Command { List all policies defined on a securable. Optionally, the list can include inherited policies defined on the securable's parent schema or catalog. + + PAGINATION BEHAVIOR: The API is by default paginated, a page may contain zero + results while still providing a next_page_token. Clients must continue reading + pages until next_page_token is absent, which is the only indication that the + end of results has been reached. Arguments: ON_SECURABLE_TYPE: Required. The type of the securable to list policies for. @@ -504,18 +512,21 @@ func newUpdatePolicy() *cobra.Command { if err != nil { return fmt.Errorf("invalid TO_PRINCIPALS: %s", args[3]) } + } if !cmd.Flags().Changed("json") { _, err = fmt.Sscan(args[4], &updatePolicyReq.PolicyInfo.ForSecurableType) if err != nil { return fmt.Errorf("invalid FOR_SECURABLE_TYPE: %s", args[4]) } + } if !cmd.Flags().Changed("json") { _, err = fmt.Sscan(args[5], &updatePolicyReq.PolicyInfo.PolicyType) if err != nil { return fmt.Errorf("invalid POLICY_TYPE: %s", args[5]) } + } response, err := w.Policies.UpdatePolicy(ctx, updatePolicyReq) diff --git a/cmd/workspace/policy-compliance-for-jobs/policy-compliance-for-jobs.go b/cmd/workspace/policy-compliance-for-jobs/policy-compliance-for-jobs.go index 784be7c5ab..80ba0f7b85 100755 --- a/cmd/workspace/policy-compliance-for-jobs/policy-compliance-for-jobs.go +++ b/cmd/workspace/policy-compliance-for-jobs/policy-compliance-for-jobs.go @@ -121,6 +121,7 @@ func newEnforceCompliance() *cobra.Command { if err != nil { return fmt.Errorf("invalid JOB_ID: %s", args[0]) } + } response, err := w.PolicyComplianceForJobs.EnforceCompliance(ctx, enforceComplianceReq) diff --git a/cmd/workspace/provider-personalization-requests/provider-personalization-requests.go b/cmd/workspace/provider-personalization-requests/provider-personalization-requests.go index da94fb0cb3..f88cfa2407 100755 --- a/cmd/workspace/provider-personalization-requests/provider-personalization-requests.go +++ b/cmd/workspace/provider-personalization-requests/provider-personalization-requests.go @@ -159,6 +159,7 @@ func newUpdate() *cobra.Command { if err != nil { return fmt.Errorf("invalid STATUS: %s", args[2]) } + } response, err := w.ProviderPersonalizationRequests.Update(ctx, updateReq) diff --git a/cmd/workspace/providers/providers.go b/cmd/workspace/providers/providers.go index 23d18d5d4c..1a1b31ef5f 100755 --- a/cmd/workspace/providers/providers.go +++ b/cmd/workspace/providers/providers.go @@ -119,6 +119,7 @@ func newCreate() *cobra.Command { if err != nil { return fmt.Errorf("invalid AUTHENTICATION_TYPE: %s", args[1]) } + } response, err := w.Providers.Create(ctx, createReq) diff --git a/cmd/workspace/query-visualizations-legacy/query-visualizations-legacy.go b/cmd/workspace/query-visualizations-legacy/query-visualizations-legacy.go index a7852161ff..f66fe2b615 100755 --- a/cmd/workspace/query-visualizations-legacy/query-visualizations-legacy.go +++ b/cmd/workspace/query-visualizations-legacy/query-visualizations-legacy.go @@ -211,7 +211,7 @@ func newUpdate() *cobra.Command { cmd.Flags().StringVar(&updateReq.Type, "type", updateReq.Type, `The type of visualization: chart, table, pivot table, and so on.`) cmd.Flags().StringVar(&updateReq.UpdatedAt, "updated-at", updateReq.UpdatedAt, ``) - cmd.Use = "update ID" + cmd.Use = "update" cmd.Short = `Edit existing visualization.` cmd.Long = `Edit existing visualization. @@ -220,15 +220,12 @@ func newUpdate() *cobra.Command { **Note**: A new version of the Databricks SQL API is now available. Please use :method:queryvisualizations/update instead. [Learn more] - [Learn more]: https://docs.databricks.com/en/sql/dbsql-api-latest.html - - Arguments: - ID: The UUID for this visualization.` + [Learn more]: https://docs.databricks.com/en/sql/dbsql-api-latest.html` cmd.Annotations = make(map[string]string) cmd.Args = func(cmd *cobra.Command, args []string) error { - check := root.ExactArgs(1) + check := root.ExactArgs(0) return check(cmd, args) } @@ -249,7 +246,6 @@ func newUpdate() *cobra.Command { } } } - updateReq.Id = args[0] response, err := w.QueryVisualizationsLegacy.Update(ctx, updateReq) if err != nil { diff --git a/cmd/workspace/recipient-federation-policies/recipient-federation-policies.go b/cmd/workspace/recipient-federation-policies/recipient-federation-policies.go index 017e3f34de..26e123673d 100755 --- a/cmd/workspace/recipient-federation-policies/recipient-federation-policies.go +++ b/cmd/workspace/recipient-federation-policies/recipient-federation-policies.go @@ -48,10 +48,7 @@ func New() *cobra.Command { Annotations: map[string]string{ "package": "sharing", }, - - // This service is being previewed; hide from help output. - Hidden: true, - RunE: root.ReportUnknownSubcommand, + RunE: root.ReportUnknownSubcommand, } // Add methods @@ -59,7 +56,6 @@ func New() *cobra.Command { cmd.AddCommand(newDelete()) cmd.AddCommand(newGetFederationPolicy()) cmd.AddCommand(newList()) - cmd.AddCommand(newUpdate()) // Apply optional overrides to this command. for _, fn := range cmdOverrides { @@ -351,85 +347,4 @@ func newList() *cobra.Command { return cmd } -// 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, - *sharing.UpdateFederationPolicyRequest, -) - -func newUpdate() *cobra.Command { - cmd := &cobra.Command{} - - var updateReq sharing.UpdateFederationPolicyRequest - updateReq.Policy = sharing.FederationPolicy{} - var updateJson flags.JsonFlag - - cmd.Flags().Var(&updateJson, "json", `either inline JSON string or @path/to/file.json with request body`) - - cmd.Flags().StringVar(&updateReq.UpdateMask, "update-mask", updateReq.UpdateMask, `The field mask specifies which fields of the policy to update.`) - cmd.Flags().StringVar(&updateReq.Policy.Comment, "comment", updateReq.Policy.Comment, `Description of the policy.`) - cmd.Flags().StringVar(&updateReq.Policy.Name, "name", updateReq.Policy.Name, `Name of the federation policy.`) - // TODO: complex arg: oidc_policy - - cmd.Use = "update RECIPIENT_NAME NAME" - cmd.Short = `Update recipient federation policy.` - cmd.Long = `Update recipient federation policy. - - Updates an existing federation policy for an OIDC_RECIPIENT. The caller must - be the owner of the recipient. - - Arguments: - RECIPIENT_NAME: Name of the recipient. This is the name of the recipient for which the - policy is being updated. - NAME: Name of the policy. This is the name of the current name of the policy.` - - cmd.Annotations = make(map[string]string) - - cmd.Args = func(cmd *cobra.Command, args []string) error { - check := root.ExactArgs(2) - return check(cmd, args) - } - - cmd.PreRunE = root.MustWorkspaceClient - cmd.RunE = func(cmd *cobra.Command, args []string) (err error) { - ctx := cmd.Context() - w := cmdctx.WorkspaceClient(ctx) - - if cmd.Flags().Changed("json") { - diags := updateJson.Unmarshal(&updateReq.Policy) - if diags.HasError() { - return diags.Error() - } - if len(diags) > 0 { - err := cmdio.RenderDiagnosticsToErrorOut(ctx, diags) - if err != nil { - return err - } - } - } - updateReq.RecipientName = args[0] - updateReq.Name = args[1] - - response, err := w.RecipientFederationPolicies.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 -} - // end service RecipientFederationPolicies diff --git a/cmd/workspace/recipients/recipients.go b/cmd/workspace/recipients/recipients.go index 5d7004fd71..cb63e56007 100755 --- a/cmd/workspace/recipients/recipients.go +++ b/cmd/workspace/recipients/recipients.go @@ -139,6 +139,7 @@ func newCreate() *cobra.Command { if err != nil { return fmt.Errorf("invalid AUTHENTICATION_TYPE: %s", args[1]) } + } response, err := w.Recipients.Create(ctx, createReq) @@ -398,6 +399,7 @@ func newRotateToken() *cobra.Command { if err != nil { return fmt.Errorf("invalid EXISTING_TOKEN_EXPIRE_IN_SECONDS: %s", args[1]) } + } response, err := w.Recipients.RotateToken(ctx, rotateTokenReq) @@ -440,8 +442,8 @@ func newSharePermissions() *cobra.Command { cmd.Short = `Get recipient share permissions.` cmd.Long = `Get recipient share permissions. - Gets the share permissions for the specified Recipient. The caller must be a - metastore admin or the owner of the Recipient. + Gets the share permissions for the specified Recipient. The caller must have + the USE_RECIPIENT privilege on the metastore or be the owner of the Recipient. Arguments: NAME: The name of the Recipient.` diff --git a/cmd/workspace/registered-models/registered-models.go b/cmd/workspace/registered-models/registered-models.go index 06dbb39233..cf75be001b 100755 --- a/cmd/workspace/registered-models/registered-models.go +++ b/cmd/workspace/registered-models/registered-models.go @@ -415,7 +415,12 @@ func newList() *cobra.Command { privilege on the parent catalog and the **USE_SCHEMA** privilege on the parent schema. - There is no guarantee of a specific ordering of the elements in the response.` + There is no guarantee of a specific ordering of the elements in the response. + + PAGINATION BEHAVIOR: The API is by default paginated, a page may contain zero + results while still providing a next_page_token. Clients must continue reading + pages until next_page_token is absent, which is the only indication that the + end of results has been reached.` cmd.Annotations = make(map[string]string) @@ -516,6 +521,7 @@ func newSetAlias() *cobra.Command { if err != nil { return fmt.Errorf("invalid VERSION_NUM: %s", args[2]) } + } response, err := w.RegisteredModels.SetAlias(ctx, setAliasReq) diff --git a/cmd/workspace/resource-quotas/resource-quotas.go b/cmd/workspace/resource-quotas/resource-quotas.go index 61101d0526..da2979d9fd 100755 --- a/cmd/workspace/resource-quotas/resource-quotas.go +++ b/cmd/workspace/resource-quotas/resource-quotas.go @@ -133,7 +133,12 @@ func newListQuotas() *cobra.Command { ListQuotas returns all quota values under the metastore. There are no SLAs on the freshness of the counts returned. This API does not trigger a refresh of - quota counts.` + quota counts. + + PAGINATION BEHAVIOR: The API is by default paginated, a page may contain zero + results while still providing a next_page_token. Clients must continue reading + pages until next_page_token is absent, which is the only indication that the + end of results has been reached.` cmd.Annotations = make(map[string]string) diff --git a/cmd/workspace/rfa/rfa.go b/cmd/workspace/rfa/rfa.go index e5e310f4d9..d9125c1c69 100755 --- a/cmd/workspace/rfa/rfa.go +++ b/cmd/workspace/rfa/rfa.go @@ -278,12 +278,14 @@ func newUpdateAccessRequestDestinations() *cobra.Command { if err != nil { return fmt.Errorf("invalid DESTINATIONS: %s", args[1]) } + } if !cmd.Flags().Changed("json") { _, err = fmt.Sscan(args[2], &updateAccessRequestDestinationsReq.AccessRequestDestinations.Securable) if err != nil { return fmt.Errorf("invalid SECURABLE: %s", args[2]) } + } response, err := w.Rfa.UpdateAccessRequestDestinations(ctx, updateAccessRequestDestinationsReq) diff --git a/cmd/workspace/schemas/schemas.go b/cmd/workspace/schemas/schemas.go index 7757127c33..cbb8dd9668 100755 --- a/cmd/workspace/schemas/schemas.go +++ b/cmd/workspace/schemas/schemas.go @@ -291,8 +291,7 @@ func newList() *cobra.Command { PAGINATION BEHAVIOR: When using pagination (max_results >= 0), a page may contain zero results while still providing a next_page_token. Clients must continue reading pages until next_page_token is absent, which is the only - indication that the end of results has been reached. This behavior follows - Google AIP-158 guidelines. + indication that the end of results has been reached. Arguments: CATALOG_NAME: Parent catalog for schemas of interest.` diff --git a/cmd/workspace/secrets/secrets.go b/cmd/workspace/secrets/secrets.go index a05d6e2fca..2425ecfb8f 100755 --- a/cmd/workspace/secrets/secrets.go +++ b/cmd/workspace/secrets/secrets.go @@ -906,6 +906,7 @@ func newPutAcl() *cobra.Command { if err != nil { return fmt.Errorf("invalid PERMISSION: %s", args[2]) } + } err = w.Secrets.PutAcl(ctx, putAclReq) diff --git a/cmd/workspace/serving-endpoints/serving-endpoints.go b/cmd/workspace/serving-endpoints/serving-endpoints.go index 3a7ceefd7d..deeec41747 100755 --- a/cmd/workspace/serving-endpoints/serving-endpoints.go +++ b/cmd/workspace/serving-endpoints/serving-endpoints.go @@ -715,6 +715,7 @@ func newHttpRequest() *cobra.Command { if err != nil { return fmt.Errorf("invalid METHOD: %s", args[1]) } + httpRequestReq.Path = args[2] response, err := w.ServingEndpoints.HttpRequest(ctx, httpRequestReq) diff --git a/cmd/workspace/shares/shares.go b/cmd/workspace/shares/shares.go index 803b1f05cc..c5f48ca19d 100755 --- a/cmd/workspace/shares/shares.go +++ b/cmd/workspace/shares/shares.go @@ -212,8 +212,8 @@ func newGet() *cobra.Command { cmd.Short = `Get a share.` cmd.Long = `Get a share. - Gets a data object share from the metastore. The caller must be a metastore - admin or the owner of the share. + Gets a data object share from the metastore. The caller must have the + USE_SHARE privilege on the metastore or be the owner of the share. Arguments: NAME: The name of the share.` @@ -272,8 +272,9 @@ func newListShares() *cobra.Command { cmd.Short = `List shares.` cmd.Long = `List shares. - Gets an array of data object shares from the metastore. The caller must be a - metastore admin or the owner of the share. There is no guarantee of a specific + Gets an array of data object shares from the metastore. If the caller has the + USE_SHARE privilege on the metastore, all shares are returned. Otherwise, only + shares owned by the caller are returned. There is no guarantee of a specific ordering of the elements in the array.` cmd.Annotations = make(map[string]string) @@ -325,11 +326,11 @@ func newSharePermissions() *cobra.Command { cmd.Short = `Get permissions.` cmd.Long = `Get permissions. - Gets the permissions for a data share from the metastore. The caller must be a - metastore admin or the owner of the share. + Gets the permissions for a data share from the metastore. The caller must have + the USE_SHARE privilege on the metastore or be the owner of the share. Arguments: - NAME: The name of the share.` + NAME: The name of the Recipient.` cmd.Annotations = make(map[string]string) @@ -481,11 +482,12 @@ func newUpdatePermissions() *cobra.Command { cmd.Short = `Update permissions.` cmd.Long = `Update permissions. - Updates the permissions for a data share in the metastore. The caller must be - a metastore admin or an owner of the share. + Updates the permissions for a data share in the metastore. The caller must + have both the USE_SHARE and SET_SHARE_PERMISSION privileges on the metastore, + or be the owner of the share. - For new recipient grants, the user must also be the recipient owner or - metastore admin. recipient revocations do not require additional privileges. + For new recipient grants, the user must also be the owner of the recipients. + recipient revocations do not require additional privileges. Arguments: NAME: The name of the share.` diff --git a/cmd/workspace/storage-credentials/storage-credentials.go b/cmd/workspace/storage-credentials/storage-credentials.go index ac8c5cb6c3..5630aba1ef 100755 --- a/cmd/workspace/storage-credentials/storage-credentials.go +++ b/cmd/workspace/storage-credentials/storage-credentials.go @@ -301,8 +301,7 @@ func newList() *cobra.Command { PAGINATION BEHAVIOR: When using pagination (max_results >= 0), a page may contain zero results while still providing a next_page_token. Clients must continue reading pages until next_page_token is absent, which is the only - indication that the end of results has been reached. This behavior follows - Google AIP-158 guidelines.` + indication that the end of results has been reached.` cmd.Annotations = make(map[string]string) diff --git a/cmd/workspace/system-schemas/system-schemas.go b/cmd/workspace/system-schemas/system-schemas.go index f0f21b203a..8cff5356e2 100755 --- a/cmd/workspace/system-schemas/system-schemas.go +++ b/cmd/workspace/system-schemas/system-schemas.go @@ -207,8 +207,7 @@ func newList() *cobra.Command { PAGINATION BEHAVIOR: When using pagination (max_results >= 0), a page may contain zero results while still providing a next_page_token. Clients must continue reading pages until next_page_token is absent, which is the only - indication that the end of results has been reached. This behavior follows - Google AIP-158 guidelines. + indication that the end of results has been reached. Arguments: METASTORE_ID: The ID for the metastore in which the system schema resides.` diff --git a/cmd/workspace/tables/tables.go b/cmd/workspace/tables/tables.go index af6db516f2..57375d4f1f 100755 --- a/cmd/workspace/tables/tables.go +++ b/cmd/workspace/tables/tables.go @@ -199,12 +199,14 @@ func newCreate() *cobra.Command { if err != nil { return fmt.Errorf("invalid TABLE_TYPE: %s", args[3]) } + } if !cmd.Flags().Changed("json") { _, err = fmt.Sscan(args[4], &createReq.DataSourceFormat) if err != nil { return fmt.Errorf("invalid DATA_SOURCE_FORMAT: %s", args[4]) } + } if !cmd.Flags().Changed("json") { createReq.StorageLocation = args[5] @@ -457,8 +459,7 @@ func newList() *cobra.Command { PAGINATION BEHAVIOR: When using pagination (max_results >= 0), a page may contain zero results while still providing a next_page_token. Clients must continue reading pages until next_page_token is absent, which is the only - indication that the end of results has been reached. This behavior follows - Google AIP-158 guidelines. + indication that the end of results has been reached. Arguments: CATALOG_NAME: Name of parent catalog for tables of interest. @@ -530,6 +531,11 @@ func newListSummaries() *cobra.Command { ownership or the **USE_CATALOG** privilege on the parent catalog. There is no guarantee of a specific ordering of the elements in the array. + + PAGINATION BEHAVIOR: The API is by default paginated, a page may contain zero + results while still providing a next_page_token. Clients must continue reading + pages until next_page_token is absent, which is the only indication that the + end of results has been reached. Arguments: CATALOG_NAME: Name of parent catalog for tables of interest.` diff --git a/cmd/workspace/temporary-path-credentials/temporary-path-credentials.go b/cmd/workspace/temporary-path-credentials/temporary-path-credentials.go index ed2235e922..ba4e0bf99a 100755 --- a/cmd/workspace/temporary-path-credentials/temporary-path-credentials.go +++ b/cmd/workspace/temporary-path-credentials/temporary-path-credentials.go @@ -143,6 +143,7 @@ func newGenerateTemporaryPathCredentials() *cobra.Command { if err != nil { return fmt.Errorf("invalid OPERATION: %s", args[1]) } + } response, err := w.TemporaryPathCredentials.GenerateTemporaryPathCredentials(ctx, generateTemporaryPathCredentialsReq) diff --git a/cmd/workspace/token-management/token-management.go b/cmd/workspace/token-management/token-management.go index f7a02d091c..438769a936 100755 --- a/cmd/workspace/token-management/token-management.go +++ b/cmd/workspace/token-management/token-management.go @@ -126,6 +126,7 @@ func newCreateOboToken() *cobra.Command { return fmt.Errorf("expected to have application id of the service principal") } createOboTokenReq.ApplicationId = args[0] + } response, err := w.TokenManagement.CreateOboToken(ctx, createOboTokenReq) diff --git a/cmd/workspace/vector-search-endpoints/vector-search-endpoints.go b/cmd/workspace/vector-search-endpoints/vector-search-endpoints.go index 17da8b0a74..ef5d757e60 100755 --- a/cmd/workspace/vector-search-endpoints/vector-search-endpoints.go +++ b/cmd/workspace/vector-search-endpoints/vector-search-endpoints.go @@ -121,6 +121,7 @@ func newCreateEndpoint() *cobra.Command { if err != nil { return fmt.Errorf("invalid ENDPOINT_TYPE: %s", args[1]) } + } wait, err := w.VectorSearchEndpoints.CreateEndpoint(ctx, createEndpointReq) diff --git a/cmd/workspace/vector-search-indexes/vector-search-indexes.go b/cmd/workspace/vector-search-indexes/vector-search-indexes.go index b39fa35b40..1fe0bcd6d1 100755 --- a/cmd/workspace/vector-search-indexes/vector-search-indexes.go +++ b/cmd/workspace/vector-search-indexes/vector-search-indexes.go @@ -135,6 +135,7 @@ func newCreateIndex() *cobra.Command { if err != nil { return fmt.Errorf("invalid INDEX_TYPE: %s", args[3]) } + } response, err := w.VectorSearchIndexes.CreateIndex(ctx, createIndexReq) diff --git a/cmd/workspace/volumes/volumes.go b/cmd/workspace/volumes/volumes.go index 006e30d400..7e14adabd0 100755 --- a/cmd/workspace/volumes/volumes.go +++ b/cmd/workspace/volumes/volumes.go @@ -151,6 +151,7 @@ func newCreate() *cobra.Command { if err != nil { return fmt.Errorf("invalid VOLUME_TYPE: %s", args[3]) } + } response, err := w.Volumes.Create(ctx, createReq) @@ -277,6 +278,11 @@ func newList() *cobra.Command { and the **USE_SCHEMA** privilege on the parent schema. There is no guarantee of a specific ordering of the elements in the array. + + PAGINATION BEHAVIOR: The API is by default paginated, a page may contain zero + results while still providing a next_page_token. Clients must continue reading + pages until next_page_token is absent, which is the only indication that the + end of results has been reached. Arguments: CATALOG_NAME: The identifier of the catalog diff --git a/cmd/workspace/workspace-bindings/workspace-bindings.go b/cmd/workspace/workspace-bindings/workspace-bindings.go index 5cb1802442..194be2961e 100755 --- a/cmd/workspace/workspace-bindings/workspace-bindings.go +++ b/cmd/workspace/workspace-bindings/workspace-bindings.go @@ -139,6 +139,14 @@ func newGetBindings() *cobra.Command { Gets workspace bindings of the securable. The caller must be a metastore admin or an owner of the securable. + + NOTE: we recommend using max_results=0 to use the paginated version of this + API. Unpaginated calls will be deprecated soon. + + PAGINATION BEHAVIOR: When using pagination (max_results >= 0), a page may + contain zero results while still providing a next_page_token. Clients must + continue reading pages until next_page_token is absent, which is the only + indication that the end of results has been reached. Arguments: SECURABLE_TYPE: The type of the securable to bind to a workspace (catalog, diff --git a/cmd/workspace/workspace-iam-v2/workspace-iam-v2.go b/cmd/workspace/workspace-iam-v2/workspace-iam-v2.go index bfa75ba936..956c208e7e 100755 --- a/cmd/workspace/workspace-iam-v2/workspace-iam-v2.go +++ b/cmd/workspace/workspace-iam-v2/workspace-iam-v2.go @@ -358,4 +358,4 @@ func newResolveUserProxy() *cobra.Command { return cmd } -// end service workspace_iamV2 +// end service WorkspaceIamV2 diff --git a/cmd/workspace/workspace/workspace.go b/cmd/workspace/workspace/workspace.go index c7339ab0e8..502b11fdb7 100755 --- a/cmd/workspace/workspace/workspace.go +++ b/cmd/workspace/workspace/workspace.go @@ -136,6 +136,7 @@ func newDelete() *cobra.Command { return fmt.Errorf("expected to have the absolute path of the notebook or directory") } deleteReq.Path = args[0] + } err = w.Workspace.Delete(ctx, deleteReq) @@ -456,7 +457,7 @@ func newImport() *cobra.Command { false, this call returns an error RESOURCE_ALREADY_EXISTS. To import a directory, you can use either the DBC format or the SOURCE format with the language field unset. To import a single file as SOURCE, you must set the - language field. + language field. Zip files within directories are not supported. Arguments: PATH: The absolute path of the object or directory. Importing a directory is diff --git a/experimental/python/databricks/bundles/jobs/_models/clean_rooms_notebook_task.py b/experimental/python/databricks/bundles/jobs/_models/clean_rooms_notebook_task.py index 7d30a1bad1..d0281f144c 100644 --- a/experimental/python/databricks/bundles/jobs/_models/clean_rooms_notebook_task.py +++ b/experimental/python/databricks/bundles/jobs/_models/clean_rooms_notebook_task.py @@ -15,7 +15,10 @@ @dataclass(kw_only=True) class CleanRoomsNotebookTask: - """""" + """ + Clean Rooms notebook task for V1 Clean Room service (GA). + Replaces the deprecated CleanRoomNotebookTask (defined above) which was for V0 service. + """ clean_room_name: VariableOr[str] """ diff --git a/experimental/python/databricks/bundles/pipelines/_models/day_of_week.py b/experimental/python/databricks/bundles/pipelines/_models/day_of_week.py index eaf5cbc9ff..a685c2b308 100644 --- a/experimental/python/databricks/bundles/pipelines/_models/day_of_week.py +++ b/experimental/python/databricks/bundles/pipelines/_models/day_of_week.py @@ -6,7 +6,7 @@ class DayOfWeek(Enum): """ :meta private: [EXPERIMENTAL] - Days of week in which the restart is allowed to happen (within a five-hour window starting at start_hour). + Days of week in which the window is allowed to happen. If not specified all days of the week will be used. """ diff --git a/experimental/python/databricks/bundles/pipelines/_models/pipeline.py b/experimental/python/databricks/bundles/pipelines/_models/pipeline.py index 0e698a64b8..2b4bbed23b 100644 --- a/experimental/python/databricks/bundles/pipelines/_models/pipeline.py +++ b/experimental/python/databricks/bundles/pipelines/_models/pipeline.py @@ -70,8 +70,6 @@ class Pipeline(Resource): budget_policy_id: VariableOrOptional[str] = None """ - :meta private: [EXPERIMENTAL] - Budget policy of this pipeline. """ @@ -212,6 +210,13 @@ class Pipeline(Resource): [DEPRECATED] Target schema (database) to add tables in this pipeline to. Exactly one of `schema` or `target` must be specified. To publish to Unity Catalog, also specify `catalog`. This legacy field is deprecated for pipeline creation in favor of the `schema` field. """ + usage_policy_id: VariableOrOptional[str] = None + """ + :meta private: [EXPERIMENTAL] + + Usage policy of this pipeline. + """ + @classmethod def from_dict(cls, value: "PipelineDict") -> "Self": return _transform(cls, value) @@ -230,8 +235,6 @@ class PipelineDict(TypedDict, total=False): budget_policy_id: VariableOrOptional[str] """ - :meta private: [EXPERIMENTAL] - Budget policy of this pipeline. """ @@ -372,5 +375,12 @@ class PipelineDict(TypedDict, total=False): [DEPRECATED] Target schema (database) to add tables in this pipeline to. Exactly one of `schema` or `target` must be specified. To publish to Unity Catalog, also specify `catalog`. This legacy field is deprecated for pipeline creation in favor of the `schema` field. """ + usage_policy_id: VariableOrOptional[str] + """ + :meta private: [EXPERIMENTAL] + + Usage policy of this pipeline. + """ + PipelineParam = PipelineDict | Pipeline diff --git a/go.mod b/go.mod index 2d65dc93e3..a0403f81f3 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/BurntSushi/toml v1.5.0 // MIT github.com/Masterminds/semver/v3 v3.4.0 // MIT github.com/briandowns/spinner v1.23.1 // Apache 2.0 - github.com/databricks/databricks-sdk-go v0.86.0 // Apache 2.0 + github.com/databricks/databricks-sdk-go v0.89.0 // Apache 2.0 github.com/fatih/color v1.18.0 // MIT github.com/google/uuid v1.6.0 // BSD-3-Clause github.com/gorilla/mux v1.8.1 // BSD 3-Clause diff --git a/go.sum b/go.sum index 9f4bfd09a9..db02c96f7b 100644 --- a/go.sum +++ b/go.sum @@ -29,8 +29,8 @@ github.com/cloudflare/circl v1.6.1/go.mod h1:uddAzsPgqdMAYatqJ0lsjX1oECcQLIlRpzZ github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= github.com/cyphar/filepath-securejoin v0.4.1 h1:JyxxyPEaktOD+GAnqIqTf9A8tHyAG22rowi7HkoSU1s= github.com/cyphar/filepath-securejoin v0.4.1/go.mod h1:Sdj7gXlvMcPZsbhwhQ33GguGLDGQL7h7bg04C/+u9jI= -github.com/databricks/databricks-sdk-go v0.86.0 h1:Di1+NBQlfzBMUhY6w6gS2mtmNXIWycowoCsLCGFQPyU= -github.com/databricks/databricks-sdk-go v0.86.0/go.mod h1:hWoHnHbNLjPKiTm5K/7bcIv3J3Pkgo5x9pPzh8K3RVE= +github.com/databricks/databricks-sdk-go v0.89.0 h1:x3bolIsX49Hov08O/BvH3QGcibD0VuiIOCBnTUGI8zs= +github.com/databricks/databricks-sdk-go v0.89.0/go.mod h1:hWoHnHbNLjPKiTm5K/7bcIv3J3Pkgo5x9pPzh8K3RVE= 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= diff --git a/libs/testdiff/replacement.go b/libs/testdiff/replacement.go index a3d4ec18af..e1b4f8ea6d 100644 --- a/libs/testdiff/replacement.go +++ b/libs/testdiff/replacement.go @@ -12,7 +12,6 @@ import ( "github.com/databricks/cli/internal/testutil" "github.com/databricks/cli/libs/iamutil" - "github.com/databricks/databricks-sdk-go" "github.com/databricks/databricks-sdk-go/config" "github.com/databricks/databricks-sdk-go/service/iam" "golang.org/x/mod/semver" @@ -28,6 +27,8 @@ var ( privatePathRegex = regexp.MustCompile(`(/tmp|/private)(/.*)/([a-zA-Z0-9]+)`) // Version could v0.0.0-dev+21e1aacf518a or just v0.0.0-dev (the latter is currently the case on Windows) devVersionRegex = regexp.MustCompile(`0\.0\.0-dev(\+[a-f0-9]{10,16})?`) + // Matches databricks-sdk-go/0.90.0 + sdkVersionRegex = regexp.MustCompile(`databricks-sdk-go/[0-9]+\.[0-9]+\.[0-9]+`) ) type Replacement struct { @@ -250,7 +251,7 @@ func PrepareReplacementsDevVersion(t testutil.TestingT, r *ReplacementsContext) func PrepareReplacementSdkVersion(t testutil.TestingT, r *ReplacementsContext) { t.Helper() - r.Set(databricks.Version(), "[SDK_VERSION]") + r.append(sdkVersionRegex, "databricks-sdk-go/[SDK_VERSION]", 0) } func goVersion() string { diff --git a/libs/testserver/alerts.go b/libs/testserver/alerts.go index 31ed356d72..7efd4be648 100644 --- a/libs/testserver/alerts.go +++ b/libs/testserver/alerts.go @@ -32,7 +32,7 @@ func (s *FakeWorkspace) AlertsUpsert(req Request, alertId string) Response { } alert.Id = alertId - alert.LifecycleState = sql.LifecycleStateActive + alert.LifecycleState = sql.AlertLifecycleStateActive s.Alerts[alertId] = alert return Response{