// Slice with functions to override default command behavior.
// Functions can be added from the `init()` function in manually curated files in this directory.
varcreateOverrides[]func(
*cobra.Command,
*dashboards.CreateDashboardRequest,
)
funcnewCreate()*cobra.Command{
cmd:=&cobra.Command{}
varcreateReqdashboards.CreateDashboardRequest
varcreateJsonflags.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.ParentPath,"parent-path",createReq.ParentPath,`The workspace path of the folder containing the dashboard.`)
cmd.Flags().StringVar(&createReq.SerializedDashboard,"serialized-dashboard",createReq.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.`)
// Slice with functions to override default command behavior.
// Functions can be added from the `init()` function in manually curated files in this directory.
varpublishOverrides[]func(
*cobra.Command,
*dashboards.PublishRequest,
)
funcnewPublish()*cobra.Command{
cmd:=&cobra.Command{}
varpublishReqdashboards.PublishRequest
varpublishJsonflags.JsonFlag
// TODO: short flags
cmd.Flags().Var(&publishJson,"json",`either inline JSON string or @path/to/file.json with request body`)
cmd.Flags().BoolVar(&publishReq.EmbedCredentials,"embed-credentials",publishReq.EmbedCredentials,`Flag to indicate if the publisher's credentials should be embedded in the published dashboard.`)
cmd.Flags().StringVar(&publishReq.WarehouseId,"warehouse-id",publishReq.WarehouseId,`The ID of the warehouse that can be used to override the warehouse which was set in the draft.`)
// 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:=rangetrashOverrides{
fn(cmd,&trashReq)
}
returncmd
}
// 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.
varupdateOverrides[]func(
*cobra.Command,
*dashboards.UpdateDashboardRequest,
)
funcnewUpdate()*cobra.Command{
cmd:=&cobra.Command{}
varupdateReqdashboards.UpdateDashboardRequest
varupdateJsonflags.JsonFlag
// TODO: short flags
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.Etag,"etag",updateReq.Etag,`The etag for the dashboard.`)
cmd.Flags().StringVar(&updateReq.SerializedDashboard,"serialized-dashboard",updateReq.SerializedDashboard,`The contents of the dashboard in serialized string form.`)
cmd.Flags().StringVar(&updateReq.WarehouseId,"warehouse-id",updateReq.WarehouseId,`The warehouse ID used to run the dashboard.`)