Updating to the latest version of gorealis and introducing the fect command to get task configurations.
This commit is contained in:
parent
92fa1f140c
commit
d38f2f967a
3 changed files with 53 additions and 28 deletions
10
Gopkg.lock
generated
10
Gopkg.lock
generated
|
@ -20,17 +20,15 @@
|
||||||
"gen-go/apache/aurora",
|
"gen-go/apache/aurora",
|
||||||
"response"
|
"response"
|
||||||
]
|
]
|
||||||
revision = "9631aa3aab9964631946814fa0d8b99a133c982f"
|
revision = "dbb08ded90109302f32ae52821d7a28919406389"
|
||||||
version = "v1.1.0"
|
version = "v1.2.0"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
name = "github.com/pkg/errors"
|
name = "github.com/pkg/errors"
|
||||||
packages = ["."]
|
packages = ["."]
|
||||||
revision = "645ef00459ed84a119197bfb8d8205042c6df63d"
|
revision = "e881fd58d78e04cf6d0de1217f8707c8cc2249bc"
|
||||||
version = "v0.8.0"
|
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
branch = "master"
|
|
||||||
name = "github.com/samuel/go-zookeeper"
|
name = "github.com/samuel/go-zookeeper"
|
||||||
packages = ["zk"]
|
packages = ["zk"]
|
||||||
revision = "471cd4e61d7a78ece1791fa5faa0345dc8c7d5a5"
|
revision = "471cd4e61d7a78ece1791fa5faa0345dc8c7d5a5"
|
||||||
|
@ -49,6 +47,6 @@
|
||||||
[solve-meta]
|
[solve-meta]
|
||||||
analyzer-name = "dep"
|
analyzer-name = "dep"
|
||||||
analyzer-version = 1
|
analyzer-version = 1
|
||||||
inputs-digest = "e80e920e8ce403740797f4b5428c7e3380244d0b4cba4faa9e22cf1bee6beeea"
|
inputs-digest = "2c5d0cedd3956478027941d8fd3f3a18b72a8ffd26f3fa3567a7dc7eaae16d50"
|
||||||
solver-name = "gps-cdcl"
|
solver-name = "gps-cdcl"
|
||||||
solver-version = 1
|
solver-version = 1
|
||||||
|
|
23
Gopkg.toml
23
Gopkg.toml
|
@ -1,29 +1,8 @@
|
||||||
# Gopkg.toml example
|
|
||||||
#
|
|
||||||
# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md
|
|
||||||
# for detailed Gopkg.toml documentation.
|
|
||||||
#
|
|
||||||
# required = ["github.com/user/thing/cmd/thing"]
|
|
||||||
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
|
|
||||||
#
|
|
||||||
# [[constraint]]
|
|
||||||
# name = "github.com/user/project"
|
|
||||||
# version = "1.0.0"
|
|
||||||
#
|
|
||||||
# [[constraint]]
|
|
||||||
# name = "github.com/user/project2"
|
|
||||||
# branch = "dev"
|
|
||||||
# source = "github.com/myfork/project2"
|
|
||||||
#
|
|
||||||
# [[override]]
|
|
||||||
# name = "github.com/x/y"
|
|
||||||
# version = "2.4.0"
|
|
||||||
|
|
||||||
required = ["git.apache.org/thrift.git/lib/go/thrift"]
|
required = ["git.apache.org/thrift.git/lib/go/thrift"]
|
||||||
|
|
||||||
[[constraint]]
|
[[constraint]]
|
||||||
name = "github.com/paypal/gorealis"
|
name = "github.com/paypal/gorealis"
|
||||||
version = "1.1.0"
|
version = "1.2.0"
|
||||||
|
|
||||||
[[constraint]]
|
[[constraint]]
|
||||||
name = "github.com/spf13/cobra"
|
name = "github.com/spf13/cobra"
|
||||||
|
|
48
cmd/fetch.go
Normal file
48
cmd/fetch.go
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
package cmd
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
|
||||||
|
"github.com/paypal/gorealis/gen-go/apache/aurora"
|
||||||
|
"github.com/spf13/cobra"
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
rootCmd.AddCommand(fetchCmd)
|
||||||
|
|
||||||
|
// Sub-commands
|
||||||
|
fetchCmd.AddCommand(taskConfigCmd)
|
||||||
|
taskConfigCmd.Flags().StringVarP(&env, "environment", "e", "", "Aurora Environment")
|
||||||
|
taskConfigCmd.Flags().StringVarP(&role, "role", "r", "", "Aurora Role")
|
||||||
|
taskConfigCmd.Flags().StringVarP(&name, "name", "n", "", "Aurora Name")
|
||||||
|
}
|
||||||
|
|
||||||
|
var fetchCmd = &cobra.Command{
|
||||||
|
Use: "fetch",
|
||||||
|
Short: "Fetch information from Aurora",
|
||||||
|
}
|
||||||
|
|
||||||
|
var taskConfigCmd = &cobra.Command{
|
||||||
|
Use: "config" ,
|
||||||
|
Short: "Fetch a list of task configurations from Aurora.",
|
||||||
|
Long: `To be written.`,
|
||||||
|
Run: fetchTasks,
|
||||||
|
}
|
||||||
|
|
||||||
|
func fetchTasks(cmd *cobra.Command, args []string) {
|
||||||
|
fmt.Printf("Fetching job configuration for [%s/%s/%s] \n", env, role, name)
|
||||||
|
|
||||||
|
//TODO: Add filtering down by status
|
||||||
|
taskQuery := &aurora.TaskQuery{Environment: env, Role: role, JobName: name}
|
||||||
|
|
||||||
|
tasks, err := client.GetTasksWithoutConfigs(taskQuery)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Printf("error: %+v\n", err.Error())
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, t := range tasks {
|
||||||
|
fmt.Println(t)
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue