diff --git a/.gitignore b/.gitignore index 528a0a3d0..178015abb 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ certs/ cmd/tink-cli/tink-cli cmd/tink-server/tink-server cmd/tink-worker/tink-worker +.idea # Terraform .terraform diff --git a/Makefile b/Makefile index bfb5b0052..0a1b79aa4 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ cli: ${cli} worker : ${worker} ${server} ${cli} ${worker}: - CGO_ENABLED=0 go build -o $@ ./$@ + CGO_ENABLED=0 GOOS=$$GOOS go build -o $@ ./$@ run: ${binaries} docker-compose up -d --build db diff --git a/cmd/tink-cli/cmd/hardware/all.go b/cmd/tink-cli/cmd/hardware/all.go index 84c25e3e8..1e8a1eef1 100644 --- a/cmd/tink-cli/cmd/hardware/all.go +++ b/cmd/tink-cli/cmd/hardware/all.go @@ -2,6 +2,7 @@ package hardware import ( "context" + "encoding/json" "fmt" "io" "log" @@ -24,10 +25,14 @@ var allCmd = &cobra.Command{ var hw *hardware.Hardware err = nil for hw, err = alls.Recv(); err == nil && hw != nil; hw, err = alls.Recv() { - fmt.Println(hw.JSON) + b, err := json.Marshal(hw) + if err != nil { + log.Println(err) + } + fmt.Println(string(b)) } if err != nil && err != io.EOF { - log.Fatal(err) + log.Println(err) } }, } diff --git a/cmd/tink-cli/cmd/hardware/id.go b/cmd/tink-cli/cmd/hardware/id.go index 2bb0cff5f..f2400bf8d 100644 --- a/cmd/tink-cli/cmd/hardware/id.go +++ b/cmd/tink-cli/cmd/hardware/id.go @@ -4,6 +4,7 @@ package hardware import ( "context" + "encoding/json" "fmt" "log" @@ -22,11 +23,15 @@ var idCmd = &cobra.Command{ }, Run: func(cmd *cobra.Command, args []string) { for _, id := range args { - hw, err := client.HardwareClient.ByID(context.Background(), &hardware.GetRequest{ID: id}) + hw, err := client.HardwareClient.ByID(context.Background(), &hardware.GetRequest{Id: id}) if err != nil { log.Fatal(err) } - fmt.Println(hw.JSON) + b, err := json.Marshal(hw) + if err != nil { + log.Fatal(err) + } + fmt.Println(string(b)) } }, } diff --git a/cmd/tink-cli/cmd/hardware/ingest.go b/cmd/tink-cli/cmd/hardware/ingest.go deleted file mode 100644 index 98965dd1d..000000000 --- a/cmd/tink-cli/cmd/hardware/ingest.go +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright © 2018 packet.net - -package hardware - -import ( - "context" - "fmt" - "log" - - "github.com/spf13/cobra" - "github.com/tinkerbell/tink/client" - "github.com/tinkerbell/tink/protos/hardware" -) - -// ingestCmd represents the ingest command -var ingestCmd = &cobra.Command{ - Use: "ingest", - Short: "Trigger tinkerbell to ingest", - Long: "This command only signals tinkerbell to ingest if it has not already done so.", - Run: func(cmd *cobra.Command, args []string) { - fmt.Println("ingest called") - _, err := client.HardwareClient.Ingest(context.Background(), &hardware.Empty{}) - if err != nil { - log.Fatal(err) - } - }, -} - -func init() { - SubCommands = append(SubCommands, ingestCmd) - -} diff --git a/cmd/tink-cli/cmd/hardware/ip.go b/cmd/tink-cli/cmd/hardware/ip.go index fc6727a4a..a63afbd4f 100644 --- a/cmd/tink-cli/cmd/hardware/ip.go +++ b/cmd/tink-cli/cmd/hardware/ip.go @@ -4,6 +4,7 @@ package hardware import ( "context" + "encoding/json" "fmt" "log" "net" @@ -28,11 +29,15 @@ var ipCmd = &cobra.Command{ }, Run: func(cmd *cobra.Command, args []string) { for _, ip := range args { - hw, err := client.HardwareClient.ByIP(context.Background(), &hardware.GetRequest{IP: ip}) + hw, err := client.HardwareClient.ByIP(context.Background(), &hardware.GetRequest{Ip: ip}) if err != nil { log.Fatal(err) } - fmt.Println(hw.JSON) + b, err := json.Marshal(hw) + if err != nil { + log.Fatal(err) + } + fmt.Println(string(b)) } }, } diff --git a/cmd/tink-cli/cmd/hardware/mac.go b/cmd/tink-cli/cmd/hardware/mac.go index 794798b0c..43c6ee317 100644 --- a/cmd/tink-cli/cmd/hardware/mac.go +++ b/cmd/tink-cli/cmd/hardware/mac.go @@ -4,6 +4,7 @@ package hardware import ( "context" + "encoding/json" "fmt" "log" "net" @@ -28,11 +29,15 @@ var macCmd = &cobra.Command{ }, Run: func(cmd *cobra.Command, args []string) { for _, mac := range args { - hw, err := client.HardwareClient.ByMAC(context.Background(), &hardware.GetRequest{MAC: mac}) + hw, err := client.HardwareClient.ByMAC(context.Background(), &hardware.GetRequest{Mac: mac}) if err != nil { log.Fatal(err) } - fmt.Println(hw.JSON) + b, err := json.Marshal(hw) + if err != nil { + log.Fatal(err) + } + fmt.Println(string(b)) } }, } diff --git a/cmd/tink-cli/cmd/hardware/push.go b/cmd/tink-cli/cmd/hardware/push.go index dc26d2864..4d70bfd75 100644 --- a/cmd/tink-cli/cmd/hardware/push.go +++ b/cmd/tink-cli/cmd/hardware/push.go @@ -51,7 +51,13 @@ tink hardware push --file /tmp/data.json`, } else if s.ID == "" { log.Fatalf("invalid json, ID is required: %s", data) } - if _, err := client.HardwareClient.Push(context.Background(), &hardware.PushRequest{Data: data}); err != nil { + + hw := hardware.Hardware{} + err := json.Unmarshal([]byte(data), &hw) + if err != nil { + log.Fatal(err) + } + if _, err := client.HardwareClient.Push(context.Background(), &hardware.PushRequest{Data: &hw}); err != nil { log.Fatal(err) } log.Println("Hardware data pushed successfully") diff --git a/cmd/tink-cli/cmd/hardware/watch.go b/cmd/tink-cli/cmd/hardware/watch.go index ebef8dfbd..6f9bb73bc 100644 --- a/cmd/tink-cli/cmd/hardware/watch.go +++ b/cmd/tink-cli/cmd/hardware/watch.go @@ -4,6 +4,7 @@ package hardware import ( "context" + "encoding/json" "fmt" "io" "log" @@ -26,7 +27,7 @@ var watchCmd = &cobra.Command{ stdoutLock := sync.Mutex{} for _, id := range args { go func(id string) { - stream, err := client.HardwareClient.Watch(context.Background(), &hardware.GetRequest{ID: id}) + stream, err := client.HardwareClient.Watch(context.Background(), &hardware.GetRequest{Id: id}) if err != nil { log.Fatal(err) } @@ -35,7 +36,11 @@ var watchCmd = &cobra.Command{ err = nil for hw, err = stream.Recv(); err == nil && hw != nil; hw, err = stream.Recv() { stdoutLock.Lock() - fmt.Println(hw.JSON) + b, err := json.Marshal(hw) + if err != nil { + log.Fatal(err) + } + fmt.Println(string(b)) stdoutLock.Unlock() } if err != nil && err != io.EOF { diff --git a/cmd/tink-cli/cmd/template/create.go b/cmd/tink-cli/cmd/template/create.go index 79657563f..6659b30cb 100644 --- a/cmd/tink-cli/cmd/template/create.go +++ b/cmd/tink-cli/cmd/template/create.go @@ -50,7 +50,7 @@ cat /tmp/example.tmpl | tink template create -n example`, data := readAll(reader) if data != nil { - if err := tryParseTemplate(data); err != nil { + if err := tryParseTemplate(string(data)); err != nil { log.Println(err) return } @@ -74,16 +74,16 @@ func addFlags() { createCmd.MarkPersistentFlagRequired(fName) } -func tryParseTemplate(data []byte) error { +func tryParseTemplate(data string) error { tmpl := *tt.New("") - if _, err := tmpl.Parse(string(data)); err != nil { + if _, err := tmpl.Parse(data); err != nil { return err } return nil } func createTemplate(data []byte) { - req := template.WorkflowTemplate{Name: templateName, Data: data} + req := template.WorkflowTemplate{Name: templateName, Data: string(data)} res, err := client.TemplateClient.CreateTemplate(context.Background(), &req) if err != nil { log.Println(err) diff --git a/cmd/tink-cli/cmd/template/update.go b/cmd/tink-cli/cmd/template/update.go index 805d03334..32689de41 100644 --- a/cmd/tink-cli/cmd/template/update.go +++ b/cmd/tink-cli/cmd/template/update.go @@ -50,7 +50,7 @@ func updateTemplate(id string) { req.Name = templateName } else if filePath != "" && templateName == "" { data := readTemplateData() - if data != nil { + if data != "" { if err := tryParseTemplate(data); err != nil { log.Println(err) return @@ -69,7 +69,7 @@ func updateTemplate(id string) { fmt.Println("Updated Template: ", id) } -func readTemplateData() []byte { +func readTemplateData() string { f, err := os.Open(filePath) if err != nil { log.Println(err) @@ -80,7 +80,7 @@ func readTemplateData() []byte { if err != nil { log.Println(err) } - return data + return string(data) } func init() { diff --git a/db/hardware.go b/db/hardware.go index 05ee294cb..779b6d383 100644 --- a/db/hardware.go +++ b/db/hardware.go @@ -66,13 +66,15 @@ func InsertIntoDB(ctx context.Context, db *sql.DB, data string) error { func GetByMAC(ctx context.Context, db *sql.DB, mac string) (string, error) { arg := ` { - "network_ports": [ - { - "data": { - "mac": "` + mac + `" - } - } - ] + "network": { + "interfaces": [ + { + "dhcp": { + "mac": "` + mac + `" + } + } + ] + } } ` query := ` @@ -94,7 +96,7 @@ func GetByIP(ctx context.Context, db *sql.DB, ip string) (string, error) { "instance": { "ip_addresses": [ { - "address": "` + ip + `" + "address": "` + ip + `" } ] } @@ -102,11 +104,17 @@ func GetByIP(ctx context.Context, db *sql.DB, ip string) (string, error) { ` hardwareOrManagement := ` { - "ip_addresses": [ - { - "address": "` + ip + `" - } - ] + "network": { + "interfaces": [ + { + "dhcp": { + "ip": { + "address": "` + ip + `" + } + } + } + ] + } } ` @@ -141,7 +149,7 @@ func GetByID(ctx context.Context, db *sql.DB, id string) (string, error) { } // GetAll : get data for all machine -func GetAll(db *sql.DB, fn func(string) error) error { +func GetAll(db *sql.DB, fn func([]byte) error) error { rows, err := db.Query(` SELECT data FROM hardware @@ -163,7 +171,7 @@ func GetAll(db *sql.DB, fn func(string) error) error { return err } - err = fn(string(buf)) + err = fn(buf) if err != nil { return err } diff --git a/db/template.go b/db/template.go index f288629ef..3c0ead76d 100644 --- a/db/template.go +++ b/db/template.go @@ -12,7 +12,7 @@ import ( ) // CreateTemplate creates a new workflow template -func CreateTemplate(ctx context.Context, db *sql.DB, name string, data []byte, id uuid.UUID) error { +func CreateTemplate(ctx context.Context, db *sql.DB, name string, data string, id uuid.UUID) error { tx, err := db.BeginTx(ctx, &sql.TxOptions{Isolation: sql.LevelSerializable}) if err != nil { return errors.Wrap(err, "BEGIN transaction") @@ -40,9 +40,9 @@ func CreateTemplate(ctx context.Context, db *sql.DB, name string, data []byte, i } // GetTemplate returns a workflow template -func GetTemplate(ctx context.Context, db *sql.DB, id string) ([]byte, error) { +func GetTemplate(ctx context.Context, db *sql.DB, id string) (string, string, error) { query := ` - SELECT data + SELECT name, data FROM template WHERE id = $1 @@ -50,10 +50,11 @@ func GetTemplate(ctx context.Context, db *sql.DB, id string) ([]byte, error) { deleted_at IS NULL ` row := db.QueryRowContext(ctx, query, id) - buf := []byte{} - err := row.Scan(&buf) + name := []byte{} + data := []byte{} + err := row.Scan(&name, &data) if err == nil { - return buf, nil + return string(name), string(data), nil } if err != sql.ErrNoRows { @@ -63,7 +64,7 @@ func GetTemplate(ctx context.Context, db *sql.DB, id string) ([]byte, error) { err = nil } - return []byte{}, nil + return "", "", nil } // DeleteTemplate deletes a workflow template @@ -136,20 +137,20 @@ func ListTemplates(db *sql.DB, fn func(id, n string, in, del *timestamp.Timestam } // UpdateTemplate update a given template -func UpdateTemplate(ctx context.Context, db *sql.DB, name string, data []byte, id uuid.UUID) error { +func UpdateTemplate(ctx context.Context, db *sql.DB, name string, data string, id uuid.UUID) error { tx, err := db.BeginTx(ctx, &sql.TxOptions{Isolation: sql.LevelSerializable}) if err != nil { return errors.Wrap(err, "BEGIN transaction") } - if data == nil && name != "" { + if data == "" && name != "" { _, err = tx.Exec(` UPDATE template SET updated_at = NOW(), name = $2 WHERE id = $1;`, id, name) - } else if data != nil && name == "" { + } else if data != "" && name == "" { _, err = tx.Exec(` UPDATE template SET diff --git a/db/workflow.go b/db/workflow.go index 2a81c84c2..7b1fadfe1 100644 --- a/db/workflow.go +++ b/db/workflow.go @@ -724,13 +724,15 @@ func parseYaml(ymlContent []byte) (*wfYamlstruct, error) { func getWorkerIDbyMac(ctx context.Context, db *sql.DB, mac string) (string, error) { arg := ` { - "network_ports": [ - { - "data": { - "mac": "` + mac + `" - } - } - ] + "network": { + "interfaces": [ + { + "dhcp": { + "mac": "` + mac + `" + } + } + ] + } } ` query := ` @@ -746,6 +748,7 @@ func getWorkerIDbyMac(ctx context.Context, db *sql.DB, mac string) (string, erro } func getWorkerIDbyIP(ctx context.Context, db *sql.DB, ip string) (string, error) { + // update for instance (under metadata) instance := ` { "instance": { @@ -758,14 +761,20 @@ func getWorkerIDbyIP(ctx context.Context, db *sql.DB, ip string) (string, error) } ` hardwareOrManagement := ` - { - "ip_addresses": [ - { - "address": "` + ip + `" - } - ] - } - ` + { + "network": { + "interfaces": [ + { + "dhcp": { + "ip": { + "address": "` + ip + `" + } + } + } + ] + } + } + ` query := ` SELECT id diff --git a/deploy/docker-compose.yml b/deploy/docker-compose.yml index caf2b005d..eaec855ef 100644 --- a/deploy/docker-compose.yml +++ b/deploy/docker-compose.yml @@ -15,16 +15,20 @@ services: PGPORT: 5432 PGSSLMODE: disable PGUSER: tinkerbell + TINKERBELL_GRPC_AUTHORITY: :42113 + TINKERBELL_HTTP_AUTHORITY: :42114 + TINK_AUTH_USERNAME: ${TINKERBELL_TINK_USERNAME} + TINK_AUTH_PASSWORD: ${TINKERBELL_TINK_PASSWORD} depends_on: db: condition: service_healthy healthcheck: - test: ["CMD-SHELL", "wget -qO- 127.0.0.1:42114/cert"] + test: ["CMD-SHELL", "wget -qO- 127.0.0.1:42114/cert"] # port needs to match TINKERBELL_HTTP_AUTHORITY interval: 5s timeout: 2s retries: 30 volumes: - - ./state/certs:/certs/${FACILITY} + - ./state/certs:/certs/${FACILITY:-onprem} ports: - 42113:42113/tcp - 42114:42114/tcp @@ -97,8 +101,6 @@ services: ROLLBAR_TOKEN: ${ROLLBAR_TOKEN:-ignored} ROLLBAR_DISABLE: ${ROLLBAR_DISABLE:-1} MIRROR_HOST: ${TINKERBELL_NGINX_IP:-127.0.0.1} - CACHER_GRPC_AUTHORITY: 127.0.0.1:42111 - CACHER_CERT_URL: http://127.0.0.1:42112/cert DNS_SERVERS: 8.8.8.8 PUBLIC_IP: $TINKERBELL_HOST_IP BOOTP_BIND: $TINKERBELL_HOST_IP:67 @@ -111,9 +113,10 @@ services: TINKERBELL_GRPC_AUTHORITY: $TINKERBELL_HOST_IP:42113 TINKERBELL_CERT_URL: http://$TINKERBELL_HOST_IP:42114/cert ELASTIC_SEARCH_URL: $TINKERBELL_HOST_IP:9200 + DATA_MODEL_VERSION: 1 depends_on: - cacher: - condition: service_started + db: + condition: service_healthy ports: - $TINKERBELL_HOST_IP:80:80/tcp - 67:67/udp @@ -128,32 +131,6 @@ services: volumes: - ./state/webroot:/usr/share/nginx/html/ - cacher: - image: quay.io/packet/cacher:workflow - restart: unless-stopped - environment: - FACILITY: ${FACILITY:-onprem} - PACKET_API_AUTH_TOKEN: ${PACKET_API_AUTH_TOKEN} - PACKET_API_URL: ${PACKET_API_URL} - PACKET_CONSUMER_TOKEN: ${PACKET_CONSUMER_TOKEN-ignored} - PACKET_ENV: testing - PACKET_VERSION: ${PACKET_VERSION:-ignored} - PGDATABASE: tinkerbell - PGHOST: db - PGPASSWORD: tinkerbell - PGPORT: 5432 - PGSSLMODE: disable - PGUSER: tinkerbell - ROLLBAR_TOKEN: ${ROLLBAR_TOKEN-ignored} - volumes: - - ./state/certs:/certs/${FACILITY} - depends_on: - db: - condition: service_healthy - ports: - - 42111:42111/tcp - - 42112:42112/tcp - hegel: image: quay.io/tinkerbell/hegel:latest restart: unless-stopped @@ -166,8 +143,9 @@ services: GRPC_PORT: 42115 HEGEL_FACILITY: ${FACILITY:-onprem} HEGEL_USE_TLS: 0 - CACHER_CERT_URL: http://127.0.0.1:42112/cert - CACHER_GRPC_AUTHORITY: 127.0.0.1:42111 + TINKERBELL_GRPC_AUTHORITY: 127.0.0.1:42113 + TINKERBELL_CERT_URL: http://127.0.0.1:42114/cert + DATA_MODEL_VERSION: 1 depends_on: - cacher: - condition: service_started + db: + condition: service_healthy diff --git a/go.mod b/go.mod index 9a2e26d1e..7bc4b2776 100644 --- a/go.mod +++ b/go.mod @@ -18,6 +18,7 @@ require ( github.com/gorilla/mux v1.6.2 // indirect github.com/grpc-ecosystem/go-grpc-middleware v1.0.0 // indirect github.com/grpc-ecosystem/go-grpc-prometheus v0.0.0-20160910222444-6b7015e65d36 + github.com/grpc-ecosystem/grpc-gateway v1.14.6 github.com/hashicorp/hcl v0.0.0-20180404174102-ef8a98b0bbce // indirect github.com/inconshreveable/mousetrap v1.0.0 // indirect github.com/jedib0t/go-pretty v4.3.0+incompatible @@ -45,13 +46,13 @@ require ( go.uber.org/atomic v1.2.0 // indirect go.uber.org/multierr v1.1.0 // indirect go.uber.org/zap v1.7.1 // indirect - golang.org/x/net v0.0.0-20200528225125-3c3fba18258b // indirect - golang.org/x/sys v0.0.0-20200523222454-059865788121 // indirect + golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e // indirect + golang.org/x/sys v0.0.0-20200331124033-c3d80250170d // indirect golang.org/x/text v0.3.2 // indirect golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect - google.golang.org/genproto v0.0.0-20200601130524-0f60399e6634 // indirect + google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884 google.golang.org/grpc v1.29.1 gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect - gopkg.in/yaml.v2 v2.2.2 + gopkg.in/yaml.v2 v2.2.3 gotest.tools v2.2.0+incompatible // indirect ) diff --git a/go.sum b/go.sum index 59782ecb6..9c35bc82d 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,5 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 h1:w+iIsaOQNcT7OZ575w+acHgRric5iCyQh+xv+KJ4HB8= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= @@ -9,6 +10,7 @@ github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc h1:cAKDfWh5Vpd github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf h1:qet1QNfXsQxTZqLG4oE62mJzwPIB8+Tee4RNCL9ulrY= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973 h1:xJ4a3vCFaGF/jqvzLMYoU8P317H5OQ+Via4RmuPwCS0= @@ -35,6 +37,8 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-openapi/errors v0.19.2 h1:a2kIyV3w+OS3S97zxUndRVD46+FhGOUBDFY7nmu4CsY= @@ -58,7 +62,6 @@ github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:x github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= @@ -77,6 +80,8 @@ github.com/grpc-ecosystem/go-grpc-middleware v1.0.0 h1:Iju5GlWwrvL6UBg4zJJt3btmo github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-prometheus v0.0.0-20160910222444-6b7015e65d36 h1:cwTrrTEhz13khQS3/UZMLFWwiqlcsdp/2sxFmSjAWeQ= github.com/grpc-ecosystem/go-grpc-prometheus v0.0.0-20160910222444-6b7015e65d36/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= +github.com/grpc-ecosystem/grpc-gateway v1.14.6 h1:8ERzHx8aj1Sc47mu9n/AksaKCSWrMchFtkdrS4BIj5o= +github.com/grpc-ecosystem/grpc-gateway v1.14.6/go.mod h1:zdiPV4Yse/1gnckTHtghG4GkDEdKCRJduHpTxT3/jcw= github.com/hashicorp/hcl v0.0.0-20180404174102-ef8a98b0bbce h1:xdsDDbiBDQTKASoGEZ+pEmF1OnWuu8AQ9I8iNbHNeno= github.com/hashicorp/hcl v0.0.0-20180404174102-ef8a98b0bbce/go.mod h1:oZtUIOe8dh44I2q6ScRibXws4Ajl+d+nod3AaR9vL5w= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= @@ -132,6 +137,7 @@ github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y8 github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1 h1:/K3IL0Z1quvmJ7X0A1AwNEK7CRkVK3YwfOU/QAL4WGg= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rollbar/rollbar-go v1.0.2 h1:uA3+z0jq6ka9WUUt9VX/xuiQZXZyWRoeKvkhVvLO9Jc= github.com/rollbar/rollbar-go v1.0.2/go.mod h1:AcFs5f0I+c71bpHlXNNDbOWJiKwjFDtISeXco0L5PKQ= github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww= @@ -180,12 +186,15 @@ golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20200528225125-3c3fba18258b h1:IYiJPiJfzktmDAO1HQiwjMjwjlYKHAL7KzeD544RJPs= -golang.org/x/net v0.0.0-20200528225125-3c3fba18258b/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20191002035440-2ec189313ef0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e h1:3G+cUijn7XD+S4eJFddp53Pv7+slrESplyjG25HgL+k= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -197,8 +206,8 @@ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b h1:ag/x1USPSsqHud38I9BAC88qdNLDHHtQ4mlgQIZPPNA= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200523222454-059865788121 h1:rITEj+UZHYC927n8GT97eC3zrpzXdb/voyeOuVKS46o= -golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200331124033-c3d80250170d h1:nc5K6ox/4lTFbMVSL9WRR81ixkcwXThoiF6yf+R9scA= +golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= @@ -218,9 +227,8 @@ google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 h1:gSJIx1SDwno+2ElGhA4+qG2zF97qiUzTM+rQ0klBOcE= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200601130524-0f60399e6634 h1:yUEnIJPm1I2GGauN1xOkwj6gXw/3t1R+HA1r/cdnkHE= -google.golang.org/genproto v0.0.0-20200601130524-0f60399e6634/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884 h1:fiNLklpBwWK1mth30Hlwk+fcdBmIALlgF5iy77O37Ig= +google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= @@ -232,11 +240,8 @@ google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.24.0 h1:UhZDfRO8JRQru4/+LlLE0BRKGF8L+PICnvYZmx/fEGA= -google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= gopkg.in/alecthomas/kingpin.v2 v2.2.6 h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -244,8 +249,8 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33 gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.1 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.3 h1:fvjTMHxHEw/mxHbtzPi3JCcKXQRAnQTBRo6YCJSVHKI= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/grpc-server/grpc-server.go b/grpc-server/grpc-server.go index fcbdeecd2..d8ef3a677 100644 --- a/grpc-server/grpc-server.go +++ b/grpc-server/grpc-server.go @@ -25,7 +25,7 @@ import ( var ( logger log.Logger - grpcListenAddr = ":42113" + grpcListenAddr = os.Getenv("TINKERBELL_GRPC_AUTHORITY") ) // Server is the gRPC server for tinkerbell @@ -76,6 +76,9 @@ func SetupGRPC(ctx context.Context, log log.Logger, facility string, errCh chan< go func() { logger.Info("serving grpc") + if grpcListenAddr == "" { + grpcListenAddr = ":42113" + } lis, err := net.Listen("tcp", grpcListenAddr) if err != nil { err = errors.Wrap(err, "failed to listen") diff --git a/grpc-server/hardware.go b/grpc-server/hardware.go index f461f0ee2..105fd7dbe 100644 --- a/grpc-server/hardware.go +++ b/grpc-server/hardware.go @@ -23,39 +23,33 @@ func (s *server) Push(ctx context.Context, in *hardware.PushRequest) (*hardware. // must be a copy so deferred cacheInFlight.Dec matches the Inc labels = prometheus.Labels{"method": "Push", "op": ""} - var h struct { - ID string - State string - } - err := json.Unmarshal([]byte(in.Data), &h) - if err != nil { + hw := in.Data + if hw.Id == "" { metrics.CacheTotals.With(labels).Inc() metrics.CacheErrors.With(labels).Inc() - err = errors.Wrap(err, "unmarshal json") + err := errors.New("id must be set to a UUID, got id: " + hw.Id) logger.Error(err) return &hardware.Empty{}, err } - if h.ID == "" { - metrics.CacheTotals.With(labels).Inc() - metrics.CacheErrors.With(labels).Inc() - err = errors.New("id must be set to a UUID") - logger.Error(err) - return &hardware.Empty{}, err - } + // TODO: somewhere here validate json (if ip addr contains cidr, etc.) - logger.With("id", h.ID).Info("data pushed") + logger.With("id", hw.Id).Info("data pushed") var fn func() error msg := "" - if h.State != "deleted" { + data, err := json.Marshal(hw) + if err != nil { + logger.Error(err) + } + if hw.Metadata.State != "deleted" { labels["op"] = "insert" msg = "inserting into DB" - fn = func() error { return db.InsertIntoDB(ctx, s.db, in.Data) } + fn = func() error { return db.InsertIntoDB(ctx, s.db, string(data)) } } else { msg = "deleting from DB" labels["op"] = "delete" - fn = func() error { return db.DeleteFromDB(ctx, s.db, h.ID) } + fn = func() error { return db.DeleteFromDB(ctx, s.db, hw.Id) } } metrics.CacheTotals.With(labels).Inc() @@ -75,30 +69,19 @@ func (s *server) Push(ctx context.Context, in *hardware.PushRequest) (*hardware. } s.watchLock.RLock() - if ch := s.watch[h.ID]; ch != nil { + if ch := s.watch[hw.Id]; ch != nil { select { - case ch <- in.Data: + case ch <- string(data): default: metrics.WatchMissTotal.Inc() - logger.With("id", h.ID).Info("skipping blocked watcher") } } s.watchLock.RUnlock() + logger.With("id", hw.Id).Info("skipping blocked watcher") return &hardware.Empty{}, err } -func (s *server) Ingest(ctx context.Context, in *hardware.Empty) (*hardware.Empty, error) { - logger.Info("ingest") - labels := prometheus.Labels{"method": "Ingest", "op": ""} - metrics.CacheInFlight.With(labels).Inc() - defer metrics.CacheInFlight.With(labels).Dec() - - logger.Info("Ingest called but is deprecated") - - return &hardware.Empty{}, nil -} - func (s *server) by(method string, fn func() (string, error)) (*hardware.Hardware, error) { labels := prometheus.Labels{"method": method, "op": "get"} @@ -125,25 +108,27 @@ func (s *server) by(method string, fn func() (string, error)) (*hardware.Hardwar } metrics.CacheHits.With(labels).Inc() - return &hardware.Hardware{JSON: j}, nil + hw := &hardware.Hardware{} + json.Unmarshal([]byte(j), hw) + return hw, nil } func (s *server) ByMAC(ctx context.Context, in *hardware.GetRequest) (*hardware.Hardware, error) { return s.by("ByMAC", func() (string, error) { - return db.GetByMAC(ctx, s.db, in.MAC) + return db.GetByMAC(ctx, s.db, in.Mac) }) } func (s *server) ByIP(ctx context.Context, in *hardware.GetRequest) (*hardware.Hardware, error) { return s.by("ByIP", func() (string, error) { - return db.GetByIP(ctx, s.db, in.IP) + return db.GetByIP(ctx, s.db, in.Ip) }) } // ByID implements hardware.ByID func (s *server) ByID(ctx context.Context, in *hardware.GetRequest) (*hardware.Hardware, error) { return s.by("ByID", func() (string, error) { - return db.GetByID(ctx, s.db, in.ID) + return db.GetByID(ctx, s.db, in.Id) }) } @@ -165,8 +150,10 @@ func (s *server) All(_ *hardware.Empty, stream hardware.HardwareService_AllServe timer := prometheus.NewTimer(metrics.CacheDuration.With(labels)) defer timer.ObserveDuration() - err := db.GetAll(s.db, func(j string) error { - return stream.Send(&hardware.Hardware{JSON: j}) + err := db.GetAll(s.db, func(j []byte) error { + hw := &hardware.Hardware{} + json.Unmarshal(j, hw) + return stream.Send(hw) }) if err != nil { metrics.CacheErrors.With(labels).Inc() @@ -178,16 +165,16 @@ func (s *server) All(_ *hardware.Empty, stream hardware.HardwareService_AllServe } func (s *server) Watch(in *hardware.GetRequest, stream hardware.HardwareService_WatchServer) error { - l := logger.With("id", in.ID) + l := logger.With("id", in.Id) ch := make(chan string, 1) s.watchLock.Lock() - old, ok := s.watch[in.ID] + old, ok := s.watch[in.Id] if ok { l.Info("evicting old watch") close(old) } - s.watch[in.ID] = ch + s.watch[in.Id] = ch s.watchLock.Unlock() labels := prometheus.Labels{"method": "Watch", "op": "push"} @@ -200,7 +187,7 @@ func (s *server) Watch(in *hardware.GetRequest, stream hardware.HardwareService_ return } s.watchLock.Lock() - delete(s.watch, in.ID) + delete(s.watch, in.Id) s.watchLock.Unlock() close(ch) }() @@ -223,7 +210,7 @@ func (s *server) Watch(in *hardware.GetRequest, stream hardware.HardwareService_ } hw.Reset() - hw.JSON = j + json.Unmarshal([]byte(j), hw) err := stream.Send(hw) if err != nil { metrics.CacheErrors.With(labels).Inc() diff --git a/grpc-server/template.go b/grpc-server/template.go index 6b166fab3..0d2cce57e 100644 --- a/grpc-server/template.go +++ b/grpc-server/template.go @@ -55,13 +55,13 @@ func (s *server) GetTemplate(ctx context.Context, in *template.GetRequest) (*tem labels["op"] = "get" msg = "getting a template" - fn := func() ([]byte, error) { return db.GetTemplate(ctx, s.db, in.Id) } + fn := func() (string, string, error) { return db.GetTemplate(ctx, s.db, in.Id) } metrics.CacheTotals.With(labels).Inc() timer := prometheus.NewTimer(metrics.CacheDuration.With(labels)) defer timer.ObserveDuration() logger.Info(msg) - d, err := fn() + n, d, err := fn() logger.Info("done " + msg) if err != nil { metrics.CacheErrors.With(labels).Inc() @@ -71,7 +71,7 @@ func (s *server) GetTemplate(ctx context.Context, in *template.GetRequest) (*tem } l.Error(err) } - return &template.WorkflowTemplate{Id: in.Id, Data: d}, err + return &template.WorkflowTemplate{Id: in.Id, Name: n, Data: d}, err } // DeleteTemplate implements template.DeleteTemplate diff --git a/grpc-server/workflow.go b/grpc-server/workflow.go index 27ca68192..211e16f09 100644 --- a/grpc-server/workflow.go +++ b/grpc-server/workflow.go @@ -264,7 +264,7 @@ func (s *server) ShowWorkflowEvents(req *workflow.GetRequest, stream workflow.Wo } func createYaml(ctx context.Context, sqlDB *sql.DB, temp string, devices string) (string, error) { - tempData, err := db.GetTemplate(ctx, sqlDB, temp) + _, tempData, err := db.GetTemplate(ctx, sqlDB, temp) if err != nil { return "", err } diff --git a/http-server/http-server.go b/http-server/http-server.go index f5cb6a92a..241276765 100644 --- a/http-server/http-server.go +++ b/http-server/http-server.go @@ -3,20 +3,34 @@ package httpserver import ( "bytes" "context" + "crypto/subtle" + "crypto/x509" "encoding/json" + "net" "net/http" + "os" "runtime" "time" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials" + + grpcRuntime "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/packethost/pkg/log" "github.com/pkg/errors" "github.com/prometheus/client_golang/prometheus/promhttp" + "github.com/tinkerbell/tink/protos/hardware" + "github.com/tinkerbell/tink/protos/template" + "github.com/tinkerbell/tink/protos/workflow" ) var ( gitRev = "unknown" gitRevJSON []byte - httpListenAddr = ":42114" + grpcEndpoint = os.Getenv("TINKERBELL_GRPC_AUTHORITY") + httpListenAddr = os.Getenv("TINKERBELL_HTTP_AUTHORITY") + authUsername = os.Getenv("TINK_AUTH_USERNAME") + authPassword = os.Getenv("TINK_AUTH_PASSWORD") startTime = time.Now() logger log.Logger ) @@ -24,6 +38,42 @@ var ( // SetupHTTP setup and return an HTTP server func SetupHTTP(ctx context.Context, lg log.Logger, certPEM []byte, modTime time.Time, errCh chan<- error) { logger = lg + + cp := x509.NewCertPool() + ok := cp.AppendCertsFromPEM(certPEM) + if !ok { + logger.Error(errors.New("parse cert")) + } + + creds := credentials.NewClientTLSFromCert(cp, "") + + mux := grpcRuntime.NewServeMux() + + dialOpts := []grpc.DialOption{grpc.WithTransportCredentials(creds)} + + if grpcEndpoint == "" { + grpcEndpoint = "localhost:42113" + } + host, _, err := net.SplitHostPort(grpcEndpoint) + if err != nil { + logger.Error(err) + } + if host == "" { + grpcEndpoint = "localhost" + grpcEndpoint + } + err = hardware.RegisterHardwareServiceHandlerFromEndpoint(ctx, mux, grpcEndpoint, dialOpts) + if err != nil { + logger.Error(err) + } + err = template.RegisterTemplateHandlerFromEndpoint(ctx, mux, grpcEndpoint, dialOpts) + if err != nil { + logger.Error(err) + } + err = workflow.RegisterWorkflowSvcHandlerFromEndpoint(ctx, mux, grpcEndpoint, dialOpts) + if err != nil { + logger.Error(err) + } + http.HandleFunc("/cert", func(w http.ResponseWriter, r *http.Request) { http.ServeContent(w, r, "server.pem", modTime, bytes.NewReader(certPEM)) }) @@ -31,7 +81,11 @@ func SetupHTTP(ctx context.Context, lg log.Logger, certPEM []byte, modTime time. setupGitRevJSON() http.HandleFunc("/version", versionHandler) http.HandleFunc("/_packet/healthcheck", healthCheckHandler) + http.Handle("/", BasicAuth(mux)) + if httpListenAddr == "" { + httpListenAddr = ":42114" + } srv := &http.Server{ Addr: httpListenAddr, } @@ -90,3 +144,21 @@ func setupGitRevJSON() { } gitRevJSON = b } + +// BasicAuth adds authentication to the routes handled by handler +// skips authentication if both authUsername and authPassword aren't set +func BasicAuth(handler http.Handler) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if authUsername != "" || authPassword != "" { + user, pass, ok := r.BasicAuth() + if !ok || subtle.ConstantTimeCompare([]byte(user), []byte(authUsername)) != 1 || + subtle.ConstantTimeCompare([]byte(pass), []byte(authPassword)) != 1 { + w.Header().Set("WWW-Authenticate", `Basic realm="Tink Realm"`) + w.WriteHeader(401) + w.Write([]byte("401 Unauthorized\n")) + return + } + } + handler.ServeHTTP(w, r) + }) +} diff --git a/protos/hardware/hardware.pb.go b/protos/hardware/hardware.pb.go index 64b0cf966..ab515c2b1 100644 --- a/protos/hardware/hardware.pb.go +++ b/protos/hardware/hardware.pb.go @@ -6,185 +6,1786 @@ package hardware import ( context "context" fmt "fmt" + proto "github.com/golang/protobuf/proto" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" math "math" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package + +type PushRequest struct { + Data *Hardware `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *PushRequest) Reset() { *m = PushRequest{} } +func (m *PushRequest) String() string { return proto.CompactTextString(m) } +func (*PushRequest) ProtoMessage() {} +func (*PushRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_61ac56d7fc2e671f, []int{0} +} + +func (m *PushRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_PushRequest.Unmarshal(m, b) +} +func (m *PushRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_PushRequest.Marshal(b, m, deterministic) +} +func (m *PushRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_PushRequest.Merge(m, src) +} +func (m *PushRequest) XXX_Size() int { + return xxx_messageInfo_PushRequest.Size(m) +} +func (m *PushRequest) XXX_DiscardUnknown() { + xxx_messageInfo_PushRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_PushRequest proto.InternalMessageInfo + +func (m *PushRequest) GetData() *Hardware { + if m != nil { + return m.Data + } + return nil +} + +type Empty struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Empty) Reset() { *m = Empty{} } +func (m *Empty) String() string { return proto.CompactTextString(m) } +func (*Empty) ProtoMessage() {} +func (*Empty) Descriptor() ([]byte, []int) { + return fileDescriptor_61ac56d7fc2e671f, []int{1} +} + +func (m *Empty) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Empty.Unmarshal(m, b) +} +func (m *Empty) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Empty.Marshal(b, m, deterministic) +} +func (m *Empty) XXX_Merge(src proto.Message) { + xxx_messageInfo_Empty.Merge(m, src) +} +func (m *Empty) XXX_Size() int { + return xxx_messageInfo_Empty.Size(m) +} +func (m *Empty) XXX_DiscardUnknown() { + xxx_messageInfo_Empty.DiscardUnknown(m) +} + +var xxx_messageInfo_Empty proto.InternalMessageInfo + +type GetRequest struct { + Mac string `protobuf:"bytes,1,opt,name=mac,proto3" json:"mac,omitempty"` + Ip string `protobuf:"bytes,2,opt,name=ip,proto3" json:"ip,omitempty"` + Id string `protobuf:"bytes,3,opt,name=id,proto3" json:"id,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetRequest) Reset() { *m = GetRequest{} } +func (m *GetRequest) String() string { return proto.CompactTextString(m) } +func (*GetRequest) ProtoMessage() {} +func (*GetRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_61ac56d7fc2e671f, []int{2} +} + +func (m *GetRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetRequest.Unmarshal(m, b) +} +func (m *GetRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetRequest.Marshal(b, m, deterministic) +} +func (m *GetRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetRequest.Merge(m, src) +} +func (m *GetRequest) XXX_Size() int { + return xxx_messageInfo_GetRequest.Size(m) +} +func (m *GetRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetRequest proto.InternalMessageInfo + +func (m *GetRequest) GetMac() string { + if m != nil { + return m.Mac + } + return "" +} + +func (m *GetRequest) GetIp() string { + if m != nil { + return m.Ip + } + return "" +} + +func (m *GetRequest) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +type Hardware struct { + OBSOLETE_JSON string `protobuf:"bytes,1,opt,name=OBSOLETE_JSON,json=OBSOLETEJSON,proto3" json:"OBSOLETE_JSON,omitempty"` + OBSOLETEDhcp *Hardware_DHCP `protobuf:"bytes,2,opt,name=OBSOLETE_dhcp,json=OBSOLETEDhcp,proto3" json:"OBSOLETE_dhcp,omitempty"` + OBSOLETENetboot *Hardware_Netboot `protobuf:"bytes,3,opt,name=OBSOLETE_netboot,json=OBSOLETENetboot,proto3" json:"OBSOLETE_netboot,omitempty"` + OBSOLETENetwork []*Hardware_Network `protobuf:"bytes,4,rep,name=OBSOLETE_network,json=OBSOLETENetwork,proto3" json:"OBSOLETE_network,omitempty"` + Metadata *Hardware_Metadata `protobuf:"bytes,5,opt,name=metadata,proto3" json:"metadata,omitempty"` + Network *Hardware_Network `protobuf:"bytes,6,opt,name=network,proto3" json:"network,omitempty"` + Id string `protobuf:"bytes,7,opt,name=id,proto3" json:"id,omitempty"` + Version int64 `protobuf:"varint,8,opt,name=version,proto3" json:"version,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Hardware) Reset() { *m = Hardware{} } +func (m *Hardware) String() string { return proto.CompactTextString(m) } +func (*Hardware) ProtoMessage() {} +func (*Hardware) Descriptor() ([]byte, []int) { + return fileDescriptor_61ac56d7fc2e671f, []int{3} +} + +func (m *Hardware) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Hardware.Unmarshal(m, b) +} +func (m *Hardware) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Hardware.Marshal(b, m, deterministic) +} +func (m *Hardware) XXX_Merge(src proto.Message) { + xxx_messageInfo_Hardware.Merge(m, src) +} +func (m *Hardware) XXX_Size() int { + return xxx_messageInfo_Hardware.Size(m) +} +func (m *Hardware) XXX_DiscardUnknown() { + xxx_messageInfo_Hardware.DiscardUnknown(m) +} + +var xxx_messageInfo_Hardware proto.InternalMessageInfo + +func (m *Hardware) GetOBSOLETE_JSON() string { + if m != nil { + return m.OBSOLETE_JSON + } + return "" +} + +func (m *Hardware) GetOBSOLETEDhcp() *Hardware_DHCP { + if m != nil { + return m.OBSOLETEDhcp + } + return nil +} + +func (m *Hardware) GetOBSOLETENetboot() *Hardware_Netboot { + if m != nil { + return m.OBSOLETENetboot + } + return nil +} + +func (m *Hardware) GetOBSOLETENetwork() []*Hardware_Network { + if m != nil { + return m.OBSOLETENetwork + } + return nil +} + +func (m *Hardware) GetMetadata() *Hardware_Metadata { + if m != nil { + return m.Metadata + } + return nil +} + +func (m *Hardware) GetNetwork() *Hardware_Network { + if m != nil { + return m.Network + } + return nil +} + +func (m *Hardware) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *Hardware) GetVersion() int64 { + if m != nil { + return m.Version + } + return 0 +} + +type Hardware_DHCP struct { + Mac string `protobuf:"bytes,1,opt,name=mac,proto3" json:"mac,omitempty"` + OBSOLETEIp string `protobuf:"bytes,2,opt,name=OBSOLETE_ip,json=OBSOLETEIp,proto3" json:"OBSOLETE_ip,omitempty"` + Hostname string `protobuf:"bytes,3,opt,name=hostname,proto3" json:"hostname,omitempty"` + LeaseTime int64 `protobuf:"varint,4,opt,name=lease_time,json=leaseTime,proto3" json:"lease_time,omitempty"` + NameServers []string `protobuf:"bytes,5,rep,name=name_servers,json=nameServers,proto3" json:"name_servers,omitempty"` + TimeServers []string `protobuf:"bytes,6,rep,name=time_servers,json=timeServers,proto3" json:"time_servers,omitempty"` + OBSOLETEGateway string `protobuf:"bytes,7,opt,name=OBSOLETE_gateway,json=OBSOLETEGateway,proto3" json:"OBSOLETE_gateway,omitempty"` + Arch string `protobuf:"bytes,8,opt,name=arch,proto3" json:"arch,omitempty"` + Uefi bool `protobuf:"varint,9,opt,name=uefi,proto3" json:"uefi,omitempty"` + IfaceName string `protobuf:"bytes,10,opt,name=iface_name,json=ifaceName,proto3" json:"iface_name,omitempty"` + Ip *Hardware_DHCP_IP `protobuf:"bytes,11,opt,name=ip,proto3" json:"ip,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Hardware_DHCP) Reset() { *m = Hardware_DHCP{} } +func (m *Hardware_DHCP) String() string { return proto.CompactTextString(m) } +func (*Hardware_DHCP) ProtoMessage() {} +func (*Hardware_DHCP) Descriptor() ([]byte, []int) { + return fileDescriptor_61ac56d7fc2e671f, []int{3, 0} +} + +func (m *Hardware_DHCP) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Hardware_DHCP.Unmarshal(m, b) +} +func (m *Hardware_DHCP) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Hardware_DHCP.Marshal(b, m, deterministic) +} +func (m *Hardware_DHCP) XXX_Merge(src proto.Message) { + xxx_messageInfo_Hardware_DHCP.Merge(m, src) +} +func (m *Hardware_DHCP) XXX_Size() int { + return xxx_messageInfo_Hardware_DHCP.Size(m) +} +func (m *Hardware_DHCP) XXX_DiscardUnknown() { + xxx_messageInfo_Hardware_DHCP.DiscardUnknown(m) +} + +var xxx_messageInfo_Hardware_DHCP proto.InternalMessageInfo + +func (m *Hardware_DHCP) GetMac() string { + if m != nil { + return m.Mac + } + return "" +} + +func (m *Hardware_DHCP) GetOBSOLETEIp() string { + if m != nil { + return m.OBSOLETEIp + } + return "" +} + +func (m *Hardware_DHCP) GetHostname() string { + if m != nil { + return m.Hostname + } + return "" +} + +func (m *Hardware_DHCP) GetLeaseTime() int64 { + if m != nil { + return m.LeaseTime + } + return 0 +} + +func (m *Hardware_DHCP) GetNameServers() []string { + if m != nil { + return m.NameServers + } + return nil +} + +func (m *Hardware_DHCP) GetTimeServers() []string { + if m != nil { + return m.TimeServers + } + return nil +} + +func (m *Hardware_DHCP) GetOBSOLETEGateway() string { + if m != nil { + return m.OBSOLETEGateway + } + return "" +} + +func (m *Hardware_DHCP) GetArch() string { + if m != nil { + return m.Arch + } + return "" +} + +func (m *Hardware_DHCP) GetUefi() bool { + if m != nil { + return m.Uefi + } + return false +} + +func (m *Hardware_DHCP) GetIfaceName() string { + if m != nil { + return m.IfaceName + } + return "" +} + +func (m *Hardware_DHCP) GetIp() *Hardware_DHCP_IP { + if m != nil { + return m.Ip + } + return nil +} + +type Hardware_DHCP_IP struct { + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Netmask string `protobuf:"bytes,2,opt,name=netmask,proto3" json:"netmask,omitempty"` + Gateway string `protobuf:"bytes,3,opt,name=gateway,proto3" json:"gateway,omitempty"` + Family int64 `protobuf:"varint,4,opt,name=family,proto3" json:"family,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Hardware_DHCP_IP) Reset() { *m = Hardware_DHCP_IP{} } +func (m *Hardware_DHCP_IP) String() string { return proto.CompactTextString(m) } +func (*Hardware_DHCP_IP) ProtoMessage() {} +func (*Hardware_DHCP_IP) Descriptor() ([]byte, []int) { + return fileDescriptor_61ac56d7fc2e671f, []int{3, 0, 0} +} + +func (m *Hardware_DHCP_IP) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Hardware_DHCP_IP.Unmarshal(m, b) +} +func (m *Hardware_DHCP_IP) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Hardware_DHCP_IP.Marshal(b, m, deterministic) +} +func (m *Hardware_DHCP_IP) XXX_Merge(src proto.Message) { + xxx_messageInfo_Hardware_DHCP_IP.Merge(m, src) +} +func (m *Hardware_DHCP_IP) XXX_Size() int { + return xxx_messageInfo_Hardware_DHCP_IP.Size(m) +} +func (m *Hardware_DHCP_IP) XXX_DiscardUnknown() { + xxx_messageInfo_Hardware_DHCP_IP.DiscardUnknown(m) +} + +var xxx_messageInfo_Hardware_DHCP_IP proto.InternalMessageInfo + +func (m *Hardware_DHCP_IP) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *Hardware_DHCP_IP) GetNetmask() string { + if m != nil { + return m.Netmask + } + return "" +} + +func (m *Hardware_DHCP_IP) GetGateway() string { + if m != nil { + return m.Gateway + } + return "" +} + +func (m *Hardware_DHCP_IP) GetFamily() int64 { + if m != nil { + return m.Family + } + return 0 +} + +type Hardware_Netboot struct { + AllowPxe bool `protobuf:"varint,1,opt,name=allow_pxe,json=allowPxe,proto3" json:"allow_pxe,omitempty"` + AllowWorkflow bool `protobuf:"varint,2,opt,name=allow_workflow,json=allowWorkflow,proto3" json:"allow_workflow,omitempty"` + Ipxe *Hardware_Netboot_IPXE `protobuf:"bytes,3,opt,name=ipxe,proto3" json:"ipxe,omitempty"` + OBSOLETEBootstrapper *Hardware_Netboot_Bootstrapper `protobuf:"bytes,4,opt,name=OBSOLETE_bootstrapper,json=OBSOLETEBootstrapper,proto3" json:"OBSOLETE_bootstrapper,omitempty"` + Osie *Hardware_Netboot_Osie `protobuf:"bytes,5,opt,name=osie,proto3" json:"osie,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Hardware_Netboot) Reset() { *m = Hardware_Netboot{} } +func (m *Hardware_Netboot) String() string { return proto.CompactTextString(m) } +func (*Hardware_Netboot) ProtoMessage() {} +func (*Hardware_Netboot) Descriptor() ([]byte, []int) { + return fileDescriptor_61ac56d7fc2e671f, []int{3, 1} +} + +func (m *Hardware_Netboot) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Hardware_Netboot.Unmarshal(m, b) +} +func (m *Hardware_Netboot) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Hardware_Netboot.Marshal(b, m, deterministic) +} +func (m *Hardware_Netboot) XXX_Merge(src proto.Message) { + xxx_messageInfo_Hardware_Netboot.Merge(m, src) +} +func (m *Hardware_Netboot) XXX_Size() int { + return xxx_messageInfo_Hardware_Netboot.Size(m) +} +func (m *Hardware_Netboot) XXX_DiscardUnknown() { + xxx_messageInfo_Hardware_Netboot.DiscardUnknown(m) +} + +var xxx_messageInfo_Hardware_Netboot proto.InternalMessageInfo + +func (m *Hardware_Netboot) GetAllowPxe() bool { + if m != nil { + return m.AllowPxe + } + return false +} + +func (m *Hardware_Netboot) GetAllowWorkflow() bool { + if m != nil { + return m.AllowWorkflow + } + return false +} + +func (m *Hardware_Netboot) GetIpxe() *Hardware_Netboot_IPXE { + if m != nil { + return m.Ipxe + } + return nil +} + +func (m *Hardware_Netboot) GetOBSOLETEBootstrapper() *Hardware_Netboot_Bootstrapper { + if m != nil { + return m.OBSOLETEBootstrapper + } + return nil +} + +func (m *Hardware_Netboot) GetOsie() *Hardware_Netboot_Osie { + if m != nil { + return m.Osie + } + return nil +} + +type Hardware_Netboot_IPXE struct { + Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` + Contents string `protobuf:"bytes,2,opt,name=contents,proto3" json:"contents,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Hardware_Netboot_IPXE) Reset() { *m = Hardware_Netboot_IPXE{} } +func (m *Hardware_Netboot_IPXE) String() string { return proto.CompactTextString(m) } +func (*Hardware_Netboot_IPXE) ProtoMessage() {} +func (*Hardware_Netboot_IPXE) Descriptor() ([]byte, []int) { + return fileDescriptor_61ac56d7fc2e671f, []int{3, 1, 0} +} + +func (m *Hardware_Netboot_IPXE) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Hardware_Netboot_IPXE.Unmarshal(m, b) +} +func (m *Hardware_Netboot_IPXE) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Hardware_Netboot_IPXE.Marshal(b, m, deterministic) +} +func (m *Hardware_Netboot_IPXE) XXX_Merge(src proto.Message) { + xxx_messageInfo_Hardware_Netboot_IPXE.Merge(m, src) +} +func (m *Hardware_Netboot_IPXE) XXX_Size() int { + return xxx_messageInfo_Hardware_Netboot_IPXE.Size(m) +} +func (m *Hardware_Netboot_IPXE) XXX_DiscardUnknown() { + xxx_messageInfo_Hardware_Netboot_IPXE.DiscardUnknown(m) +} + +var xxx_messageInfo_Hardware_Netboot_IPXE proto.InternalMessageInfo + +func (m *Hardware_Netboot_IPXE) GetUrl() string { + if m != nil { + return m.Url + } + return "" +} + +func (m *Hardware_Netboot_IPXE) GetContents() string { + if m != nil { + return m.Contents + } + return "" +} + +type Hardware_Netboot_Bootstrapper struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Hardware_Netboot_Bootstrapper) Reset() { *m = Hardware_Netboot_Bootstrapper{} } +func (m *Hardware_Netboot_Bootstrapper) String() string { return proto.CompactTextString(m) } +func (*Hardware_Netboot_Bootstrapper) ProtoMessage() {} +func (*Hardware_Netboot_Bootstrapper) Descriptor() ([]byte, []int) { + return fileDescriptor_61ac56d7fc2e671f, []int{3, 1, 1} +} + +func (m *Hardware_Netboot_Bootstrapper) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Hardware_Netboot_Bootstrapper.Unmarshal(m, b) +} +func (m *Hardware_Netboot_Bootstrapper) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Hardware_Netboot_Bootstrapper.Marshal(b, m, deterministic) +} +func (m *Hardware_Netboot_Bootstrapper) XXX_Merge(src proto.Message) { + xxx_messageInfo_Hardware_Netboot_Bootstrapper.Merge(m, src) +} +func (m *Hardware_Netboot_Bootstrapper) XXX_Size() int { + return xxx_messageInfo_Hardware_Netboot_Bootstrapper.Size(m) +} +func (m *Hardware_Netboot_Bootstrapper) XXX_DiscardUnknown() { + xxx_messageInfo_Hardware_Netboot_Bootstrapper.DiscardUnknown(m) +} + +var xxx_messageInfo_Hardware_Netboot_Bootstrapper proto.InternalMessageInfo + +type Hardware_Netboot_Osie struct { + BaseUrl string `protobuf:"bytes,1,opt,name=base_url,json=baseUrl,proto3" json:"base_url,omitempty"` + Kernel string `protobuf:"bytes,2,opt,name=kernel,proto3" json:"kernel,omitempty"` + Initrd string `protobuf:"bytes,3,opt,name=initrd,proto3" json:"initrd,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Hardware_Netboot_Osie) Reset() { *m = Hardware_Netboot_Osie{} } +func (m *Hardware_Netboot_Osie) String() string { return proto.CompactTextString(m) } +func (*Hardware_Netboot_Osie) ProtoMessage() {} +func (*Hardware_Netboot_Osie) Descriptor() ([]byte, []int) { + return fileDescriptor_61ac56d7fc2e671f, []int{3, 1, 2} +} + +func (m *Hardware_Netboot_Osie) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Hardware_Netboot_Osie.Unmarshal(m, b) +} +func (m *Hardware_Netboot_Osie) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Hardware_Netboot_Osie.Marshal(b, m, deterministic) +} +func (m *Hardware_Netboot_Osie) XXX_Merge(src proto.Message) { + xxx_messageInfo_Hardware_Netboot_Osie.Merge(m, src) +} +func (m *Hardware_Netboot_Osie) XXX_Size() int { + return xxx_messageInfo_Hardware_Netboot_Osie.Size(m) +} +func (m *Hardware_Netboot_Osie) XXX_DiscardUnknown() { + xxx_messageInfo_Hardware_Netboot_Osie.DiscardUnknown(m) +} + +var xxx_messageInfo_Hardware_Netboot_Osie proto.InternalMessageInfo + +func (m *Hardware_Netboot_Osie) GetBaseUrl() string { + if m != nil { + return m.BaseUrl + } + return "" +} + +func (m *Hardware_Netboot_Osie) GetKernel() string { + if m != nil { + return m.Kernel + } + return "" +} + +func (m *Hardware_Netboot_Osie) GetInitrd() string { + if m != nil { + return m.Initrd + } + return "" +} + +type Hardware_Network struct { + OBSOLETEDhcp *Hardware_DHCP `protobuf:"bytes,1,opt,name=OBSOLETE_dhcp,json=OBSOLETEDhcp,proto3" json:"OBSOLETE_dhcp,omitempty"` + OBSOLETENetboot *Hardware_Netboot `protobuf:"bytes,2,opt,name=OBSOLETE_netboot,json=OBSOLETENetboot,proto3" json:"OBSOLETE_netboot,omitempty"` + Interfaces []*Hardware_Network_Interface `protobuf:"bytes,3,rep,name=interfaces,proto3" json:"interfaces,omitempty"` + OBSOLETEDefault *Hardware_Network_Interface `protobuf:"bytes,4,opt,name=OBSOLETE_default,json=OBSOLETEDefault,proto3" json:"OBSOLETE_default,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Hardware_Network) Reset() { *m = Hardware_Network{} } +func (m *Hardware_Network) String() string { return proto.CompactTextString(m) } +func (*Hardware_Network) ProtoMessage() {} +func (*Hardware_Network) Descriptor() ([]byte, []int) { + return fileDescriptor_61ac56d7fc2e671f, []int{3, 2} +} + +func (m *Hardware_Network) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Hardware_Network.Unmarshal(m, b) +} +func (m *Hardware_Network) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Hardware_Network.Marshal(b, m, deterministic) +} +func (m *Hardware_Network) XXX_Merge(src proto.Message) { + xxx_messageInfo_Hardware_Network.Merge(m, src) +} +func (m *Hardware_Network) XXX_Size() int { + return xxx_messageInfo_Hardware_Network.Size(m) +} +func (m *Hardware_Network) XXX_DiscardUnknown() { + xxx_messageInfo_Hardware_Network.DiscardUnknown(m) +} + +var xxx_messageInfo_Hardware_Network proto.InternalMessageInfo + +func (m *Hardware_Network) GetOBSOLETEDhcp() *Hardware_DHCP { + if m != nil { + return m.OBSOLETEDhcp + } + return nil +} + +func (m *Hardware_Network) GetOBSOLETENetboot() *Hardware_Netboot { + if m != nil { + return m.OBSOLETENetboot + } + return nil +} + +func (m *Hardware_Network) GetInterfaces() []*Hardware_Network_Interface { + if m != nil { + return m.Interfaces + } + return nil +} + +func (m *Hardware_Network) GetOBSOLETEDefault() *Hardware_Network_Interface { + if m != nil { + return m.OBSOLETEDefault + } + return nil +} + +type Hardware_Network_Interface struct { + Dhcp *Hardware_DHCP `protobuf:"bytes,1,opt,name=dhcp,proto3" json:"dhcp,omitempty"` + Netboot *Hardware_Netboot `protobuf:"bytes,2,opt,name=netboot,proto3" json:"netboot,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Hardware_Network_Interface) Reset() { *m = Hardware_Network_Interface{} } +func (m *Hardware_Network_Interface) String() string { return proto.CompactTextString(m) } +func (*Hardware_Network_Interface) ProtoMessage() {} +func (*Hardware_Network_Interface) Descriptor() ([]byte, []int) { + return fileDescriptor_61ac56d7fc2e671f, []int{3, 2, 0} +} + +func (m *Hardware_Network_Interface) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Hardware_Network_Interface.Unmarshal(m, b) +} +func (m *Hardware_Network_Interface) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Hardware_Network_Interface.Marshal(b, m, deterministic) +} +func (m *Hardware_Network_Interface) XXX_Merge(src proto.Message) { + xxx_messageInfo_Hardware_Network_Interface.Merge(m, src) +} +func (m *Hardware_Network_Interface) XXX_Size() int { + return xxx_messageInfo_Hardware_Network_Interface.Size(m) +} +func (m *Hardware_Network_Interface) XXX_DiscardUnknown() { + xxx_messageInfo_Hardware_Network_Interface.DiscardUnknown(m) +} + +var xxx_messageInfo_Hardware_Network_Interface proto.InternalMessageInfo + +func (m *Hardware_Network_Interface) GetDhcp() *Hardware_DHCP { + if m != nil { + return m.Dhcp + } + return nil +} + +func (m *Hardware_Network_Interface) GetNetboot() *Hardware_Netboot { + if m != nil { + return m.Netboot + } + return nil +} + +type Hardware_Metadata struct { + State string `protobuf:"bytes,1,opt,name=state,proto3" json:"state,omitempty"` + BondingMode int64 `protobuf:"varint,2,opt,name=bonding_mode,json=bondingMode,proto3" json:"bonding_mode,omitempty"` + Manufacturer *Hardware_Metadata_Manufacturer `protobuf:"bytes,3,opt,name=manufacturer,proto3" json:"manufacturer,omitempty"` + Instance *Hardware_Metadata_Instance `protobuf:"bytes,4,opt,name=instance,proto3" json:"instance,omitempty"` + Custom *Hardware_Metadata_Custom `protobuf:"bytes,5,opt,name=custom,proto3" json:"custom,omitempty"` + Facility *Hardware_Metadata_Facility `protobuf:"bytes,6,opt,name=facility,proto3" json:"facility,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Hardware_Metadata) Reset() { *m = Hardware_Metadata{} } +func (m *Hardware_Metadata) String() string { return proto.CompactTextString(m) } +func (*Hardware_Metadata) ProtoMessage() {} +func (*Hardware_Metadata) Descriptor() ([]byte, []int) { + return fileDescriptor_61ac56d7fc2e671f, []int{3, 3} +} + +func (m *Hardware_Metadata) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Hardware_Metadata.Unmarshal(m, b) +} +func (m *Hardware_Metadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Hardware_Metadata.Marshal(b, m, deterministic) +} +func (m *Hardware_Metadata) XXX_Merge(src proto.Message) { + xxx_messageInfo_Hardware_Metadata.Merge(m, src) +} +func (m *Hardware_Metadata) XXX_Size() int { + return xxx_messageInfo_Hardware_Metadata.Size(m) +} +func (m *Hardware_Metadata) XXX_DiscardUnknown() { + xxx_messageInfo_Hardware_Metadata.DiscardUnknown(m) +} + +var xxx_messageInfo_Hardware_Metadata proto.InternalMessageInfo + +func (m *Hardware_Metadata) GetState() string { + if m != nil { + return m.State + } + return "" +} + +func (m *Hardware_Metadata) GetBondingMode() int64 { + if m != nil { + return m.BondingMode + } + return 0 +} + +func (m *Hardware_Metadata) GetManufacturer() *Hardware_Metadata_Manufacturer { + if m != nil { + return m.Manufacturer + } + return nil +} + +func (m *Hardware_Metadata) GetInstance() *Hardware_Metadata_Instance { + if m != nil { + return m.Instance + } + return nil +} + +func (m *Hardware_Metadata) GetCustom() *Hardware_Metadata_Custom { + if m != nil { + return m.Custom + } + return nil +} + +func (m *Hardware_Metadata) GetFacility() *Hardware_Metadata_Facility { + if m != nil { + return m.Facility + } + return nil +} + +type Hardware_Metadata_Manufacturer struct { + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Slug string `protobuf:"bytes,2,opt,name=slug,proto3" json:"slug,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Hardware_Metadata_Manufacturer) Reset() { *m = Hardware_Metadata_Manufacturer{} } +func (m *Hardware_Metadata_Manufacturer) String() string { return proto.CompactTextString(m) } +func (*Hardware_Metadata_Manufacturer) ProtoMessage() {} +func (*Hardware_Metadata_Manufacturer) Descriptor() ([]byte, []int) { + return fileDescriptor_61ac56d7fc2e671f, []int{3, 3, 0} +} + +func (m *Hardware_Metadata_Manufacturer) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Hardware_Metadata_Manufacturer.Unmarshal(m, b) +} +func (m *Hardware_Metadata_Manufacturer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Hardware_Metadata_Manufacturer.Marshal(b, m, deterministic) +} +func (m *Hardware_Metadata_Manufacturer) XXX_Merge(src proto.Message) { + xxx_messageInfo_Hardware_Metadata_Manufacturer.Merge(m, src) +} +func (m *Hardware_Metadata_Manufacturer) XXX_Size() int { + return xxx_messageInfo_Hardware_Metadata_Manufacturer.Size(m) +} +func (m *Hardware_Metadata_Manufacturer) XXX_DiscardUnknown() { + xxx_messageInfo_Hardware_Metadata_Manufacturer.DiscardUnknown(m) +} + +var xxx_messageInfo_Hardware_Metadata_Manufacturer proto.InternalMessageInfo + +func (m *Hardware_Metadata_Manufacturer) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *Hardware_Metadata_Manufacturer) GetSlug() string { + if m != nil { + return m.Slug + } + return "" +} + +type Hardware_Metadata_Instance struct { + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + State string `protobuf:"bytes,2,opt,name=state,proto3" json:"state,omitempty"` + Hostname string `protobuf:"bytes,3,opt,name=hostname,proto3" json:"hostname,omitempty"` + AllowPxe bool `protobuf:"varint,4,opt,name=allow_pxe,json=allowPxe,proto3" json:"allow_pxe,omitempty"` + Rescue bool `protobuf:"varint,5,opt,name=rescue,proto3" json:"rescue,omitempty"` + OperatingSystemVersion *Hardware_Metadata_Instance_OperatingSystem `protobuf:"bytes,6,opt,name=operating_system_version,json=operatingSystemVersion,proto3" json:"operating_system_version,omitempty"` + AlwaysPxe bool `protobuf:"varint,7,opt,name=always_pxe,json=alwaysPxe,proto3" json:"always_pxe,omitempty"` + IpxeScriptUrl string `protobuf:"bytes,8,opt,name=ipxe_script_url,json=ipxeScriptUrl,proto3" json:"ipxe_script_url,omitempty"` + Ips []*Hardware_Metadata_Instance_IP `protobuf:"bytes,9,rep,name=ips,proto3" json:"ips,omitempty"` + Userdata string `protobuf:"bytes,10,opt,name=userdata,proto3" json:"userdata,omitempty"` + CryptedRootPassword string `protobuf:"bytes,11,opt,name=crypted_root_password,json=cryptedRootPassword,proto3" json:"crypted_root_password,omitempty"` + Tags []string `protobuf:"bytes,12,rep,name=tags,proto3" json:"tags,omitempty"` + Storage *Hardware_Metadata_Instance_Storage `protobuf:"bytes,13,opt,name=storage,proto3" json:"storage,omitempty"` + SshKeys []string `protobuf:"bytes,14,rep,name=ssh_keys,json=sshKeys,proto3" json:"ssh_keys,omitempty"` + NetworkReady bool `protobuf:"varint,15,opt,name=network_ready,json=networkReady,proto3" json:"network_ready,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Hardware_Metadata_Instance) Reset() { *m = Hardware_Metadata_Instance{} } +func (m *Hardware_Metadata_Instance) String() string { return proto.CompactTextString(m) } +func (*Hardware_Metadata_Instance) ProtoMessage() {} +func (*Hardware_Metadata_Instance) Descriptor() ([]byte, []int) { + return fileDescriptor_61ac56d7fc2e671f, []int{3, 3, 1} +} + +func (m *Hardware_Metadata_Instance) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Hardware_Metadata_Instance.Unmarshal(m, b) +} +func (m *Hardware_Metadata_Instance) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Hardware_Metadata_Instance.Marshal(b, m, deterministic) +} +func (m *Hardware_Metadata_Instance) XXX_Merge(src proto.Message) { + xxx_messageInfo_Hardware_Metadata_Instance.Merge(m, src) +} +func (m *Hardware_Metadata_Instance) XXX_Size() int { + return xxx_messageInfo_Hardware_Metadata_Instance.Size(m) +} +func (m *Hardware_Metadata_Instance) XXX_DiscardUnknown() { + xxx_messageInfo_Hardware_Metadata_Instance.DiscardUnknown(m) +} + +var xxx_messageInfo_Hardware_Metadata_Instance proto.InternalMessageInfo + +func (m *Hardware_Metadata_Instance) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *Hardware_Metadata_Instance) GetState() string { + if m != nil { + return m.State + } + return "" +} + +func (m *Hardware_Metadata_Instance) GetHostname() string { + if m != nil { + return m.Hostname + } + return "" +} + +func (m *Hardware_Metadata_Instance) GetAllowPxe() bool { + if m != nil { + return m.AllowPxe + } + return false +} + +func (m *Hardware_Metadata_Instance) GetRescue() bool { + if m != nil { + return m.Rescue + } + return false +} + +func (m *Hardware_Metadata_Instance) GetOperatingSystemVersion() *Hardware_Metadata_Instance_OperatingSystem { + if m != nil { + return m.OperatingSystemVersion + } + return nil +} + +func (m *Hardware_Metadata_Instance) GetAlwaysPxe() bool { + if m != nil { + return m.AlwaysPxe + } + return false +} + +func (m *Hardware_Metadata_Instance) GetIpxeScriptUrl() string { + if m != nil { + return m.IpxeScriptUrl + } + return "" +} + +func (m *Hardware_Metadata_Instance) GetIps() []*Hardware_Metadata_Instance_IP { + if m != nil { + return m.Ips + } + return nil +} + +func (m *Hardware_Metadata_Instance) GetUserdata() string { + if m != nil { + return m.Userdata + } + return "" +} + +func (m *Hardware_Metadata_Instance) GetCryptedRootPassword() string { + if m != nil { + return m.CryptedRootPassword + } + return "" +} + +func (m *Hardware_Metadata_Instance) GetTags() []string { + if m != nil { + return m.Tags + } + return nil +} + +func (m *Hardware_Metadata_Instance) GetStorage() *Hardware_Metadata_Instance_Storage { + if m != nil { + return m.Storage + } + return nil +} + +func (m *Hardware_Metadata_Instance) GetSshKeys() []string { + if m != nil { + return m.SshKeys + } + return nil +} + +func (m *Hardware_Metadata_Instance) GetNetworkReady() bool { + if m != nil { + return m.NetworkReady + } + return false +} + +type Hardware_Metadata_Instance_OperatingSystem struct { + Slug string `protobuf:"bytes,1,opt,name=slug,proto3" json:"slug,omitempty"` + Distro string `protobuf:"bytes,2,opt,name=distro,proto3" json:"distro,omitempty"` + Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` + ImageTag string `protobuf:"bytes,4,opt,name=image_tag,json=imageTag,proto3" json:"image_tag,omitempty"` + OsSlug string `protobuf:"bytes,5,opt,name=os_slug,json=osSlug,proto3" json:"os_slug,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Hardware_Metadata_Instance_OperatingSystem) Reset() { + *m = Hardware_Metadata_Instance_OperatingSystem{} +} +func (m *Hardware_Metadata_Instance_OperatingSystem) String() string { + return proto.CompactTextString(m) +} +func (*Hardware_Metadata_Instance_OperatingSystem) ProtoMessage() {} +func (*Hardware_Metadata_Instance_OperatingSystem) Descriptor() ([]byte, []int) { + return fileDescriptor_61ac56d7fc2e671f, []int{3, 3, 1, 0} +} + +func (m *Hardware_Metadata_Instance_OperatingSystem) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Hardware_Metadata_Instance_OperatingSystem.Unmarshal(m, b) +} +func (m *Hardware_Metadata_Instance_OperatingSystem) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Hardware_Metadata_Instance_OperatingSystem.Marshal(b, m, deterministic) +} +func (m *Hardware_Metadata_Instance_OperatingSystem) XXX_Merge(src proto.Message) { + xxx_messageInfo_Hardware_Metadata_Instance_OperatingSystem.Merge(m, src) +} +func (m *Hardware_Metadata_Instance_OperatingSystem) XXX_Size() int { + return xxx_messageInfo_Hardware_Metadata_Instance_OperatingSystem.Size(m) +} +func (m *Hardware_Metadata_Instance_OperatingSystem) XXX_DiscardUnknown() { + xxx_messageInfo_Hardware_Metadata_Instance_OperatingSystem.DiscardUnknown(m) +} + +var xxx_messageInfo_Hardware_Metadata_Instance_OperatingSystem proto.InternalMessageInfo + +func (m *Hardware_Metadata_Instance_OperatingSystem) GetSlug() string { + if m != nil { + return m.Slug + } + return "" +} + +func (m *Hardware_Metadata_Instance_OperatingSystem) GetDistro() string { + if m != nil { + return m.Distro + } + return "" +} + +func (m *Hardware_Metadata_Instance_OperatingSystem) GetVersion() string { + if m != nil { + return m.Version + } + return "" +} + +func (m *Hardware_Metadata_Instance_OperatingSystem) GetImageTag() string { + if m != nil { + return m.ImageTag + } + return "" +} + +func (m *Hardware_Metadata_Instance_OperatingSystem) GetOsSlug() string { + if m != nil { + return m.OsSlug + } + return "" +} + +type Hardware_Metadata_Instance_IP struct { + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Netmask string `protobuf:"bytes,2,opt,name=netmask,proto3" json:"netmask,omitempty"` + Gateway string `protobuf:"bytes,3,opt,name=gateway,proto3" json:"gateway,omitempty"` + Family int64 `protobuf:"varint,4,opt,name=family,proto3" json:"family,omitempty"` + Public bool `protobuf:"varint,5,opt,name=public,proto3" json:"public,omitempty"` + Management bool `protobuf:"varint,6,opt,name=management,proto3" json:"management,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Hardware_Metadata_Instance_IP) Reset() { *m = Hardware_Metadata_Instance_IP{} } +func (m *Hardware_Metadata_Instance_IP) String() string { return proto.CompactTextString(m) } +func (*Hardware_Metadata_Instance_IP) ProtoMessage() {} +func (*Hardware_Metadata_Instance_IP) Descriptor() ([]byte, []int) { + return fileDescriptor_61ac56d7fc2e671f, []int{3, 3, 1, 1} +} + +func (m *Hardware_Metadata_Instance_IP) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Hardware_Metadata_Instance_IP.Unmarshal(m, b) +} +func (m *Hardware_Metadata_Instance_IP) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Hardware_Metadata_Instance_IP.Marshal(b, m, deterministic) +} +func (m *Hardware_Metadata_Instance_IP) XXX_Merge(src proto.Message) { + xxx_messageInfo_Hardware_Metadata_Instance_IP.Merge(m, src) +} +func (m *Hardware_Metadata_Instance_IP) XXX_Size() int { + return xxx_messageInfo_Hardware_Metadata_Instance_IP.Size(m) +} +func (m *Hardware_Metadata_Instance_IP) XXX_DiscardUnknown() { + xxx_messageInfo_Hardware_Metadata_Instance_IP.DiscardUnknown(m) +} + +var xxx_messageInfo_Hardware_Metadata_Instance_IP proto.InternalMessageInfo + +func (m *Hardware_Metadata_Instance_IP) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *Hardware_Metadata_Instance_IP) GetNetmask() string { + if m != nil { + return m.Netmask + } + return "" +} + +func (m *Hardware_Metadata_Instance_IP) GetGateway() string { + if m != nil { + return m.Gateway + } + return "" +} + +func (m *Hardware_Metadata_Instance_IP) GetFamily() int64 { + if m != nil { + return m.Family + } + return 0 +} + +func (m *Hardware_Metadata_Instance_IP) GetPublic() bool { + if m != nil { + return m.Public + } + return false +} + +func (m *Hardware_Metadata_Instance_IP) GetManagement() bool { + if m != nil { + return m.Management + } + return false +} + +type Hardware_Metadata_Instance_Storage struct { + OBSOLETEDisks []string `protobuf:"bytes,1,rep,name=OBSOLETE_disks,json=OBSOLETEDisks,proto3" json:"OBSOLETE_disks,omitempty"` + OBSOLETERaid []string `protobuf:"bytes,2,rep,name=OBSOLETE_raid,json=OBSOLETERaid,proto3" json:"OBSOLETE_raid,omitempty"` + OBSOLETEFilesystems []string `protobuf:"bytes,3,rep,name=OBSOLETE_filesystems,json=OBSOLETEFilesystems,proto3" json:"OBSOLETE_filesystems,omitempty"` + Disks []*Hardware_Metadata_Instance_Storage_Disk `protobuf:"bytes,4,rep,name=disks,proto3" json:"disks,omitempty"` + Raid []*Hardware_Metadata_Instance_Storage_RAID `protobuf:"bytes,5,rep,name=raid,proto3" json:"raid,omitempty"` + Filesystems []*Hardware_Metadata_Instance_Storage_Filesystem `protobuf:"bytes,6,rep,name=filesystems,proto3" json:"filesystems,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Hardware_Metadata_Instance_Storage) Reset() { *m = Hardware_Metadata_Instance_Storage{} } +func (m *Hardware_Metadata_Instance_Storage) String() string { return proto.CompactTextString(m) } +func (*Hardware_Metadata_Instance_Storage) ProtoMessage() {} +func (*Hardware_Metadata_Instance_Storage) Descriptor() ([]byte, []int) { + return fileDescriptor_61ac56d7fc2e671f, []int{3, 3, 1, 2} +} + +func (m *Hardware_Metadata_Instance_Storage) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Hardware_Metadata_Instance_Storage.Unmarshal(m, b) +} +func (m *Hardware_Metadata_Instance_Storage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Hardware_Metadata_Instance_Storage.Marshal(b, m, deterministic) +} +func (m *Hardware_Metadata_Instance_Storage) XXX_Merge(src proto.Message) { + xxx_messageInfo_Hardware_Metadata_Instance_Storage.Merge(m, src) +} +func (m *Hardware_Metadata_Instance_Storage) XXX_Size() int { + return xxx_messageInfo_Hardware_Metadata_Instance_Storage.Size(m) +} +func (m *Hardware_Metadata_Instance_Storage) XXX_DiscardUnknown() { + xxx_messageInfo_Hardware_Metadata_Instance_Storage.DiscardUnknown(m) +} + +var xxx_messageInfo_Hardware_Metadata_Instance_Storage proto.InternalMessageInfo + +func (m *Hardware_Metadata_Instance_Storage) GetOBSOLETEDisks() []string { + if m != nil { + return m.OBSOLETEDisks + } + return nil +} + +func (m *Hardware_Metadata_Instance_Storage) GetOBSOLETERaid() []string { + if m != nil { + return m.OBSOLETERaid + } + return nil +} + +func (m *Hardware_Metadata_Instance_Storage) GetOBSOLETEFilesystems() []string { + if m != nil { + return m.OBSOLETEFilesystems + } + return nil +} + +func (m *Hardware_Metadata_Instance_Storage) GetDisks() []*Hardware_Metadata_Instance_Storage_Disk { + if m != nil { + return m.Disks + } + return nil +} + +func (m *Hardware_Metadata_Instance_Storage) GetRaid() []*Hardware_Metadata_Instance_Storage_RAID { + if m != nil { + return m.Raid + } + return nil +} + +func (m *Hardware_Metadata_Instance_Storage) GetFilesystems() []*Hardware_Metadata_Instance_Storage_Filesystem { + if m != nil { + return m.Filesystems + } + return nil +} + +type Hardware_Metadata_Instance_Storage_Disk struct { + Device string `protobuf:"bytes,1,opt,name=device,proto3" json:"device,omitempty"` + WipeTable bool `protobuf:"varint,2,opt,name=wipe_table,json=wipeTable,proto3" json:"wipe_table,omitempty"` + Partitions []*Hardware_Metadata_Instance_Storage_Disk_Partition `protobuf:"bytes,3,rep,name=partitions,proto3" json:"partitions,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Hardware_Metadata_Instance_Storage_Disk) Reset() { + *m = Hardware_Metadata_Instance_Storage_Disk{} +} +func (m *Hardware_Metadata_Instance_Storage_Disk) String() string { return proto.CompactTextString(m) } +func (*Hardware_Metadata_Instance_Storage_Disk) ProtoMessage() {} +func (*Hardware_Metadata_Instance_Storage_Disk) Descriptor() ([]byte, []int) { + return fileDescriptor_61ac56d7fc2e671f, []int{3, 3, 1, 2, 0} +} + +func (m *Hardware_Metadata_Instance_Storage_Disk) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Hardware_Metadata_Instance_Storage_Disk.Unmarshal(m, b) +} +func (m *Hardware_Metadata_Instance_Storage_Disk) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Hardware_Metadata_Instance_Storage_Disk.Marshal(b, m, deterministic) +} +func (m *Hardware_Metadata_Instance_Storage_Disk) XXX_Merge(src proto.Message) { + xxx_messageInfo_Hardware_Metadata_Instance_Storage_Disk.Merge(m, src) +} +func (m *Hardware_Metadata_Instance_Storage_Disk) XXX_Size() int { + return xxx_messageInfo_Hardware_Metadata_Instance_Storage_Disk.Size(m) +} +func (m *Hardware_Metadata_Instance_Storage_Disk) XXX_DiscardUnknown() { + xxx_messageInfo_Hardware_Metadata_Instance_Storage_Disk.DiscardUnknown(m) +} + +var xxx_messageInfo_Hardware_Metadata_Instance_Storage_Disk proto.InternalMessageInfo + +func (m *Hardware_Metadata_Instance_Storage_Disk) GetDevice() string { + if m != nil { + return m.Device + } + return "" +} + +func (m *Hardware_Metadata_Instance_Storage_Disk) GetWipeTable() bool { + if m != nil { + return m.WipeTable + } + return false +} + +func (m *Hardware_Metadata_Instance_Storage_Disk) GetPartitions() []*Hardware_Metadata_Instance_Storage_Disk_Partition { + if m != nil { + return m.Partitions + } + return nil +} + +type Hardware_Metadata_Instance_Storage_Disk_Partition struct { + Label string `protobuf:"bytes,1,opt,name=label,proto3" json:"label,omitempty"` + Number int64 `protobuf:"varint,2,opt,name=number,proto3" json:"number,omitempty"` + Size int64 `protobuf:"varint,3,opt,name=size,proto3" json:"size,omitempty"` + Start int64 `protobuf:"varint,4,opt,name=start,proto3" json:"start,omitempty"` + TypeGuid string `protobuf:"bytes,5,opt,name=type_guid,json=typeGuid,proto3" json:"type_guid,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} - proto "github.com/golang/protobuf/proto" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) +func (m *Hardware_Metadata_Instance_Storage_Disk_Partition) Reset() { + *m = Hardware_Metadata_Instance_Storage_Disk_Partition{} +} +func (m *Hardware_Metadata_Instance_Storage_Disk_Partition) String() string { + return proto.CompactTextString(m) +} +func (*Hardware_Metadata_Instance_Storage_Disk_Partition) ProtoMessage() {} +func (*Hardware_Metadata_Instance_Storage_Disk_Partition) Descriptor() ([]byte, []int) { + return fileDescriptor_61ac56d7fc2e671f, []int{3, 3, 1, 2, 0, 0} +} -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf +func (m *Hardware_Metadata_Instance_Storage_Disk_Partition) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Hardware_Metadata_Instance_Storage_Disk_Partition.Unmarshal(m, b) +} +func (m *Hardware_Metadata_Instance_Storage_Disk_Partition) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Hardware_Metadata_Instance_Storage_Disk_Partition.Marshal(b, m, deterministic) +} +func (m *Hardware_Metadata_Instance_Storage_Disk_Partition) XXX_Merge(src proto.Message) { + xxx_messageInfo_Hardware_Metadata_Instance_Storage_Disk_Partition.Merge(m, src) +} +func (m *Hardware_Metadata_Instance_Storage_Disk_Partition) XXX_Size() int { + return xxx_messageInfo_Hardware_Metadata_Instance_Storage_Disk_Partition.Size(m) +} +func (m *Hardware_Metadata_Instance_Storage_Disk_Partition) XXX_DiscardUnknown() { + xxx_messageInfo_Hardware_Metadata_Instance_Storage_Disk_Partition.DiscardUnknown(m) +} -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package +var xxx_messageInfo_Hardware_Metadata_Instance_Storage_Disk_Partition proto.InternalMessageInfo -type PushRequest struct { - Data string `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` +func (m *Hardware_Metadata_Instance_Storage_Disk_Partition) GetLabel() string { + if m != nil { + return m.Label + } + return "" +} + +func (m *Hardware_Metadata_Instance_Storage_Disk_Partition) GetNumber() int64 { + if m != nil { + return m.Number + } + return 0 +} + +func (m *Hardware_Metadata_Instance_Storage_Disk_Partition) GetSize() int64 { + if m != nil { + return m.Size + } + return 0 +} + +func (m *Hardware_Metadata_Instance_Storage_Disk_Partition) GetStart() int64 { + if m != nil { + return m.Start + } + return 0 +} + +func (m *Hardware_Metadata_Instance_Storage_Disk_Partition) GetTypeGuid() string { + if m != nil { + return m.TypeGuid + } + return "" +} + +type Hardware_Metadata_Instance_Storage_File struct { + Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` + Contents string `protobuf:"bytes,2,opt,name=contents,proto3" json:"contents,omitempty"` + Mode int64 `protobuf:"varint,3,opt,name=mode,proto3" json:"mode,omitempty"` + Uid int64 `protobuf:"varint,4,opt,name=uid,proto3" json:"uid,omitempty"` + Gid int64 `protobuf:"varint,5,opt,name=gid,proto3" json:"gid,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } -func (m *PushRequest) Reset() { *m = PushRequest{} } -func (m *PushRequest) String() string { return proto.CompactTextString(m) } -func (*PushRequest) ProtoMessage() {} -func (*PushRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_61ac56d7fc2e671f, []int{0} +func (m *Hardware_Metadata_Instance_Storage_File) Reset() { + *m = Hardware_Metadata_Instance_Storage_File{} +} +func (m *Hardware_Metadata_Instance_Storage_File) String() string { return proto.CompactTextString(m) } +func (*Hardware_Metadata_Instance_Storage_File) ProtoMessage() {} +func (*Hardware_Metadata_Instance_Storage_File) Descriptor() ([]byte, []int) { + return fileDescriptor_61ac56d7fc2e671f, []int{3, 3, 1, 2, 1} } -func (m *PushRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PushRequest.Unmarshal(m, b) +func (m *Hardware_Metadata_Instance_Storage_File) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Hardware_Metadata_Instance_Storage_File.Unmarshal(m, b) } -func (m *PushRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PushRequest.Marshal(b, m, deterministic) +func (m *Hardware_Metadata_Instance_Storage_File) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Hardware_Metadata_Instance_Storage_File.Marshal(b, m, deterministic) } -func (m *PushRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_PushRequest.Merge(m, src) +func (m *Hardware_Metadata_Instance_Storage_File) XXX_Merge(src proto.Message) { + xxx_messageInfo_Hardware_Metadata_Instance_Storage_File.Merge(m, src) } -func (m *PushRequest) XXX_Size() int { - return xxx_messageInfo_PushRequest.Size(m) +func (m *Hardware_Metadata_Instance_Storage_File) XXX_Size() int { + return xxx_messageInfo_Hardware_Metadata_Instance_Storage_File.Size(m) } -func (m *PushRequest) XXX_DiscardUnknown() { - xxx_messageInfo_PushRequest.DiscardUnknown(m) +func (m *Hardware_Metadata_Instance_Storage_File) XXX_DiscardUnknown() { + xxx_messageInfo_Hardware_Metadata_Instance_Storage_File.DiscardUnknown(m) } -var xxx_messageInfo_PushRequest proto.InternalMessageInfo +var xxx_messageInfo_Hardware_Metadata_Instance_Storage_File proto.InternalMessageInfo -func (m *PushRequest) GetData() string { +func (m *Hardware_Metadata_Instance_Storage_File) GetPath() string { if m != nil { - return m.Data + return m.Path } return "" } -type Empty struct { +func (m *Hardware_Metadata_Instance_Storage_File) GetContents() string { + if m != nil { + return m.Contents + } + return "" +} + +func (m *Hardware_Metadata_Instance_Storage_File) GetMode() int64 { + if m != nil { + return m.Mode + } + return 0 +} + +func (m *Hardware_Metadata_Instance_Storage_File) GetUid() int64 { + if m != nil { + return m.Uid + } + return 0 +} + +func (m *Hardware_Metadata_Instance_Storage_File) GetGid() int64 { + if m != nil { + return m.Gid + } + return 0 +} + +type Hardware_Metadata_Instance_Storage_Mount struct { + Device string `protobuf:"bytes,1,opt,name=device,proto3" json:"device,omitempty"` + Format string `protobuf:"bytes,2,opt,name=format,proto3" json:"format,omitempty"` + Files []*Hardware_Metadata_Instance_Storage_File `protobuf:"bytes,3,rep,name=files,proto3" json:"files,omitempty"` + Create *Hardware_Metadata_Instance_Storage_Mount_FilesystemOptions `protobuf:"bytes,4,opt,name=create,proto3" json:"create,omitempty"` + Point string `protobuf:"bytes,5,opt,name=point,proto3" json:"point,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Hardware_Metadata_Instance_Storage_Mount) Reset() { + *m = Hardware_Metadata_Instance_Storage_Mount{} +} +func (m *Hardware_Metadata_Instance_Storage_Mount) String() string { return proto.CompactTextString(m) } +func (*Hardware_Metadata_Instance_Storage_Mount) ProtoMessage() {} +func (*Hardware_Metadata_Instance_Storage_Mount) Descriptor() ([]byte, []int) { + return fileDescriptor_61ac56d7fc2e671f, []int{3, 3, 1, 2, 2} +} + +func (m *Hardware_Metadata_Instance_Storage_Mount) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Hardware_Metadata_Instance_Storage_Mount.Unmarshal(m, b) +} +func (m *Hardware_Metadata_Instance_Storage_Mount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Hardware_Metadata_Instance_Storage_Mount.Marshal(b, m, deterministic) +} +func (m *Hardware_Metadata_Instance_Storage_Mount) XXX_Merge(src proto.Message) { + xxx_messageInfo_Hardware_Metadata_Instance_Storage_Mount.Merge(m, src) +} +func (m *Hardware_Metadata_Instance_Storage_Mount) XXX_Size() int { + return xxx_messageInfo_Hardware_Metadata_Instance_Storage_Mount.Size(m) +} +func (m *Hardware_Metadata_Instance_Storage_Mount) XXX_DiscardUnknown() { + xxx_messageInfo_Hardware_Metadata_Instance_Storage_Mount.DiscardUnknown(m) +} + +var xxx_messageInfo_Hardware_Metadata_Instance_Storage_Mount proto.InternalMessageInfo + +func (m *Hardware_Metadata_Instance_Storage_Mount) GetDevice() string { + if m != nil { + return m.Device + } + return "" +} + +func (m *Hardware_Metadata_Instance_Storage_Mount) GetFormat() string { + if m != nil { + return m.Format + } + return "" +} + +func (m *Hardware_Metadata_Instance_Storage_Mount) GetFiles() []*Hardware_Metadata_Instance_Storage_File { + if m != nil { + return m.Files + } + return nil +} + +func (m *Hardware_Metadata_Instance_Storage_Mount) GetCreate() *Hardware_Metadata_Instance_Storage_Mount_FilesystemOptions { + if m != nil { + return m.Create + } + return nil +} + +func (m *Hardware_Metadata_Instance_Storage_Mount) GetPoint() string { + if m != nil { + return m.Point + } + return "" +} + +type Hardware_Metadata_Instance_Storage_Mount_FilesystemOptions struct { + Force bool `protobuf:"varint,1,opt,name=force,proto3" json:"force,omitempty"` + Options []string `protobuf:"bytes,2,rep,name=options,proto3" json:"options,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } -func (m *Empty) Reset() { *m = Empty{} } -func (m *Empty) String() string { return proto.CompactTextString(m) } -func (*Empty) ProtoMessage() {} -func (*Empty) Descriptor() ([]byte, []int) { - return fileDescriptor_61ac56d7fc2e671f, []int{1} +func (m *Hardware_Metadata_Instance_Storage_Mount_FilesystemOptions) Reset() { + *m = Hardware_Metadata_Instance_Storage_Mount_FilesystemOptions{} +} +func (m *Hardware_Metadata_Instance_Storage_Mount_FilesystemOptions) String() string { + return proto.CompactTextString(m) +} +func (*Hardware_Metadata_Instance_Storage_Mount_FilesystemOptions) ProtoMessage() {} +func (*Hardware_Metadata_Instance_Storage_Mount_FilesystemOptions) Descriptor() ([]byte, []int) { + return fileDescriptor_61ac56d7fc2e671f, []int{3, 3, 1, 2, 2, 0} } -func (m *Empty) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Empty.Unmarshal(m, b) +func (m *Hardware_Metadata_Instance_Storage_Mount_FilesystemOptions) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Hardware_Metadata_Instance_Storage_Mount_FilesystemOptions.Unmarshal(m, b) } -func (m *Empty) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Empty.Marshal(b, m, deterministic) +func (m *Hardware_Metadata_Instance_Storage_Mount_FilesystemOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Hardware_Metadata_Instance_Storage_Mount_FilesystemOptions.Marshal(b, m, deterministic) } -func (m *Empty) XXX_Merge(src proto.Message) { - xxx_messageInfo_Empty.Merge(m, src) +func (m *Hardware_Metadata_Instance_Storage_Mount_FilesystemOptions) XXX_Merge(src proto.Message) { + xxx_messageInfo_Hardware_Metadata_Instance_Storage_Mount_FilesystemOptions.Merge(m, src) } -func (m *Empty) XXX_Size() int { - return xxx_messageInfo_Empty.Size(m) +func (m *Hardware_Metadata_Instance_Storage_Mount_FilesystemOptions) XXX_Size() int { + return xxx_messageInfo_Hardware_Metadata_Instance_Storage_Mount_FilesystemOptions.Size(m) } -func (m *Empty) XXX_DiscardUnknown() { - xxx_messageInfo_Empty.DiscardUnknown(m) +func (m *Hardware_Metadata_Instance_Storage_Mount_FilesystemOptions) XXX_DiscardUnknown() { + xxx_messageInfo_Hardware_Metadata_Instance_Storage_Mount_FilesystemOptions.DiscardUnknown(m) } -var xxx_messageInfo_Empty proto.InternalMessageInfo +var xxx_messageInfo_Hardware_Metadata_Instance_Storage_Mount_FilesystemOptions proto.InternalMessageInfo -type GetRequest struct { - MAC string `protobuf:"bytes,1,opt,name=MAC,proto3" json:"MAC,omitempty"` - IP string `protobuf:"bytes,2,opt,name=IP,proto3" json:"IP,omitempty"` - ID string `protobuf:"bytes,3,opt,name=ID,proto3" json:"ID,omitempty"` +func (m *Hardware_Metadata_Instance_Storage_Mount_FilesystemOptions) GetForce() bool { + if m != nil { + return m.Force + } + return false +} + +func (m *Hardware_Metadata_Instance_Storage_Mount_FilesystemOptions) GetOptions() []string { + if m != nil { + return m.Options + } + return nil +} + +type Hardware_Metadata_Instance_Storage_Filesystem struct { + Mount *Hardware_Metadata_Instance_Storage_Mount `protobuf:"bytes,1,opt,name=mount,proto3" json:"mount,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Hardware_Metadata_Instance_Storage_Filesystem) Reset() { + *m = Hardware_Metadata_Instance_Storage_Filesystem{} +} +func (m *Hardware_Metadata_Instance_Storage_Filesystem) String() string { + return proto.CompactTextString(m) +} +func (*Hardware_Metadata_Instance_Storage_Filesystem) ProtoMessage() {} +func (*Hardware_Metadata_Instance_Storage_Filesystem) Descriptor() ([]byte, []int) { + return fileDescriptor_61ac56d7fc2e671f, []int{3, 3, 1, 2, 3} +} + +func (m *Hardware_Metadata_Instance_Storage_Filesystem) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Hardware_Metadata_Instance_Storage_Filesystem.Unmarshal(m, b) +} +func (m *Hardware_Metadata_Instance_Storage_Filesystem) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Hardware_Metadata_Instance_Storage_Filesystem.Marshal(b, m, deterministic) +} +func (m *Hardware_Metadata_Instance_Storage_Filesystem) XXX_Merge(src proto.Message) { + xxx_messageInfo_Hardware_Metadata_Instance_Storage_Filesystem.Merge(m, src) +} +func (m *Hardware_Metadata_Instance_Storage_Filesystem) XXX_Size() int { + return xxx_messageInfo_Hardware_Metadata_Instance_Storage_Filesystem.Size(m) +} +func (m *Hardware_Metadata_Instance_Storage_Filesystem) XXX_DiscardUnknown() { + xxx_messageInfo_Hardware_Metadata_Instance_Storage_Filesystem.DiscardUnknown(m) +} + +var xxx_messageInfo_Hardware_Metadata_Instance_Storage_Filesystem proto.InternalMessageInfo + +func (m *Hardware_Metadata_Instance_Storage_Filesystem) GetMount() *Hardware_Metadata_Instance_Storage_Mount { + if m != nil { + return m.Mount + } + return nil +} + +type Hardware_Metadata_Instance_Storage_RAID struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Level string `protobuf:"bytes,2,opt,name=level,proto3" json:"level,omitempty"` + Devices []string `protobuf:"bytes,3,rep,name=devices,proto3" json:"devices,omitempty"` + Spare int64 `protobuf:"varint,4,opt,name=spare,proto3" json:"spare,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } -func (m *GetRequest) Reset() { *m = GetRequest{} } -func (m *GetRequest) String() string { return proto.CompactTextString(m) } -func (*GetRequest) ProtoMessage() {} -func (*GetRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_61ac56d7fc2e671f, []int{2} +func (m *Hardware_Metadata_Instance_Storage_RAID) Reset() { + *m = Hardware_Metadata_Instance_Storage_RAID{} +} +func (m *Hardware_Metadata_Instance_Storage_RAID) String() string { return proto.CompactTextString(m) } +func (*Hardware_Metadata_Instance_Storage_RAID) ProtoMessage() {} +func (*Hardware_Metadata_Instance_Storage_RAID) Descriptor() ([]byte, []int) { + return fileDescriptor_61ac56d7fc2e671f, []int{3, 3, 1, 2, 4} } -func (m *GetRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetRequest.Unmarshal(m, b) +func (m *Hardware_Metadata_Instance_Storage_RAID) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Hardware_Metadata_Instance_Storage_RAID.Unmarshal(m, b) } -func (m *GetRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetRequest.Marshal(b, m, deterministic) +func (m *Hardware_Metadata_Instance_Storage_RAID) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Hardware_Metadata_Instance_Storage_RAID.Marshal(b, m, deterministic) } -func (m *GetRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetRequest.Merge(m, src) +func (m *Hardware_Metadata_Instance_Storage_RAID) XXX_Merge(src proto.Message) { + xxx_messageInfo_Hardware_Metadata_Instance_Storage_RAID.Merge(m, src) } -func (m *GetRequest) XXX_Size() int { - return xxx_messageInfo_GetRequest.Size(m) +func (m *Hardware_Metadata_Instance_Storage_RAID) XXX_Size() int { + return xxx_messageInfo_Hardware_Metadata_Instance_Storage_RAID.Size(m) } -func (m *GetRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetRequest.DiscardUnknown(m) +func (m *Hardware_Metadata_Instance_Storage_RAID) XXX_DiscardUnknown() { + xxx_messageInfo_Hardware_Metadata_Instance_Storage_RAID.DiscardUnknown(m) } -var xxx_messageInfo_GetRequest proto.InternalMessageInfo +var xxx_messageInfo_Hardware_Metadata_Instance_Storage_RAID proto.InternalMessageInfo -func (m *GetRequest) GetMAC() string { +func (m *Hardware_Metadata_Instance_Storage_RAID) GetName() string { if m != nil { - return m.MAC + return m.Name } return "" } -func (m *GetRequest) GetIP() string { +func (m *Hardware_Metadata_Instance_Storage_RAID) GetLevel() string { if m != nil { - return m.IP + return m.Level } return "" } -func (m *GetRequest) GetID() string { +func (m *Hardware_Metadata_Instance_Storage_RAID) GetDevices() []string { if m != nil { - return m.ID + return m.Devices } - return "" + return nil } -type Hardware struct { - JSON string `protobuf:"bytes,1,opt,name=JSON,proto3" json:"JSON,omitempty"` +func (m *Hardware_Metadata_Instance_Storage_RAID) GetSpare() int64 { + if m != nil { + return m.Spare + } + return 0 +} + +type Hardware_Metadata_Custom struct { + PreinstalledOperatingSystemVersion *Hardware_Metadata_Instance_OperatingSystem `protobuf:"bytes,1,opt,name=preinstalled_operating_system_version,json=preinstalledOperatingSystemVersion,proto3" json:"preinstalled_operating_system_version,omitempty"` + PrivateSubnets []string `protobuf:"bytes,2,rep,name=private_subnets,json=privateSubnets,proto3" json:"private_subnets,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Hardware_Metadata_Custom) Reset() { *m = Hardware_Metadata_Custom{} } +func (m *Hardware_Metadata_Custom) String() string { return proto.CompactTextString(m) } +func (*Hardware_Metadata_Custom) ProtoMessage() {} +func (*Hardware_Metadata_Custom) Descriptor() ([]byte, []int) { + return fileDescriptor_61ac56d7fc2e671f, []int{3, 3, 2} +} + +func (m *Hardware_Metadata_Custom) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Hardware_Metadata_Custom.Unmarshal(m, b) +} +func (m *Hardware_Metadata_Custom) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Hardware_Metadata_Custom.Marshal(b, m, deterministic) +} +func (m *Hardware_Metadata_Custom) XXX_Merge(src proto.Message) { + xxx_messageInfo_Hardware_Metadata_Custom.Merge(m, src) +} +func (m *Hardware_Metadata_Custom) XXX_Size() int { + return xxx_messageInfo_Hardware_Metadata_Custom.Size(m) +} +func (m *Hardware_Metadata_Custom) XXX_DiscardUnknown() { + xxx_messageInfo_Hardware_Metadata_Custom.DiscardUnknown(m) +} + +var xxx_messageInfo_Hardware_Metadata_Custom proto.InternalMessageInfo + +func (m *Hardware_Metadata_Custom) GetPreinstalledOperatingSystemVersion() *Hardware_Metadata_Instance_OperatingSystem { + if m != nil { + return m.PreinstalledOperatingSystemVersion + } + return nil +} + +func (m *Hardware_Metadata_Custom) GetPrivateSubnets() []string { + if m != nil { + return m.PrivateSubnets + } + return nil +} + +type Hardware_Metadata_Facility struct { + PlanSlug string `protobuf:"bytes,1,opt,name=plan_slug,json=planSlug,proto3" json:"plan_slug,omitempty"` + PlanVersionSlug string `protobuf:"bytes,2,opt,name=plan_version_slug,json=planVersionSlug,proto3" json:"plan_version_slug,omitempty"` + FacilityCode string `protobuf:"bytes,3,opt,name=facility_code,json=facilityCode,proto3" json:"facility_code,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } -func (m *Hardware) Reset() { *m = Hardware{} } -func (m *Hardware) String() string { return proto.CompactTextString(m) } -func (*Hardware) ProtoMessage() {} -func (*Hardware) Descriptor() ([]byte, []int) { - return fileDescriptor_61ac56d7fc2e671f, []int{3} +func (m *Hardware_Metadata_Facility) Reset() { *m = Hardware_Metadata_Facility{} } +func (m *Hardware_Metadata_Facility) String() string { return proto.CompactTextString(m) } +func (*Hardware_Metadata_Facility) ProtoMessage() {} +func (*Hardware_Metadata_Facility) Descriptor() ([]byte, []int) { + return fileDescriptor_61ac56d7fc2e671f, []int{3, 3, 3} } -func (m *Hardware) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Hardware.Unmarshal(m, b) +func (m *Hardware_Metadata_Facility) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Hardware_Metadata_Facility.Unmarshal(m, b) } -func (m *Hardware) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Hardware.Marshal(b, m, deterministic) +func (m *Hardware_Metadata_Facility) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Hardware_Metadata_Facility.Marshal(b, m, deterministic) } -func (m *Hardware) XXX_Merge(src proto.Message) { - xxx_messageInfo_Hardware.Merge(m, src) +func (m *Hardware_Metadata_Facility) XXX_Merge(src proto.Message) { + xxx_messageInfo_Hardware_Metadata_Facility.Merge(m, src) } -func (m *Hardware) XXX_Size() int { - return xxx_messageInfo_Hardware.Size(m) +func (m *Hardware_Metadata_Facility) XXX_Size() int { + return xxx_messageInfo_Hardware_Metadata_Facility.Size(m) } -func (m *Hardware) XXX_DiscardUnknown() { - xxx_messageInfo_Hardware.DiscardUnknown(m) +func (m *Hardware_Metadata_Facility) XXX_DiscardUnknown() { + xxx_messageInfo_Hardware_Metadata_Facility.DiscardUnknown(m) } -var xxx_messageInfo_Hardware proto.InternalMessageInfo +var xxx_messageInfo_Hardware_Metadata_Facility proto.InternalMessageInfo + +func (m *Hardware_Metadata_Facility) GetPlanSlug() string { + if m != nil { + return m.PlanSlug + } + return "" +} + +func (m *Hardware_Metadata_Facility) GetPlanVersionSlug() string { + if m != nil { + return m.PlanVersionSlug + } + return "" +} -func (m *Hardware) GetJSON() string { +func (m *Hardware_Metadata_Facility) GetFacilityCode() string { if m != nil { - return m.JSON + return m.FacilityCode } return "" } @@ -233,43 +1834,174 @@ func init() { proto.RegisterType((*Empty)(nil), "github.com.tinkerbell.tink.protos.hardware.Empty") proto.RegisterType((*GetRequest)(nil), "github.com.tinkerbell.tink.protos.hardware.GetRequest") proto.RegisterType((*Hardware)(nil), "github.com.tinkerbell.tink.protos.hardware.Hardware") + proto.RegisterType((*Hardware_DHCP)(nil), "github.com.tinkerbell.tink.protos.hardware.Hardware.DHCP") + proto.RegisterType((*Hardware_DHCP_IP)(nil), "github.com.tinkerbell.tink.protos.hardware.Hardware.DHCP.IP") + proto.RegisterType((*Hardware_Netboot)(nil), "github.com.tinkerbell.tink.protos.hardware.Hardware.Netboot") + proto.RegisterType((*Hardware_Netboot_IPXE)(nil), "github.com.tinkerbell.tink.protos.hardware.Hardware.Netboot.IPXE") + proto.RegisterType((*Hardware_Netboot_Bootstrapper)(nil), "github.com.tinkerbell.tink.protos.hardware.Hardware.Netboot.Bootstrapper") + proto.RegisterType((*Hardware_Netboot_Osie)(nil), "github.com.tinkerbell.tink.protos.hardware.Hardware.Netboot.Osie") + proto.RegisterType((*Hardware_Network)(nil), "github.com.tinkerbell.tink.protos.hardware.Hardware.Network") + proto.RegisterType((*Hardware_Network_Interface)(nil), "github.com.tinkerbell.tink.protos.hardware.Hardware.Network.Interface") + proto.RegisterType((*Hardware_Metadata)(nil), "github.com.tinkerbell.tink.protos.hardware.Hardware.Metadata") + proto.RegisterType((*Hardware_Metadata_Manufacturer)(nil), "github.com.tinkerbell.tink.protos.hardware.Hardware.Metadata.Manufacturer") + proto.RegisterType((*Hardware_Metadata_Instance)(nil), "github.com.tinkerbell.tink.protos.hardware.Hardware.Metadata.Instance") + proto.RegisterType((*Hardware_Metadata_Instance_OperatingSystem)(nil), "github.com.tinkerbell.tink.protos.hardware.Hardware.Metadata.Instance.OperatingSystem") + proto.RegisterType((*Hardware_Metadata_Instance_IP)(nil), "github.com.tinkerbell.tink.protos.hardware.Hardware.Metadata.Instance.IP") + proto.RegisterType((*Hardware_Metadata_Instance_Storage)(nil), "github.com.tinkerbell.tink.protos.hardware.Hardware.Metadata.Instance.Storage") + proto.RegisterType((*Hardware_Metadata_Instance_Storage_Disk)(nil), "github.com.tinkerbell.tink.protos.hardware.Hardware.Metadata.Instance.Storage.Disk") + proto.RegisterType((*Hardware_Metadata_Instance_Storage_Disk_Partition)(nil), "github.com.tinkerbell.tink.protos.hardware.Hardware.Metadata.Instance.Storage.Disk.Partition") + proto.RegisterType((*Hardware_Metadata_Instance_Storage_File)(nil), "github.com.tinkerbell.tink.protos.hardware.Hardware.Metadata.Instance.Storage.File") + proto.RegisterType((*Hardware_Metadata_Instance_Storage_Mount)(nil), "github.com.tinkerbell.tink.protos.hardware.Hardware.Metadata.Instance.Storage.Mount") + proto.RegisterType((*Hardware_Metadata_Instance_Storage_Mount_FilesystemOptions)(nil), "github.com.tinkerbell.tink.protos.hardware.Hardware.Metadata.Instance.Storage.Mount.FilesystemOptions") + proto.RegisterType((*Hardware_Metadata_Instance_Storage_Filesystem)(nil), "github.com.tinkerbell.tink.protos.hardware.Hardware.Metadata.Instance.Storage.Filesystem") + proto.RegisterType((*Hardware_Metadata_Instance_Storage_RAID)(nil), "github.com.tinkerbell.tink.protos.hardware.Hardware.Metadata.Instance.Storage.RAID") + proto.RegisterType((*Hardware_Metadata_Custom)(nil), "github.com.tinkerbell.tink.protos.hardware.Hardware.Metadata.Custom") + proto.RegisterType((*Hardware_Metadata_Facility)(nil), "github.com.tinkerbell.tink.protos.hardware.Hardware.Metadata.Facility") proto.RegisterType((*DeleteRequest)(nil), "github.com.tinkerbell.tink.protos.hardware.DeleteRequest") } -func init() { proto.RegisterFile("hardware/hardware.proto", fileDescriptor_61ac56d7fc2e671f) } +func init() { + proto.RegisterFile("hardware/hardware.proto", fileDescriptor_61ac56d7fc2e671f) +} var fileDescriptor_61ac56d7fc2e671f = []byte{ - // 326 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x93, 0x4b, 0x4f, 0x83, 0x40, - 0x14, 0x85, 0x43, 0x0b, 0xb4, 0x5e, 0xe3, 0x23, 0xb3, 0x91, 0x74, 0xe1, 0x83, 0x95, 0x71, 0x31, - 0xd6, 0x47, 0x34, 0x6e, 0x4c, 0x8a, 0x18, 0xc5, 0x44, 0x25, 0xed, 0xc2, 0xc4, 0x1d, 0xd0, 0x49, - 0x21, 0x52, 0xc0, 0x61, 0x68, 0xc3, 0x6f, 0xf3, 0xcf, 0x99, 0x19, 0x18, 0x1f, 0x3b, 0x61, 0x51, - 0x77, 0x67, 0x26, 0xf7, 0xde, 0x2f, 0xe7, 0xcc, 0x5c, 0xd8, 0x09, 0x3d, 0x3a, 0x5d, 0x7a, 0x94, - 0x1c, 0x4b, 0x81, 0x33, 0x9a, 0xb2, 0x14, 0x1d, 0xcd, 0x22, 0x16, 0x16, 0x3e, 0x0e, 0xd2, 0x39, - 0x66, 0x51, 0xf2, 0x46, 0xa8, 0x4f, 0xe2, 0x58, 0xc8, 0xaa, 0x22, 0xc7, 0xb2, 0xc3, 0x3c, 0x80, - 0x75, 0xb7, 0xc8, 0xc3, 0x31, 0x79, 0x2f, 0x48, 0xce, 0x10, 0x02, 0x75, 0xea, 0x31, 0xcf, 0x50, - 0xf6, 0x95, 0xc3, 0xb5, 0xb1, 0xd0, 0x66, 0x0f, 0xb4, 0xdb, 0x79, 0xc6, 0x4a, 0xf3, 0x1a, 0x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x00, 0x00, + // 2017 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0x5b, 0x8f, 0x1c, 0x47, + 0x15, 0x56, 0xcf, 0x65, 0x67, 0xe6, 0xcc, 0x5e, 0xec, 0xf2, 0x6d, 0xd2, 0x01, 0x62, 0x36, 0x0a, + 0x18, 0x23, 0x8d, 0xe3, 0x25, 0x02, 0x81, 0x00, 0xc9, 0xf6, 0xfa, 0x32, 0x21, 0xeb, 0x1d, 0x6a, + 0x1c, 0x9b, 0x70, 0x6b, 0x6a, 0xba, 0x6b, 0x66, 0x2a, 0xdb, 0xd3, 0xdd, 0xe9, 0xaa, 0xde, 0xf5, + 0x10, 0x25, 0x42, 0x3c, 0xf0, 0x82, 0x10, 0x11, 0xf0, 0x0b, 0x78, 0xe3, 0x95, 0x3f, 0xc0, 0x4f, + 0xe0, 0x21, 0xcf, 0xbc, 0x20, 0x2e, 0xbf, 0x80, 0x47, 0x24, 0x74, 0xea, 0xd2, 0xdb, 0x6b, 0x27, + 0x11, 0xbb, 0xb3, 0xeb, 0xb7, 0x3a, 0x5f, 0x57, 0x7f, 0xe7, 0x9c, 0x3a, 0xe7, 0xd4, 0x39, 0xdd, + 0x70, 0x65, 0xc6, 0xf2, 0xe8, 0x80, 0xe5, 0xfc, 0x86, 0x5b, 0xf4, 0xb3, 0x3c, 0x55, 0x29, 0xb9, + 0x3e, 0x15, 0x6a, 0x56, 0x8c, 0xfb, 0x61, 0x3a, 0xef, 0x2b, 0x91, 0xec, 0xf1, 0x7c, 0xcc, 0xe3, + 0x58, 0x2f, 0xcd, 0x0e, 0xd9, 0x77, 0x6f, 0xf8, 0x9f, 0x9b, 0xa6, 0xe9, 0x34, 0xe6, 0x37, 0x58, + 0x26, 0x6e, 0xb0, 0x24, 0x49, 0x15, 0x53, 0x22, 0x4d, 0xa4, 0xd9, 0xb7, 0xf9, 0x04, 0xba, 0xc3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8, 0x61, 0xdb, 0x21, 0xe3, 0x15, + 0xbd, 0xe5, 0x6b, 0xff, 0x0b, 0x00, 0x00, 0xff, 0xff, 0x64, 0x79, 0xa2, 0x8c, 0x08, 0x1b, 0x00, + 0x00, } // Reference imports to suppress errors if they are not otherwise used. var _ context.Context -var _ grpc.ClientConn +var _ grpc.ClientConnInterface // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 +const _ = grpc.SupportPackageIsVersion6 // HardwareServiceClient is the client API for HardwareService service. // @@ -280,16 +2012,15 @@ type HardwareServiceClient interface { ByIP(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*Hardware, error) ByID(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*Hardware, error) All(ctx context.Context, in *Empty, opts ...grpc.CallOption) (HardwareService_AllClient, error) - Ingest(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) Watch(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (HardwareService_WatchClient, error) Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*Empty, error) } type hardwareServiceClient struct { - cc *grpc.ClientConn + cc grpc.ClientConnInterface } -func NewHardwareServiceClient(cc *grpc.ClientConn) HardwareServiceClient { +func NewHardwareServiceClient(cc grpc.ClientConnInterface) HardwareServiceClient { return &hardwareServiceClient{cc} } @@ -361,15 +2092,6 @@ func (x *hardwareServiceAllClient) Recv() (*Hardware, error) { return m, nil } -func (c *hardwareServiceClient) Ingest(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) { - out := new(Empty) - err := c.cc.Invoke(ctx, "/github.com.tinkerbell.tink.protos.hardware.HardwareService/Ingest", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *hardwareServiceClient) Watch(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (HardwareService_WatchClient, error) { stream, err := c.cc.NewStream(ctx, &_HardwareService_serviceDesc.Streams[1], "/github.com.tinkerbell.tink.protos.hardware.HardwareService/Watch", opts...) if err != nil { @@ -418,7 +2140,6 @@ type HardwareServiceServer interface { ByIP(context.Context, *GetRequest) (*Hardware, error) ByID(context.Context, *GetRequest) (*Hardware, error) All(*Empty, HardwareService_AllServer) error - Ingest(context.Context, *Empty) (*Empty, error) Watch(*GetRequest, HardwareService_WatchServer) error Delete(context.Context, *DeleteRequest) (*Empty, error) } @@ -442,9 +2163,6 @@ func (*UnimplementedHardwareServiceServer) ByID(ctx context.Context, req *GetReq func (*UnimplementedHardwareServiceServer) All(req *Empty, srv HardwareService_AllServer) error { return status.Errorf(codes.Unimplemented, "method All not implemented") } -func (*UnimplementedHardwareServiceServer) Ingest(ctx context.Context, req *Empty) (*Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method Ingest not implemented") -} func (*UnimplementedHardwareServiceServer) Watch(req *GetRequest, srv HardwareService_WatchServer) error { return status.Errorf(codes.Unimplemented, "method Watch not implemented") } @@ -549,24 +2267,6 @@ func (x *hardwareServiceAllServer) Send(m *Hardware) error { return x.ServerStream.SendMsg(m) } -func _HardwareService_Ingest_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(Empty) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(HardwareServiceServer).Ingest(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/github.com.tinkerbell.tink.protos.hardware.HardwareService/Ingest", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(HardwareServiceServer).Ingest(ctx, req.(*Empty)) - } - return interceptor(ctx, in, info, handler) -} - func _HardwareService_Watch_Handler(srv interface{}, stream grpc.ServerStream) error { m := new(GetRequest) if err := stream.RecvMsg(m); err != nil { @@ -626,10 +2326,6 @@ var _HardwareService_serviceDesc = grpc.ServiceDesc{ MethodName: "ByID", Handler: _HardwareService_ByID_Handler, }, - { - MethodName: "Ingest", - Handler: _HardwareService_Ingest_Handler, - }, { MethodName: "Delete", Handler: _HardwareService_Delete_Handler, diff --git a/protos/hardware/hardware.pb.gw.go b/protos/hardware/hardware.pb.gw.go new file mode 100644 index 000000000..3cdc2d7fc --- /dev/null +++ b/protos/hardware/hardware.pb.gw.go @@ -0,0 +1,480 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: hardware/hardware.proto + +/* +Package hardware is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package hardware + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage + +func request_HardwareService_Push_0(ctx context.Context, marshaler runtime.Marshaler, client HardwareServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq PushRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.Push(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_HardwareService_Push_0(ctx context.Context, marshaler runtime.Marshaler, server HardwareServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq PushRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.Push(ctx, &protoReq) + return msg, metadata, err + +} + +func request_HardwareService_ByMAC_0(ctx context.Context, marshaler runtime.Marshaler, client HardwareServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ByMAC(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_HardwareService_ByMAC_0(ctx context.Context, marshaler runtime.Marshaler, server HardwareServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ByMAC(ctx, &protoReq) + return msg, metadata, err + +} + +func request_HardwareService_ByIP_0(ctx context.Context, marshaler runtime.Marshaler, client HardwareServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ByIP(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_HardwareService_ByIP_0(ctx context.Context, marshaler runtime.Marshaler, server HardwareServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ByIP(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_HardwareService_ByID_0 = &utilities.DoubleArray{Encoding: map[string]int{"id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_HardwareService_ByID_0(ctx context.Context, marshaler runtime.Marshaler, client HardwareServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_HardwareService_ByID_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ByID(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_HardwareService_ByID_0(ctx context.Context, marshaler runtime.Marshaler, server HardwareServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_HardwareService_ByID_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ByID(ctx, &protoReq) + return msg, metadata, err + +} + +func request_HardwareService_All_0(ctx context.Context, marshaler runtime.Marshaler, client HardwareServiceClient, req *http.Request, pathParams map[string]string) (HardwareService_AllClient, runtime.ServerMetadata, error) { + var protoReq Empty + var metadata runtime.ServerMetadata + + stream, err := client.All(ctx, &protoReq) + if err != nil { + return nil, metadata, err + } + header, err := stream.Header() + if err != nil { + return nil, metadata, err + } + metadata.HeaderMD = header + return stream, metadata, nil + +} + +// RegisterHardwareServiceHandlerServer registers the http handlers for service HardwareService to "mux". +// UnaryRPC :call HardwareServiceServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +func RegisterHardwareServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server HardwareServiceServer) error { + + mux.Handle("POST", pattern_HardwareService_Push_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_HardwareService_Push_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_HardwareService_Push_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_HardwareService_ByMAC_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_HardwareService_ByMAC_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_HardwareService_ByMAC_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_HardwareService_ByIP_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_HardwareService_ByIP_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_HardwareService_ByIP_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_HardwareService_ByID_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_HardwareService_ByID_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_HardwareService_ByID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_HardwareService_All_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + err := status.Error(codes.Unimplemented, "streaming calls are not yet supported in the in-process transport") + _, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + }) + + return nil +} + +// RegisterHardwareServiceHandlerFromEndpoint is same as RegisterHardwareServiceHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterHardwareServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterHardwareServiceHandler(ctx, mux, conn) +} + +// RegisterHardwareServiceHandler registers the http handlers for service HardwareService to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterHardwareServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterHardwareServiceHandlerClient(ctx, mux, NewHardwareServiceClient(conn)) +} + +// RegisterHardwareServiceHandlerClient registers the http handlers for service HardwareService +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "HardwareServiceClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "HardwareServiceClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "HardwareServiceClient" to call the correct interceptors. +func RegisterHardwareServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client HardwareServiceClient) error { + + mux.Handle("POST", pattern_HardwareService_Push_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_HardwareService_Push_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_HardwareService_Push_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_HardwareService_ByMAC_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_HardwareService_ByMAC_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_HardwareService_ByMAC_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_HardwareService_ByIP_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_HardwareService_ByIP_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_HardwareService_ByIP_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_HardwareService_ByID_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_HardwareService_ByID_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_HardwareService_ByID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_HardwareService_All_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_HardwareService_All_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_HardwareService_All_0(ctx, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_HardwareService_Push_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "hardware"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_HardwareService_ByMAC_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "hardware", "mac"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_HardwareService_ByIP_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "hardware", "ip"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_HardwareService_ByID_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"v1", "hardware", "id"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_HardwareService_All_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "hardware"}, "", runtime.AssumeColonVerbOpt(true))) +) + +var ( + forward_HardwareService_Push_0 = runtime.ForwardResponseMessage + + forward_HardwareService_ByMAC_0 = runtime.ForwardResponseMessage + + forward_HardwareService_ByIP_0 = runtime.ForwardResponseMessage + + forward_HardwareService_ByID_0 = runtime.ForwardResponseMessage + + forward_HardwareService_All_0 = runtime.ForwardResponseStream +) diff --git a/protos/hardware/hardware.proto b/protos/hardware/hardware.proto index d8c63076f..f94301492 100644 --- a/protos/hardware/hardware.proto +++ b/protos/hardware/hardware.proto @@ -4,32 +4,224 @@ option go_package = "hardware"; package github.com.tinkerbell.tink.protos.hardware; +import "google/api/annotations.proto"; + service HardwareService { - rpc Push (PushRequest) returns (Empty); - rpc ByMAC(GetRequest) returns (Hardware); - rpc ByIP(GetRequest) returns (Hardware); - rpc ByID(GetRequest) returns (Hardware); - rpc All(Empty) returns (stream Hardware); - rpc Ingest(Empty) returns (Empty); + rpc Push (PushRequest) returns (Empty) { + option (google.api.http) = { + post: "/v1/hardware" + body: "*" + }; + }; + rpc ByMAC(GetRequest) returns (Hardware) { + option (google.api.http) = { + post: "/v1/hardware/mac" + body: "*" + }; + }; + rpc ByIP(GetRequest) returns (Hardware) { + option (google.api.http) = { + post: "/v1/hardware/ip" + body: "*" + }; + }; + rpc ByID(GetRequest) returns (Hardware) { + option (google.api.http) = { + get: "/v1/hardware/{id}" + }; + }; + rpc All(Empty) returns (stream Hardware) { + option (google.api.http) = { + get: "/v1/hardware" + }; + }; rpc Watch(GetRequest) returns (stream Hardware); rpc Delete(DeleteRequest) returns (Empty); } message PushRequest { - string data = 1; + Hardware data = 1; } message Empty { } message GetRequest { - string MAC = 1; - string IP = 2; - string ID = 3; + string mac = 1; + string ip = 2; + string id = 3; } message Hardware { - string JSON = 1; + message DHCP { + message IP { + string address = 1; + string netmask = 2; + string gateway = 3; + int64 family = 4; + } + string mac = 1; + string OBSOLETE_ip = 2; // obsolete + string hostname = 3; + int64 lease_time = 4; + repeated string name_servers = 5; + repeated string time_servers = 6; + string OBSOLETE_gateway = 7; // obsolete + string arch = 8; + bool uefi = 9; + string iface_name = 10; + IP ip = 11; + } + message Netboot { + message IPXE { + string url = 1; + string contents = 2; + } + message Bootstrapper { // obsolete + } + message Osie { + string base_url = 1; + string kernel = 2; + string initrd = 3; + } + + bool allow_pxe = 1; + bool allow_workflow = 2; + IPXE ipxe = 3; + Bootstrapper OBSOLETE_bootstrapper = 4; // obsolete + Osie osie = 5; + } + message Network { + message Interface { + DHCP dhcp = 1; + Netboot netboot = 2; + } + DHCP OBSOLETE_dhcp = 1; // obsolete + Netboot OBSOLETE_netboot = 2; // obsolete + repeated Interface interfaces = 3; + Interface OBSOLETE_default = 4; // obsolete + } + message Metadata { + message Manufacturer { + string id = 1; + string slug = 2; + } + message Instance { + message OperatingSystem { + string slug = 1; + string distro = 2; + string version = 3; + string image_tag = 4; + string os_slug = 5; + } + message IP { + string address = 1; + string netmask = 2; + string gateway = 3; + int64 family = 4; + bool public = 5; + bool management = 6; + } + message Storage { + message Disk { + message Partition { + string label = 1; + int64 number = 2; + int64 size = 3; + int64 start = 4; + string type_guid = 5; + } + + string device = 1; + bool wipe_table = 2; + repeated Partition partitions = 3; + } + + message File { + string path = 1; + string contents = 2; + int64 mode = 3; + int64 uid = 4; + int64 gid = 5; + } + + message Mount { + message FilesystemOptions { + bool force = 1; + repeated string options = 2; + } + + string device = 1; + string format = 2; + repeated File files = 3; + FilesystemOptions create = 4; + string point = 5; + } + + message Filesystem { + Mount mount = 1; + } + + message RAID { + string name = 1; + string level = 2; + repeated string devices = 3; + int64 spare = 4; + } + + repeated string OBSOLETE_disks = 1; // obsolete + repeated string OBSOLETE_raid = 2; // obsolete + repeated string OBSOLETE_filesystems = 3; // obsolete + repeated Disk disks = 4; + repeated RAID raid = 5; + repeated Filesystem filesystems = 6; + } + + string id = 1; + string state = 2; + string hostname = 3; + bool allow_pxe = 4; + bool rescue = 5; + + OperatingSystem operating_system_version = 6; + bool always_pxe = 7; + string ipxe_script_url = 8; + repeated IP ips = 9; + string userdata = 10; + + string crypted_root_password = 11; + + repeated string tags = 12; + Storage storage = 13; + repeated string ssh_keys = 14; + bool network_ready = 15; + } + message Custom { + Instance.OperatingSystem preinstalled_operating_system_version = 1; + repeated string private_subnets = 2; + } + message Facility { + string plan_slug = 1; + string plan_version_slug = 2; + string facility_code = 3; + } + + string state = 1; + int64 bonding_mode = 2; + Manufacturer manufacturer = 3; + Instance instance = 4; + Custom custom = 5; + Facility facility = 6; + } + + string OBSOLETE_JSON = 1; // obsolete + DHCP OBSOLETE_dhcp = 2; // obsolete + Netboot OBSOLETE_netboot = 3; //obsolete + repeated Network OBSOLETE_network = 4; // obsolete + Metadata metadata = 5; + Network network = 6; + string id = 7; + int64 version = 8; } message DeleteRequest { diff --git a/protos/protoc.sh b/protos/protoc.sh index fa8429298..fbb702a46 100755 --- a/protos/protoc.sh +++ b/protos/protoc.sh @@ -4,5 +4,5 @@ set -e for proto in hardware template workflow; do echo "Generating ${proto}.pb.go..." - protoc -I ./ -I ./common/ "${proto}/${proto}.proto" --go_out=plugins=grpc:./ + protoc -I ./ -I ./common/ -I "$GOPATH"/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis "${proto}/${proto}.proto" --go_out=plugins=grpc:./ --grpc-gateway_out=logtostderr=true:. done diff --git a/protos/template/template.pb.go b/protos/template/template.pb.go index 20f4fa3ed..fb2104150 100644 --- a/protos/template/template.pb.go +++ b/protos/template/template.pb.go @@ -10,6 +10,7 @@ import ( proto "github.com/golang/protobuf/proto" timestamp "github.com/golang/protobuf/ptypes/timestamp" + _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -60,10 +61,11 @@ var xxx_messageInfo_Empty proto.InternalMessageInfo type WorkflowTemplate struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` + OBSOLETEData []byte `protobuf:"bytes,3,opt,name=OBSOLETE_data,json=OBSOLETEData,proto3" json:"OBSOLETE_data,omitempty"` CreatedAt *timestamp.Timestamp `protobuf:"bytes,4,opt,name=createdAt,proto3" json:"createdAt,omitempty"` UpdatedAt *timestamp.Timestamp `protobuf:"bytes,5,opt,name=updatedAt,proto3" json:"updatedAt,omitempty"` DeletedAt *timestamp.Timestamp `protobuf:"bytes,6,opt,name=deletedAt,proto3" json:"deletedAt,omitempty"` + Data string `protobuf:"bytes,7,opt,name=data,proto3" json:"data,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -108,9 +110,9 @@ func (m *WorkflowTemplate) GetName() string { return "" } -func (m *WorkflowTemplate) GetData() []byte { +func (m *WorkflowTemplate) GetOBSOLETEData() []byte { if m != nil { - return m.Data + return m.OBSOLETEData } return nil } @@ -136,6 +138,13 @@ func (m *WorkflowTemplate) GetDeletedAt() *timestamp.Timestamp { return nil } +func (m *WorkflowTemplate) GetData() string { + if m != nil { + return m.Data + } + return "" +} + type CreateResponse struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` @@ -221,42 +230,50 @@ func init() { proto.RegisterType((*GetRequest)(nil), "github.com.tinkerbell.tink.protos.template.GetRequest") } -func init() { proto.RegisterFile("template/template.proto", fileDescriptor_dca67df6b60706ce) } +func init() { + proto.RegisterFile("template/template.proto", fileDescriptor_dca67df6b60706ce) +} var fileDescriptor_dca67df6b60706ce = []byte{ - // 353 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x92, 0x4f, 0x4b, 0xf3, 0x40, - 0x10, 0xc6, 0xd9, 0xbe, 0x6d, 0xdf, 0x76, 0xaa, 0x51, 0xf6, 0x62, 0x08, 0x1e, 0x42, 0x4e, 0xc5, - 0xc3, 0xaa, 0x15, 0x44, 0xc4, 0x8b, 0xff, 0xe8, 0xc5, 0x53, 0xa8, 0x08, 0xde, 0x92, 0x66, 0x5a, - 0x43, 0x93, 0x6e, 0xcc, 0x4e, 0x10, 0xf1, 0xa4, 0xde, 0xfc, 0x1a, 0x7e, 0x49, 0x8f, 0xd2, 0x6d, - 0x93, 0x42, 0x3d, 0xd4, 0x10, 0x6f, 0xc3, 0xec, 0xf3, 0x1b, 0x9e, 0x67, 0x76, 0x60, 0x87, 0x30, - 0x4e, 0x22, 0x8f, 0x70, 0x3f, 0x2f, 0x44, 0x92, 0x4a, 0x92, 0x7c, 0x6f, 0x1c, 0xd2, 0x43, 0xe6, - 0x8b, 0xa1, 0x8c, 0x05, 0x85, 0xd3, 0x09, 0xa6, 0x3e, 0x46, 0x91, 0x2e, 0xe7, 0x0a, 0x25, 0x72, - 0xc2, 0xda, 0xa2, 0x30, 0x46, 0x45, 0x5e, 0x9c, 0xcc, 0x9f, 0x9c, 0xff, 0xd0, 0x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79, 0x13, 0xaa, 0x62, 0x07, 0x8a, 0x97, 0x1f, 0x52, 0x2d, 0xff, 0x01, 0xe3, 0xaf, - 0x0c, 0x8c, 0x5b, 0x7d, 0xa9, 0x7f, 0x74, 0x14, 0xe5, 0x33, 0x5c, 0xc0, 0x7d, 0x2b, 0xef, 0xf8, - 0x4d, 0x2d, 0x39, 0xfa, 0x0e, 0x00, 0x00, 0xff, 0xff, 0x72, 0xba, 0x4c, 0x77, 0x54, 0x04, 0x00, - 0x00, + // 452 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x93, 0x41, 0x6b, 0xd4, 0x40, + 0x14, 0xc7, 0x99, 0xd8, 0x6e, 0xdb, 0xd7, 0xee, 0x56, 0x06, 0xc5, 0x10, 0x7a, 0x58, 0xe2, 0x65, + 0xd9, 0xc3, 0xc4, 0x56, 0x10, 0x29, 0x5e, 0xac, 0x5d, 0x7a, 0x29, 0x14, 0xe2, 0x8a, 0xe0, 0x45, + 0x66, 0x9b, 0xd7, 0x75, 0x68, 0x92, 0x89, 0x3b, 0x2f, 0x8a, 0x88, 0x07, 0xbd, 0x7b, 0xf2, 0x20, + 0x1e, 0xc4, 0x8b, 0xdf, 0xc8, 0xaf, 0xe0, 0x07, 0x91, 0xcc, 0x6c, 0x52, 0xb6, 0x0a, 0x35, 0x6c, + 0x6f, 0x8f, 0x97, 0xff, 0x3f, 0xf3, 0xfb, 0xbf, 0x37, 0x03, 0x77, 0x08, 0xb3, 0x22, 0x95, 0x84, + 0x51, 0x5d, 0x88, 0x62, 0xa6, 0x49, 0xf3, 0xe1, 0x54, 0xd1, 0xab, 0x72, 0x22, 0x4e, 0x75, 0x26, + 0x48, 0xe5, 0xe7, 0x38, 0x9b, 0x60, 0x9a, 0xda, 0xd2, 0x29, 0x8c, 0xa8, 0x1d, 0xc1, 0xce, 0x54, + 0xeb, 0x69, 0x8a, 0x91, 0x2c, 0x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, 0x12, 0xff, 0xbf, 0x64, + 0x71, 0x79, 0x51, 0xc1, 0x7e, 0x1b, 0xf7, 0x62, 0x8e, 0xd0, 0xff, 0xf4, 0xeb, 0xf7, 0x17, 0x8f, + 0x87, 0xdd, 0xe8, 0xcd, 0x6e, 0x73, 0xf3, 0xcc, 0x3e, 0x1b, 0xf2, 0x1f, 0x0c, 0x36, 0x8f, 0x90, + 0x1a, 0xc6, 0x07, 0x6d, 0x4e, 0xb9, 0x98, 0x45, 0xb0, 0x54, 0xb6, 0x30, 0xb0, 0x7c, 0xb7, 0x38, + 0x5f, 0xe0, 0x8b, 0xde, 0xab, 0xe4, 0x03, 0xff, 0xca, 0xa0, 0x77, 0x68, 0xf7, 0xb6, 0x34, 0xe4, + 0x6e, 0x1b, 0x9f, 0x7b, 0x33, 0x73, 0xb2, 0xe1, 0xbf, 0xc8, 0xbe, 0x31, 0xe8, 0x1e, 0x2b, 0xd3, + 0x0c, 0xcf, 0xf0, 0xf6, 0x07, 0x2c, 0x39, 0xb8, 0xdb, 0x16, 0x6f, 0x9b, 0x2f, 0x2e, 0xf6, 0x1e, + 0xe3, 0x1f, 0x19, 0xf4, 0x9e, 0xd9, 0x77, 0x72, 0x4d, 0xd7, 0xaf, 0x7d, 0xb4, 0x03, 0x78, 0xb1, + 0x5e, 0x77, 0x26, 0x1d, 0x2b, 0xb9, 0xff, 0x27, 0x00, 0x00, 0xff, 0xff, 0xa1, 0x05, 0xbe, 0xa2, + 0x01, 0x05, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. var _ context.Context -var _ grpc.ClientConn +var _ grpc.ClientConnInterface // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 +const _ = grpc.SupportPackageIsVersion6 // TemplateClient is the client API for Template service. // @@ -270,10 +287,10 @@ type TemplateClient interface { } type templateClient struct { - cc *grpc.ClientConn + cc grpc.ClientConnInterface } -func NewTemplateClient(cc *grpc.ClientConn) TemplateClient { +func NewTemplateClient(cc grpc.ClientConnInterface) TemplateClient { return &templateClient{cc} } diff --git a/protos/template/template.pb.gw.go b/protos/template/template.pb.gw.go new file mode 100644 index 000000000..1d6c0b326 --- /dev/null +++ b/protos/template/template.pb.gw.go @@ -0,0 +1,407 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: template/template.proto + +/* +Package template is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package template + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage + +func request_Template_CreateTemplate_0(ctx context.Context, marshaler runtime.Marshaler, client TemplateClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq WorkflowTemplate + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.CreateTemplate(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Template_CreateTemplate_0(ctx context.Context, marshaler runtime.Marshaler, server TemplateServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq WorkflowTemplate + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.CreateTemplate(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Template_GetTemplate_0(ctx context.Context, marshaler runtime.Marshaler, client TemplateClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := client.GetTemplate(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Template_GetTemplate_0(ctx context.Context, marshaler runtime.Marshaler, server TemplateServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := server.GetTemplate(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Template_DeleteTemplate_0(ctx context.Context, marshaler runtime.Marshaler, client TemplateClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := client.DeleteTemplate(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Template_DeleteTemplate_0(ctx context.Context, marshaler runtime.Marshaler, server TemplateServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := server.DeleteTemplate(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Template_ListTemplates_0(ctx context.Context, marshaler runtime.Marshaler, client TemplateClient, req *http.Request, pathParams map[string]string) (Template_ListTemplatesClient, runtime.ServerMetadata, error) { + var protoReq Empty + var metadata runtime.ServerMetadata + + stream, err := client.ListTemplates(ctx, &protoReq) + if err != nil { + return nil, metadata, err + } + header, err := stream.Header() + if err != nil { + return nil, metadata, err + } + metadata.HeaderMD = header + return stream, metadata, nil + +} + +// RegisterTemplateHandlerServer registers the http handlers for service Template to "mux". +// UnaryRPC :call TemplateServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +func RegisterTemplateHandlerServer(ctx context.Context, mux *runtime.ServeMux, server TemplateServer) error { + + mux.Handle("POST", pattern_Template_CreateTemplate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Template_CreateTemplate_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Template_CreateTemplate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Template_GetTemplate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Template_GetTemplate_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Template_GetTemplate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_Template_DeleteTemplate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Template_DeleteTemplate_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Template_DeleteTemplate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Template_ListTemplates_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + err := status.Error(codes.Unimplemented, "streaming calls are not yet supported in the in-process transport") + _, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + }) + + return nil +} + +// RegisterTemplateHandlerFromEndpoint is same as RegisterTemplateHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterTemplateHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterTemplateHandler(ctx, mux, conn) +} + +// RegisterTemplateHandler registers the http handlers for service Template to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterTemplateHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterTemplateHandlerClient(ctx, mux, NewTemplateClient(conn)) +} + +// RegisterTemplateHandlerClient registers the http handlers for service Template +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "TemplateClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "TemplateClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "TemplateClient" to call the correct interceptors. +func RegisterTemplateHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TemplateClient) error { + + mux.Handle("POST", pattern_Template_CreateTemplate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Template_CreateTemplate_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Template_CreateTemplate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Template_GetTemplate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Template_GetTemplate_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Template_GetTemplate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_Template_DeleteTemplate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Template_DeleteTemplate_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Template_DeleteTemplate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Template_ListTemplates_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Template_ListTemplates_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Template_ListTemplates_0(ctx, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Template_CreateTemplate_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "templates"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Template_GetTemplate_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"v1", "templates", "id"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Template_DeleteTemplate_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"v1", "templates", "id"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Template_ListTemplates_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "templates"}, "", runtime.AssumeColonVerbOpt(true))) +) + +var ( + forward_Template_CreateTemplate_0 = runtime.ForwardResponseMessage + + forward_Template_GetTemplate_0 = runtime.ForwardResponseMessage + + forward_Template_DeleteTemplate_0 = runtime.ForwardResponseMessage + + forward_Template_ListTemplates_0 = runtime.ForwardResponseStream +) diff --git a/protos/template/template.proto b/protos/template/template.proto index 7712e4900..eb23b9b2e 100644 --- a/protos/template/template.proto +++ b/protos/template/template.proto @@ -4,13 +4,31 @@ option go_package = "template"; package github.com.tinkerbell.tink.protos.template; +import "google/api/annotations.proto"; import "timestamp.proto"; service Template { - rpc CreateTemplate(WorkflowTemplate) returns (CreateResponse); - rpc GetTemplate(GetRequest) returns (WorkflowTemplate); - rpc DeleteTemplate(GetRequest) returns (Empty); - rpc ListTemplates(Empty) returns (stream WorkflowTemplate); + rpc CreateTemplate(WorkflowTemplate) returns (CreateResponse) { + option (google.api.http) = { + post: "/v1/templates" + body: "*" + }; + }; + rpc GetTemplate(GetRequest) returns (WorkflowTemplate) { + option (google.api.http) = { + get: "/v1/templates/{id}" + }; + }; + rpc DeleteTemplate(GetRequest) returns (Empty) { + option (google.api.http) = { + delete: "/v1/templates/{id}" + }; + }; + rpc ListTemplates(Empty) returns (stream WorkflowTemplate) { + option (google.api.http) = { + get: "/v1/templates" + }; + }; rpc UpdateTemplate(WorkflowTemplate) returns (Empty); } @@ -20,10 +38,11 @@ message Empty { message WorkflowTemplate { string id = 1; string name = 2; - bytes data = 3; + bytes OBSOLETE_data = 3; // obsolete google.protobuf.Timestamp createdAt = 4; google.protobuf.Timestamp updatedAt = 5; google.protobuf.Timestamp deletedAt = 6; + string data = 7; } message CreateResponse { diff --git a/protos/workflow/workflow.pb.go b/protos/workflow/workflow.pb.go index f402e115d..8d5ede592 100644 --- a/protos/workflow/workflow.pb.go +++ b/protos/workflow/workflow.pb.go @@ -10,6 +10,7 @@ import ( proto "github.com/golang/protobuf/proto" timestamp "github.com/golang/protobuf/ptypes/timestamp" + _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -963,92 +964,100 @@ func init() { proto.RegisterType((*UpdateWorkflowDataRequest)(nil), "github.com.tinkerbell.tink.protos.workflow.UpdateWorkflowDataRequest") } -func init() { proto.RegisterFile("workflow/workflow.proto", fileDescriptor_87aff9429097fa52) } +func init() { + proto.RegisterFile("workflow/workflow.proto", fileDescriptor_87aff9429097fa52) +} var fileDescriptor_87aff9429097fa52 = []byte{ - // 1164 bytes of a gzipped FileDescriptorProto + // 1256 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08,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x1b, 0x11, 0xca, + 0x62, 0x39, 0x35, 0x5e, 0x92, 0x53, 0x33, 0x9e, 0x53, 0xbb, 0x0c, 0x05, 0x1d, 0x88, 0x0e, 0xc3, + 0x80, 0x92, 0xd9, 0x6a, 0xd9, 0x37, 0x01, 0x9a, 0x84, 0xe9, 0x73, 0x66, 0xad, 0xff, 0x98, 0xb0, + 0xa1, 0x0b, 0x5d, 0x0b, 0x03, 0x46, 0x9e, 0x33, 0xf4, 0x06, 0xe4, 0x74, 0xde, 0x7b, 0x63, 0x67, + 0xd0, 0xaa, 0x96, 0x8b, 0xde, 0x84, 0x42, 0x7f, 0x14, 0x45, 0x24, 0x60, 0x3d, 0xae, 0x25, 0x91, + 0xa2, 0x95, 0x57, 0xda, 0xa7, 0x42, 0x89, 0x6e, 0xc1, 0x25, 0xed, 0xc6, 0x30, 0x3d, 0x51, 0xfd, + 0x90, 0x53, 0xba, 0x2e, 0xa6, 0x27, 0xd3, 0x91, 0x70, 0x9f, 0xb7, 0xa6, 0xe8, 0x8d, 0x49, 0xa4, + 0x5d, 0xa1, 0x44, 0xb7, 0x61, 0x33, 0xee, 0xd6, 0xf3, 0x02, 0x97, 0x3c, 0x17, 0xb5, 0x4f, 0x39, + 0x28, 0xe6, 0xdc, 0xe2, 0x16, 0xe4, 0xcd, 0x21, 0x64, 0xeb, 0xad, 0x89, 0xd6, 0x7b, 0x77, 0x91, + 0xd6, 0x93, 0x61, 0x65, 0x03, 0xc6, 0x8f, 0x12, 0x3a, 0x74, 0x17, 0xae, 0xb1, 0x90, 0xe1, 0x41, + 0x2f, 0x18, 0xf9, 0x07, 0x24, 0xea, 0x85, 0x87, 0xea, 0x48, 0x2a, 0xfa, 0x24, 0xe5, 0x6c, 0x0a, + 0x73, 0x5b, 0x58, 0xf7, 0x0e, 0x25, 0x94, 0xda, 0x7f, 0x99, 0xb0, 0xa9, 0x33, 0x3f, 0x09, 0x37, + 0xa2, 0x17, 0xa7, 0xff, 0x06, 0x64, 0x79, 0x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0xd6, 0x7b, + 0x00, 0x9f, 0x64, 0xb4, 0xee, 0x60, 0x4d, 0x38, 0xbd, 0xf5, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, + 0x83, 0x4c, 0x56, 0x43, 0xd0, 0x11, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. var _ context.Context -var _ grpc.ClientConn +var _ grpc.ClientConnInterface // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 +const _ = grpc.SupportPackageIsVersion6 // WorkflowSvcClient is the client API for WorkflowSvc service. // @@ -1070,10 +1079,10 @@ type WorkflowSvcClient interface { } type workflowSvcClient struct { - cc *grpc.ClientConn + cc grpc.ClientConnInterface } -func NewWorkflowSvcClient(cc *grpc.ClientConn) WorkflowSvcClient { +func NewWorkflowSvcClient(cc grpc.ClientConnInterface) WorkflowSvcClient { return &workflowSvcClient{cc} } diff --git a/protos/workflow/workflow.pb.gw.go b/protos/workflow/workflow.pb.gw.go new file mode 100644 index 000000000..2f8e8b7db --- /dev/null +++ b/protos/workflow/workflow.pb.gw.go @@ -0,0 +1,571 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: workflow/workflow.proto + +/* +Package workflow is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package workflow + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage + +func request_WorkflowSvc_CreateWorkflow_0(ctx context.Context, marshaler runtime.Marshaler, client WorkflowSvcClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq CreateRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.CreateWorkflow(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_WorkflowSvc_CreateWorkflow_0(ctx context.Context, marshaler runtime.Marshaler, server WorkflowSvcServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq CreateRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.CreateWorkflow(ctx, &protoReq) + return msg, metadata, err + +} + +func request_WorkflowSvc_GetWorkflow_0(ctx context.Context, marshaler runtime.Marshaler, client WorkflowSvcClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := client.GetWorkflow(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_WorkflowSvc_GetWorkflow_0(ctx context.Context, marshaler runtime.Marshaler, server WorkflowSvcServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := server.GetWorkflow(ctx, &protoReq) + return msg, metadata, err + +} + +func request_WorkflowSvc_DeleteWorkflow_0(ctx context.Context, marshaler runtime.Marshaler, client WorkflowSvcClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := client.DeleteWorkflow(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_WorkflowSvc_DeleteWorkflow_0(ctx context.Context, marshaler runtime.Marshaler, server WorkflowSvcServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := server.DeleteWorkflow(ctx, &protoReq) + return msg, metadata, err + +} + +func request_WorkflowSvc_ListWorkflows_0(ctx context.Context, marshaler runtime.Marshaler, client WorkflowSvcClient, req *http.Request, pathParams map[string]string) (WorkflowSvc_ListWorkflowsClient, runtime.ServerMetadata, error) { + var protoReq Empty + var metadata runtime.ServerMetadata + + stream, err := client.ListWorkflows(ctx, &protoReq) + if err != nil { + return nil, metadata, err + } + header, err := stream.Header() + if err != nil { + return nil, metadata, err + } + metadata.HeaderMD = header + return stream, metadata, nil + +} + +func request_WorkflowSvc_GetWorkflowContext_0(ctx context.Context, marshaler runtime.Marshaler, client WorkflowSvcClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := client.GetWorkflowContext(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_WorkflowSvc_GetWorkflowContext_0(ctx context.Context, marshaler runtime.Marshaler, server WorkflowSvcServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := server.GetWorkflowContext(ctx, &protoReq) + return msg, metadata, err + +} + +func request_WorkflowSvc_ShowWorkflowEvents_0(ctx context.Context, marshaler runtime.Marshaler, client WorkflowSvcClient, req *http.Request, pathParams map[string]string) (WorkflowSvc_ShowWorkflowEventsClient, runtime.ServerMetadata, error) { + var protoReq GetRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + stream, err := client.ShowWorkflowEvents(ctx, &protoReq) + if err != nil { + return nil, metadata, err + } + header, err := stream.Header() + if err != nil { + return nil, metadata, err + } + metadata.HeaderMD = header + return stream, metadata, nil + +} + +// RegisterWorkflowSvcHandlerServer registers the http handlers for service WorkflowSvc to "mux". +// UnaryRPC :call WorkflowSvcServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +func RegisterWorkflowSvcHandlerServer(ctx context.Context, mux *runtime.ServeMux, server WorkflowSvcServer) error { + + mux.Handle("POST", pattern_WorkflowSvc_CreateWorkflow_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_WorkflowSvc_CreateWorkflow_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_WorkflowSvc_CreateWorkflow_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_WorkflowSvc_GetWorkflow_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_WorkflowSvc_GetWorkflow_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_WorkflowSvc_GetWorkflow_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_WorkflowSvc_DeleteWorkflow_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_WorkflowSvc_DeleteWorkflow_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_WorkflowSvc_DeleteWorkflow_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_WorkflowSvc_ListWorkflows_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + err := status.Error(codes.Unimplemented, "streaming calls are not yet supported in the in-process transport") + _, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + }) + + mux.Handle("GET", pattern_WorkflowSvc_GetWorkflowContext_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_WorkflowSvc_GetWorkflowContext_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_WorkflowSvc_GetWorkflowContext_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_WorkflowSvc_ShowWorkflowEvents_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + err := status.Error(codes.Unimplemented, "streaming calls are not yet supported in the in-process transport") + _, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + }) + + return nil +} + +// RegisterWorkflowSvcHandlerFromEndpoint is same as RegisterWorkflowSvcHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterWorkflowSvcHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterWorkflowSvcHandler(ctx, mux, conn) +} + +// RegisterWorkflowSvcHandler registers the http handlers for service WorkflowSvc to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterWorkflowSvcHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterWorkflowSvcHandlerClient(ctx, mux, NewWorkflowSvcClient(conn)) +} + +// RegisterWorkflowSvcHandlerClient registers the http handlers for service WorkflowSvc +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "WorkflowSvcClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "WorkflowSvcClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "WorkflowSvcClient" to call the correct interceptors. +func RegisterWorkflowSvcHandlerClient(ctx context.Context, mux *runtime.ServeMux, client WorkflowSvcClient) error { + + mux.Handle("POST", pattern_WorkflowSvc_CreateWorkflow_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_WorkflowSvc_CreateWorkflow_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_WorkflowSvc_CreateWorkflow_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_WorkflowSvc_GetWorkflow_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_WorkflowSvc_GetWorkflow_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_WorkflowSvc_GetWorkflow_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_WorkflowSvc_DeleteWorkflow_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_WorkflowSvc_DeleteWorkflow_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_WorkflowSvc_DeleteWorkflow_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_WorkflowSvc_ListWorkflows_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_WorkflowSvc_ListWorkflows_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_WorkflowSvc_ListWorkflows_0(ctx, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_WorkflowSvc_GetWorkflowContext_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_WorkflowSvc_GetWorkflowContext_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_WorkflowSvc_GetWorkflowContext_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_WorkflowSvc_ShowWorkflowEvents_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_WorkflowSvc_ShowWorkflowEvents_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_WorkflowSvc_ShowWorkflowEvents_0(ctx, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_WorkflowSvc_CreateWorkflow_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "workflows"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_WorkflowSvc_GetWorkflow_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"v1", "workflows", "id"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_WorkflowSvc_DeleteWorkflow_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"v1", "workflows", "id"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_WorkflowSvc_ListWorkflows_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "workflows"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_WorkflowSvc_GetWorkflowContext_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3}, []string{"v1", "workflows", "id", "state"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_WorkflowSvc_ShowWorkflowEvents_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3}, []string{"v1", "workflows", "id", "events"}, "", runtime.AssumeColonVerbOpt(true))) +) + +var ( + forward_WorkflowSvc_CreateWorkflow_0 = runtime.ForwardResponseMessage + + forward_WorkflowSvc_GetWorkflow_0 = runtime.ForwardResponseMessage + + forward_WorkflowSvc_DeleteWorkflow_0 = runtime.ForwardResponseMessage + + forward_WorkflowSvc_ListWorkflows_0 = runtime.ForwardResponseStream + + forward_WorkflowSvc_GetWorkflowContext_0 = runtime.ForwardResponseMessage + + forward_WorkflowSvc_ShowWorkflowEvents_0 = runtime.ForwardResponseStream +) diff --git a/protos/workflow/workflow.proto b/protos/workflow/workflow.proto index 992106580..8e0b6b377 100644 --- a/protos/workflow/workflow.proto +++ b/protos/workflow/workflow.proto @@ -4,15 +4,41 @@ option go_package = "workflow"; package github.com.tinkerbell.tink.protos.workflow; +import "google/api/annotations.proto"; import "timestamp.proto"; service WorkflowSvc { - rpc CreateWorkflow(CreateRequest) returns (CreateResponse); - rpc GetWorkflow(GetRequest) returns (Workflow); - rpc DeleteWorkflow(GetRequest) returns (Empty); - rpc ListWorkflows(Empty) returns (stream Workflow); - rpc GetWorkflowContext(GetRequest) returns (WorkflowContext); - rpc ShowWorkflowEvents(GetRequest) returns (stream WorkflowActionStatus); + rpc CreateWorkflow(CreateRequest) returns (CreateResponse) { + option (google.api.http) = { + post: "/v1/workflows" + body: "*" + }; + }; + rpc GetWorkflow(GetRequest) returns (Workflow) { + option (google.api.http) = { + get: "/v1/workflows/{id}" + }; + }; + rpc DeleteWorkflow(GetRequest) returns (Empty) { + option (google.api.http) = { + delete: "/v1/workflows/{id}" + }; + }; + rpc ListWorkflows(Empty) returns (stream Workflow) { + option (google.api.http) = { + get: "/v1/workflows" + }; + }; + rpc GetWorkflowContext(GetRequest) returns (WorkflowContext) { + option (google.api.http) = { + get: "/v1/workflows/{id}/state" + }; + }; + rpc ShowWorkflowEvents(GetRequest) returns (stream WorkflowActionStatus) { + option (google.api.http) = { + get: "/v1/workflows/{id}/events" + }; + }; rpc GetWorkflowContexts(WorkflowContextRequest) returns (WorkflowContextList) {} rpc GetWorkflowActions(WorkflowActionsRequest) returns (WorkflowActionList) {} rpc ReportActionStatus(WorkflowActionStatus) returns (Empty) {} diff --git a/setup.sh b/setup.sh index 7233f89b9..1c6b98dc6 100755 --- a/setup.sh +++ b/setup.sh @@ -418,7 +418,7 @@ setup_docker_registry() ( ) start_components() ( - local components=(db cacher hegel tink-server boots tink-cli nginx) + local components=(db hegel tink-server boots tink-cli nginx) for comp in "${components[@]}"; do docker-compose -f "$DEPLOYDIR/docker-compose.yml" up --build -d "$comp" sleep 3 diff --git a/test/framework/hardware.go b/test/framework/hardware.go index 5b8f77aab..cc5c87b9e 100644 --- a/test/framework/hardware.go +++ b/test/framework/hardware.go @@ -2,6 +2,7 @@ package framework import ( "context" + "encoding/json" "io/ioutil" "os" @@ -9,18 +10,18 @@ import ( "github.com/tinkerbell/tink/protos/hardware" ) -func readHwData(file string) (string, error) { +func readHwData(file string) ([]byte, error) { f, err := os.Open(file) if err != nil { - return "", err + return []byte(""), err } defer f.Close() data, err := ioutil.ReadAll(f) if err != nil { - return "", err + return []byte(""), err } - return string(data), nil + return data, nil } // PushHardwareData : push hardware data @@ -31,7 +32,9 @@ func PushHardwareData(hwDataFiles []string) error { if err != nil { return err } - _, err = client.HardwareClient.Push(context.Background(), &hardware.PushRequest{Data: data}) + hw := hardware.Hardware{} + err = json.Unmarshal(data, &hw) + _, err = client.HardwareClient.Push(context.Background(), &hardware.PushRequest{Data: &hw}) if err != nil { return err } diff --git a/test/framework/template.go b/test/framework/template.go index 1a010d974..6148c2ce5 100644 --- a/test/framework/template.go +++ b/test/framework/template.go @@ -9,18 +9,18 @@ import ( "github.com/tinkerbell/tink/protos/template" ) -func readTemplateData(file string) ([]byte, error) { +func readTemplateData(file string) (string, error) { f, err := os.Open(file) if err != nil { - return []byte(""), err + return "", err } defer f.Close() data, err := ioutil.ReadAll(f) if err != nil { - return []byte(""), err + return "", err } - return data, nil + return string(data), nil } // CreateTemplate : create template in the database