55
66 "github.com/spf13/cobra"
77
8- "github.com/soda-data-inc/soda-cli/internal/mock"
98 "github.com/soda-data-inc/soda-cli/internal/output"
109)
1110
@@ -19,32 +18,7 @@ var jobListCmd = &cobra.Command{
1918 Use : "list" ,
2019 Short : "List recent jobs" ,
2120 RunE : func (cmd * cobra.Command , args []string ) error {
22- datasource , _ := cmd .Flags ().GetString ("datasource" )
23- dataset , _ := cmd .Flags ().GetString ("dataset" )
24- jobType , _ := cmd .Flags ().GetString ("type" )
25- status , _ := cmd .Flags ().GetString ("status" )
26-
27- rows := mock .Jobs
28- filtered := []map [string ]string {}
29- for _ , j := range rows {
30- if datasource != "" && j ["datasource" ] != datasource {
31- continue
32- }
33- if dataset != "" && j ["dataset" ] != dataset {
34- continue
35- }
36- if jobType != "" && jobType != "all" && j ["type" ] != jobType {
37- continue
38- }
39- if status != "" && j ["status" ] != status {
40- continue
41- }
42- filtered = append (filtered , j )
43- }
44-
45- cols := []string {"id" , "datasource" , "dataset" , "type" , "status" , "date" }
46- output .Render (filtered , cols , map [string ]bool {"status" : true }, GCtx )
47- return nil
21+ return output .Errorf (2 , "job list is not yet available in the public API" )
4822 },
4923}
5024
@@ -113,11 +87,6 @@ var jobCancelCmd = &cobra.Command{
11387}
11488
11589func init () {
116- jobListCmd .Flags ().String ("datasource" , "" , "Filter by datasource ID" )
117- jobListCmd .Flags ().String ("dataset" , "" , "Filter by dataset ID" )
118- jobListCmd .Flags ().String ("type" , "all" , "Filter by type: contract|monitor|all" )
119- jobListCmd .Flags ().String ("status" , "" , "Filter by status: passing|failing|running|error" )
120-
12190 jobLogsCmd .Flags ().Bool ("follow" , false , "Stream logs as they arrive" )
12291
12392 jobCmd .AddCommand (jobListCmd , jobLogsCmd , jobCancelCmd )
0 commit comments