Skip to content

Commit

Permalink
Merge pull request #124 from modular-magician/codegen-pr-2925
Browse files Browse the repository at this point in the history
Inspec cluster updates
  • Loading branch information
slevenick authored Jan 6, 2020
2 parents e0258e1 + 400c14c commit 2f24dda
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
39 changes: 39 additions & 0 deletions plugins/modules/gcp_container_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -1221,6 +1221,17 @@
- Block specified in CIDR notation.
returned: success
type: str
nodePools:
description:
- Node pools belonging to this cluster.
returned: success
type: complex
contains:
name:
description:
- Name of the node pool.
returned: success
type: str
location:
description:
- The location where the cluster is deployed.
Expand Down Expand Up @@ -1520,6 +1531,7 @@ def response_to_hash(module, response):
u'expireTime': response.get(u'expireTime'),
u'conditions': ClusterConditionsArray(response.get(u'conditions', []), module).from_response(),
u'masterAuthorizedNetworksConfig': ClusterMasterauthorizednetworksconfig(response.get(u'masterAuthorizedNetworksConfig', {}), module).from_response(),
u'nodePools': ClusterNodepoolsArray(response.get(u'nodePools', []), module).from_response(),
}


Expand Down Expand Up @@ -2055,5 +2067,32 @@ def _response_from_item(self, item):
return remove_nones_from_dict({u'displayName': item.get(u'displayName'), u'cidrBlock': item.get(u'cidrBlock')})


class ClusterNodepoolsArray(object):
def __init__(self, request, module):
self.module = module
if request:
self.request = request
else:
self.request = []

def to_request(self):
items = []
for item in self.request:
items.append(self._request_for_item(item))
return items

def from_response(self):
items = []
for item in self.request:
items.append(self._response_from_item(item))
return items

def _request_for_item(self, item):
return remove_nones_from_dict({u'name': item.get('name')})

def _response_from_item(self, item):
return remove_nones_from_dict({u'name': item.get(u'name')})


if __name__ == '__main__':
main()
11 changes: 11 additions & 0 deletions plugins/modules/gcp_container_cluster_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,17 @@
- Block specified in CIDR notation.
returned: success
type: str
nodePools:
description:
- Node pools belonging to this cluster.
returned: success
type: complex
contains:
name:
description:
- Name of the node pool.
returned: success
type: str
location:
description:
- The location where the cluster is deployed.
Expand Down

0 comments on commit 2f24dda

Please sign in to comment.