Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inspec cluster updates #124

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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