Code Review
/
nonrtric
/
plt
/
ranpm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
NONRTRIC-924: RANPM - remove proxy
[nonrtric/plt/ranpm.git]
/
pm-rapp
/
main.go
diff --git
a/pm-rapp/main.go
b/pm-rapp/main.go
index
4113a42
..
86f1b3c
100644
(file)
--- a/
pm-rapp/main.go
+++ b/
pm-rapp/main.go
@@
-45,10
+45,8
@@
import (
type JobDefinition struct {
InfoTypeID string `json:"info_type_id"`
JobOwner string `json:"job_owner"`
type JobDefinition struct {
InfoTypeID string `json:"info_type_id"`
JobOwner string `json:"job_owner"`
-
JobResultURI string `json:"job_result
_uri"`
+
StatusNotificationURI string `json:"status_notification
_uri"`
JobDefinition struct {
JobDefinition struct {
- KafkaOutputTopic string `json:"kafkaOutputTopic"`
- FilterType string `json:"filterType"`
Filter json.RawMessage `json:"filter"`
DeliveryInfo struct {
Topic string `json:"topic"`
Filter json.RawMessage `json:"filter"`
DeliveryInfo struct {
Topic string `json:"topic"`
@@
-77,7
+75,7
@@
var gzipped_data = os.Getenv("GZIP")
var log_payload = os.Getenv("LOG_PAYLOAD")
var log_payload = os.Getenv("LOG_PAYLOAD")
-// Th
is
are optional - if rapp is fethcing the token instead of the side car
+// Th
ese
are optional - if rapp is fethcing the token instead of the side car
var creds_grant_type = os.Getenv("CREDS_GRANT_TYPE")
var creds_client_secret = os.Getenv("CREDS_CLIENT_SECRET")
var creds_client_id = os.Getenv("CREDS_CLIENT_ID")
var creds_grant_type = os.Getenv("CREDS_GRANT_TYPE")
var creds_client_secret = os.Getenv("CREDS_CLIENT_SECRET")
var creds_client_id = os.Getenv("CREDS_CLIENT_ID")
@@
-165,13
+163,12
@@
func main() {
os.Exit(1)
}
job_type := job_json.InfoTypeID
os.Exit(1)
}
job_type := job_json.InfoTypeID
- job_json.JobDefinition.KafkaOutputTopic = topic
job_json.JobDefinition.DeliveryInfo.Topic = topic
job_json.JobDefinition.DeliveryInfo.BootStrapServers = bootstrapserver
job_json.JobDefinition.DeliveryInfo.Topic = topic
job_json.JobDefinition.DeliveryInfo.BootStrapServers = bootstrapserver
- gid = "pm-rapp-" + job_type + "-" + rapp_id
+
gid = "pm-rapp-" + job_type + "-" + rapp_id
- jobid = "rapp-job-" + job_type + "-" + rapp_id
+
jobid = "rapp-job-" + job_type + "-" + rapp_id
json_bytes, err := json.Marshal(job_json)
if err != nil {
json_bytes, err := json.Marshal(job_json)
if err != nil {
@@
-399,7
+396,7
@@
func send_http_request(jsonData []byte, method string, url string, contentType s
}
if jwt_file != "" || creds_service_url != "" {
if accessToken != "" {
}
if jwt_file != "" || creds_service_url != "" {
if accessToken != "" {
- req.Header.
Add("authorization",
accessToken)
+ req.Header.
Set("Authorization", "Bearer "+
accessToken)
} else {
log.Error("Cannot create http request for url: ", url, " - token missing")
return false, nil
} else {
log.Error("Cannot create http request for url: ", url, " - token missing")
return false, nil
@@
-455,7
+452,7
@@
func send_http_request(jsonData []byte, method string, url string, contentType s
}
}
} else {
}
}
} else {
- log.Error("Bad response, method: ", method, " url: ", url, " resp: ", resp.StatusCode)
+ log.Error("Bad response, method: ", method, " url: ", url, " resp: ", resp.StatusCode
, " resp: ", resp
)
}
}
}
}
}
}