mirror of https://github.com/databricks/cli.git
Bump github.com/databricks/databricks-sdk-go from 0.49.0 to 0.51.0 (#1878)
Known issues: - [ ] _(non-blocking with a command override)_ `apps.Update` requires 2 `name` params (one from path, one from request body) - [ ] _(non-blocking)_ `lakeview.Create` does not require positional argument `display_name` anymore because it's not marked as required in request body Bumps [github.com/databricks/databricks-sdk-go](https://github.com/databricks/databricks-sdk-go) from 0.49.0 to 0.51.0. --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Andrew Nester <andrew.nester@databricks.com>
This commit is contained in:
parent
f80ebe15f8
commit
25838ee0af
|
@ -1 +1 @@
|
||||||
cf9c61453990df0f9453670f2fe68e1b128647a2
|
d25296d2f4aa7bd6195c816fdf82e0f960f775da
|
|
@ -115,6 +115,9 @@ func new{{.PascalName}}() *cobra.Command {
|
||||||
{{- if .Request}}
|
{{- if .Request}}
|
||||||
|
|
||||||
var {{.CamelName}}Req {{.Service.Package.Name}}.{{.Request.PascalName}}
|
var {{.CamelName}}Req {{.Service.Package.Name}}.{{.Request.PascalName}}
|
||||||
|
{{- if .RequestBodyField }}
|
||||||
|
{{.CamelName}}Req.{{.RequestBodyField.PascalName}} = &{{.Service.Package.Name}}.{{.RequestBodyField.Entity.PascalName}}{}
|
||||||
|
{{- end }}
|
||||||
{{- if .CanUseJson}}
|
{{- if .CanUseJson}}
|
||||||
var {{.CamelName}}Json flags.JsonFlag
|
var {{.CamelName}}Json flags.JsonFlag
|
||||||
{{- end}}
|
{{- end}}
|
||||||
|
@ -127,21 +130,27 @@ func new{{.PascalName}}() *cobra.Command {
|
||||||
cmd.Flags().BoolVar(&{{.CamelName}}SkipWait, "no-wait", {{.CamelName}}SkipWait, `do not wait to reach {{range $i, $e := .Wait.Success}}{{if $i}} or {{end}}{{.Content}}{{end}} state`)
|
cmd.Flags().BoolVar(&{{.CamelName}}SkipWait, "no-wait", {{.CamelName}}SkipWait, `do not wait to reach {{range $i, $e := .Wait.Success}}{{if $i}} or {{end}}{{.Content}}{{end}} state`)
|
||||||
cmd.Flags().DurationVar(&{{.CamelName}}Timeout, "timeout", {{.Wait.Timeout}}*time.Minute, `maximum amount of time to reach {{range $i, $e := .Wait.Success}}{{if $i}} or {{end}}{{.Content}}{{end}} state`)
|
cmd.Flags().DurationVar(&{{.CamelName}}Timeout, "timeout", {{.Wait.Timeout}}*time.Minute, `maximum amount of time to reach {{range $i, $e := .Wait.Success}}{{if $i}} or {{end}}{{.Content}}{{end}} state`)
|
||||||
{{end -}}
|
{{end -}}
|
||||||
{{if .Request}}// TODO: short flags
|
{{- $request := .Request -}}
|
||||||
|
{{- if .RequestBodyField -}}
|
||||||
|
{{- $request = .RequestBodyField.Entity -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{if $request }}// TODO: short flags
|
||||||
{{- if .CanUseJson}}
|
{{- if .CanUseJson}}
|
||||||
cmd.Flags().Var(&{{.CamelName}}Json, "json", `either inline JSON string or @path/to/file.json with request body`)
|
cmd.Flags().Var(&{{.CamelName}}Json, "json", `either inline JSON string or @path/to/file.json with request body`)
|
||||||
{{- end}}
|
{{- end}}
|
||||||
{{$method := .}}
|
{{$method := .}}
|
||||||
{{ if not .IsJsonOnly }}
|
{{ if not .IsJsonOnly }}
|
||||||
{{range .Request.Fields -}}
|
{{range $request.Fields -}}
|
||||||
{{- if not .Required -}}
|
{{- if not .Required -}}
|
||||||
{{if .Entity.IsObject }}// TODO: complex arg: {{.Name}}
|
{{if .Entity.IsObject }}// TODO: complex arg: {{.Name}}
|
||||||
{{else if .Entity.IsAny }}// TODO: any: {{.Name}}
|
{{else if .Entity.IsAny }}// TODO: any: {{.Name}}
|
||||||
{{else if .Entity.ArrayValue }}// TODO: array: {{.Name}}
|
{{else if .Entity.ArrayValue }}// TODO: array: {{.Name}}
|
||||||
{{else if .Entity.MapValue }}// TODO: map via StringToStringVar: {{.Name}}
|
{{else if .Entity.MapValue }}// TODO: map via StringToStringVar: {{.Name}}
|
||||||
{{else if .Entity.IsEmpty }}// TODO: output-only field
|
{{else if .Entity.IsEmpty }}// TODO: output-only field
|
||||||
{{else if .Entity.Enum }}cmd.Flags().Var(&{{$method.CamelName}}Req.{{.PascalName}}, "{{.KebabName}}", `{{.Summary | without "`" | trimSuffix "."}}. Supported values: {{template "printArray" .Entity.Enum}}`)
|
{{else if .Entity.IsComputed -}}
|
||||||
{{else}}cmd.Flags().{{template "arg-type" .Entity}}(&{{$method.CamelName}}Req.{{.PascalName}}, "{{.KebabName}}", {{$method.CamelName}}Req.{{.PascalName}}, `{{.Summary | without "`"}}`)
|
{{else if .IsOutputOnly -}}
|
||||||
|
{{else if .Entity.Enum }}cmd.Flags().Var(&{{- template "request-body-obj" (dict "Method" $method "Field" .)}}, "{{.KebabName}}", `{{.Summary | without "`" | trimSuffix "."}}. Supported values: {{template "printArray" .Entity.Enum}}`)
|
||||||
|
{{else}}cmd.Flags().{{template "arg-type" .Entity}}(&{{- template "request-body-obj" (dict "Method" $method "Field" .)}}, "{{.KebabName}}", {{- template "request-body-obj" (dict "Method" $method "Field" .)}}, `{{.Summary | without "`"}}`)
|
||||||
{{end}}
|
{{end}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end}}
|
{{- end}}
|
||||||
|
@ -161,14 +170,14 @@ func new{{.PascalName}}() *cobra.Command {
|
||||||
{{- $noPrompt := or .IsCrudCreate (in $excludeFromPrompts $fullCommandName) }}
|
{{- $noPrompt := or .IsCrudCreate (in $excludeFromPrompts $fullCommandName) }}
|
||||||
|
|
||||||
{{- $hasPosArgs := .HasRequiredPositionalArguments -}}
|
{{- $hasPosArgs := .HasRequiredPositionalArguments -}}
|
||||||
{{- $hasSinglePosArg := and $hasPosArgs (eq 1 (len .Request.RequiredFields)) -}}
|
{{- $hasSinglePosArg := and $hasPosArgs (eq 1 (len $request.RequiredFields)) -}}
|
||||||
{{- $serviceHasNamedIdMap := and (and .Service.List .Service.List.NamedIdMap) (not (eq .PascalName "List")) -}}
|
{{- $serviceHasNamedIdMap := and (and .Service.List .Service.List.NamedIdMap) (not (eq .PascalName "List")) -}}
|
||||||
{{- $hasIdPrompt := and (not $noPrompt) (and $hasSinglePosArg $serviceHasNamedIdMap) -}}
|
{{- $hasIdPrompt := and (not $noPrompt) (and $hasSinglePosArg $serviceHasNamedIdMap) -}}
|
||||||
{{- $wait := and .Wait (and (not .IsCrudRead) (not (eq .SnakeName "get_run"))) -}}
|
{{- $wait := and .Wait (and (not .IsCrudRead) (not (eq .SnakeName "get_run"))) -}}
|
||||||
{{- $hasRequiredArgs := and (not $hasIdPrompt) $hasPosArgs -}}
|
{{- $hasRequiredArgs := and (not $hasIdPrompt) $hasPosArgs -}}
|
||||||
{{- $hasSingleRequiredRequestBodyFieldWithPrompt := and (and $hasIdPrompt .Request) (eq 1 (len .Request.RequiredRequestBodyFields)) -}}
|
{{- $hasSingleRequiredRequestBodyFieldWithPrompt := and (and $hasIdPrompt $request) (eq 1 (len $request.RequiredRequestBodyFields)) -}}
|
||||||
{{- $onlyPathArgsRequiredAsPositionalArguments := and .Request (eq (len .RequiredPositionalArguments) (len .Request.RequiredPathFields)) -}}
|
{{- $onlyPathArgsRequiredAsPositionalArguments := and $request (eq (len .RequiredPositionalArguments) (len $request.RequiredPathFields)) -}}
|
||||||
{{- $hasDifferentArgsWithJsonFlag := and (not $onlyPathArgsRequiredAsPositionalArguments) (and .CanUseJson .Request.HasRequiredRequestBodyFields) -}}
|
{{- $hasDifferentArgsWithJsonFlag := and (not $onlyPathArgsRequiredAsPositionalArguments) (and .CanUseJson (or $request.HasRequiredRequestBodyFields )) -}}
|
||||||
{{- $hasCustomArgHandler := or $hasRequiredArgs $hasDifferentArgsWithJsonFlag -}}
|
{{- $hasCustomArgHandler := or $hasRequiredArgs $hasDifferentArgsWithJsonFlag -}}
|
||||||
|
|
||||||
{{- $atleastOneArgumentWithDescription := false -}}
|
{{- $atleastOneArgumentWithDescription := false -}}
|
||||||
|
@ -206,12 +215,12 @@ func new{{.PascalName}}() *cobra.Command {
|
||||||
cmd.Args = func(cmd *cobra.Command, args []string) error {
|
cmd.Args = func(cmd *cobra.Command, args []string) error {
|
||||||
{{- if $hasDifferentArgsWithJsonFlag }}
|
{{- if $hasDifferentArgsWithJsonFlag }}
|
||||||
if cmd.Flags().Changed("json") {
|
if cmd.Flags().Changed("json") {
|
||||||
err := root.ExactArgs({{len .Request.RequiredPathFields}})(cmd, args)
|
err := root.ExactArgs({{len $request.RequiredPathFields}})(cmd, args)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
{{- if eq 0 (len .Request.RequiredPathFields) }}
|
{{- if eq 0 (len $request.RequiredPathFields) }}
|
||||||
return fmt.Errorf("when --json flag is specified, no positional arguments are required. Provide{{- range $index, $field := .Request.RequiredFields}}{{if $index}},{{end}} '{{$field.Name}}'{{end}} in your JSON input")
|
return fmt.Errorf("when --json flag is specified, no positional arguments are required. Provide{{- range $index, $field := $request.RequiredFields}}{{if $index}},{{end}} '{{$field.Name}}'{{end}} in your JSON input")
|
||||||
{{- else }}
|
{{- else }}
|
||||||
return fmt.Errorf("when --json flag is specified, provide only{{- range $index, $field := .Request.RequiredPathFields}}{{if $index}},{{end}} {{$field.ConstantName}}{{end}} as positional arguments. Provide{{- range $index, $field := .Request.RequiredRequestBodyFields}}{{if $index}},{{end}} '{{$field.Name}}'{{end}} in your JSON input")
|
return fmt.Errorf("when --json flag is specified, provide only{{- range $index, $field := $request.RequiredPathFields}}{{if $index}},{{end}} {{$field.ConstantName}}{{end}} as positional arguments. Provide{{- range $index, $field := $request.RequiredRequestBodyFields}}{{if $index}},{{end}} '{{$field.Name}}'{{end}} in your JSON input")
|
||||||
{{- end }}
|
{{- end }}
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
@ -232,7 +241,7 @@ func new{{.PascalName}}() *cobra.Command {
|
||||||
{{- if .Request }}
|
{{- if .Request }}
|
||||||
{{ if .CanUseJson }}
|
{{ if .CanUseJson }}
|
||||||
if cmd.Flags().Changed("json") {
|
if cmd.Flags().Changed("json") {
|
||||||
diags := {{.CamelName}}Json.Unmarshal(&{{.CamelName}}Req)
|
diags := {{.CamelName}}Json.Unmarshal(&{{.CamelName}}Req{{ if .RequestBodyField }}.{{.RequestBodyField.PascalName}}{{ end }})
|
||||||
if diags.HasError() {
|
if diags.HasError() {
|
||||||
return diags.Error()
|
return diags.Error()
|
||||||
}
|
}
|
||||||
|
@ -251,20 +260,20 @@ func new{{.PascalName}}() *cobra.Command {
|
||||||
{{- if $hasIdPrompt}}
|
{{- if $hasIdPrompt}}
|
||||||
if len(args) == 0 {
|
if len(args) == 0 {
|
||||||
promptSpinner := cmdio.Spinner(ctx)
|
promptSpinner := cmdio.Spinner(ctx)
|
||||||
promptSpinner <- "No{{range .Request.RequiredFields}} {{.ConstantName}}{{end}} argument specified. Loading names for {{.Service.TitleName}} drop-down."
|
promptSpinner <- "No{{range $request.RequiredFields}} {{.ConstantName}}{{end}} argument specified. Loading names for {{.Service.TitleName}} drop-down."
|
||||||
names, err := {{if .Service.IsAccounts}}a{{else}}w{{end}}.{{(.Service.TrimPrefix "account").PascalName}}.{{.Service.List.NamedIdMap.PascalName}}(ctx{{if .Service.List.Request}}, {{.Service.Package.Name}}.{{.Service.List.Request.PascalName}}{}{{end}})
|
names, err := {{if .Service.IsAccounts}}a{{else}}w{{end}}.{{(.Service.TrimPrefix "account").PascalName}}.{{.Service.List.NamedIdMap.PascalName}}(ctx{{if .Service.List.Request}}, {{.Service.Package.Name}}.{{.Service.List.Request.PascalName}}{}{{end}})
|
||||||
close(promptSpinner)
|
close(promptSpinner)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("failed to load names for {{.Service.TitleName}} drop-down. Please manually specify required arguments. Original error: %w", err)
|
return fmt.Errorf("failed to load names for {{.Service.TitleName}} drop-down. Please manually specify required arguments. Original error: %w", err)
|
||||||
}
|
}
|
||||||
id, err := cmdio.Select(ctx, names, "{{range .Request.RequiredFields}}{{.Summary | trimSuffix "."}}{{end}}")
|
id, err := cmdio.Select(ctx, names, "{{range $request.RequiredFields}}{{.Summary | trimSuffix "."}}{{end}}")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
args = append(args, id)
|
args = append(args, id)
|
||||||
}
|
}
|
||||||
if len(args) != 1 {
|
if len(args) != 1 {
|
||||||
return fmt.Errorf("expected to have {{range .Request.RequiredFields}}{{.Summary | trimSuffix "." | lower}}{{end}}")
|
return fmt.Errorf("expected to have {{range $request.RequiredFields}}{{.Summary | trimSuffix "." | lower}}{{end}}")
|
||||||
}
|
}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
@ -388,13 +397,19 @@ func new{{.PascalName}}() *cobra.Command {
|
||||||
if !cmd.Flags().Changed("json") {
|
if !cmd.Flags().Changed("json") {
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{if not $field.Entity.IsString -}}
|
{{if not $field.Entity.IsString -}}
|
||||||
_, err = fmt.Sscan(args[{{$arg}}], &{{$method.CamelName}}Req.{{$field.PascalName}})
|
_, err = fmt.Sscan(args[{{$arg}}], &{{- template "request-body-obj" (dict "Method" $method "Field" $field)}})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("invalid {{$field.ConstantName}}: %s", args[{{$arg}}])
|
return fmt.Errorf("invalid {{$field.ConstantName}}: %s", args[{{$arg}}])
|
||||||
}{{else -}}
|
}{{else -}}
|
||||||
{{$method.CamelName}}Req.{{$field.PascalName}} = args[{{$arg}}]
|
{{- template "request-body-obj" (dict "Method" $method "Field" $field)}} = args[{{$arg}}]
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- if $optionalIfJsonIsUsed }}
|
{{- if $optionalIfJsonIsUsed }}
|
||||||
}
|
}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- define "request-body-obj" -}}
|
||||||
|
{{- $method := .Method -}}
|
||||||
|
{{- $field := .Field -}}
|
||||||
|
{{$method.CamelName}}Req{{ if (and $method.RequestBodyField (not $field.IsPath)) }}.{{$method.RequestBodyField.PascalName}}{{end}}.{{$field.PascalName}}
|
||||||
|
{{- end -}}
|
||||||
|
|
|
@ -30,13 +30,14 @@ cmd/account/users/users.go linguist-generated=true
|
||||||
cmd/account/vpc-endpoints/vpc-endpoints.go linguist-generated=true
|
cmd/account/vpc-endpoints/vpc-endpoints.go linguist-generated=true
|
||||||
cmd/account/workspace-assignment/workspace-assignment.go linguist-generated=true
|
cmd/account/workspace-assignment/workspace-assignment.go linguist-generated=true
|
||||||
cmd/account/workspaces/workspaces.go linguist-generated=true
|
cmd/account/workspaces/workspaces.go linguist-generated=true
|
||||||
|
cmd/workspace/aibi-dashboard-embedding-access-policy/aibi-dashboard-embedding-access-policy.go linguist-generated=true
|
||||||
|
cmd/workspace/aibi-dashboard-embedding-approved-domains/aibi-dashboard-embedding-approved-domains.go linguist-generated=true
|
||||||
cmd/workspace/alerts-legacy/alerts-legacy.go linguist-generated=true
|
cmd/workspace/alerts-legacy/alerts-legacy.go linguist-generated=true
|
||||||
cmd/workspace/alerts/alerts.go linguist-generated=true
|
cmd/workspace/alerts/alerts.go linguist-generated=true
|
||||||
cmd/workspace/apps/apps.go linguist-generated=true
|
cmd/workspace/apps/apps.go linguist-generated=true
|
||||||
cmd/workspace/artifact-allowlists/artifact-allowlists.go linguist-generated=true
|
cmd/workspace/artifact-allowlists/artifact-allowlists.go linguist-generated=true
|
||||||
cmd/workspace/automatic-cluster-update/automatic-cluster-update.go linguist-generated=true
|
cmd/workspace/automatic-cluster-update/automatic-cluster-update.go linguist-generated=true
|
||||||
cmd/workspace/catalogs/catalogs.go linguist-generated=true
|
cmd/workspace/catalogs/catalogs.go linguist-generated=true
|
||||||
cmd/workspace/clean-rooms/clean-rooms.go linguist-generated=true
|
|
||||||
cmd/workspace/cluster-policies/cluster-policies.go linguist-generated=true
|
cmd/workspace/cluster-policies/cluster-policies.go linguist-generated=true
|
||||||
cmd/workspace/clusters/clusters.go linguist-generated=true
|
cmd/workspace/clusters/clusters.go linguist-generated=true
|
||||||
cmd/workspace/cmd.go linguist-generated=true
|
cmd/workspace/cmd.go linguist-generated=true
|
||||||
|
@ -48,6 +49,7 @@ cmd/workspace/consumer-listings/consumer-listings.go linguist-generated=true
|
||||||
cmd/workspace/consumer-personalization-requests/consumer-personalization-requests.go linguist-generated=true
|
cmd/workspace/consumer-personalization-requests/consumer-personalization-requests.go linguist-generated=true
|
||||||
cmd/workspace/consumer-providers/consumer-providers.go linguist-generated=true
|
cmd/workspace/consumer-providers/consumer-providers.go linguist-generated=true
|
||||||
cmd/workspace/credentials-manager/credentials-manager.go linguist-generated=true
|
cmd/workspace/credentials-manager/credentials-manager.go linguist-generated=true
|
||||||
|
cmd/workspace/credentials/credentials.go linguist-generated=true
|
||||||
cmd/workspace/current-user/current-user.go linguist-generated=true
|
cmd/workspace/current-user/current-user.go linguist-generated=true
|
||||||
cmd/workspace/dashboard-widgets/dashboard-widgets.go linguist-generated=true
|
cmd/workspace/dashboard-widgets/dashboard-widgets.go linguist-generated=true
|
||||||
cmd/workspace/dashboards/dashboards.go linguist-generated=true
|
cmd/workspace/dashboards/dashboards.go linguist-generated=true
|
||||||
|
|
|
@ -214,7 +214,7 @@ func (m *applyPresets) Apply(ctx context.Context, b *bundle.Bundle) diag.Diagnos
|
||||||
|
|
||||||
// Dashboards: Prefix
|
// Dashboards: Prefix
|
||||||
for key, dashboard := range r.Dashboards {
|
for key, dashboard := range r.Dashboards {
|
||||||
if dashboard == nil || dashboard.CreateDashboardRequest == nil {
|
if dashboard == nil || dashboard.Dashboard == nil {
|
||||||
diags = diags.Extend(diag.Errorf("dashboard %s s is not defined", key))
|
diags = diags.Extend(diag.Errorf("dashboard %s s is not defined", key))
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,13 +26,13 @@ func TestConfigureDashboardDefaultsParentPath(t *testing.T) {
|
||||||
"d1": {
|
"d1": {
|
||||||
// Empty string is skipped.
|
// Empty string is skipped.
|
||||||
// See below for how it is set.
|
// See below for how it is set.
|
||||||
CreateDashboardRequest: &dashboards.CreateDashboardRequest{
|
Dashboard: &dashboards.Dashboard{
|
||||||
ParentPath: "",
|
ParentPath: "",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"d2": {
|
"d2": {
|
||||||
// Non-empty string is skipped.
|
// Non-empty string is skipped.
|
||||||
CreateDashboardRequest: &dashboards.CreateDashboardRequest{
|
Dashboard: &dashboards.Dashboard{
|
||||||
ParentPath: "already-set",
|
ParentPath: "already-set",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -89,7 +89,7 @@ func TestInitializeURLs(t *testing.T) {
|
||||||
Dashboards: map[string]*resources.Dashboard{
|
Dashboards: map[string]*resources.Dashboard{
|
||||||
"dashboard1": {
|
"dashboard1": {
|
||||||
ID: "01ef8d56871e1d50ae30ce7375e42478",
|
ID: "01ef8d56871e1d50ae30ce7375e42478",
|
||||||
CreateDashboardRequest: &dashboards.CreateDashboardRequest{
|
Dashboard: &dashboards.Dashboard{
|
||||||
DisplayName: "My special dashboard",
|
DisplayName: "My special dashboard",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -126,7 +126,7 @@ func mockBundle(mode config.Mode) *bundle.Bundle {
|
||||||
},
|
},
|
||||||
Dashboards: map[string]*resources.Dashboard{
|
Dashboards: map[string]*resources.Dashboard{
|
||||||
"dashboard1": {
|
"dashboard1": {
|
||||||
CreateDashboardRequest: &dashboards.CreateDashboardRequest{
|
Dashboard: &dashboards.Dashboard{
|
||||||
DisplayName: "dashboard1",
|
DisplayName: "dashboard1",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -28,7 +28,7 @@ func TestTranslatePathsDashboards_FilePathRelativeSubDirectory(t *testing.T) {
|
||||||
Resources: config.Resources{
|
Resources: config.Resources{
|
||||||
Dashboards: map[string]*resources.Dashboard{
|
Dashboards: map[string]*resources.Dashboard{
|
||||||
"dashboard": {
|
"dashboard": {
|
||||||
CreateDashboardRequest: &dashboards.CreateDashboardRequest{
|
Dashboard: &dashboards.Dashboard{
|
||||||
DisplayName: "My Dashboard",
|
DisplayName: "My Dashboard",
|
||||||
},
|
},
|
||||||
FilePath: "../src/my_dashboard.lvdash.json",
|
FilePath: "../src/my_dashboard.lvdash.json",
|
||||||
|
|
|
@ -17,7 +17,7 @@ type Dashboard struct {
|
||||||
ModifiedStatus ModifiedStatus `json:"modified_status,omitempty" bundle:"internal"`
|
ModifiedStatus ModifiedStatus `json:"modified_status,omitempty" bundle:"internal"`
|
||||||
URL string `json:"url,omitempty" bundle:"internal"`
|
URL string `json:"url,omitempty" bundle:"internal"`
|
||||||
|
|
||||||
*dashboards.CreateDashboardRequest
|
*dashboards.Dashboard
|
||||||
|
|
||||||
// =========================
|
// =========================
|
||||||
// === Additional fields ===
|
// === Additional fields ===
|
||||||
|
|
|
@ -29,7 +29,7 @@ func mockDashboardBundle(t *testing.T) *bundle.Bundle {
|
||||||
Resources: config.Resources{
|
Resources: config.Resources{
|
||||||
Dashboards: map[string]*resources.Dashboard{
|
Dashboards: map[string]*resources.Dashboard{
|
||||||
"dash1": {
|
"dash1": {
|
||||||
CreateDashboardRequest: &dashboards.CreateDashboardRequest{
|
Dashboard: &dashboards.Dashboard{
|
||||||
DisplayName: "My Special Dashboard",
|
DisplayName: "My Special Dashboard",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -792,7 +792,7 @@ func TestTerraformToBundleEmptyRemoteResources(t *testing.T) {
|
||||||
},
|
},
|
||||||
Dashboards: map[string]*resources.Dashboard{
|
Dashboards: map[string]*resources.Dashboard{
|
||||||
"test_dashboard": {
|
"test_dashboard": {
|
||||||
CreateDashboardRequest: &dashboards.CreateDashboardRequest{
|
Dashboard: &dashboards.Dashboard{
|
||||||
DisplayName: "test_dashboard",
|
DisplayName: "test_dashboard",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -951,12 +951,12 @@ func TestTerraformToBundleModifiedResources(t *testing.T) {
|
||||||
},
|
},
|
||||||
Dashboards: map[string]*resources.Dashboard{
|
Dashboards: map[string]*resources.Dashboard{
|
||||||
"test_dashboard": {
|
"test_dashboard": {
|
||||||
CreateDashboardRequest: &dashboards.CreateDashboardRequest{
|
Dashboard: &dashboards.Dashboard{
|
||||||
DisplayName: "test_dashboard",
|
DisplayName: "test_dashboard",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"test_dashboard_new": {
|
"test_dashboard_new": {
|
||||||
CreateDashboardRequest: &dashboards.CreateDashboardRequest{
|
Dashboard: &dashboards.Dashboard{
|
||||||
DisplayName: "test_dashboard_new",
|
DisplayName: "test_dashboard_new",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -15,7 +15,7 @@ import (
|
||||||
|
|
||||||
func TestConvertDashboard(t *testing.T) {
|
func TestConvertDashboard(t *testing.T) {
|
||||||
var src = resources.Dashboard{
|
var src = resources.Dashboard{
|
||||||
CreateDashboardRequest: &dashboards.CreateDashboardRequest{
|
Dashboard: &dashboards.Dashboard{
|
||||||
DisplayName: "my dashboard",
|
DisplayName: "my dashboard",
|
||||||
WarehouseId: "f00dcafe",
|
WarehouseId: "f00dcafe",
|
||||||
ParentPath: "/some/path",
|
ParentPath: "/some/path",
|
||||||
|
|
|
@ -59,9 +59,14 @@ func TestJsonSchema(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Assert enum values are loaded
|
// Assert enum values are loaded
|
||||||
schedule := walk(s.Definitions, "github.com", "databricks", "databricks-sdk-go", "service", "catalog.MonitorCronSchedule")
|
schedule := walk(s.Definitions, "github.com", "databricks", "databricks-sdk-go", "service", "pipelines.RestartWindow")
|
||||||
assert.Contains(t, schedule.AnyOf[0].Properties["pause_status"].Enum, "PAUSED")
|
assert.Contains(t, schedule.AnyOf[0].Properties["days_of_week"].Enum, "MONDAY")
|
||||||
assert.Contains(t, schedule.AnyOf[0].Properties["pause_status"].Enum, "UNPAUSED")
|
assert.Contains(t, schedule.AnyOf[0].Properties["days_of_week"].Enum, "TUESDAY")
|
||||||
|
assert.Contains(t, schedule.AnyOf[0].Properties["days_of_week"].Enum, "WEDNESDAY")
|
||||||
|
assert.Contains(t, schedule.AnyOf[0].Properties["days_of_week"].Enum, "THURSDAY")
|
||||||
|
assert.Contains(t, schedule.AnyOf[0].Properties["days_of_week"].Enum, "FRIDAY")
|
||||||
|
assert.Contains(t, schedule.AnyOf[0].Properties["days_of_week"].Enum, "SATURDAY")
|
||||||
|
assert.Contains(t, schedule.AnyOf[0].Properties["days_of_week"].Enum, "SUNDAY")
|
||||||
|
|
||||||
providers := walk(s.Definitions, "github.com", "databricks", "databricks-sdk-go", "service", "jobs.GitProvider")
|
providers := walk(s.Definitions, "github.com", "databricks", "databricks-sdk-go", "service", "jobs.GitProvider")
|
||||||
assert.Contains(t, providers.Enum, "gitHub")
|
assert.Contains(t, providers.Enum, "gitHub")
|
||||||
|
|
|
@ -185,6 +185,14 @@
|
||||||
{
|
{
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
"create_time": {
|
||||||
|
"description": "The timestamp of when the dashboard was created.",
|
||||||
|
"$ref": "#/$defs/string"
|
||||||
|
},
|
||||||
|
"dashboard_id": {
|
||||||
|
"description": "UUID identifying the dashboard.",
|
||||||
|
"$ref": "#/$defs/string"
|
||||||
|
},
|
||||||
"display_name": {
|
"display_name": {
|
||||||
"description": "The display name of the dashboard.",
|
"description": "The display name of the dashboard.",
|
||||||
"$ref": "#/$defs/string"
|
"$ref": "#/$defs/string"
|
||||||
|
@ -192,13 +200,25 @@
|
||||||
"embed_credentials": {
|
"embed_credentials": {
|
||||||
"$ref": "#/$defs/bool"
|
"$ref": "#/$defs/bool"
|
||||||
},
|
},
|
||||||
|
"etag": {
|
||||||
|
"description": "The etag for the dashboard. Can be optionally provided on updates to ensure that the dashboard\nhas not been modified since the last read.\nThis field is excluded in List Dashboards responses.",
|
||||||
|
"$ref": "#/$defs/string"
|
||||||
|
},
|
||||||
"file_path": {
|
"file_path": {
|
||||||
"$ref": "#/$defs/string"
|
"$ref": "#/$defs/string"
|
||||||
},
|
},
|
||||||
|
"lifecycle_state": {
|
||||||
|
"description": "The state of the dashboard resource. Used for tracking trashed status.",
|
||||||
|
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/dashboards.LifecycleState"
|
||||||
|
},
|
||||||
"parent_path": {
|
"parent_path": {
|
||||||
"description": "The workspace path of the folder containing the dashboard. Includes leading slash and no\ntrailing slash.\nThis field is excluded in List Dashboards responses.",
|
"description": "The workspace path of the folder containing the dashboard. Includes leading slash and no\ntrailing slash.\nThis field is excluded in List Dashboards responses.",
|
||||||
"$ref": "#/$defs/string"
|
"$ref": "#/$defs/string"
|
||||||
},
|
},
|
||||||
|
"path": {
|
||||||
|
"description": "The workspace path of the dashboard asset, including the file name.\nExported dashboards always have the file extension `.lvdash.json`.\nThis field is excluded in List Dashboards responses.",
|
||||||
|
"$ref": "#/$defs/string"
|
||||||
|
},
|
||||||
"permissions": {
|
"permissions": {
|
||||||
"$ref": "#/$defs/slice/github.com/databricks/cli/bundle/config/resources.Permission"
|
"$ref": "#/$defs/slice/github.com/databricks/cli/bundle/config/resources.Permission"
|
||||||
},
|
},
|
||||||
|
@ -206,15 +226,16 @@
|
||||||
"description": "The contents of the dashboard in serialized string form.\nThis field is excluded in List Dashboards responses.\nUse the [get dashboard API](https://docs.databricks.com/api/workspace/lakeview/get)\nto retrieve an example response, which includes the `serialized_dashboard` field.\nThis field provides the structure of the JSON string that represents the dashboard's\nlayout and components.",
|
"description": "The contents of the dashboard in serialized string form.\nThis field is excluded in List Dashboards responses.\nUse the [get dashboard API](https://docs.databricks.com/api/workspace/lakeview/get)\nto retrieve an example response, which includes the `serialized_dashboard` field.\nThis field provides the structure of the JSON string that represents the dashboard's\nlayout and components.",
|
||||||
"$ref": "#/$defs/interface"
|
"$ref": "#/$defs/interface"
|
||||||
},
|
},
|
||||||
|
"update_time": {
|
||||||
|
"description": "The timestamp of when the dashboard was last updated by the user.\nThis field is excluded in List Dashboards responses.",
|
||||||
|
"$ref": "#/$defs/string"
|
||||||
|
},
|
||||||
"warehouse_id": {
|
"warehouse_id": {
|
||||||
"description": "The warehouse ID used to run the dashboard.",
|
"description": "The warehouse ID used to run the dashboard.",
|
||||||
"$ref": "#/$defs/string"
|
"$ref": "#/$defs/string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"additionalProperties": false,
|
"additionalProperties": false
|
||||||
"required": [
|
|
||||||
"display_name"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "string",
|
"type": "string",
|
||||||
|
@ -551,7 +572,7 @@
|
||||||
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.Filters"
|
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.Filters"
|
||||||
},
|
},
|
||||||
"gateway_definition": {
|
"gateway_definition": {
|
||||||
"description": "The definition of a gateway pipeline to support CDC.",
|
"description": "The definition of a gateway pipeline to support change data capture.",
|
||||||
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.IngestionGatewayPipelineDefinition"
|
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.IngestionGatewayPipelineDefinition"
|
||||||
},
|
},
|
||||||
"id": {
|
"id": {
|
||||||
|
@ -581,6 +602,10 @@
|
||||||
"description": "Whether Photon is enabled for this pipeline.",
|
"description": "Whether Photon is enabled for this pipeline.",
|
||||||
"$ref": "#/$defs/bool"
|
"$ref": "#/$defs/bool"
|
||||||
},
|
},
|
||||||
|
"restart_window": {
|
||||||
|
"description": "Restart window of this pipeline.",
|
||||||
|
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.RestartWindow"
|
||||||
|
},
|
||||||
"schema": {
|
"schema": {
|
||||||
"description": "The default schema (database) where tables are read from or published to. The presence of this field implies that the pipeline is in direct publishing mode.",
|
"description": "The default schema (database) where tables are read from or published to. The presence of this field implies that the pipeline is in direct publishing mode.",
|
||||||
"$ref": "#/$defs/string"
|
"$ref": "#/$defs/string"
|
||||||
|
@ -1289,11 +1314,7 @@
|
||||||
"properties": {
|
"properties": {
|
||||||
"pause_status": {
|
"pause_status": {
|
||||||
"description": "Read only field that indicates whether a schedule is paused or not.",
|
"description": "Read only field that indicates whether a schedule is paused or not.",
|
||||||
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/catalog.MonitorCronSchedulePauseStatus",
|
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/catalog.MonitorCronSchedulePauseStatus"
|
||||||
"enum": [
|
|
||||||
"UNPAUSED",
|
|
||||||
"PAUSED"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"quartz_cron_expression": {
|
"quartz_cron_expression": {
|
||||||
"description": "The expression that determines when to run the monitor. See [examples](https://www.quartz-scheduler.org/documentation/quartz-2.3.0/tutorials/crontrigger.html).\n",
|
"description": "The expression that determines when to run the monitor. See [examples](https://www.quartz-scheduler.org/documentation/quartz-2.3.0/tutorials/crontrigger.html).\n",
|
||||||
|
@ -1317,7 +1338,12 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"catalog.MonitorCronSchedulePauseStatus": {
|
"catalog.MonitorCronSchedulePauseStatus": {
|
||||||
"type": "string"
|
"type": "string",
|
||||||
|
"description": "Read only field that indicates whether a schedule is paused or not.",
|
||||||
|
"enum": [
|
||||||
|
"UNPAUSED",
|
||||||
|
"PAUSED"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"catalog.MonitorDataClassificationConfig": {
|
"catalog.MonitorDataClassificationConfig": {
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
|
@ -1382,11 +1408,7 @@
|
||||||
},
|
},
|
||||||
"problem_type": {
|
"problem_type": {
|
||||||
"description": "Problem type the model aims to solve. Determines the type of model-quality metrics that will be computed.",
|
"description": "Problem type the model aims to solve. Determines the type of model-quality metrics that will be computed.",
|
||||||
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/catalog.MonitorInferenceLogProblemType",
|
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/catalog.MonitorInferenceLogProblemType"
|
||||||
"enum": [
|
|
||||||
"PROBLEM_TYPE_CLASSIFICATION",
|
|
||||||
"PROBLEM_TYPE_REGRESSION"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"timestamp_col": {
|
"timestamp_col": {
|
||||||
"description": "Column that contains the timestamps of requests. The column must be one of the following:\n- A ``TimestampType`` column\n- A column whose values can be converted to timestamps through the pyspark\n ``to_timestamp`` [function](https://spark.apache.org/docs/latest/api/python/reference/pyspark.sql/api/pyspark.sql.functions.to_timestamp.html).\n",
|
"description": "Column that contains the timestamps of requests. The column must be one of the following:\n- A ``TimestampType`` column\n- A column whose values can be converted to timestamps through the pyspark\n ``to_timestamp`` [function](https://spark.apache.org/docs/latest/api/python/reference/pyspark.sql/api/pyspark.sql.functions.to_timestamp.html).\n",
|
||||||
|
@ -1409,7 +1431,12 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"catalog.MonitorInferenceLogProblemType": {
|
"catalog.MonitorInferenceLogProblemType": {
|
||||||
"type": "string"
|
"type": "string",
|
||||||
|
"description": "Problem type the model aims to solve. Determines the type of model-quality metrics that will be computed.",
|
||||||
|
"enum": [
|
||||||
|
"PROBLEM_TYPE_CLASSIFICATION",
|
||||||
|
"PROBLEM_TYPE_REGRESSION"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"catalog.MonitorMetric": {
|
"catalog.MonitorMetric": {
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
|
@ -1434,12 +1461,7 @@
|
||||||
},
|
},
|
||||||
"type": {
|
"type": {
|
||||||
"description": "Can only be one of ``\"CUSTOM_METRIC_TYPE_AGGREGATE\"``, ``\"CUSTOM_METRIC_TYPE_DERIVED\"``, or ``\"CUSTOM_METRIC_TYPE_DRIFT\"``.\nThe ``\"CUSTOM_METRIC_TYPE_AGGREGATE\"`` and ``\"CUSTOM_METRIC_TYPE_DERIVED\"`` metrics\nare computed on a single table, whereas the ``\"CUSTOM_METRIC_TYPE_DRIFT\"`` compare metrics across\nbaseline and input table, or across the two consecutive time windows.\n- CUSTOM_METRIC_TYPE_AGGREGATE: only depend on the existing columns in your table\n- CUSTOM_METRIC_TYPE_DERIVED: depend on previously computed aggregate metrics\n- CUSTOM_METRIC_TYPE_DRIFT: depend on previously computed aggregate or derived metrics\n",
|
"description": "Can only be one of ``\"CUSTOM_METRIC_TYPE_AGGREGATE\"``, ``\"CUSTOM_METRIC_TYPE_DERIVED\"``, or ``\"CUSTOM_METRIC_TYPE_DRIFT\"``.\nThe ``\"CUSTOM_METRIC_TYPE_AGGREGATE\"`` and ``\"CUSTOM_METRIC_TYPE_DERIVED\"`` metrics\nare computed on a single table, whereas the ``\"CUSTOM_METRIC_TYPE_DRIFT\"`` compare metrics across\nbaseline and input table, or across the two consecutive time windows.\n- CUSTOM_METRIC_TYPE_AGGREGATE: only depend on the existing columns in your table\n- CUSTOM_METRIC_TYPE_DERIVED: depend on previously computed aggregate metrics\n- CUSTOM_METRIC_TYPE_DRIFT: depend on previously computed aggregate or derived metrics\n",
|
||||||
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/catalog.MonitorMetricType",
|
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/catalog.MonitorMetricType"
|
||||||
"enum": [
|
|
||||||
"CUSTOM_METRIC_TYPE_AGGREGATE",
|
|
||||||
"CUSTOM_METRIC_TYPE_DERIVED",
|
|
||||||
"CUSTOM_METRIC_TYPE_DRIFT"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"additionalProperties": false,
|
"additionalProperties": false,
|
||||||
|
@ -1458,7 +1480,13 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"catalog.MonitorMetricType": {
|
"catalog.MonitorMetricType": {
|
||||||
"type": "string"
|
"type": "string",
|
||||||
|
"description": "Can only be one of ``\"CUSTOM_METRIC_TYPE_AGGREGATE\"``, ``\"CUSTOM_METRIC_TYPE_DERIVED\"``, or ``\"CUSTOM_METRIC_TYPE_DRIFT\"``.\nThe ``\"CUSTOM_METRIC_TYPE_AGGREGATE\"`` and ``\"CUSTOM_METRIC_TYPE_DERIVED\"`` metrics\nare computed on a single table, whereas the ``\"CUSTOM_METRIC_TYPE_DRIFT\"`` compare metrics across\nbaseline and input table, or across the two consecutive time windows.\n- CUSTOM_METRIC_TYPE_AGGREGATE: only depend on the existing columns in your table\n- CUSTOM_METRIC_TYPE_DERIVED: depend on previously computed aggregate metrics\n- CUSTOM_METRIC_TYPE_DRIFT: depend on previously computed aggregate or derived metrics\n",
|
||||||
|
"enum": [
|
||||||
|
"CUSTOM_METRIC_TYPE_AGGREGATE",
|
||||||
|
"CUSTOM_METRIC_TYPE_DERIVED",
|
||||||
|
"CUSTOM_METRIC_TYPE_DRIFT"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"catalog.MonitorNotifications": {
|
"catalog.MonitorNotifications": {
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
|
@ -2325,6 +2353,13 @@
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"dashboards.LifecycleState": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
"ACTIVE",
|
||||||
|
"TRASHED"
|
||||||
|
]
|
||||||
|
},
|
||||||
"jobs.Condition": {
|
"jobs.Condition": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"enum": [
|
"enum": [
|
||||||
|
@ -3102,7 +3137,7 @@
|
||||||
"$ref": "#/$defs/slice/string"
|
"$ref": "#/$defs/slice/string"
|
||||||
},
|
},
|
||||||
"jar_params": {
|
"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](/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\nUse [Task parameter variables](https://docs.databricks.com/jobs.html#parameter-variables) to set parameters containing information about job runs.",
|
||||||
"$ref": "#/$defs/slice/string"
|
"$ref": "#/$defs/slice/string"
|
||||||
},
|
},
|
||||||
"job_id": {
|
"job_id": {
|
||||||
|
@ -3436,11 +3471,11 @@
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"condition_task": {
|
"condition_task": {
|
||||||
"description": "If condition_task, specifies a condition with an outcome that can be used to control the execution of other tasks. Does not require a cluster to execute and does not support retries or notifications.",
|
"description": "The task evaluates a condition that can be used to control the execution of other tasks when the `condition_task` field is present.\nThe condition task does not require a cluster to execute and does not support retries or notifications.",
|
||||||
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.ConditionTask"
|
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.ConditionTask"
|
||||||
},
|
},
|
||||||
"dbt_task": {
|
"dbt_task": {
|
||||||
"description": "If dbt_task, indicates that this must execute a dbt task. It requires both Databricks SQL and the ability to use a serverless or a pro SQL warehouse.",
|
"description": "The task runs one or more dbt commands when the `dbt_task` field is present. The dbt task requires both Databricks SQL and the ability to use a serverless or a pro SQL warehouse.",
|
||||||
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.DbtTask"
|
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.DbtTask"
|
||||||
},
|
},
|
||||||
"depends_on": {
|
"depends_on": {
|
||||||
|
@ -3468,7 +3503,7 @@
|
||||||
"$ref": "#/$defs/string"
|
"$ref": "#/$defs/string"
|
||||||
},
|
},
|
||||||
"for_each_task": {
|
"for_each_task": {
|
||||||
"description": "If for_each_task, indicates that this task must execute the nested task within it.",
|
"description": "The task executes a nested task for every input provided when the `for_each_task` field is present.",
|
||||||
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.ForEachTask"
|
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.ForEachTask"
|
||||||
},
|
},
|
||||||
"health": {
|
"health": {
|
||||||
|
@ -3495,7 +3530,7 @@
|
||||||
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.ClusterSpec"
|
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.ClusterSpec"
|
||||||
},
|
},
|
||||||
"notebook_task": {
|
"notebook_task": {
|
||||||
"description": "If notebook_task, indicates that this task must run a notebook. This field may not be specified in conjunction with spark_jar_task.",
|
"description": "The task runs a notebook when the `notebook_task` field is present.",
|
||||||
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.NotebookTask"
|
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.NotebookTask"
|
||||||
},
|
},
|
||||||
"notification_settings": {
|
"notification_settings": {
|
||||||
|
@ -3503,11 +3538,11 @@
|
||||||
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.TaskNotificationSettings"
|
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.TaskNotificationSettings"
|
||||||
},
|
},
|
||||||
"pipeline_task": {
|
"pipeline_task": {
|
||||||
"description": "If pipeline_task, indicates that this task must execute a Pipeline.",
|
"description": "The task triggers a pipeline update when the `pipeline_task` field is present. Only pipelines configured to use triggered more are supported.",
|
||||||
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.PipelineTask"
|
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.PipelineTask"
|
||||||
},
|
},
|
||||||
"python_wheel_task": {
|
"python_wheel_task": {
|
||||||
"description": "If python_wheel_task, indicates that this job must execute a PythonWheel.",
|
"description": "The task runs a Python wheel when the `python_wheel_task` field is present.",
|
||||||
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.PythonWheelTask"
|
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.PythonWheelTask"
|
||||||
},
|
},
|
||||||
"retry_on_timeout": {
|
"retry_on_timeout": {
|
||||||
|
@ -3519,23 +3554,23 @@
|
||||||
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.RunIf"
|
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.RunIf"
|
||||||
},
|
},
|
||||||
"run_job_task": {
|
"run_job_task": {
|
||||||
"description": "If run_job_task, indicates that this task must execute another job.",
|
"description": "The task triggers another job when the `run_job_task` field is present.",
|
||||||
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.RunJobTask"
|
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.RunJobTask"
|
||||||
},
|
},
|
||||||
"spark_jar_task": {
|
"spark_jar_task": {
|
||||||
"description": "If spark_jar_task, indicates that this task must run a JAR.",
|
"description": "The task runs a JAR when the `spark_jar_task` field is present.",
|
||||||
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.SparkJarTask"
|
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.SparkJarTask"
|
||||||
},
|
},
|
||||||
"spark_python_task": {
|
"spark_python_task": {
|
||||||
"description": "If spark_python_task, indicates that this task must run a Python file.",
|
"description": "The task runs a Python file when the `spark_python_task` field is present.",
|
||||||
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.SparkPythonTask"
|
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.SparkPythonTask"
|
||||||
},
|
},
|
||||||
"spark_submit_task": {
|
"spark_submit_task": {
|
||||||
"description": "If `spark_submit_task`, indicates that this task must be launched by the spark submit script. This task can run only on new clusters.\n\nIn the `new_cluster` specification, `libraries` and `spark_conf` are not supported. Instead, use `--jars` and `--py-files` to add Java and Python libraries and `--conf` to set the Spark configurations.\n\n`master`, `deploy-mode`, and `executor-cores` are automatically configured by Databricks; you _cannot_ specify them in parameters.\n\nBy default, the Spark submit job uses all available memory (excluding reserved memory for Databricks services). You can set `--driver-memory`, and `--executor-memory` to a smaller value to leave some room for off-heap usage.\n\nThe `--jars`, `--py-files`, `--files` arguments support DBFS and S3 paths.",
|
"description": "(Legacy) The task runs the spark-submit script when the `spark_submit_task` field is present. This task can run only on new clusters and is not compatible with serverless compute.\n\nIn the `new_cluster` specification, `libraries` and `spark_conf` are not supported. Instead, use `--jars` and `--py-files` to add Java and Python libraries and `--conf` to set the Spark configurations.\n\n`master`, `deploy-mode`, and `executor-cores` are automatically configured by Databricks; you _cannot_ specify them in parameters.\n\nBy default, the Spark submit job uses all available memory (excluding reserved memory for Databricks services). You can set `--driver-memory`, and `--executor-memory` to a smaller value to leave some room for off-heap usage.\n\nThe `--jars`, `--py-files`, `--files` arguments support DBFS and S3 paths.",
|
||||||
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.SparkSubmitTask"
|
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.SparkSubmitTask"
|
||||||
},
|
},
|
||||||
"sql_task": {
|
"sql_task": {
|
||||||
"description": "If sql_task, indicates that this job must execute a SQL task.",
|
"description": "The task runs a SQL query or file, or it refreshes a SQL alert or a legacy SQL dashboard when the `sql_task` field is present.",
|
||||||
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.SqlTask"
|
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.SqlTask"
|
||||||
},
|
},
|
||||||
"task_key": {
|
"task_key": {
|
||||||
|
@ -3821,12 +3856,7 @@
|
||||||
},
|
},
|
||||||
"status": {
|
"status": {
|
||||||
"description": "Current status of `model_version`",
|
"description": "Current status of `model_version`",
|
||||||
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/ml.ModelVersionStatus",
|
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/ml.ModelVersionStatus"
|
||||||
"enum": [
|
|
||||||
"PENDING_REGISTRATION",
|
|
||||||
"FAILED_REGISTRATION",
|
|
||||||
"READY"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"status_message": {
|
"status_message": {
|
||||||
"description": "Details on current `status`, if it is pending or failed.",
|
"description": "Details on current `status`, if it is pending or failed.",
|
||||||
|
@ -3854,7 +3884,13 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"ml.ModelVersionStatus": {
|
"ml.ModelVersionStatus": {
|
||||||
"type": "string"
|
"type": "string",
|
||||||
|
"description": "Current status of `model_version`",
|
||||||
|
"enum": [
|
||||||
|
"PENDING_REGISTRATION",
|
||||||
|
"FAILED_REGISTRATION",
|
||||||
|
"READY"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"ml.ModelVersionTag": {
|
"ml.ModelVersionTag": {
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
|
@ -3951,15 +3987,15 @@
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"report": {
|
"report": {
|
||||||
"description": "Select tables from a specific source report.",
|
"description": "Select a specific source report.",
|
||||||
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.ReportSpec"
|
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.ReportSpec"
|
||||||
},
|
},
|
||||||
"schema": {
|
"schema": {
|
||||||
"description": "Select tables from a specific source schema.",
|
"description": "Select all tables from a specific source schema.",
|
||||||
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.SchemaSpec"
|
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.SchemaSpec"
|
||||||
},
|
},
|
||||||
"table": {
|
"table": {
|
||||||
"description": "Select tables from a specific source table.",
|
"description": "Select a specific source table.",
|
||||||
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.TableSpec"
|
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.TableSpec"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -3977,7 +4013,11 @@
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"connection_id": {
|
"connection_id": {
|
||||||
"description": "Immutable. The Unity Catalog connection this gateway pipeline uses to communicate with the source.",
|
"description": "[Deprecated, use connection_name instead] Immutable. The Unity Catalog connection that this gateway pipeline uses to communicate with the source.",
|
||||||
|
"$ref": "#/$defs/string"
|
||||||
|
},
|
||||||
|
"connection_name": {
|
||||||
|
"description": "Immutable. The Unity Catalog connection that this gateway pipeline uses to communicate with the source.",
|
||||||
"$ref": "#/$defs/string"
|
"$ref": "#/$defs/string"
|
||||||
},
|
},
|
||||||
"gateway_storage_catalog": {
|
"gateway_storage_catalog": {
|
||||||
|
@ -4007,11 +4047,11 @@
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"connection_name": {
|
"connection_name": {
|
||||||
"description": "Immutable. The Unity Catalog connection this ingestion pipeline uses to communicate with the source. Specify either ingestion_gateway_id or connection_name.",
|
"description": "Immutable. The Unity Catalog connection that this ingestion pipeline uses to communicate with the source. This is used with connectors for applications like Salesforce, Workday, and so on.",
|
||||||
"$ref": "#/$defs/string"
|
"$ref": "#/$defs/string"
|
||||||
},
|
},
|
||||||
"ingestion_gateway_id": {
|
"ingestion_gateway_id": {
|
||||||
"description": "Immutable. Identifier for the ingestion gateway used by this ingestion pipeline to communicate with the source. Specify either ingestion_gateway_id or connection_name.",
|
"description": "Immutable. Identifier for the gateway that is used by this ingestion pipeline to communicate with the source database. This is used with connectors to databases like SQL Server.",
|
||||||
"$ref": "#/$defs/string"
|
"$ref": "#/$defs/string"
|
||||||
},
|
},
|
||||||
"objects": {
|
"objects": {
|
||||||
|
@ -4188,11 +4228,7 @@
|
||||||
},
|
},
|
||||||
"mode": {
|
"mode": {
|
||||||
"description": "Databricks Enhanced Autoscaling optimizes cluster utilization by automatically\nallocating cluster resources based on workload volume, with minimal impact to\nthe data processing latency of your pipelines. Enhanced Autoscaling is available\nfor `updates` clusters only. The legacy autoscaling feature is used for `maintenance`\nclusters.\n",
|
"description": "Databricks Enhanced Autoscaling optimizes cluster utilization by automatically\nallocating cluster resources based on workload volume, with minimal impact to\nthe data processing latency of your pipelines. Enhanced Autoscaling is available\nfor `updates` clusters only. The legacy autoscaling feature is used for `maintenance`\nclusters.\n",
|
||||||
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.PipelineClusterAutoscaleMode",
|
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.PipelineClusterAutoscaleMode"
|
||||||
"enum": [
|
|
||||||
"ENHANCED",
|
|
||||||
"LEGACY"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"additionalProperties": false,
|
"additionalProperties": false,
|
||||||
|
@ -4208,7 +4244,12 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"pipelines.PipelineClusterAutoscaleMode": {
|
"pipelines.PipelineClusterAutoscaleMode": {
|
||||||
"type": "string"
|
"type": "string",
|
||||||
|
"description": "Databricks Enhanced Autoscaling optimizes cluster utilization by automatically\nallocating cluster resources based on workload volume, with minimal impact to\nthe data processing latency of your pipelines. Enhanced Autoscaling is available\nfor `updates` clusters only. The legacy autoscaling feature is used for `maintenance`\nclusters.\n",
|
||||||
|
"enum": [
|
||||||
|
"ENHANCED",
|
||||||
|
"LEGACY"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"pipelines.PipelineDeployment": {
|
"pipelines.PipelineDeployment": {
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
|
@ -4320,6 +4361,47 @@
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"pipelines.RestartWindow": {
|
||||||
|
"anyOf": [
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"days_of_week": {
|
||||||
|
"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.",
|
||||||
|
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.RestartWindowDaysOfWeek",
|
||||||
|
"enum": [
|
||||||
|
"MONDAY",
|
||||||
|
"TUESDAY",
|
||||||
|
"WEDNESDAY",
|
||||||
|
"THURSDAY",
|
||||||
|
"FRIDAY",
|
||||||
|
"SATURDAY",
|
||||||
|
"SUNDAY"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"start_hour": {
|
||||||
|
"description": "An integer between 0 and 23 denoting the start hour for the restart window in the 24-hour day.\nContinuous pipeline restart is triggered only within a five-hour window starting at this hour.",
|
||||||
|
"$ref": "#/$defs/int"
|
||||||
|
},
|
||||||
|
"time_zone_id": {
|
||||||
|
"description": "Time zone id of restart window. See https://docs.databricks.com/sql/language-manual/sql-ref-syntax-aux-conf-mgmt-set-timezone.html for details.\nIf not specified, UTC will be used.",
|
||||||
|
"$ref": "#/$defs/string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties": false,
|
||||||
|
"required": [
|
||||||
|
"start_hour"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"pattern": "\\$\\{(var(\\.[a-zA-Z]+([-_]?[a-zA-Z0-9]+)*(\\[[0-9]+\\])*)+)\\}"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"pipelines.RestartWindowDaysOfWeek": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"pipelines.SchemaSpec": {
|
"pipelines.SchemaSpec": {
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
|
@ -4411,11 +4493,7 @@
|
||||||
},
|
},
|
||||||
"scd_type": {
|
"scd_type": {
|
||||||
"description": "The SCD type to use to ingest the table.",
|
"description": "The SCD type to use to ingest the table.",
|
||||||
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.TableSpecificConfigScdType",
|
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.TableSpecificConfigScdType"
|
||||||
"enum": [
|
|
||||||
"SCD_TYPE_1",
|
|
||||||
"SCD_TYPE_2"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"sequence_by": {
|
"sequence_by": {
|
||||||
"description": "The column names specifying the logical order of events in the source data. Delta Live Tables uses this sequencing to handle change events that arrive out of order.",
|
"description": "The column names specifying the logical order of events in the source data. Delta Live Tables uses this sequencing to handle change events that arrive out of order.",
|
||||||
|
@ -4431,7 +4509,12 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"pipelines.TableSpecificConfigScdType": {
|
"pipelines.TableSpecificConfigScdType": {
|
||||||
"type": "string"
|
"type": "string",
|
||||||
|
"description": "The SCD type to use to ingest the table.",
|
||||||
|
"enum": [
|
||||||
|
"SCD_TYPE_1",
|
||||||
|
"SCD_TYPE_2"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"serving.Ai21LabsConfig": {
|
"serving.Ai21LabsConfig": {
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
|
@ -4520,11 +4603,7 @@
|
||||||
"properties": {
|
"properties": {
|
||||||
"behavior": {
|
"behavior": {
|
||||||
"description": "Behavior for PII filter. Currently only 'BLOCK' is supported. If 'BLOCK' is set for the input guardrail and the request contains PII, the request is not sent to the model server and 400 status code is returned; if 'BLOCK' is set for the output guardrail and the model response contains PII, the PII info in the response is redacted and 400 status code is returned.",
|
"description": "Behavior for PII filter. Currently only 'BLOCK' is supported. If 'BLOCK' is set for the input guardrail and the request contains PII, the request is not sent to the model server and 400 status code is returned; if 'BLOCK' is set for the output guardrail and the model response contains PII, the PII info in the response is redacted and 400 status code is returned.",
|
||||||
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.AiGatewayGuardrailPiiBehaviorBehavior",
|
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.AiGatewayGuardrailPiiBehaviorBehavior"
|
||||||
"enum": [
|
|
||||||
"NONE",
|
|
||||||
"BLOCK"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"additionalProperties": false,
|
"additionalProperties": false,
|
||||||
|
@ -4539,7 +4618,12 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"serving.AiGatewayGuardrailPiiBehaviorBehavior": {
|
"serving.AiGatewayGuardrailPiiBehaviorBehavior": {
|
||||||
"type": "string"
|
"type": "string",
|
||||||
|
"description": "Behavior for PII filter. Currently only 'BLOCK' is supported. If 'BLOCK' is set for the input guardrail and the request contains PII, the request is not sent to the model server and 400 status code is returned; if 'BLOCK' is set for the output guardrail and the model response contains PII, the PII info in the response is redacted and 400 status code is returned.",
|
||||||
|
"enum": [
|
||||||
|
"NONE",
|
||||||
|
"BLOCK"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"serving.AiGatewayGuardrails": {
|
"serving.AiGatewayGuardrails": {
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
|
@ -4604,18 +4688,11 @@
|
||||||
},
|
},
|
||||||
"key": {
|
"key": {
|
||||||
"description": "Key field for a rate limit. Currently, only 'user' and 'endpoint' are supported, with 'endpoint' being the default if not specified.",
|
"description": "Key field for a rate limit. Currently, only 'user' and 'endpoint' are supported, with 'endpoint' being the default if not specified.",
|
||||||
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.AiGatewayRateLimitKey",
|
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.AiGatewayRateLimitKey"
|
||||||
"enum": [
|
|
||||||
"user",
|
|
||||||
"endpoint"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"renewal_period": {
|
"renewal_period": {
|
||||||
"description": "Renewal period field for a rate limit. Currently, only 'minute' is supported.",
|
"description": "Renewal period field for a rate limit. Currently, only 'minute' is supported.",
|
||||||
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.AiGatewayRateLimitRenewalPeriod",
|
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.AiGatewayRateLimitRenewalPeriod"
|
||||||
"enum": [
|
|
||||||
"minute"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"additionalProperties": false,
|
"additionalProperties": false,
|
||||||
|
@ -4631,10 +4708,19 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"serving.AiGatewayRateLimitKey": {
|
"serving.AiGatewayRateLimitKey": {
|
||||||
"type": "string"
|
"type": "string",
|
||||||
|
"description": "Key field for a rate limit. Currently, only 'user' and 'endpoint' are supported, with 'endpoint' being the default if not specified.",
|
||||||
|
"enum": [
|
||||||
|
"user",
|
||||||
|
"endpoint"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"serving.AiGatewayRateLimitRenewalPeriod": {
|
"serving.AiGatewayRateLimitRenewalPeriod": {
|
||||||
"type": "string"
|
"type": "string",
|
||||||
|
"description": "Renewal period field for a rate limit. Currently, only 'minute' is supported.",
|
||||||
|
"enum": [
|
||||||
|
"minute"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"serving.AiGatewayUsageTrackingConfig": {
|
"serving.AiGatewayUsageTrackingConfig": {
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
|
@ -4681,13 +4767,7 @@
|
||||||
},
|
},
|
||||||
"bedrock_provider": {
|
"bedrock_provider": {
|
||||||
"description": "The underlying provider in Amazon Bedrock. Supported values (case insensitive) include: Anthropic, Cohere, AI21Labs, Amazon.",
|
"description": "The underlying provider in Amazon Bedrock. Supported values (case insensitive) include: Anthropic, Cohere, AI21Labs, Amazon.",
|
||||||
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.AmazonBedrockConfigBedrockProvider",
|
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.AmazonBedrockConfigBedrockProvider"
|
||||||
"enum": [
|
|
||||||
"anthropic",
|
|
||||||
"cohere",
|
|
||||||
"ai21labs",
|
|
||||||
"amazon"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"additionalProperties": false,
|
"additionalProperties": false,
|
||||||
|
@ -4703,7 +4783,14 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"serving.AmazonBedrockConfigBedrockProvider": {
|
"serving.AmazonBedrockConfigBedrockProvider": {
|
||||||
"type": "string"
|
"type": "string",
|
||||||
|
"description": "The underlying provider in Amazon Bedrock. Supported values (case insensitive) include: Anthropic, Cohere, AI21Labs, Amazon.",
|
||||||
|
"enum": [
|
||||||
|
"anthropic",
|
||||||
|
"cohere",
|
||||||
|
"ai21labs",
|
||||||
|
"amazon"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"serving.AnthropicConfig": {
|
"serving.AnthropicConfig": {
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
|
@ -4910,17 +4997,7 @@
|
||||||
},
|
},
|
||||||
"provider": {
|
"provider": {
|
||||||
"description": "The name of the provider for the external model. Currently, the supported providers are 'ai21labs', 'anthropic',\n'amazon-bedrock', 'cohere', 'databricks-model-serving', 'google-cloud-vertex-ai', 'openai', and 'palm'.\",\n",
|
"description": "The name of the provider for the external model. Currently, the supported providers are 'ai21labs', 'anthropic',\n'amazon-bedrock', 'cohere', 'databricks-model-serving', 'google-cloud-vertex-ai', 'openai', and 'palm'.\",\n",
|
||||||
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.ExternalModelProvider",
|
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.ExternalModelProvider"
|
||||||
"enum": [
|
|
||||||
"ai21labs",
|
|
||||||
"anthropic",
|
|
||||||
"amazon-bedrock",
|
|
||||||
"cohere",
|
|
||||||
"databricks-model-serving",
|
|
||||||
"google-cloud-vertex-ai",
|
|
||||||
"openai",
|
|
||||||
"palm"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"task": {
|
"task": {
|
||||||
"description": "The task type of the external model.",
|
"description": "The task type of the external model.",
|
||||||
|
@ -4941,7 +5018,18 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"serving.ExternalModelProvider": {
|
"serving.ExternalModelProvider": {
|
||||||
"type": "string"
|
"type": "string",
|
||||||
|
"description": "The name of the provider for the external model. Currently, the supported providers are 'ai21labs', 'anthropic',\n'amazon-bedrock', 'cohere', 'databricks-model-serving', 'google-cloud-vertex-ai', 'openai', and 'palm'.\",\n",
|
||||||
|
"enum": [
|
||||||
|
"ai21labs",
|
||||||
|
"anthropic",
|
||||||
|
"amazon-bedrock",
|
||||||
|
"cohere",
|
||||||
|
"databricks-model-serving",
|
||||||
|
"google-cloud-vertex-ai",
|
||||||
|
"openai",
|
||||||
|
"palm"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"serving.GoogleCloudVertexAiConfig": {
|
"serving.GoogleCloudVertexAiConfig": {
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
|
@ -5047,18 +5135,11 @@
|
||||||
},
|
},
|
||||||
"key": {
|
"key": {
|
||||||
"description": "Key field for a serving endpoint rate limit. Currently, only 'user' and 'endpoint' are supported, with 'endpoint' being the default if not specified.",
|
"description": "Key field for a serving endpoint rate limit. Currently, only 'user' and 'endpoint' are supported, with 'endpoint' being the default if not specified.",
|
||||||
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.RateLimitKey",
|
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.RateLimitKey"
|
||||||
"enum": [
|
|
||||||
"user",
|
|
||||||
"endpoint"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"renewal_period": {
|
"renewal_period": {
|
||||||
"description": "Renewal period field for a serving endpoint rate limit. Currently, only 'minute' is supported.",
|
"description": "Renewal period field for a serving endpoint rate limit. Currently, only 'minute' is supported.",
|
||||||
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.RateLimitRenewalPeriod",
|
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.RateLimitRenewalPeriod"
|
||||||
"enum": [
|
|
||||||
"minute"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"additionalProperties": false,
|
"additionalProperties": false,
|
||||||
|
@ -5074,10 +5155,19 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"serving.RateLimitKey": {
|
"serving.RateLimitKey": {
|
||||||
"type": "string"
|
"type": "string",
|
||||||
|
"description": "Key field for a serving endpoint rate limit. Currently, only 'user' and 'endpoint' are supported, with 'endpoint' being the default if not specified.",
|
||||||
|
"enum": [
|
||||||
|
"user",
|
||||||
|
"endpoint"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"serving.RateLimitRenewalPeriod": {
|
"serving.RateLimitRenewalPeriod": {
|
||||||
"type": "string"
|
"type": "string",
|
||||||
|
"description": "Renewal period field for a serving endpoint rate limit. Currently, only 'minute' is supported.",
|
||||||
|
"enum": [
|
||||||
|
"minute"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"serving.Route": {
|
"serving.Route": {
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
|
@ -5202,23 +5292,11 @@
|
||||||
},
|
},
|
||||||
"workload_size": {
|
"workload_size": {
|
||||||
"description": "The workload size of the served model. The workload size corresponds to a range of provisioned concurrency that the compute will autoscale between.\nA single unit of provisioned concurrency can process one request at a time.\nValid workload sizes are \"Small\" (4 - 4 provisioned concurrency), \"Medium\" (8 - 16 provisioned concurrency), and \"Large\" (16 - 64 provisioned concurrency).\nIf scale-to-zero is enabled, the lower bound of the provisioned concurrency for each workload size will be 0.\n",
|
"description": "The workload size of the served model. The workload size corresponds to a range of provisioned concurrency that the compute will autoscale between.\nA single unit of provisioned concurrency can process one request at a time.\nValid workload sizes are \"Small\" (4 - 4 provisioned concurrency), \"Medium\" (8 - 16 provisioned concurrency), and \"Large\" (16 - 64 provisioned concurrency).\nIf scale-to-zero is enabled, the lower bound of the provisioned concurrency for each workload size will be 0.\n",
|
||||||
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.ServedModelInputWorkloadSize",
|
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.ServedModelInputWorkloadSize"
|
||||||
"enum": [
|
|
||||||
"Small",
|
|
||||||
"Medium",
|
|
||||||
"Large"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"workload_type": {
|
"workload_type": {
|
||||||
"description": "The workload type of the served model. The workload type selects which type of compute to use in the endpoint. The default value for this parameter is\n\"CPU\". For deep learning workloads, GPU acceleration is available by selecting workload types like GPU_SMALL and others.\nSee the available [GPU types](https://docs.databricks.com/machine-learning/model-serving/create-manage-serving-endpoints.html#gpu-workload-types).\n",
|
"description": "The workload type of the served model. The workload type selects which type of compute to use in the endpoint. The default value for this parameter is\n\"CPU\". For deep learning workloads, GPU acceleration is available by selecting workload types like GPU_SMALL and others.\nSee the available [GPU types](https://docs.databricks.com/machine-learning/model-serving/create-manage-serving-endpoints.html#gpu-workload-types).\n",
|
||||||
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.ServedModelInputWorkloadType",
|
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.ServedModelInputWorkloadType"
|
||||||
"enum": [
|
|
||||||
"CPU",
|
|
||||||
"GPU_SMALL",
|
|
||||||
"GPU_MEDIUM",
|
|
||||||
"GPU_LARGE",
|
|
||||||
"MULTIGPU_MEDIUM"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"additionalProperties": false,
|
"additionalProperties": false,
|
||||||
|
@ -5235,10 +5313,24 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"serving.ServedModelInputWorkloadSize": {
|
"serving.ServedModelInputWorkloadSize": {
|
||||||
"type": "string"
|
"type": "string",
|
||||||
|
"description": "The workload size of the served model. The workload size corresponds to a range of provisioned concurrency that the compute will autoscale between.\nA single unit of provisioned concurrency can process one request at a time.\nValid workload sizes are \"Small\" (4 - 4 provisioned concurrency), \"Medium\" (8 - 16 provisioned concurrency), and \"Large\" (16 - 64 provisioned concurrency).\nIf scale-to-zero is enabled, the lower bound of the provisioned concurrency for each workload size will be 0.\n",
|
||||||
|
"enum": [
|
||||||
|
"Small",
|
||||||
|
"Medium",
|
||||||
|
"Large"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"serving.ServedModelInputWorkloadType": {
|
"serving.ServedModelInputWorkloadType": {
|
||||||
"type": "string"
|
"type": "string",
|
||||||
|
"description": "The workload type of the served model. The workload type selects which type of compute to use in the endpoint. The default value for this parameter is\n\"CPU\". For deep learning workloads, GPU acceleration is available by selecting workload types like GPU_SMALL and others.\nSee the available [GPU types](https://docs.databricks.com/machine-learning/model-serving/create-manage-serving-endpoints.html#gpu-workload-types).\n",
|
||||||
|
"enum": [
|
||||||
|
"CPU",
|
||||||
|
"GPU_SMALL",
|
||||||
|
"GPU_MEDIUM",
|
||||||
|
"GPU_LARGE",
|
||||||
|
"MULTIGPU_MEDIUM"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"serving.TrafficConfig": {
|
"serving.TrafficConfig": {
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
|
|
|
@ -191,6 +191,8 @@ func newList() *cobra.Command {
|
||||||
|
|
||||||
// TODO: short flags
|
// TODO: short flags
|
||||||
|
|
||||||
|
cmd.Flags().StringVar(&listReq.PageToken, "page-token", listReq.PageToken, `An opaque page token which was the next_page_token in the response of the previous request to list the secrets for this service principal.`)
|
||||||
|
|
||||||
cmd.Use = "list SERVICE_PRINCIPAL_ID"
|
cmd.Use = "list SERVICE_PRINCIPAL_ID"
|
||||||
cmd.Short = `List service principal secrets.`
|
cmd.Short = `List service principal secrets.`
|
||||||
cmd.Long = `List service principal secrets.
|
cmd.Long = `List service principal secrets.
|
||||||
|
|
|
@ -81,6 +81,7 @@ func newCreate() *cobra.Command {
|
||||||
cmd.Flags().StringVar(&createReq.DeploymentName, "deployment-name", createReq.DeploymentName, `The deployment name defines part of the subdomain for the workspace.`)
|
cmd.Flags().StringVar(&createReq.DeploymentName, "deployment-name", createReq.DeploymentName, `The deployment name defines part of the subdomain for the workspace.`)
|
||||||
// TODO: complex arg: gcp_managed_network_config
|
// TODO: complex arg: gcp_managed_network_config
|
||||||
// TODO: complex arg: gke_config
|
// TODO: complex arg: gke_config
|
||||||
|
cmd.Flags().BoolVar(&createReq.IsNoPublicIpEnabled, "is-no-public-ip-enabled", createReq.IsNoPublicIpEnabled, `Whether no public IP is enabled for the workspace.`)
|
||||||
cmd.Flags().StringVar(&createReq.Location, "location", createReq.Location, `The Google Cloud region of the workspace data plane in your Google account.`)
|
cmd.Flags().StringVar(&createReq.Location, "location", createReq.Location, `The Google Cloud region of the workspace data plane in your Google account.`)
|
||||||
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.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.NetworkId, "network-id", createReq.NetworkId, ``)
|
cmd.Flags().StringVar(&createReq.NetworkId, "network-id", createReq.NetworkId, ``)
|
||||||
|
@ -420,6 +421,7 @@ func newUpdate() *cobra.Command {
|
||||||
cmd.Flags().StringVar(&updateReq.ManagedServicesCustomerManagedKeyId, "managed-services-customer-managed-key-id", updateReq.ManagedServicesCustomerManagedKeyId, `The ID of the workspace's managed services encryption key configuration object.`)
|
cmd.Flags().StringVar(&updateReq.ManagedServicesCustomerManagedKeyId, "managed-services-customer-managed-key-id", updateReq.ManagedServicesCustomerManagedKeyId, `The ID of the workspace's managed services encryption key configuration object.`)
|
||||||
cmd.Flags().StringVar(&updateReq.NetworkConnectivityConfigId, "network-connectivity-config-id", updateReq.NetworkConnectivityConfigId, ``)
|
cmd.Flags().StringVar(&updateReq.NetworkConnectivityConfigId, "network-connectivity-config-id", updateReq.NetworkConnectivityConfigId, ``)
|
||||||
cmd.Flags().StringVar(&updateReq.NetworkId, "network-id", updateReq.NetworkId, `The ID of the workspace's network configuration object.`)
|
cmd.Flags().StringVar(&updateReq.NetworkId, "network-id", updateReq.NetworkId, `The ID of the workspace's network configuration object.`)
|
||||||
|
cmd.Flags().StringVar(&updateReq.PrivateAccessSettingsId, "private-access-settings-id", updateReq.PrivateAccessSettingsId, `The ID of the workspace's private access settings configuration object.`)
|
||||||
cmd.Flags().StringVar(&updateReq.StorageConfigurationId, "storage-configuration-id", updateReq.StorageConfigurationId, `The ID of the workspace's storage configuration object.`)
|
cmd.Flags().StringVar(&updateReq.StorageConfigurationId, "storage-configuration-id", updateReq.StorageConfigurationId, `The ID of the workspace's storage configuration object.`)
|
||||||
cmd.Flags().StringVar(&updateReq.StorageCustomerManagedKeyId, "storage-customer-managed-key-id", updateReq.StorageCustomerManagedKeyId, `The ID of the key configuration object for workspace storage.`)
|
cmd.Flags().StringVar(&updateReq.StorageCustomerManagedKeyId, "storage-customer-managed-key-id", updateReq.StorageCustomerManagedKeyId, `The ID of the key configuration object for workspace storage.`)
|
||||||
|
|
||||||
|
|
162
cmd/workspace/aibi-dashboard-embedding-access-policy/aibi-dashboard-embedding-access-policy.go
generated
Executable file
162
cmd/workspace/aibi-dashboard-embedding-access-policy/aibi-dashboard-embedding-access-policy.go
generated
Executable file
|
@ -0,0 +1,162 @@
|
||||||
|
// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT.
|
||||||
|
|
||||||
|
package aibi_dashboard_embedding_access_policy
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/databricks/cli/cmd/root"
|
||||||
|
"github.com/databricks/cli/libs/cmdio"
|
||||||
|
"github.com/databricks/cli/libs/flags"
|
||||||
|
"github.com/databricks/databricks-sdk-go/service/settings"
|
||||||
|
"github.com/spf13/cobra"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Slice with functions to override default command behavior.
|
||||||
|
// Functions can be added from the `init()` function in manually curated files in this directory.
|
||||||
|
var cmdOverrides []func(*cobra.Command)
|
||||||
|
|
||||||
|
func New() *cobra.Command {
|
||||||
|
cmd := &cobra.Command{
|
||||||
|
Use: "aibi-dashboard-embedding-access-policy",
|
||||||
|
Short: `Controls whether AI/BI published dashboard embedding is enabled, conditionally enabled, or disabled at the workspace level.`,
|
||||||
|
Long: `Controls whether AI/BI published dashboard embedding is enabled, conditionally
|
||||||
|
enabled, or disabled at the workspace level. By default, this setting is
|
||||||
|
conditionally enabled (ALLOW_APPROVED_DOMAINS).`,
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add methods
|
||||||
|
cmd.AddCommand(newGet())
|
||||||
|
cmd.AddCommand(newUpdate())
|
||||||
|
|
||||||
|
// Apply optional overrides to this command.
|
||||||
|
for _, fn := range cmdOverrides {
|
||||||
|
fn(cmd)
|
||||||
|
}
|
||||||
|
|
||||||
|
return cmd
|
||||||
|
}
|
||||||
|
|
||||||
|
// start get command
|
||||||
|
|
||||||
|
// Slice with functions to override default command behavior.
|
||||||
|
// Functions can be added from the `init()` function in manually curated files in this directory.
|
||||||
|
var getOverrides []func(
|
||||||
|
*cobra.Command,
|
||||||
|
*settings.GetAibiDashboardEmbeddingAccessPolicySettingRequest,
|
||||||
|
)
|
||||||
|
|
||||||
|
func newGet() *cobra.Command {
|
||||||
|
cmd := &cobra.Command{}
|
||||||
|
|
||||||
|
var getReq settings.GetAibiDashboardEmbeddingAccessPolicySettingRequest
|
||||||
|
|
||||||
|
// TODO: short flags
|
||||||
|
|
||||||
|
cmd.Flags().StringVar(&getReq.Etag, "etag", getReq.Etag, `etag used for versioning.`)
|
||||||
|
|
||||||
|
cmd.Use = "get"
|
||||||
|
cmd.Short = `Retrieve the AI/BI dashboard embedding access policy.`
|
||||||
|
cmd.Long = `Retrieve the AI/BI dashboard embedding access policy.
|
||||||
|
|
||||||
|
Retrieves the AI/BI dashboard embedding access policy. The default setting is
|
||||||
|
ALLOW_APPROVED_DOMAINS, permitting AI/BI dashboards to be embedded on approved
|
||||||
|
domains.`
|
||||||
|
|
||||||
|
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 := root.WorkspaceClient(ctx)
|
||||||
|
|
||||||
|
response, err := w.Settings.AibiDashboardEmbeddingAccessPolicy().Get(ctx, getReq)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return cmdio.Render(ctx, response)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Disable completions since they are not applicable.
|
||||||
|
// Can be overridden by manual implementation in `override.go`.
|
||||||
|
cmd.ValidArgsFunction = cobra.NoFileCompletions
|
||||||
|
|
||||||
|
// Apply optional overrides to this command.
|
||||||
|
for _, fn := range getOverrides {
|
||||||
|
fn(cmd, &getReq)
|
||||||
|
}
|
||||||
|
|
||||||
|
return cmd
|
||||||
|
}
|
||||||
|
|
||||||
|
// start update command
|
||||||
|
|
||||||
|
// Slice with functions to override default command behavior.
|
||||||
|
// Functions can be added from the `init()` function in manually curated files in this directory.
|
||||||
|
var updateOverrides []func(
|
||||||
|
*cobra.Command,
|
||||||
|
*settings.UpdateAibiDashboardEmbeddingAccessPolicySettingRequest,
|
||||||
|
)
|
||||||
|
|
||||||
|
func newUpdate() *cobra.Command {
|
||||||
|
cmd := &cobra.Command{}
|
||||||
|
|
||||||
|
var updateReq settings.UpdateAibiDashboardEmbeddingAccessPolicySettingRequest
|
||||||
|
var updateJson flags.JsonFlag
|
||||||
|
|
||||||
|
// TODO: short flags
|
||||||
|
cmd.Flags().Var(&updateJson, "json", `either inline JSON string or @path/to/file.json with request body`)
|
||||||
|
|
||||||
|
cmd.Use = "update"
|
||||||
|
cmd.Short = `Update the AI/BI dashboard embedding access policy.`
|
||||||
|
cmd.Long = `Update the AI/BI dashboard embedding access policy.
|
||||||
|
|
||||||
|
Updates the AI/BI dashboard embedding access policy at the workspace level.`
|
||||||
|
|
||||||
|
cmd.Annotations = make(map[string]string)
|
||||||
|
|
||||||
|
cmd.PreRunE = root.MustWorkspaceClient
|
||||||
|
cmd.RunE = func(cmd *cobra.Command, args []string) (err error) {
|
||||||
|
ctx := cmd.Context()
|
||||||
|
w := root.WorkspaceClient(ctx)
|
||||||
|
|
||||||
|
if cmd.Flags().Changed("json") {
|
||||||
|
diags := updateJson.Unmarshal(&updateReq)
|
||||||
|
if diags.HasError() {
|
||||||
|
return diags.Error()
|
||||||
|
}
|
||||||
|
if len(diags) > 0 {
|
||||||
|
err := cmdio.RenderDiagnosticsToErrorOut(ctx, diags)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return fmt.Errorf("please provide command input in JSON format by specifying the --json flag")
|
||||||
|
}
|
||||||
|
|
||||||
|
response, err := w.Settings.AibiDashboardEmbeddingAccessPolicy().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 AibiDashboardEmbeddingAccessPolicy
|
162
cmd/workspace/aibi-dashboard-embedding-approved-domains/aibi-dashboard-embedding-approved-domains.go
generated
Executable file
162
cmd/workspace/aibi-dashboard-embedding-approved-domains/aibi-dashboard-embedding-approved-domains.go
generated
Executable file
|
@ -0,0 +1,162 @@
|
||||||
|
// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT.
|
||||||
|
|
||||||
|
package aibi_dashboard_embedding_approved_domains
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/databricks/cli/cmd/root"
|
||||||
|
"github.com/databricks/cli/libs/cmdio"
|
||||||
|
"github.com/databricks/cli/libs/flags"
|
||||||
|
"github.com/databricks/databricks-sdk-go/service/settings"
|
||||||
|
"github.com/spf13/cobra"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Slice with functions to override default command behavior.
|
||||||
|
// Functions can be added from the `init()` function in manually curated files in this directory.
|
||||||
|
var cmdOverrides []func(*cobra.Command)
|
||||||
|
|
||||||
|
func New() *cobra.Command {
|
||||||
|
cmd := &cobra.Command{
|
||||||
|
Use: "aibi-dashboard-embedding-approved-domains",
|
||||||
|
Short: `Controls the list of domains approved to host the embedded AI/BI dashboards.`,
|
||||||
|
Long: `Controls the list of domains approved to host the embedded AI/BI dashboards.
|
||||||
|
The approved domains list can't be mutated when the current access policy is
|
||||||
|
not set to ALLOW_APPROVED_DOMAINS.`,
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add methods
|
||||||
|
cmd.AddCommand(newGet())
|
||||||
|
cmd.AddCommand(newUpdate())
|
||||||
|
|
||||||
|
// Apply optional overrides to this command.
|
||||||
|
for _, fn := range cmdOverrides {
|
||||||
|
fn(cmd)
|
||||||
|
}
|
||||||
|
|
||||||
|
return cmd
|
||||||
|
}
|
||||||
|
|
||||||
|
// start get command
|
||||||
|
|
||||||
|
// Slice with functions to override default command behavior.
|
||||||
|
// Functions can be added from the `init()` function in manually curated files in this directory.
|
||||||
|
var getOverrides []func(
|
||||||
|
*cobra.Command,
|
||||||
|
*settings.GetAibiDashboardEmbeddingApprovedDomainsSettingRequest,
|
||||||
|
)
|
||||||
|
|
||||||
|
func newGet() *cobra.Command {
|
||||||
|
cmd := &cobra.Command{}
|
||||||
|
|
||||||
|
var getReq settings.GetAibiDashboardEmbeddingApprovedDomainsSettingRequest
|
||||||
|
|
||||||
|
// TODO: short flags
|
||||||
|
|
||||||
|
cmd.Flags().StringVar(&getReq.Etag, "etag", getReq.Etag, `etag used for versioning.`)
|
||||||
|
|
||||||
|
cmd.Use = "get"
|
||||||
|
cmd.Short = `Retrieve the list of domains approved to host embedded AI/BI dashboards.`
|
||||||
|
cmd.Long = `Retrieve the list of domains approved to host embedded AI/BI dashboards.
|
||||||
|
|
||||||
|
Retrieves the list of domains approved to host embedded AI/BI dashboards.`
|
||||||
|
|
||||||
|
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 := root.WorkspaceClient(ctx)
|
||||||
|
|
||||||
|
response, err := w.Settings.AibiDashboardEmbeddingApprovedDomains().Get(ctx, getReq)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return cmdio.Render(ctx, response)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Disable completions since they are not applicable.
|
||||||
|
// Can be overridden by manual implementation in `override.go`.
|
||||||
|
cmd.ValidArgsFunction = cobra.NoFileCompletions
|
||||||
|
|
||||||
|
// Apply optional overrides to this command.
|
||||||
|
for _, fn := range getOverrides {
|
||||||
|
fn(cmd, &getReq)
|
||||||
|
}
|
||||||
|
|
||||||
|
return cmd
|
||||||
|
}
|
||||||
|
|
||||||
|
// start update command
|
||||||
|
|
||||||
|
// Slice with functions to override default command behavior.
|
||||||
|
// Functions can be added from the `init()` function in manually curated files in this directory.
|
||||||
|
var updateOverrides []func(
|
||||||
|
*cobra.Command,
|
||||||
|
*settings.UpdateAibiDashboardEmbeddingApprovedDomainsSettingRequest,
|
||||||
|
)
|
||||||
|
|
||||||
|
func newUpdate() *cobra.Command {
|
||||||
|
cmd := &cobra.Command{}
|
||||||
|
|
||||||
|
var updateReq settings.UpdateAibiDashboardEmbeddingApprovedDomainsSettingRequest
|
||||||
|
var updateJson flags.JsonFlag
|
||||||
|
|
||||||
|
// TODO: short flags
|
||||||
|
cmd.Flags().Var(&updateJson, "json", `either inline JSON string or @path/to/file.json with request body`)
|
||||||
|
|
||||||
|
cmd.Use = "update"
|
||||||
|
cmd.Short = `Update the list of domains approved to host embedded AI/BI dashboards.`
|
||||||
|
cmd.Long = `Update the list of domains approved to host embedded AI/BI dashboards.
|
||||||
|
|
||||||
|
Updates the list of domains approved to host embedded AI/BI dashboards. This
|
||||||
|
update will fail if the current workspace access policy is not
|
||||||
|
ALLOW_APPROVED_DOMAINS.`
|
||||||
|
|
||||||
|
cmd.Annotations = make(map[string]string)
|
||||||
|
|
||||||
|
cmd.PreRunE = root.MustWorkspaceClient
|
||||||
|
cmd.RunE = func(cmd *cobra.Command, args []string) (err error) {
|
||||||
|
ctx := cmd.Context()
|
||||||
|
w := root.WorkspaceClient(ctx)
|
||||||
|
|
||||||
|
if cmd.Flags().Changed("json") {
|
||||||
|
diags := updateJson.Unmarshal(&updateReq)
|
||||||
|
if diags.HasError() {
|
||||||
|
return diags.Error()
|
||||||
|
}
|
||||||
|
if len(diags) > 0 {
|
||||||
|
err := cmdio.RenderDiagnosticsToErrorOut(ctx, diags)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return fmt.Errorf("please provide command input in JSON format by specifying the --json flag")
|
||||||
|
}
|
||||||
|
|
||||||
|
response, err := w.Settings.AibiDashboardEmbeddingApprovedDomains().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 AibiDashboardEmbeddingApprovedDomains
|
|
@ -67,6 +67,7 @@ func newCreate() *cobra.Command {
|
||||||
cmd := &cobra.Command{}
|
cmd := &cobra.Command{}
|
||||||
|
|
||||||
var createReq apps.CreateAppRequest
|
var createReq apps.CreateAppRequest
|
||||||
|
createReq.App = &apps.App{}
|
||||||
var createJson flags.JsonFlag
|
var createJson flags.JsonFlag
|
||||||
|
|
||||||
var createSkipWait bool
|
var createSkipWait bool
|
||||||
|
@ -77,7 +78,11 @@ func newCreate() *cobra.Command {
|
||||||
// TODO: short flags
|
// TODO: short flags
|
||||||
cmd.Flags().Var(&createJson, "json", `either inline JSON string or @path/to/file.json with request body`)
|
cmd.Flags().Var(&createJson, "json", `either inline JSON string or @path/to/file.json with request body`)
|
||||||
|
|
||||||
cmd.Flags().StringVar(&createReq.Description, "description", createReq.Description, `The description of the app.`)
|
// TODO: complex arg: active_deployment
|
||||||
|
// TODO: complex arg: app_status
|
||||||
|
// TODO: complex arg: compute_status
|
||||||
|
cmd.Flags().StringVar(&createReq.App.Description, "description", createReq.App.Description, `The description of the app.`)
|
||||||
|
// TODO: complex arg: pending_deployment
|
||||||
// TODO: array: resources
|
// TODO: array: resources
|
||||||
|
|
||||||
cmd.Use = "create NAME"
|
cmd.Use = "create NAME"
|
||||||
|
@ -110,7 +115,7 @@ func newCreate() *cobra.Command {
|
||||||
w := root.WorkspaceClient(ctx)
|
w := root.WorkspaceClient(ctx)
|
||||||
|
|
||||||
if cmd.Flags().Changed("json") {
|
if cmd.Flags().Changed("json") {
|
||||||
diags := createJson.Unmarshal(&createReq)
|
diags := createJson.Unmarshal(&createReq.App)
|
||||||
if diags.HasError() {
|
if diags.HasError() {
|
||||||
return diags.Error()
|
return diags.Error()
|
||||||
}
|
}
|
||||||
|
@ -122,7 +127,7 @@ func newCreate() *cobra.Command {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if !cmd.Flags().Changed("json") {
|
if !cmd.Flags().Changed("json") {
|
||||||
createReq.Name = args[0]
|
createReq.App.Name = args[0]
|
||||||
}
|
}
|
||||||
|
|
||||||
wait, err := w.Apps.Create(ctx, createReq)
|
wait, err := w.Apps.Create(ctx, createReq)
|
||||||
|
@ -234,6 +239,7 @@ func newDeploy() *cobra.Command {
|
||||||
cmd := &cobra.Command{}
|
cmd := &cobra.Command{}
|
||||||
|
|
||||||
var deployReq apps.CreateAppDeploymentRequest
|
var deployReq apps.CreateAppDeploymentRequest
|
||||||
|
deployReq.AppDeployment = &apps.AppDeployment{}
|
||||||
var deployJson flags.JsonFlag
|
var deployJson flags.JsonFlag
|
||||||
|
|
||||||
var deploySkipWait bool
|
var deploySkipWait bool
|
||||||
|
@ -244,9 +250,11 @@ func newDeploy() *cobra.Command {
|
||||||
// TODO: short flags
|
// TODO: short flags
|
||||||
cmd.Flags().Var(&deployJson, "json", `either inline JSON string or @path/to/file.json with request body`)
|
cmd.Flags().Var(&deployJson, "json", `either inline JSON string or @path/to/file.json with request body`)
|
||||||
|
|
||||||
cmd.Flags().StringVar(&deployReq.DeploymentId, "deployment-id", deployReq.DeploymentId, `The unique id of the deployment.`)
|
// TODO: complex arg: deployment_artifacts
|
||||||
cmd.Flags().Var(&deployReq.Mode, "mode", `The mode of which the deployment will manage the source code. Supported values: [AUTO_SYNC, SNAPSHOT]`)
|
cmd.Flags().StringVar(&deployReq.AppDeployment.DeploymentId, "deployment-id", deployReq.AppDeployment.DeploymentId, `The unique id of the deployment.`)
|
||||||
cmd.Flags().StringVar(&deployReq.SourceCodePath, "source-code-path", deployReq.SourceCodePath, `The workspace file system path of the source code used to create the app deployment.`)
|
cmd.Flags().Var(&deployReq.AppDeployment.Mode, "mode", `The mode of which the deployment will manage the source code. Supported values: [AUTO_SYNC, SNAPSHOT]`)
|
||||||
|
cmd.Flags().StringVar(&deployReq.AppDeployment.SourceCodePath, "source-code-path", deployReq.AppDeployment.SourceCodePath, `The workspace file system path of the source code used to create the app deployment.`)
|
||||||
|
// TODO: complex arg: status
|
||||||
|
|
||||||
cmd.Use = "deploy APP_NAME"
|
cmd.Use = "deploy APP_NAME"
|
||||||
cmd.Short = `Create an app deployment.`
|
cmd.Short = `Create an app deployment.`
|
||||||
|
@ -270,7 +278,7 @@ func newDeploy() *cobra.Command {
|
||||||
w := root.WorkspaceClient(ctx)
|
w := root.WorkspaceClient(ctx)
|
||||||
|
|
||||||
if cmd.Flags().Changed("json") {
|
if cmd.Flags().Changed("json") {
|
||||||
diags := deployJson.Unmarshal(&deployReq)
|
diags := deployJson.Unmarshal(&deployReq.AppDeployment)
|
||||||
if diags.HasError() {
|
if diags.HasError() {
|
||||||
return diags.Error()
|
return diags.Error()
|
||||||
}
|
}
|
||||||
|
@ -692,8 +700,9 @@ func newSetPermissions() *cobra.Command {
|
||||||
cmd.Short = `Set app permissions.`
|
cmd.Short = `Set app permissions.`
|
||||||
cmd.Long = `Set app permissions.
|
cmd.Long = `Set app permissions.
|
||||||
|
|
||||||
Sets permissions on an app. Apps can inherit permissions from their root
|
Sets permissions on an object, replacing existing permissions if they exist.
|
||||||
object.
|
Deletes all direct permissions if none are specified. Objects can inherit
|
||||||
|
permissions from their root object.
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
APP_NAME: The app for which to get or manage permissions.`
|
APP_NAME: The app for which to get or manage permissions.`
|
||||||
|
@ -920,28 +929,41 @@ func newUpdate() *cobra.Command {
|
||||||
cmd := &cobra.Command{}
|
cmd := &cobra.Command{}
|
||||||
|
|
||||||
var updateReq apps.UpdateAppRequest
|
var updateReq apps.UpdateAppRequest
|
||||||
|
updateReq.App = &apps.App{}
|
||||||
var updateJson flags.JsonFlag
|
var updateJson flags.JsonFlag
|
||||||
|
|
||||||
// TODO: short flags
|
// TODO: short flags
|
||||||
cmd.Flags().Var(&updateJson, "json", `either inline JSON string or @path/to/file.json with request body`)
|
cmd.Flags().Var(&updateJson, "json", `either inline JSON string or @path/to/file.json with request body`)
|
||||||
|
|
||||||
cmd.Flags().StringVar(&updateReq.Description, "description", updateReq.Description, `The description of the app.`)
|
// TODO: complex arg: active_deployment
|
||||||
|
// TODO: complex arg: app_status
|
||||||
|
// TODO: complex arg: compute_status
|
||||||
|
cmd.Flags().StringVar(&updateReq.App.Description, "description", updateReq.App.Description, `The description of the app.`)
|
||||||
|
// TODO: complex arg: pending_deployment
|
||||||
// TODO: array: resources
|
// TODO: array: resources
|
||||||
|
|
||||||
cmd.Use = "update NAME"
|
cmd.Use = "update NAME NAME"
|
||||||
cmd.Short = `Update an app.`
|
cmd.Short = `Update an app.`
|
||||||
cmd.Long = `Update an app.
|
cmd.Long = `Update an app.
|
||||||
|
|
||||||
Updates the app with the supplied name.
|
Updates the app with the supplied name.
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
|
NAME: The name of the app.
|
||||||
NAME: The name of the app. The name must contain only lowercase alphanumeric
|
NAME: The name of the app. The name must contain only lowercase alphanumeric
|
||||||
characters and hyphens. It must be unique within the workspace.`
|
characters and hyphens. It must be unique within the workspace.`
|
||||||
|
|
||||||
cmd.Annotations = make(map[string]string)
|
cmd.Annotations = make(map[string]string)
|
||||||
|
|
||||||
cmd.Args = func(cmd *cobra.Command, args []string) error {
|
cmd.Args = func(cmd *cobra.Command, args []string) error {
|
||||||
check := root.ExactArgs(1)
|
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 'name' in your JSON input")
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
check := root.ExactArgs(2)
|
||||||
return check(cmd, args)
|
return check(cmd, args)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -951,7 +973,7 @@ func newUpdate() *cobra.Command {
|
||||||
w := root.WorkspaceClient(ctx)
|
w := root.WorkspaceClient(ctx)
|
||||||
|
|
||||||
if cmd.Flags().Changed("json") {
|
if cmd.Flags().Changed("json") {
|
||||||
diags := updateJson.Unmarshal(&updateReq)
|
diags := updateJson.Unmarshal(&updateReq.App)
|
||||||
if diags.HasError() {
|
if diags.HasError() {
|
||||||
return diags.Error()
|
return diags.Error()
|
||||||
}
|
}
|
||||||
|
@ -963,6 +985,9 @@ func newUpdate() *cobra.Command {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
updateReq.Name = args[0]
|
updateReq.Name = args[0]
|
||||||
|
if !cmd.Flags().Changed("json") {
|
||||||
|
updateReq.App.Name = args[1]
|
||||||
|
}
|
||||||
|
|
||||||
response, err := w.Apps.Update(ctx, updateReq)
|
response, err := w.Apps.Update(ctx, updateReq)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -0,0 +1,59 @@
|
||||||
|
package apps
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/databricks/cli/cmd/root"
|
||||||
|
"github.com/databricks/cli/libs/cmdio"
|
||||||
|
"github.com/databricks/cli/libs/flags"
|
||||||
|
"github.com/databricks/databricks-sdk-go/service/apps"
|
||||||
|
"github.com/spf13/cobra"
|
||||||
|
)
|
||||||
|
|
||||||
|
// We override apps.Update command beccause currently genkit does not support
|
||||||
|
// a way to identify that path field (such as name) matches the field in the request body.
|
||||||
|
// As a result, genkit generates a command with 2 required same fields, update NAME NAME.
|
||||||
|
// This override should be removed when genkit supports this.
|
||||||
|
func updateOverride(cmd *cobra.Command, req *apps.UpdateAppRequest) {
|
||||||
|
cmd.Use = "update NAME"
|
||||||
|
cmd.Long = `Update an app.
|
||||||
|
|
||||||
|
Updates the app with the supplied name.
|
||||||
|
|
||||||
|
Arguments:
|
||||||
|
NAME: The name of the app. The name must contain only lowercase alphanumeric
|
||||||
|
characters and hyphens. It must be unique within the workspace.`
|
||||||
|
|
||||||
|
cmd.Args = func(cmd *cobra.Command, args []string) error {
|
||||||
|
check := root.ExactArgs(1)
|
||||||
|
return check(cmd, args)
|
||||||
|
}
|
||||||
|
|
||||||
|
updateJson := cmd.Flag("json").Value.(*flags.JsonFlag)
|
||||||
|
cmd.RunE = func(cmd *cobra.Command, args []string) (err error) {
|
||||||
|
ctx := cmd.Context()
|
||||||
|
w := root.WorkspaceClient(ctx)
|
||||||
|
|
||||||
|
if cmd.Flags().Changed("json") {
|
||||||
|
diags := updateJson.Unmarshal(&req.App)
|
||||||
|
if diags.HasError() {
|
||||||
|
return diags.Error()
|
||||||
|
}
|
||||||
|
if len(diags) > 0 {
|
||||||
|
err := cmdio.RenderDiagnosticsToErrorOut(ctx, diags)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
req.Name = args[0]
|
||||||
|
response, err := w.Apps.Update(ctx, *req)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return cmdio.Render(ctx, response)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
updateOverrides = append(updateOverrides, updateOverride)
|
||||||
|
}
|
|
@ -1,385 +0,0 @@
|
||||||
// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT.
|
|
||||||
|
|
||||||
package clean_rooms
|
|
||||||
|
|
||||||
import (
|
|
||||||
"fmt"
|
|
||||||
|
|
||||||
"github.com/databricks/cli/cmd/root"
|
|
||||||
"github.com/databricks/cli/libs/cmdio"
|
|
||||||
"github.com/databricks/cli/libs/flags"
|
|
||||||
"github.com/databricks/databricks-sdk-go/service/sharing"
|
|
||||||
"github.com/spf13/cobra"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Slice with functions to override default command behavior.
|
|
||||||
// Functions can be added from the `init()` function in manually curated files in this directory.
|
|
||||||
var cmdOverrides []func(*cobra.Command)
|
|
||||||
|
|
||||||
func New() *cobra.Command {
|
|
||||||
cmd := &cobra.Command{
|
|
||||||
Use: "clean-rooms",
|
|
||||||
Short: `A clean room is a secure, privacy-protecting environment where two or more parties can share sensitive enterprise data, including customer data, for measurements, insights, activation and other use cases.`,
|
|
||||||
Long: `A clean room is a secure, privacy-protecting environment where two or more
|
|
||||||
parties can share sensitive enterprise data, including customer data, for
|
|
||||||
measurements, insights, activation and other use cases.
|
|
||||||
|
|
||||||
To create clean rooms, you must be a metastore admin or a user with the
|
|
||||||
**CREATE_CLEAN_ROOM** privilege.`,
|
|
||||||
GroupID: "sharing",
|
|
||||||
Annotations: map[string]string{
|
|
||||||
"package": "sharing",
|
|
||||||
},
|
|
||||||
|
|
||||||
// This service is being previewed; hide from help output.
|
|
||||||
Hidden: true,
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add methods
|
|
||||||
cmd.AddCommand(newCreate())
|
|
||||||
cmd.AddCommand(newDelete())
|
|
||||||
cmd.AddCommand(newGet())
|
|
||||||
cmd.AddCommand(newList())
|
|
||||||
cmd.AddCommand(newUpdate())
|
|
||||||
|
|
||||||
// Apply optional overrides to this command.
|
|
||||||
for _, fn := range cmdOverrides {
|
|
||||||
fn(cmd)
|
|
||||||
}
|
|
||||||
|
|
||||||
return cmd
|
|
||||||
}
|
|
||||||
|
|
||||||
// start create 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 createOverrides []func(
|
|
||||||
*cobra.Command,
|
|
||||||
*sharing.CreateCleanRoom,
|
|
||||||
)
|
|
||||||
|
|
||||||
func newCreate() *cobra.Command {
|
|
||||||
cmd := &cobra.Command{}
|
|
||||||
|
|
||||||
var createReq sharing.CreateCleanRoom
|
|
||||||
var createJson flags.JsonFlag
|
|
||||||
|
|
||||||
// TODO: short flags
|
|
||||||
cmd.Flags().Var(&createJson, "json", `either inline JSON string or @path/to/file.json with request body`)
|
|
||||||
|
|
||||||
cmd.Flags().StringVar(&createReq.Comment, "comment", createReq.Comment, `User-provided free-form text description.`)
|
|
||||||
|
|
||||||
cmd.Use = "create"
|
|
||||||
cmd.Short = `Create a clean room.`
|
|
||||||
cmd.Long = `Create a clean room.
|
|
||||||
|
|
||||||
Creates a new clean room with specified colaborators. The caller must be a
|
|
||||||
metastore admin or have the **CREATE_CLEAN_ROOM** privilege on the metastore.`
|
|
||||||
|
|
||||||
cmd.Annotations = make(map[string]string)
|
|
||||||
|
|
||||||
cmd.PreRunE = root.MustWorkspaceClient
|
|
||||||
cmd.RunE = func(cmd *cobra.Command, args []string) (err error) {
|
|
||||||
ctx := cmd.Context()
|
|
||||||
w := root.WorkspaceClient(ctx)
|
|
||||||
|
|
||||||
if cmd.Flags().Changed("json") {
|
|
||||||
diags := createJson.Unmarshal(&createReq)
|
|
||||||
if diags.HasError() {
|
|
||||||
return diags.Error()
|
|
||||||
}
|
|
||||||
if len(diags) > 0 {
|
|
||||||
err := cmdio.RenderDiagnosticsToErrorOut(ctx, diags)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return fmt.Errorf("please provide command input in JSON format by specifying the --json flag")
|
|
||||||
}
|
|
||||||
|
|
||||||
response, err := w.CleanRooms.Create(ctx, createReq)
|
|
||||||
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 createOverrides {
|
|
||||||
fn(cmd, &createReq)
|
|
||||||
}
|
|
||||||
|
|
||||||
return cmd
|
|
||||||
}
|
|
||||||
|
|
||||||
// start delete command
|
|
||||||
|
|
||||||
// Slice with functions to override default command behavior.
|
|
||||||
// Functions can be added from the `init()` function in manually curated files in this directory.
|
|
||||||
var deleteOverrides []func(
|
|
||||||
*cobra.Command,
|
|
||||||
*sharing.DeleteCleanRoomRequest,
|
|
||||||
)
|
|
||||||
|
|
||||||
func newDelete() *cobra.Command {
|
|
||||||
cmd := &cobra.Command{}
|
|
||||||
|
|
||||||
var deleteReq sharing.DeleteCleanRoomRequest
|
|
||||||
|
|
||||||
// TODO: short flags
|
|
||||||
|
|
||||||
cmd.Use = "delete NAME"
|
|
||||||
cmd.Short = `Delete a clean room.`
|
|
||||||
cmd.Long = `Delete a clean room.
|
|
||||||
|
|
||||||
Deletes a data object clean room from the metastore. The caller must be an
|
|
||||||
owner of the clean room.
|
|
||||||
|
|
||||||
Arguments:
|
|
||||||
NAME: The name of the clean room.`
|
|
||||||
|
|
||||||
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 := root.WorkspaceClient(ctx)
|
|
||||||
|
|
||||||
deleteReq.Name = args[0]
|
|
||||||
|
|
||||||
err = w.CleanRooms.Delete(ctx, deleteReq)
|
|
||||||
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 deleteOverrides {
|
|
||||||
fn(cmd, &deleteReq)
|
|
||||||
}
|
|
||||||
|
|
||||||
return cmd
|
|
||||||
}
|
|
||||||
|
|
||||||
// start get command
|
|
||||||
|
|
||||||
// Slice with functions to override default command behavior.
|
|
||||||
// Functions can be added from the `init()` function in manually curated files in this directory.
|
|
||||||
var getOverrides []func(
|
|
||||||
*cobra.Command,
|
|
||||||
*sharing.GetCleanRoomRequest,
|
|
||||||
)
|
|
||||||
|
|
||||||
func newGet() *cobra.Command {
|
|
||||||
cmd := &cobra.Command{}
|
|
||||||
|
|
||||||
var getReq sharing.GetCleanRoomRequest
|
|
||||||
|
|
||||||
// TODO: short flags
|
|
||||||
|
|
||||||
cmd.Flags().BoolVar(&getReq.IncludeRemoteDetails, "include-remote-details", getReq.IncludeRemoteDetails, `Whether to include remote details (central) on the clean room.`)
|
|
||||||
|
|
||||||
cmd.Use = "get NAME"
|
|
||||||
cmd.Short = `Get a clean room.`
|
|
||||||
cmd.Long = `Get a clean room.
|
|
||||||
|
|
||||||
Gets a data object clean room from the metastore. The caller must be a
|
|
||||||
metastore admin or the owner of the clean room.
|
|
||||||
|
|
||||||
Arguments:
|
|
||||||
NAME: The name of the clean room.`
|
|
||||||
|
|
||||||
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 := root.WorkspaceClient(ctx)
|
|
||||||
|
|
||||||
getReq.Name = args[0]
|
|
||||||
|
|
||||||
response, err := w.CleanRooms.Get(ctx, getReq)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
return cmdio.Render(ctx, response)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Disable completions since they are not applicable.
|
|
||||||
// Can be overridden by manual implementation in `override.go`.
|
|
||||||
cmd.ValidArgsFunction = cobra.NoFileCompletions
|
|
||||||
|
|
||||||
// Apply optional overrides to this command.
|
|
||||||
for _, fn := range getOverrides {
|
|
||||||
fn(cmd, &getReq)
|
|
||||||
}
|
|
||||||
|
|
||||||
return cmd
|
|
||||||
}
|
|
||||||
|
|
||||||
// start list 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 listOverrides []func(
|
|
||||||
*cobra.Command,
|
|
||||||
*sharing.ListCleanRoomsRequest,
|
|
||||||
)
|
|
||||||
|
|
||||||
func newList() *cobra.Command {
|
|
||||||
cmd := &cobra.Command{}
|
|
||||||
|
|
||||||
var listReq sharing.ListCleanRoomsRequest
|
|
||||||
|
|
||||||
// TODO: short flags
|
|
||||||
|
|
||||||
cmd.Flags().IntVar(&listReq.MaxResults, "max-results", listReq.MaxResults, `Maximum number of clean rooms to return.`)
|
|
||||||
cmd.Flags().StringVar(&listReq.PageToken, "page-token", listReq.PageToken, `Opaque pagination token to go to next page based on previous query.`)
|
|
||||||
|
|
||||||
cmd.Use = "list"
|
|
||||||
cmd.Short = `List clean rooms.`
|
|
||||||
cmd.Long = `List clean rooms.
|
|
||||||
|
|
||||||
Gets an array of data object clean rooms from the metastore. The caller must
|
|
||||||
be a metastore admin or the owner of the clean room. There is no guarantee of
|
|
||||||
a specific ordering of the elements in the array.`
|
|
||||||
|
|
||||||
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 := root.WorkspaceClient(ctx)
|
|
||||||
|
|
||||||
response := w.CleanRooms.List(ctx, listReq)
|
|
||||||
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 listOverrides {
|
|
||||||
fn(cmd, &listReq)
|
|
||||||
}
|
|
||||||
|
|
||||||
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.UpdateCleanRoom,
|
|
||||||
)
|
|
||||||
|
|
||||||
func newUpdate() *cobra.Command {
|
|
||||||
cmd := &cobra.Command{}
|
|
||||||
|
|
||||||
var updateReq sharing.UpdateCleanRoom
|
|
||||||
var updateJson flags.JsonFlag
|
|
||||||
|
|
||||||
// TODO: short flags
|
|
||||||
cmd.Flags().Var(&updateJson, "json", `either inline JSON string or @path/to/file.json with request body`)
|
|
||||||
|
|
||||||
// TODO: array: catalog_updates
|
|
||||||
cmd.Flags().StringVar(&updateReq.Comment, "comment", updateReq.Comment, `User-provided free-form text description.`)
|
|
||||||
cmd.Flags().StringVar(&updateReq.Owner, "owner", updateReq.Owner, `Username of current owner of clean room.`)
|
|
||||||
|
|
||||||
cmd.Use = "update NAME"
|
|
||||||
cmd.Short = `Update a clean room.`
|
|
||||||
cmd.Long = `Update a clean room.
|
|
||||||
|
|
||||||
Updates the clean room with the changes and data objects in the request. The
|
|
||||||
caller must be the owner of the clean room or a metastore admin.
|
|
||||||
|
|
||||||
When the caller is a metastore admin, only the __owner__ field can be updated.
|
|
||||||
|
|
||||||
In the case that the clean room name is changed **updateCleanRoom** requires
|
|
||||||
that the caller is both the clean room owner and a metastore admin.
|
|
||||||
|
|
||||||
For each table that is added through this method, the clean room owner must
|
|
||||||
also have **SELECT** privilege on the table. The privilege must be maintained
|
|
||||||
indefinitely for recipients to be able to access the table. Typically, you
|
|
||||||
should use a group as the clean room owner.
|
|
||||||
|
|
||||||
Table removals through **update** do not require additional privileges.
|
|
||||||
|
|
||||||
Arguments:
|
|
||||||
NAME: The name of the clean room.`
|
|
||||||
|
|
||||||
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 := root.WorkspaceClient(ctx)
|
|
||||||
|
|
||||||
if cmd.Flags().Changed("json") {
|
|
||||||
diags := updateJson.Unmarshal(&updateReq)
|
|
||||||
if diags.HasError() {
|
|
||||||
return diags.Error()
|
|
||||||
}
|
|
||||||
if len(diags) > 0 {
|
|
||||||
err := cmdio.RenderDiagnosticsToErrorOut(ctx, diags)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
updateReq.Name = args[0]
|
|
||||||
|
|
||||||
response, err := w.CleanRooms.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 CleanRooms
|
|
|
@ -634,8 +634,9 @@ func newSetPermissions() *cobra.Command {
|
||||||
cmd.Short = `Set cluster policy permissions.`
|
cmd.Short = `Set cluster policy permissions.`
|
||||||
cmd.Long = `Set cluster policy permissions.
|
cmd.Long = `Set cluster policy permissions.
|
||||||
|
|
||||||
Sets permissions on a cluster policy. Cluster policies can inherit permissions
|
Sets permissions on an object, replacing existing permissions if they exist.
|
||||||
from their root object.
|
Deletes all direct permissions if none are specified. Objects can inherit
|
||||||
|
permissions from their root object.
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
CLUSTER_POLICY_ID: The cluster policy for which to get or manage permissions.`
|
CLUSTER_POLICY_ID: The cluster policy for which to get or manage permissions.`
|
||||||
|
|
|
@ -512,7 +512,7 @@ func newEdit() *cobra.Command {
|
||||||
Clusters created by the Databricks Jobs service cannot be edited.
|
Clusters created by the Databricks Jobs service cannot be edited.
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
CLUSTER_ID: ID of the cluser
|
CLUSTER_ID: ID of the cluster
|
||||||
SPARK_VERSION: The Spark version of the cluster, e.g. 3.3.x-scala2.11. A list of
|
SPARK_VERSION: The Spark version of the cluster, e.g. 3.3.x-scala2.11. A list of
|
||||||
available Spark versions can be retrieved by using the
|
available Spark versions can be retrieved by using the
|
||||||
:method:clusters/sparkVersions API call.`
|
:method:clusters/sparkVersions API call.`
|
||||||
|
@ -1504,8 +1504,9 @@ func newSetPermissions() *cobra.Command {
|
||||||
cmd.Short = `Set cluster permissions.`
|
cmd.Short = `Set cluster permissions.`
|
||||||
cmd.Long = `Set cluster permissions.
|
cmd.Long = `Set cluster permissions.
|
||||||
|
|
||||||
Sets permissions on a cluster. Clusters can inherit permissions from their
|
Sets permissions on an object, replacing existing permissions if they exist.
|
||||||
root object.
|
Deletes all direct permissions if none are specified. Objects can inherit
|
||||||
|
permissions from their root object.
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
CLUSTER_ID: The cluster for which to get or manage permissions.`
|
CLUSTER_ID: The cluster for which to get or manage permissions.`
|
||||||
|
|
|
@ -8,7 +8,6 @@ import (
|
||||||
apps "github.com/databricks/cli/cmd/workspace/apps"
|
apps "github.com/databricks/cli/cmd/workspace/apps"
|
||||||
artifact_allowlists "github.com/databricks/cli/cmd/workspace/artifact-allowlists"
|
artifact_allowlists "github.com/databricks/cli/cmd/workspace/artifact-allowlists"
|
||||||
catalogs "github.com/databricks/cli/cmd/workspace/catalogs"
|
catalogs "github.com/databricks/cli/cmd/workspace/catalogs"
|
||||||
clean_rooms "github.com/databricks/cli/cmd/workspace/clean-rooms"
|
|
||||||
cluster_policies "github.com/databricks/cli/cmd/workspace/cluster-policies"
|
cluster_policies "github.com/databricks/cli/cmd/workspace/cluster-policies"
|
||||||
clusters "github.com/databricks/cli/cmd/workspace/clusters"
|
clusters "github.com/databricks/cli/cmd/workspace/clusters"
|
||||||
connections "github.com/databricks/cli/cmd/workspace/connections"
|
connections "github.com/databricks/cli/cmd/workspace/connections"
|
||||||
|
@ -17,6 +16,7 @@ import (
|
||||||
consumer_listings "github.com/databricks/cli/cmd/workspace/consumer-listings"
|
consumer_listings "github.com/databricks/cli/cmd/workspace/consumer-listings"
|
||||||
consumer_personalization_requests "github.com/databricks/cli/cmd/workspace/consumer-personalization-requests"
|
consumer_personalization_requests "github.com/databricks/cli/cmd/workspace/consumer-personalization-requests"
|
||||||
consumer_providers "github.com/databricks/cli/cmd/workspace/consumer-providers"
|
consumer_providers "github.com/databricks/cli/cmd/workspace/consumer-providers"
|
||||||
|
credentials "github.com/databricks/cli/cmd/workspace/credentials"
|
||||||
credentials_manager "github.com/databricks/cli/cmd/workspace/credentials-manager"
|
credentials_manager "github.com/databricks/cli/cmd/workspace/credentials-manager"
|
||||||
current_user "github.com/databricks/cli/cmd/workspace/current-user"
|
current_user "github.com/databricks/cli/cmd/workspace/current-user"
|
||||||
dashboard_widgets "github.com/databricks/cli/cmd/workspace/dashboard-widgets"
|
dashboard_widgets "github.com/databricks/cli/cmd/workspace/dashboard-widgets"
|
||||||
|
@ -98,7 +98,6 @@ func All() []*cobra.Command {
|
||||||
out = append(out, apps.New())
|
out = append(out, apps.New())
|
||||||
out = append(out, artifact_allowlists.New())
|
out = append(out, artifact_allowlists.New())
|
||||||
out = append(out, catalogs.New())
|
out = append(out, catalogs.New())
|
||||||
out = append(out, clean_rooms.New())
|
|
||||||
out = append(out, cluster_policies.New())
|
out = append(out, cluster_policies.New())
|
||||||
out = append(out, clusters.New())
|
out = append(out, clusters.New())
|
||||||
out = append(out, connections.New())
|
out = append(out, connections.New())
|
||||||
|
@ -107,6 +106,7 @@ func All() []*cobra.Command {
|
||||||
out = append(out, consumer_listings.New())
|
out = append(out, consumer_listings.New())
|
||||||
out = append(out, consumer_personalization_requests.New())
|
out = append(out, consumer_personalization_requests.New())
|
||||||
out = append(out, consumer_providers.New())
|
out = append(out, consumer_providers.New())
|
||||||
|
out = append(out, credentials.New())
|
||||||
out = append(out, credentials_manager.New())
|
out = append(out, credentials_manager.New())
|
||||||
out = append(out, current_user.New())
|
out = append(out, current_user.New())
|
||||||
out = append(out, dashboard_widgets.New())
|
out = append(out, dashboard_widgets.New())
|
||||||
|
|
|
@ -0,0 +1,545 @@
|
||||||
|
// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT.
|
||||||
|
|
||||||
|
package credentials
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/databricks/cli/cmd/root"
|
||||||
|
"github.com/databricks/cli/libs/cmdio"
|
||||||
|
"github.com/databricks/cli/libs/flags"
|
||||||
|
"github.com/databricks/databricks-sdk-go/service/catalog"
|
||||||
|
"github.com/spf13/cobra"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Slice with functions to override default command behavior.
|
||||||
|
// Functions can be added from the `init()` function in manually curated files in this directory.
|
||||||
|
var cmdOverrides []func(*cobra.Command)
|
||||||
|
|
||||||
|
func New() *cobra.Command {
|
||||||
|
cmd := &cobra.Command{
|
||||||
|
Use: "credentials",
|
||||||
|
Short: `A credential represents an authentication and authorization mechanism for accessing services on your cloud tenant.`,
|
||||||
|
Long: `A credential represents an authentication and authorization mechanism for
|
||||||
|
accessing services on your cloud tenant. Each credential is subject to Unity
|
||||||
|
Catalog access-control policies that control which users and groups can access
|
||||||
|
the credential.
|
||||||
|
|
||||||
|
To create credentials, you must be a Databricks account admin or have the
|
||||||
|
CREATE SERVICE CREDENTIAL privilege. The user who creates the credential can
|
||||||
|
delegate ownership to another user or group to manage permissions on it`,
|
||||||
|
GroupID: "catalog",
|
||||||
|
Annotations: map[string]string{
|
||||||
|
"package": "catalog",
|
||||||
|
},
|
||||||
|
|
||||||
|
// This service is being previewed; hide from help output.
|
||||||
|
Hidden: true,
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add methods
|
||||||
|
cmd.AddCommand(newCreateCredential())
|
||||||
|
cmd.AddCommand(newDeleteCredential())
|
||||||
|
cmd.AddCommand(newGenerateTemporaryServiceCredential())
|
||||||
|
cmd.AddCommand(newGetCredential())
|
||||||
|
cmd.AddCommand(newListCredentials())
|
||||||
|
cmd.AddCommand(newUpdateCredential())
|
||||||
|
cmd.AddCommand(newValidateCredential())
|
||||||
|
|
||||||
|
// Apply optional overrides to this command.
|
||||||
|
for _, fn := range cmdOverrides {
|
||||||
|
fn(cmd)
|
||||||
|
}
|
||||||
|
|
||||||
|
return cmd
|
||||||
|
}
|
||||||
|
|
||||||
|
// start create-credential 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 createCredentialOverrides []func(
|
||||||
|
*cobra.Command,
|
||||||
|
*catalog.CreateCredentialRequest,
|
||||||
|
)
|
||||||
|
|
||||||
|
func newCreateCredential() *cobra.Command {
|
||||||
|
cmd := &cobra.Command{}
|
||||||
|
|
||||||
|
var createCredentialReq catalog.CreateCredentialRequest
|
||||||
|
var createCredentialJson flags.JsonFlag
|
||||||
|
|
||||||
|
// TODO: short flags
|
||||||
|
cmd.Flags().Var(&createCredentialJson, "json", `either inline JSON string or @path/to/file.json with request body`)
|
||||||
|
|
||||||
|
// TODO: complex arg: aws_iam_role
|
||||||
|
// TODO: complex arg: azure_managed_identity
|
||||||
|
cmd.Flags().StringVar(&createCredentialReq.Comment, "comment", createCredentialReq.Comment, `Comment associated with the credential.`)
|
||||||
|
cmd.Flags().StringVar(&createCredentialReq.Name, "name", createCredentialReq.Name, `The credential name.`)
|
||||||
|
cmd.Flags().Var(&createCredentialReq.Purpose, "purpose", `Indicates the purpose of the credential. Supported values: [SERVICE]`)
|
||||||
|
cmd.Flags().BoolVar(&createCredentialReq.SkipValidation, "skip-validation", createCredentialReq.SkipValidation, `Optional.`)
|
||||||
|
|
||||||
|
cmd.Use = "create-credential"
|
||||||
|
cmd.Short = `Create a credential.`
|
||||||
|
cmd.Long = `Create a credential.
|
||||||
|
|
||||||
|
Creates a new credential.`
|
||||||
|
|
||||||
|
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 := root.WorkspaceClient(ctx)
|
||||||
|
|
||||||
|
if cmd.Flags().Changed("json") {
|
||||||
|
diags := createCredentialJson.Unmarshal(&createCredentialReq)
|
||||||
|
if diags.HasError() {
|
||||||
|
return diags.Error()
|
||||||
|
}
|
||||||
|
if len(diags) > 0 {
|
||||||
|
err := cmdio.RenderDiagnosticsToErrorOut(ctx, diags)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
response, err := w.Credentials.CreateCredential(ctx, createCredentialReq)
|
||||||
|
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 createCredentialOverrides {
|
||||||
|
fn(cmd, &createCredentialReq)
|
||||||
|
}
|
||||||
|
|
||||||
|
return cmd
|
||||||
|
}
|
||||||
|
|
||||||
|
// start delete-credential 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 deleteCredentialOverrides []func(
|
||||||
|
*cobra.Command,
|
||||||
|
*catalog.DeleteCredentialRequest,
|
||||||
|
)
|
||||||
|
|
||||||
|
func newDeleteCredential() *cobra.Command {
|
||||||
|
cmd := &cobra.Command{}
|
||||||
|
|
||||||
|
var deleteCredentialReq catalog.DeleteCredentialRequest
|
||||||
|
|
||||||
|
// TODO: short flags
|
||||||
|
|
||||||
|
cmd.Flags().BoolVar(&deleteCredentialReq.Force, "force", deleteCredentialReq.Force, `Force deletion even if there are dependent services.`)
|
||||||
|
|
||||||
|
cmd.Use = "delete-credential NAME_ARG"
|
||||||
|
cmd.Short = `Delete a credential.`
|
||||||
|
cmd.Long = `Delete a credential.
|
||||||
|
|
||||||
|
Deletes a credential from the metastore. The caller must be an owner of the
|
||||||
|
credential.
|
||||||
|
|
||||||
|
Arguments:
|
||||||
|
NAME_ARG: Name of the credential.`
|
||||||
|
|
||||||
|
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 := root.WorkspaceClient(ctx)
|
||||||
|
|
||||||
|
deleteCredentialReq.NameArg = args[0]
|
||||||
|
|
||||||
|
err = w.Credentials.DeleteCredential(ctx, deleteCredentialReq)
|
||||||
|
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 deleteCredentialOverrides {
|
||||||
|
fn(cmd, &deleteCredentialReq)
|
||||||
|
}
|
||||||
|
|
||||||
|
return cmd
|
||||||
|
}
|
||||||
|
|
||||||
|
// start generate-temporary-service-credential 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 generateTemporaryServiceCredentialOverrides []func(
|
||||||
|
*cobra.Command,
|
||||||
|
*catalog.GenerateTemporaryServiceCredentialRequest,
|
||||||
|
)
|
||||||
|
|
||||||
|
func newGenerateTemporaryServiceCredential() *cobra.Command {
|
||||||
|
cmd := &cobra.Command{}
|
||||||
|
|
||||||
|
var generateTemporaryServiceCredentialReq catalog.GenerateTemporaryServiceCredentialRequest
|
||||||
|
var generateTemporaryServiceCredentialJson flags.JsonFlag
|
||||||
|
|
||||||
|
// TODO: short flags
|
||||||
|
cmd.Flags().Var(&generateTemporaryServiceCredentialJson, "json", `either inline JSON string or @path/to/file.json with request body`)
|
||||||
|
|
||||||
|
// TODO: complex arg: azure_options
|
||||||
|
cmd.Flags().StringVar(&generateTemporaryServiceCredentialReq.CredentialName, "credential-name", generateTemporaryServiceCredentialReq.CredentialName, `The name of the service credential used to generate a temporary credential.`)
|
||||||
|
|
||||||
|
cmd.Use = "generate-temporary-service-credential"
|
||||||
|
cmd.Short = `Generate a temporary service credential.`
|
||||||
|
cmd.Long = `Generate a temporary service credential.
|
||||||
|
|
||||||
|
Returns a set of temporary credentials generated using the specified service
|
||||||
|
credential. The caller must be a metastore admin or have the metastore
|
||||||
|
privilege **ACCESS** on the service credential.`
|
||||||
|
|
||||||
|
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 := root.WorkspaceClient(ctx)
|
||||||
|
|
||||||
|
if cmd.Flags().Changed("json") {
|
||||||
|
diags := generateTemporaryServiceCredentialJson.Unmarshal(&generateTemporaryServiceCredentialReq)
|
||||||
|
if diags.HasError() {
|
||||||
|
return diags.Error()
|
||||||
|
}
|
||||||
|
if len(diags) > 0 {
|
||||||
|
err := cmdio.RenderDiagnosticsToErrorOut(ctx, diags)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
response, err := w.Credentials.GenerateTemporaryServiceCredential(ctx, generateTemporaryServiceCredentialReq)
|
||||||
|
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 generateTemporaryServiceCredentialOverrides {
|
||||||
|
fn(cmd, &generateTemporaryServiceCredentialReq)
|
||||||
|
}
|
||||||
|
|
||||||
|
return cmd
|
||||||
|
}
|
||||||
|
|
||||||
|
// start get-credential 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 getCredentialOverrides []func(
|
||||||
|
*cobra.Command,
|
||||||
|
*catalog.GetCredentialRequest,
|
||||||
|
)
|
||||||
|
|
||||||
|
func newGetCredential() *cobra.Command {
|
||||||
|
cmd := &cobra.Command{}
|
||||||
|
|
||||||
|
var getCredentialReq catalog.GetCredentialRequest
|
||||||
|
|
||||||
|
// TODO: short flags
|
||||||
|
|
||||||
|
cmd.Use = "get-credential NAME_ARG"
|
||||||
|
cmd.Short = `Get a credential.`
|
||||||
|
cmd.Long = `Get a credential.
|
||||||
|
|
||||||
|
Gets a credential from the metastore. The caller must be a metastore admin,
|
||||||
|
the owner of the credential, or have any permission on the credential.
|
||||||
|
|
||||||
|
Arguments:
|
||||||
|
NAME_ARG: Name of the credential.`
|
||||||
|
|
||||||
|
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 := root.WorkspaceClient(ctx)
|
||||||
|
|
||||||
|
getCredentialReq.NameArg = args[0]
|
||||||
|
|
||||||
|
response, err := w.Credentials.GetCredential(ctx, getCredentialReq)
|
||||||
|
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 getCredentialOverrides {
|
||||||
|
fn(cmd, &getCredentialReq)
|
||||||
|
}
|
||||||
|
|
||||||
|
return cmd
|
||||||
|
}
|
||||||
|
|
||||||
|
// start list-credentials 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 listCredentialsOverrides []func(
|
||||||
|
*cobra.Command,
|
||||||
|
*catalog.ListCredentialsRequest,
|
||||||
|
)
|
||||||
|
|
||||||
|
func newListCredentials() *cobra.Command {
|
||||||
|
cmd := &cobra.Command{}
|
||||||
|
|
||||||
|
var listCredentialsReq catalog.ListCredentialsRequest
|
||||||
|
|
||||||
|
// TODO: short flags
|
||||||
|
|
||||||
|
cmd.Flags().IntVar(&listCredentialsReq.MaxResults, "max-results", listCredentialsReq.MaxResults, `Maximum number of credentials to return.`)
|
||||||
|
cmd.Flags().StringVar(&listCredentialsReq.PageToken, "page-token", listCredentialsReq.PageToken, `Opaque token to retrieve the next page of results.`)
|
||||||
|
cmd.Flags().Var(&listCredentialsReq.Purpose, "purpose", `Return only credentials for the specified purpose. Supported values: [SERVICE]`)
|
||||||
|
|
||||||
|
cmd.Use = "list-credentials"
|
||||||
|
cmd.Short = `List credentials.`
|
||||||
|
cmd.Long = `List credentials.
|
||||||
|
|
||||||
|
Gets an array of credentials (as __CredentialInfo__ objects).
|
||||||
|
|
||||||
|
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.`
|
||||||
|
|
||||||
|
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 := root.WorkspaceClient(ctx)
|
||||||
|
|
||||||
|
response := w.Credentials.ListCredentials(ctx, listCredentialsReq)
|
||||||
|
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 listCredentialsOverrides {
|
||||||
|
fn(cmd, &listCredentialsReq)
|
||||||
|
}
|
||||||
|
|
||||||
|
return cmd
|
||||||
|
}
|
||||||
|
|
||||||
|
// start update-credential 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 updateCredentialOverrides []func(
|
||||||
|
*cobra.Command,
|
||||||
|
*catalog.UpdateCredentialRequest,
|
||||||
|
)
|
||||||
|
|
||||||
|
func newUpdateCredential() *cobra.Command {
|
||||||
|
cmd := &cobra.Command{}
|
||||||
|
|
||||||
|
var updateCredentialReq catalog.UpdateCredentialRequest
|
||||||
|
var updateCredentialJson flags.JsonFlag
|
||||||
|
|
||||||
|
// TODO: short flags
|
||||||
|
cmd.Flags().Var(&updateCredentialJson, "json", `either inline JSON string or @path/to/file.json with request body`)
|
||||||
|
|
||||||
|
// TODO: complex arg: aws_iam_role
|
||||||
|
// TODO: complex arg: azure_managed_identity
|
||||||
|
cmd.Flags().StringVar(&updateCredentialReq.Comment, "comment", updateCredentialReq.Comment, `Comment associated with the credential.`)
|
||||||
|
cmd.Flags().BoolVar(&updateCredentialReq.Force, "force", updateCredentialReq.Force, `Force update even if there are dependent services.`)
|
||||||
|
cmd.Flags().Var(&updateCredentialReq.IsolationMode, "isolation-mode", `Whether the current securable is accessible from all workspaces or a specific set of workspaces. Supported values: [ISOLATION_MODE_ISOLATED, ISOLATION_MODE_OPEN]`)
|
||||||
|
cmd.Flags().StringVar(&updateCredentialReq.NewName, "new-name", updateCredentialReq.NewName, `New name of credential.`)
|
||||||
|
cmd.Flags().StringVar(&updateCredentialReq.Owner, "owner", updateCredentialReq.Owner, `Username of current owner of credential.`)
|
||||||
|
cmd.Flags().BoolVar(&updateCredentialReq.SkipValidation, "skip-validation", updateCredentialReq.SkipValidation, `Supply true to this argument to skip validation of the updated credential.`)
|
||||||
|
|
||||||
|
cmd.Use = "update-credential NAME_ARG"
|
||||||
|
cmd.Short = `Update a credential.`
|
||||||
|
cmd.Long = `Update a credential.
|
||||||
|
|
||||||
|
Updates a credential on the metastore.
|
||||||
|
|
||||||
|
The caller must be the owner of the credential or a metastore admin or have
|
||||||
|
the MANAGE permission. If the caller is a metastore admin, only the
|
||||||
|
__owner__ field can be changed.
|
||||||
|
|
||||||
|
Arguments:
|
||||||
|
NAME_ARG: Name of the credential.`
|
||||||
|
|
||||||
|
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 := root.WorkspaceClient(ctx)
|
||||||
|
|
||||||
|
if cmd.Flags().Changed("json") {
|
||||||
|
diags := updateCredentialJson.Unmarshal(&updateCredentialReq)
|
||||||
|
if diags.HasError() {
|
||||||
|
return diags.Error()
|
||||||
|
}
|
||||||
|
if len(diags) > 0 {
|
||||||
|
err := cmdio.RenderDiagnosticsToErrorOut(ctx, diags)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
updateCredentialReq.NameArg = args[0]
|
||||||
|
|
||||||
|
response, err := w.Credentials.UpdateCredential(ctx, updateCredentialReq)
|
||||||
|
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 updateCredentialOverrides {
|
||||||
|
fn(cmd, &updateCredentialReq)
|
||||||
|
}
|
||||||
|
|
||||||
|
return cmd
|
||||||
|
}
|
||||||
|
|
||||||
|
// start validate-credential 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 validateCredentialOverrides []func(
|
||||||
|
*cobra.Command,
|
||||||
|
*catalog.ValidateCredentialRequest,
|
||||||
|
)
|
||||||
|
|
||||||
|
func newValidateCredential() *cobra.Command {
|
||||||
|
cmd := &cobra.Command{}
|
||||||
|
|
||||||
|
var validateCredentialReq catalog.ValidateCredentialRequest
|
||||||
|
var validateCredentialJson flags.JsonFlag
|
||||||
|
|
||||||
|
// TODO: short flags
|
||||||
|
cmd.Flags().Var(&validateCredentialJson, "json", `either inline JSON string or @path/to/file.json with request body`)
|
||||||
|
|
||||||
|
// TODO: complex arg: aws_iam_role
|
||||||
|
// TODO: complex arg: azure_managed_identity
|
||||||
|
cmd.Flags().StringVar(&validateCredentialReq.CredentialName, "credential-name", validateCredentialReq.CredentialName, `Required.`)
|
||||||
|
cmd.Flags().Var(&validateCredentialReq.Purpose, "purpose", `The purpose of the credential. Supported values: [SERVICE]`)
|
||||||
|
|
||||||
|
cmd.Use = "validate-credential"
|
||||||
|
cmd.Short = `Validate a credential.`
|
||||||
|
cmd.Long = `Validate a credential.
|
||||||
|
|
||||||
|
Validates a credential.
|
||||||
|
|
||||||
|
Either the __credential_name__ or the cloud-specific credential must be
|
||||||
|
provided.
|
||||||
|
|
||||||
|
The caller must be a metastore admin or the credential owner.`
|
||||||
|
|
||||||
|
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 := root.WorkspaceClient(ctx)
|
||||||
|
|
||||||
|
if cmd.Flags().Changed("json") {
|
||||||
|
diags := validateCredentialJson.Unmarshal(&validateCredentialReq)
|
||||||
|
if diags.HasError() {
|
||||||
|
return diags.Error()
|
||||||
|
}
|
||||||
|
if len(diags) > 0 {
|
||||||
|
err := cmdio.RenderDiagnosticsToErrorOut(ctx, diags)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
response, err := w.Credentials.ValidateCredential(ctx, validateCredentialReq)
|
||||||
|
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 validateCredentialOverrides {
|
||||||
|
fn(cmd, &validateCredentialReq)
|
||||||
|
}
|
||||||
|
|
||||||
|
return cmd
|
||||||
|
}
|
||||||
|
|
||||||
|
// end service Credentials
|
|
@ -2034,8 +2034,9 @@ func newSetPermissions() *cobra.Command {
|
||||||
cmd.Short = `Set experiment permissions.`
|
cmd.Short = `Set experiment permissions.`
|
||||||
cmd.Long = `Set experiment permissions.
|
cmd.Long = `Set experiment permissions.
|
||||||
|
|
||||||
Sets permissions on an experiment. Experiments can inherit permissions from
|
Sets permissions on an object, replacing existing permissions if they exist.
|
||||||
their root object.
|
Deletes all direct permissions if none are specified. Objects can inherit
|
||||||
|
permissions from their root object.
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
EXPERIMENT_ID: The experiment for which to get or manage permissions.`
|
EXPERIMENT_ID: The experiment for which to get or manage permissions.`
|
||||||
|
|
|
@ -356,7 +356,7 @@ func newUpdate() *cobra.Command {
|
||||||
// TODO: complex arg: encryption_details
|
// TODO: complex arg: encryption_details
|
||||||
cmd.Flags().BoolVar(&updateReq.Fallback, "fallback", updateReq.Fallback, `Indicates whether fallback mode is enabled for this external location.`)
|
cmd.Flags().BoolVar(&updateReq.Fallback, "fallback", updateReq.Fallback, `Indicates whether fallback mode is enabled for this external location.`)
|
||||||
cmd.Flags().BoolVar(&updateReq.Force, "force", updateReq.Force, `Force update even if changing url invalidates dependent external tables or mounts.`)
|
cmd.Flags().BoolVar(&updateReq.Force, "force", updateReq.Force, `Force update even if changing url invalidates dependent external tables or mounts.`)
|
||||||
cmd.Flags().Var(&updateReq.IsolationMode, "isolation-mode", `Whether the current securable is accessible from all workspaces or a specific set of workspaces. Supported values: [ISOLATION_MODE_ISOLATED, ISOLATION_MODE_OPEN]`)
|
cmd.Flags().Var(&updateReq.IsolationMode, "isolation-mode", `. Supported values: [ISOLATION_MODE_ISOLATED, ISOLATION_MODE_OPEN]`)
|
||||||
cmd.Flags().StringVar(&updateReq.NewName, "new-name", updateReq.NewName, `New name for the external location.`)
|
cmd.Flags().StringVar(&updateReq.NewName, "new-name", updateReq.NewName, `New name for the external location.`)
|
||||||
cmd.Flags().StringVar(&updateReq.Owner, "owner", updateReq.Owner, `The owner of the external location.`)
|
cmd.Flags().StringVar(&updateReq.Owner, "owner", updateReq.Owner, `The owner of the external location.`)
|
||||||
cmd.Flags().BoolVar(&updateReq.ReadOnly, "read-only", updateReq.ReadOnly, `Indicates whether the external location is read-only.`)
|
cmd.Flags().BoolVar(&updateReq.ReadOnly, "read-only", updateReq.ReadOnly, `Indicates whether the external location is read-only.`)
|
||||||
|
|
|
@ -160,13 +160,13 @@ func newCreateMessage() *cobra.Command {
|
||||||
// Functions can be added from the `init()` function in manually curated files in this directory.
|
// Functions can be added from the `init()` function in manually curated files in this directory.
|
||||||
var executeMessageQueryOverrides []func(
|
var executeMessageQueryOverrides []func(
|
||||||
*cobra.Command,
|
*cobra.Command,
|
||||||
*dashboards.ExecuteMessageQueryRequest,
|
*dashboards.GenieExecuteMessageQueryRequest,
|
||||||
)
|
)
|
||||||
|
|
||||||
func newExecuteMessageQuery() *cobra.Command {
|
func newExecuteMessageQuery() *cobra.Command {
|
||||||
cmd := &cobra.Command{}
|
cmd := &cobra.Command{}
|
||||||
|
|
||||||
var executeMessageQueryReq dashboards.ExecuteMessageQueryRequest
|
var executeMessageQueryReq dashboards.GenieExecuteMessageQueryRequest
|
||||||
|
|
||||||
// TODO: short flags
|
// TODO: short flags
|
||||||
|
|
||||||
|
|
|
@ -635,8 +635,9 @@ func newSetPermissions() *cobra.Command {
|
||||||
cmd.Short = `Set instance pool permissions.`
|
cmd.Short = `Set instance pool permissions.`
|
||||||
cmd.Long = `Set instance pool permissions.
|
cmd.Long = `Set instance pool permissions.
|
||||||
|
|
||||||
Sets permissions on an instance pool. Instance pools can inherit permissions
|
Sets permissions on an object, replacing existing permissions if they exist.
|
||||||
from their root object.
|
Deletes all direct permissions if none are specified. Objects can inherit
|
||||||
|
permissions from their root object.
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
INSTANCE_POOL_ID: The instance pool for which to get or manage permissions.`
|
INSTANCE_POOL_ID: The instance pool for which to get or manage permissions.`
|
||||||
|
|
|
@ -847,7 +847,7 @@ func newGetRun() *cobra.Command {
|
||||||
|
|
||||||
cmd.Flags().BoolVar(&getRunReq.IncludeHistory, "include-history", getRunReq.IncludeHistory, `Whether to include the repair history in the response.`)
|
cmd.Flags().BoolVar(&getRunReq.IncludeHistory, "include-history", getRunReq.IncludeHistory, `Whether to include the repair history in the response.`)
|
||||||
cmd.Flags().BoolVar(&getRunReq.IncludeResolvedValues, "include-resolved-values", getRunReq.IncludeResolvedValues, `Whether to include resolved parameter values in the response.`)
|
cmd.Flags().BoolVar(&getRunReq.IncludeResolvedValues, "include-resolved-values", getRunReq.IncludeResolvedValues, `Whether to include resolved parameter values in the response.`)
|
||||||
cmd.Flags().StringVar(&getRunReq.PageToken, "page-token", getRunReq.PageToken, `To list the next page or the previous page of job tasks, set this field to the value of the next_page_token or prev_page_token returned in the GetJob response.`)
|
cmd.Flags().StringVar(&getRunReq.PageToken, "page-token", getRunReq.PageToken, `To list the next page of job tasks, set this field to the value of the next_page_token returned in the GetJob response.`)
|
||||||
|
|
||||||
cmd.Use = "get-run RUN_ID"
|
cmd.Use = "get-run RUN_ID"
|
||||||
cmd.Short = `Get a single job run.`
|
cmd.Short = `Get a single job run.`
|
||||||
|
@ -1339,6 +1339,7 @@ func newRunNow() *cobra.Command {
|
||||||
// TODO: array: jar_params
|
// TODO: array: jar_params
|
||||||
// TODO: map via StringToStringVar: job_parameters
|
// TODO: map via StringToStringVar: job_parameters
|
||||||
// TODO: map via StringToStringVar: notebook_params
|
// TODO: map via StringToStringVar: notebook_params
|
||||||
|
// TODO: array: only
|
||||||
// TODO: complex arg: pipeline_params
|
// TODO: complex arg: pipeline_params
|
||||||
// TODO: map via StringToStringVar: python_named_params
|
// TODO: map via StringToStringVar: python_named_params
|
||||||
// TODO: array: python_params
|
// TODO: array: python_params
|
||||||
|
@ -1470,8 +1471,9 @@ func newSetPermissions() *cobra.Command {
|
||||||
cmd.Short = `Set job permissions.`
|
cmd.Short = `Set job permissions.`
|
||||||
cmd.Long = `Set job permissions.
|
cmd.Long = `Set job permissions.
|
||||||
|
|
||||||
Sets permissions on a job. Jobs can inherit permissions from their root
|
Sets permissions on an object, replacing existing permissions if they exist.
|
||||||
object.
|
Deletes all direct permissions if none are specified. Objects can inherit
|
||||||
|
permissions from their root object.
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
JOB_ID: The job for which to get or manage permissions.`
|
JOB_ID: The job for which to get or manage permissions.`
|
||||||
|
|
|
@ -70,35 +70,26 @@ func newCreate() *cobra.Command {
|
||||||
cmd := &cobra.Command{}
|
cmd := &cobra.Command{}
|
||||||
|
|
||||||
var createReq dashboards.CreateDashboardRequest
|
var createReq dashboards.CreateDashboardRequest
|
||||||
|
createReq.Dashboard = &dashboards.Dashboard{}
|
||||||
var createJson flags.JsonFlag
|
var createJson flags.JsonFlag
|
||||||
|
|
||||||
// TODO: short flags
|
// TODO: short flags
|
||||||
cmd.Flags().Var(&createJson, "json", `either inline JSON string or @path/to/file.json with request body`)
|
cmd.Flags().Var(&createJson, "json", `either inline JSON string or @path/to/file.json with request body`)
|
||||||
|
|
||||||
cmd.Flags().StringVar(&createReq.ParentPath, "parent-path", createReq.ParentPath, `The workspace path of the folder containing the dashboard.`)
|
cmd.Flags().StringVar(&createReq.Dashboard.DisplayName, "display-name", createReq.Dashboard.DisplayName, `The display name of the dashboard.`)
|
||||||
cmd.Flags().StringVar(&createReq.SerializedDashboard, "serialized-dashboard", createReq.SerializedDashboard, `The contents of the dashboard in serialized string form.`)
|
cmd.Flags().StringVar(&createReq.Dashboard.SerializedDashboard, "serialized-dashboard", createReq.Dashboard.SerializedDashboard, `The contents of the dashboard in serialized string form.`)
|
||||||
cmd.Flags().StringVar(&createReq.WarehouseId, "warehouse-id", createReq.WarehouseId, `The warehouse ID used to run the dashboard.`)
|
cmd.Flags().StringVar(&createReq.Dashboard.WarehouseId, "warehouse-id", createReq.Dashboard.WarehouseId, `The warehouse ID used to run the dashboard.`)
|
||||||
|
|
||||||
cmd.Use = "create DISPLAY_NAME"
|
cmd.Use = "create"
|
||||||
cmd.Short = `Create dashboard.`
|
cmd.Short = `Create dashboard.`
|
||||||
cmd.Long = `Create dashboard.
|
cmd.Long = `Create dashboard.
|
||||||
|
|
||||||
Create a draft dashboard.
|
Create a draft dashboard.`
|
||||||
|
|
||||||
Arguments:
|
|
||||||
DISPLAY_NAME: The display name of the dashboard.`
|
|
||||||
|
|
||||||
cmd.Annotations = make(map[string]string)
|
cmd.Annotations = make(map[string]string)
|
||||||
|
|
||||||
cmd.Args = func(cmd *cobra.Command, args []string) error {
|
cmd.Args = func(cmd *cobra.Command, args []string) error {
|
||||||
if cmd.Flags().Changed("json") {
|
check := root.ExactArgs(0)
|
||||||
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' in your JSON input")
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
check := root.ExactArgs(1)
|
|
||||||
return check(cmd, args)
|
return check(cmd, args)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -108,7 +99,7 @@ func newCreate() *cobra.Command {
|
||||||
w := root.WorkspaceClient(ctx)
|
w := root.WorkspaceClient(ctx)
|
||||||
|
|
||||||
if cmd.Flags().Changed("json") {
|
if cmd.Flags().Changed("json") {
|
||||||
diags := createJson.Unmarshal(&createReq)
|
diags := createJson.Unmarshal(&createReq.Dashboard)
|
||||||
if diags.HasError() {
|
if diags.HasError() {
|
||||||
return diags.Error()
|
return diags.Error()
|
||||||
}
|
}
|
||||||
|
@ -119,9 +110,6 @@ func newCreate() *cobra.Command {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if !cmd.Flags().Changed("json") {
|
|
||||||
createReq.DisplayName = args[0]
|
|
||||||
}
|
|
||||||
|
|
||||||
response, err := w.Lakeview.Create(ctx, createReq)
|
response, err := w.Lakeview.Create(ctx, createReq)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -155,13 +143,15 @@ func newCreateSchedule() *cobra.Command {
|
||||||
cmd := &cobra.Command{}
|
cmd := &cobra.Command{}
|
||||||
|
|
||||||
var createScheduleReq dashboards.CreateScheduleRequest
|
var createScheduleReq dashboards.CreateScheduleRequest
|
||||||
|
createScheduleReq.Schedule = &dashboards.Schedule{}
|
||||||
var createScheduleJson flags.JsonFlag
|
var createScheduleJson flags.JsonFlag
|
||||||
|
|
||||||
// TODO: short flags
|
// TODO: short flags
|
||||||
cmd.Flags().Var(&createScheduleJson, "json", `either inline JSON string or @path/to/file.json with request body`)
|
cmd.Flags().Var(&createScheduleJson, "json", `either inline JSON string or @path/to/file.json with request body`)
|
||||||
|
|
||||||
cmd.Flags().StringVar(&createScheduleReq.DisplayName, "display-name", createScheduleReq.DisplayName, `The display name for schedule.`)
|
cmd.Flags().StringVar(&createScheduleReq.Schedule.DisplayName, "display-name", createScheduleReq.Schedule.DisplayName, `The display name for schedule.`)
|
||||||
cmd.Flags().Var(&createScheduleReq.PauseStatus, "pause-status", `The status indicates whether this schedule is paused or not. Supported values: [PAUSED, UNPAUSED]`)
|
cmd.Flags().Var(&createScheduleReq.Schedule.PauseStatus, "pause-status", `The status indicates whether this schedule is paused or not. Supported values: [PAUSED, UNPAUSED]`)
|
||||||
|
cmd.Flags().StringVar(&createScheduleReq.Schedule.WarehouseId, "warehouse-id", createScheduleReq.Schedule.WarehouseId, `The warehouse id to run the dashboard with for the schedule.`)
|
||||||
|
|
||||||
cmd.Use = "create-schedule DASHBOARD_ID"
|
cmd.Use = "create-schedule DASHBOARD_ID"
|
||||||
cmd.Short = `Create dashboard schedule.`
|
cmd.Short = `Create dashboard schedule.`
|
||||||
|
@ -176,6 +166,13 @@ func newCreateSchedule() *cobra.Command {
|
||||||
cmd.Annotations = make(map[string]string)
|
cmd.Annotations = make(map[string]string)
|
||||||
|
|
||||||
cmd.Args = func(cmd *cobra.Command, args []string) error {
|
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 'cron_schedule' in your JSON input")
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
check := root.ExactArgs(1)
|
check := root.ExactArgs(1)
|
||||||
return check(cmd, args)
|
return check(cmd, args)
|
||||||
}
|
}
|
||||||
|
@ -186,7 +183,7 @@ func newCreateSchedule() *cobra.Command {
|
||||||
w := root.WorkspaceClient(ctx)
|
w := root.WorkspaceClient(ctx)
|
||||||
|
|
||||||
if cmd.Flags().Changed("json") {
|
if cmd.Flags().Changed("json") {
|
||||||
diags := createScheduleJson.Unmarshal(&createScheduleReq)
|
diags := createScheduleJson.Unmarshal(&createScheduleReq.Schedule)
|
||||||
if diags.HasError() {
|
if diags.HasError() {
|
||||||
return diags.Error()
|
return diags.Error()
|
||||||
}
|
}
|
||||||
|
@ -196,8 +193,6 @@ func newCreateSchedule() *cobra.Command {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
return fmt.Errorf("please provide command input in JSON format by specifying the --json flag")
|
|
||||||
}
|
}
|
||||||
createScheduleReq.DashboardId = args[0]
|
createScheduleReq.DashboardId = args[0]
|
||||||
|
|
||||||
|
@ -233,6 +228,7 @@ func newCreateSubscription() *cobra.Command {
|
||||||
cmd := &cobra.Command{}
|
cmd := &cobra.Command{}
|
||||||
|
|
||||||
var createSubscriptionReq dashboards.CreateSubscriptionRequest
|
var createSubscriptionReq dashboards.CreateSubscriptionRequest
|
||||||
|
createSubscriptionReq.Subscription = &dashboards.Subscription{}
|
||||||
var createSubscriptionJson flags.JsonFlag
|
var createSubscriptionJson flags.JsonFlag
|
||||||
|
|
||||||
// TODO: short flags
|
// TODO: short flags
|
||||||
|
@ -252,6 +248,13 @@ func newCreateSubscription() *cobra.Command {
|
||||||
cmd.Annotations = make(map[string]string)
|
cmd.Annotations = make(map[string]string)
|
||||||
|
|
||||||
cmd.Args = func(cmd *cobra.Command, args []string) error {
|
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 'subscriber' in your JSON input")
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
check := root.ExactArgs(2)
|
check := root.ExactArgs(2)
|
||||||
return check(cmd, args)
|
return check(cmd, args)
|
||||||
}
|
}
|
||||||
|
@ -262,7 +265,7 @@ func newCreateSubscription() *cobra.Command {
|
||||||
w := root.WorkspaceClient(ctx)
|
w := root.WorkspaceClient(ctx)
|
||||||
|
|
||||||
if cmd.Flags().Changed("json") {
|
if cmd.Flags().Changed("json") {
|
||||||
diags := createSubscriptionJson.Unmarshal(&createSubscriptionReq)
|
diags := createSubscriptionJson.Unmarshal(&createSubscriptionReq.Subscription)
|
||||||
if diags.HasError() {
|
if diags.HasError() {
|
||||||
return diags.Error()
|
return diags.Error()
|
||||||
}
|
}
|
||||||
|
@ -272,8 +275,6 @@ func newCreateSubscription() *cobra.Command {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
return fmt.Errorf("please provide command input in JSON format by specifying the --json flag")
|
|
||||||
}
|
}
|
||||||
createSubscriptionReq.DashboardId = args[0]
|
createSubscriptionReq.DashboardId = args[0]
|
||||||
createSubscriptionReq.ScheduleId = args[1]
|
createSubscriptionReq.ScheduleId = args[1]
|
||||||
|
@ -313,8 +314,6 @@ func newDeleteSchedule() *cobra.Command {
|
||||||
|
|
||||||
// TODO: short flags
|
// TODO: short flags
|
||||||
|
|
||||||
cmd.Flags().StringVar(&deleteScheduleReq.Etag, "etag", deleteScheduleReq.Etag, `The etag for the schedule.`)
|
|
||||||
|
|
||||||
cmd.Use = "delete-schedule DASHBOARD_ID SCHEDULE_ID"
|
cmd.Use = "delete-schedule DASHBOARD_ID SCHEDULE_ID"
|
||||||
cmd.Short = `Delete dashboard schedule.`
|
cmd.Short = `Delete dashboard schedule.`
|
||||||
cmd.Long = `Delete dashboard schedule.
|
cmd.Long = `Delete dashboard schedule.
|
||||||
|
@ -376,8 +375,6 @@ func newDeleteSubscription() *cobra.Command {
|
||||||
|
|
||||||
// TODO: short flags
|
// TODO: short flags
|
||||||
|
|
||||||
cmd.Flags().StringVar(&deleteSubscriptionReq.Etag, "etag", deleteSubscriptionReq.Etag, `The etag for the subscription.`)
|
|
||||||
|
|
||||||
cmd.Use = "delete-subscription DASHBOARD_ID SCHEDULE_ID SUBSCRIPTION_ID"
|
cmd.Use = "delete-subscription DASHBOARD_ID SCHEDULE_ID SUBSCRIPTION_ID"
|
||||||
cmd.Short = `Delete schedule subscription.`
|
cmd.Short = `Delete schedule subscription.`
|
||||||
cmd.Long = `Delete schedule subscription.
|
cmd.Long = `Delete schedule subscription.
|
||||||
|
@ -682,7 +679,6 @@ func newList() *cobra.Command {
|
||||||
// TODO: short flags
|
// TODO: short flags
|
||||||
|
|
||||||
cmd.Flags().IntVar(&listReq.PageSize, "page-size", listReq.PageSize, `The number of dashboards to return per page.`)
|
cmd.Flags().IntVar(&listReq.PageSize, "page-size", listReq.PageSize, `The number of dashboards to return per page.`)
|
||||||
cmd.Flags().StringVar(&listReq.PageToken, "page-token", listReq.PageToken, `A page token, received from a previous ListDashboards call.`)
|
|
||||||
cmd.Flags().BoolVar(&listReq.ShowTrashed, "show-trashed", listReq.ShowTrashed, `The flag to include dashboards located in the trash.`)
|
cmd.Flags().BoolVar(&listReq.ShowTrashed, "show-trashed", listReq.ShowTrashed, `The flag to include dashboards located in the trash.`)
|
||||||
cmd.Flags().Var(&listReq.View, "view", `DASHBOARD_VIEW_BASIConly includes summary metadata from the dashboard. Supported values: [DASHBOARD_VIEW_BASIC]`)
|
cmd.Flags().Var(&listReq.View, "view", `DASHBOARD_VIEW_BASIConly includes summary metadata from the dashboard. Supported values: [DASHBOARD_VIEW_BASIC]`)
|
||||||
|
|
||||||
|
@ -735,7 +731,6 @@ func newListSchedules() *cobra.Command {
|
||||||
// TODO: short flags
|
// TODO: short flags
|
||||||
|
|
||||||
cmd.Flags().IntVar(&listSchedulesReq.PageSize, "page-size", listSchedulesReq.PageSize, `The number of schedules to return per page.`)
|
cmd.Flags().IntVar(&listSchedulesReq.PageSize, "page-size", listSchedulesReq.PageSize, `The number of schedules to return per page.`)
|
||||||
cmd.Flags().StringVar(&listSchedulesReq.PageToken, "page-token", listSchedulesReq.PageToken, `A page token, received from a previous ListSchedules call.`)
|
|
||||||
|
|
||||||
cmd.Use = "list-schedules DASHBOARD_ID"
|
cmd.Use = "list-schedules DASHBOARD_ID"
|
||||||
cmd.Short = `List dashboard schedules.`
|
cmd.Short = `List dashboard schedules.`
|
||||||
|
@ -794,7 +789,6 @@ func newListSubscriptions() *cobra.Command {
|
||||||
// TODO: short flags
|
// TODO: short flags
|
||||||
|
|
||||||
cmd.Flags().IntVar(&listSubscriptionsReq.PageSize, "page-size", listSubscriptionsReq.PageSize, `The number of subscriptions to return per page.`)
|
cmd.Flags().IntVar(&listSubscriptionsReq.PageSize, "page-size", listSubscriptionsReq.PageSize, `The number of subscriptions to return per page.`)
|
||||||
cmd.Flags().StringVar(&listSubscriptionsReq.PageToken, "page-token", listSubscriptionsReq.PageToken, `A page token, received from a previous ListSubscriptions call.`)
|
|
||||||
|
|
||||||
cmd.Use = "list-subscriptions DASHBOARD_ID SCHEDULE_ID"
|
cmd.Use = "list-subscriptions DASHBOARD_ID SCHEDULE_ID"
|
||||||
cmd.Short = `List schedule subscriptions.`
|
cmd.Short = `List schedule subscriptions.`
|
||||||
|
@ -1126,15 +1120,15 @@ func newUpdate() *cobra.Command {
|
||||||
cmd := &cobra.Command{}
|
cmd := &cobra.Command{}
|
||||||
|
|
||||||
var updateReq dashboards.UpdateDashboardRequest
|
var updateReq dashboards.UpdateDashboardRequest
|
||||||
|
updateReq.Dashboard = &dashboards.Dashboard{}
|
||||||
var updateJson flags.JsonFlag
|
var updateJson flags.JsonFlag
|
||||||
|
|
||||||
// TODO: short flags
|
// TODO: short flags
|
||||||
cmd.Flags().Var(&updateJson, "json", `either inline JSON string or @path/to/file.json with request body`)
|
cmd.Flags().Var(&updateJson, "json", `either inline JSON string or @path/to/file.json with request body`)
|
||||||
|
|
||||||
cmd.Flags().StringVar(&updateReq.DisplayName, "display-name", updateReq.DisplayName, `The display name of the dashboard.`)
|
cmd.Flags().StringVar(&updateReq.Dashboard.DisplayName, "display-name", updateReq.Dashboard.DisplayName, `The display name of the dashboard.`)
|
||||||
cmd.Flags().StringVar(&updateReq.Etag, "etag", updateReq.Etag, `The etag for the dashboard.`)
|
cmd.Flags().StringVar(&updateReq.Dashboard.SerializedDashboard, "serialized-dashboard", updateReq.Dashboard.SerializedDashboard, `The contents of the dashboard in serialized string form.`)
|
||||||
cmd.Flags().StringVar(&updateReq.SerializedDashboard, "serialized-dashboard", updateReq.SerializedDashboard, `The contents of the dashboard in serialized string form.`)
|
cmd.Flags().StringVar(&updateReq.Dashboard.WarehouseId, "warehouse-id", updateReq.Dashboard.WarehouseId, `The warehouse ID used to run the dashboard.`)
|
||||||
cmd.Flags().StringVar(&updateReq.WarehouseId, "warehouse-id", updateReq.WarehouseId, `The warehouse ID used to run the dashboard.`)
|
|
||||||
|
|
||||||
cmd.Use = "update DASHBOARD_ID"
|
cmd.Use = "update DASHBOARD_ID"
|
||||||
cmd.Short = `Update dashboard.`
|
cmd.Short = `Update dashboard.`
|
||||||
|
@ -1158,7 +1152,7 @@ func newUpdate() *cobra.Command {
|
||||||
w := root.WorkspaceClient(ctx)
|
w := root.WorkspaceClient(ctx)
|
||||||
|
|
||||||
if cmd.Flags().Changed("json") {
|
if cmd.Flags().Changed("json") {
|
||||||
diags := updateJson.Unmarshal(&updateReq)
|
diags := updateJson.Unmarshal(&updateReq.Dashboard)
|
||||||
if diags.HasError() {
|
if diags.HasError() {
|
||||||
return diags.Error()
|
return diags.Error()
|
||||||
}
|
}
|
||||||
|
@ -1203,14 +1197,15 @@ func newUpdateSchedule() *cobra.Command {
|
||||||
cmd := &cobra.Command{}
|
cmd := &cobra.Command{}
|
||||||
|
|
||||||
var updateScheduleReq dashboards.UpdateScheduleRequest
|
var updateScheduleReq dashboards.UpdateScheduleRequest
|
||||||
|
updateScheduleReq.Schedule = &dashboards.Schedule{}
|
||||||
var updateScheduleJson flags.JsonFlag
|
var updateScheduleJson flags.JsonFlag
|
||||||
|
|
||||||
// TODO: short flags
|
// TODO: short flags
|
||||||
cmd.Flags().Var(&updateScheduleJson, "json", `either inline JSON string or @path/to/file.json with request body`)
|
cmd.Flags().Var(&updateScheduleJson, "json", `either inline JSON string or @path/to/file.json with request body`)
|
||||||
|
|
||||||
cmd.Flags().StringVar(&updateScheduleReq.DisplayName, "display-name", updateScheduleReq.DisplayName, `The display name for schedule.`)
|
cmd.Flags().StringVar(&updateScheduleReq.Schedule.DisplayName, "display-name", updateScheduleReq.Schedule.DisplayName, `The display name for schedule.`)
|
||||||
cmd.Flags().StringVar(&updateScheduleReq.Etag, "etag", updateScheduleReq.Etag, `The etag for the schedule.`)
|
cmd.Flags().Var(&updateScheduleReq.Schedule.PauseStatus, "pause-status", `The status indicates whether this schedule is paused or not. Supported values: [PAUSED, UNPAUSED]`)
|
||||||
cmd.Flags().Var(&updateScheduleReq.PauseStatus, "pause-status", `The status indicates whether this schedule is paused or not. Supported values: [PAUSED, UNPAUSED]`)
|
cmd.Flags().StringVar(&updateScheduleReq.Schedule.WarehouseId, "warehouse-id", updateScheduleReq.Schedule.WarehouseId, `The warehouse id to run the dashboard with for the schedule.`)
|
||||||
|
|
||||||
cmd.Use = "update-schedule DASHBOARD_ID SCHEDULE_ID"
|
cmd.Use = "update-schedule DASHBOARD_ID SCHEDULE_ID"
|
||||||
cmd.Short = `Update dashboard schedule.`
|
cmd.Short = `Update dashboard schedule.`
|
||||||
|
@ -1226,6 +1221,13 @@ func newUpdateSchedule() *cobra.Command {
|
||||||
cmd.Annotations = make(map[string]string)
|
cmd.Annotations = make(map[string]string)
|
||||||
|
|
||||||
cmd.Args = func(cmd *cobra.Command, args []string) error {
|
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 'cron_schedule' in your JSON input")
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
check := root.ExactArgs(2)
|
check := root.ExactArgs(2)
|
||||||
return check(cmd, args)
|
return check(cmd, args)
|
||||||
}
|
}
|
||||||
|
@ -1236,7 +1238,7 @@ func newUpdateSchedule() *cobra.Command {
|
||||||
w := root.WorkspaceClient(ctx)
|
w := root.WorkspaceClient(ctx)
|
||||||
|
|
||||||
if cmd.Flags().Changed("json") {
|
if cmd.Flags().Changed("json") {
|
||||||
diags := updateScheduleJson.Unmarshal(&updateScheduleReq)
|
diags := updateScheduleJson.Unmarshal(&updateScheduleReq.Schedule)
|
||||||
if diags.HasError() {
|
if diags.HasError() {
|
||||||
return diags.Error()
|
return diags.Error()
|
||||||
}
|
}
|
||||||
|
@ -1246,8 +1248,6 @@ func newUpdateSchedule() *cobra.Command {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
return fmt.Errorf("please provide command input in JSON format by specifying the --json flag")
|
|
||||||
}
|
}
|
||||||
updateScheduleReq.DashboardId = args[0]
|
updateScheduleReq.DashboardId = args[0]
|
||||||
updateScheduleReq.ScheduleId = args[1]
|
updateScheduleReq.ScheduleId = args[1]
|
||||||
|
|
|
@ -2123,7 +2123,8 @@ func newSetPermissions() *cobra.Command {
|
||||||
cmd.Short = `Set registered model permissions.`
|
cmd.Short = `Set registered model permissions.`
|
||||||
cmd.Long = `Set registered model permissions.
|
cmd.Long = `Set registered model permissions.
|
||||||
|
|
||||||
Sets permissions on a registered model. Registered models can inherit
|
Sets permissions on an object, replacing existing permissions if they exist.
|
||||||
|
Deletes all direct permissions if none are specified. Objects can inherit
|
||||||
permissions from their root object.
|
permissions from their root object.
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
|
|
|
@ -3,6 +3,9 @@
|
||||||
package online_tables
|
package online_tables
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/databricks/cli/cmd/root"
|
"github.com/databricks/cli/cmd/root"
|
||||||
"github.com/databricks/cli/libs/cmdio"
|
"github.com/databricks/cli/libs/cmdio"
|
||||||
"github.com/databricks/cli/libs/flags"
|
"github.com/databricks/cli/libs/flags"
|
||||||
|
@ -52,13 +55,20 @@ func newCreate() *cobra.Command {
|
||||||
cmd := &cobra.Command{}
|
cmd := &cobra.Command{}
|
||||||
|
|
||||||
var createReq catalog.CreateOnlineTableRequest
|
var createReq catalog.CreateOnlineTableRequest
|
||||||
|
createReq.Table = &catalog.OnlineTable{}
|
||||||
var createJson flags.JsonFlag
|
var createJson flags.JsonFlag
|
||||||
|
|
||||||
|
var createSkipWait bool
|
||||||
|
var createTimeout time.Duration
|
||||||
|
|
||||||
|
cmd.Flags().BoolVar(&createSkipWait, "no-wait", createSkipWait, `do not wait to reach ACTIVE state`)
|
||||||
|
cmd.Flags().DurationVar(&createTimeout, "timeout", 20*time.Minute, `maximum amount of time to reach ACTIVE state`)
|
||||||
// TODO: short flags
|
// TODO: short flags
|
||||||
cmd.Flags().Var(&createJson, "json", `either inline JSON string or @path/to/file.json with request body`)
|
cmd.Flags().Var(&createJson, "json", `either inline JSON string or @path/to/file.json with request body`)
|
||||||
|
|
||||||
cmd.Flags().StringVar(&createReq.Name, "name", createReq.Name, `Full three-part (catalog, schema, table) name of the table.`)
|
cmd.Flags().StringVar(&createReq.Table.Name, "name", createReq.Table.Name, `Full three-part (catalog, schema, table) name of the table.`)
|
||||||
// TODO: complex arg: spec
|
// TODO: complex arg: spec
|
||||||
|
// TODO: complex arg: status
|
||||||
|
|
||||||
cmd.Use = "create"
|
cmd.Use = "create"
|
||||||
cmd.Short = `Create an Online Table.`
|
cmd.Short = `Create an Online Table.`
|
||||||
|
@ -79,7 +89,7 @@ func newCreate() *cobra.Command {
|
||||||
w := root.WorkspaceClient(ctx)
|
w := root.WorkspaceClient(ctx)
|
||||||
|
|
||||||
if cmd.Flags().Changed("json") {
|
if cmd.Flags().Changed("json") {
|
||||||
diags := createJson.Unmarshal(&createReq)
|
diags := createJson.Unmarshal(&createReq.Table)
|
||||||
if diags.HasError() {
|
if diags.HasError() {
|
||||||
return diags.Error()
|
return diags.Error()
|
||||||
}
|
}
|
||||||
|
@ -91,11 +101,24 @@ func newCreate() *cobra.Command {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
response, err := w.OnlineTables.Create(ctx, createReq)
|
wait, err := w.OnlineTables.Create(ctx, createReq)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
return cmdio.Render(ctx, response)
|
if createSkipWait {
|
||||||
|
return cmdio.Render(ctx, wait.Response)
|
||||||
|
}
|
||||||
|
spinner := cmdio.Spinner(ctx)
|
||||||
|
info, err := wait.OnProgress(func(i *catalog.OnlineTable) {
|
||||||
|
status := i.UnityCatalogProvisioningState
|
||||||
|
statusMessage := fmt.Sprintf("current status: %s", status)
|
||||||
|
spinner <- statusMessage
|
||||||
|
}).GetWithTimeout(createTimeout)
|
||||||
|
close(spinner)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return cmdio.Render(ctx, info)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Disable completions since they are not applicable.
|
// Disable completions since they are not applicable.
|
||||||
|
|
|
@ -241,8 +241,9 @@ func newSet() *cobra.Command {
|
||||||
cmd.Short = `Set object permissions.`
|
cmd.Short = `Set object permissions.`
|
||||||
cmd.Long = `Set object permissions.
|
cmd.Long = `Set object permissions.
|
||||||
|
|
||||||
Sets permissions on an object. Objects can inherit permissions from their
|
Sets permissions on an object, replacing existing permissions if they exist.
|
||||||
parent objects or root object.
|
Deletes all direct permissions if none are specified. Objects can inherit
|
||||||
|
permissions from their parent objects or root object.
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
REQUEST_OBJECT_TYPE: The type of the request object. Can be one of the following: alerts,
|
REQUEST_OBJECT_TYPE: The type of the request object. Can be one of the following: alerts,
|
||||||
|
|
|
@ -691,8 +691,9 @@ func newSetPermissions() *cobra.Command {
|
||||||
cmd.Short = `Set pipeline permissions.`
|
cmd.Short = `Set pipeline permissions.`
|
||||||
cmd.Long = `Set pipeline permissions.
|
cmd.Long = `Set pipeline permissions.
|
||||||
|
|
||||||
Sets permissions on a pipeline. Pipelines can inherit permissions from their
|
Sets permissions on an object, replacing existing permissions if they exist.
|
||||||
root object.
|
Deletes all direct permissions if none are specified. Objects can inherit
|
||||||
|
permissions from their root object.
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
PIPELINE_ID: The pipeline for which to get or manage permissions.`
|
PIPELINE_ID: The pipeline for which to get or manage permissions.`
|
||||||
|
@ -972,6 +973,7 @@ func newUpdate() *cobra.Command {
|
||||||
// TODO: array: notifications
|
// TODO: array: notifications
|
||||||
cmd.Flags().BoolVar(&updateReq.Photon, "photon", updateReq.Photon, `Whether Photon is enabled for this pipeline.`)
|
cmd.Flags().BoolVar(&updateReq.Photon, "photon", updateReq.Photon, `Whether Photon is enabled for this pipeline.`)
|
||||||
cmd.Flags().StringVar(&updateReq.PipelineId, "pipeline-id", updateReq.PipelineId, `Unique identifier for this pipeline.`)
|
cmd.Flags().StringVar(&updateReq.PipelineId, "pipeline-id", updateReq.PipelineId, `Unique identifier for this pipeline.`)
|
||||||
|
// TODO: complex arg: restart_window
|
||||||
cmd.Flags().StringVar(&updateReq.Schema, "schema", updateReq.Schema, `The default schema (database) where tables are read from or published to.`)
|
cmd.Flags().StringVar(&updateReq.Schema, "schema", updateReq.Schema, `The default schema (database) where tables are read from or published to.`)
|
||||||
cmd.Flags().BoolVar(&updateReq.Serverless, "serverless", updateReq.Serverless, `Whether serverless compute is enabled for this pipeline.`)
|
cmd.Flags().BoolVar(&updateReq.Serverless, "serverless", updateReq.Serverless, `Whether serverless compute is enabled for this pipeline.`)
|
||||||
cmd.Flags().StringVar(&updateReq.Storage, "storage", updateReq.Storage, `DBFS root directory for storing checkpoints and tables.`)
|
cmd.Flags().StringVar(&updateReq.Storage, "storage", updateReq.Storage, `DBFS root directory for storing checkpoints and tables.`)
|
||||||
|
|
|
@ -513,8 +513,9 @@ func newSetPermissions() *cobra.Command {
|
||||||
cmd.Short = `Set repo permissions.`
|
cmd.Short = `Set repo permissions.`
|
||||||
cmd.Long = `Set repo permissions.
|
cmd.Long = `Set repo permissions.
|
||||||
|
|
||||||
Sets permissions on a repo. Repos can inherit permissions from their root
|
Sets permissions on an object, replacing existing permissions if they exist.
|
||||||
object.
|
Deletes all direct permissions if none are specified. Objects can inherit
|
||||||
|
permissions from their root object.
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
REPO_ID: The repo for which to get or manage permissions.`
|
REPO_ID: The repo for which to get or manage permissions.`
|
||||||
|
|
|
@ -1008,7 +1008,8 @@ func newSetPermissions() *cobra.Command {
|
||||||
cmd.Short = `Set serving endpoint permissions.`
|
cmd.Short = `Set serving endpoint permissions.`
|
||||||
cmd.Long = `Set serving endpoint permissions.
|
cmd.Long = `Set serving endpoint permissions.
|
||||||
|
|
||||||
Sets permissions on a serving endpoint. Serving endpoints can inherit
|
Sets permissions on an object, replacing existing permissions if they exist.
|
||||||
|
Deletes all direct permissions if none are specified. Objects can inherit
|
||||||
permissions from their root object.
|
permissions from their root object.
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
|
|
|
@ -5,6 +5,8 @@ package settings
|
||||||
import (
|
import (
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
|
||||||
|
aibi_dashboard_embedding_access_policy "github.com/databricks/cli/cmd/workspace/aibi-dashboard-embedding-access-policy"
|
||||||
|
aibi_dashboard_embedding_approved_domains "github.com/databricks/cli/cmd/workspace/aibi-dashboard-embedding-approved-domains"
|
||||||
automatic_cluster_update "github.com/databricks/cli/cmd/workspace/automatic-cluster-update"
|
automatic_cluster_update "github.com/databricks/cli/cmd/workspace/automatic-cluster-update"
|
||||||
compliance_security_profile "github.com/databricks/cli/cmd/workspace/compliance-security-profile"
|
compliance_security_profile "github.com/databricks/cli/cmd/workspace/compliance-security-profile"
|
||||||
default_namespace "github.com/databricks/cli/cmd/workspace/default-namespace"
|
default_namespace "github.com/databricks/cli/cmd/workspace/default-namespace"
|
||||||
|
@ -30,6 +32,8 @@ func New() *cobra.Command {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add subservices
|
// Add subservices
|
||||||
|
cmd.AddCommand(aibi_dashboard_embedding_access_policy.New())
|
||||||
|
cmd.AddCommand(aibi_dashboard_embedding_approved_domains.New())
|
||||||
cmd.AddCommand(automatic_cluster_update.New())
|
cmd.AddCommand(automatic_cluster_update.New())
|
||||||
cmd.AddCommand(compliance_security_profile.New())
|
cmd.AddCommand(compliance_security_profile.New())
|
||||||
cmd.AddCommand(default_namespace.New())
|
cmd.AddCommand(default_namespace.New())
|
||||||
|
|
|
@ -391,7 +391,6 @@ func newUpdate() *cobra.Command {
|
||||||
|
|
||||||
cmd.Flags().StringVar(&updateReq.Comment, "comment", updateReq.Comment, `User-provided free-form text description.`)
|
cmd.Flags().StringVar(&updateReq.Comment, "comment", updateReq.Comment, `User-provided free-form text description.`)
|
||||||
cmd.Flags().StringVar(&updateReq.NewName, "new-name", updateReq.NewName, `New name for the share.`)
|
cmd.Flags().StringVar(&updateReq.NewName, "new-name", updateReq.NewName, `New name for the share.`)
|
||||||
cmd.Flags().StringVar(&updateReq.Owner, "owner", updateReq.Owner, `Username of current owner of share.`)
|
|
||||||
cmd.Flags().StringVar(&updateReq.StorageRoot, "storage-root", updateReq.StorageRoot, `Storage root URL for the share.`)
|
cmd.Flags().StringVar(&updateReq.StorageRoot, "storage-root", updateReq.StorageRoot, `Storage root URL for the share.`)
|
||||||
// TODO: array: updates
|
// TODO: array: updates
|
||||||
|
|
||||||
|
|
|
@ -360,7 +360,7 @@ func newUpdate() *cobra.Command {
|
||||||
cmd.Flags().StringVar(&updateReq.Comment, "comment", updateReq.Comment, `Comment associated with the credential.`)
|
cmd.Flags().StringVar(&updateReq.Comment, "comment", updateReq.Comment, `Comment associated with the credential.`)
|
||||||
// TODO: complex arg: databricks_gcp_service_account
|
// TODO: complex arg: databricks_gcp_service_account
|
||||||
cmd.Flags().BoolVar(&updateReq.Force, "force", updateReq.Force, `Force update even if there are dependent external locations or external tables.`)
|
cmd.Flags().BoolVar(&updateReq.Force, "force", updateReq.Force, `Force update even if there are dependent external locations or external tables.`)
|
||||||
cmd.Flags().Var(&updateReq.IsolationMode, "isolation-mode", `Whether the current securable is accessible from all workspaces or a specific set of workspaces. Supported values: [ISOLATION_MODE_ISOLATED, ISOLATION_MODE_OPEN]`)
|
cmd.Flags().Var(&updateReq.IsolationMode, "isolation-mode", `. Supported values: [ISOLATION_MODE_ISOLATED, ISOLATION_MODE_OPEN]`)
|
||||||
cmd.Flags().StringVar(&updateReq.NewName, "new-name", updateReq.NewName, `New name for the storage credential.`)
|
cmd.Flags().StringVar(&updateReq.NewName, "new-name", updateReq.NewName, `New name for the storage credential.`)
|
||||||
cmd.Flags().StringVar(&updateReq.Owner, "owner", updateReq.Owner, `Username of current owner of credential.`)
|
cmd.Flags().StringVar(&updateReq.Owner, "owner", updateReq.Owner, `Username of current owner of credential.`)
|
||||||
cmd.Flags().BoolVar(&updateReq.ReadOnly, "read-only", updateReq.ReadOnly, `Whether the storage credential is only usable for read operations.`)
|
cmd.Flags().BoolVar(&updateReq.ReadOnly, "read-only", updateReq.ReadOnly, `Whether the storage credential is only usable for read operations.`)
|
||||||
|
|
|
@ -304,6 +304,7 @@ func newList() *cobra.Command {
|
||||||
cmd.Flags().IntVar(&listReq.MaxResults, "max-results", listReq.MaxResults, `Maximum number of tables to return.`)
|
cmd.Flags().IntVar(&listReq.MaxResults, "max-results", listReq.MaxResults, `Maximum number of tables to return.`)
|
||||||
cmd.Flags().BoolVar(&listReq.OmitColumns, "omit-columns", listReq.OmitColumns, `Whether to omit the columns of the table from the response or not.`)
|
cmd.Flags().BoolVar(&listReq.OmitColumns, "omit-columns", listReq.OmitColumns, `Whether to omit the columns of the table from the response or not.`)
|
||||||
cmd.Flags().BoolVar(&listReq.OmitProperties, "omit-properties", listReq.OmitProperties, `Whether to omit the properties of the table from the response or not.`)
|
cmd.Flags().BoolVar(&listReq.OmitProperties, "omit-properties", listReq.OmitProperties, `Whether to omit the properties of the table from the response or not.`)
|
||||||
|
cmd.Flags().BoolVar(&listReq.OmitUsername, "omit-username", listReq.OmitUsername, `Whether to omit the username of the table (e.g.`)
|
||||||
cmd.Flags().StringVar(&listReq.PageToken, "page-token", listReq.PageToken, `Opaque token to send for the next page of results (pagination).`)
|
cmd.Flags().StringVar(&listReq.PageToken, "page-token", listReq.PageToken, `Opaque token to send for the next page of results (pagination).`)
|
||||||
|
|
||||||
cmd.Use = "list CATALOG_NAME SCHEMA_NAME"
|
cmd.Use = "list CATALOG_NAME SCHEMA_NAME"
|
||||||
|
|
|
@ -448,8 +448,9 @@ func newSetPermissions() *cobra.Command {
|
||||||
cmd.Short = `Set token permissions.`
|
cmd.Short = `Set token permissions.`
|
||||||
cmd.Long = `Set token permissions.
|
cmd.Long = `Set token permissions.
|
||||||
|
|
||||||
Sets permissions on all tokens. Tokens can inherit permissions from their root
|
Sets permissions on an object, replacing existing permissions if they exist.
|
||||||
object.`
|
Deletes all direct permissions if none are specified. Objects can inherit
|
||||||
|
permissions from their root object.`
|
||||||
|
|
||||||
cmd.Annotations = make(map[string]string)
|
cmd.Annotations = make(map[string]string)
|
||||||
|
|
||||||
|
|
|
@ -542,8 +542,9 @@ func newSetPermissions() *cobra.Command {
|
||||||
cmd.Short = `Set password permissions.`
|
cmd.Short = `Set password permissions.`
|
||||||
cmd.Long = `Set password permissions.
|
cmd.Long = `Set password permissions.
|
||||||
|
|
||||||
Sets permissions on all passwords. Passwords can inherit permissions from
|
Sets permissions on an object, replacing existing permissions if they exist.
|
||||||
their root object.`
|
Deletes all direct permissions if none are specified. Objects can inherit
|
||||||
|
permissions from their root object.`
|
||||||
|
|
||||||
cmd.Annotations = make(map[string]string)
|
cmd.Annotations = make(map[string]string)
|
||||||
|
|
||||||
|
|
|
@ -686,8 +686,9 @@ func newSetPermissions() *cobra.Command {
|
||||||
cmd.Short = `Set SQL warehouse permissions.`
|
cmd.Short = `Set SQL warehouse permissions.`
|
||||||
cmd.Long = `Set SQL warehouse permissions.
|
cmd.Long = `Set SQL warehouse permissions.
|
||||||
|
|
||||||
Sets permissions on a SQL warehouse. SQL warehouses can inherit permissions
|
Sets permissions on an object, replacing existing permissions if they exist.
|
||||||
from their root object.
|
Deletes all direct permissions if none are specified. Objects can inherit
|
||||||
|
permissions from their root object.
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
WAREHOUSE_ID: The SQL warehouse for which to get or manage permissions.`
|
WAREHOUSE_ID: The SQL warehouse for which to get or manage permissions.`
|
||||||
|
|
|
@ -447,6 +447,7 @@ func newImport() *cobra.Command {
|
||||||
DBC,
|
DBC,
|
||||||
HTML,
|
HTML,
|
||||||
JUPYTER,
|
JUPYTER,
|
||||||
|
RAW,
|
||||||
R_MARKDOWN,
|
R_MARKDOWN,
|
||||||
SOURCE,
|
SOURCE,
|
||||||
]`)
|
]`)
|
||||||
|
@ -708,7 +709,8 @@ func newSetPermissions() *cobra.Command {
|
||||||
cmd.Short = `Set workspace object permissions.`
|
cmd.Short = `Set workspace object permissions.`
|
||||||
cmd.Long = `Set workspace object permissions.
|
cmd.Long = `Set workspace object permissions.
|
||||||
|
|
||||||
Sets permissions on a workspace object. Workspace objects can inherit
|
Sets permissions on an object, replacing existing permissions if they exist.
|
||||||
|
Deletes all direct permissions if none are specified. Objects can inherit
|
||||||
permissions from their parent objects or root object.
|
permissions from their parent objects or root object.
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
|
|
2
go.mod
2
go.mod
|
@ -7,7 +7,7 @@ toolchain go1.23.2
|
||||||
require (
|
require (
|
||||||
github.com/Masterminds/semver/v3 v3.3.0 // MIT
|
github.com/Masterminds/semver/v3 v3.3.0 // MIT
|
||||||
github.com/briandowns/spinner v1.23.1 // Apache 2.0
|
github.com/briandowns/spinner v1.23.1 // Apache 2.0
|
||||||
github.com/databricks/databricks-sdk-go v0.49.0 // Apache 2.0
|
github.com/databricks/databricks-sdk-go v0.51.0 // Apache 2.0
|
||||||
github.com/fatih/color v1.18.0 // MIT
|
github.com/fatih/color v1.18.0 // MIT
|
||||||
github.com/ghodss/yaml v1.0.0 // MIT + NOTICE
|
github.com/ghodss/yaml v1.0.0 // MIT + NOTICE
|
||||||
github.com/google/uuid v1.6.0 // BSD-3-Clause
|
github.com/google/uuid v1.6.0 // BSD-3-Clause
|
||||||
|
|
|
@ -32,8 +32,8 @@ github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGX
|
||||||
github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
|
github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
|
||||||
github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg=
|
github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg=
|
||||||
github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4=
|
github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4=
|
||||||
github.com/databricks/databricks-sdk-go v0.49.0 h1:VBTeZZMLIuBSM4kxOCfUcW9z4FUQZY2QeNRD5qm9FUQ=
|
github.com/databricks/databricks-sdk-go v0.51.0 h1:tcvB9TID3oUl0O8npccB5c+33tarBiYMBFbq4U4AB6M=
|
||||||
github.com/databricks/databricks-sdk-go v0.49.0/go.mod h1:ds+zbv5mlQG7nFEU5ojLtgN/u0/9YzZmKQES/CfedzU=
|
github.com/databricks/databricks-sdk-go v0.51.0/go.mod h1:ds+zbv5mlQG7nFEU5ojLtgN/u0/9YzZmKQES/CfedzU=
|
||||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
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 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
|
|
|
@ -47,7 +47,9 @@ func TestAccDashboards(t *testing.T) {
|
||||||
// Make an out of band modification to the dashboard and confirm that it is detected.
|
// Make an out of band modification to the dashboard and confirm that it is detected.
|
||||||
_, err = wt.W.Lakeview.Update(ctx, dashboards.UpdateDashboardRequest{
|
_, err = wt.W.Lakeview.Update(ctx, dashboards.UpdateDashboardRequest{
|
||||||
DashboardId: oi.ResourceId,
|
DashboardId: oi.ResourceId,
|
||||||
|
Dashboard: &dashboards.Dashboard{
|
||||||
SerializedDashboard: dashboard.SerializedDashboard,
|
SerializedDashboard: dashboard.SerializedDashboard,
|
||||||
|
},
|
||||||
})
|
})
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
|
|
|
@ -30,10 +30,12 @@ func TestAccDashboardAssumptions_WorkspaceImport(t *testing.T) {
|
||||||
dir := wt.TemporaryWorkspaceDir("dashboard-assumptions-")
|
dir := wt.TemporaryWorkspaceDir("dashboard-assumptions-")
|
||||||
|
|
||||||
dashboard, err := wt.W.Lakeview.Create(ctx, dashboards.CreateDashboardRequest{
|
dashboard, err := wt.W.Lakeview.Create(ctx, dashboards.CreateDashboardRequest{
|
||||||
|
Dashboard: &dashboards.Dashboard{
|
||||||
DisplayName: dashboardName,
|
DisplayName: dashboardName,
|
||||||
ParentPath: dir,
|
ParentPath: dir,
|
||||||
SerializedDashboard: string(dashboardPayload),
|
SerializedDashboard: string(dashboardPayload),
|
||||||
WarehouseId: warehouseId,
|
WarehouseId: warehouseId,
|
||||||
|
},
|
||||||
})
|
})
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
t.Logf("Dashboard ID (per Lakeview API): %s", dashboard.DashboardId)
|
t.Logf("Dashboard ID (per Lakeview API): %s", dashboard.DashboardId)
|
||||||
|
@ -62,9 +64,11 @@ func TestAccDashboardAssumptions_WorkspaceImport(t *testing.T) {
|
||||||
// Try to overwrite the dashboard via the Lakeview API (and expect failure).
|
// Try to overwrite the dashboard via the Lakeview API (and expect failure).
|
||||||
{
|
{
|
||||||
_, err := wt.W.Lakeview.Create(ctx, dashboards.CreateDashboardRequest{
|
_, err := wt.W.Lakeview.Create(ctx, dashboards.CreateDashboardRequest{
|
||||||
|
Dashboard: &dashboards.Dashboard{
|
||||||
DisplayName: dashboardName,
|
DisplayName: dashboardName,
|
||||||
ParentPath: dir,
|
ParentPath: dir,
|
||||||
SerializedDashboard: string(dashboardPayload),
|
SerializedDashboard: string(dashboardPayload),
|
||||||
|
},
|
||||||
})
|
})
|
||||||
require.ErrorIs(t, err, apierr.ErrResourceAlreadyExists)
|
require.ErrorIs(t, err, apierr.ErrResourceAlreadyExists)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue