|
1 | 1 | #!/usr/bin/python |
2 | 2 | # -*- coding: utf-8 -*- |
3 | 3 |
|
4 | | -# Copyright 2023 Cloudera, Inc. All Rights Reserved. |
| 4 | +# Copyright 2025 Cloudera, Inc. All Rights Reserved. |
5 | 5 | # |
6 | 6 | # Licensed under the Apache License, Version 2.0 (the "License"); |
7 | 7 | # you may not use this file except in compliance with the License. |
|
15 | 15 | # See the License for the specific language governing permissions and |
16 | 16 | # limitations under the License. |
17 | 17 |
|
18 | | -# TODO: Update docs |
19 | 18 | DOCUMENTATION = r""" |
20 | 19 | module: df_deployment |
21 | 20 | short_description: Enable or Disable CDP DataFlow Deployments |
|
134 | 133 | - Definitions of KPIs to apply to the Deployed Flow |
135 | 134 | type: list |
136 | 135 | required: False |
| 136 | + inbound_hostname: |
| 137 | + description: |
| 138 | + - Fully qualified domain name (FQDN) for the inbound host where the DataFlow Service accepts incoming connections |
| 139 | + type: str |
| 140 | + required: False |
| 141 | + listen_components: |
| 142 | + description: |
| 143 | + - List of ports and protocols through which the DataFlow Service accepts incoming connections |
| 144 | + type: list |
| 145 | + required: False |
137 | 146 | delay: |
138 | 147 | description: |
139 | 148 | - The internal polling interval (in seconds) while the module waits for the Dataflow Service to achieve the |
|
166 | 175 | - cloudera.cloud.df_deployment: |
167 | 176 | name: my-flow |
168 | 177 |
|
| 178 | +# Deploy a Dataflow with specific Flow and Version and accepting inbound connection |
| 179 | +- cloudera.cloud.df_deployment: |
| 180 | + name: my-flow |
| 181 | + flow_name: exmple-kafka-flow-definition |
| 182 | + nifi_ver: "2.3.0.4.3.2.0-89" |
| 183 | + parameter_groups: |
| 184 | + - name: "parameters" |
| 185 | + parameters: |
| 186 | + - name: "brokers" |
| 187 | + value: "edge-data-kafka-brokers:9091" |
| 188 | + assetReferences: [] |
| 189 | + - name: "topic" |
| 190 | + value: "my-kafka-topic" |
| 191 | + assetReferences: [] |
| 192 | + - name: "workload.password" |
| 193 | + value: "example-password" |
| 194 | + assetReferences: [] |
| 195 | + - name: "workload.user" |
| 196 | + value: "example-user" |
| 197 | + assetReferences: [] |
| 198 | + inbound_hostname: "receivetxn.inbound.example.com" |
| 199 | + listen_components: |
| 200 | + - protocol: "TCP" |
| 201 | + port: "10001" |
| 202 | +
|
169 | 203 | # Remove a Dataflow Service with Async wait |
170 | 204 | - cloudera.cloud.df_deployment: |
171 | 205 | name: my-flow-name |
@@ -349,6 +383,8 @@ def __init__(self, module): |
349 | 383 | self.autostart_flow = self._get_param("autostart_flow") |
350 | 384 | self.parameter_groups = self._get_param("parameter_groups") |
351 | 385 | self.kpis = self._get_param("kpis") |
| 386 | + self.inbound_hostname = self._get_param("inbound_hostname") |
| 387 | + self.listen_components = self._get_param("listen_components") |
352 | 388 |
|
353 | 389 | self.state = self._get_param("state") |
354 | 390 | self.wait = self._get_param("wait") |
@@ -461,6 +497,8 @@ def _create_deployment(self): |
461 | 497 | autostart_flow=self.autostart_flow, |
462 | 498 | parameter_groups=self.parameter_groups, |
463 | 499 | kpis=self.kpis, |
| 500 | + inbound_hostname=self.inbound_hostname, |
| 501 | + listen_components=self.listen_components, |
464 | 502 | ) |
465 | 503 | self.changed = True |
466 | 504 |
|
@@ -519,6 +557,8 @@ def main(): |
519 | 557 | autostart_flow=dict(type="bool", default=True), |
520 | 558 | parameter_groups=dict(type="list", default=None), |
521 | 559 | kpis=dict(type="list", default=None), |
| 560 | + inbound_hostname=dict(type="str", default=None), |
| 561 | + listen_components=dict(type="list", default=None), |
522 | 562 | state=dict(type="str", choices=["present", "absent"], default="present"), |
523 | 563 | wait=dict(type="bool", default=True), |
524 | 564 | delay=dict(type="int", aliases=["polling_delay"], default=15), |
|
0 commit comments