Skip to content

Commit 34fc07a

Browse files
committed
Update parameter naming, aliases, and requirements
Signed-off-by: Webster Mudge <wmudge@cloudera.com>
1 parent c4ddd4f commit 34fc07a

File tree

2 files changed

+39
-31
lines changed

2 files changed

+39
-31
lines changed

plugins/modules/dw_cluster.py

Lines changed: 30 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,19 @@
3535
requirements:
3636
- cdpy
3737
options:
38-
name:
38+
cluster_id:
3939
description:
4040
- The identifier of the Data Warehouse Cluster.
41-
- Required if C(state=absent) and C(env) is not specified.
41+
- Required if I(state=absent) and I(env) is not specified.
4242
type: str
4343
aliases:
4444
- id
45+
- name
4546
env:
4647
description:
4748
- The name of the target environment.
48-
- Required if C(state=present) or C(state=absent) and C(id) is not specified.
49+
- Required if I(state=present).
50+
- Required if I(state=absent) and I(cluster_id) is not specified.
4951
type: str
5052
aliases:
5153
- environment
@@ -63,24 +65,24 @@
6365
aws_public_subnets:
6466
description:
6567
- List of zero or more Public AWS Subnet IDs used for deployment.
66-
- Required if C(state=present) and the C(env) is deployed to AWS.
68+
- Required if I(state=present) and the I(env) is deployed to AWS.
6769
type: list
6870
elements: str
6971
aws_private_subnets:
7072
description:
7173
- List of zero or more Private AWS Subnet IDs used for deployment.
72-
- Required if C(state=present) and the C(env) is deployed to AWS.
74+
- Required if I(state=present) and the I(env) is deployed to AWS.
7375
type: list
7476
elements: str
7577
az_subnet:
7678
description:
7779
- The Azure Subnet Name.
78-
- Required if C(state=present) and the C(env) is deployed to Azure.
80+
- Required if I(state=present) and the I(env) is deployed to Azure.
7981
type: str
8082
az_enable_az:
8183
description:
8284
- Flag to enable Availability Zone mode.
83-
- Required if C(state=present) and the C(env) is deployed to Azure.
85+
- Required if I(state=present) and the I(env) is deployed to Azure.
8486
type: bool
8587
state:
8688
description: The state of the Data Warehouse Cluster
@@ -154,45 +156,49 @@
154156
description: Details for the Data Warehouse cluster
155157
type: dict
156158
contains:
157-
name:
158-
description: The name of the cluster.
159+
id:
160+
description: The cluster identifier.
159161
returned: always
160162
type: str
161163
environmentCrn:
162-
description: The crn of the cluster's environment.
164+
description: The CRN of the cluster's Environment
163165
returned: always
164166
type: str
165167
crn:
166168
description: The cluster's CRN.
167169
returned: always
168170
type: str
169171
creationDate:
170-
description: The creation time of the cluster in UTC.
172+
description: The creation timestamp of the cluster in UTC.
171173
returned: always
172174
type: str
173175
status:
174-
description: The status of the cluster.
176+
description: The status of the cluster
175177
returned: always
176178
type: str
177179
creator:
178-
description: The details regarding the cluster creator.
180+
description: The cluster creator details.
179181
returned: always
180182
type: dict
181183
contains:
182184
crn:
185+
description: The Actor CRN.
183186
type: str
184-
description: The creator's CRN
187+
returned: always
185188
email:
189+
description: Email address (users).
186190
type: str
187-
description: Email address
191+
returned: when supported
188192
workloadUsername:
193+
description: Username (users).
189194
type: str
190-
description: Username
195+
returned: when supported
191196
machineUsername:
197+
description: Username (machine users).
192198
type: str
193-
description: Username for machine users
199+
returned: when supported
194200
cloudPlatform:
195-
description: The cloud platform of the environment housing the Data Warehouse cluster
201+
description: The cloud platform of the environment that was used to create this cluster.
196202
returned: always
197203
type: str
198204
sdk_out:
@@ -325,14 +331,14 @@ def process(self):
325331
def main():
326332
module = AnsibleModule(
327333
argument_spec=CdpModule.argument_spec(
328-
name=dict(type='str', aliases=['id']),
334+
cluster_id=dict(type='str', aliases=['id', 'name']),
329335
env=dict(type='str', aliases=['environment', 'env_crn']),
330336
overlay=dict(type='bool', default=False),
331337
private_load_balancer=dict(type='bool', default=False),
332-
az_subnet=dict(type='str', default=None),
333-
az_enable_az=dict(type='bool', default=None),
334-
aws_public_subnets=dict(type='list', default=None),
335-
aws_private_subnets=dict(type='list', default=None),
338+
az_subnet=dict(type='str'),
339+
az_enable_az=dict(type='bool'),
340+
aws_public_subnets=dict(type='list'),
341+
aws_private_subnets=dict(type='list'),
336342
state=dict(type='str', choices=['present', 'absent'], default='present'),
337343
force=dict(type='bool', default=False),
338344
wait=dict(type='bool', default=True),
@@ -344,7 +350,7 @@ def main():
344350
['aws_public_subnets', 'aws_private_subnets']
345351
],
346352
required_if=[
347-
['state', 'absent', ['name', 'env']],
353+
['state', 'absent', ['cluster_id', 'env'], True],
348354
['state', 'present', ['env']]
349355
],
350356
supports_check_mode=True

plugins/modules/dw_virtual_warehouse.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@
4040
- The identifier of the Virtual Warehouse.
4141
- Required if C(state=absent).
4242
type: str
43+
aliases:
44+
- vw_id
4345
cluster_id:
4446
description:
4547
- The identifier of the parent Data Warehouse Cluster of the Virtual Warehouse.
@@ -246,7 +248,7 @@
246248
virtual_warehouse:
247249
description: The details about the CDP Data Warehouse Virtual Warehouse.
248250
type: dict
249-
suboptions:
251+
contains:
250252
id:
251253
description: The identifier of the Virtual Warehouse.
252254
returned: always
@@ -272,25 +274,25 @@
272274
returned: always
273275
type: str
274276
creator:
275-
description: The CRN of the Virtual Warehouse creator.
277+
description: Details about the Virtual Warehouse creator.
276278
returned: always
277279
type: dict
278280
suboptions:
279281
crn:
282+
description: The creator's Actor CRN.
280283
type: str
281-
description: The creator's Actor CRN
282284
returned: always
283285
email:
286+
description: Email address (for users).
284287
type: str
285-
description: Email address (for users)
286288
returned: when supported
287289
workloadUsername:
290+
description: Username (for users).
288291
type: str
289-
description: Username (for users)
290292
returned: when supported
291293
machineUsername:
294+
description: Username (for machine users).
292295
type: str
293-
description: Username (for machine users)
294296
returned: when supported
295297
tags:
296298
description: Custom tags applied to the Virtual Warehouse.
@@ -420,7 +422,7 @@ def process(self):
420422
def main():
421423
module = AnsibleModule(
422424
argument_spec=CdpModule.argument_spec(
423-
id=dict(type='str'),
425+
id=dict(type='str', aliases=['vw_id']),
424426
cluster_id=dict(required=True, type='str'),
425427
dbc_id=dict(type='str'),
426428
type = dict(type='str'),

0 commit comments

Comments
 (0)