Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/loxilb-io/loxicmd into main
Browse files Browse the repository at this point in the history
  • Loading branch information
inhogog2 committed May 22, 2023
2 parents ff875c1 + 530cc57 commit ee1efdf
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
10 changes: 5 additions & 5 deletions cmd/create/create_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@ ex) loxicmd create endpoint 32.32.32.1 --name=32.32.32.1_http_8080 --probetype=h
}

if o.ProbeType != "http" && o.ProbeType != "https" && o.ProbeType != "ping" &&
o.ProbeType != "connect-tcp" && o.ProbeType != "connect-udp" &&
o.ProbeType != "connect-sctp" && o.ProbeType != "none" {
o.ProbeType != "tcp" && o.ProbeType != "udp" &&
o.ProbeType != "sctp" && o.ProbeType != "none" {
fmt.Printf("probetype '%s' is invalid\n", o.ProbeType)
return
}

if o.ProbeType == "http" || o.ProbeType == "https" || o.ProbeType == "connect-tcp" ||
o.ProbeType == "connect-udp" || o.ProbeType == "connect-sctp" {
if o.ProbeType == "http" || o.ProbeType == "https" || o.ProbeType == "tcp" ||
o.ProbeType == "udp" || o.ProbeType == "sctp" {
if o.ProbePort == 0 {
fmt.Printf("probeport cant be 0 for '%s' probes\n", o.ProbeType)
return
Expand Down Expand Up @@ -121,7 +121,7 @@ ex) loxicmd create endpoint 32.32.32.1 --name=32.32.32.1_http_8080 --probetype=h
createEndPointCmd.Flags().StringVar(&o.Name, "name", "", "Endpoint Identifier")
createEndPointCmd.Flags().StringVar(&o.Name, "desc", "", "Endpoint Identifier")
createEndPointCmd.Flags().MarkDeprecated("desc", "This flag is decrecated, Use --name")
createEndPointCmd.Flags().StringVar(&o.ProbeType, "probetype", "ping", "Probe-type:ping,http,https,connect-udp,connect-tcp,connect-sctp,none")
createEndPointCmd.Flags().StringVar(&o.ProbeType, "probetype", "ping", "Probe-type:ping,http,https,udp,tcp,sctp,none")
createEndPointCmd.Flags().StringVar(&o.ProbeReq, "probereq", "", "If probe is http/https, one can specify additional uri path")
createEndPointCmd.Flags().StringVar(&o.ProbeResp, "proberesp", "", "If probe is http/https, one can specify custom response string")
createEndPointCmd.Flags().IntVar(&o.ProbePort, "probeport", 0, "If probe is http,https,tcp,udp,sctp one can specify custom l4port to use")
Expand Down
10 changes: 5 additions & 5 deletions cmd/delete/delete_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@ ex) loxicmd delete endpoint 31.31.31.31 --name=31.31.31.31_http_8080 --probetype
}

if o.ProbeType != "http" && o.ProbeType != "https" && o.ProbeType != "ping" &&
o.ProbeType != "connect-tcp" && o.ProbeType != "connect-udp" &&
o.ProbeType != "connect-sctp" && o.ProbeType != "none" {
o.ProbeType != "tcp" && o.ProbeType != "udp" &&
o.ProbeType != "sctp" && o.ProbeType != "none" {
fmt.Printf("probetype '%s' is invalid\n", o.ProbeType)
return
}

if o.ProbeType == "http" || o.ProbeType == "https" || o.ProbeType == "connect-tcp" ||
o.ProbeType == "connect-udp" || o.ProbeType == "connect-sctp" {
if o.ProbeType == "http" || o.ProbeType == "https" || o.ProbeType == "tcp" ||
o.ProbeType == "udp" || o.ProbeType == "sctp" {
if o.ProbePort == 0 {
fmt.Printf("probeport cant be 0 for '%s' probes\n", o.ProbeType)
return
Expand Down Expand Up @@ -120,7 +120,7 @@ ex) loxicmd delete endpoint 31.31.31.31 --name=31.31.31.31_http_8080 --probetype
},
}
deleteEndPointCmd.Flags().StringVar(&o.Name, "name", "", "Endpoint Identifier")
deleteEndPointCmd.Flags().StringVar(&o.ProbeType, "probetype", "ping", "Probe-type:ping,http,https,connect-udp,connect-tcp,connect-sctp,none")
deleteEndPointCmd.Flags().StringVar(&o.ProbeType, "probetype", "ping", "Probe-type:ping,http,https,udp,tcp,sctp,none")
deleteEndPointCmd.Flags().IntVar(&o.ProbePort, "probeport", 0, "If probe is http,https,tcp,udp,sctp one can specify custom l4port to use")
return deleteEndPointCmd
}
4 changes: 2 additions & 2 deletions pkg/api/endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ type EndPointGetEntry struct {
// InActTries - No. of inactive probes to mark
// an end-point inactive
InActTries int `json:"inactiveReTries"`
// ProbeType - Type of probe : "icmp","connect-tcp", "connect-udp", "connect-sctp", "http"
// ProbeType - Type of probe : "icmp","tcp", "udp", "sctp", "http"
ProbeType string `json:"probeType"`
// ProbeReq - Request string in case of http probe
ProbeReq string `json:"probeReq"`
Expand Down Expand Up @@ -70,7 +70,7 @@ type EndPointMod struct {
// InActTries - No. of inactive probes to mark
// an end-point inactive
InActTries int `json:"inactiveReTries" yaml:"inactiveReTries"`
// ProbeType - Type of probe : "icmp","connect-tcp", "connect-udp", "connect-sctp", "http"
// ProbeType - Type of probe : "icmp","tcp", "udp", "sctp", "http"
ProbeType string `json:"probeType" yaml:"probeType"`
// ProbeReq - Request string in case of http probe
ProbeReq string `json:"probeReq" yaml:"probeReq"`
Expand Down

0 comments on commit ee1efdf

Please sign in to comment.