Loading charts/meep-ctrl-engine/values.yaml +2 −2 Original line number Diff line number Diff line Loading @@ -44,8 +44,8 @@ ingress: # kubernetes.io/ingress.class: nginx # kubernetes.io/tls-acme: "true" # nginx.ingress.kubernetes.io/rewrite-target: /$2 nginx.ingress.kubernetes.io/configuration-snippet: | rewrite ^(/api)$ $1/ redirect; # nginx.ingress.kubernetes.io/configuration-snippet: | # rewrite ^(/api)$ $1/ redirect; labels: {} tls: Loading charts/meep-metrics-engine/templates/deployment.yaml +3 −0 Original line number Diff line number Diff line Loading @@ -41,6 +41,9 @@ spec: ports: - containerPort: {{ .Values.deployment.port }} protocol: {{ .Values.deployment.protocol }} env: - name: MEEP_METRICS_ROOT_URL value: {{ .Values.image.env.rooturl }} {{- if .Values.codecov.enabled}} volumeMounts: - name: codecov-storage Loading charts/meep-metrics-engine/values.yaml +2 −0 Original line number Diff line number Diff line Loading @@ -14,6 +14,8 @@ image: repository: meep-metrics-engine tag: latest pullPolicy: Always env: rooturl: "http://www.example.com" service: type: ClusterIP Loading go-apps/meep-metrics-engine/server/v2/metrics-engine.go +16 −5 Original line number Diff line number Diff line Loading @@ -22,7 +22,10 @@ import ( "errors" "fmt" "net/http" "net/url" "os" "strconv" "strings" "time" ceModel "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-ctrl-engine-model" Loading @@ -42,7 +45,7 @@ const metricNetwork = "network" const moduleName string = "meep-metrics-engine" const redisAddr string = "meep-redis-master:6379" const basepathURL = "http://meep-metrics-engine/v2/" const basePath = "/metrics/v2/" const typeNetworkSubscription = "netsubs" const typeEventSubscription = "eventsubs" Loading @@ -59,6 +62,7 @@ var eventSubscriptionMap = map[string]*EventRegistration{} var activeModel *mod.Model var activeScenarioName string var metricStore *ms.MetricStore var rootUrl *url.URL var rc *redis.Connector Loading @@ -76,6 +80,13 @@ type NetworkRegistration struct { // Init - Metrics engine initialization func Init() (err error) { // Retrieve Root URL from environment variable rootUrl, err = url.Parse(strings.TrimSpace(os.Getenv("MEEP_METRICS_ROOT_URL"))) if err != nil { rootUrl = new(url.URL) } log.Info("MEEP_METRICS_ROOT_URL: ", rootUrl) // Connect to Metric Store metricStore, err = ms.NewMetricStore("", influxDBAddr, redisAddr) if err != nil { Loading Loading @@ -378,7 +389,7 @@ func createEventSubscription(w http.ResponseWriter, r *http.Request) { return } response.ResourceURL = basepathURL + "subscriptions/event/" + subsIdStr response.ResourceURL = rootUrl.String() + basePath + "subscriptions/event/" + subsIdStr response.SubscriptionId = subsIdStr response.SubscriptionType = eventSubscriptionParams.SubscriptionType response.Period = eventSubscriptionParams.Period Loading Loading @@ -423,7 +434,7 @@ func createNetworkSubscription(w http.ResponseWriter, r *http.Request) { return } response.ResourceURL = basepathURL + "metrics/subscriptions/network/" + subsIdStr response.ResourceURL = rootUrl.String() + basePath + "metrics/subscriptions/network/" + subsIdStr response.SubscriptionId = subsIdStr response.SubscriptionType = networkSubscriptionParams.SubscriptionType response.Period = networkSubscriptionParams.Period Loading Loading @@ -758,7 +769,7 @@ func getEventSubscription(w http.ResponseWriter, r *http.Request) { _ = rc.JSONGetList("", "", moduleName+":"+typeEventSubscription, populateEventList, &response) response.ResourceURL = basepathURL + "metrics/subscriptions/event" response.ResourceURL = rootUrl.String() + basePath + "metrics/subscriptions/event" jsonResponse, err := json.Marshal(response) if err != nil { log.Error(err.Error()) Loading @@ -775,7 +786,7 @@ func getNetworkSubscription(w http.ResponseWriter, r *http.Request) { _ = rc.JSONGetList("", "", moduleName+":"+typeNetworkSubscription, populateNetworkList, &response) response.ResourceURL = basepathURL + "metrics/subscriptions/network" response.ResourceURL = rootUrl.String() + basePath + "metrics/subscriptions/network" jsonResponse, err := json.Marshal(response) if err != nil { log.Error(err.Error()) Loading go-apps/meepctl/cmd/configIp.go +1 −1 Original line number Diff line number Diff line Loading @@ -29,7 +29,7 @@ import ( // configSet represents the set command var configIp = &cobra.Command{ Use: "ip [IP]", Short: "get/get node IP address in the meepctl config file", Short: "get/set node IP address in the meepctl config file", Long: "Get/Set node IP address in the meepctl config file", Example: "meepctl config ip 1.2.3.4", Args: cobra.RangeArgs(0, 1), Loading Loading
charts/meep-ctrl-engine/values.yaml +2 −2 Original line number Diff line number Diff line Loading @@ -44,8 +44,8 @@ ingress: # kubernetes.io/ingress.class: nginx # kubernetes.io/tls-acme: "true" # nginx.ingress.kubernetes.io/rewrite-target: /$2 nginx.ingress.kubernetes.io/configuration-snippet: | rewrite ^(/api)$ $1/ redirect; # nginx.ingress.kubernetes.io/configuration-snippet: | # rewrite ^(/api)$ $1/ redirect; labels: {} tls: Loading
charts/meep-metrics-engine/templates/deployment.yaml +3 −0 Original line number Diff line number Diff line Loading @@ -41,6 +41,9 @@ spec: ports: - containerPort: {{ .Values.deployment.port }} protocol: {{ .Values.deployment.protocol }} env: - name: MEEP_METRICS_ROOT_URL value: {{ .Values.image.env.rooturl }} {{- if .Values.codecov.enabled}} volumeMounts: - name: codecov-storage Loading
charts/meep-metrics-engine/values.yaml +2 −0 Original line number Diff line number Diff line Loading @@ -14,6 +14,8 @@ image: repository: meep-metrics-engine tag: latest pullPolicy: Always env: rooturl: "http://www.example.com" service: type: ClusterIP Loading
go-apps/meep-metrics-engine/server/v2/metrics-engine.go +16 −5 Original line number Diff line number Diff line Loading @@ -22,7 +22,10 @@ import ( "errors" "fmt" "net/http" "net/url" "os" "strconv" "strings" "time" ceModel "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-ctrl-engine-model" Loading @@ -42,7 +45,7 @@ const metricNetwork = "network" const moduleName string = "meep-metrics-engine" const redisAddr string = "meep-redis-master:6379" const basepathURL = "http://meep-metrics-engine/v2/" const basePath = "/metrics/v2/" const typeNetworkSubscription = "netsubs" const typeEventSubscription = "eventsubs" Loading @@ -59,6 +62,7 @@ var eventSubscriptionMap = map[string]*EventRegistration{} var activeModel *mod.Model var activeScenarioName string var metricStore *ms.MetricStore var rootUrl *url.URL var rc *redis.Connector Loading @@ -76,6 +80,13 @@ type NetworkRegistration struct { // Init - Metrics engine initialization func Init() (err error) { // Retrieve Root URL from environment variable rootUrl, err = url.Parse(strings.TrimSpace(os.Getenv("MEEP_METRICS_ROOT_URL"))) if err != nil { rootUrl = new(url.URL) } log.Info("MEEP_METRICS_ROOT_URL: ", rootUrl) // Connect to Metric Store metricStore, err = ms.NewMetricStore("", influxDBAddr, redisAddr) if err != nil { Loading Loading @@ -378,7 +389,7 @@ func createEventSubscription(w http.ResponseWriter, r *http.Request) { return } response.ResourceURL = basepathURL + "subscriptions/event/" + subsIdStr response.ResourceURL = rootUrl.String() + basePath + "subscriptions/event/" + subsIdStr response.SubscriptionId = subsIdStr response.SubscriptionType = eventSubscriptionParams.SubscriptionType response.Period = eventSubscriptionParams.Period Loading Loading @@ -423,7 +434,7 @@ func createNetworkSubscription(w http.ResponseWriter, r *http.Request) { return } response.ResourceURL = basepathURL + "metrics/subscriptions/network/" + subsIdStr response.ResourceURL = rootUrl.String() + basePath + "metrics/subscriptions/network/" + subsIdStr response.SubscriptionId = subsIdStr response.SubscriptionType = networkSubscriptionParams.SubscriptionType response.Period = networkSubscriptionParams.Period Loading Loading @@ -758,7 +769,7 @@ func getEventSubscription(w http.ResponseWriter, r *http.Request) { _ = rc.JSONGetList("", "", moduleName+":"+typeEventSubscription, populateEventList, &response) response.ResourceURL = basepathURL + "metrics/subscriptions/event" response.ResourceURL = rootUrl.String() + basePath + "metrics/subscriptions/event" jsonResponse, err := json.Marshal(response) if err != nil { log.Error(err.Error()) Loading @@ -775,7 +786,7 @@ func getNetworkSubscription(w http.ResponseWriter, r *http.Request) { _ = rc.JSONGetList("", "", moduleName+":"+typeNetworkSubscription, populateNetworkList, &response) response.ResourceURL = basepathURL + "metrics/subscriptions/network" response.ResourceURL = rootUrl.String() + basePath + "metrics/subscriptions/network" jsonResponse, err := json.Marshal(response) if err != nil { log.Error(err.Error()) Loading
go-apps/meepctl/cmd/configIp.go +1 −1 Original line number Diff line number Diff line Loading @@ -29,7 +29,7 @@ import ( // configSet represents the set command var configIp = &cobra.Command{ Use: "ip [IP]", Short: "get/get node IP address in the meepctl config file", Short: "get/set node IP address in the meepctl config file", Long: "Get/Set node IP address in the meepctl config file", Example: "meepctl config ip 1.2.3.4", Args: cobra.RangeArgs(0, 1), Loading