From ade725f66756df5896fa01f25faada3b953f91c9 Mon Sep 17 00:00:00 2001 From: andronache Date: Mon, 10 May 2021 15:59:12 +0300 Subject: [PATCH] Finished changing opts for Event Exporter --- apier/v1/apier_it_test.go | 0 config/config_defaults.go | 19 +++++----- .../samples/cdrsexport_internal/cgrates.json | 38 +++++++++---------- ers/s3_test.go | 0 4 files changed, 28 insertions(+), 29 deletions(-) create mode 100644 apier/v1/apier_it_test.go create mode 100644 ers/s3_test.go diff --git a/apier/v1/apier_it_test.go b/apier/v1/apier_it_test.go new file mode 100644 index 000000000..e69de29bb diff --git a/config/config_defaults.go b/config/config_defaults.go index f4a38736d..470bc177f 100644 --- a/config/config_defaults.go +++ b/config/config_defaults.go @@ -428,15 +428,11 @@ const CGRATES_CFG_JSON = ` "type": "*none", // exporter type "export_path": "/var/spool/cgrates/ees", // path where the exported events will be placed "opts": { - - // General - // "queueID": "cgrates_cdrs", // the queue id where events are exported - // CSV // "csvFieldSeparator": ",", // separator used when reading the fields - + // Elasticsearch options // "elsIndex": "", // ElsIndex // "elsIfPrimaryTerm": 0, // ElsIfPrimaryTerm @@ -464,14 +460,17 @@ const CGRATES_CFG_JSON = ` // Kafka // "kafkaTopic": "cgrates", // the topic from where the events are exported - + // AMQP - // "amqpRoutingKey": "", // RoutingKey - // "sqlExchange": "", // Exchange - // "sqlExchangeType": "", // ExchangeType - + // "amqpQueueID": "cgrates_cdrs", // the queue id for AMQP exporters from were the events are exported + // "amqpRoutingKey": "", // RoutingKey + // "sqlExchange": "", // Exchange + // "sqlExchangeType": "", // ExchangeType + // SQS and S3 + // "sqsQueueID": "cgrates_cdrs", // the queue id for SQS exporters from were the events are exported + // "s3BucketID": "cgrates_cdrs", // the bucket id for S3 readers from where the events that are exported // "awsRegion": "", // AWSRegion // "awsKey": "", // AWSKey // "awsSecret": "", // AWSSecret diff --git a/data/conf/samples/cdrsexport_internal/cgrates.json b/data/conf/samples/cdrsexport_internal/cgrates.json index 83e159989..aeea69a8a 100644 --- a/data/conf/samples/cdrsexport_internal/cgrates.json +++ b/data/conf/samples/cdrsexport_internal/cgrates.json @@ -11,12 +11,12 @@ }, "data_db": { - "db_type": "*internal", + "db_type": "*internal" }, "stor_db": { - "db_type": "*internal", + "db_type": "*internal" }, @@ -26,13 +26,13 @@ "attributes": { - "enabled": true, + "enabled": true }, "chargers": { "enabled": true, - "attributes_conns": ["*internal"], + "attributes_conns": ["*internal"] }, @@ -56,8 +56,8 @@ "tenant": "cgrates.org", "attempts": 1, "fields":[ - {"tag": "RequiredTemplate","type": "*template", "value": "requiredFields"}, - ], + {"tag": "RequiredTemplate","type": "*template", "value": "requiredFields"} + ] }, { "id": "amqp_localhost", @@ -72,8 +72,8 @@ "tenant": "cgrates.org", "attempts": 20, "fields":[ - {"tag": "RequiredTemplate","type": "*template", "value": "requiredFields"}, - ], + {"tag": "RequiredTemplate","type": "*template", "value": "requiredFields"} + ] }, { "id": "aws_test_file", @@ -85,8 +85,8 @@ "tenant": "cgrates.org", "attempts": 1, "fields":[ - {"tag": "RequiredTemplate","type": "*template", "value": "requiredFields"}, - ], + {"tag": "RequiredTemplate","type": "*template", "value": "requiredFields"} + ] }, { "id": "sqs_test_file", @@ -103,21 +103,21 @@ "tenant": "cgrates.org", "attempts": 1, "fields":[ - {"tag": "RequiredTemplate","type": "*template", "value": "requiredFields"}, - ], + {"tag": "RequiredTemplate","type": "*template", "value": "requiredFields"} + ] }, { "id": "kafka_localhost", "type": "*kafka_json_map", "export_path": "127.0.0.1:9092", "opts":{ - "kafkaTopic": "cgrates_cdrs", + "kafkaTopic": "cgrates_cdrs" }, "tenant": "cgrates.org", "attempts": 10, "fields":[ - {"tag": "RequiredTemplate","type": "*template", "value": "requiredFields"}, - ], + {"tag": "RequiredTemplate","type": "*template", "value": "requiredFields"} + ] }, { "id": "s3_test_file", @@ -134,10 +134,10 @@ "tenant": "cgrates.org", "attempts": 1, "fields":[ - {"tag": "RequiredTemplate","type": "*template", "value": "requiredFields"}, - ], - }, - ], + {"tag": "RequiredTemplate","type": "*template", "value": "requiredFields"} + ] + } + ] }, diff --git a/ers/s3_test.go b/ers/s3_test.go new file mode 100644 index 000000000..e69de29bb