Update DMaaP plugin - DataRouter subscriber creation 51/90451/1
authorJoeOLeary <joseph.o.leary@est.tech>
Tue, 25 Jun 2019 13:26:56 +0000 (13:26 +0000)
committerJoeOLeary <joseph.o.leary@est.tech>
Tue, 25 Jun 2019 13:26:56 +0000 (13:26 +0000)
- Add privileged subscriber flag.
- Add decompression flag.

Change-Id: Id3c2e7fb88d858f4a1ebe4e1ab86598c0f3f30a0
Issue-ID: DCAEGEN2-1581
Signed-off-by: JoeOLeary <joseph.o.leary@est.tech>
dmaap/dmaap.yaml
dmaap/dmaapcontrollerif/dmaap_requests.py
dmaap/dmaapplugin/dr_relationships.py
dmaap/setup.py

index 36a32e5..77397bb 100644 (file)
@@ -25,7 +25,7 @@ plugins:
   dmaapplugin:
     executor: 'central_deployment_agent'
     package_name: dmaap
-    package_version: 1.3.2
+    package_version: 1.3.3
 
 
 node_types:
index 5506865..813a1d8 100644 (file)
@@ -165,7 +165,7 @@ class DMaaPControllerHandle(object):
 
 
     # Data Router SUbscrihers
-    def add_subscriber(self, feed_id, location, delivery_url, username, password, status=None):
+    def add_subscriber(self, feed_id, location, delivery_url, username, password, decompress, privileged, status=None):
         '''
         Add a publisher to feed feed_id at location location with user, pass, and status
         '''
@@ -174,7 +174,9 @@ class DMaaPControllerHandle(object):
             'dcaeLocationName' : location,
             'deliveryURL' : delivery_url,
             'username' : username,
-            'userpwd' : password
+            'userpwd' : password,
+            'decompress': decompress,
+            'privilegedSubscriber': privileged
         }
 
         if status:
index dd67394..2f342f3 100644 (file)
@@ -148,14 +148,17 @@ def add_dr_subscriber(**kwargs):
 
         # Get the parameters for the call
         feed_id = ctx.target.instance.runtime_properties["feed_id"]
-        location = ctx.source.instance.runtime_properties[target_feed]["location"]
-        delivery_url = ctx.source.instance.runtime_properties[target_feed]["delivery_url"]
-        username = ctx.source.instance.runtime_properties[target_feed]["username"]
-        password = ctx.source.instance.runtime_properties[target_feed]["password"]
+        feed = ctx.source.instance.runtime_properties[target_feed]
+        location = feed["location"]
+        delivery_url = feed["delivery_url"]
+        username = feed["username"]
+        password = feed["password"]
+        decompress = feed["decompress"] if "decompress" in feed else False
+        privileged = feed["privileged"] if "privileged" in feed else False
 
         # Make the request to add the subscriber to the feed
         dmc = DMaaPControllerHandle(DMAAP_API_URL, DMAAP_USER, DMAAP_PASS, ctx.logger)
-        add_sub = dmc.add_subscriber(feed_id, location, delivery_url,username, password)
+        add_sub = dmc.add_subscriber(feed_id, location, delivery_url,username, password, decompress, privileged)
         add_sub.raise_for_status()
         subscriber_info = add_sub.json()
         subscriber_id = subscriber_info["subId"]
@@ -168,7 +171,9 @@ def add_dr_subscriber(**kwargs):
             "location" : location,
             "delivery_url" : delivery_url,
             "username" : username,
-            "password" : password
+            "password" : password,
+            "decompress": decompress,
+            "privilegedSubscriber": privileged
         }
         ctx.logger.info("on source: {0}".format(ctx.source.instance.runtime_properties[target_feed]))
 
index c50ce64..938612d 100644 (file)
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
 
 setup(
     name = "dmaap",
-    version = "1.3.2",
+    version = "1.3.3",
     packages=find_packages(),
     author = "AT&T",
     description = ("Cloudify plugin for creating DMaaP feeds and topics, and setting up publishers and subscribers."),