--------|----|---------|---------------------------------------
topic_name|string|no|a name that uniquely identifies the feed (plugin will generate if absent or is empty string or contain only whitespace)
topic_description|string|no|human-readable description of the feed
-txenable|boolean|no|flag indicating whether transactions are enabled for this topic
+tnxEnabled|boolean|no|flag indicating whether transactions are enabled for this topic
replication_case|string|no|type of replication required for the topic (defaults to no replication)
global_mr_url|string|no|Global MR host name for replication to a global MR instance
# org.onap.dcaegen2
# =============================================================================
# Copyright (c) 2017-2020 AT&T Intellectual Property. All rights reserved.
+# Modifications Copyright © 2021 Nordix Foundation.
# =============================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
dmaapplugin:
executor: 'central_deployment_agent'
package_name: dmaap
- package_version: 1.5.0
+ package_version: 1.5.1
node_types:
topic_description:
type: string
required: false
- txenable:
+ tnxEnabled:
type: boolean
required: false
replication_case:
# =============================================================================
# Copyright (c) 2017-2020 AT&T Intellectual Property. All rights reserved.
# Copyright (c) 2020 Pantheon.tech. All rights reserved.
+# Modifications Copyright (c) 2021 Nordix Foundation.
# =============================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
return self._delete_resource("{0}/{1}".format(self.subs_path, sub_id))
# Message router topics
- def create_topic(self, name, description = None, txenable = None, owner = None, replication_case = None, global_mr_url = None, useExisting = None):
+ def create_topic(self, name, description = None, tnx_enabled = None, owner = None, replication_case = None, global_mr_url = None, use_existing = None):
'''
Create a message router topic with the topic name 'name' and optionally the topic_description
- 'description', the 'txenable' flag, the 'useExisting' flag and the topic owner 'owner'.
+ 'description', the 'tnxEnabled' flag, the 'useExisting' flag and the topic owner 'owner'.
'''
topic_definition = {'topicName' : name}
if description:
topic_definition['topicDescription'] = description
if owner:
topic_definition['owner'] = owner
- if txenable != None: # It's a boolean!
- topic_definition['txenable'] = txenable
+ if tnx_enabled is not None: # It's a boolean!
+ topic_definition['tnxEnabled'] = tnx_enabled
if replication_case:
topic_definition['replicationCase'] = replication_case
if global_mr_url:
topic_definition['globalMrURL'] = global_mr_url
topics_path_query = self.topics_path
- if useExisting == True: # It's a boolean!
+ if use_existing: # It's a boolean!
topics_path_query += "?useExisting=true"
return self._create_resource(topics_path_query, topic_definition)
# =============================================================================
# Copyright (c) 2017-2020 AT&T Intellectual Property. All rights reserved.
# Copyright (c) 2020 Pantheon.tech. All rights reserved.
+# Modifications Copyright (c) 2021 Nordix Foundation.
# =============================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
def create_topic(**kwargs):
'''
Creates a message router topic.
- Allows 'topic_name', 'topic_description', 'txenable', 'replication_case', 'global_mr_url',
+ Allows 'topic_name', 'topic_description', 'tnxEnabled', 'replication_case', 'global_mr_url',
and 'useExisting' as optional node properties. If 'topic_name' is not set,
generates a random one.
Sets 'fqtn' in the instance runtime_properties.
- Note that 'txenable' is a Message Router flag indicating whether transactions
+ Note that 'tnxEnabled' is a Message Router flag indicating whether transactions
are enabled on the topic.
Note that 'useExisting' is a flag indicating whether DBCL will use existing topic if
the topic already exists.
topic_name = random_string(12)
# Make sure there's a topic description
- if "topic_description" in ctx.node.properties:
- topic_description = ctx.node.properties["topic_description"]
- else:
- topic_description = "No description provided"
+ topic_description = ctx.node.properties.get("topic_description", "No description provided")
# ..and the truly optional setting
- if "txenable" in ctx.node.properties:
- txenable = ctx.node.properties["txenable"]
- else:
- txenable= False
+ tnx_enabled = ctx.node.properties.get("tnxEnabled", False)
- if "replication_case" in ctx.node.properties:
- replication_case = ctx.node.properties["replication_case"]
- else:
- replication_case = None
+ replication_case = ctx.node.properties.get("replication_case")
- if "global_mr_url" in ctx.node.properties:
- global_mr_url = ctx.node.properties["global_mr_url"]
- else:
- global_mr_url = None
+ global_mr_url = ctx.node.properties.get("global_mr_url")
- if "useExisting" in ctx.node.properties:
- useExisting = ctx.node.properties["useExisting"]
- else:
- useExisting = False
+ use_existing = ctx.node.properties.get("useExisting", False)
# Make the request to the controller
dmc = DMaaPControllerHandle(DMAAP_API_URL, DMAAP_USER, DMAAP_PASS, ctx.logger)
ctx.logger.info("Attempting to create topic name {0}".format(topic_name))
- t = dmc.create_topic(topic_name, topic_description, txenable, DMAAP_OWNER, replication_case, global_mr_url, useExisting)
+ t = dmc.create_topic(topic_name, topic_description, tnx_enabled, DMAAP_OWNER, replication_case, global_mr_url, use_existing)
t.raise_for_status()
# Capture important properties from the result
org.onap.dcaegen2
================================================================================
Copyright (c) 2019-2020 AT&T Intellectual Property. All rights reserved.
+Modifications Copyright (c) 2021 Nordix Foundation.
================================================================================
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
<artifactId>dmaap</artifactId>
<name>dmaap</name>
- <version>1.5.0-SNAPSHOT</version>
+ <version>1.5.1-SNAPSHOT</version>
<url>http://maven.apache.org</url>
<properties>
<!-- name from the setup.py file -->
# ================================================================================
# Copyright (c) 2017-2020 AT&T Intellectual Property. All rights reserved.
# Copyright (c) 2020 Pantheon.tech. All rights reserved.
+# Modifications Copyright (c) 2021 Nordix Foundation.
# ================================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
topic_name = random_string(12)
# Make sure there's a topic description
- if "topic_description" in ctx.node.properties:
- topic_description = ctx.node.properties["topic_description"]
- else:
- topic_description = "No description provided"
+ topic_description = ctx.node.properties.get("topic_description", "No description provided")
# ..and the truly optional setting
- if "txenable" in ctx.node.properties:
- txenable = ctx.node.properties["txenable"]
- else:
- txenable= False
+ tnx_enabled = ctx.node.properties.get("tnxEnabled", False)
- if "replication_case" in ctx.node.properties:
- replication_case = ctx.node.properties["replication_case"]
- else:
- replication_case = None
+ replication_case = ctx.node.properties.get("replication_case")
- if "global_mr_url" in ctx.node.properties:
- global_mr_url = ctx.node.properties["global_mr_url"]
- else:
- global_mr_url = None
+ global_mr_url = ctx.node.properties.get("global_mr_url")
dmc = DMaaPControllerHandle(DMAAP_API_URL, DMAAP_USER, DMAAP_PASS, ctx.logger)
ctx.logger.info("Attempting to create topic name {0}".format(topic_name))
- t = dmc.create_topic(topic_name, topic_description, txenable, DMAAP_OWNER, replication_case, global_mr_url)
+ t = dmc.create_topic(topic_name, topic_description, tnx_enabled, DMAAP_OWNER, replication_case, global_mr_url)
# Capture important properties from the result
topic = t.json()