mirror of https://github.com/databricks/cli.git
Added more commands
This commit is contained in:
parent
f88605c032
commit
91e1da0f52
|
@ -58,7 +58,7 @@ func init() {
|
|||
{{if .Request}}// TODO: short flags
|
||||
{{.CamelName}}Cmd.Flags().Var(&{{.CamelName}}Json, "json", `either inline JSON string or @path/to/file.json with request body`)
|
||||
{{$method := .}}
|
||||
{{ if not .OnlyPayload }}
|
||||
{{ if not .JsonOnly }}
|
||||
{{range .Request.Fields -}}
|
||||
{{- if not .Required -}}
|
||||
{{if .Entity.IsObject }}// TODO: complex arg: {{.Name}}
|
||||
|
@ -135,7 +135,7 @@ var {{.CamelName}}Cmd = &cobra.Command{
|
|||
}
|
||||
{{- end -}}
|
||||
{{$method := .}}
|
||||
{{- if and .Request.IsAllRequiredFieldsPrimitive (not .OnlyPayload) -}}
|
||||
{{- if and .Request.IsAllRequiredFieldsPrimitive (not .JsonOnly) -}}
|
||||
{{- range $arg, $field := .Request.RequiredFields}}
|
||||
{{if not $field.Entity.IsString -}}
|
||||
_, err = fmt.Sscan(args[{{$arg}}], &{{$method.CamelName}}Req.{{$field.PascalName}})
|
||||
|
|
|
@ -37,14 +37,6 @@ func init() {
|
|||
// TODO: short flags
|
||||
createCmd.Flags().Var(&createJson, "json", `either inline JSON string or @path/to/file.json with request body`)
|
||||
|
||||
createCmd.Flags().StringVar(&createReq.DisplayName, "display-name", createReq.DisplayName, `String that represents a human-readable group name.`)
|
||||
// TODO: array: entitlements
|
||||
createCmd.Flags().StringVar(&createReq.ExternalId, "external-id", createReq.ExternalId, ``)
|
||||
// TODO: array: groups
|
||||
createCmd.Flags().StringVar(&createReq.Id, "id", createReq.Id, `Databricks group ID.`)
|
||||
// TODO: array: members
|
||||
// TODO: array: roles
|
||||
|
||||
}
|
||||
|
||||
var createCmd = &cobra.Command{
|
||||
|
@ -73,6 +65,7 @@ var createCmd = &cobra.Command{
|
|||
return err
|
||||
}
|
||||
} else {
|
||||
return fmt.Errorf("please provide command input in JSON format by specifying the --json flag")
|
||||
}
|
||||
|
||||
response, err := a.Groups.Create(ctx, createReq)
|
||||
|
|
|
@ -36,15 +36,6 @@ func init() {
|
|||
// TODO: short flags
|
||||
createCmd.Flags().Var(&createJson, "json", `either inline JSON string or @path/to/file.json with request body`)
|
||||
|
||||
createCmd.Flags().BoolVar(&createReq.Active, "active", createReq.Active, `If this user is active.`)
|
||||
createCmd.Flags().StringVar(&createReq.ApplicationId, "application-id", createReq.ApplicationId, `UUID relating to the service principal.`)
|
||||
createCmd.Flags().StringVar(&createReq.DisplayName, "display-name", createReq.DisplayName, `String that represents a concatenation of given and family names.`)
|
||||
// TODO: array: entitlements
|
||||
createCmd.Flags().StringVar(&createReq.ExternalId, "external-id", createReq.ExternalId, ``)
|
||||
// TODO: array: groups
|
||||
createCmd.Flags().StringVar(&createReq.Id, "id", createReq.Id, `Databricks service principal ID.`)
|
||||
// TODO: array: roles
|
||||
|
||||
}
|
||||
|
||||
var createCmd = &cobra.Command{
|
||||
|
@ -72,6 +63,7 @@ var createCmd = &cobra.Command{
|
|||
return err
|
||||
}
|
||||
} else {
|
||||
return fmt.Errorf("please provide command input in JSON format by specifying the --json flag")
|
||||
}
|
||||
|
||||
response, err := a.ServicePrincipals.Create(ctx, createReq)
|
||||
|
|
|
@ -41,17 +41,6 @@ func init() {
|
|||
// TODO: short flags
|
||||
createCmd.Flags().Var(&createJson, "json", `either inline JSON string or @path/to/file.json with request body`)
|
||||
|
||||
createCmd.Flags().BoolVar(&createReq.Active, "active", createReq.Active, `If this user is active.`)
|
||||
createCmd.Flags().StringVar(&createReq.DisplayName, "display-name", createReq.DisplayName, `String that represents a concatenation of given and family names.`)
|
||||
// TODO: array: emails
|
||||
// TODO: array: entitlements
|
||||
createCmd.Flags().StringVar(&createReq.ExternalId, "external-id", createReq.ExternalId, ``)
|
||||
// TODO: array: groups
|
||||
createCmd.Flags().StringVar(&createReq.Id, "id", createReq.Id, `Databricks user ID.`)
|
||||
// TODO: complex arg: name
|
||||
// TODO: array: roles
|
||||
createCmd.Flags().StringVar(&createReq.UserName, "user-name", createReq.UserName, `Email address of the Databricks user.`)
|
||||
|
||||
}
|
||||
|
||||
var createCmd = &cobra.Command{
|
||||
|
@ -80,6 +69,7 @@ var createCmd = &cobra.Command{
|
|||
return err
|
||||
}
|
||||
} else {
|
||||
return fmt.Errorf("please provide command input in JSON format by specifying the --json flag")
|
||||
}
|
||||
|
||||
response, err := a.Users.Create(ctx, createReq)
|
||||
|
|
|
@ -36,11 +36,6 @@ func init() {
|
|||
// TODO: short flags
|
||||
createCmd.Flags().Var(&createJson, "json", `either inline JSON string or @path/to/file.json with request body`)
|
||||
|
||||
createCmd.Flags().BoolVar(&createReq.IsFavorite, "is-favorite", createReq.IsFavorite, `Indicates whether this query object should appear in the current user's favorites list.`)
|
||||
createCmd.Flags().StringVar(&createReq.Name, "name", createReq.Name, `The title of this dashboard that appears in list views and at the top of the dashboard page.`)
|
||||
createCmd.Flags().StringVar(&createReq.Parent, "parent", createReq.Parent, `The identifier of the workspace folder containing the dashboard.`)
|
||||
// TODO: array: tags
|
||||
|
||||
}
|
||||
|
||||
var createCmd = &cobra.Command{
|
||||
|
@ -66,6 +61,7 @@ var createCmd = &cobra.Command{
|
|||
return err
|
||||
}
|
||||
} else {
|
||||
return fmt.Errorf("please provide command input in JSON format by specifying the --json flag")
|
||||
}
|
||||
|
||||
response, err := w.Dashboards.Create(ctx, createReq)
|
||||
|
|
|
@ -37,14 +37,6 @@ func init() {
|
|||
// TODO: short flags
|
||||
createCmd.Flags().Var(&createJson, "json", `either inline JSON string or @path/to/file.json with request body`)
|
||||
|
||||
createCmd.Flags().StringVar(&createReq.DisplayName, "display-name", createReq.DisplayName, `String that represents a human-readable group name.`)
|
||||
// TODO: array: entitlements
|
||||
createCmd.Flags().StringVar(&createReq.ExternalId, "external-id", createReq.ExternalId, ``)
|
||||
// TODO: array: groups
|
||||
createCmd.Flags().StringVar(&createReq.Id, "id", createReq.Id, `Databricks group ID.`)
|
||||
// TODO: array: members
|
||||
// TODO: array: roles
|
||||
|
||||
}
|
||||
|
||||
var createCmd = &cobra.Command{
|
||||
|
@ -73,6 +65,7 @@ var createCmd = &cobra.Command{
|
|||
return err
|
||||
}
|
||||
} else {
|
||||
return fmt.Errorf("please provide command input in JSON format by specifying the --json flag")
|
||||
}
|
||||
|
||||
response, err := w.Groups.Create(ctx, createReq)
|
||||
|
|
|
@ -45,25 +45,6 @@ func init() {
|
|||
// TODO: short flags
|
||||
createCmd.Flags().Var(&createJson, "json", `either inline JSON string or @path/to/file.json with request body`)
|
||||
|
||||
createCmd.Flags().BoolVar(&createReq.AllowDuplicateNames, "allow-duplicate-names", createReq.AllowDuplicateNames, `If false, deployment will fail if name conflicts with that of another pipeline.`)
|
||||
createCmd.Flags().StringVar(&createReq.Catalog, "catalog", createReq.Catalog, `A catalog in Unity Catalog to publish data from this pipeline to.`)
|
||||
createCmd.Flags().StringVar(&createReq.Channel, "channel", createReq.Channel, `DLT Release Channel that specifies which version to use.`)
|
||||
// TODO: array: clusters
|
||||
// TODO: map via StringToStringVar: configuration
|
||||
createCmd.Flags().BoolVar(&createReq.Continuous, "continuous", createReq.Continuous, `Whether the pipeline is continuous or triggered.`)
|
||||
createCmd.Flags().BoolVar(&createReq.Development, "development", createReq.Development, `Whether the pipeline is in Development mode.`)
|
||||
createCmd.Flags().BoolVar(&createReq.DryRun, "dry-run", createReq.DryRun, ``)
|
||||
createCmd.Flags().StringVar(&createReq.Edition, "edition", createReq.Edition, `Pipeline product edition.`)
|
||||
// TODO: complex arg: filters
|
||||
createCmd.Flags().StringVar(&createReq.Id, "id", createReq.Id, `Unique identifier for this pipeline.`)
|
||||
// TODO: array: libraries
|
||||
createCmd.Flags().StringVar(&createReq.Name, "name", createReq.Name, `Friendly identifier for this pipeline.`)
|
||||
createCmd.Flags().BoolVar(&createReq.Photon, "photon", createReq.Photon, `Whether Photon is enabled for this pipeline.`)
|
||||
createCmd.Flags().BoolVar(&createReq.Serverless, "serverless", createReq.Serverless, `Whether serverless compute is enabled for this pipeline.`)
|
||||
createCmd.Flags().StringVar(&createReq.Storage, "storage", createReq.Storage, `DBFS root directory for storing checkpoints and tables.`)
|
||||
createCmd.Flags().StringVar(&createReq.Target, "target", createReq.Target, `Target schema (database) to add tables in this pipeline to.`)
|
||||
// TODO: complex arg: trigger
|
||||
|
||||
}
|
||||
|
||||
var createCmd = &cobra.Command{
|
||||
|
@ -92,6 +73,7 @@ var createCmd = &cobra.Command{
|
|||
return err
|
||||
}
|
||||
} else {
|
||||
return fmt.Errorf("please provide command input in JSON format by specifying the --json flag")
|
||||
}
|
||||
|
||||
response, err := w.Pipelines.Create(ctx, createReq)
|
||||
|
|
|
@ -34,13 +34,6 @@ func init() {
|
|||
// TODO: short flags
|
||||
createCmd.Flags().Var(&createJson, "json", `either inline JSON string or @path/to/file.json with request body`)
|
||||
|
||||
createCmd.Flags().StringVar(&createReq.DataSourceId, "data-source-id", createReq.DataSourceId, `The ID of the data source / SQL warehouse where this query will run.`)
|
||||
createCmd.Flags().StringVar(&createReq.Description, "description", createReq.Description, `General description that can convey additional information about this query such as usage notes.`)
|
||||
createCmd.Flags().StringVar(&createReq.Name, "name", createReq.Name, `The name or title of this query to display in list views.`)
|
||||
// TODO: any: options
|
||||
createCmd.Flags().StringVar(&createReq.Parent, "parent", createReq.Parent, `The identifier of the workspace folder containing the query.`)
|
||||
createCmd.Flags().StringVar(&createReq.Query, "query", createReq.Query, `The text of the query.`)
|
||||
|
||||
}
|
||||
|
||||
var createCmd = &cobra.Command{
|
||||
|
@ -76,6 +69,7 @@ var createCmd = &cobra.Command{
|
|||
return err
|
||||
}
|
||||
} else {
|
||||
return fmt.Errorf("please provide command input in JSON format by specifying the --json flag")
|
||||
}
|
||||
|
||||
response, err := w.Queries.Create(ctx, createReq)
|
||||
|
|
|
@ -36,15 +36,6 @@ func init() {
|
|||
// TODO: short flags
|
||||
createCmd.Flags().Var(&createJson, "json", `either inline JSON string or @path/to/file.json with request body`)
|
||||
|
||||
createCmd.Flags().BoolVar(&createReq.Active, "active", createReq.Active, `If this user is active.`)
|
||||
createCmd.Flags().StringVar(&createReq.ApplicationId, "application-id", createReq.ApplicationId, `UUID relating to the service principal.`)
|
||||
createCmd.Flags().StringVar(&createReq.DisplayName, "display-name", createReq.DisplayName, `String that represents a concatenation of given and family names.`)
|
||||
// TODO: array: entitlements
|
||||
createCmd.Flags().StringVar(&createReq.ExternalId, "external-id", createReq.ExternalId, ``)
|
||||
// TODO: array: groups
|
||||
createCmd.Flags().StringVar(&createReq.Id, "id", createReq.Id, `Databricks service principal ID.`)
|
||||
// TODO: array: roles
|
||||
|
||||
}
|
||||
|
||||
var createCmd = &cobra.Command{
|
||||
|
@ -72,6 +63,7 @@ var createCmd = &cobra.Command{
|
|||
return err
|
||||
}
|
||||
} else {
|
||||
return fmt.Errorf("please provide command input in JSON format by specifying the --json flag")
|
||||
}
|
||||
|
||||
response, err := w.ServicePrincipals.Create(ctx, createReq)
|
||||
|
|
|
@ -41,17 +41,6 @@ func init() {
|
|||
// TODO: short flags
|
||||
createCmd.Flags().Var(&createJson, "json", `either inline JSON string or @path/to/file.json with request body`)
|
||||
|
||||
createCmd.Flags().BoolVar(&createReq.Active, "active", createReq.Active, `If this user is active.`)
|
||||
createCmd.Flags().StringVar(&createReq.DisplayName, "display-name", createReq.DisplayName, `String that represents a concatenation of given and family names.`)
|
||||
// TODO: array: emails
|
||||
// TODO: array: entitlements
|
||||
createCmd.Flags().StringVar(&createReq.ExternalId, "external-id", createReq.ExternalId, ``)
|
||||
// TODO: array: groups
|
||||
createCmd.Flags().StringVar(&createReq.Id, "id", createReq.Id, `Databricks user ID.`)
|
||||
// TODO: complex arg: name
|
||||
// TODO: array: roles
|
||||
createCmd.Flags().StringVar(&createReq.UserName, "user-name", createReq.UserName, `Email address of the Databricks user.`)
|
||||
|
||||
}
|
||||
|
||||
var createCmd = &cobra.Command{
|
||||
|
@ -80,6 +69,7 @@ var createCmd = &cobra.Command{
|
|||
return err
|
||||
}
|
||||
} else {
|
||||
return fmt.Errorf("please provide command input in JSON format by specifying the --json flag")
|
||||
}
|
||||
|
||||
response, err := w.Users.Create(ctx, createReq)
|
||||
|
|
Loading…
Reference in New Issue