diff options
author | JoeOLeary <joseph.o.leary@est.tech> | 2019-06-25 13:26:56 +0000 |
---|---|---|
committer | JoeOLeary <joseph.o.leary@est.tech> | 2019-06-25 13:26:56 +0000 |
commit | 6b5636fe2ddaab95d180876127701e71639faf78 (patch) | |
tree | 65d2bb167b4726ff31277fbfbae1b246e017ad4a | |
parent | d206b39f669ff86e469918ef1db5d3e75f4d18d4 (diff) |
Update DMaaP plugin - DataRouter subscriber creation
- Add privileged subscriber flag.
- Add decompression flag.
Change-Id: Id3c2e7fb88d858f4a1ebe4e1ab86598c0f3f30a0
Issue-ID: DCAEGEN2-1581
Signed-off-by: JoeOLeary <joseph.o.leary@est.tech>
-rw-r--r-- | dmaap/dmaap.yaml | 2 | ||||
-rw-r--r-- | dmaap/dmaapcontrollerif/dmaap_requests.py | 6 | ||||
-rw-r--r-- | dmaap/dmaapplugin/dr_relationships.py | 17 | ||||
-rw-r--r-- | dmaap/setup.py | 2 |
4 files changed, 17 insertions, 10 deletions
diff --git a/dmaap/dmaap.yaml b/dmaap/dmaap.yaml index 36a32e5..77397bb 100644 --- a/dmaap/dmaap.yaml +++ b/dmaap/dmaap.yaml @@ -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: diff --git a/dmaap/dmaapcontrollerif/dmaap_requests.py b/dmaap/dmaapcontrollerif/dmaap_requests.py index 5506865..813a1d8 100644 --- a/dmaap/dmaapcontrollerif/dmaap_requests.py +++ b/dmaap/dmaapcontrollerif/dmaap_requests.py @@ -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: diff --git a/dmaap/dmaapplugin/dr_relationships.py b/dmaap/dmaapplugin/dr_relationships.py index dd67394..2f342f3 100644 --- a/dmaap/dmaapplugin/dr_relationships.py +++ b/dmaap/dmaapplugin/dr_relationships.py @@ -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])) diff --git a/dmaap/setup.py b/dmaap/setup.py index c50ce64..938612d 100644 --- a/dmaap/setup.py +++ b/dmaap/setup.py @@ -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."), |