diff options
Diffstat (limited to 'ansible_collections/cisco/meraki/plugins')
594 files changed, 23135 insertions, 5573 deletions
diff --git a/ansible_collections/cisco/meraki/plugins/action/administered_licensing_subscription_entitlements_info.py b/ansible_collections/cisco/meraki/plugins/action/administered_licensing_subscription_entitlements_info.py new file mode 100644 index 000000000..b5af8055e --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/action/administered_licensing_subscription_entitlements_info.py @@ -0,0 +1,90 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( + MERAKI, + meraki_argument_spec, +) + +# Get common arguments specification +argument_spec = meraki_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + skus=dict(type="list"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail( + "ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_all(self, params): + new_object = {} + if params.get("skus") is not None: + new_object["skus"] = params.get( + "skus") + + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(meraki_response={})) + + meraki = MERAKI(params=self._task.args) + + response = meraki.exec_meraki( + family="licensing", + function='getAdministeredLicensingSubscriptionEntitlements', + params=self.get_all(self._task.args), + ) + self._result.update(dict(meraki_response=response)) + self._result.update(meraki.exit_json()) + return self._result diff --git a/ansible_collections/cisco/meraki/plugins/action/administered_licensing_subscription_subscriptions_bind.py b/ansible_collections/cisco/meraki/plugins/action/administered_licensing_subscription_subscriptions_bind.py new file mode 100644 index 000000000..e3cc7eba1 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/action/administered_licensing_subscription_subscriptions_bind.py @@ -0,0 +1,91 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( + MERAKI, + meraki_argument_spec, +) + +# Get common arguements specification +argument_spec = meraki_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + networkIds=dict(type="list"), + subscriptionId=dict(type="str"), + validate=dict(type="bool"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail( + "ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + networkIds=params.get("networkIds"), + subscription_id=params.get("subscriptionId"), + validate=params.get("validate"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + meraki = MERAKI(params=self._task.args) + + response = meraki.exec_meraki( + family="licensing", + function='bindAdministeredLicensingSubscriptionSubscription', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(meraki_response=response)) + self._result.update(meraki.exit_json()) + return self._result diff --git a/ansible_collections/cisco/meraki/plugins/action/administered_licensing_subscription_subscriptions_claim.py b/ansible_collections/cisco/meraki/plugins/action/administered_licensing_subscription_subscriptions_claim.py new file mode 100644 index 000000000..cf02a8ac6 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/action/administered_licensing_subscription_subscriptions_claim.py @@ -0,0 +1,95 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( + MERAKI, + meraki_argument_spec, +) + +# Get common arguements specification +argument_spec = meraki_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + claimKey=dict(type="str"), + description=dict(type="str"), + name=dict(type="str"), + organizationId=dict(type="str"), + validate=dict(type="bool"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail( + "ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + claimKey=params.get("claimKey"), + description=params.get("description"), + name=params.get("name"), + organizationId=params.get("organizationId"), + validate=params.get("validate"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + meraki = MERAKI(params=self._task.args) + + response = meraki.exec_meraki( + family="licensing", + function='claimAdministeredLicensingSubscriptionSubscriptions', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(meraki_response=response)) + self._result.update(meraki.exit_json()) + return self._result diff --git a/ansible_collections/cisco/meraki/plugins/action/administered_licensing_subscription_subscriptions_claim_key_validate.py b/ansible_collections/cisco/meraki/plugins/action/administered_licensing_subscription_subscriptions_claim_key_validate.py new file mode 100644 index 000000000..9113049d7 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/action/administered_licensing_subscription_subscriptions_claim_key_validate.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( + MERAKI, + meraki_argument_spec, +) + +# Get common arguements specification +argument_spec = meraki_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + claimKey=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail( + "ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + claimKey=params.get("claimKey"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + meraki = MERAKI(params=self._task.args) + + response = meraki.exec_meraki( + family="licensing", + function='validateAdministeredLicensingSubscriptionSubscriptionsClaimKey', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(meraki_response=response)) + self._result.update(meraki.exit_json()) + return self._result diff --git a/ansible_collections/cisco/meraki/plugins/action/administered_licensing_subscription_subscriptions_compliance_statuses_info.py b/ansible_collections/cisco/meraki/plugins/action/administered_licensing_subscription_subscriptions_compliance_statuses_info.py new file mode 100644 index 000000000..ec2d035ab --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/action/administered_licensing_subscription_subscriptions_compliance_statuses_info.py @@ -0,0 +1,94 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( + MERAKI, + meraki_argument_spec, +) + +# Get common arguments specification +argument_spec = meraki_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + organizationIds=dict(type="list"), + subscriptionIds=dict(type="list"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail( + "ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_all(self, params): + new_object = {} + if params.get("organizationIds") is not None: + new_object["organizationIds"] = params.get( + "organizationIds") + if params.get("subscriptionIds") is not None: + new_object["subscriptionIds"] = params.get( + "subscriptionIds") + + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(meraki_response={})) + + meraki = MERAKI(params=self._task.args) + + response = meraki.exec_meraki( + family="licensing", + function='getAdministeredLicensingSubscriptionSubscriptionsComplianceStatuses', + params=self.get_all(self._task.args), + ) + self._result.update(dict(meraki_response=response)) + self._result.update(meraki.exit_json()) + return self._result diff --git a/ansible_collections/cisco/meraki/plugins/action/administered_licensing_subscription_subscriptions_info.py b/ansible_collections/cisco/meraki/plugins/action/administered_licensing_subscription_subscriptions_info.py new file mode 100644 index 000000000..8be76a060 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/action/administered_licensing_subscription_subscriptions_info.py @@ -0,0 +1,128 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( + MERAKI, + meraki_argument_spec, +) + +# Get common arguments specification +argument_spec = meraki_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + perPage=dict(type="int"), + total_pages=dict(type="int"), + direction=dict(type="str"), + startingAfter=dict(type="str"), + endingBefore=dict(type="str"), + subscriptionIds=dict(type="list"), + organizationIds=dict(type="list"), + statuses=dict(type="list"), + productTypes=dict(type="list"), + startDate=dict(type="str"), + endDate=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail( + "ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_all(self, params): + new_object = {} + if params.get("perPage") is not None: + new_object["perPage"] = params.get( + "perPage") + new_object['total_pages'] = params.get( + "total_pages") or 1 + new_object['direction'] = params.get( + "direction") or "next" + if params.get("startingAfter") is not None: + new_object["startingAfter"] = params.get( + "startingAfter") + if params.get("endingBefore") is not None: + new_object["endingBefore"] = params.get( + "endingBefore") + if params.get("subscriptionIds") is not None: + new_object["subscriptionIds"] = params.get( + "subscriptionIds") + if params.get("organizationIds") is not None: + new_object["organizationIds"] = params.get( + "organizationIds") + if params.get("statuses") is not None: + new_object["statuses"] = params.get( + "statuses") + if params.get("productTypes") is not None: + new_object["productTypes"] = params.get( + "productTypes") + if params.get("startDate") is not None: + new_object["startDate"] = params.get( + "startDate") + if params.get("endDate") is not None: + new_object["endDate"] = params.get( + "endDate") + + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(meraki_response={})) + + meraki = MERAKI(params=self._task.args) + + response = meraki.exec_meraki( + family="licensing", + function='getAdministeredLicensingSubscriptionSubscriptions', + params=self.get_all(self._task.args), + ) + self._result.update(dict(meraki_response=response)) + self._result.update(meraki.exit_json()) + return self._result diff --git a/ansible_collections/cisco/meraki/plugins/action/devices.py b/ansible_collections/cisco/meraki/plugins/action/devices.py index df0edfd10..49d41b1a7 100644 --- a/ansible_collections/cisco/meraki/plugins/action/devices.py +++ b/ansible_collections/cisco/meraki/plugins/action/devices.py @@ -32,16 +32,15 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present"]), - name=dict(type="str"), - tags=dict(type="list"), + address=dict(type="str"), + floorPlanId=dict(type="str"), lat=dict(type="float"), lng=dict(type="float"), - address=dict(type="str"), - notes=dict(type="str"), moveMapMarker=dict(type="bool"), + name=dict(type="str"), + notes=dict(type="str"), switchProfileId=dict(type="str"), - floorPlanId=dict(type="str"), - mac=dict(type="str"), + tags=dict(type="list"), serial=dict(type="str"), organizationId=dict(type="str"), )) @@ -58,16 +57,15 @@ class Devices(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( - name=params.get("name"), - tags=params.get("tags"), + address=params.get("address"), + floorPlanId=params.get("floorPlanId"), lat=params.get("lat"), lng=params.get("lng"), - address=params.get("address"), - notes=params.get("notes"), moveMapMarker=params.get("moveMapMarker"), + name=params.get("name"), + notes=params.get("notes"), switchProfileId=params.get("switchProfileId"), - floorPlanId=params.get("floorPlanId"), - mac=params.get("mac"), + tags=params.get("tags"), serial=params.get("serial"), organization_id=params.get("organizationId"), ) @@ -130,36 +128,32 @@ class Devices(object): def update_by_id_params(self): new_object_params = {} - if self.new_object.get('name') is not None or self.new_object.get('name') is not None: - new_object_params['name'] = self.new_object.get('name') or \ - self.new_object.get('name') - if self.new_object.get('tags') is not None or self.new_object.get('tags') is not None: - new_object_params['tags'] = self.new_object.get('tags') or \ - self.new_object.get('tags') + if self.new_object.get('address') is not None or self.new_object.get('address') is not None: + new_object_params['address'] = self.new_object.get('address') or \ + self.new_object.get('address') + if self.new_object.get('floorPlanId') is not None or self.new_object.get('floor_plan_id') is not None: + new_object_params['floorPlanId'] = self.new_object.get('floorPlanId') or \ + self.new_object.get('floor_plan_id') if self.new_object.get('lat') is not None or self.new_object.get('lat') is not None: new_object_params['lat'] = self.new_object.get('lat') or \ self.new_object.get('lat') if self.new_object.get('lng') is not None or self.new_object.get('lng') is not None: new_object_params['lng'] = self.new_object.get('lng') or \ self.new_object.get('lng') - if self.new_object.get('address') is not None or self.new_object.get('address') is not None: - new_object_params['address'] = self.new_object.get('address') or \ - self.new_object.get('address') + if self.new_object.get('moveMapMarker') is not None or self.new_object.get('move_map_marker') is not None: + new_object_params['moveMapMarker'] = self.new_object.get('moveMapMarker') + if self.new_object.get('name') is not None or self.new_object.get('name') is not None: + new_object_params['name'] = self.new_object.get('name') or \ + self.new_object.get('name') if self.new_object.get('notes') is not None or self.new_object.get('notes') is not None: new_object_params['notes'] = self.new_object.get('notes') or \ self.new_object.get('notes') - if self.new_object.get('moveMapMarker') is not None or self.new_object.get('move_map_marker') is not None: - new_object_params['moveMapMarker'] = self.new_object.get( - 'moveMapMarker') if self.new_object.get('switchProfileId') is not None or self.new_object.get('switch_profile_id') is not None: new_object_params['switchProfileId'] = self.new_object.get('switchProfileId') or \ self.new_object.get('switch_profile_id') - if self.new_object.get('floorPlanId') is not None or self.new_object.get('floor_plan_id') is not None: - new_object_params['floorPlanId'] = self.new_object.get('floorPlanId') or \ - self.new_object.get('floor_plan_id') - if self.new_object.get('mac') is not None or self.new_object.get('mac') is not None: - new_object_params['mac'] = self.new_object.get('mac') or \ - self.new_object.get('mac') + if self.new_object.get('tags') is not None or self.new_object.get('tags') is not None: + new_object_params['tags'] = self.new_object.get('tags') or \ + self.new_object.get('tags') if self.new_object.get('serial') is not None or self.new_object.get('serial') is not None: new_object_params['serial'] = self.new_object.get('serial') or \ self.new_object.get('serial') @@ -238,16 +232,15 @@ class Devices(object): requested_obj = self.new_object obj_params = [ - ("name", "name"), - ("tags", "tags"), + ("address", "address"), + ("floorPlanId", "floorPlanId"), ("lat", "lat"), ("lng", "lng"), - ("address", "address"), - ("notes", "notes"), ("moveMapMarker", "moveMapMarker"), + ("name", "name"), + ("notes", "notes"), ("switchProfileId", "switchProfileId"), - ("floorPlanId", "floorPlanId"), - ("mac", "mac"), + ("tags", "tags"), ("serial", "serial"), ("organizationId", "organizationId"), ] diff --git a/ansible_collections/cisco/meraki/plugins/action/devices_appliance_radio_settings.py b/ansible_collections/cisco/meraki/plugins/action/devices_appliance_radio_settings.py new file mode 100644 index 000000000..783ba4821 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/action/devices_appliance_radio_settings.py @@ -0,0 +1,211 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or +# https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( + MERAKI, + meraki_argument_spec, + meraki_compare_equality, + get_dict_result, +) +from ansible_collections.cisco.meraki.plugins.plugin_utils.exceptions import ( + InconsistentParameters, +) + +# Get common arguments specification +argument_spec = meraki_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present"]), + fiveGhzSettings=dict(type="dict"), + rfProfileId=dict(type="str"), + twoFourGhzSettings=dict(type="dict"), + serial=dict(type="str"), +)) + +required_if = [ + ("state", "present", ["serial"], True), +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class DevicesApplianceRadioSettings(object): + def __init__(self, params, meraki): + self.meraki = meraki + self.new_object = dict( + fiveGhzSettings=params.get("fiveGhzSettings"), + rfProfileId=params.get("rfProfileId"), + twoFourGhzSettings=params.get("twoFourGhzSettings"), + serial=params.get("serial"), + ) + + def get_all_params(self, name=None, id=None): + new_object_params = {} + if self.new_object.get('serial') is not None or self.new_object.get('serial') is not None: + new_object_params['serial'] = self.new_object.get('serial') + return new_object_params + + def update_all_params(self): + new_object_params = {} + if self.new_object.get('fiveGhzSettings') is not None or self.new_object.get('five_ghz_settings') is not None: + new_object_params['fiveGhzSettings'] = self.new_object.get('fiveGhzSettings') or \ + self.new_object.get('five_ghz_settings') + if self.new_object.get('rfProfileId') is not None or self.new_object.get('rf_profile_id') is not None: + new_object_params['rfProfileId'] = self.new_object.get('rfProfileId') or \ + self.new_object.get('rf_profile_id') + if self.new_object.get('twoFourGhzSettings') is not None or self.new_object.get('two_four_ghz_settings') is not None: + new_object_params['twoFourGhzSettings'] = self.new_object.get('twoFourGhzSettings') or \ + self.new_object.get('two_four_ghz_settings') + if self.new_object.get('serial') is not None or self.new_object.get('serial') is not None: + new_object_params['serial'] = self.new_object.get('serial') or \ + self.new_object.get('serial') + return new_object_params + + def get_object_by_name(self, name): + result = None + # NOTE: Does not have a get by name method, using get all + try: + items = self.meraki.exec_meraki( + family="appliance", + function="getDeviceApplianceRadioSettings", + params=self.get_all_params(name=name), + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'name', name) + if result is None: + result = items + except Exception as e: + print("Error: ", e) + result = None + return result + + def get_object_by_id(self, id): + result = None + # NOTE: Does not have a get by id method or it is in another action + return result + + def exists(self): + prev_obj = None + id_exists = False + name_exists = False + o_id = self.new_object.get("serial") + name = self.new_object.get("name") + if o_id: + prev_obj = self.get_object_by_name(o_id) + id_exists = prev_obj is not None and isinstance(prev_obj, dict) + if not id_exists and name: + prev_obj = self.get_object_by_name(name) + name_exists = prev_obj is not None and isinstance(prev_obj, dict) + if name_exists: + _id = prev_obj.get("id") + if id_exists and name_exists and o_id != _id: + raise InconsistentParameters( + "The 'id' and 'name' params don't refer to the same object") + if _id: + self.new_object.update(dict(id=_id)) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object + + obj_params = [ + ("fiveGhzSettings", "fiveGhzSettings"), + ("rfProfileId", "rfProfileId"), + ("twoFourGhzSettings", "twoFourGhzSettings"), + ("serial", "serial"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params + # If any does not have eq params, it requires update + return any(not meraki_compare_equality(current_obj.get(meraki_param), + requested_obj.get(ansible_param)) + for (meraki_param, ansible_param) in obj_params) + + def update(self): + id = self.new_object.get("id") + name = self.new_object.get("name") + result = None + result = self.meraki.exec_meraki( + family="appliance", + function="updateDeviceApplianceRadioSettings", + params=self.update_all_params(), + op_modifies=True, + ) + return result + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail( + "ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + meraki = MERAKI(self._task.args) + obj = DevicesApplianceRadioSettings(self._task.args, meraki) + + state = self._task.args.get("state") + + response = None + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = obj.update() + meraki.object_updated() + else: + response = prev_obj + meraki.object_already_present() + else: + meraki.fail_json( + "Object does not exists, plugin only has update") + + self._result.update(dict(meraki_response=response)) + self._result.update(meraki.exit_json()) + return self._result diff --git a/ansible_collections/cisco/meraki/plugins/action/devices_appliance_radio_settings_info.py b/ansible_collections/cisco/meraki/plugins/action/devices_appliance_radio_settings_info.py new file mode 100644 index 000000000..2ac8e4768 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/action/devices_appliance_radio_settings_info.py @@ -0,0 +1,90 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( + MERAKI, + meraki_argument_spec, +) + +# Get common arguments specification +argument_spec = meraki_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + serial=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail( + "ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_all(self, params): + new_object = {} + if params.get("serial") is not None: + new_object["serial"] = params.get( + "serial") + + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(meraki_response={})) + + meraki = MERAKI(params=self._task.args) + + response = meraki.exec_meraki( + family="appliance", + function='getDeviceApplianceRadioSettings', + params=self.get_all(self._task.args), + ) + self._result.update(dict(meraki_response=response)) + self._result.update(meraki.exit_json()) + return self._result diff --git a/ansible_collections/cisco/meraki/plugins/action/devices_blink_leds.py b/ansible_collections/cisco/meraki/plugins/action/devices_blink_leds.py index d6e157172..010922bcd 100644 --- a/ansible_collections/cisco/meraki/plugins/action/devices_blink_leds.py +++ b/ansible_collections/cisco/meraki/plugins/action/devices_blink_leds.py @@ -26,8 +26,8 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( duration=dict(type="int"), - period=dict(type="int"), duty=dict(type="int"), + period=dict(type="int"), serial=dict(type="str"), )) @@ -68,8 +68,8 @@ class ActionModule(ActionBase): def get_object(self, params): new_object = dict( duration=params.get("duration"), - period=params.get("period"), duty=params.get("duty"), + period=params.get("period"), serial=params.get("serial"), ) return new_object diff --git a/ansible_collections/cisco/meraki/plugins/action/devices_camera_custom_analytics.py b/ansible_collections/cisco/meraki/plugins/action/devices_camera_custom_analytics.py index 92f3aa3ae..7493fe9b4 100644 --- a/ansible_collections/cisco/meraki/plugins/action/devices_camera_custom_analytics.py +++ b/ansible_collections/cisco/meraki/plugins/action/devices_camera_custom_analytics.py @@ -32,8 +32,8 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present"]), - enabled=dict(type="bool"), artifactId=dict(type="str"), + enabled=dict(type="bool"), parameters=dict(type="list"), serial=dict(type="str"), )) @@ -50,8 +50,8 @@ class DevicesCameraCustomAnalytics(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( - enabled=params.get("enabled"), artifactId=params.get("artifactId"), + enabled=params.get("enabled"), parameters=params.get("parameters"), serial=params.get("serial"), ) @@ -64,11 +64,11 @@ class DevicesCameraCustomAnalytics(object): def update_all_params(self): new_object_params = {} - if self.new_object.get('enabled') is not None or self.new_object.get('enabled') is not None: - new_object_params['enabled'] = self.new_object.get('enabled') if self.new_object.get('artifactId') is not None or self.new_object.get('artifact_id') is not None: new_object_params['artifactId'] = self.new_object.get('artifactId') or \ self.new_object.get('artifact_id') + if self.new_object.get('enabled') is not None or self.new_object.get('enabled') is not None: + new_object_params['enabled'] = self.new_object.get('enabled') if self.new_object.get('parameters') is not None or self.new_object.get('parameters') is not None: new_object_params['parameters'] = self.new_object.get('parameters') or \ self.new_object.get('parameters') @@ -128,8 +128,8 @@ class DevicesCameraCustomAnalytics(object): requested_obj = self.new_object obj_params = [ - ("enabled", "enabled"), ("artifactId", "artifactId"), + ("enabled", "enabled"), ("parameters", "parameters"), ("serial", "serial"), ] diff --git a/ansible_collections/cisco/meraki/plugins/action/devices_camera_generate_snapshot.py b/ansible_collections/cisco/meraki/plugins/action/devices_camera_generate_snapshot.py index 8b7e68487..25f923011 100644 --- a/ansible_collections/cisco/meraki/plugins/action/devices_camera_generate_snapshot.py +++ b/ansible_collections/cisco/meraki/plugins/action/devices_camera_generate_snapshot.py @@ -25,8 +25,8 @@ from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( - timestamp=dict(type="str"), fullframe=dict(type="bool"), + timestamp=dict(type="str"), serial=dict(type="str"), )) @@ -66,8 +66,8 @@ class ActionModule(ActionBase): def get_object(self, params): new_object = dict( - timestamp=params.get("timestamp"), fullframe=params.get("fullframe"), + timestamp=params.get("timestamp"), serial=params.get("serial"), ) return new_object diff --git a/ansible_collections/cisco/meraki/plugins/action/devices_camera_quality_and_retention.py b/ansible_collections/cisco/meraki/plugins/action/devices_camera_quality_and_retention.py index b7781783a..7b5056cf0 100644 --- a/ansible_collections/cisco/meraki/plugins/action/devices_camera_quality_and_retention.py +++ b/ansible_collections/cisco/meraki/plugins/action/devices_camera_quality_and_retention.py @@ -32,13 +32,13 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present"]), - profileId=dict(type="str"), - motionBasedRetentionEnabled=dict(type="bool"), audioRecordingEnabled=dict(type="bool"), - restrictedBandwidthModeEnabled=dict(type="bool"), + motionBasedRetentionEnabled=dict(type="bool"), + motionDetectorVersion=dict(type="int"), + profileId=dict(type="str"), quality=dict(type="str"), resolution=dict(type="str"), - motionDetectorVersion=dict(type="int"), + restrictedBandwidthModeEnabled=dict(type="bool"), serial=dict(type="str"), )) @@ -54,13 +54,13 @@ class DevicesCameraQualityAndRetention(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( - profileId=params.get("profileId"), - motionBasedRetentionEnabled=params.get("motionBasedRetentionEnabled"), audioRecordingEnabled=params.get("audioRecordingEnabled"), - restrictedBandwidthModeEnabled=params.get("restrictedBandwidthModeEnabled"), + motionBasedRetentionEnabled=params.get("motionBasedRetentionEnabled"), + motionDetectorVersion=params.get("motionDetectorVersion"), + profileId=params.get("profileId"), quality=params.get("quality"), resolution=params.get("resolution"), - motionDetectorVersion=params.get("motionDetectorVersion"), + restrictedBandwidthModeEnabled=params.get("restrictedBandwidthModeEnabled"), serial=params.get("serial"), ) @@ -72,24 +72,24 @@ class DevicesCameraQualityAndRetention(object): def update_all_params(self): new_object_params = {} + if self.new_object.get('audioRecordingEnabled') is not None or self.new_object.get('audio_recording_enabled') is not None: + new_object_params['audioRecordingEnabled'] = self.new_object.get('audioRecordingEnabled') + if self.new_object.get('motionBasedRetentionEnabled') is not None or self.new_object.get('motion_based_retention_enabled') is not None: + new_object_params['motionBasedRetentionEnabled'] = self.new_object.get('motionBasedRetentionEnabled') + if self.new_object.get('motionDetectorVersion') is not None or self.new_object.get('motion_detector_version') is not None: + new_object_params['motionDetectorVersion'] = self.new_object.get('motionDetectorVersion') or \ + self.new_object.get('motion_detector_version') if self.new_object.get('profileId') is not None or self.new_object.get('profile_id') is not None: new_object_params['profileId'] = self.new_object.get('profileId') or \ self.new_object.get('profile_id') - if self.new_object.get('motionBasedRetentionEnabled') is not None or self.new_object.get('motion_based_retention_enabled') is not None: - new_object_params['motionBasedRetentionEnabled'] = self.new_object.get('motionBasedRetentionEnabled') - if self.new_object.get('audioRecordingEnabled') is not None or self.new_object.get('audio_recording_enabled') is not None: - new_object_params['audioRecordingEnabled'] = self.new_object.get('audioRecordingEnabled') - if self.new_object.get('restrictedBandwidthModeEnabled') is not None or self.new_object.get('restricted_bandwidth_mode_enabled') is not None: - new_object_params['restrictedBandwidthModeEnabled'] = self.new_object.get('restrictedBandwidthModeEnabled') if self.new_object.get('quality') is not None or self.new_object.get('quality') is not None: new_object_params['quality'] = self.new_object.get('quality') or \ self.new_object.get('quality') if self.new_object.get('resolution') is not None or self.new_object.get('resolution') is not None: new_object_params['resolution'] = self.new_object.get('resolution') or \ self.new_object.get('resolution') - if self.new_object.get('motionDetectorVersion') is not None or self.new_object.get('motion_detector_version') is not None: - new_object_params['motionDetectorVersion'] = self.new_object.get('motionDetectorVersion') or \ - self.new_object.get('motion_detector_version') + if self.new_object.get('restrictedBandwidthModeEnabled') is not None or self.new_object.get('restricted_bandwidth_mode_enabled') is not None: + new_object_params['restrictedBandwidthModeEnabled'] = self.new_object.get('restrictedBandwidthModeEnabled') if self.new_object.get('serial') is not None or self.new_object.get('serial') is not None: new_object_params['serial'] = self.new_object.get('serial') or \ self.new_object.get('serial') @@ -146,13 +146,13 @@ class DevicesCameraQualityAndRetention(object): requested_obj = self.new_object obj_params = [ - ("profileId", "profileId"), - ("motionBasedRetentionEnabled", "motionBasedRetentionEnabled"), ("audioRecordingEnabled", "audioRecordingEnabled"), - ("restrictedBandwidthModeEnabled", "restrictedBandwidthModeEnabled"), + ("motionBasedRetentionEnabled", "motionBasedRetentionEnabled"), + ("motionDetectorVersion", "motionDetectorVersion"), + ("profileId", "profileId"), ("quality", "quality"), ("resolution", "resolution"), - ("motionDetectorVersion", "motionDetectorVersion"), + ("restrictedBandwidthModeEnabled", "restrictedBandwidthModeEnabled"), ("serial", "serial"), ] # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params diff --git a/ansible_collections/cisco/meraki/plugins/action/devices_camera_sense.py b/ansible_collections/cisco/meraki/plugins/action/devices_camera_sense.py index 3cc8dca92..c95304f52 100644 --- a/ansible_collections/cisco/meraki/plugins/action/devices_camera_sense.py +++ b/ansible_collections/cisco/meraki/plugins/action/devices_camera_sense.py @@ -32,10 +32,10 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present"]), - senseEnabled=dict(type="bool"), - mqttBrokerId=dict(type="str"), audioDetection=dict(type="dict"), detectionModelId=dict(type="str"), + mqttBrokerId=dict(type="str"), + senseEnabled=dict(type="bool"), serial=dict(type="str"), )) @@ -51,10 +51,10 @@ class DevicesCameraSense(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( - senseEnabled=params.get("senseEnabled"), - mqttBrokerId=params.get("mqttBrokerId"), audioDetection=params.get("audioDetection"), detectionModelId=params.get("detectionModelId"), + mqttBrokerId=params.get("mqttBrokerId"), + senseEnabled=params.get("senseEnabled"), serial=params.get("serial"), ) @@ -66,17 +66,17 @@ class DevicesCameraSense(object): def update_all_params(self): new_object_params = {} - if self.new_object.get('senseEnabled') is not None or self.new_object.get('sense_enabled') is not None: - new_object_params['senseEnabled'] = self.new_object.get('senseEnabled') - if self.new_object.get('mqttBrokerId') is not None or self.new_object.get('mqtt_broker_id') is not None: - new_object_params['mqttBrokerId'] = self.new_object.get('mqttBrokerId') or \ - self.new_object.get('mqtt_broker_id') if self.new_object.get('audioDetection') is not None or self.new_object.get('audio_detection') is not None: new_object_params['audioDetection'] = self.new_object.get('audioDetection') or \ self.new_object.get('audio_detection') if self.new_object.get('detectionModelId') is not None or self.new_object.get('detection_model_id') is not None: new_object_params['detectionModelId'] = self.new_object.get('detectionModelId') or \ self.new_object.get('detection_model_id') + if self.new_object.get('mqttBrokerId') is not None or self.new_object.get('mqtt_broker_id') is not None: + new_object_params['mqttBrokerId'] = self.new_object.get('mqttBrokerId') or \ + self.new_object.get('mqtt_broker_id') + if self.new_object.get('senseEnabled') is not None or self.new_object.get('sense_enabled') is not None: + new_object_params['senseEnabled'] = self.new_object.get('senseEnabled') if self.new_object.get('serial') is not None or self.new_object.get('serial') is not None: new_object_params['serial'] = self.new_object.get('serial') or \ self.new_object.get('serial') @@ -133,10 +133,10 @@ class DevicesCameraSense(object): requested_obj = self.new_object obj_params = [ - ("senseEnabled", "senseEnabled"), - ("mqttBrokerId", "mqttBrokerId"), ("audioDetection", "audioDetection"), ("detectionModelId", "detectionModelId"), + ("mqttBrokerId", "mqttBrokerId"), + ("senseEnabled", "senseEnabled"), ("serial", "serial"), ] # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params diff --git a/ansible_collections/cisco/meraki/plugins/action/devices_camera_wireless_profiles.py b/ansible_collections/cisco/meraki/plugins/action/devices_camera_wireless_profiles.py index 8153293df..f891d8c5b 100644 --- a/ansible_collections/cisco/meraki/plugins/action/devices_camera_wireless_profiles.py +++ b/ansible_collections/cisco/meraki/plugins/action/devices_camera_wireless_profiles.py @@ -78,8 +78,8 @@ class DevicesCameraWirelessProfiles(object): params=self.get_all_params(name=name), ) if isinstance(items, dict): - if 'response' in items: - items = items.get('response') + if 'ids' in items: + items = items.get('ids') result = get_dict_result(items, 'name', name) if result is None: result = items diff --git a/ansible_collections/cisco/meraki/plugins/action/devices_cellular_gateway_lan.py b/ansible_collections/cisco/meraki/plugins/action/devices_cellular_gateway_lan.py index ddb0b4d97..048e8a28b 100644 --- a/ansible_collections/cisco/meraki/plugins/action/devices_cellular_gateway_lan.py +++ b/ansible_collections/cisco/meraki/plugins/action/devices_cellular_gateway_lan.py @@ -32,8 +32,8 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present"]), - reservedIpRanges=dict(type="list"), fixedIpAssignments=dict(type="list"), + reservedIpRanges=dict(type="list"), serial=dict(type="str"), )) @@ -49,8 +49,8 @@ class DevicesCellularGatewayLan(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( - reservedIpRanges=params.get("reservedIpRanges"), fixedIpAssignments=params.get("fixedIpAssignments"), + reservedIpRanges=params.get("reservedIpRanges"), serial=params.get("serial"), ) @@ -62,12 +62,12 @@ class DevicesCellularGatewayLan(object): def update_all_params(self): new_object_params = {} - if self.new_object.get('reservedIpRanges') is not None or self.new_object.get('reserved_ip_ranges') is not None: - new_object_params['reservedIpRanges'] = self.new_object.get('reservedIpRanges') or \ - self.new_object.get('reserved_ip_ranges') if self.new_object.get('fixedIpAssignments') is not None or self.new_object.get('fixed_ip_assignments') is not None: new_object_params['fixedIpAssignments'] = self.new_object.get('fixedIpAssignments') or \ self.new_object.get('fixed_ip_assignments') + if self.new_object.get('reservedIpRanges') is not None or self.new_object.get('reserved_ip_ranges') is not None: + new_object_params['reservedIpRanges'] = self.new_object.get('reservedIpRanges') or \ + self.new_object.get('reserved_ip_ranges') if self.new_object.get('serial') is not None or self.new_object.get('serial') is not None: new_object_params['serial'] = self.new_object.get('serial') or \ self.new_object.get('serial') @@ -124,8 +124,8 @@ class DevicesCellularGatewayLan(object): requested_obj = self.new_object obj_params = [ - ("reservedIpRanges", "reservedIpRanges"), ("fixedIpAssignments", "fixedIpAssignments"), + ("reservedIpRanges", "reservedIpRanges"), ("serial", "serial"), ] # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params diff --git a/ansible_collections/cisco/meraki/plugins/action/devices_cellular_gateway_port_forwarding_rules.py b/ansible_collections/cisco/meraki/plugins/action/devices_cellular_gateway_port_forwarding_rules.py index 59a6ddf66..cb8693d61 100644 --- a/ansible_collections/cisco/meraki/plugins/action/devices_cellular_gateway_port_forwarding_rules.py +++ b/ansible_collections/cisco/meraki/plugins/action/devices_cellular_gateway_port_forwarding_rules.py @@ -78,8 +78,8 @@ class DevicesCellularGatewayPortForwardingRules(object): params=self.get_all_params(name=name), ) if isinstance(items, dict): - if 'response' in items: - items = items.get('response') + if 'rules' in items: + items = items.get('rules') result = get_dict_result(items, 'name', name) if result is None: result = items diff --git a/ansible_collections/cisco/meraki/plugins/action/devices_cellular_sims.py b/ansible_collections/cisco/meraki/plugins/action/devices_cellular_sims.py index 93e187918..d00c47622 100644 --- a/ansible_collections/cisco/meraki/plugins/action/devices_cellular_sims.py +++ b/ansible_collections/cisco/meraki/plugins/action/devices_cellular_sims.py @@ -32,8 +32,8 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present"]), - sims=dict(type="list"), simFailover=dict(type="dict"), + sims=dict(type="list"), serial=dict(type="str"), )) @@ -49,8 +49,8 @@ class DevicesCellularSims(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( - sims=params.get("sims"), simFailover=params.get("simFailover"), + sims=params.get("sims"), serial=params.get("serial"), ) @@ -62,12 +62,12 @@ class DevicesCellularSims(object): def update_all_params(self): new_object_params = {} - if self.new_object.get('sims') is not None or self.new_object.get('sims') is not None: - new_object_params['sims'] = self.new_object.get('sims') or \ - self.new_object.get('sims') if self.new_object.get('simFailover') is not None or self.new_object.get('sim_failover') is not None: new_object_params['simFailover'] = self.new_object.get('simFailover') or \ self.new_object.get('sim_failover') + if self.new_object.get('sims') is not None or self.new_object.get('sims') is not None: + new_object_params['sims'] = self.new_object.get('sims') or \ + self.new_object.get('sims') if self.new_object.get('serial') is not None or self.new_object.get('serial') is not None: new_object_params['serial'] = self.new_object.get('serial') or \ self.new_object.get('serial') @@ -83,8 +83,8 @@ class DevicesCellularSims(object): params=self.get_all_params(name=name), ) if isinstance(items, dict): - if 'response' in items: - items = items.get('response') + if 'sims' in items: + items = items.get('sims') result = get_dict_result(items, 'name', name) if result is None: result = items @@ -124,8 +124,8 @@ class DevicesCellularSims(object): requested_obj = self.new_object obj_params = [ - ("sims", "sims"), ("simFailover", "simFailover"), + ("sims", "sims"), ("serial", "serial"), ] # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params diff --git a/ansible_collections/cisco/meraki/plugins/action/devices_live_tools_arp_table.py b/ansible_collections/cisco/meraki/plugins/action/devices_live_tools_arp_table.py new file mode 100644 index 000000000..3c80f50c5 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/action/devices_live_tools_arp_table.py @@ -0,0 +1,174 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or +# https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( + MERAKI, + meraki_argument_spec, + meraki_compare_equality, +) +from ansible_collections.cisco.meraki.plugins.plugin_utils.exceptions import ( + InconsistentParameters, +) + +# Get common arguments specification +argument_spec = meraki_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present"]), + callback=dict(type="dict"), + serial=dict(type="str"), +)) + +required_if = [ + ("state", "present", ["serial"], True), +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class DevicesLiveToolsArpTable(object): + def __init__(self, params, meraki): + self.meraki = meraki + self.new_object = dict( + callback=params.get("callback"), + serial=params.get("serial"), + ) + + def create_params(self): + new_object_params = {} + if self.new_object.get('callback') is not None or self.new_object.get('callback') is not None: + new_object_params['callback'] = self.new_object.get('callback') or \ + self.new_object.get('callback') + if self.new_object.get('serial') is not None or self.new_object.get('serial') is not None: + new_object_params['serial'] = self.new_object.get('serial') or \ + self.new_object.get('serial') + return new_object_params + + def get_object_by_name(self, name): + result = None + # NOTE: Does not have a get by name and get all + return result + + def get_object_by_id(self, id): + result = None + # NOTE: Does not have a get by id method or it is in another action + return result + + def exists(self): + prev_obj = None + id_exists = False + name_exists = False + o_id = self.new_object.get("serial") + name = self.new_object.get("name") + if o_id: + prev_obj = self.get_object_by_name(o_id) + id_exists = prev_obj is not None and isinstance(prev_obj, dict) + if not id_exists and name: + prev_obj = self.get_object_by_name(name) + name_exists = prev_obj is not None and isinstance(prev_obj, dict) + if name_exists: + _id = prev_obj.get("id") + if id_exists and name_exists and o_id != _id: + raise InconsistentParameters( + "The 'id' and 'name' params don't refer to the same object") + if _id: + self.new_object.update(dict(id=_id)) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object + + obj_params = [ + ("callback", "callback"), + ("serial", "serial"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params + # If any does not have eq params, it requires update + return any(not meraki_compare_equality(current_obj.get(meraki_param), + requested_obj.get(ansible_param)) + for (meraki_param, ansible_param) in obj_params) + + def create(self): + result = self.meraki.exec_meraki( + family="devices", + function="createDeviceLiveToolsArpTable", + params=self.create_params(), + op_modifies=True, + ) + return result + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail( + "ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + meraki = MERAKI(self._task.args) + obj = DevicesLiveToolsArpTable(self._task.args, meraki) + + state = self._task.args.get("state") + + response = None + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = prev_obj + meraki.object_present_and_different() + else: + response = prev_obj + meraki.object_already_present() + else: + response = obj.create() + meraki.object_created() + + self._result.update(dict(meraki_response=response)) + self._result.update(meraki.exit_json()) + return self._result diff --git a/ansible_collections/cisco/meraki/plugins/action/devices_live_tools_arp_table_info.py b/ansible_collections/cisco/meraki/plugins/action/devices_live_tools_arp_table_info.py new file mode 100644 index 000000000..8e972db51 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/action/devices_live_tools_arp_table_info.py @@ -0,0 +1,79 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( + MERAKI, + meraki_argument_spec, +) + +# Get common arguments specification +argument_spec = meraki_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail( + "ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(meraki_response={})) + + meraki = MERAKI(params=self._task.args) + + # NOTE: Does not have a get all method or it is in another action + response = None + meraki.object_modify_result(changed=False, result="Module does not have get all, check arguments of module") + self._result.update(dict(meraki_response=response)) + self._result.update(meraki.exit_json()) + return self._result diff --git a/ansible_collections/cisco/meraki/plugins/action/devices_live_tools_cable_test.py b/ansible_collections/cisco/meraki/plugins/action/devices_live_tools_cable_test.py new file mode 100644 index 000000000..ec58e54fc --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/action/devices_live_tools_cable_test.py @@ -0,0 +1,180 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or +# https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( + MERAKI, + meraki_argument_spec, + meraki_compare_equality, +) +from ansible_collections.cisco.meraki.plugins.plugin_utils.exceptions import ( + InconsistentParameters, +) + +# Get common arguments specification +argument_spec = meraki_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present"]), + callback=dict(type="dict"), + ports=dict(type="list"), + serial=dict(type="str"), +)) + +required_if = [ + ("state", "present", ["serial"], True), +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class DevicesLiveToolsCableTest(object): + def __init__(self, params, meraki): + self.meraki = meraki + self.new_object = dict( + callback=params.get("callback"), + ports=params.get("ports"), + serial=params.get("serial"), + ) + + def create_params(self): + new_object_params = {} + if self.new_object.get('callback') is not None or self.new_object.get('callback') is not None: + new_object_params['callback'] = self.new_object.get('callback') or \ + self.new_object.get('callback') + if self.new_object.get('ports') is not None or self.new_object.get('ports') is not None: + new_object_params['ports'] = self.new_object.get('ports') or \ + self.new_object.get('ports') + if self.new_object.get('serial') is not None or self.new_object.get('serial') is not None: + new_object_params['serial'] = self.new_object.get('serial') or \ + self.new_object.get('serial') + return new_object_params + + def get_object_by_name(self, name): + result = None + # NOTE: Does not have a get by name and get all + return result + + def get_object_by_id(self, id): + result = None + # NOTE: Does not have a get by id method or it is in another action + return result + + def exists(self): + prev_obj = None + id_exists = False + name_exists = False + o_id = self.new_object.get("serial") + name = self.new_object.get("name") + if o_id: + prev_obj = self.get_object_by_name(o_id) + id_exists = prev_obj is not None and isinstance(prev_obj, dict) + if not id_exists and name: + prev_obj = self.get_object_by_name(name) + name_exists = prev_obj is not None and isinstance(prev_obj, dict) + if name_exists: + _id = prev_obj.get("id") + if id_exists and name_exists and o_id != _id: + raise InconsistentParameters( + "The 'id' and 'name' params don't refer to the same object") + if _id: + self.new_object.update(dict(id=_id)) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object + + obj_params = [ + ("callback", "callback"), + ("ports", "ports"), + ("serial", "serial"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params + # If any does not have eq params, it requires update + return any(not meraki_compare_equality(current_obj.get(meraki_param), + requested_obj.get(ansible_param)) + for (meraki_param, ansible_param) in obj_params) + + def create(self): + result = self.meraki.exec_meraki( + family="devices", + function="createDeviceLiveToolsCableTest", + params=self.create_params(), + op_modifies=True, + ) + return result + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail( + "ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + meraki = MERAKI(self._task.args) + obj = DevicesLiveToolsCableTest(self._task.args, meraki) + + state = self._task.args.get("state") + + response = None + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = prev_obj + meraki.object_present_and_different() + else: + response = prev_obj + meraki.object_already_present() + else: + response = obj.create() + meraki.object_created() + + self._result.update(dict(meraki_response=response)) + self._result.update(meraki.exit_json()) + return self._result diff --git a/ansible_collections/cisco/meraki/plugins/action/devices_live_tools_cable_test_info.py b/ansible_collections/cisco/meraki/plugins/action/devices_live_tools_cable_test_info.py new file mode 100644 index 000000000..8e972db51 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/action/devices_live_tools_cable_test_info.py @@ -0,0 +1,79 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( + MERAKI, + meraki_argument_spec, +) + +# Get common arguments specification +argument_spec = meraki_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail( + "ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(meraki_response={})) + + meraki = MERAKI(params=self._task.args) + + # NOTE: Does not have a get all method or it is in another action + response = None + meraki.object_modify_result(changed=False, result="Module does not have get all, check arguments of module") + self._result.update(dict(meraki_response=response)) + self._result.update(meraki.exit_json()) + return self._result diff --git a/ansible_collections/cisco/meraki/plugins/action/devices_live_tools_ping.py b/ansible_collections/cisco/meraki/plugins/action/devices_live_tools_ping.py index ba5ef2d67..bd91ad77e 100644 --- a/ansible_collections/cisco/meraki/plugins/action/devices_live_tools_ping.py +++ b/ansible_collections/cisco/meraki/plugins/action/devices_live_tools_ping.py @@ -31,8 +31,9 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present"]), - target=dict(type="str"), + callback=dict(type="dict"), count=dict(type="int"), + target=dict(type="str"), serial=dict(type="str"), id=dict(type="str"), )) @@ -49,8 +50,9 @@ class DevicesLiveToolsPing(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( - target=params.get("target"), + callback=params.get("callback"), count=params.get("count"), + target=params.get("target"), serial=params.get("serial"), id=params.get("id"), ) @@ -65,12 +67,15 @@ class DevicesLiveToolsPing(object): def create_params(self): new_object_params = {} - if self.new_object.get('target') is not None or self.new_object.get('target') is not None: - new_object_params['target'] = self.new_object.get('target') or \ - self.new_object.get('target') + if self.new_object.get('callback') is not None or self.new_object.get('callback') is not None: + new_object_params['callback'] = self.new_object.get('callback') or \ + self.new_object.get('callback') if self.new_object.get('count') is not None or self.new_object.get('count') is not None: new_object_params['count'] = self.new_object.get('count') or \ self.new_object.get('count') + if self.new_object.get('target') is not None or self.new_object.get('target') is not None: + new_object_params['target'] = self.new_object.get('target') or \ + self.new_object.get('target') if self.new_object.get('serial') is not None or self.new_object.get('serial') is not None: new_object_params['serial'] = self.new_object.get('serial') or \ self.new_object.get('serial') @@ -126,8 +131,9 @@ class DevicesLiveToolsPing(object): requested_obj = self.new_object obj_params = [ - ("target", "target"), + ("callback", "callback"), ("count", "count"), + ("target", "target"), ("serial", "serial"), ("id", "id"), ] diff --git a/ansible_collections/cisco/meraki/plugins/action/devices_live_tools_ping_device.py b/ansible_collections/cisco/meraki/plugins/action/devices_live_tools_ping_device.py index cb00a6c6b..4738511fb 100644 --- a/ansible_collections/cisco/meraki/plugins/action/devices_live_tools_ping_device.py +++ b/ansible_collections/cisco/meraki/plugins/action/devices_live_tools_ping_device.py @@ -31,6 +31,7 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present"]), + callback=dict(type="dict"), count=dict(type="int"), serial=dict(type="str"), id=dict(type="str"), @@ -48,6 +49,7 @@ class DevicesLiveToolsPingDevice(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( + callback=params.get("callback"), count=params.get("count"), serial=params.get("serial"), id=params.get("id"), @@ -63,6 +65,9 @@ class DevicesLiveToolsPingDevice(object): def create_params(self): new_object_params = {} + if self.new_object.get('callback') is not None or self.new_object.get('callback') is not None: + new_object_params['callback'] = self.new_object.get('callback') or \ + self.new_object.get('callback') if self.new_object.get('count') is not None or self.new_object.get('count') is not None: new_object_params['count'] = self.new_object.get('count') or \ self.new_object.get('count') @@ -121,6 +126,7 @@ class DevicesLiveToolsPingDevice(object): requested_obj = self.new_object obj_params = [ + ("callback", "callback"), ("count", "count"), ("serial", "serial"), ("id", "id"), diff --git a/ansible_collections/cisco/meraki/plugins/action/devices_live_tools_throughput_test.py b/ansible_collections/cisco/meraki/plugins/action/devices_live_tools_throughput_test.py new file mode 100644 index 000000000..50edfcffd --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/action/devices_live_tools_throughput_test.py @@ -0,0 +1,174 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or +# https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( + MERAKI, + meraki_argument_spec, + meraki_compare_equality, +) +from ansible_collections.cisco.meraki.plugins.plugin_utils.exceptions import ( + InconsistentParameters, +) + +# Get common arguments specification +argument_spec = meraki_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present"]), + callback=dict(type="dict"), + serial=dict(type="str"), +)) + +required_if = [ + ("state", "present", ["serial"], True), +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class DevicesLiveToolsThroughputTest(object): + def __init__(self, params, meraki): + self.meraki = meraki + self.new_object = dict( + callback=params.get("callback"), + serial=params.get("serial"), + ) + + def create_params(self): + new_object_params = {} + if self.new_object.get('callback') is not None or self.new_object.get('callback') is not None: + new_object_params['callback'] = self.new_object.get('callback') or \ + self.new_object.get('callback') + if self.new_object.get('serial') is not None or self.new_object.get('serial') is not None: + new_object_params['serial'] = self.new_object.get('serial') or \ + self.new_object.get('serial') + return new_object_params + + def get_object_by_name(self, name): + result = None + # NOTE: Does not have a get by name and get all + return result + + def get_object_by_id(self, id): + result = None + # NOTE: Does not have a get by id method or it is in another action + return result + + def exists(self): + prev_obj = None + id_exists = False + name_exists = False + o_id = self.new_object.get("serial") + name = self.new_object.get("name") + if o_id: + prev_obj = self.get_object_by_name(o_id) + id_exists = prev_obj is not None and isinstance(prev_obj, dict) + if not id_exists and name: + prev_obj = self.get_object_by_name(name) + name_exists = prev_obj is not None and isinstance(prev_obj, dict) + if name_exists: + _id = prev_obj.get("id") + if id_exists and name_exists and o_id != _id: + raise InconsistentParameters( + "The 'id' and 'name' params don't refer to the same object") + if _id: + self.new_object.update(dict(id=_id)) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object + + obj_params = [ + ("callback", "callback"), + ("serial", "serial"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params + # If any does not have eq params, it requires update + return any(not meraki_compare_equality(current_obj.get(meraki_param), + requested_obj.get(ansible_param)) + for (meraki_param, ansible_param) in obj_params) + + def create(self): + result = self.meraki.exec_meraki( + family="devices", + function="createDeviceLiveToolsThroughputTest", + params=self.create_params(), + op_modifies=True, + ) + return result + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail( + "ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + meraki = MERAKI(self._task.args) + obj = DevicesLiveToolsThroughputTest(self._task.args, meraki) + + state = self._task.args.get("state") + + response = None + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = prev_obj + meraki.object_present_and_different() + else: + response = prev_obj + meraki.object_already_present() + else: + response = obj.create() + meraki.object_created() + + self._result.update(dict(meraki_response=response)) + self._result.update(meraki.exit_json()) + return self._result diff --git a/ansible_collections/cisco/meraki/plugins/action/devices_live_tools_throughput_test_info.py b/ansible_collections/cisco/meraki/plugins/action/devices_live_tools_throughput_test_info.py new file mode 100644 index 000000000..8e972db51 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/action/devices_live_tools_throughput_test_info.py @@ -0,0 +1,79 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( + MERAKI, + meraki_argument_spec, +) + +# Get common arguments specification +argument_spec = meraki_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail( + "ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(meraki_response={})) + + meraki = MERAKI(params=self._task.args) + + # NOTE: Does not have a get all method or it is in another action + response = None + meraki.object_modify_result(changed=False, result="Module does not have get all, check arguments of module") + self._result.update(dict(meraki_response=response)) + self._result.update(meraki.exit_json()) + return self._result diff --git a/ansible_collections/cisco/meraki/plugins/action/devices_live_tools_wake_on_lan.py b/ansible_collections/cisco/meraki/plugins/action/devices_live_tools_wake_on_lan.py new file mode 100644 index 000000000..4fc6873e4 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/action/devices_live_tools_wake_on_lan.py @@ -0,0 +1,186 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or +# https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( + MERAKI, + meraki_argument_spec, + meraki_compare_equality, +) +from ansible_collections.cisco.meraki.plugins.plugin_utils.exceptions import ( + InconsistentParameters, +) + +# Get common arguments specification +argument_spec = meraki_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present"]), + callback=dict(type="dict"), + mac=dict(type="str"), + vlanId=dict(type="int"), + serial=dict(type="str"), +)) + +required_if = [ + ("state", "present", ["serial"], True), +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class DevicesLiveToolsWakeOnLan(object): + def __init__(self, params, meraki): + self.meraki = meraki + self.new_object = dict( + callback=params.get("callback"), + mac=params.get("mac"), + vlanId=params.get("vlanId"), + serial=params.get("serial"), + ) + + def create_params(self): + new_object_params = {} + if self.new_object.get('callback') is not None or self.new_object.get('callback') is not None: + new_object_params['callback'] = self.new_object.get('callback') or \ + self.new_object.get('callback') + if self.new_object.get('mac') is not None or self.new_object.get('mac') is not None: + new_object_params['mac'] = self.new_object.get('mac') or \ + self.new_object.get('mac') + if self.new_object.get('vlanId') is not None or self.new_object.get('vlan_id') is not None: + new_object_params['vlanId'] = self.new_object.get('vlanId') or \ + self.new_object.get('vlan_id') + if self.new_object.get('serial') is not None or self.new_object.get('serial') is not None: + new_object_params['serial'] = self.new_object.get('serial') or \ + self.new_object.get('serial') + return new_object_params + + def get_object_by_name(self, name): + result = None + # NOTE: Does not have a get by name and get all + return result + + def get_object_by_id(self, id): + result = None + # NOTE: Does not have a get by id method or it is in another action + return result + + def exists(self): + prev_obj = None + id_exists = False + name_exists = False + o_id = self.new_object.get("serial") + name = self.new_object.get("name") + if o_id: + prev_obj = self.get_object_by_name(o_id) + id_exists = prev_obj is not None and isinstance(prev_obj, dict) + if not id_exists and name: + prev_obj = self.get_object_by_name(name) + name_exists = prev_obj is not None and isinstance(prev_obj, dict) + if name_exists: + _id = prev_obj.get("id") + if id_exists and name_exists and o_id != _id: + raise InconsistentParameters( + "The 'id' and 'name' params don't refer to the same object") + if _id: + self.new_object.update(dict(id=_id)) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object + + obj_params = [ + ("callback", "callback"), + ("mac", "mac"), + ("vlanId", "vlanId"), + ("serial", "serial"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params + # If any does not have eq params, it requires update + return any(not meraki_compare_equality(current_obj.get(meraki_param), + requested_obj.get(ansible_param)) + for (meraki_param, ansible_param) in obj_params) + + def create(self): + result = self.meraki.exec_meraki( + family="devices", + function="createDeviceLiveToolsWakeOnLan", + params=self.create_params(), + op_modifies=True, + ) + return result + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail( + "ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + meraki = MERAKI(self._task.args) + obj = DevicesLiveToolsWakeOnLan(self._task.args, meraki) + + state = self._task.args.get("state") + + response = None + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = prev_obj + meraki.object_present_and_different() + else: + response = prev_obj + meraki.object_already_present() + else: + response = obj.create() + meraki.object_created() + + self._result.update(dict(meraki_response=response)) + self._result.update(meraki.exit_json()) + return self._result diff --git a/ansible_collections/cisco/meraki/plugins/action/devices_live_tools_wake_on_lan_info.py b/ansible_collections/cisco/meraki/plugins/action/devices_live_tools_wake_on_lan_info.py new file mode 100644 index 000000000..8e972db51 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/action/devices_live_tools_wake_on_lan_info.py @@ -0,0 +1,79 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( + MERAKI, + meraki_argument_spec, +) + +# Get common arguments specification +argument_spec = meraki_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail( + "ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(meraki_response={})) + + meraki = MERAKI(params=self._task.args) + + # NOTE: Does not have a get all method or it is in another action + response = None + meraki.object_modify_result(changed=False, result="Module does not have get all, check arguments of module") + self._result.update(dict(meraki_response=response)) + self._result.update(meraki.exit_json()) + return self._result diff --git a/ansible_collections/cisco/meraki/plugins/action/devices_sensor_relationships.py b/ansible_collections/cisco/meraki/plugins/action/devices_sensor_relationships.py index 75c20b830..b55f44b6e 100644 --- a/ansible_collections/cisco/meraki/plugins/action/devices_sensor_relationships.py +++ b/ansible_collections/cisco/meraki/plugins/action/devices_sensor_relationships.py @@ -78,8 +78,8 @@ class DevicesSensorRelationships(object): params=self.get_all_params(name=name), ) if isinstance(items, dict): - if 'response' in items: - items = items.get('response') + if 'livestream' in items: + items = items.get('livestream') result = get_dict_result(items, 'name', name) if result is None: result = items diff --git a/ansible_collections/cisco/meraki/plugins/action/devices_switch_ports.py b/ansible_collections/cisco/meraki/plugins/action/devices_switch_ports.py index 659e6a4f8..44a238eb2 100644 --- a/ansible_collections/cisco/meraki/plugins/action/devices_switch_ports.py +++ b/ansible_collections/cisco/meraki/plugins/action/devices_switch_ports.py @@ -32,31 +32,31 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present"]), - name=dict(type="str"), - tags=dict(type="list"), - enabled=dict(type="bool"), - poeEnabled=dict(type="bool"), - type=dict(type="str"), - vlan=dict(type="int"), - voiceVlan=dict(type="int"), + accessPolicyNumber=dict(type="int"), + accessPolicyType=dict(type="str"), + adaptivePolicyGroupId=dict(type="str"), allowedVlans=dict(type="str"), + daiTrusted=dict(type="bool"), + enabled=dict(type="bool"), + flexibleStackingEnabled=dict(type="bool"), isolationEnabled=dict(type="bool"), - rstpEnabled=dict(type="bool"), - stpGuard=dict(type="str"), linkNegotiation=dict(type="str"), - portScheduleId=dict(type="str"), - udld=dict(type="str"), - accessPolicyType=dict(type="str"), - accessPolicyNumber=dict(type="int"), macAllowList=dict(type="list"), + name=dict(type="str"), + peerSgtCapable=dict(type="bool"), + poeEnabled=dict(type="bool"), + portScheduleId=dict(type="str"), + profile=dict(type="dict"), + rstpEnabled=dict(type="bool"), stickyMacAllowList=dict(type="list"), stickyMacAllowListLimit=dict(type="int"), stormControlEnabled=dict(type="bool"), - adaptivePolicyGroupId=dict(type="str"), - peerSgtCapable=dict(type="bool"), - flexibleStackingEnabled=dict(type="bool"), - daiTrusted=dict(type="bool"), - profile=dict(type="dict"), + stpGuard=dict(type="str"), + tags=dict(type="list"), + type=dict(type="str"), + udld=dict(type="str"), + vlan=dict(type="int"), + voiceVlan=dict(type="int"), serial=dict(type="str"), portId=dict(type="str"), )) @@ -73,31 +73,31 @@ class DevicesSwitchPorts(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( - name=params.get("name"), - tags=params.get("tags"), - enabled=params.get("enabled"), - poeEnabled=params.get("poeEnabled"), - type=params.get("type"), - vlan=params.get("vlan"), - voiceVlan=params.get("voiceVlan"), + accessPolicyNumber=params.get("accessPolicyNumber"), + accessPolicyType=params.get("accessPolicyType"), + adaptivePolicyGroupId=params.get("adaptivePolicyGroupId"), allowedVlans=params.get("allowedVlans"), + daiTrusted=params.get("daiTrusted"), + enabled=params.get("enabled"), + flexibleStackingEnabled=params.get("flexibleStackingEnabled"), isolationEnabled=params.get("isolationEnabled"), - rstpEnabled=params.get("rstpEnabled"), - stpGuard=params.get("stpGuard"), linkNegotiation=params.get("linkNegotiation"), - portScheduleId=params.get("portScheduleId"), - udld=params.get("udld"), - accessPolicyType=params.get("accessPolicyType"), - accessPolicyNumber=params.get("accessPolicyNumber"), macAllowList=params.get("macAllowList"), + name=params.get("name"), + peerSgtCapable=params.get("peerSgtCapable"), + poeEnabled=params.get("poeEnabled"), + portScheduleId=params.get("portScheduleId"), + profile=params.get("profile"), + rstpEnabled=params.get("rstpEnabled"), stickyMacAllowList=params.get("stickyMacAllowList"), stickyMacAllowListLimit=params.get("stickyMacAllowListLimit"), stormControlEnabled=params.get("stormControlEnabled"), - adaptivePolicyGroupId=params.get("adaptivePolicyGroupId"), - peerSgtCapable=params.get("peerSgtCapable"), - flexibleStackingEnabled=params.get("flexibleStackingEnabled"), - daiTrusted=params.get("daiTrusted"), - profile=params.get("profile"), + stpGuard=params.get("stpGuard"), + tags=params.get("tags"), + type=params.get("type"), + udld=params.get("udld"), + vlan=params.get("vlan"), + voiceVlan=params.get("voiceVlan"), serial=params.get("serial"), port_id=params.get("portId"), ) @@ -119,55 +119,47 @@ class DevicesSwitchPorts(object): def update_by_id_params(self): new_object_params = {} - if self.new_object.get('name') is not None or self.new_object.get('name') is not None: - new_object_params['name'] = self.new_object.get('name') or \ - self.new_object.get('name') - if self.new_object.get('tags') is not None or self.new_object.get('tags') is not None: - new_object_params['tags'] = self.new_object.get('tags') or \ - self.new_object.get('tags') - if self.new_object.get('enabled') is not None or self.new_object.get('enabled') is not None: - new_object_params['enabled'] = self.new_object.get('enabled') - if self.new_object.get('poeEnabled') is not None or self.new_object.get('poe_enabled') is not None: - new_object_params['poeEnabled'] = self.new_object.get('poeEnabled') - if self.new_object.get('type') is not None or self.new_object.get('type') is not None: - new_object_params['type'] = self.new_object.get('type') or \ - self.new_object.get('type') - if self.new_object.get('vlan') is not None or self.new_object.get('vlan') is not None: - new_object_params['vlan'] = self.new_object.get('vlan') or \ - self.new_object.get('vlan') - if self.new_object.get('voiceVlan') is not None or self.new_object.get('voice_vlan') is not None: - new_object_params['voiceVlan'] = self.new_object.get('voiceVlan') or \ - self.new_object.get('voice_vlan') + if self.new_object.get('accessPolicyNumber') is not None or self.new_object.get('access_policy_number') is not None: + new_object_params['accessPolicyNumber'] = self.new_object.get('accessPolicyNumber') or \ + self.new_object.get('access_policy_number') + if self.new_object.get('accessPolicyType') is not None or self.new_object.get('access_policy_type') is not None: + new_object_params['accessPolicyType'] = self.new_object.get('accessPolicyType') or \ + self.new_object.get('access_policy_type') + if self.new_object.get('adaptivePolicyGroupId') is not None or self.new_object.get('adaptive_policy_group_id') is not None: + new_object_params['adaptivePolicyGroupId'] = self.new_object.get('adaptivePolicyGroupId') or \ + self.new_object.get('adaptive_policy_group_id') if self.new_object.get('allowedVlans') is not None or self.new_object.get('allowed_vlans') is not None: new_object_params['allowedVlans'] = self.new_object.get('allowedVlans') or \ self.new_object.get('allowed_vlans') + if self.new_object.get('daiTrusted') is not None or self.new_object.get('dai_trusted') is not None: + new_object_params['daiTrusted'] = self.new_object.get('daiTrusted') + if self.new_object.get('enabled') is not None or self.new_object.get('enabled') is not None: + new_object_params['enabled'] = self.new_object.get('enabled') + if self.new_object.get('flexibleStackingEnabled') is not None or self.new_object.get('flexible_stacking_enabled') is not None: + new_object_params['flexibleStackingEnabled'] = self.new_object.get('flexibleStackingEnabled') if self.new_object.get('isolationEnabled') is not None or self.new_object.get('isolation_enabled') is not None: - new_object_params['isolationEnabled'] = self.new_object.get( - 'isolationEnabled') - if self.new_object.get('rstpEnabled') is not None or self.new_object.get('rstp_enabled') is not None: - new_object_params['rstpEnabled'] = self.new_object.get( - 'rstpEnabled') - if self.new_object.get('stpGuard') is not None or self.new_object.get('stp_guard') is not None: - new_object_params['stpGuard'] = self.new_object.get('stpGuard') or \ - self.new_object.get('stp_guard') + new_object_params['isolationEnabled'] = self.new_object.get('isolationEnabled') if self.new_object.get('linkNegotiation') is not None or self.new_object.get('link_negotiation') is not None: new_object_params['linkNegotiation'] = self.new_object.get('linkNegotiation') or \ self.new_object.get('link_negotiation') - if self.new_object.get('portScheduleId') is not None or self.new_object.get('port_schedule_id') is not None: - new_object_params['portScheduleId'] = self.new_object.get('portScheduleId') or \ - self.new_object.get('port_schedule_id') - if self.new_object.get('udld') is not None or self.new_object.get('udld') is not None: - new_object_params['udld'] = self.new_object.get('udld') or \ - self.new_object.get('udld') - if self.new_object.get('accessPolicyType') is not None or self.new_object.get('access_policy_type') is not None: - new_object_params['accessPolicyType'] = self.new_object.get('accessPolicyType') or \ - self.new_object.get('access_policy_type') - if self.new_object.get('accessPolicyNumber') is not None or self.new_object.get('access_policy_number') is not None: - new_object_params['accessPolicyNumber'] = self.new_object.get('accessPolicyNumber') or \ - self.new_object.get('access_policy_number') if self.new_object.get('macAllowList') is not None or self.new_object.get('mac_allow_list') is not None: new_object_params['macAllowList'] = self.new_object.get('macAllowList') or \ self.new_object.get('mac_allow_list') + if self.new_object.get('name') is not None or self.new_object.get('name') is not None: + new_object_params['name'] = self.new_object.get('name') or \ + self.new_object.get('name') + if self.new_object.get('peerSgtCapable') is not None or self.new_object.get('peer_sgt_capable') is not None: + new_object_params['peerSgtCapable'] = self.new_object.get('peerSgtCapable') + if self.new_object.get('poeEnabled') is not None or self.new_object.get('poe_enabled') is not None: + new_object_params['poeEnabled'] = self.new_object.get('poeEnabled') + if self.new_object.get('portScheduleId') is not None or self.new_object.get('port_schedule_id') is not None: + new_object_params['portScheduleId'] = self.new_object.get('portScheduleId') or \ + self.new_object.get('port_schedule_id') + if self.new_object.get('profile') is not None or self.new_object.get('profile') is not None: + new_object_params['profile'] = self.new_object.get('profile') or \ + self.new_object.get('profile') + if self.new_object.get('rstpEnabled') is not None or self.new_object.get('rstp_enabled') is not None: + new_object_params['rstpEnabled'] = self.new_object.get('rstpEnabled') if self.new_object.get('stickyMacAllowList') is not None or self.new_object.get('sticky_mac_allow_list') is not None: new_object_params['stickyMacAllowList'] = self.new_object.get('stickyMacAllowList') or \ self.new_object.get('sticky_mac_allow_list') @@ -175,22 +167,25 @@ class DevicesSwitchPorts(object): new_object_params['stickyMacAllowListLimit'] = self.new_object.get('stickyMacAllowListLimit') or \ self.new_object.get('sticky_mac_allow_list_limit') if self.new_object.get('stormControlEnabled') is not None or self.new_object.get('storm_control_enabled') is not None: - new_object_params['stormControlEnabled'] = self.new_object.get( - 'stormControlEnabled') - if self.new_object.get('adaptivePolicyGroupId') is not None or self.new_object.get('adaptive_policy_group_id') is not None: - new_object_params['adaptivePolicyGroupId'] = self.new_object.get('adaptivePolicyGroupId') or \ - self.new_object.get('adaptive_policy_group_id') - if self.new_object.get('peerSgtCapable') is not None or self.new_object.get('peer_sgt_capable') is not None: - new_object_params['peerSgtCapable'] = self.new_object.get( - 'peerSgtCapable') - if self.new_object.get('flexibleStackingEnabled') is not None or self.new_object.get('flexible_stacking_enabled') is not None: - new_object_params['flexibleStackingEnabled'] = self.new_object.get( - 'flexibleStackingEnabled') - if self.new_object.get('daiTrusted') is not None or self.new_object.get('dai_trusted') is not None: - new_object_params['daiTrusted'] = self.new_object.get('daiTrusted') - if self.new_object.get('profile') is not None or self.new_object.get('profile') is not None: - new_object_params['profile'] = self.new_object.get('profile') or \ - self.new_object.get('profile') + new_object_params['stormControlEnabled'] = self.new_object.get('stormControlEnabled') + if self.new_object.get('stpGuard') is not None or self.new_object.get('stp_guard') is not None: + new_object_params['stpGuard'] = self.new_object.get('stpGuard') or \ + self.new_object.get('stp_guard') + if self.new_object.get('tags') is not None or self.new_object.get('tags') is not None: + new_object_params['tags'] = self.new_object.get('tags') or \ + self.new_object.get('tags') + if self.new_object.get('type') is not None or self.new_object.get('type') is not None: + new_object_params['type'] = self.new_object.get('type') or \ + self.new_object.get('type') + if self.new_object.get('udld') is not None or self.new_object.get('udld') is not None: + new_object_params['udld'] = self.new_object.get('udld') or \ + self.new_object.get('udld') + if self.new_object.get('vlan') is not None or self.new_object.get('vlan') is not None: + new_object_params['vlan'] = self.new_object.get('vlan') or \ + self.new_object.get('vlan') + if self.new_object.get('voiceVlan') is not None or self.new_object.get('voice_vlan') is not None: + new_object_params['voiceVlan'] = self.new_object.get('voiceVlan') or \ + self.new_object.get('voice_vlan') if self.new_object.get('serial') is not None or self.new_object.get('serial') is not None: new_object_params['serial'] = self.new_object.get('serial') or \ self.new_object.get('serial') @@ -269,31 +264,31 @@ class DevicesSwitchPorts(object): requested_obj = self.new_object obj_params = [ - ("name", "name"), - ("tags", "tags"), - ("enabled", "enabled"), - ("poeEnabled", "poeEnabled"), - ("type", "type"), - ("vlan", "vlan"), - ("voiceVlan", "voiceVlan"), + ("accessPolicyNumber", "accessPolicyNumber"), + ("accessPolicyType", "accessPolicyType"), + ("adaptivePolicyGroupId", "adaptivePolicyGroupId"), ("allowedVlans", "allowedVlans"), + ("daiTrusted", "daiTrusted"), + ("enabled", "enabled"), + ("flexibleStackingEnabled", "flexibleStackingEnabled"), ("isolationEnabled", "isolationEnabled"), - ("rstpEnabled", "rstpEnabled"), - ("stpGuard", "stpGuard"), ("linkNegotiation", "linkNegotiation"), - ("portScheduleId", "portScheduleId"), - ("udld", "udld"), - ("accessPolicyType", "accessPolicyType"), - ("accessPolicyNumber", "accessPolicyNumber"), ("macAllowList", "macAllowList"), + ("name", "name"), + ("peerSgtCapable", "peerSgtCapable"), + ("poeEnabled", "poeEnabled"), + ("portScheduleId", "portScheduleId"), + ("profile", "profile"), + ("rstpEnabled", "rstpEnabled"), ("stickyMacAllowList", "stickyMacAllowList"), ("stickyMacAllowListLimit", "stickyMacAllowListLimit"), ("stormControlEnabled", "stormControlEnabled"), - ("adaptivePolicyGroupId", "adaptivePolicyGroupId"), - ("peerSgtCapable", "peerSgtCapable"), - ("flexibleStackingEnabled", "flexibleStackingEnabled"), - ("daiTrusted", "daiTrusted"), - ("profile", "profile"), + ("stpGuard", "stpGuard"), + ("tags", "tags"), + ("type", "type"), + ("udld", "udld"), + ("vlan", "vlan"), + ("voiceVlan", "voiceVlan"), ("serial", "serial"), ("portId", "portId"), ] diff --git a/ansible_collections/cisco/meraki/plugins/action/devices_switch_routing_interfaces.py b/ansible_collections/cisco/meraki/plugins/action/devices_switch_routing_interfaces.py index 774366850..c013c4bb5 100644 --- a/ansible_collections/cisco/meraki/plugins/action/devices_switch_routing_interfaces.py +++ b/ansible_collections/cisco/meraki/plugins/action/devices_switch_routing_interfaces.py @@ -32,15 +32,15 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present", "absent"]), - name=dict(type="str"), - subnet=dict(type="str"), + defaultGateway=dict(type="str"), interfaceIp=dict(type="str"), + ipv6=dict(type="dict"), multicastRouting=dict(type="str"), - vlanId=dict(type="int"), - defaultGateway=dict(type="str"), + name=dict(type="str"), ospfSettings=dict(type="dict"), ospfV3=dict(type="dict"), - ipv6=dict(type="dict"), + subnet=dict(type="str"), + vlanId=dict(type="int"), serial=dict(type="str"), interfaceId=dict(type="str"), )) @@ -58,15 +58,15 @@ class DevicesSwitchRoutingInterfaces(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( - name=params.get("name"), - subnet=params.get("subnet"), + defaultGateway=params.get("defaultGateway"), interfaceIp=params.get("interfaceIp"), + ipv6=params.get("ipv6"), multicastRouting=params.get("multicastRouting"), - vlanId=params.get("vlanId"), - defaultGateway=params.get("defaultGateway"), + name=params.get("name"), ospfSettings=params.get("ospfSettings"), ospfV3=params.get("ospfV3"), - ipv6=params.get("ipv6"), + subnet=params.get("subnet"), + vlanId=params.get("vlanId"), serial=params.get("serial"), interfaceId=params.get("interfaceId"), ) @@ -88,33 +88,33 @@ class DevicesSwitchRoutingInterfaces(object): def create_params(self): new_object_params = {} - if self.new_object.get('name') is not None or self.new_object.get('name') is not None: - new_object_params['name'] = self.new_object.get('name') or \ - self.new_object.get('name') - if self.new_object.get('subnet') is not None or self.new_object.get('subnet') is not None: - new_object_params['subnet'] = self.new_object.get('subnet') or \ - self.new_object.get('subnet') + if self.new_object.get('defaultGateway') is not None or self.new_object.get('default_gateway') is not None: + new_object_params['defaultGateway'] = self.new_object.get('defaultGateway') or \ + self.new_object.get('default_gateway') if self.new_object.get('interfaceIp') is not None or self.new_object.get('interface_ip') is not None: new_object_params['interfaceIp'] = self.new_object.get('interfaceIp') or \ self.new_object.get('interface_ip') + if self.new_object.get('ipv6') is not None or self.new_object.get('ipv6') is not None: + new_object_params['ipv6'] = self.new_object.get('ipv6') or \ + self.new_object.get('ipv6') if self.new_object.get('multicastRouting') is not None or self.new_object.get('multicast_routing') is not None: new_object_params['multicastRouting'] = self.new_object.get('multicastRouting') or \ self.new_object.get('multicast_routing') - if self.new_object.get('vlanId') is not None or self.new_object.get('vlan_id') is not None: - new_object_params['vlanId'] = self.new_object.get('vlanId') or \ - self.new_object.get('vlan_id') - if self.new_object.get('defaultGateway') is not None or self.new_object.get('default_gateway') is not None: - new_object_params['defaultGateway'] = self.new_object.get('defaultGateway') or \ - self.new_object.get('default_gateway') + if self.new_object.get('name') is not None or self.new_object.get('name') is not None: + new_object_params['name'] = self.new_object.get('name') or \ + self.new_object.get('name') if self.new_object.get('ospfSettings') is not None or self.new_object.get('ospf_settings') is not None: new_object_params['ospfSettings'] = self.new_object.get('ospfSettings') or \ self.new_object.get('ospf_settings') if self.new_object.get('ospfV3') is not None or self.new_object.get('ospf_v3') is not None: new_object_params['ospfV3'] = self.new_object.get('ospfV3') or \ self.new_object.get('ospf_v3') - if self.new_object.get('ipv6') is not None or self.new_object.get('ipv6') is not None: - new_object_params['ipv6'] = self.new_object.get('ipv6') or \ - self.new_object.get('ipv6') + if self.new_object.get('subnet') is not None or self.new_object.get('subnet') is not None: + new_object_params['subnet'] = self.new_object.get('subnet') or \ + self.new_object.get('subnet') + if self.new_object.get('vlanId') is not None or self.new_object.get('vlan_id') is not None: + new_object_params['vlanId'] = self.new_object.get('vlanId') or \ + self.new_object.get('vlan_id') if self.new_object.get('serial') is not None or self.new_object.get('serial') is not None: new_object_params['serial'] = self.new_object.get('serial') or \ self.new_object.get('serial') @@ -132,33 +132,33 @@ class DevicesSwitchRoutingInterfaces(object): def update_by_id_params(self): new_object_params = {} - if self.new_object.get('name') is not None or self.new_object.get('name') is not None: - new_object_params['name'] = self.new_object.get('name') or \ - self.new_object.get('name') - if self.new_object.get('subnet') is not None or self.new_object.get('subnet') is not None: - new_object_params['subnet'] = self.new_object.get('subnet') or \ - self.new_object.get('subnet') + if self.new_object.get('defaultGateway') is not None or self.new_object.get('default_gateway') is not None: + new_object_params['defaultGateway'] = self.new_object.get('defaultGateway') or \ + self.new_object.get('default_gateway') if self.new_object.get('interfaceIp') is not None or self.new_object.get('interface_ip') is not None: new_object_params['interfaceIp'] = self.new_object.get('interfaceIp') or \ self.new_object.get('interface_ip') + if self.new_object.get('ipv6') is not None or self.new_object.get('ipv6') is not None: + new_object_params['ipv6'] = self.new_object.get('ipv6') or \ + self.new_object.get('ipv6') if self.new_object.get('multicastRouting') is not None or self.new_object.get('multicast_routing') is not None: new_object_params['multicastRouting'] = self.new_object.get('multicastRouting') or \ self.new_object.get('multicast_routing') - if self.new_object.get('vlanId') is not None or self.new_object.get('vlan_id') is not None: - new_object_params['vlanId'] = self.new_object.get('vlanId') or \ - self.new_object.get('vlan_id') - if self.new_object.get('defaultGateway') is not None or self.new_object.get('default_gateway') is not None: - new_object_params['defaultGateway'] = self.new_object.get('defaultGateway') or \ - self.new_object.get('default_gateway') + if self.new_object.get('name') is not None or self.new_object.get('name') is not None: + new_object_params['name'] = self.new_object.get('name') or \ + self.new_object.get('name') if self.new_object.get('ospfSettings') is not None or self.new_object.get('ospf_settings') is not None: new_object_params['ospfSettings'] = self.new_object.get('ospfSettings') or \ self.new_object.get('ospf_settings') if self.new_object.get('ospfV3') is not None or self.new_object.get('ospf_v3') is not None: new_object_params['ospfV3'] = self.new_object.get('ospfV3') or \ self.new_object.get('ospf_v3') - if self.new_object.get('ipv6') is not None or self.new_object.get('ipv6') is not None: - new_object_params['ipv6'] = self.new_object.get('ipv6') or \ - self.new_object.get('ipv6') + if self.new_object.get('subnet') is not None or self.new_object.get('subnet') is not None: + new_object_params['subnet'] = self.new_object.get('subnet') or \ + self.new_object.get('subnet') + if self.new_object.get('vlanId') is not None or self.new_object.get('vlan_id') is not None: + new_object_params['vlanId'] = self.new_object.get('vlanId') or \ + self.new_object.get('vlan_id') if self.new_object.get('serial') is not None or self.new_object.get('serial') is not None: new_object_params['serial'] = self.new_object.get('serial') or \ self.new_object.get('serial') @@ -236,15 +236,15 @@ class DevicesSwitchRoutingInterfaces(object): requested_obj = self.new_object obj_params = [ - ("name", "name"), - ("subnet", "subnet"), + ("defaultGateway", "defaultGateway"), ("interfaceIp", "interfaceIp"), + ("ipv6", "ipv6"), ("multicastRouting", "multicastRouting"), - ("vlanId", "vlanId"), - ("defaultGateway", "defaultGateway"), + ("name", "name"), ("ospfSettings", "ospfSettings"), ("ospfV3", "ospfV3"), - ("ipv6", "ipv6"), + ("subnet", "subnet"), + ("vlanId", "vlanId"), ("serial", "serial"), ("interfaceId", "interfaceId"), ] diff --git a/ansible_collections/cisco/meraki/plugins/action/devices_switch_routing_interfaces_dhcp.py b/ansible_collections/cisco/meraki/plugins/action/devices_switch_routing_interfaces_dhcp.py index 4fdb74e4e..39063de9f 100644 --- a/ansible_collections/cisco/meraki/plugins/action/devices_switch_routing_interfaces_dhcp.py +++ b/ansible_collections/cisco/meraki/plugins/action/devices_switch_routing_interfaces_dhcp.py @@ -32,17 +32,17 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present"]), + bootFileName=dict(type="str"), + bootNextServer=dict(type="str"), + bootOptionsEnabled=dict(type="bool"), + dhcpLeaseTime=dict(type="str"), dhcpMode=dict(type="str"), + dhcpOptions=dict(type="list"), dhcpRelayServerIps=dict(type="list"), - dhcpLeaseTime=dict(type="str"), - dnsNameserversOption=dict(type="str"), dnsCustomNameservers=dict(type="list"), - bootOptionsEnabled=dict(type="bool"), - bootNextServer=dict(type="str"), - bootFileName=dict(type="str"), - dhcpOptions=dict(type="list"), - reservedIpRanges=dict(type="list"), + dnsNameserversOption=dict(type="str"), fixedIpAssignments=dict(type="list"), + reservedIpRanges=dict(type="list"), serial=dict(type="str"), interfaceId=dict(type="str"), )) @@ -59,17 +59,17 @@ class DevicesSwitchRoutingInterfacesDhcp(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( + bootFileName=params.get("bootFileName"), + bootNextServer=params.get("bootNextServer"), + bootOptionsEnabled=params.get("bootOptionsEnabled"), + dhcpLeaseTime=params.get("dhcpLeaseTime"), dhcpMode=params.get("dhcpMode"), + dhcpOptions=params.get("dhcpOptions"), dhcpRelayServerIps=params.get("dhcpRelayServerIps"), - dhcpLeaseTime=params.get("dhcpLeaseTime"), - dnsNameserversOption=params.get("dnsNameserversOption"), dnsCustomNameservers=params.get("dnsCustomNameservers"), - bootOptionsEnabled=params.get("bootOptionsEnabled"), - bootNextServer=params.get("bootNextServer"), - bootFileName=params.get("bootFileName"), - dhcpOptions=params.get("dhcpOptions"), - reservedIpRanges=params.get("reservedIpRanges"), + dnsNameserversOption=params.get("dnsNameserversOption"), fixedIpAssignments=params.get("fixedIpAssignments"), + reservedIpRanges=params.get("reservedIpRanges"), serial=params.get("serial"), interface_id=params.get("interfaceId"), ) @@ -85,38 +85,38 @@ class DevicesSwitchRoutingInterfacesDhcp(object): def update_all_params(self): new_object_params = {} + if self.new_object.get('bootFileName') is not None or self.new_object.get('boot_file_name') is not None: + new_object_params['bootFileName'] = self.new_object.get('bootFileName') or \ + self.new_object.get('boot_file_name') + if self.new_object.get('bootNextServer') is not None or self.new_object.get('boot_next_server') is not None: + new_object_params['bootNextServer'] = self.new_object.get('bootNextServer') or \ + self.new_object.get('boot_next_server') + if self.new_object.get('bootOptionsEnabled') is not None or self.new_object.get('boot_options_enabled') is not None: + new_object_params['bootOptionsEnabled'] = self.new_object.get('bootOptionsEnabled') + if self.new_object.get('dhcpLeaseTime') is not None or self.new_object.get('dhcp_lease_time') is not None: + new_object_params['dhcpLeaseTime'] = self.new_object.get('dhcpLeaseTime') or \ + self.new_object.get('dhcp_lease_time') if self.new_object.get('dhcpMode') is not None or self.new_object.get('dhcp_mode') is not None: new_object_params['dhcpMode'] = self.new_object.get('dhcpMode') or \ self.new_object.get('dhcp_mode') + if self.new_object.get('dhcpOptions') is not None or self.new_object.get('dhcp_options') is not None: + new_object_params['dhcpOptions'] = self.new_object.get('dhcpOptions') or \ + self.new_object.get('dhcp_options') if self.new_object.get('dhcpRelayServerIps') is not None or self.new_object.get('dhcp_relay_server_ips') is not None: new_object_params['dhcpRelayServerIps'] = self.new_object.get('dhcpRelayServerIps') or \ self.new_object.get('dhcp_relay_server_ips') - if self.new_object.get('dhcpLeaseTime') is not None or self.new_object.get('dhcp_lease_time') is not None: - new_object_params['dhcpLeaseTime'] = self.new_object.get('dhcpLeaseTime') or \ - self.new_object.get('dhcp_lease_time') - if self.new_object.get('dnsNameserversOption') is not None or self.new_object.get('dns_nameservers_option') is not None: - new_object_params['dnsNameserversOption'] = self.new_object.get('dnsNameserversOption') or \ - self.new_object.get('dns_nameservers_option') if self.new_object.get('dnsCustomNameservers') is not None or self.new_object.get('dns_custom_nameservers') is not None: new_object_params['dnsCustomNameservers'] = self.new_object.get('dnsCustomNameservers') or \ self.new_object.get('dns_custom_nameservers') - if self.new_object.get('bootOptionsEnabled') is not None or self.new_object.get('boot_options_enabled') is not None: - new_object_params['bootOptionsEnabled'] = self.new_object.get('bootOptionsEnabled') - if self.new_object.get('bootNextServer') is not None or self.new_object.get('boot_next_server') is not None: - new_object_params['bootNextServer'] = self.new_object.get('bootNextServer') or \ - self.new_object.get('boot_next_server') - if self.new_object.get('bootFileName') is not None or self.new_object.get('boot_file_name') is not None: - new_object_params['bootFileName'] = self.new_object.get('bootFileName') or \ - self.new_object.get('boot_file_name') - if self.new_object.get('dhcpOptions') is not None or self.new_object.get('dhcp_options') is not None: - new_object_params['dhcpOptions'] = self.new_object.get('dhcpOptions') or \ - self.new_object.get('dhcp_options') - if self.new_object.get('reservedIpRanges') is not None or self.new_object.get('reserved_ip_ranges') is not None: - new_object_params['reservedIpRanges'] = self.new_object.get('reservedIpRanges') or \ - self.new_object.get('reserved_ip_ranges') + if self.new_object.get('dnsNameserversOption') is not None or self.new_object.get('dns_nameservers_option') is not None: + new_object_params['dnsNameserversOption'] = self.new_object.get('dnsNameserversOption') or \ + self.new_object.get('dns_nameservers_option') if self.new_object.get('fixedIpAssignments') is not None or self.new_object.get('fixed_ip_assignments') is not None: new_object_params['fixedIpAssignments'] = self.new_object.get('fixedIpAssignments') or \ self.new_object.get('fixed_ip_assignments') + if self.new_object.get('reservedIpRanges') is not None or self.new_object.get('reserved_ip_ranges') is not None: + new_object_params['reservedIpRanges'] = self.new_object.get('reservedIpRanges') or \ + self.new_object.get('reserved_ip_ranges') if self.new_object.get('serial') is not None or self.new_object.get('serial') is not None: new_object_params['serial'] = self.new_object.get('serial') or \ self.new_object.get('serial') @@ -176,17 +176,17 @@ class DevicesSwitchRoutingInterfacesDhcp(object): requested_obj = self.new_object obj_params = [ + ("bootFileName", "bootFileName"), + ("bootNextServer", "bootNextServer"), + ("bootOptionsEnabled", "bootOptionsEnabled"), + ("dhcpLeaseTime", "dhcpLeaseTime"), ("dhcpMode", "dhcpMode"), + ("dhcpOptions", "dhcpOptions"), ("dhcpRelayServerIps", "dhcpRelayServerIps"), - ("dhcpLeaseTime", "dhcpLeaseTime"), - ("dnsNameserversOption", "dnsNameserversOption"), ("dnsCustomNameservers", "dnsCustomNameservers"), - ("bootOptionsEnabled", "bootOptionsEnabled"), - ("bootNextServer", "bootNextServer"), - ("bootFileName", "bootFileName"), - ("dhcpOptions", "dhcpOptions"), - ("reservedIpRanges", "reservedIpRanges"), + ("dnsNameserversOption", "dnsNameserversOption"), ("fixedIpAssignments", "fixedIpAssignments"), + ("reservedIpRanges", "reservedIpRanges"), ("serial", "serial"), ("interfaceId", "interfaceId"), ] diff --git a/ansible_collections/cisco/meraki/plugins/action/devices_switch_routing_static_routes.py b/ansible_collections/cisco/meraki/plugins/action/devices_switch_routing_static_routes.py index e24a6e721..f146b8447 100644 --- a/ansible_collections/cisco/meraki/plugins/action/devices_switch_routing_static_routes.py +++ b/ansible_collections/cisco/meraki/plugins/action/devices_switch_routing_static_routes.py @@ -32,11 +32,11 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present", "absent"]), + advertiseViaOspfEnabled=dict(type="bool"), name=dict(type="str"), - subnet=dict(type="str"), nextHopIp=dict(type="str"), - advertiseViaOspfEnabled=dict(type="bool"), preferOverOspfRoutesEnabled=dict(type="bool"), + subnet=dict(type="str"), serial=dict(type="str"), staticRouteId=dict(type="str"), )) @@ -54,11 +54,11 @@ class DevicesSwitchRoutingStaticRoutes(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( + advertiseViaOspfEnabled=params.get("advertiseViaOspfEnabled"), name=params.get("name"), - subnet=params.get("subnet"), nextHopIp=params.get("nextHopIp"), - advertiseViaOspfEnabled=params.get("advertiseViaOspfEnabled"), preferOverOspfRoutesEnabled=params.get("preferOverOspfRoutesEnabled"), + subnet=params.get("subnet"), serial=params.get("serial"), staticRouteId=params.get("staticRouteId"), ) @@ -80,19 +80,19 @@ class DevicesSwitchRoutingStaticRoutes(object): def create_params(self): new_object_params = {} + if self.new_object.get('advertiseViaOspfEnabled') is not None or self.new_object.get('advertise_via_ospf_enabled') is not None: + new_object_params['advertiseViaOspfEnabled'] = self.new_object.get('advertiseViaOspfEnabled') if self.new_object.get('name') is not None or self.new_object.get('name') is not None: new_object_params['name'] = self.new_object.get('name') or \ self.new_object.get('name') - if self.new_object.get('subnet') is not None or self.new_object.get('subnet') is not None: - new_object_params['subnet'] = self.new_object.get('subnet') or \ - self.new_object.get('subnet') if self.new_object.get('nextHopIp') is not None or self.new_object.get('next_hop_ip') is not None: new_object_params['nextHopIp'] = self.new_object.get('nextHopIp') or \ self.new_object.get('next_hop_ip') - if self.new_object.get('advertiseViaOspfEnabled') is not None or self.new_object.get('advertise_via_ospf_enabled') is not None: - new_object_params['advertiseViaOspfEnabled'] = self.new_object.get('advertiseViaOspfEnabled') if self.new_object.get('preferOverOspfRoutesEnabled') is not None or self.new_object.get('prefer_over_ospf_routes_enabled') is not None: new_object_params['preferOverOspfRoutesEnabled'] = self.new_object.get('preferOverOspfRoutesEnabled') + if self.new_object.get('subnet') is not None or self.new_object.get('subnet') is not None: + new_object_params['subnet'] = self.new_object.get('subnet') or \ + self.new_object.get('subnet') if self.new_object.get('serial') is not None or self.new_object.get('serial') is not None: new_object_params['serial'] = self.new_object.get('serial') or \ self.new_object.get('serial') @@ -110,19 +110,19 @@ class DevicesSwitchRoutingStaticRoutes(object): def update_by_id_params(self): new_object_params = {} + if self.new_object.get('advertiseViaOspfEnabled') is not None or self.new_object.get('advertise_via_ospf_enabled') is not None: + new_object_params['advertiseViaOspfEnabled'] = self.new_object.get('advertiseViaOspfEnabled') if self.new_object.get('name') is not None or self.new_object.get('name') is not None: new_object_params['name'] = self.new_object.get('name') or \ self.new_object.get('name') - if self.new_object.get('subnet') is not None or self.new_object.get('subnet') is not None: - new_object_params['subnet'] = self.new_object.get('subnet') or \ - self.new_object.get('subnet') if self.new_object.get('nextHopIp') is not None or self.new_object.get('next_hop_ip') is not None: new_object_params['nextHopIp'] = self.new_object.get('nextHopIp') or \ self.new_object.get('next_hop_ip') - if self.new_object.get('advertiseViaOspfEnabled') is not None or self.new_object.get('advertise_via_ospf_enabled') is not None: - new_object_params['advertiseViaOspfEnabled'] = self.new_object.get('advertiseViaOspfEnabled') if self.new_object.get('preferOverOspfRoutesEnabled') is not None or self.new_object.get('prefer_over_ospf_routes_enabled') is not None: new_object_params['preferOverOspfRoutesEnabled'] = self.new_object.get('preferOverOspfRoutesEnabled') + if self.new_object.get('subnet') is not None or self.new_object.get('subnet') is not None: + new_object_params['subnet'] = self.new_object.get('subnet') or \ + self.new_object.get('subnet') if self.new_object.get('serial') is not None or self.new_object.get('serial') is not None: new_object_params['serial'] = self.new_object.get('serial') or \ self.new_object.get('serial') @@ -200,11 +200,11 @@ class DevicesSwitchRoutingStaticRoutes(object): requested_obj = self.new_object obj_params = [ + ("advertiseViaOspfEnabled", "advertiseViaOspfEnabled"), ("name", "name"), - ("subnet", "subnet"), ("nextHopIp", "nextHopIp"), - ("advertiseViaOspfEnabled", "advertiseViaOspfEnabled"), ("preferOverOspfRoutesEnabled", "preferOverOspfRoutesEnabled"), + ("subnet", "subnet"), ("serial", "serial"), ("staticRouteId", "staticRouteId"), ] diff --git a/ansible_collections/cisco/meraki/plugins/action/devices_wireless_alternate_management_interface_ipv6.py b/ansible_collections/cisco/meraki/plugins/action/devices_wireless_alternate_management_interface_ipv6.py new file mode 100644 index 000000000..41447bb98 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/action/devices_wireless_alternate_management_interface_ipv6.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( + MERAKI, + meraki_argument_spec, +) + +# Get common arguements specification +argument_spec = meraki_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + addresses=dict(type="list"), + serial=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail( + "ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + addresses=params.get("addresses"), + serial=params.get("serial"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + meraki = MERAKI(params=self._task.args) + + response = meraki.exec_meraki( + family="wireless", + function='updateDeviceWirelessAlternateManagementInterfaceIpv6', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(meraki_response=response)) + self._result.update(meraki.exit_json()) + return self._result diff --git a/ansible_collections/cisco/meraki/plugins/action/devices_wireless_bluetooth_settings.py b/ansible_collections/cisco/meraki/plugins/action/devices_wireless_bluetooth_settings.py index dd3712df6..f1f41d07c 100644 --- a/ansible_collections/cisco/meraki/plugins/action/devices_wireless_bluetooth_settings.py +++ b/ansible_collections/cisco/meraki/plugins/action/devices_wireless_bluetooth_settings.py @@ -32,9 +32,9 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present"]), - uuid=dict(type="str"), major=dict(type="int"), minor=dict(type="int"), + uuid=dict(type="str"), serial=dict(type="str"), )) @@ -50,9 +50,9 @@ class DevicesWirelessBluetoothSettings(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( - uuid=params.get("uuid"), major=params.get("major"), minor=params.get("minor"), + uuid=params.get("uuid"), serial=params.get("serial"), ) @@ -64,15 +64,15 @@ class DevicesWirelessBluetoothSettings(object): def update_all_params(self): new_object_params = {} - if self.new_object.get('uuid') is not None or self.new_object.get('uuid') is not None: - new_object_params['uuid'] = self.new_object.get('uuid') or \ - self.new_object.get('uuid') if self.new_object.get('major') is not None or self.new_object.get('major') is not None: new_object_params['major'] = self.new_object.get('major') or \ self.new_object.get('major') if self.new_object.get('minor') is not None or self.new_object.get('minor') is not None: new_object_params['minor'] = self.new_object.get('minor') or \ self.new_object.get('minor') + if self.new_object.get('uuid') is not None or self.new_object.get('uuid') is not None: + new_object_params['uuid'] = self.new_object.get('uuid') or \ + self.new_object.get('uuid') if self.new_object.get('serial') is not None or self.new_object.get('serial') is not None: new_object_params['serial'] = self.new_object.get('serial') or \ self.new_object.get('serial') @@ -129,9 +129,9 @@ class DevicesWirelessBluetoothSettings(object): requested_obj = self.new_object obj_params = [ - ("uuid", "uuid"), ("major", "major"), ("minor", "minor"), + ("uuid", "uuid"), ("serial", "serial"), ] # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params diff --git a/ansible_collections/cisco/meraki/plugins/action/devices_wireless_radio_settings.py b/ansible_collections/cisco/meraki/plugins/action/devices_wireless_radio_settings.py index 72dad3f48..2fc35da7b 100644 --- a/ansible_collections/cisco/meraki/plugins/action/devices_wireless_radio_settings.py +++ b/ansible_collections/cisco/meraki/plugins/action/devices_wireless_radio_settings.py @@ -32,9 +32,9 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present"]), + fiveGhzSettings=dict(type="dict"), rfProfileId=dict(type="str"), twoFourGhzSettings=dict(type="dict"), - fiveGhzSettings=dict(type="dict"), serial=dict(type="str"), )) @@ -50,9 +50,9 @@ class DevicesWirelessRadioSettings(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( + fiveGhzSettings=params.get("fiveGhzSettings"), rfProfileId=params.get("rfProfileId"), twoFourGhzSettings=params.get("twoFourGhzSettings"), - fiveGhzSettings=params.get("fiveGhzSettings"), serial=params.get("serial"), ) @@ -64,15 +64,15 @@ class DevicesWirelessRadioSettings(object): def update_all_params(self): new_object_params = {} + if self.new_object.get('fiveGhzSettings') is not None or self.new_object.get('five_ghz_settings') is not None: + new_object_params['fiveGhzSettings'] = self.new_object.get('fiveGhzSettings') or \ + self.new_object.get('five_ghz_settings') if self.new_object.get('rfProfileId') is not None or self.new_object.get('rf_profile_id') is not None: new_object_params['rfProfileId'] = self.new_object.get('rfProfileId') or \ self.new_object.get('rf_profile_id') if self.new_object.get('twoFourGhzSettings') is not None or self.new_object.get('two_four_ghz_settings') is not None: new_object_params['twoFourGhzSettings'] = self.new_object.get('twoFourGhzSettings') or \ self.new_object.get('two_four_ghz_settings') - if self.new_object.get('fiveGhzSettings') is not None or self.new_object.get('five_ghz_settings') is not None: - new_object_params['fiveGhzSettings'] = self.new_object.get('fiveGhzSettings') or \ - self.new_object.get('five_ghz_settings') if self.new_object.get('serial') is not None or self.new_object.get('serial') is not None: new_object_params['serial'] = self.new_object.get('serial') or \ self.new_object.get('serial') @@ -129,9 +129,9 @@ class DevicesWirelessRadioSettings(object): requested_obj = self.new_object obj_params = [ + ("fiveGhzSettings", "fiveGhzSettings"), ("rfProfileId", "rfProfileId"), ("twoFourGhzSettings", "twoFourGhzSettings"), - ("fiveGhzSettings", "fiveGhzSettings"), ("serial", "serial"), ] # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params diff --git a/ansible_collections/cisco/meraki/plugins/action/networks.py b/ansible_collections/cisco/meraki/plugins/action/networks.py index 378b0bc0d..17904b9f8 100644 --- a/ansible_collections/cisco/meraki/plugins/action/networks.py +++ b/ansible_collections/cisco/meraki/plugins/action/networks.py @@ -32,12 +32,12 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present", "absent"]), + copyFromNetworkId=dict(type="str"), name=dict(type="str"), + notes=dict(type="str"), productTypes=dict(type="list"), tags=dict(type="list"), timeZone=dict(type="str"), - copyFromNetworkId=dict(type="str"), - notes=dict(type="str"), organizationId=dict(type="str"), networkId=dict(type="str"), enrollmentString=dict(type="str"), @@ -56,12 +56,12 @@ class Networks(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( + copyFromNetworkId=params.get("copyFromNetworkId"), name=params.get("name"), + notes=params.get("notes"), productTypes=params.get("productTypes"), tags=params.get("tags"), timeZone=params.get("timeZone"), - copyFromNetworkId=params.get("copyFromNetworkId"), - notes=params.get("notes"), organizationId=params.get("organizationId"), networkId=params.get("networkId"), enrollmentString=params.get("enrollmentString"), @@ -104,9 +104,15 @@ class Networks(object): def create_params(self): new_object_params = {} + if self.new_object.get('copyFromNetworkId') is not None or self.new_object.get('copy_from_network_id') is not None: + new_object_params['copyFromNetworkId'] = self.new_object.get('copyFromNetworkId') or \ + self.new_object.get('copy_from_network_id') if self.new_object.get('name') is not None or self.new_object.get('name') is not None: new_object_params['name'] = self.new_object.get('name') or \ self.new_object.get('name') + if self.new_object.get('notes') is not None or self.new_object.get('notes') is not None: + new_object_params['notes'] = self.new_object.get('notes') or \ + self.new_object.get('notes') if self.new_object.get('productTypes') is not None or self.new_object.get('product_types') is not None: new_object_params['productTypes'] = self.new_object.get('productTypes') or \ self.new_object.get('product_types') @@ -116,12 +122,6 @@ class Networks(object): if self.new_object.get('timeZone') is not None or self.new_object.get('time_zone') is not None: new_object_params['timeZone'] = self.new_object.get('timeZone') or \ self.new_object.get('time_zone') - if self.new_object.get('copyFromNetworkId') is not None or self.new_object.get('copy_from_network_id') is not None: - new_object_params['copyFromNetworkId'] = self.new_object.get('copyFromNetworkId') or \ - self.new_object.get('copy_from_network_id') - if self.new_object.get('notes') is not None or self.new_object.get('notes') is not None: - new_object_params['notes'] = self.new_object.get('notes') or \ - self.new_object.get('notes') if self.new_object.get('organizationId') is not None or self.new_object.get('organization_id') is not None: new_object_params['organizationId'] = self.new_object.get('organizationId') or \ self.new_object.get('organization_id') @@ -136,24 +136,21 @@ class Networks(object): def update_by_id_params(self): new_object_params = {} - if self.new_object.get('name') is not None or self.new_object.get('name') is not None: - new_object_params['name'] = self.new_object.get('name') or \ - self.new_object.get('name') - if self.new_object.get('timeZone') is not None or self.new_object.get('time_zone') is not None: - new_object_params['timeZone'] = self.new_object.get('timeZone') or \ - self.new_object.get('time_zone') - if self.new_object.get('productTypes') is not None or self.new_object.get('product_types') is not None: - new_object_params['productTypes'] = self.new_object.get('productTypes') or \ - self.new_object.get('product_types') - if self.new_object.get('tags') is not None or self.new_object.get('tags') is not None: - new_object_params['tags'] = self.new_object.get('tags') or \ - self.new_object.get('tags') if self.new_object.get('enrollmentString') is not None or self.new_object.get('enrollment_string') is not None: new_object_params['enrollmentString'] = self.new_object.get('enrollmentString') or \ self.new_object.get('enrollment_string') + if self.new_object.get('name') is not None or self.new_object.get('name') is not None: + new_object_params['name'] = self.new_object.get('name') or \ + self.new_object.get('name') if self.new_object.get('notes') is not None or self.new_object.get('notes') is not None: new_object_params['notes'] = self.new_object.get('notes') or \ self.new_object.get('notes') + if self.new_object.get('tags') is not None or self.new_object.get('tags') is not None: + new_object_params['tags'] = self.new_object.get('tags') or \ + self.new_object.get('tags') + if self.new_object.get('timeZone') is not None or self.new_object.get('time_zone') is not None: + new_object_params['timeZone'] = self.new_object.get('timeZone') or \ + self.new_object.get('time_zone') if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: new_object_params['networkId'] = self.new_object.get('networkId') or \ self.new_object.get('network_id') @@ -228,12 +225,12 @@ class Networks(object): requested_obj = self.new_object obj_params = [ + ("copyFromNetworkId", "copyFromNetworkId"), ("name", "name"), + ("notes", "notes"), ("productTypes", "productTypes"), ("tags", "tags"), ("timeZone", "timeZone"), - ("copyFromNetworkId", "copyFromNetworkId"), - ("notes", "notes"), ("organizationId", "organizationId"), ("networkId", "networkId"), ("enrollmentString", "enrollmentString"), diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_alerts_settings.py b/ansible_collections/cisco/meraki/plugins/action/networks_alerts_settings.py index 9389b5db1..6d0da8e32 100644 --- a/ansible_collections/cisco/meraki/plugins/action/networks_alerts_settings.py +++ b/ansible_collections/cisco/meraki/plugins/action/networks_alerts_settings.py @@ -32,8 +32,9 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present"]), - defaultDestinations=dict(type="dict"), alerts=dict(type="list"), + defaultDestinations=dict(type="dict"), + muting=dict(type="dict"), networkId=dict(type="str"), )) @@ -49,8 +50,9 @@ class NetworksAlertsSettings(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( - defaultDestinations=params.get("defaultDestinations"), alerts=params.get("alerts"), + defaultDestinations=params.get("defaultDestinations"), + muting=params.get("muting"), network_id=params.get("networkId"), ) @@ -63,12 +65,15 @@ class NetworksAlertsSettings(object): def update_all_params(self): new_object_params = {} - if self.new_object.get('defaultDestinations') is not None or self.new_object.get('default_destinations') is not None: - new_object_params['defaultDestinations'] = self.new_object.get('defaultDestinations') or \ - self.new_object.get('default_destinations') if self.new_object.get('alerts') is not None or self.new_object.get('alerts') is not None: new_object_params['alerts'] = self.new_object.get('alerts') or \ self.new_object.get('alerts') + if self.new_object.get('defaultDestinations') is not None or self.new_object.get('default_destinations') is not None: + new_object_params['defaultDestinations'] = self.new_object.get('defaultDestinations') or \ + self.new_object.get('default_destinations') + if self.new_object.get('muting') is not None or self.new_object.get('muting') is not None: + new_object_params['muting'] = self.new_object.get('muting') or \ + self.new_object.get('muting') if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: new_object_params['networkId'] = self.new_object.get('networkId') or \ self.new_object.get('network_id') @@ -125,8 +130,9 @@ class NetworksAlertsSettings(object): requested_obj = self.new_object obj_params = [ - ("defaultDestinations", "defaultDestinations"), ("alerts", "alerts"), + ("defaultDestinations", "defaultDestinations"), + ("muting", "muting"), ("networkId", "networkId"), ] # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_appliance_content_filtering.py b/ansible_collections/cisco/meraki/plugins/action/networks_appliance_content_filtering.py index 5cad13ae6..3f1144ee3 100644 --- a/ansible_collections/cisco/meraki/plugins/action/networks_appliance_content_filtering.py +++ b/ansible_collections/cisco/meraki/plugins/action/networks_appliance_content_filtering.py @@ -33,8 +33,8 @@ argument_spec = meraki_argument_spec() argument_spec.update(dict( state=dict(type="str", default="present", choices=["present"]), allowedUrlPatterns=dict(type="list"), - blockedUrlPatterns=dict(type="list"), blockedUrlCategories=dict(type="list"), + blockedUrlPatterns=dict(type="list"), urlCategoryListSize=dict(type="str"), networkId=dict(type="str"), )) @@ -52,8 +52,8 @@ class NetworksApplianceContentFiltering(object): self.meraki = meraki self.new_object = dict( allowedUrlPatterns=params.get("allowedUrlPatterns"), - blockedUrlPatterns=params.get("blockedUrlPatterns"), blockedUrlCategories=params.get("blockedUrlCategories"), + blockedUrlPatterns=params.get("blockedUrlPatterns"), urlCategoryListSize=params.get("urlCategoryListSize"), network_id=params.get("networkId"), ) @@ -70,12 +70,12 @@ class NetworksApplianceContentFiltering(object): if self.new_object.get('allowedUrlPatterns') is not None or self.new_object.get('allowed_url_patterns') is not None: new_object_params['allowedUrlPatterns'] = self.new_object.get('allowedUrlPatterns') or \ self.new_object.get('allowed_url_patterns') - if self.new_object.get('blockedUrlPatterns') is not None or self.new_object.get('blocked_url_patterns') is not None: - new_object_params['blockedUrlPatterns'] = self.new_object.get('blockedUrlPatterns') or \ - self.new_object.get('blocked_url_patterns') if self.new_object.get('blockedUrlCategories') is not None or self.new_object.get('blocked_url_categories') is not None: new_object_params['blockedUrlCategories'] = self.new_object.get('blockedUrlCategories') or \ self.new_object.get('blocked_url_categories') + if self.new_object.get('blockedUrlPatterns') is not None or self.new_object.get('blocked_url_patterns') is not None: + new_object_params['blockedUrlPatterns'] = self.new_object.get('blockedUrlPatterns') or \ + self.new_object.get('blocked_url_patterns') if self.new_object.get('urlCategoryListSize') is not None or self.new_object.get('url_category_list_size') is not None: new_object_params['urlCategoryListSize'] = self.new_object.get('urlCategoryListSize') or \ self.new_object.get('url_category_list_size') @@ -136,8 +136,8 @@ class NetworksApplianceContentFiltering(object): obj_params = [ ("allowedUrlPatterns", "allowedUrlPatterns"), - ("blockedUrlPatterns", "blockedUrlPatterns"), ("blockedUrlCategories", "blockedUrlCategories"), + ("blockedUrlPatterns", "blockedUrlPatterns"), ("urlCategoryListSize", "urlCategoryListSize"), ("networkId", "networkId"), ] diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_appliance_ports.py b/ansible_collections/cisco/meraki/plugins/action/networks_appliance_ports.py index 1c57e3fb3..c6a4ddbfb 100644 --- a/ansible_collections/cisco/meraki/plugins/action/networks_appliance_ports.py +++ b/ansible_collections/cisco/meraki/plugins/action/networks_appliance_ports.py @@ -32,12 +32,12 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present"]), - enabled=dict(type="bool"), + accessPolicy=dict(type="str"), + allowedVlans=dict(type="str"), dropUntaggedTraffic=dict(type="bool"), + enabled=dict(type="bool"), type=dict(type="str"), vlan=dict(type="int"), - allowedVlans=dict(type="str"), - accessPolicy=dict(type="str"), networkId=dict(type="str"), portId=dict(type="str"), )) @@ -54,12 +54,12 @@ class NetworksAppliancePorts(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( - enabled=params.get("enabled"), + accessPolicy=params.get("accessPolicy"), + allowedVlans=params.get("allowedVlans"), dropUntaggedTraffic=params.get("dropUntaggedTraffic"), + enabled=params.get("enabled"), type=params.get("type"), vlan=params.get("vlan"), - allowedVlans=params.get("allowedVlans"), - accessPolicy=params.get("accessPolicy"), network_id=params.get("networkId"), port_id=params.get("portId"), ) @@ -83,22 +83,22 @@ class NetworksAppliancePorts(object): def update_by_id_params(self): new_object_params = {} - if self.new_object.get('enabled') is not None or self.new_object.get('enabled') is not None: - new_object_params['enabled'] = self.new_object.get('enabled') + if self.new_object.get('accessPolicy') is not None or self.new_object.get('access_policy') is not None: + new_object_params['accessPolicy'] = self.new_object.get('accessPolicy') or \ + self.new_object.get('access_policy') + if self.new_object.get('allowedVlans') is not None or self.new_object.get('allowed_vlans') is not None: + new_object_params['allowedVlans'] = self.new_object.get('allowedVlans') or \ + self.new_object.get('allowed_vlans') if self.new_object.get('dropUntaggedTraffic') is not None or self.new_object.get('drop_untagged_traffic') is not None: new_object_params['dropUntaggedTraffic'] = self.new_object.get('dropUntaggedTraffic') + if self.new_object.get('enabled') is not None or self.new_object.get('enabled') is not None: + new_object_params['enabled'] = self.new_object.get('enabled') if self.new_object.get('type') is not None or self.new_object.get('type') is not None: new_object_params['type'] = self.new_object.get('type') or \ self.new_object.get('type') if self.new_object.get('vlan') is not None or self.new_object.get('vlan') is not None: new_object_params['vlan'] = self.new_object.get('vlan') or \ self.new_object.get('vlan') - if self.new_object.get('allowedVlans') is not None or self.new_object.get('allowed_vlans') is not None: - new_object_params['allowedVlans'] = self.new_object.get('allowedVlans') or \ - self.new_object.get('allowed_vlans') - if self.new_object.get('accessPolicy') is not None or self.new_object.get('access_policy') is not None: - new_object_params['accessPolicy'] = self.new_object.get('accessPolicy') or \ - self.new_object.get('access_policy') if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: new_object_params['networkId'] = self.new_object.get('networkId') or \ self.new_object.get('network_id') @@ -176,12 +176,12 @@ class NetworksAppliancePorts(object): requested_obj = self.new_object obj_params = [ - ("enabled", "enabled"), + ("accessPolicy", "accessPolicy"), + ("allowedVlans", "allowedVlans"), ("dropUntaggedTraffic", "dropUntaggedTraffic"), + ("enabled", "enabled"), ("type", "type"), ("vlan", "vlan"), - ("allowedVlans", "allowedVlans"), - ("accessPolicy", "accessPolicy"), ("networkId", "networkId"), ("portId", "portId"), ] diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_appliance_prefixes_delegated_statics.py b/ansible_collections/cisco/meraki/plugins/action/networks_appliance_prefixes_delegated_statics.py index 0297ff01e..f0fdfec7c 100644 --- a/ansible_collections/cisco/meraki/plugins/action/networks_appliance_prefixes_delegated_statics.py +++ b/ansible_collections/cisco/meraki/plugins/action/networks_appliance_prefixes_delegated_statics.py @@ -32,9 +32,9 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present", "absent"]), - prefix=dict(type="str"), - origin=dict(type="dict"), description=dict(type="str"), + origin=dict(type="dict"), + prefix=dict(type="str"), networkId=dict(type="str"), staticDelegatedPrefixId=dict(type="str"), )) @@ -52,9 +52,9 @@ class NetworksAppliancePrefixesDelegatedStatics(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( - prefix=params.get("prefix"), - origin=params.get("origin"), description=params.get("description"), + origin=params.get("origin"), + prefix=params.get("prefix"), networkId=params.get("networkId"), staticDelegatedPrefixId=params.get("staticDelegatedPrefixId"), ) @@ -78,15 +78,15 @@ class NetworksAppliancePrefixesDelegatedStatics(object): def create_params(self): new_object_params = {} - if self.new_object.get('prefix') is not None or self.new_object.get('prefix') is not None: - new_object_params['prefix'] = self.new_object.get('prefix') or \ - self.new_object.get('prefix') - if self.new_object.get('origin') is not None or self.new_object.get('origin') is not None: - new_object_params['origin'] = self.new_object.get('origin') or \ - self.new_object.get('origin') if self.new_object.get('description') is not None or self.new_object.get('description') is not None: new_object_params['description'] = self.new_object.get('description') or \ self.new_object.get('description') + if self.new_object.get('origin') is not None or self.new_object.get('origin') is not None: + new_object_params['origin'] = self.new_object.get('origin') or \ + self.new_object.get('origin') + if self.new_object.get('prefix') is not None or self.new_object.get('prefix') is not None: + new_object_params['prefix'] = self.new_object.get('prefix') or \ + self.new_object.get('prefix') if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: new_object_params['networkId'] = self.new_object.get('networkId') or \ self.new_object.get('network_id') @@ -104,15 +104,15 @@ class NetworksAppliancePrefixesDelegatedStatics(object): def update_by_id_params(self): new_object_params = {} - if self.new_object.get('prefix') is not None or self.new_object.get('prefix') is not None: - new_object_params['prefix'] = self.new_object.get('prefix') or \ - self.new_object.get('prefix') - if self.new_object.get('origin') is not None or self.new_object.get('origin') is not None: - new_object_params['origin'] = self.new_object.get('origin') or \ - self.new_object.get('origin') if self.new_object.get('description') is not None or self.new_object.get('description') is not None: new_object_params['description'] = self.new_object.get('description') or \ self.new_object.get('description') + if self.new_object.get('origin') is not None or self.new_object.get('origin') is not None: + new_object_params['origin'] = self.new_object.get('origin') or \ + self.new_object.get('origin') + if self.new_object.get('prefix') is not None or self.new_object.get('prefix') is not None: + new_object_params['prefix'] = self.new_object.get('prefix') or \ + self.new_object.get('prefix') if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: new_object_params['networkId'] = self.new_object.get('networkId') or \ self.new_object.get('network_id') @@ -190,9 +190,9 @@ class NetworksAppliancePrefixesDelegatedStatics(object): requested_obj = self.new_object obj_params = [ - ("prefix", "prefix"), - ("origin", "origin"), ("description", "description"), + ("origin", "origin"), + ("prefix", "prefix"), ("networkId", "networkId"), ("staticDelegatedPrefixId", "staticDelegatedPrefixId"), ] diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_appliance_rf_profiles.py b/ansible_collections/cisco/meraki/plugins/action/networks_appliance_rf_profiles.py new file mode 100644 index 000000000..88a31b2d1 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/action/networks_appliance_rf_profiles.py @@ -0,0 +1,252 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or +# https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( + MERAKI, + meraki_argument_spec, + meraki_compare_equality, + get_dict_result, +) +from ansible_collections.cisco.meraki.plugins.plugin_utils.exceptions import ( + InconsistentParameters, +) + +# Get common arguments specification +argument_spec = meraki_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present", "absent"]), + fiveGhzSettings=dict(type="dict"), + name=dict(type="str"), + perSsidSettings=dict(type="dict"), + twoFourGhzSettings=dict(type="dict"), + networkId=dict(type="str"), +)) + +required_if = [ + ("state", "present", ["name", "networkId"], True), + ("state", "absent", ["name", "networkId"], True), +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class NetworksApplianceRfProfiles(object): + def __init__(self, params, meraki): + self.meraki = meraki + self.new_object = dict( + fiveGhzSettings=params.get("fiveGhzSettings"), + name=params.get("name"), + perSsidSettings=params.get("perSsidSettings"), + twoFourGhzSettings=params.get("twoFourGhzSettings"), + networkId=params.get("networkId"), + ) + + def get_all_params(self, name=None, id=None): + new_object_params = {} + if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: + new_object_params['networkId'] = self.new_object.get('networkId') or \ + self.new_object.get('network_id') + return new_object_params + + def create_params(self): + new_object_params = {} + if self.new_object.get('fiveGhzSettings') is not None or self.new_object.get('five_ghz_settings') is not None: + new_object_params['fiveGhzSettings'] = self.new_object.get('fiveGhzSettings') or \ + self.new_object.get('five_ghz_settings') + if self.new_object.get('name') is not None or self.new_object.get('name') is not None: + new_object_params['name'] = self.new_object.get('name') or \ + self.new_object.get('name') + if self.new_object.get('perSsidSettings') is not None or self.new_object.get('per_ssid_settings') is not None: + new_object_params['perSsidSettings'] = self.new_object.get('perSsidSettings') or \ + self.new_object.get('per_ssid_settings') + if self.new_object.get('twoFourGhzSettings') is not None or self.new_object.get('two_four_ghz_settings') is not None: + new_object_params['twoFourGhzSettings'] = self.new_object.get('twoFourGhzSettings') or \ + self.new_object.get('two_four_ghz_settings') + if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: + new_object_params['networkId'] = self.new_object.get('networkId') or \ + self.new_object.get('network_id') + return new_object_params + + def get_object_by_name(self, name): + result = None + # NOTE: Does not have a get by name method or it is in another action + try: + items = self.meraki.exec_meraki( + family="appliance", + function="getNetworkApplianceRfProfiles", + params=self.get_all_params(name=name), + ) + if isinstance(items, dict): + if 'assigned' in items: + items = items.get('assigned') + result = get_dict_result(items, 'name', name) + if result is None: + result = items + except Exception as e: + print("Error: ", e) + result = None + return result + + def get_object_by_id(self, id): + result = None + # NOTE: Does not have a get by id method or it is in another action + try: + items = self.meraki.exec_meraki( + family="appliance", + function="getNetworkApplianceRfProfiles", + params=self.get_all_params(id=id), + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'id', id) + except Exception as e: + print("Error: ", e) + result = None + return result + + def exists(self): + id_exists = False + name_exists = False + prev_obj = None + o_id = self.new_object.get("id") + name = self.new_object.get("name") + if o_id: + prev_obj = self.get_object_by_id(o_id) + id_exists = prev_obj is not None and isinstance(prev_obj, dict) + if not id_exists and name: + prev_obj = self.get_object_by_name(name) + name_exists = prev_obj is not None and isinstance(prev_obj, dict) + if name_exists: + _id = prev_obj.get("id") + if id_exists and name_exists and o_id != _id: + raise InconsistentParameters( + "The 'id' and 'name' params don't refer to the same object") + if _id: + self.new_object.update(dict(id=_id)) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object + + obj_params = [ + ("fiveGhzSettings", "fiveGhzSettings"), + ("name", "name"), + ("perSsidSettings", "perSsidSettings"), + ("twoFourGhzSettings", "twoFourGhzSettings"), + ("networkId", "networkId"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (DNAC) params + # If any does not have eq params, it requires update + return any(not meraki_compare_equality(current_obj.get(meraki_param), + requested_obj.get(ansible_param)) + for (meraki_param, ansible_param) in obj_params) + + def create(self): + result = self.meraki.exec_meraki( + family="appliance", + function="createNetworkApplianceRfProfile", + params=self.create_params(), + op_modifies=True, + ) + return result + + def update(self): + id = self.new_object.get("id") + name = self.new_object.get("name") + result = None + # NOTE: Does not have update method. What do we do? + return result + + def delete(self): + id = self.new_object.get("id") + name = self.new_object.get("name") + result = None + # NOTE: Does not have delete method. What do we do? + return result + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail( + "ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + meraki = MERAKI(self._task.args) + obj = NetworksApplianceRfProfiles(self._task.args, meraki) + + state = self._task.args.get("state") + + response = None + + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = obj.update() + meraki.object_updated() + else: + response = prev_obj + meraki.object_already_present() + else: + response = obj.create() + meraki.object_created() + + elif state == "absent": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + response = obj.delete() + meraki.object_deleted() + else: + meraki.object_already_absent() + + self._result.update(dict(meraki_response=response)) + self._result.update(meraki.exit_json()) + return self._result diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_appliance_rf_profiles_info.py b/ansible_collections/cisco/meraki/plugins/action/networks_appliance_rf_profiles_info.py new file mode 100644 index 000000000..863571233 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/action/networks_appliance_rf_profiles_info.py @@ -0,0 +1,90 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( + MERAKI, + meraki_argument_spec, +) + +# Get common arguments specification +argument_spec = meraki_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + networkId=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail( + "ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_all(self, params): + new_object = {} + if params.get("networkId") is not None: + new_object["networkId"] = params.get( + "networkId") + + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(meraki_response={})) + + meraki = MERAKI(params=self._task.args) + + response = meraki.exec_meraki( + family="appliance", + function='getNetworkApplianceRfProfiles', + params=self.get_all(self._task.args), + ) + self._result.update(dict(meraki_response=response)) + self._result.update(meraki.exit_json()) + return self._result diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_appliance_security_intrusion.py b/ansible_collections/cisco/meraki/plugins/action/networks_appliance_security_intrusion.py index 3449abf9c..6da952d48 100644 --- a/ansible_collections/cisco/meraki/plugins/action/networks_appliance_security_intrusion.py +++ b/ansible_collections/cisco/meraki/plugins/action/networks_appliance_security_intrusion.py @@ -32,8 +32,8 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present"]), - mode=dict(type="str"), idsRulesets=dict(type="str"), + mode=dict(type="str"), protectedNetworks=dict(type="dict"), networkId=dict(type="str"), )) @@ -50,8 +50,8 @@ class NetworksApplianceSecurityIntrusion(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( - mode=params.get("mode"), idsRulesets=params.get("idsRulesets"), + mode=params.get("mode"), protectedNetworks=params.get("protectedNetworks"), network_id=params.get("networkId"), ) @@ -65,12 +65,12 @@ class NetworksApplianceSecurityIntrusion(object): def update_all_params(self): new_object_params = {} - if self.new_object.get('mode') is not None or self.new_object.get('mode') is not None: - new_object_params['mode'] = self.new_object.get('mode') or \ - self.new_object.get('mode') if self.new_object.get('idsRulesets') is not None or self.new_object.get('ids_rulesets') is not None: new_object_params['idsRulesets'] = self.new_object.get('idsRulesets') or \ self.new_object.get('ids_rulesets') + if self.new_object.get('mode') is not None or self.new_object.get('mode') is not None: + new_object_params['mode'] = self.new_object.get('mode') or \ + self.new_object.get('mode') if self.new_object.get('protectedNetworks') is not None or self.new_object.get('protected_networks') is not None: new_object_params['protectedNetworks'] = self.new_object.get('protectedNetworks') or \ self.new_object.get('protected_networks') @@ -130,8 +130,8 @@ class NetworksApplianceSecurityIntrusion(object): requested_obj = self.new_object obj_params = [ - ("mode", "mode"), ("idsRulesets", "idsRulesets"), + ("mode", "mode"), ("protectedNetworks", "protectedNetworks"), ("networkId", "networkId"), ] diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_appliance_security_malware.py b/ansible_collections/cisco/meraki/plugins/action/networks_appliance_security_malware.py index 904889494..faef0ed12 100644 --- a/ansible_collections/cisco/meraki/plugins/action/networks_appliance_security_malware.py +++ b/ansible_collections/cisco/meraki/plugins/action/networks_appliance_security_malware.py @@ -32,9 +32,9 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present"]), - mode=dict(type="str"), - allowedUrls=dict(type="list"), allowedFiles=dict(type="list"), + allowedUrls=dict(type="list"), + mode=dict(type="str"), networkId=dict(type="str"), )) @@ -50,9 +50,9 @@ class NetworksApplianceSecurityMalware(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( - mode=params.get("mode"), - allowedUrls=params.get("allowedUrls"), allowedFiles=params.get("allowedFiles"), + allowedUrls=params.get("allowedUrls"), + mode=params.get("mode"), network_id=params.get("networkId"), ) @@ -65,15 +65,15 @@ class NetworksApplianceSecurityMalware(object): def update_all_params(self): new_object_params = {} - if self.new_object.get('mode') is not None or self.new_object.get('mode') is not None: - new_object_params['mode'] = self.new_object.get('mode') or \ - self.new_object.get('mode') - if self.new_object.get('allowedUrls') is not None or self.new_object.get('allowed_urls') is not None: - new_object_params['allowedUrls'] = self.new_object.get('allowedUrls') or \ - self.new_object.get('allowed_urls') if self.new_object.get('allowedFiles') is not None or self.new_object.get('allowed_files') is not None: new_object_params['allowedFiles'] = self.new_object.get('allowedFiles') or \ self.new_object.get('allowed_files') + if self.new_object.get('allowedUrls') is not None or self.new_object.get('allowed_urls') is not None: + new_object_params['allowedUrls'] = self.new_object.get('allowedUrls') or \ + self.new_object.get('allowed_urls') + if self.new_object.get('mode') is not None or self.new_object.get('mode') is not None: + new_object_params['mode'] = self.new_object.get('mode') or \ + self.new_object.get('mode') if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: new_object_params['networkId'] = self.new_object.get('networkId') or \ self.new_object.get('network_id') @@ -130,9 +130,9 @@ class NetworksApplianceSecurityMalware(object): requested_obj = self.new_object obj_params = [ - ("mode", "mode"), - ("allowedUrls", "allowedUrls"), ("allowedFiles", "allowedFiles"), + ("allowedUrls", "allowedUrls"), + ("mode", "mode"), ("networkId", "networkId"), ] # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_appliance_single_lan.py b/ansible_collections/cisco/meraki/plugins/action/networks_appliance_single_lan.py index fd8219403..4254f631f 100644 --- a/ansible_collections/cisco/meraki/plugins/action/networks_appliance_single_lan.py +++ b/ansible_collections/cisco/meraki/plugins/action/networks_appliance_single_lan.py @@ -32,10 +32,10 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present"]), - subnet=dict(type="str"), applianceIp=dict(type="str"), ipv6=dict(type="dict"), mandatoryDhcp=dict(type="dict"), + subnet=dict(type="str"), networkId=dict(type="str"), )) @@ -51,10 +51,10 @@ class NetworksApplianceSingleLan(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( - subnet=params.get("subnet"), applianceIp=params.get("applianceIp"), ipv6=params.get("ipv6"), mandatoryDhcp=params.get("mandatoryDhcp"), + subnet=params.get("subnet"), network_id=params.get("networkId"), ) @@ -67,9 +67,6 @@ class NetworksApplianceSingleLan(object): def update_all_params(self): new_object_params = {} - if self.new_object.get('subnet') is not None or self.new_object.get('subnet') is not None: - new_object_params['subnet'] = self.new_object.get('subnet') or \ - self.new_object.get('subnet') if self.new_object.get('applianceIp') is not None or self.new_object.get('appliance_ip') is not None: new_object_params['applianceIp'] = self.new_object.get('applianceIp') or \ self.new_object.get('appliance_ip') @@ -79,6 +76,9 @@ class NetworksApplianceSingleLan(object): if self.new_object.get('mandatoryDhcp') is not None or self.new_object.get('mandatory_dhcp') is not None: new_object_params['mandatoryDhcp'] = self.new_object.get('mandatoryDhcp') or \ self.new_object.get('mandatory_dhcp') + if self.new_object.get('subnet') is not None or self.new_object.get('subnet') is not None: + new_object_params['subnet'] = self.new_object.get('subnet') or \ + self.new_object.get('subnet') if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: new_object_params['networkId'] = self.new_object.get('networkId') or \ self.new_object.get('network_id') @@ -135,10 +135,10 @@ class NetworksApplianceSingleLan(object): requested_obj = self.new_object obj_params = [ - ("subnet", "subnet"), ("applianceIp", "applianceIp"), ("ipv6", "ipv6"), ("mandatoryDhcp", "mandatoryDhcp"), + ("subnet", "subnet"), ("networkId", "networkId"), ] # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_appliance_ssids.py b/ansible_collections/cisco/meraki/plugins/action/networks_appliance_ssids.py index cfe172d5a..364855692 100644 --- a/ansible_collections/cisco/meraki/plugins/action/networks_appliance_ssids.py +++ b/ansible_collections/cisco/meraki/plugins/action/networks_appliance_ssids.py @@ -32,16 +32,17 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present"]), - name=dict(type="str"), - enabled=dict(type="bool"), - defaultVlanId=dict(type="int"), authMode=dict(type="str"), + defaultVlanId=dict(type="int"), + dhcpEnforcedDeauthentication=dict(type="dict"), + dot11w=dict(type="dict"), + enabled=dict(type="bool"), + encryptionMode=dict(type="str"), + name=dict(type="str"), psk=dict(type="str"), radiusServers=dict(type="list"), - encryptionMode=dict(type="str"), - wpaEncryptionMode=dict(type="str"), visible=dict(type="bool"), - dhcpEnforcedDeauthentication=dict(type="dict"), + wpaEncryptionMode=dict(type="str"), networkId=dict(type="str"), number=dict(type="str"), )) @@ -58,16 +59,17 @@ class NetworksApplianceSsids(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( - name=params.get("name"), - enabled=params.get("enabled"), - defaultVlanId=params.get("defaultVlanId"), authMode=params.get("authMode"), + defaultVlanId=params.get("defaultVlanId"), + dhcpEnforcedDeauthentication=params.get("dhcpEnforcedDeauthentication"), + dot11w=params.get("dot11w"), + enabled=params.get("enabled"), + encryptionMode=params.get("encryptionMode"), + name=params.get("name"), psk=params.get("psk"), radiusServers=params.get("radiusServers"), - encryptionMode=params.get("encryptionMode"), - wpaEncryptionMode=params.get("wpaEncryptionMode"), visible=params.get("visible"), - dhcpEnforcedDeauthentication=params.get("dhcpEnforcedDeauthentication"), + wpaEncryptionMode=params.get("wpaEncryptionMode"), network_id=params.get("networkId"), number=params.get("number"), ) @@ -90,34 +92,37 @@ class NetworksApplianceSsids(object): def update_by_id_params(self): new_object_params = {} - if self.new_object.get('name') is not None or self.new_object.get('name') is not None: - new_object_params['name'] = self.new_object.get('name') or \ - self.new_object.get('name') - if self.new_object.get('enabled') is not None or self.new_object.get('enabled') is not None: - new_object_params['enabled'] = self.new_object.get('enabled') - if self.new_object.get('defaultVlanId') is not None or self.new_object.get('default_vlan_id') is not None: - new_object_params['defaultVlanId'] = self.new_object.get('defaultVlanId') or \ - self.new_object.get('default_vlan_id') if self.new_object.get('authMode') is not None or self.new_object.get('auth_mode') is not None: new_object_params['authMode'] = self.new_object.get('authMode') or \ self.new_object.get('auth_mode') + if self.new_object.get('defaultVlanId') is not None or self.new_object.get('default_vlan_id') is not None: + new_object_params['defaultVlanId'] = self.new_object.get('defaultVlanId') or \ + self.new_object.get('default_vlan_id') + if self.new_object.get('dhcpEnforcedDeauthentication') is not None or self.new_object.get('dhcp_enforced_deauthentication') is not None: + new_object_params['dhcpEnforcedDeauthentication'] = self.new_object.get('dhcpEnforcedDeauthentication') or \ + self.new_object.get('dhcp_enforced_deauthentication') + if self.new_object.get('dot11w') is not None or self.new_object.get('dot11w') is not None: + new_object_params['dot11w'] = self.new_object.get('dot11w') or \ + self.new_object.get('dot11w') + if self.new_object.get('enabled') is not None or self.new_object.get('enabled') is not None: + new_object_params['enabled'] = self.new_object.get('enabled') + if self.new_object.get('encryptionMode') is not None or self.new_object.get('encryption_mode') is not None: + new_object_params['encryptionMode'] = self.new_object.get('encryptionMode') or \ + self.new_object.get('encryption_mode') + if self.new_object.get('name') is not None or self.new_object.get('name') is not None: + new_object_params['name'] = self.new_object.get('name') or \ + self.new_object.get('name') if self.new_object.get('psk') is not None or self.new_object.get('psk') is not None: new_object_params['psk'] = self.new_object.get('psk') or \ self.new_object.get('psk') if self.new_object.get('radiusServers') is not None or self.new_object.get('radius_servers') is not None: new_object_params['radiusServers'] = self.new_object.get('radiusServers') or \ self.new_object.get('radius_servers') - if self.new_object.get('encryptionMode') is not None or self.new_object.get('encryption_mode') is not None: - new_object_params['encryptionMode'] = self.new_object.get('encryptionMode') or \ - self.new_object.get('encryption_mode') + if self.new_object.get('visible') is not None or self.new_object.get('visible') is not None: + new_object_params['visible'] = self.new_object.get('visible') if self.new_object.get('wpaEncryptionMode') is not None or self.new_object.get('wpa_encryption_mode') is not None: new_object_params['wpaEncryptionMode'] = self.new_object.get('wpaEncryptionMode') or \ self.new_object.get('wpa_encryption_mode') - if self.new_object.get('visible') is not None or self.new_object.get('visible') is not None: - new_object_params['visible'] = self.new_object.get('visible') - if self.new_object.get('dhcpEnforcedDeauthentication') is not None or self.new_object.get('dhcp_enforced_deauthentication') is not None: - new_object_params['dhcpEnforcedDeauthentication'] = self.new_object.get('dhcpEnforcedDeauthentication') or \ - self.new_object.get('dhcp_enforced_deauthentication') if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: new_object_params['networkId'] = self.new_object.get('networkId') or \ self.new_object.get('network_id') @@ -195,16 +200,17 @@ class NetworksApplianceSsids(object): requested_obj = self.new_object obj_params = [ - ("name", "name"), - ("enabled", "enabled"), - ("defaultVlanId", "defaultVlanId"), ("authMode", "authMode"), + ("defaultVlanId", "defaultVlanId"), + ("dhcpEnforcedDeauthentication", "dhcpEnforcedDeauthentication"), + ("dot11w", "dot11w"), + ("enabled", "enabled"), + ("encryptionMode", "encryptionMode"), + ("name", "name"), ("psk", "psk"), ("radiusServers", "radiusServers"), - ("encryptionMode", "encryptionMode"), - ("wpaEncryptionMode", "wpaEncryptionMode"), ("visible", "visible"), - ("dhcpEnforcedDeauthentication", "dhcpEnforcedDeauthentication"), + ("wpaEncryptionMode", "wpaEncryptionMode"), ("networkId", "networkId"), ("number", "number"), ] diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_appliance_traffic_shaping_custom_performance_classes.py b/ansible_collections/cisco/meraki/plugins/action/networks_appliance_traffic_shaping_custom_performance_classes.py index 4331bc9b2..dd072c4c8 100644 --- a/ansible_collections/cisco/meraki/plugins/action/networks_appliance_traffic_shaping_custom_performance_classes.py +++ b/ansible_collections/cisco/meraki/plugins/action/networks_appliance_traffic_shaping_custom_performance_classes.py @@ -25,10 +25,10 @@ from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( - name=dict(type="str"), - maxLatency=dict(type="int"), maxJitter=dict(type="int"), + maxLatency=dict(type="int"), maxLossPercentage=dict(type="int"), + name=dict(type="str"), networkId=dict(type="str"), )) @@ -68,10 +68,10 @@ class ActionModule(ActionBase): def get_object(self, params): new_object = dict( - name=params.get("name"), - maxLatency=params.get("maxLatency"), maxJitter=params.get("maxJitter"), + maxLatency=params.get("maxLatency"), maxLossPercentage=params.get("maxLossPercentage"), + name=params.get("name"), networkId=params.get("networkId"), ) return new_object diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_appliance_traffic_shaping_uplink_selection.py b/ansible_collections/cisco/meraki/plugins/action/networks_appliance_traffic_shaping_uplink_selection.py index 79b737a1e..525ba5f77 100644 --- a/ansible_collections/cisco/meraki/plugins/action/networks_appliance_traffic_shaping_uplink_selection.py +++ b/ansible_collections/cisco/meraki/plugins/action/networks_appliance_traffic_shaping_uplink_selection.py @@ -34,10 +34,10 @@ argument_spec.update(dict( state=dict(type="str", default="present", choices=["present"]), activeActiveAutoVpnEnabled=dict(type="bool"), defaultUplink=dict(type="str"), - loadBalancingEnabled=dict(type="bool"), failoverAndFailback=dict(type="dict"), - wanTrafficUplinkPreferences=dict(type="list"), + loadBalancingEnabled=dict(type="bool"), vpnTrafficUplinkPreferences=dict(type="list"), + wanTrafficUplinkPreferences=dict(type="list"), networkId=dict(type="str"), )) @@ -55,10 +55,10 @@ class NetworksApplianceTrafficShapingUplinkSelection(object): self.new_object = dict( activeActiveAutoVpnEnabled=params.get("activeActiveAutoVpnEnabled"), defaultUplink=params.get("defaultUplink"), - loadBalancingEnabled=params.get("loadBalancingEnabled"), failoverAndFailback=params.get("failoverAndFailback"), - wanTrafficUplinkPreferences=params.get("wanTrafficUplinkPreferences"), + loadBalancingEnabled=params.get("loadBalancingEnabled"), vpnTrafficUplinkPreferences=params.get("vpnTrafficUplinkPreferences"), + wanTrafficUplinkPreferences=params.get("wanTrafficUplinkPreferences"), network_id=params.get("networkId"), ) @@ -76,17 +76,17 @@ class NetworksApplianceTrafficShapingUplinkSelection(object): if self.new_object.get('defaultUplink') is not None or self.new_object.get('default_uplink') is not None: new_object_params['defaultUplink'] = self.new_object.get('defaultUplink') or \ self.new_object.get('default_uplink') - if self.new_object.get('loadBalancingEnabled') is not None or self.new_object.get('load_balancing_enabled') is not None: - new_object_params['loadBalancingEnabled'] = self.new_object.get('loadBalancingEnabled') if self.new_object.get('failoverAndFailback') is not None or self.new_object.get('failover_and_failback') is not None: new_object_params['failoverAndFailback'] = self.new_object.get('failoverAndFailback') or \ self.new_object.get('failover_and_failback') - if self.new_object.get('wanTrafficUplinkPreferences') is not None or self.new_object.get('wan_traffic_uplink_preferences') is not None: - new_object_params['wanTrafficUplinkPreferences'] = self.new_object.get('wanTrafficUplinkPreferences') or \ - self.new_object.get('wan_traffic_uplink_preferences') + if self.new_object.get('loadBalancingEnabled') is not None or self.new_object.get('load_balancing_enabled') is not None: + new_object_params['loadBalancingEnabled'] = self.new_object.get('loadBalancingEnabled') if self.new_object.get('vpnTrafficUplinkPreferences') is not None or self.new_object.get('vpn_traffic_uplink_preferences') is not None: new_object_params['vpnTrafficUplinkPreferences'] = self.new_object.get('vpnTrafficUplinkPreferences') or \ self.new_object.get('vpn_traffic_uplink_preferences') + if self.new_object.get('wanTrafficUplinkPreferences') is not None or self.new_object.get('wan_traffic_uplink_preferences') is not None: + new_object_params['wanTrafficUplinkPreferences'] = self.new_object.get('wanTrafficUplinkPreferences') or \ + self.new_object.get('wan_traffic_uplink_preferences') if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: new_object_params['networkId'] = self.new_object.get('networkId') or \ self.new_object.get('network_id') @@ -145,10 +145,10 @@ class NetworksApplianceTrafficShapingUplinkSelection(object): obj_params = [ ("activeActiveAutoVpnEnabled", "activeActiveAutoVpnEnabled"), ("defaultUplink", "defaultUplink"), - ("loadBalancingEnabled", "loadBalancingEnabled"), ("failoverAndFailback", "failoverAndFailback"), - ("wanTrafficUplinkPreferences", "wanTrafficUplinkPreferences"), + ("loadBalancingEnabled", "loadBalancingEnabled"), ("vpnTrafficUplinkPreferences", "vpnTrafficUplinkPreferences"), + ("wanTrafficUplinkPreferences", "wanTrafficUplinkPreferences"), ("networkId", "networkId"), ] # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_appliance_traffic_shaping_vpn_exclusions.py b/ansible_collections/cisco/meraki/plugins/action/networks_appliance_traffic_shaping_vpn_exclusions.py new file mode 100644 index 000000000..447231a08 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/action/networks_appliance_traffic_shaping_vpn_exclusions.py @@ -0,0 +1,91 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( + MERAKI, + meraki_argument_spec, +) + +# Get common arguements specification +argument_spec = meraki_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + custom=dict(type="list"), + majorApplications=dict(type="list"), + networkId=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail( + "ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + custom=params.get("custom"), + majorApplications=params.get("majorApplications"), + networkId=params.get("networkId"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + meraki = MERAKI(params=self._task.args) + + response = meraki.exec_meraki( + family="appliance", + function='updateNetworkApplianceTrafficShapingVpnExclusions', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(meraki_response=response)) + self._result.update(meraki.exit_json()) + return self._result diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_appliance_vlans.py b/ansible_collections/cisco/meraki/plugins/action/networks_appliance_vlans.py index ba4835a9d..48ebdb4ca 100644 --- a/ansible_collections/cisco/meraki/plugins/action/networks_appliance_vlans.py +++ b/ansible_collections/cisco/meraki/plugins/action/networks_appliance_vlans.py @@ -32,29 +32,29 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present", "absent"]), - id=dict(type="str"), - name=dict(type="str"), - subnet=dict(type="str"), applianceIp=dict(type="str"), - groupPolicyId=dict(type="str"), - templateVlanType=dict(type="str"), cidr=dict(type="str"), - mask=dict(type="int"), + groupPolicyId=dict(type="str"), + id=dict(type="str"), ipv6=dict(type="dict"), mandatoryDhcp=dict(type="dict"), + mask=dict(type="int"), + name=dict(type="str"), + subnet=dict(type="str"), + templateVlanType=dict(type="str"), networkId=dict(type="str"), vlanId=dict(type="str"), - vpnNatSubnet=dict(type="str"), + dhcpBootFilename=dict(type="str"), + dhcpBootNextServer=dict(type="str"), + dhcpBootOptionsEnabled=dict(type="bool"), dhcpHandling=dict(type="str"), - dhcpRelayServerIps=dict(type="list"), dhcpLeaseTime=dict(type="str"), - dhcpBootOptionsEnabled=dict(type="bool"), - dhcpBootNextServer=dict(type="str"), - dhcpBootFilename=dict(type="str"), + dhcpOptions=dict(type="list"), + dhcpRelayServerIps=dict(type="list"), + dnsNameservers=dict(type="str"), fixedIpAssignments=dict(type="dict"), reservedIpRanges=dict(type="list"), - dnsNameservers=dict(type="str"), - dhcpOptions=dict(type="list"), + vpnNatSubnet=dict(type="str"), )) required_if = [ @@ -70,29 +70,29 @@ class NetworksApplianceVlans(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( - id=params.get("id"), - name=params.get("name"), - subnet=params.get("subnet"), applianceIp=params.get("applianceIp"), - groupPolicyId=params.get("groupPolicyId"), - templateVlanType=params.get("templateVlanType"), cidr=params.get("cidr"), - mask=params.get("mask"), + groupPolicyId=params.get("groupPolicyId"), + id=params.get("id"), ipv6=params.get("ipv6"), mandatoryDhcp=params.get("mandatoryDhcp"), + mask=params.get("mask"), + name=params.get("name"), + subnet=params.get("subnet"), + templateVlanType=params.get("templateVlanType"), networkId=params.get("networkId"), vlanId=params.get("vlanId"), - vpnNatSubnet=params.get("vpnNatSubnet"), + dhcpBootFilename=params.get("dhcpBootFilename"), + dhcpBootNextServer=params.get("dhcpBootNextServer"), + dhcpBootOptionsEnabled=params.get("dhcpBootOptionsEnabled"), dhcpHandling=params.get("dhcpHandling"), - dhcpRelayServerIps=params.get("dhcpRelayServerIps"), dhcpLeaseTime=params.get("dhcpLeaseTime"), - dhcpBootOptionsEnabled=params.get("dhcpBootOptionsEnabled"), - dhcpBootNextServer=params.get("dhcpBootNextServer"), - dhcpBootFilename=params.get("dhcpBootFilename"), + dhcpOptions=params.get("dhcpOptions"), + dhcpRelayServerIps=params.get("dhcpRelayServerIps"), + dnsNameservers=params.get("dnsNameservers"), fixedIpAssignments=params.get("fixedIpAssignments"), reservedIpRanges=params.get("reservedIpRanges"), - dnsNameservers=params.get("dnsNameservers"), - dhcpOptions=params.get("dhcpOptions"), + vpnNatSubnet=params.get("vpnNatSubnet"), ) def get_all_params(self, name=None, id=None): @@ -107,43 +107,43 @@ class NetworksApplianceVlans(object): if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: new_object_params['networkId'] = self.new_object.get('networkId') or \ self.new_object.get('network_id') - if self.new_object.get('vlanId') is not None or self.new_object.get('vlan_id') is not None or self.new_object.get('id') is not None: + if self.new_object.get('vlanId') is not None or self.new_object.get('vlan_id') is not None: new_object_params['vlanId'] = self.new_object.get('vlanId') or \ - self.new_object.get('vlan_id') or self.new_object.get('id') + self.new_object.get('vlan_id') return new_object_params def create_params(self): new_object_params = {} - if self.new_object.get('id') is not None or self.new_object.get('id') is not None: - new_object_params['id'] = self.new_object.get('id') or \ - self.new_object.get('id') - if self.new_object.get('name') is not None or self.new_object.get('name') is not None: - new_object_params['name'] = self.new_object.get('name') or \ - self.new_object.get('name') - if self.new_object.get('subnet') is not None or self.new_object.get('subnet') is not None: - new_object_params['subnet'] = self.new_object.get('subnet') or \ - self.new_object.get('subnet') if self.new_object.get('applianceIp') is not None or self.new_object.get('appliance_ip') is not None: new_object_params['applianceIp'] = self.new_object.get('applianceIp') or \ self.new_object.get('appliance_ip') - if self.new_object.get('groupPolicyId') is not None or self.new_object.get('group_policy_id') is not None: - new_object_params['groupPolicyId'] = self.new_object.get('groupPolicyId') or \ - self.new_object.get('group_policy_id') - if self.new_object.get('templateVlanType') is not None or self.new_object.get('template_vlan_type') is not None: - new_object_params['templateVlanType'] = self.new_object.get('templateVlanType') or \ - self.new_object.get('template_vlan_type') if self.new_object.get('cidr') is not None or self.new_object.get('cidr') is not None: new_object_params['cidr'] = self.new_object.get('cidr') or \ self.new_object.get('cidr') - if self.new_object.get('mask') is not None or self.new_object.get('mask') is not None: - new_object_params['mask'] = self.new_object.get('mask') or \ - self.new_object.get('mask') + if self.new_object.get('groupPolicyId') is not None or self.new_object.get('group_policy_id') is not None: + new_object_params['groupPolicyId'] = self.new_object.get('groupPolicyId') or \ + self.new_object.get('group_policy_id') + if self.new_object.get('id') is not None or self.new_object.get('id') is not None: + new_object_params['id'] = self.new_object.get('id') or \ + self.new_object.get('id') if self.new_object.get('ipv6') is not None or self.new_object.get('ipv6') is not None: new_object_params['ipv6'] = self.new_object.get('ipv6') or \ self.new_object.get('ipv6') if self.new_object.get('mandatoryDhcp') is not None or self.new_object.get('mandatory_dhcp') is not None: new_object_params['mandatoryDhcp'] = self.new_object.get('mandatoryDhcp') or \ self.new_object.get('mandatory_dhcp') + if self.new_object.get('mask') is not None or self.new_object.get('mask') is not None: + new_object_params['mask'] = self.new_object.get('mask') or \ + self.new_object.get('mask') + if self.new_object.get('name') is not None or self.new_object.get('name') is not None: + new_object_params['name'] = self.new_object.get('name') or \ + self.new_object.get('name') + if self.new_object.get('subnet') is not None or self.new_object.get('subnet') is not None: + new_object_params['subnet'] = self.new_object.get('subnet') or \ + self.new_object.get('subnet') + if self.new_object.get('templateVlanType') is not None or self.new_object.get('template_vlan_type') is not None: + new_object_params['templateVlanType'] = self.new_object.get('templateVlanType') or \ + self.new_object.get('template_vlan_type') if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: new_object_params['networkId'] = self.new_object.get('networkId') or \ self.new_object.get('network_id') @@ -154,79 +154,78 @@ class NetworksApplianceVlans(object): if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: new_object_params['networkId'] = self.new_object.get('networkId') or \ self.new_object.get('network_id') - if self.new_object.get('vlanId') is not None or self.new_object.get('vlan_id') is not None is not None or self.new_object.get('id') is not None: + if self.new_object.get('vlanId') is not None or self.new_object.get('vlan_id') is not None: new_object_params['vlanId'] = self.new_object.get('vlanId') or \ - self.new_object.get('vlan_id') or self.new_object.get('id') + self.new_object.get('vlan_id') return new_object_params def update_by_id_params(self): new_object_params = {} - if self.new_object.get('name') is not None or self.new_object.get('name') is not None: - new_object_params['name'] = self.new_object.get('name') or \ - self.new_object.get('name') - if self.new_object.get('subnet') is not None or self.new_object.get('subnet') is not None: - new_object_params['subnet'] = self.new_object.get('subnet') or \ - self.new_object.get('subnet') if self.new_object.get('applianceIp') is not None or self.new_object.get('appliance_ip') is not None: new_object_params['applianceIp'] = self.new_object.get('applianceIp') or \ self.new_object.get('appliance_ip') - if self.new_object.get('groupPolicyId') is not None or self.new_object.get('group_policy_id') is not None: - new_object_params['groupPolicyId'] = self.new_object.get('groupPolicyId') or \ - self.new_object.get('group_policy_id') - if self.new_object.get('vpnNatSubnet') is not None or self.new_object.get('vpn_nat_subnet') is not None: - new_object_params['vpnNatSubnet'] = self.new_object.get('vpnNatSubnet') or \ - self.new_object.get('vpn_nat_subnet') + if self.new_object.get('cidr') is not None or self.new_object.get('cidr') is not None: + new_object_params['cidr'] = self.new_object.get('cidr') or \ + self.new_object.get('cidr') + if self.new_object.get('dhcpBootFilename') is not None or self.new_object.get('dhcp_boot_filename') is not None: + new_object_params['dhcpBootFilename'] = self.new_object.get('dhcpBootFilename') or \ + self.new_object.get('dhcp_boot_filename') + if self.new_object.get('dhcpBootNextServer') is not None or self.new_object.get('dhcp_boot_next_server') is not None: + new_object_params['dhcpBootNextServer'] = self.new_object.get('dhcpBootNextServer') or \ + self.new_object.get('dhcp_boot_next_server') + if self.new_object.get('dhcpBootOptionsEnabled') is not None or self.new_object.get('dhcp_boot_options_enabled') is not None: + new_object_params['dhcpBootOptionsEnabled'] = self.new_object.get('dhcpBootOptionsEnabled') if self.new_object.get('dhcpHandling') is not None or self.new_object.get('dhcp_handling') is not None: new_object_params['dhcpHandling'] = self.new_object.get('dhcpHandling') or \ self.new_object.get('dhcp_handling') - if self.new_object.get('dhcpRelayServerIps') is not None or self.new_object.get('dhcp_relay_server_ips') is not None: - new_object_params['dhcpRelayServerIps'] = self.new_object.get('dhcpRelayServerIps') or \ - self.new_object.get('dhcp_relay_server_ips') if self.new_object.get('dhcpLeaseTime') is not None or self.new_object.get('dhcp_lease_time') is not None: new_object_params['dhcpLeaseTime'] = self.new_object.get('dhcpLeaseTime') or \ self.new_object.get('dhcp_lease_time') - if self.new_object.get('dhcpBootOptionsEnabled') is not None or self.new_object.get('dhcp_boot_options_enabled') is not None: - new_object_params['dhcpBootOptionsEnabled'] = self.new_object.get( - 'dhcpBootOptionsEnabled') - if self.new_object.get('dhcpBootNextServer') is not None or self.new_object.get('dhcp_boot_next_server') is not None: - new_object_params['dhcpBootNextServer'] = self.new_object.get('dhcpBootNextServer') or \ - self.new_object.get('dhcp_boot_next_server') - if self.new_object.get('dhcpBootFilename') is not None or self.new_object.get('dhcp_boot_filename') is not None: - new_object_params['dhcpBootFilename'] = self.new_object.get('dhcpBootFilename') or \ - self.new_object.get('dhcp_boot_filename') - if self.new_object.get('fixedIpAssignments') is not None or self.new_object.get('fixed_ip_assignments') is not None: - new_object_params['fixedIpAssignments'] = self.new_object.get('fixedIpAssignments') or \ - self.new_object.get('fixed_ip_assignments') - if self.new_object.get('reservedIpRanges') is not None or self.new_object.get('reserved_ip_ranges') is not None: - new_object_params['reservedIpRanges'] = self.new_object.get('reservedIpRanges') or \ - self.new_object.get('reserved_ip_ranges') - if self.new_object.get('dnsNameservers') is not None or self.new_object.get('dns_nameservers') is not None: - new_object_params['dnsNameservers'] = self.new_object.get('dnsNameservers') or \ - self.new_object.get('dns_nameservers') if self.new_object.get('dhcpOptions') is not None or self.new_object.get('dhcp_options') is not None: new_object_params['dhcpOptions'] = self.new_object.get('dhcpOptions') or \ self.new_object.get('dhcp_options') - if self.new_object.get('templateVlanType') is not None or self.new_object.get('template_vlan_type') is not None: - new_object_params['templateVlanType'] = self.new_object.get('templateVlanType') or \ - self.new_object.get('template_vlan_type') - if self.new_object.get('cidr') is not None or self.new_object.get('cidr') is not None: - new_object_params['cidr'] = self.new_object.get('cidr') or \ - self.new_object.get('cidr') - if self.new_object.get('mask') is not None or self.new_object.get('mask') is not None: - new_object_params['mask'] = self.new_object.get('mask') or \ - self.new_object.get('mask') + if self.new_object.get('dhcpRelayServerIps') is not None or self.new_object.get('dhcp_relay_server_ips') is not None: + new_object_params['dhcpRelayServerIps'] = self.new_object.get('dhcpRelayServerIps') or \ + self.new_object.get('dhcp_relay_server_ips') + if self.new_object.get('dnsNameservers') is not None or self.new_object.get('dns_nameservers') is not None: + new_object_params['dnsNameservers'] = self.new_object.get('dnsNameservers') or \ + self.new_object.get('dns_nameservers') + if self.new_object.get('fixedIpAssignments') is not None or self.new_object.get('fixed_ip_assignments') is not None: + new_object_params['fixedIpAssignments'] = self.new_object.get('fixedIpAssignments') or \ + self.new_object.get('fixed_ip_assignments') + if self.new_object.get('groupPolicyId') is not None or self.new_object.get('group_policy_id') is not None: + new_object_params['groupPolicyId'] = self.new_object.get('groupPolicyId') or \ + self.new_object.get('group_policy_id') if self.new_object.get('ipv6') is not None or self.new_object.get('ipv6') is not None: new_object_params['ipv6'] = self.new_object.get('ipv6') or \ self.new_object.get('ipv6') if self.new_object.get('mandatoryDhcp') is not None or self.new_object.get('mandatory_dhcp') is not None: new_object_params['mandatoryDhcp'] = self.new_object.get('mandatoryDhcp') or \ self.new_object.get('mandatory_dhcp') + if self.new_object.get('mask') is not None or self.new_object.get('mask') is not None: + new_object_params['mask'] = self.new_object.get('mask') or \ + self.new_object.get('mask') + if self.new_object.get('name') is not None or self.new_object.get('name') is not None: + new_object_params['name'] = self.new_object.get('name') or \ + self.new_object.get('name') + if self.new_object.get('reservedIpRanges') is not None or self.new_object.get('reserved_ip_ranges') is not None: + new_object_params['reservedIpRanges'] = self.new_object.get('reservedIpRanges') or \ + self.new_object.get('reserved_ip_ranges') + if self.new_object.get('subnet') is not None or self.new_object.get('subnet') is not None: + new_object_params['subnet'] = self.new_object.get('subnet') or \ + self.new_object.get('subnet') + if self.new_object.get('templateVlanType') is not None or self.new_object.get('template_vlan_type') is not None: + new_object_params['templateVlanType'] = self.new_object.get('templateVlanType') or \ + self.new_object.get('template_vlan_type') + if self.new_object.get('vpnNatSubnet') is not None or self.new_object.get('vpn_nat_subnet') is not None: + new_object_params['vpnNatSubnet'] = self.new_object.get('vpnNatSubnet') or \ + self.new_object.get('vpn_nat_subnet') if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: new_object_params['networkId'] = self.new_object.get('networkId') or \ self.new_object.get('network_id') - if self.new_object.get('vlanId') is not None or self.new_object.get('vlan_id') is not None is not None or self.new_object.get('id') is not None: + if self.new_object.get('vlanId') is not None or self.new_object.get('vlan_id') is not None: new_object_params['vlanId'] = self.new_object.get('vlanId') or \ - self.new_object.get('vlan_id') or self.new_object.get('id') + self.new_object.get('vlan_id') return new_object_params def get_object_by_name(self, name): @@ -298,29 +297,29 @@ class NetworksApplianceVlans(object): requested_obj = self.new_object obj_params = [ - ("id", "id"), - ("name", "name"), - ("subnet", "subnet"), ("applianceIp", "applianceIp"), - ("groupPolicyId", "groupPolicyId"), - ("templateVlanType", "templateVlanType"), ("cidr", "cidr"), - ("mask", "mask"), + ("groupPolicyId", "groupPolicyId"), + ("id", "id"), ("ipv6", "ipv6"), ("mandatoryDhcp", "mandatoryDhcp"), + ("mask", "mask"), + ("name", "name"), + ("subnet", "subnet"), + ("templateVlanType", "templateVlanType"), ("networkId", "networkId"), ("vlanId", "vlanId"), - ("vpnNatSubnet", "vpnNatSubnet"), + ("dhcpBootFilename", "dhcpBootFilename"), + ("dhcpBootNextServer", "dhcpBootNextServer"), + ("dhcpBootOptionsEnabled", "dhcpBootOptionsEnabled"), ("dhcpHandling", "dhcpHandling"), - ("dhcpRelayServerIps", "dhcpRelayServerIps"), ("dhcpLeaseTime", "dhcpLeaseTime"), - ("dhcpBootOptionsEnabled", "dhcpBootOptionsEnabled"), - ("dhcpBootNextServer", "dhcpBootNextServer"), - ("dhcpBootFilename", "dhcpBootFilename"), + ("dhcpOptions", "dhcpOptions"), + ("dhcpRelayServerIps", "dhcpRelayServerIps"), + ("dnsNameservers", "dnsNameservers"), ("fixedIpAssignments", "fixedIpAssignments"), ("reservedIpRanges", "reservedIpRanges"), - ("dnsNameservers", "dnsNameservers"), - ("dhcpOptions", "dhcpOptions"), + ("vpnNatSubnet", "vpnNatSubnet"), ] # Method 1. Params present in request (Ansible) obj are the same as the current (DNAC) params # If any does not have eq params, it requires update diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_appliance_vpn_bgp.py b/ansible_collections/cisco/meraki/plugins/action/networks_appliance_vpn_bgp.py index e3eba8000..956e2bf59 100644 --- a/ansible_collections/cisco/meraki/plugins/action/networks_appliance_vpn_bgp.py +++ b/ansible_collections/cisco/meraki/plugins/action/networks_appliance_vpn_bgp.py @@ -32,8 +32,8 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present"]), - enabled=dict(type="bool"), asNumber=dict(type="int"), + enabled=dict(type="bool"), ibgpHoldTimer=dict(type="int"), neighbors=dict(type="list"), networkId=dict(type="str"), @@ -51,8 +51,8 @@ class NetworksApplianceVpnBgp(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( - enabled=params.get("enabled"), asNumber=params.get("asNumber"), + enabled=params.get("enabled"), ibgpHoldTimer=params.get("ibgpHoldTimer"), neighbors=params.get("neighbors"), network_id=params.get("networkId"), @@ -67,11 +67,11 @@ class NetworksApplianceVpnBgp(object): def update_all_params(self): new_object_params = {} - if self.new_object.get('enabled') is not None or self.new_object.get('enabled') is not None: - new_object_params['enabled'] = self.new_object.get('enabled') if self.new_object.get('asNumber') is not None or self.new_object.get('as_number') is not None: new_object_params['asNumber'] = self.new_object.get('asNumber') or \ self.new_object.get('as_number') + if self.new_object.get('enabled') is not None or self.new_object.get('enabled') is not None: + new_object_params['enabled'] = self.new_object.get('enabled') if self.new_object.get('ibgpHoldTimer') is not None or self.new_object.get('ibgp_hold_timer') is not None: new_object_params['ibgpHoldTimer'] = self.new_object.get('ibgpHoldTimer') or \ self.new_object.get('ibgp_hold_timer') @@ -134,8 +134,8 @@ class NetworksApplianceVpnBgp(object): requested_obj = self.new_object obj_params = [ - ("enabled", "enabled"), ("asNumber", "asNumber"), + ("enabled", "enabled"), ("ibgpHoldTimer", "ibgpHoldTimer"), ("neighbors", "neighbors"), ("networkId", "networkId"), diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_appliance_vpn_site_to_site_vpn.py b/ansible_collections/cisco/meraki/plugins/action/networks_appliance_vpn_site_to_site_vpn.py index 1a73bb08d..e687d1ed4 100644 --- a/ansible_collections/cisco/meraki/plugins/action/networks_appliance_vpn_site_to_site_vpn.py +++ b/ansible_collections/cisco/meraki/plugins/action/networks_appliance_vpn_site_to_site_vpn.py @@ -32,8 +32,8 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present"]), - mode=dict(type="str"), hubs=dict(type="list"), + mode=dict(type="str"), subnets=dict(type="list"), networkId=dict(type="str"), )) @@ -50,8 +50,8 @@ class NetworksApplianceVpnSiteToSiteVpn(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( - mode=params.get("mode"), hubs=params.get("hubs"), + mode=params.get("mode"), subnets=params.get("subnets"), network_id=params.get("networkId"), ) @@ -65,12 +65,12 @@ class NetworksApplianceVpnSiteToSiteVpn(object): def update_all_params(self): new_object_params = {} - if self.new_object.get('mode') is not None or self.new_object.get('mode') is not None: - new_object_params['mode'] = self.new_object.get('mode') or \ - self.new_object.get('mode') if self.new_object.get('hubs') is not None or self.new_object.get('hubs') is not None: new_object_params['hubs'] = self.new_object.get('hubs') or \ self.new_object.get('hubs') + if self.new_object.get('mode') is not None or self.new_object.get('mode') is not None: + new_object_params['mode'] = self.new_object.get('mode') or \ + self.new_object.get('mode') if self.new_object.get('subnets') is not None or self.new_object.get('subnets') is not None: new_object_params['subnets'] = self.new_object.get('subnets') or \ self.new_object.get('subnets') @@ -130,8 +130,8 @@ class NetworksApplianceVpnSiteToSiteVpn(object): requested_obj = self.new_object obj_params = [ - ("mode", "mode"), ("hubs", "hubs"), + ("mode", "mode"), ("subnets", "subnets"), ("networkId", "networkId"), ] diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_bind.py b/ansible_collections/cisco/meraki/plugins/action/networks_bind.py index 2e65eefb3..e25f56335 100644 --- a/ansible_collections/cisco/meraki/plugins/action/networks_bind.py +++ b/ansible_collections/cisco/meraki/plugins/action/networks_bind.py @@ -25,8 +25,8 @@ from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( - configTemplateId=dict(type="str"), autoBind=dict(type="bool"), + configTemplateId=dict(type="str"), networkId=dict(type="str"), )) @@ -66,8 +66,8 @@ class ActionModule(ActionBase): def get_object(self, params): new_object = dict( - configTemplateId=params.get("configTemplateId"), autoBind=params.get("autoBind"), + configTemplateId=params.get("configTemplateId"), networkId=params.get("networkId"), ) return new_object diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_camera_quality_retention_profiles.py b/ansible_collections/cisco/meraki/plugins/action/networks_camera_quality_retention_profiles.py index 29e1aae17..4b33683b8 100644 --- a/ansible_collections/cisco/meraki/plugins/action/networks_camera_quality_retention_profiles.py +++ b/ansible_collections/cisco/meraki/plugins/action/networks_camera_quality_retention_profiles.py @@ -32,14 +32,14 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present", "absent"]), - name=dict(type="str"), - motionBasedRetentionEnabled=dict(type="bool"), - restrictedBandwidthModeEnabled=dict(type="bool"), audioRecordingEnabled=dict(type="bool"), cloudArchiveEnabled=dict(type="bool"), + maxRetentionDays=dict(type="int"), + motionBasedRetentionEnabled=dict(type="bool"), motionDetectorVersion=dict(type="int"), + name=dict(type="str"), + restrictedBandwidthModeEnabled=dict(type="bool"), scheduleId=dict(type="str"), - maxRetentionDays=dict(type="int"), videoSettings=dict(type="dict"), networkId=dict(type="str"), qualityRetentionProfileId=dict(type="str"), @@ -58,14 +58,14 @@ class NetworksCameraQualityRetentionProfiles(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( - name=params.get("name"), - motionBasedRetentionEnabled=params.get("motionBasedRetentionEnabled"), - restrictedBandwidthModeEnabled=params.get("restrictedBandwidthModeEnabled"), audioRecordingEnabled=params.get("audioRecordingEnabled"), cloudArchiveEnabled=params.get("cloudArchiveEnabled"), + maxRetentionDays=params.get("maxRetentionDays"), + motionBasedRetentionEnabled=params.get("motionBasedRetentionEnabled"), motionDetectorVersion=params.get("motionDetectorVersion"), + name=params.get("name"), + restrictedBandwidthModeEnabled=params.get("restrictedBandwidthModeEnabled"), scheduleId=params.get("scheduleId"), - maxRetentionDays=params.get("maxRetentionDays"), videoSettings=params.get("videoSettings"), networkId=params.get("networkId"), qualityRetentionProfileId=params.get("qualityRetentionProfileId"), @@ -90,26 +90,26 @@ class NetworksCameraQualityRetentionProfiles(object): def create_params(self): new_object_params = {} - if self.new_object.get('name') is not None or self.new_object.get('name') is not None: - new_object_params['name'] = self.new_object.get('name') or \ - self.new_object.get('name') - if self.new_object.get('motionBasedRetentionEnabled') is not None or self.new_object.get('motion_based_retention_enabled') is not None: - new_object_params['motionBasedRetentionEnabled'] = self.new_object.get('motionBasedRetentionEnabled') - if self.new_object.get('restrictedBandwidthModeEnabled') is not None or self.new_object.get('restricted_bandwidth_mode_enabled') is not None: - new_object_params['restrictedBandwidthModeEnabled'] = self.new_object.get('restrictedBandwidthModeEnabled') if self.new_object.get('audioRecordingEnabled') is not None or self.new_object.get('audio_recording_enabled') is not None: new_object_params['audioRecordingEnabled'] = self.new_object.get('audioRecordingEnabled') if self.new_object.get('cloudArchiveEnabled') is not None or self.new_object.get('cloud_archive_enabled') is not None: new_object_params['cloudArchiveEnabled'] = self.new_object.get('cloudArchiveEnabled') + if self.new_object.get('maxRetentionDays') is not None or self.new_object.get('max_retention_days') is not None: + new_object_params['maxRetentionDays'] = self.new_object.get('maxRetentionDays') or \ + self.new_object.get('max_retention_days') + if self.new_object.get('motionBasedRetentionEnabled') is not None or self.new_object.get('motion_based_retention_enabled') is not None: + new_object_params['motionBasedRetentionEnabled'] = self.new_object.get('motionBasedRetentionEnabled') if self.new_object.get('motionDetectorVersion') is not None or self.new_object.get('motion_detector_version') is not None: new_object_params['motionDetectorVersion'] = self.new_object.get('motionDetectorVersion') or \ self.new_object.get('motion_detector_version') + if self.new_object.get('name') is not None or self.new_object.get('name') is not None: + new_object_params['name'] = self.new_object.get('name') or \ + self.new_object.get('name') + if self.new_object.get('restrictedBandwidthModeEnabled') is not None or self.new_object.get('restricted_bandwidth_mode_enabled') is not None: + new_object_params['restrictedBandwidthModeEnabled'] = self.new_object.get('restrictedBandwidthModeEnabled') if self.new_object.get('scheduleId') is not None or self.new_object.get('schedule_id') is not None: new_object_params['scheduleId'] = self.new_object.get('scheduleId') or \ self.new_object.get('schedule_id') - if self.new_object.get('maxRetentionDays') is not None or self.new_object.get('max_retention_days') is not None: - new_object_params['maxRetentionDays'] = self.new_object.get('maxRetentionDays') or \ - self.new_object.get('max_retention_days') if self.new_object.get('videoSettings') is not None or self.new_object.get('video_settings') is not None: new_object_params['videoSettings'] = self.new_object.get('videoSettings') or \ self.new_object.get('video_settings') @@ -130,26 +130,26 @@ class NetworksCameraQualityRetentionProfiles(object): def update_by_id_params(self): new_object_params = {} - if self.new_object.get('name') is not None or self.new_object.get('name') is not None: - new_object_params['name'] = self.new_object.get('name') or \ - self.new_object.get('name') - if self.new_object.get('motionBasedRetentionEnabled') is not None or self.new_object.get('motion_based_retention_enabled') is not None: - new_object_params['motionBasedRetentionEnabled'] = self.new_object.get('motionBasedRetentionEnabled') - if self.new_object.get('restrictedBandwidthModeEnabled') is not None or self.new_object.get('restricted_bandwidth_mode_enabled') is not None: - new_object_params['restrictedBandwidthModeEnabled'] = self.new_object.get('restrictedBandwidthModeEnabled') if self.new_object.get('audioRecordingEnabled') is not None or self.new_object.get('audio_recording_enabled') is not None: new_object_params['audioRecordingEnabled'] = self.new_object.get('audioRecordingEnabled') if self.new_object.get('cloudArchiveEnabled') is not None or self.new_object.get('cloud_archive_enabled') is not None: new_object_params['cloudArchiveEnabled'] = self.new_object.get('cloudArchiveEnabled') + if self.new_object.get('maxRetentionDays') is not None or self.new_object.get('max_retention_days') is not None: + new_object_params['maxRetentionDays'] = self.new_object.get('maxRetentionDays') or \ + self.new_object.get('max_retention_days') + if self.new_object.get('motionBasedRetentionEnabled') is not None or self.new_object.get('motion_based_retention_enabled') is not None: + new_object_params['motionBasedRetentionEnabled'] = self.new_object.get('motionBasedRetentionEnabled') if self.new_object.get('motionDetectorVersion') is not None or self.new_object.get('motion_detector_version') is not None: new_object_params['motionDetectorVersion'] = self.new_object.get('motionDetectorVersion') or \ self.new_object.get('motion_detector_version') + if self.new_object.get('name') is not None or self.new_object.get('name') is not None: + new_object_params['name'] = self.new_object.get('name') or \ + self.new_object.get('name') + if self.new_object.get('restrictedBandwidthModeEnabled') is not None or self.new_object.get('restricted_bandwidth_mode_enabled') is not None: + new_object_params['restrictedBandwidthModeEnabled'] = self.new_object.get('restrictedBandwidthModeEnabled') if self.new_object.get('scheduleId') is not None or self.new_object.get('schedule_id') is not None: new_object_params['scheduleId'] = self.new_object.get('scheduleId') or \ self.new_object.get('schedule_id') - if self.new_object.get('maxRetentionDays') is not None or self.new_object.get('max_retention_days') is not None: - new_object_params['maxRetentionDays'] = self.new_object.get('maxRetentionDays') or \ - self.new_object.get('max_retention_days') if self.new_object.get('videoSettings') is not None or self.new_object.get('video_settings') is not None: new_object_params['videoSettings'] = self.new_object.get('videoSettings') or \ self.new_object.get('video_settings') @@ -230,14 +230,14 @@ class NetworksCameraQualityRetentionProfiles(object): requested_obj = self.new_object obj_params = [ - ("name", "name"), - ("motionBasedRetentionEnabled", "motionBasedRetentionEnabled"), - ("restrictedBandwidthModeEnabled", "restrictedBandwidthModeEnabled"), ("audioRecordingEnabled", "audioRecordingEnabled"), ("cloudArchiveEnabled", "cloudArchiveEnabled"), + ("maxRetentionDays", "maxRetentionDays"), + ("motionBasedRetentionEnabled", "motionBasedRetentionEnabled"), ("motionDetectorVersion", "motionDetectorVersion"), + ("name", "name"), + ("restrictedBandwidthModeEnabled", "restrictedBandwidthModeEnabled"), ("scheduleId", "scheduleId"), - ("maxRetentionDays", "maxRetentionDays"), ("videoSettings", "videoSettings"), ("networkId", "networkId"), ("qualityRetentionProfileId", "qualityRetentionProfileId"), diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_camera_wireless_profiles.py b/ansible_collections/cisco/meraki/plugins/action/networks_camera_wireless_profiles.py index 4aedf37c2..4525ab771 100644 --- a/ansible_collections/cisco/meraki/plugins/action/networks_camera_wireless_profiles.py +++ b/ansible_collections/cisco/meraki/plugins/action/networks_camera_wireless_profiles.py @@ -32,9 +32,9 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present", "absent"]), + identity=dict(type="dict"), name=dict(type="str"), ssid=dict(type="dict"), - identity=dict(type="dict"), networkId=dict(type="str"), wirelessProfileId=dict(type="str"), )) @@ -52,9 +52,9 @@ class NetworksCameraWirelessProfiles(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( + identity=params.get("identity"), name=params.get("name"), ssid=params.get("ssid"), - identity=params.get("identity"), networkId=params.get("networkId"), wirelessProfileId=params.get("wirelessProfileId"), ) @@ -78,15 +78,15 @@ class NetworksCameraWirelessProfiles(object): def create_params(self): new_object_params = {} + if self.new_object.get('identity') is not None or self.new_object.get('identity') is not None: + new_object_params['identity'] = self.new_object.get('identity') or \ + self.new_object.get('identity') if self.new_object.get('name') is not None or self.new_object.get('name') is not None: new_object_params['name'] = self.new_object.get('name') or \ self.new_object.get('name') if self.new_object.get('ssid') is not None or self.new_object.get('ssid') is not None: new_object_params['ssid'] = self.new_object.get('ssid') or \ self.new_object.get('ssid') - if self.new_object.get('identity') is not None or self.new_object.get('identity') is not None: - new_object_params['identity'] = self.new_object.get('identity') or \ - self.new_object.get('identity') if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: new_object_params['networkId'] = self.new_object.get('networkId') or \ self.new_object.get('network_id') @@ -104,15 +104,15 @@ class NetworksCameraWirelessProfiles(object): def update_by_id_params(self): new_object_params = {} + if self.new_object.get('identity') is not None or self.new_object.get('identity') is not None: + new_object_params['identity'] = self.new_object.get('identity') or \ + self.new_object.get('identity') if self.new_object.get('name') is not None or self.new_object.get('name') is not None: new_object_params['name'] = self.new_object.get('name') or \ self.new_object.get('name') if self.new_object.get('ssid') is not None or self.new_object.get('ssid') is not None: new_object_params['ssid'] = self.new_object.get('ssid') or \ self.new_object.get('ssid') - if self.new_object.get('identity') is not None or self.new_object.get('identity') is not None: - new_object_params['identity'] = self.new_object.get('identity') or \ - self.new_object.get('identity') if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: new_object_params['networkId'] = self.new_object.get('networkId') or \ self.new_object.get('network_id') @@ -190,9 +190,9 @@ class NetworksCameraWirelessProfiles(object): requested_obj = self.new_object obj_params = [ + ("identity", "identity"), ("name", "name"), ("ssid", "ssid"), - ("identity", "identity"), ("networkId", "networkId"), ("wirelessProfileId", "wirelessProfileId"), ] diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_cellular_gateway_dhcp.py b/ansible_collections/cisco/meraki/plugins/action/networks_cellular_gateway_dhcp.py index a02d4c4d4..823ff2348 100644 --- a/ansible_collections/cisco/meraki/plugins/action/networks_cellular_gateway_dhcp.py +++ b/ansible_collections/cisco/meraki/plugins/action/networks_cellular_gateway_dhcp.py @@ -33,8 +33,8 @@ argument_spec = meraki_argument_spec() argument_spec.update(dict( state=dict(type="str", default="present", choices=["present"]), dhcpLeaseTime=dict(type="str"), - dnsNameservers=dict(type="str"), dnsCustomNameservers=dict(type="list"), + dnsNameservers=dict(type="str"), networkId=dict(type="str"), )) @@ -51,8 +51,8 @@ class NetworksCellularGatewayDhcp(object): self.meraki = meraki self.new_object = dict( dhcpLeaseTime=params.get("dhcpLeaseTime"), - dnsNameservers=params.get("dnsNameservers"), dnsCustomNameservers=params.get("dnsCustomNameservers"), + dnsNameservers=params.get("dnsNameservers"), network_id=params.get("networkId"), ) @@ -68,12 +68,12 @@ class NetworksCellularGatewayDhcp(object): if self.new_object.get('dhcpLeaseTime') is not None or self.new_object.get('dhcp_lease_time') is not None: new_object_params['dhcpLeaseTime'] = self.new_object.get('dhcpLeaseTime') or \ self.new_object.get('dhcp_lease_time') - if self.new_object.get('dnsNameservers') is not None or self.new_object.get('dns_nameservers') is not None: - new_object_params['dnsNameservers'] = self.new_object.get('dnsNameservers') or \ - self.new_object.get('dns_nameservers') if self.new_object.get('dnsCustomNameservers') is not None or self.new_object.get('dns_custom_nameservers') is not None: new_object_params['dnsCustomNameservers'] = self.new_object.get('dnsCustomNameservers') or \ self.new_object.get('dns_custom_nameservers') + if self.new_object.get('dnsNameservers') is not None or self.new_object.get('dns_nameservers') is not None: + new_object_params['dnsNameservers'] = self.new_object.get('dnsNameservers') or \ + self.new_object.get('dns_nameservers') if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: new_object_params['networkId'] = self.new_object.get('networkId') or \ self.new_object.get('network_id') @@ -131,8 +131,8 @@ class NetworksCellularGatewayDhcp(object): obj_params = [ ("dhcpLeaseTime", "dhcpLeaseTime"), - ("dnsNameservers", "dnsNameservers"), ("dnsCustomNameservers", "dnsCustomNameservers"), + ("dnsNameservers", "dnsNameservers"), ("networkId", "networkId"), ] # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_cellular_gateway_subnet_pool.py b/ansible_collections/cisco/meraki/plugins/action/networks_cellular_gateway_subnet_pool.py index 4af5e75ad..328e935ae 100644 --- a/ansible_collections/cisco/meraki/plugins/action/networks_cellular_gateway_subnet_pool.py +++ b/ansible_collections/cisco/meraki/plugins/action/networks_cellular_gateway_subnet_pool.py @@ -32,8 +32,8 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present"]), - mask=dict(type="int"), cidr=dict(type="str"), + mask=dict(type="int"), networkId=dict(type="str"), )) @@ -49,8 +49,8 @@ class NetworksCellularGatewaySubnetPool(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( - mask=params.get("mask"), cidr=params.get("cidr"), + mask=params.get("mask"), network_id=params.get("networkId"), ) @@ -63,12 +63,12 @@ class NetworksCellularGatewaySubnetPool(object): def update_all_params(self): new_object_params = {} - if self.new_object.get('mask') is not None or self.new_object.get('mask') is not None: - new_object_params['mask'] = self.new_object.get('mask') or \ - self.new_object.get('mask') if self.new_object.get('cidr') is not None or self.new_object.get('cidr') is not None: new_object_params['cidr'] = self.new_object.get('cidr') or \ self.new_object.get('cidr') + if self.new_object.get('mask') is not None or self.new_object.get('mask') is not None: + new_object_params['mask'] = self.new_object.get('mask') or \ + self.new_object.get('mask') if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: new_object_params['networkId'] = self.new_object.get('networkId') or \ self.new_object.get('network_id') @@ -125,8 +125,8 @@ class NetworksCellularGatewaySubnetPool(object): requested_obj = self.new_object obj_params = [ - ("mask", "mask"), ("cidr", "cidr"), + ("mask", "mask"), ("networkId", "networkId"), ] # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_clients_info.py b/ansible_collections/cisco/meraki/plugins/action/networks_clients_info.py index 7f6eae8dc..cb865220d 100644 --- a/ansible_collections/cisco/meraki/plugins/action/networks_clients_info.py +++ b/ansible_collections/cisco/meraki/plugins/action/networks_clients_info.py @@ -26,23 +26,7 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( networkId=dict(type="str"), - t0=dict(type="str"), - timespan=dict(type="float"), - perPage=dict(type="int"), - total_pages=dict(type="int"), - direction=dict(type="str"), - startingAfter=dict(type="str"), - endingBefore=dict(type="str"), - statuses=dict(type="list"), - ip=dict(type="str"), - ip6=dict(type="str"), - ip6Local=dict(type="str"), - mac=dict(type="str"), - os=dict(type="str"), - pskGroup=dict(type="str"), - description=dict(type="str"), - vlan=dict(type="str"), - recentDeviceConnections=dict(type="list"), + clientId=dict(type="str"), )) required_if = [] @@ -79,61 +63,14 @@ class ActionModule(ActionBase): if not valid: raise AnsibleActionFail(errors) - def get_all(self, params): + def get_object(self, params): new_object = {} if params.get("networkId") is not None: new_object["networkId"] = params.get( "networkId") - if params.get("t0") is not None: - new_object["t0"] = params.get( - "t0") - if params.get("timespan") is not None: - new_object["timespan"] = params.get( - "timespan") - if params.get("perPage") is not None: - new_object["perPage"] = params.get( - "perPage") - new_object['total_pages'] = params.get( - "total_pages") or 1 - new_object['direction'] = params.get( - "direction") or "next" - if params.get("startingAfter") is not None: - new_object["startingAfter"] = params.get( - "startingAfter") - if params.get("endingBefore") is not None: - new_object["endingBefore"] = params.get( - "endingBefore") - if params.get("statuses") is not None: - new_object["statuses"] = params.get( - "statuses") - if params.get("ip") is not None: - new_object["ip"] = params.get( - "ip") - if params.get("ip6") is not None: - new_object["ip6"] = params.get( - "ip6") - if params.get("ip6Local") is not None: - new_object["ip6Local"] = params.get( - "ip6Local") - if params.get("mac") is not None: - new_object["mac"] = params.get( - "mac") - if params.get("os") is not None: - new_object["os"] = params.get( - "os") - if params.get("pskGroup") is not None: - new_object["pskGroup"] = params.get( - "pskGroup") - if params.get("description") is not None: - new_object["description"] = params.get( - "description") - if params.get("vlan") is not None: - new_object["vlan"] = params.get( - "vlan") - if params.get("recentDeviceConnections") is not None: - new_object["recentDeviceConnections"] = params.get( - "recentDeviceConnections") - + if params.get("clientId") is not None: + new_object["clientId"] = params.get( + "clientId") return new_object def run(self, tmp=None, task_vars=None): @@ -146,11 +83,20 @@ class ActionModule(ActionBase): meraki = MERAKI(params=self._task.args) - response = meraki.exec_meraki( - family="networks", - function='getNetworkClients', - params=self.get_all(self._task.args), - ) - self._result.update(dict(meraki_response=response)) - self._result.update(meraki.exit_json()) - return self._result + id = self._task.args.get("clientId") + if id: + response = meraki.exec_meraki( + family="networks", + function='getNetworkClient', + params=self.get_object(self._task.args), + ) + self._result.update(dict(meraki_response=response)) + self._result.update(meraki.exit_json()) + return self._result + if not id: + # NOTE: Does not have a get all method or it is in another action + response = None + meraki.object_modify_result(changed=False, result="Module does not have get all, check arguments of module") + self._result.update(dict(meraki_response=response)) + self._result.update(meraki.exit_json()) + return self._result diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_firmware_upgrades.py b/ansible_collections/cisco/meraki/plugins/action/networks_firmware_upgrades.py index d60217404..f3cc453f0 100644 --- a/ansible_collections/cisco/meraki/plugins/action/networks_firmware_upgrades.py +++ b/ansible_collections/cisco/meraki/plugins/action/networks_firmware_upgrades.py @@ -32,9 +32,9 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present"]), - upgradeWindow=dict(type="dict"), - timezone=dict(type="str"), products=dict(type="dict"), + timezone=dict(type="str"), + upgradeWindow=dict(type="dict"), networkId=dict(type="str"), )) @@ -50,9 +50,9 @@ class NetworksFirmwareUpgrades(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( - upgradeWindow=params.get("upgradeWindow"), - timezone=params.get("timezone"), products=params.get("products"), + timezone=params.get("timezone"), + upgradeWindow=params.get("upgradeWindow"), network_id=params.get("networkId"), ) @@ -65,15 +65,15 @@ class NetworksFirmwareUpgrades(object): def update_all_params(self): new_object_params = {} - if self.new_object.get('upgradeWindow') is not None or self.new_object.get('upgrade_window') is not None: - new_object_params['upgradeWindow'] = self.new_object.get('upgradeWindow') or \ - self.new_object.get('upgrade_window') - if self.new_object.get('timezone') is not None or self.new_object.get('timezone') is not None: - new_object_params['timezone'] = self.new_object.get('timezone') or \ - self.new_object.get('timezone') if self.new_object.get('products') is not None or self.new_object.get('products') is not None: new_object_params['products'] = self.new_object.get('products') or \ self.new_object.get('products') + if self.new_object.get('timezone') is not None or self.new_object.get('timezone') is not None: + new_object_params['timezone'] = self.new_object.get('timezone') or \ + self.new_object.get('timezone') + if self.new_object.get('upgradeWindow') is not None or self.new_object.get('upgrade_window') is not None: + new_object_params['upgradeWindow'] = self.new_object.get('upgradeWindow') or \ + self.new_object.get('upgrade_window') if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: new_object_params['networkId'] = self.new_object.get('networkId') or \ self.new_object.get('network_id') @@ -130,9 +130,9 @@ class NetworksFirmwareUpgrades(object): requested_obj = self.new_object obj_params = [ - ("upgradeWindow", "upgradeWindow"), - ("timezone", "timezone"), ("products", "products"), + ("timezone", "timezone"), + ("upgradeWindow", "upgradeWindow"), ("networkId", "networkId"), ] # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_firmware_upgrades_rollbacks.py b/ansible_collections/cisco/meraki/plugins/action/networks_firmware_upgrades_rollbacks.py index 02dd7a060..ac1f8efea 100644 --- a/ansible_collections/cisco/meraki/plugins/action/networks_firmware_upgrades_rollbacks.py +++ b/ansible_collections/cisco/meraki/plugins/action/networks_firmware_upgrades_rollbacks.py @@ -26,8 +26,8 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( product=dict(type="str"), - time=dict(type="str"), reasons=dict(type="list"), + time=dict(type="str"), toVersion=dict(type="dict"), networkId=dict(type="str"), )) @@ -69,8 +69,8 @@ class ActionModule(ActionBase): def get_object(self, params): new_object = dict( product=params.get("product"), - time=params.get("time"), reasons=params.get("reasons"), + time=params.get("time"), toVersion=params.get("toVersion"), networkId=params.get("networkId"), ) diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_firmware_upgrades_staged_events_defer.py b/ansible_collections/cisco/meraki/plugins/action/networks_firmware_upgrades_staged_events_defer.py index db07326b4..f4676d6e5 100644 --- a/ansible_collections/cisco/meraki/plugins/action/networks_firmware_upgrades_staged_events_defer.py +++ b/ansible_collections/cisco/meraki/plugins/action/networks_firmware_upgrades_staged_events_defer.py @@ -64,7 +64,7 @@ class ActionModule(ActionBase): def get_object(self, params): new_object = dict( - network_id=params.get("networkId"), + networkId=params.get("networkId"), ) return new_object diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_firmware_upgrades_staged_events_rollbacks.py b/ansible_collections/cisco/meraki/plugins/action/networks_firmware_upgrades_staged_events_rollbacks.py index 72ab2abcc..4a7b0d8aa 100644 --- a/ansible_collections/cisco/meraki/plugins/action/networks_firmware_upgrades_staged_events_rollbacks.py +++ b/ansible_collections/cisco/meraki/plugins/action/networks_firmware_upgrades_staged_events_rollbacks.py @@ -25,8 +25,8 @@ from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( - stages=dict(type="list"), reasons=dict(type="list"), + stages=dict(type="list"), networkId=dict(type="str"), )) diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_firmware_upgrades_staged_groups.py b/ansible_collections/cisco/meraki/plugins/action/networks_firmware_upgrades_staged_groups.py index ea0902e37..61f7f1b4b 100644 --- a/ansible_collections/cisco/meraki/plugins/action/networks_firmware_upgrades_staged_groups.py +++ b/ansible_collections/cisco/meraki/plugins/action/networks_firmware_upgrades_staged_groups.py @@ -32,10 +32,10 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present", "absent"]), - name=dict(type="str"), + assignedDevices=dict(type="dict"), description=dict(type="str"), isDefault=dict(type="bool"), - assignedDevices=dict(type="dict"), + name=dict(type="str"), networkId=dict(type="str"), groupId=dict(type="str"), )) @@ -53,10 +53,10 @@ class NetworksFirmwareUpgradesStagedGroups(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( - name=params.get("name"), + assignedDevices=params.get("assignedDevices"), description=params.get("description"), isDefault=params.get("isDefault"), - assignedDevices=params.get("assignedDevices"), + name=params.get("name"), networkId=params.get("networkId"), groupId=params.get("groupId"), ) @@ -80,17 +80,17 @@ class NetworksFirmwareUpgradesStagedGroups(object): def create_params(self): new_object_params = {} - if self.new_object.get('name') is not None or self.new_object.get('name') is not None: - new_object_params['name'] = self.new_object.get('name') or \ - self.new_object.get('name') + if self.new_object.get('assignedDevices') is not None or self.new_object.get('assigned_devices') is not None: + new_object_params['assignedDevices'] = self.new_object.get('assignedDevices') or \ + self.new_object.get('assigned_devices') if self.new_object.get('description') is not None or self.new_object.get('description') is not None: new_object_params['description'] = self.new_object.get('description') or \ self.new_object.get('description') if self.new_object.get('isDefault') is not None or self.new_object.get('is_default') is not None: new_object_params['isDefault'] = self.new_object.get('isDefault') - if self.new_object.get('assignedDevices') is not None or self.new_object.get('assigned_devices') is not None: - new_object_params['assignedDevices'] = self.new_object.get('assignedDevices') or \ - self.new_object.get('assigned_devices') + if self.new_object.get('name') is not None or self.new_object.get('name') is not None: + new_object_params['name'] = self.new_object.get('name') or \ + self.new_object.get('name') if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: new_object_params['networkId'] = self.new_object.get('networkId') or \ self.new_object.get('network_id') @@ -108,17 +108,17 @@ class NetworksFirmwareUpgradesStagedGroups(object): def update_by_id_params(self): new_object_params = {} - if self.new_object.get('name') is not None or self.new_object.get('name') is not None: - new_object_params['name'] = self.new_object.get('name') or \ - self.new_object.get('name') + if self.new_object.get('assignedDevices') is not None or self.new_object.get('assigned_devices') is not None: + new_object_params['assignedDevices'] = self.new_object.get('assignedDevices') or \ + self.new_object.get('assigned_devices') if self.new_object.get('description') is not None or self.new_object.get('description') is not None: new_object_params['description'] = self.new_object.get('description') or \ self.new_object.get('description') if self.new_object.get('isDefault') is not None or self.new_object.get('is_default') is not None: new_object_params['isDefault'] = self.new_object.get('isDefault') - if self.new_object.get('assignedDevices') is not None or self.new_object.get('assigned_devices') is not None: - new_object_params['assignedDevices'] = self.new_object.get('assignedDevices') or \ - self.new_object.get('assigned_devices') + if self.new_object.get('name') is not None or self.new_object.get('name') is not None: + new_object_params['name'] = self.new_object.get('name') or \ + self.new_object.get('name') if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: new_object_params['networkId'] = self.new_object.get('networkId') or \ self.new_object.get('network_id') @@ -196,10 +196,10 @@ class NetworksFirmwareUpgradesStagedGroups(object): requested_obj = self.new_object obj_params = [ - ("name", "name"), + ("assignedDevices", "assignedDevices"), ("description", "description"), ("isDefault", "isDefault"), - ("assignedDevices", "assignedDevices"), + ("name", "name"), ("networkId", "networkId"), ("groupId", "groupId"), ] diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_floor_plans.py b/ansible_collections/cisco/meraki/plugins/action/networks_floor_plans.py index 0e1a40eec..561919d38 100644 --- a/ansible_collections/cisco/meraki/plugins/action/networks_floor_plans.py +++ b/ansible_collections/cisco/meraki/plugins/action/networks_floor_plans.py @@ -32,13 +32,13 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present", "absent"]), - name=dict(type="str"), - center=dict(type="dict"), bottomLeftCorner=dict(type="dict"), bottomRightCorner=dict(type="dict"), + center=dict(type="dict"), + imageContents=dict(type="str"), + name=dict(type="str"), topLeftCorner=dict(type="dict"), topRightCorner=dict(type="dict"), - imageContents=dict(type="str"), networkId=dict(type="str"), floorPlanId=dict(type="str"), )) @@ -56,13 +56,13 @@ class NetworksFloorPlans(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( - name=params.get("name"), - center=params.get("center"), bottomLeftCorner=params.get("bottomLeftCorner"), bottomRightCorner=params.get("bottomRightCorner"), + center=params.get("center"), + imageContents=params.get("imageContents"), + name=params.get("name"), topLeftCorner=params.get("topLeftCorner"), topRightCorner=params.get("topRightCorner"), - imageContents=params.get("imageContents"), networkId=params.get("networkId"), floorPlanId=params.get("floorPlanId"), ) @@ -86,27 +86,27 @@ class NetworksFloorPlans(object): def create_params(self): new_object_params = {} - if self.new_object.get('name') is not None or self.new_object.get('name') is not None: - new_object_params['name'] = self.new_object.get('name') or \ - self.new_object.get('name') - if self.new_object.get('center') is not None or self.new_object.get('center') is not None: - new_object_params['center'] = self.new_object.get('center') or \ - self.new_object.get('center') if self.new_object.get('bottomLeftCorner') is not None or self.new_object.get('bottom_left_corner') is not None: new_object_params['bottomLeftCorner'] = self.new_object.get('bottomLeftCorner') or \ self.new_object.get('bottom_left_corner') if self.new_object.get('bottomRightCorner') is not None or self.new_object.get('bottom_right_corner') is not None: new_object_params['bottomRightCorner'] = self.new_object.get('bottomRightCorner') or \ self.new_object.get('bottom_right_corner') + if self.new_object.get('center') is not None or self.new_object.get('center') is not None: + new_object_params['center'] = self.new_object.get('center') or \ + self.new_object.get('center') + if self.new_object.get('imageContents') is not None or self.new_object.get('image_contents') is not None: + new_object_params['imageContents'] = self.new_object.get('imageContents') or \ + self.new_object.get('image_contents') + if self.new_object.get('name') is not None or self.new_object.get('name') is not None: + new_object_params['name'] = self.new_object.get('name') or \ + self.new_object.get('name') if self.new_object.get('topLeftCorner') is not None or self.new_object.get('top_left_corner') is not None: new_object_params['topLeftCorner'] = self.new_object.get('topLeftCorner') or \ self.new_object.get('top_left_corner') if self.new_object.get('topRightCorner') is not None or self.new_object.get('top_right_corner') is not None: new_object_params['topRightCorner'] = self.new_object.get('topRightCorner') or \ self.new_object.get('top_right_corner') - if self.new_object.get('imageContents') is not None or self.new_object.get('image_contents') is not None: - new_object_params['imageContents'] = self.new_object.get('imageContents') or \ - self.new_object.get('image_contents') if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: new_object_params['networkId'] = self.new_object.get('networkId') or \ self.new_object.get('network_id') @@ -124,27 +124,27 @@ class NetworksFloorPlans(object): def update_by_id_params(self): new_object_params = {} - if self.new_object.get('name') is not None or self.new_object.get('name') is not None: - new_object_params['name'] = self.new_object.get('name') or \ - self.new_object.get('name') - if self.new_object.get('center') is not None or self.new_object.get('center') is not None: - new_object_params['center'] = self.new_object.get('center') or \ - self.new_object.get('center') if self.new_object.get('bottomLeftCorner') is not None or self.new_object.get('bottom_left_corner') is not None: new_object_params['bottomLeftCorner'] = self.new_object.get('bottomLeftCorner') or \ self.new_object.get('bottom_left_corner') if self.new_object.get('bottomRightCorner') is not None or self.new_object.get('bottom_right_corner') is not None: new_object_params['bottomRightCorner'] = self.new_object.get('bottomRightCorner') or \ self.new_object.get('bottom_right_corner') + if self.new_object.get('center') is not None or self.new_object.get('center') is not None: + new_object_params['center'] = self.new_object.get('center') or \ + self.new_object.get('center') + if self.new_object.get('imageContents') is not None or self.new_object.get('image_contents') is not None: + new_object_params['imageContents'] = self.new_object.get('imageContents') or \ + self.new_object.get('image_contents') + if self.new_object.get('name') is not None or self.new_object.get('name') is not None: + new_object_params['name'] = self.new_object.get('name') or \ + self.new_object.get('name') if self.new_object.get('topLeftCorner') is not None or self.new_object.get('top_left_corner') is not None: new_object_params['topLeftCorner'] = self.new_object.get('topLeftCorner') or \ self.new_object.get('top_left_corner') if self.new_object.get('topRightCorner') is not None or self.new_object.get('top_right_corner') is not None: new_object_params['topRightCorner'] = self.new_object.get('topRightCorner') or \ self.new_object.get('top_right_corner') - if self.new_object.get('imageContents') is not None or self.new_object.get('image_contents') is not None: - new_object_params['imageContents'] = self.new_object.get('imageContents') or \ - self.new_object.get('image_contents') if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: new_object_params['networkId'] = self.new_object.get('networkId') or \ self.new_object.get('network_id') @@ -222,13 +222,13 @@ class NetworksFloorPlans(object): requested_obj = self.new_object obj_params = [ - ("name", "name"), - ("center", "center"), ("bottomLeftCorner", "bottomLeftCorner"), ("bottomRightCorner", "bottomRightCorner"), + ("center", "center"), + ("imageContents", "imageContents"), + ("name", "name"), ("topLeftCorner", "topLeftCorner"), ("topRightCorner", "topRightCorner"), - ("imageContents", "imageContents"), ("networkId", "networkId"), ("floorPlanId", "floorPlanId"), ] diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_group_policies.py b/ansible_collections/cisco/meraki/plugins/action/networks_group_policies.py index c8f41fc81..749350851 100644 --- a/ansible_collections/cisco/meraki/plugins/action/networks_group_policies.py +++ b/ansible_collections/cisco/meraki/plugins/action/networks_group_policies.py @@ -32,14 +32,14 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present", "absent"]), - name=dict(type="str"), - scheduling=dict(type="dict"), bandwidth=dict(type="dict"), - firewallAndTrafficShaping=dict(type="dict"), + bonjourForwarding=dict(type="dict"), contentFiltering=dict(type="dict"), + firewallAndTrafficShaping=dict(type="dict"), + name=dict(type="str"), + scheduling=dict(type="dict"), splashAuthSettings=dict(type="str"), vlanTagging=dict(type="dict"), - bonjourForwarding=dict(type="dict"), networkId=dict(type="str"), groupPolicyId=dict(type="str"), )) @@ -57,14 +57,14 @@ class NetworksGroupPolicies(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( - name=params.get("name"), - scheduling=params.get("scheduling"), bandwidth=params.get("bandwidth"), - firewallAndTrafficShaping=params.get("firewallAndTrafficShaping"), + bonjourForwarding=params.get("bonjourForwarding"), contentFiltering=params.get("contentFiltering"), + firewallAndTrafficShaping=params.get("firewallAndTrafficShaping"), + name=params.get("name"), + scheduling=params.get("scheduling"), splashAuthSettings=params.get("splashAuthSettings"), vlanTagging=params.get("vlanTagging"), - bonjourForwarding=params.get("bonjourForwarding"), networkId=params.get("networkId"), groupPolicyId=params.get("groupPolicyId"), ) @@ -88,30 +88,30 @@ class NetworksGroupPolicies(object): def create_params(self): new_object_params = {} - if self.new_object.get('name') is not None or self.new_object.get('name') is not None: - new_object_params['name'] = self.new_object.get('name') or \ - self.new_object.get('name') - if self.new_object.get('scheduling') is not None or self.new_object.get('scheduling') is not None: - new_object_params['scheduling'] = self.new_object.get('scheduling') or \ - self.new_object.get('scheduling') if self.new_object.get('bandwidth') is not None or self.new_object.get('bandwidth') is not None: new_object_params['bandwidth'] = self.new_object.get('bandwidth') or \ self.new_object.get('bandwidth') - if self.new_object.get('firewallAndTrafficShaping') is not None or self.new_object.get('firewall_and_traffic_shaping') is not None: - new_object_params['firewallAndTrafficShaping'] = self.new_object.get('firewallAndTrafficShaping') or \ - self.new_object.get('firewall_and_traffic_shaping') + if self.new_object.get('bonjourForwarding') is not None or self.new_object.get('bonjour_forwarding') is not None: + new_object_params['bonjourForwarding'] = self.new_object.get('bonjourForwarding') or \ + self.new_object.get('bonjour_forwarding') if self.new_object.get('contentFiltering') is not None or self.new_object.get('content_filtering') is not None: new_object_params['contentFiltering'] = self.new_object.get('contentFiltering') or \ self.new_object.get('content_filtering') + if self.new_object.get('firewallAndTrafficShaping') is not None or self.new_object.get('firewall_and_traffic_shaping') is not None: + new_object_params['firewallAndTrafficShaping'] = self.new_object.get('firewallAndTrafficShaping') or \ + self.new_object.get('firewall_and_traffic_shaping') + if self.new_object.get('name') is not None or self.new_object.get('name') is not None: + new_object_params['name'] = self.new_object.get('name') or \ + self.new_object.get('name') + if self.new_object.get('scheduling') is not None or self.new_object.get('scheduling') is not None: + new_object_params['scheduling'] = self.new_object.get('scheduling') or \ + self.new_object.get('scheduling') if self.new_object.get('splashAuthSettings') is not None or self.new_object.get('splash_auth_settings') is not None: new_object_params['splashAuthSettings'] = self.new_object.get('splashAuthSettings') or \ self.new_object.get('splash_auth_settings') if self.new_object.get('vlanTagging') is not None or self.new_object.get('vlan_tagging') is not None: new_object_params['vlanTagging'] = self.new_object.get('vlanTagging') or \ self.new_object.get('vlan_tagging') - if self.new_object.get('bonjourForwarding') is not None or self.new_object.get('bonjour_forwarding') is not None: - new_object_params['bonjourForwarding'] = self.new_object.get('bonjourForwarding') or \ - self.new_object.get('bonjour_forwarding') if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: new_object_params['networkId'] = self.new_object.get('networkId') or \ self.new_object.get('network_id') @@ -129,30 +129,30 @@ class NetworksGroupPolicies(object): def update_by_id_params(self): new_object_params = {} - if self.new_object.get('name') is not None or self.new_object.get('name') is not None: - new_object_params['name'] = self.new_object.get('name') or \ - self.new_object.get('name') - if self.new_object.get('scheduling') is not None or self.new_object.get('scheduling') is not None: - new_object_params['scheduling'] = self.new_object.get('scheduling') or \ - self.new_object.get('scheduling') if self.new_object.get('bandwidth') is not None or self.new_object.get('bandwidth') is not None: new_object_params['bandwidth'] = self.new_object.get('bandwidth') or \ self.new_object.get('bandwidth') - if self.new_object.get('firewallAndTrafficShaping') is not None or self.new_object.get('firewall_and_traffic_shaping') is not None: - new_object_params['firewallAndTrafficShaping'] = self.new_object.get('firewallAndTrafficShaping') or \ - self.new_object.get('firewall_and_traffic_shaping') + if self.new_object.get('bonjourForwarding') is not None or self.new_object.get('bonjour_forwarding') is not None: + new_object_params['bonjourForwarding'] = self.new_object.get('bonjourForwarding') or \ + self.new_object.get('bonjour_forwarding') if self.new_object.get('contentFiltering') is not None or self.new_object.get('content_filtering') is not None: new_object_params['contentFiltering'] = self.new_object.get('contentFiltering') or \ self.new_object.get('content_filtering') + if self.new_object.get('firewallAndTrafficShaping') is not None or self.new_object.get('firewall_and_traffic_shaping') is not None: + new_object_params['firewallAndTrafficShaping'] = self.new_object.get('firewallAndTrafficShaping') or \ + self.new_object.get('firewall_and_traffic_shaping') + if self.new_object.get('name') is not None or self.new_object.get('name') is not None: + new_object_params['name'] = self.new_object.get('name') or \ + self.new_object.get('name') + if self.new_object.get('scheduling') is not None or self.new_object.get('scheduling') is not None: + new_object_params['scheduling'] = self.new_object.get('scheduling') or \ + self.new_object.get('scheduling') if self.new_object.get('splashAuthSettings') is not None or self.new_object.get('splash_auth_settings') is not None: new_object_params['splashAuthSettings'] = self.new_object.get('splashAuthSettings') or \ self.new_object.get('splash_auth_settings') if self.new_object.get('vlanTagging') is not None or self.new_object.get('vlan_tagging') is not None: new_object_params['vlanTagging'] = self.new_object.get('vlanTagging') or \ self.new_object.get('vlan_tagging') - if self.new_object.get('bonjourForwarding') is not None or self.new_object.get('bonjour_forwarding') is not None: - new_object_params['bonjourForwarding'] = self.new_object.get('bonjourForwarding') or \ - self.new_object.get('bonjour_forwarding') if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: new_object_params['networkId'] = self.new_object.get('networkId') or \ self.new_object.get('network_id') @@ -230,14 +230,14 @@ class NetworksGroupPolicies(object): requested_obj = self.new_object obj_params = [ - ("name", "name"), - ("scheduling", "scheduling"), ("bandwidth", "bandwidth"), - ("firewallAndTrafficShaping", "firewallAndTrafficShaping"), + ("bonjourForwarding", "bonjourForwarding"), ("contentFiltering", "contentFiltering"), + ("firewallAndTrafficShaping", "firewallAndTrafficShaping"), + ("name", "name"), + ("scheduling", "scheduling"), ("splashAuthSettings", "splashAuthSettings"), ("vlanTagging", "vlanTagging"), - ("bonjourForwarding", "bonjourForwarding"), ("networkId", "networkId"), ("groupPolicyId", "groupPolicyId"), ] diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_meraki_auth_users.py b/ansible_collections/cisco/meraki/plugins/action/networks_meraki_auth_users.py index 56787c4fd..436947b7c 100644 --- a/ansible_collections/cisco/meraki/plugins/action/networks_meraki_auth_users.py +++ b/ansible_collections/cisco/meraki/plugins/action/networks_meraki_auth_users.py @@ -32,15 +32,16 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present", "absent"]), - email=dict(type="str"), - name=dict(type="str"), - password=dict(type="str"), accountType=dict(type="str"), + authorizations=dict(type="list"), + email=dict(type="str"), emailPasswordToUser=dict(type="bool"), isAdmin=dict(type="bool"), - authorizations=dict(type="list"), + name=dict(type="str"), + password=dict(type="str"), networkId=dict(type="str"), merakiAuthUserId=dict(type="str"), + delete=dict(type="bool"), )) required_if = [ @@ -56,15 +57,16 @@ class NetworksMerakiAuthUsers(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( - email=params.get("email"), - name=params.get("name"), - password=params.get("password"), accountType=params.get("accountType"), + authorizations=params.get("authorizations"), + email=params.get("email"), emailPasswordToUser=params.get("emailPasswordToUser"), isAdmin=params.get("isAdmin"), - authorizations=params.get("authorizations"), + name=params.get("name"), + password=params.get("password"), networkId=params.get("networkId"), merakiAuthUserId=params.get("merakiAuthUserId"), + delete=params.get("delete"), ) def get_all_params(self, name=None, id=None): @@ -86,25 +88,25 @@ class NetworksMerakiAuthUsers(object): def create_params(self): new_object_params = {} + if self.new_object.get('accountType') is not None or self.new_object.get('account_type') is not None: + new_object_params['accountType'] = self.new_object.get('accountType') or \ + self.new_object.get('account_type') + if self.new_object.get('authorizations') is not None or self.new_object.get('authorizations') is not None: + new_object_params['authorizations'] = self.new_object.get('authorizations') or \ + self.new_object.get('authorizations') if self.new_object.get('email') is not None or self.new_object.get('email') is not None: new_object_params['email'] = self.new_object.get('email') or \ self.new_object.get('email') + if self.new_object.get('emailPasswordToUser') is not None or self.new_object.get('email_password_to_user') is not None: + new_object_params['emailPasswordToUser'] = self.new_object.get('emailPasswordToUser') + if self.new_object.get('isAdmin') is not None or self.new_object.get('is_admin') is not None: + new_object_params['isAdmin'] = self.new_object.get('isAdmin') if self.new_object.get('name') is not None or self.new_object.get('name') is not None: new_object_params['name'] = self.new_object.get('name') or \ self.new_object.get('name') if self.new_object.get('password') is not None or self.new_object.get('password') is not None: new_object_params['password'] = self.new_object.get('password') or \ self.new_object.get('password') - if self.new_object.get('accountType') is not None or self.new_object.get('account_type') is not None: - new_object_params['accountType'] = self.new_object.get('accountType') or \ - self.new_object.get('account_type') - if self.new_object.get('emailPasswordToUser') is not None or self.new_object.get('email_password_to_user') is not None: - new_object_params['emailPasswordToUser'] = self.new_object.get('emailPasswordToUser') - if self.new_object.get('isAdmin') is not None or self.new_object.get('is_admin') is not None: - new_object_params['isAdmin'] = self.new_object.get('isAdmin') - if self.new_object.get('authorizations') is not None or self.new_object.get('authorizations') is not None: - new_object_params['authorizations'] = self.new_object.get('authorizations') or \ - self.new_object.get('authorizations') if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: new_object_params['networkId'] = self.new_object.get('networkId') or \ self.new_object.get('network_id') @@ -112,6 +114,8 @@ class NetworksMerakiAuthUsers(object): def delete_by_id_params(self): new_object_params = {} + if self.new_object.get('delete') is not None or self.new_object.get('delete') is not None: + new_object_params['delete'] = self.new_object.get('delete') if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: new_object_params['networkId'] = self.new_object.get('networkId') or \ self.new_object.get('network_id') @@ -122,17 +126,17 @@ class NetworksMerakiAuthUsers(object): def update_by_id_params(self): new_object_params = {} + if self.new_object.get('authorizations') is not None or self.new_object.get('authorizations') is not None: + new_object_params['authorizations'] = self.new_object.get('authorizations') or \ + self.new_object.get('authorizations') + if self.new_object.get('emailPasswordToUser') is not None or self.new_object.get('email_password_to_user') is not None: + new_object_params['emailPasswordToUser'] = self.new_object.get('emailPasswordToUser') if self.new_object.get('name') is not None or self.new_object.get('name') is not None: new_object_params['name'] = self.new_object.get('name') or \ self.new_object.get('name') if self.new_object.get('password') is not None or self.new_object.get('password') is not None: new_object_params['password'] = self.new_object.get('password') or \ self.new_object.get('password') - if self.new_object.get('emailPasswordToUser') is not None or self.new_object.get('email_password_to_user') is not None: - new_object_params['emailPasswordToUser'] = self.new_object.get('emailPasswordToUser') - if self.new_object.get('authorizations') is not None or self.new_object.get('authorizations') is not None: - new_object_params['authorizations'] = self.new_object.get('authorizations') or \ - self.new_object.get('authorizations') if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: new_object_params['networkId'] = self.new_object.get('networkId') or \ self.new_object.get('network_id') @@ -210,14 +214,15 @@ class NetworksMerakiAuthUsers(object): requested_obj = self.new_object obj_params = [ - ("email", "email"), - ("name", "name"), ("accountType", "accountType"), + ("authorizations", "authorizations"), + ("email", "email"), ("emailPasswordToUser", "emailPasswordToUser"), ("isAdmin", "isAdmin"), - ("authorizations", "authorizations"), + ("name", "name"), ("networkId", "networkId"), ("merakiAuthUserId", "merakiAuthUserId"), + ("delete", "delete"), ] # Method 1. Params present in request (Ansible) obj are the same as the current (DNAC) params # If any does not have eq params, it requires update diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_mqtt_brokers.py b/ansible_collections/cisco/meraki/plugins/action/networks_mqtt_brokers.py index 4313ec519..89e45246e 100644 --- a/ansible_collections/cisco/meraki/plugins/action/networks_mqtt_brokers.py +++ b/ansible_collections/cisco/meraki/plugins/action/networks_mqtt_brokers.py @@ -25,11 +25,11 @@ from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( - name=dict(type="str"), + authentication=dict(type="dict"), host=dict(type="str"), + name=dict(type="str"), port=dict(type="int"), security=dict(type="dict"), - authentication=dict(type="dict"), networkId=dict(type="str"), )) @@ -69,11 +69,11 @@ class ActionModule(ActionBase): def get_object(self, params): new_object = dict( - name=params.get("name"), + authentication=params.get("authentication"), host=params.get("host"), + name=params.get("name"), port=params.get("port"), security=params.get("security"), - authentication=params.get("authentication"), networkId=params.get("networkId"), ) return new_object diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_netflow.py b/ansible_collections/cisco/meraki/plugins/action/networks_netflow.py index 0360b2792..730f5518b 100644 --- a/ansible_collections/cisco/meraki/plugins/action/networks_netflow.py +++ b/ansible_collections/cisco/meraki/plugins/action/networks_netflow.py @@ -32,11 +32,11 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present"]), - reportingEnabled=dict(type="bool"), collectorIp=dict(type="str"), collectorPort=dict(type="int"), - etaEnabled=dict(type="bool"), etaDstPort=dict(type="int"), + etaEnabled=dict(type="bool"), + reportingEnabled=dict(type="bool"), networkId=dict(type="str"), )) @@ -52,11 +52,11 @@ class NetworksNetflow(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( - reportingEnabled=params.get("reportingEnabled"), collectorIp=params.get("collectorIp"), collectorPort=params.get("collectorPort"), - etaEnabled=params.get("etaEnabled"), etaDstPort=params.get("etaDstPort"), + etaEnabled=params.get("etaEnabled"), + reportingEnabled=params.get("reportingEnabled"), network_id=params.get("networkId"), ) @@ -69,19 +69,19 @@ class NetworksNetflow(object): def update_all_params(self): new_object_params = {} - if self.new_object.get('reportingEnabled') is not None or self.new_object.get('reporting_enabled') is not None: - new_object_params['reportingEnabled'] = self.new_object.get('reportingEnabled') if self.new_object.get('collectorIp') is not None or self.new_object.get('collector_ip') is not None: new_object_params['collectorIp'] = self.new_object.get('collectorIp') or \ self.new_object.get('collector_ip') if self.new_object.get('collectorPort') is not None or self.new_object.get('collector_port') is not None: new_object_params['collectorPort'] = self.new_object.get('collectorPort') or \ self.new_object.get('collector_port') - if self.new_object.get('etaEnabled') is not None or self.new_object.get('eta_enabled') is not None: - new_object_params['etaEnabled'] = self.new_object.get('etaEnabled') if self.new_object.get('etaDstPort') is not None or self.new_object.get('eta_dst_port') is not None: new_object_params['etaDstPort'] = self.new_object.get('etaDstPort') or \ self.new_object.get('eta_dst_port') + if self.new_object.get('etaEnabled') is not None or self.new_object.get('eta_enabled') is not None: + new_object_params['etaEnabled'] = self.new_object.get('etaEnabled') + if self.new_object.get('reportingEnabled') is not None or self.new_object.get('reporting_enabled') is not None: + new_object_params['reportingEnabled'] = self.new_object.get('reportingEnabled') if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: new_object_params['networkId'] = self.new_object.get('networkId') or \ self.new_object.get('network_id') @@ -138,11 +138,11 @@ class NetworksNetflow(object): requested_obj = self.new_object obj_params = [ - ("reportingEnabled", "reportingEnabled"), ("collectorIp", "collectorIp"), ("collectorPort", "collectorPort"), - ("etaEnabled", "etaEnabled"), ("etaDstPort", "etaDstPort"), + ("etaEnabled", "etaEnabled"), + ("reportingEnabled", "reportingEnabled"), ("networkId", "networkId"), ] # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_sensor_alerts_profiles.py b/ansible_collections/cisco/meraki/plugins/action/networks_sensor_alerts_profiles.py index 13be65175..bb150c8fd 100644 --- a/ansible_collections/cisco/meraki/plugins/action/networks_sensor_alerts_profiles.py +++ b/ansible_collections/cisco/meraki/plugins/action/networks_sensor_alerts_profiles.py @@ -32,10 +32,10 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present", "absent"]), - name=dict(type="str"), - schedule=dict(type="dict"), conditions=dict(type="list"), + name=dict(type="str"), recipients=dict(type="dict"), + schedule=dict(type="dict"), serials=dict(type="list"), networkId=dict(type="str"), id=dict(type="str"), @@ -54,10 +54,10 @@ class NetworksSensorAlertsProfiles(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( - name=params.get("name"), - schedule=params.get("schedule"), conditions=params.get("conditions"), + name=params.get("name"), recipients=params.get("recipients"), + schedule=params.get("schedule"), serials=params.get("serials"), networkId=params.get("networkId"), id=params.get("id"), @@ -81,18 +81,18 @@ class NetworksSensorAlertsProfiles(object): def create_params(self): new_object_params = {} - if self.new_object.get('name') is not None or self.new_object.get('name') is not None: - new_object_params['name'] = self.new_object.get('name') or \ - self.new_object.get('name') - if self.new_object.get('schedule') is not None or self.new_object.get('schedule') is not None: - new_object_params['schedule'] = self.new_object.get('schedule') or \ - self.new_object.get('schedule') if self.new_object.get('conditions') is not None or self.new_object.get('conditions') is not None: new_object_params['conditions'] = self.new_object.get('conditions') or \ self.new_object.get('conditions') + if self.new_object.get('name') is not None or self.new_object.get('name') is not None: + new_object_params['name'] = self.new_object.get('name') or \ + self.new_object.get('name') if self.new_object.get('recipients') is not None or self.new_object.get('recipients') is not None: new_object_params['recipients'] = self.new_object.get('recipients') or \ self.new_object.get('recipients') + if self.new_object.get('schedule') is not None or self.new_object.get('schedule') is not None: + new_object_params['schedule'] = self.new_object.get('schedule') or \ + self.new_object.get('schedule') if self.new_object.get('serials') is not None or self.new_object.get('serials') is not None: new_object_params['serials'] = self.new_object.get('serials') or \ self.new_object.get('serials') @@ -113,18 +113,18 @@ class NetworksSensorAlertsProfiles(object): def update_by_id_params(self): new_object_params = {} - if self.new_object.get('name') is not None or self.new_object.get('name') is not None: - new_object_params['name'] = self.new_object.get('name') or \ - self.new_object.get('name') - if self.new_object.get('schedule') is not None or self.new_object.get('schedule') is not None: - new_object_params['schedule'] = self.new_object.get('schedule') or \ - self.new_object.get('schedule') if self.new_object.get('conditions') is not None or self.new_object.get('conditions') is not None: new_object_params['conditions'] = self.new_object.get('conditions') or \ self.new_object.get('conditions') + if self.new_object.get('name') is not None or self.new_object.get('name') is not None: + new_object_params['name'] = self.new_object.get('name') or \ + self.new_object.get('name') if self.new_object.get('recipients') is not None or self.new_object.get('recipients') is not None: new_object_params['recipients'] = self.new_object.get('recipients') or \ self.new_object.get('recipients') + if self.new_object.get('schedule') is not None or self.new_object.get('schedule') is not None: + new_object_params['schedule'] = self.new_object.get('schedule') or \ + self.new_object.get('schedule') if self.new_object.get('serials') is not None or self.new_object.get('serials') is not None: new_object_params['serials'] = self.new_object.get('serials') or \ self.new_object.get('serials') @@ -201,10 +201,10 @@ class NetworksSensorAlertsProfiles(object): requested_obj = self.new_object obj_params = [ - ("name", "name"), - ("schedule", "schedule"), ("conditions", "conditions"), + ("name", "name"), ("recipients", "recipients"), + ("schedule", "schedule"), ("serials", "serials"), ("networkId", "networkId"), ("id", "id"), diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_settings.py b/ansible_collections/cisco/meraki/plugins/action/networks_settings.py index 3827be9c0..26277be99 100644 --- a/ansible_collections/cisco/meraki/plugins/action/networks_settings.py +++ b/ansible_collections/cisco/meraki/plugins/action/networks_settings.py @@ -32,9 +32,10 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present"]), + localStatusPage=dict(type="dict"), localStatusPageEnabled=dict(type="bool"), + namedVlans=dict(type="dict"), remoteStatusPageEnabled=dict(type="bool"), - localStatusPage=dict(type="dict"), securePort=dict(type="dict"), networkId=dict(type="str"), )) @@ -51,9 +52,10 @@ class NetworksSettings(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( + localStatusPage=params.get("localStatusPage"), localStatusPageEnabled=params.get("localStatusPageEnabled"), + namedVlans=params.get("namedVlans"), remoteStatusPageEnabled=params.get("remoteStatusPageEnabled"), - localStatusPage=params.get("localStatusPage"), securePort=params.get("securePort"), network_id=params.get("networkId"), ) @@ -67,13 +69,16 @@ class NetworksSettings(object): def update_all_params(self): new_object_params = {} + if self.new_object.get('localStatusPage') is not None or self.new_object.get('local_status_page') is not None: + new_object_params['localStatusPage'] = self.new_object.get('localStatusPage') or \ + self.new_object.get('local_status_page') if self.new_object.get('localStatusPageEnabled') is not None or self.new_object.get('local_status_page_enabled') is not None: new_object_params['localStatusPageEnabled'] = self.new_object.get('localStatusPageEnabled') + if self.new_object.get('namedVlans') is not None or self.new_object.get('named_vlans') is not None: + new_object_params['namedVlans'] = self.new_object.get('namedVlans') or \ + self.new_object.get('named_vlans') if self.new_object.get('remoteStatusPageEnabled') is not None or self.new_object.get('remote_status_page_enabled') is not None: new_object_params['remoteStatusPageEnabled'] = self.new_object.get('remoteStatusPageEnabled') - if self.new_object.get('localStatusPage') is not None or self.new_object.get('local_status_page') is not None: - new_object_params['localStatusPage'] = self.new_object.get('localStatusPage') or \ - self.new_object.get('local_status_page') if self.new_object.get('securePort') is not None or self.new_object.get('secure_port') is not None: new_object_params['securePort'] = self.new_object.get('securePort') or \ self.new_object.get('secure_port') @@ -133,9 +138,10 @@ class NetworksSettings(object): requested_obj = self.new_object obj_params = [ + ("localStatusPage", "localStatusPage"), ("localStatusPageEnabled", "localStatusPageEnabled"), + ("namedVlans", "namedVlans"), ("remoteStatusPageEnabled", "remoteStatusPageEnabled"), - ("localStatusPage", "localStatusPage"), ("securePort", "securePort"), ("networkId", "networkId"), ] diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_sm_devices_checkin.py b/ansible_collections/cisco/meraki/plugins/action/networks_sm_devices_checkin.py index 8695838b5..ba46b4121 100644 --- a/ansible_collections/cisco/meraki/plugins/action/networks_sm_devices_checkin.py +++ b/ansible_collections/cisco/meraki/plugins/action/networks_sm_devices_checkin.py @@ -25,10 +25,10 @@ from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( - wifiMacs=dict(type="list"), ids=dict(type="list"), - serials=dict(type="list"), scope=dict(type="list"), + serials=dict(type="list"), + wifiMacs=dict(type="list"), networkId=dict(type="str"), )) @@ -68,10 +68,10 @@ class ActionModule(ActionBase): def get_object(self, params): new_object = dict( - wifiMacs=params.get("wifiMacs"), ids=params.get("ids"), - serials=params.get("serials"), scope=params.get("scope"), + serials=params.get("serials"), + wifiMacs=params.get("wifiMacs"), networkId=params.get("networkId"), ) return new_object diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_sm_devices_fields.py b/ansible_collections/cisco/meraki/plugins/action/networks_sm_devices_fields.py index 6d9bda4c7..7d7ada596 100644 --- a/ansible_collections/cisco/meraki/plugins/action/networks_sm_devices_fields.py +++ b/ansible_collections/cisco/meraki/plugins/action/networks_sm_devices_fields.py @@ -25,10 +25,10 @@ from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( - wifiMac=dict(type="str"), + deviceFields=dict(type="dict"), id=dict(type="str"), serial=dict(type="str"), - deviceFields=dict(type="dict"), + wifiMac=dict(type="str"), networkId=dict(type="str"), )) @@ -68,10 +68,10 @@ class ActionModule(ActionBase): def get_object(self, params): new_object = dict( - wifiMac=params.get("wifiMac"), + deviceFields=params.get("deviceFields"), id=params.get("id"), serial=params.get("serial"), - deviceFields=params.get("deviceFields"), + wifiMac=params.get("wifiMac"), networkId=params.get("networkId"), ) return new_object diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_sm_devices_info.py b/ansible_collections/cisco/meraki/plugins/action/networks_sm_devices_info.py index c37f3cc07..e186502cd 100644 --- a/ansible_collections/cisco/meraki/plugins/action/networks_sm_devices_info.py +++ b/ansible_collections/cisco/meraki/plugins/action/networks_sm_devices_info.py @@ -30,6 +30,8 @@ argument_spec.update(dict( wifiMacs=dict(type="list"), serials=dict(type="list"), ids=dict(type="list"), + uuids=dict(type="list"), + systemTypes=dict(type="list"), scope=dict(type="list"), perPage=dict(type="int"), total_pages=dict(type="int"), @@ -89,6 +91,12 @@ class ActionModule(ActionBase): if params.get("ids") is not None: new_object["ids"] = params.get( "ids") + if params.get("uuids") is not None: + new_object["uuids"] = params.get( + "uuids") + if params.get("systemTypes") is not None: + new_object["systemTypes"] = params.get( + "systemTypes") if params.get("scope") is not None: new_object["scope"] = params.get( "scope") diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_sm_devices_install_apps.py b/ansible_collections/cisco/meraki/plugins/action/networks_sm_devices_install_apps.py new file mode 100644 index 000000000..5dfbe018f --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/action/networks_sm_devices_install_apps.py @@ -0,0 +1,93 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( + MERAKI, + meraki_argument_spec, +) + +# Get common arguements specification +argument_spec = meraki_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + appIds=dict(type="list"), + force=dict(type="bool"), + networkId=dict(type="str"), + deviceId=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail( + "ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + appIds=params.get("appIds"), + force=params.get("force"), + networkId=params.get("networkId"), + deviceId=params.get("deviceId"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + meraki = MERAKI(params=self._task.args) + + response = meraki.exec_meraki( + family="sm", + function='installNetworkSmDeviceApps', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(meraki_response=response)) + self._result.update(meraki.exit_json()) + return self._result diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_sm_devices_lock.py b/ansible_collections/cisco/meraki/plugins/action/networks_sm_devices_lock.py index c846a4dde..8f851fe0a 100644 --- a/ansible_collections/cisco/meraki/plugins/action/networks_sm_devices_lock.py +++ b/ansible_collections/cisco/meraki/plugins/action/networks_sm_devices_lock.py @@ -25,11 +25,11 @@ from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( - wifiMacs=dict(type="list"), ids=dict(type="list"), - serials=dict(type="list"), - scope=dict(type="list"), pin=dict(type="int"), + scope=dict(type="list"), + serials=dict(type="list"), + wifiMacs=dict(type="list"), networkId=dict(type="str"), )) @@ -69,11 +69,11 @@ class ActionModule(ActionBase): def get_object(self, params): new_object = dict( - wifiMacs=params.get("wifiMacs"), ids=params.get("ids"), - serials=params.get("serials"), - scope=params.get("scope"), pin=params.get("pin"), + scope=params.get("scope"), + serials=params.get("serials"), + wifiMacs=params.get("wifiMacs"), networkId=params.get("networkId"), ) return new_object diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_sm_devices_modify_tags.py b/ansible_collections/cisco/meraki/plugins/action/networks_sm_devices_modify_tags.py index ea771b977..27f47614e 100644 --- a/ansible_collections/cisco/meraki/plugins/action/networks_sm_devices_modify_tags.py +++ b/ansible_collections/cisco/meraki/plugins/action/networks_sm_devices_modify_tags.py @@ -25,12 +25,12 @@ from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( - wifiMacs=dict(type="list"), ids=dict(type="list"), - serials=dict(type="list"), scope=dict(type="list"), + serials=dict(type="list"), tags=dict(type="list"), updateAction=dict(type="str"), + wifiMacs=dict(type="list"), networkId=dict(type="str"), )) @@ -70,12 +70,12 @@ class ActionModule(ActionBase): def get_object(self, params): new_object = dict( - wifiMacs=params.get("wifiMacs"), ids=params.get("ids"), - serials=params.get("serials"), scope=params.get("scope"), + serials=params.get("serials"), tags=params.get("tags"), updateAction=params.get("updateAction"), + wifiMacs=params.get("wifiMacs"), networkId=params.get("networkId"), ) return new_object diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_sm_devices_move.py b/ansible_collections/cisco/meraki/plugins/action/networks_sm_devices_move.py index 5ed4b5d65..384f3abf0 100644 --- a/ansible_collections/cisco/meraki/plugins/action/networks_sm_devices_move.py +++ b/ansible_collections/cisco/meraki/plugins/action/networks_sm_devices_move.py @@ -25,11 +25,11 @@ from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( - wifiMacs=dict(type="list"), ids=dict(type="list"), - serials=dict(type="list"), - scope=dict(type="list"), newNetwork=dict(type="str"), + scope=dict(type="list"), + serials=dict(type="list"), + wifiMacs=dict(type="list"), networkId=dict(type="str"), )) @@ -69,11 +69,11 @@ class ActionModule(ActionBase): def get_object(self, params): new_object = dict( - wifiMacs=params.get("wifiMacs"), ids=params.get("ids"), - serials=params.get("serials"), - scope=params.get("scope"), newNetwork=params.get("newNetwork"), + scope=params.get("scope"), + serials=params.get("serials"), + wifiMacs=params.get("wifiMacs"), networkId=params.get("networkId"), ) return new_object diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_sm_devices_reboot.py b/ansible_collections/cisco/meraki/plugins/action/networks_sm_devices_reboot.py new file mode 100644 index 000000000..16e825308 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/action/networks_sm_devices_reboot.py @@ -0,0 +1,103 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( + MERAKI, + meraki_argument_spec, +) + +# Get common arguements specification +argument_spec = meraki_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + ids=dict(type="list"), + kextPaths=dict(type="list"), + notifyUser=dict(type="bool"), + rebuildKernelCache=dict(type="bool"), + requestRequiresNetworkTether=dict(type="bool"), + scope=dict(type="list"), + serials=dict(type="list"), + wifiMacs=dict(type="list"), + networkId=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail( + "ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + ids=params.get("ids"), + kextPaths=params.get("kextPaths"), + notifyUser=params.get("notifyUser"), + rebuildKernelCache=params.get("rebuildKernelCache"), + requestRequiresNetworkTether=params.get("requestRequiresNetworkTether"), + scope=params.get("scope"), + serials=params.get("serials"), + wifiMacs=params.get("wifiMacs"), + networkId=params.get("networkId"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + meraki = MERAKI(params=self._task.args) + + response = meraki.exec_meraki( + family="sm", + function='rebootNetworkSmDevices', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(meraki_response=response)) + self._result.update(meraki.exit_json()) + return self._result diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_sm_devices_shutdown.py b/ansible_collections/cisco/meraki/plugins/action/networks_sm_devices_shutdown.py new file mode 100644 index 000000000..fb184208c --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/action/networks_sm_devices_shutdown.py @@ -0,0 +1,95 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( + MERAKI, + meraki_argument_spec, +) + +# Get common arguements specification +argument_spec = meraki_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + ids=dict(type="list"), + scope=dict(type="list"), + serials=dict(type="list"), + wifiMacs=dict(type="list"), + networkId=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail( + "ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + ids=params.get("ids"), + scope=params.get("scope"), + serials=params.get("serials"), + wifiMacs=params.get("wifiMacs"), + networkId=params.get("networkId"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + meraki = MERAKI(params=self._task.args) + + response = meraki.exec_meraki( + family="sm", + function='shutdownNetworkSmDevices', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(meraki_response=response)) + self._result.update(meraki.exit_json()) + return self._result diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_sm_devices_uninstall_apps.py b/ansible_collections/cisco/meraki/plugins/action/networks_sm_devices_uninstall_apps.py new file mode 100644 index 000000000..056734402 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/action/networks_sm_devices_uninstall_apps.py @@ -0,0 +1,91 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( + MERAKI, + meraki_argument_spec, +) + +# Get common arguements specification +argument_spec = meraki_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + appIds=dict(type="list"), + networkId=dict(type="str"), + deviceId=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail( + "ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + appIds=params.get("appIds"), + networkId=params.get("networkId"), + deviceId=params.get("deviceId"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + meraki = MERAKI(params=self._task.args) + + response = meraki.exec_meraki( + family="sm", + function='uninstallNetworkSmDeviceApps', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(meraki_response=response)) + self._result.update(meraki.exit_json()) + return self._result diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_sm_devices_wipe.py b/ansible_collections/cisco/meraki/plugins/action/networks_sm_devices_wipe.py index 1b20cad81..ca334bd8c 100644 --- a/ansible_collections/cisco/meraki/plugins/action/networks_sm_devices_wipe.py +++ b/ansible_collections/cisco/meraki/plugins/action/networks_sm_devices_wipe.py @@ -25,10 +25,10 @@ from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( - wifiMac=dict(type="str"), id=dict(type="str"), - serial=dict(type="str"), pin=dict(type="int"), + serial=dict(type="str"), + wifiMac=dict(type="str"), networkId=dict(type="str"), )) @@ -68,10 +68,10 @@ class ActionModule(ActionBase): def get_object(self, params): new_object = dict( - wifiMac=params.get("wifiMac"), id=params.get("id"), - serial=params.get("serial"), pin=params.get("pin"), + serial=params.get("serial"), + wifiMac=params.get("wifiMac"), networkId=params.get("networkId"), ) return new_object diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_sm_profiles_info.py b/ansible_collections/cisco/meraki/plugins/action/networks_sm_profiles_info.py index 44ab17a59..d834af8b9 100644 --- a/ansible_collections/cisco/meraki/plugins/action/networks_sm_profiles_info.py +++ b/ansible_collections/cisco/meraki/plugins/action/networks_sm_profiles_info.py @@ -26,6 +26,7 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( networkId=dict(type="str"), + payloadTypes=dict(type="list"), )) required_if = [] @@ -67,6 +68,9 @@ class ActionModule(ActionBase): if params.get("networkId") is not None: new_object["networkId"] = params.get( "networkId") + if params.get("payloadTypes") is not None: + new_object["payloadTypes"] = params.get( + "payloadTypes") return new_object diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_switch_access_policies.py b/ansible_collections/cisco/meraki/plugins/action/networks_switch_access_policies.py index a56a7f0dd..aef2813a9 100644 --- a/ansible_collections/cisco/meraki/plugins/action/networks_switch_access_policies.py +++ b/ansible_collections/cisco/meraki/plugins/action/networks_switch_access_policies.py @@ -32,23 +32,23 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present", "absent"]), + accessPolicyType=dict(type="str"), + dot1x=dict(type="dict"), + guestPortBouncing=dict(type="bool"), + guestVlanId=dict(type="int"), + hostMode=dict(type="str"), + increaseAccessSpeed=dict(type="bool"), name=dict(type="str"), - radiusServers=dict(type="list"), radius=dict(type="dict"), - guestPortBouncing=dict(type="bool"), - radiusTestingEnabled=dict(type="bool"), - radiusCoaSupportEnabled=dict(type="bool"), radiusAccountingEnabled=dict(type="bool"), radiusAccountingServers=dict(type="list"), + radiusCoaSupportEnabled=dict(type="bool"), radiusGroupAttribute=dict(type="str"), - hostMode=dict(type="str"), - accessPolicyType=dict(type="str"), - increaseAccessSpeed=dict(type="bool"), - guestVlanId=dict(type="int"), - dot1x=dict(type="dict"), - voiceVlanClients=dict(type="bool"), + radiusServers=dict(type="list"), + radiusTestingEnabled=dict(type="bool"), urlRedirectWalledGardenEnabled=dict(type="bool"), urlRedirectWalledGardenRanges=dict(type="list"), + voiceVlanClients=dict(type="bool"), networkId=dict(type="str"), accessPolicyNumber=dict(type="str"), )) @@ -66,25 +66,23 @@ class NetworksSwitchAccessPolicies(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( + accessPolicyType=params.get("accessPolicyType"), + dot1x=params.get("dot1x"), + guestPortBouncing=params.get("guestPortBouncing"), + guestVlanId=params.get("guestVlanId"), + hostMode=params.get("hostMode"), + increaseAccessSpeed=params.get("increaseAccessSpeed"), name=params.get("name"), - radiusServers=params.get("radiusServers"), radius=params.get("radius"), - guestPortBouncing=params.get("guestPortBouncing"), - radiusTestingEnabled=params.get("radiusTestingEnabled"), - radiusCoaSupportEnabled=params.get("radiusCoaSupportEnabled"), radiusAccountingEnabled=params.get("radiusAccountingEnabled"), radiusAccountingServers=params.get("radiusAccountingServers"), + radiusCoaSupportEnabled=params.get("radiusCoaSupportEnabled"), radiusGroupAttribute=params.get("radiusGroupAttribute"), - hostMode=params.get("hostMode"), - accessPolicyType=params.get("accessPolicyType"), - increaseAccessSpeed=params.get("increaseAccessSpeed"), - guestVlanId=params.get("guestVlanId"), - dot1x=params.get("dot1x"), + radiusServers=params.get("radiusServers"), + radiusTestingEnabled=params.get("radiusTestingEnabled"), + urlRedirectWalledGardenEnabled=params.get("urlRedirectWalledGardenEnabled"), + urlRedirectWalledGardenRanges=params.get("urlRedirectWalledGardenRanges"), voiceVlanClients=params.get("voiceVlanClients"), - urlRedirectWalledGardenEnabled=params.get( - "urlRedirectWalledGardenEnabled"), - urlRedirectWalledGardenRanges=params.get( - "urlRedirectWalledGardenRanges"), networkId=params.get("networkId"), accessPolicyNumber=params.get("accessPolicyNumber"), ) @@ -108,57 +106,50 @@ class NetworksSwitchAccessPolicies(object): def create_params(self): new_object_params = {} + if self.new_object.get('accessPolicyType') is not None or self.new_object.get('access_policy_type') is not None: + new_object_params['accessPolicyType'] = self.new_object.get('accessPolicyType') or \ + self.new_object.get('access_policy_type') + if self.new_object.get('dot1x') is not None or self.new_object.get('dot1x') is not None: + new_object_params['dot1x'] = self.new_object.get('dot1x') or \ + self.new_object.get('dot1x') + if self.new_object.get('guestPortBouncing') is not None or self.new_object.get('guest_port_bouncing') is not None: + new_object_params['guestPortBouncing'] = self.new_object.get('guestPortBouncing') + if self.new_object.get('guestVlanId') is not None or self.new_object.get('guest_vlan_id') is not None: + new_object_params['guestVlanId'] = self.new_object.get('guestVlanId') or \ + self.new_object.get('guest_vlan_id') + if self.new_object.get('hostMode') is not None or self.new_object.get('host_mode') is not None: + new_object_params['hostMode'] = self.new_object.get('hostMode') or \ + self.new_object.get('host_mode') + if self.new_object.get('increaseAccessSpeed') is not None or self.new_object.get('increase_access_speed') is not None: + new_object_params['increaseAccessSpeed'] = self.new_object.get('increaseAccessSpeed') if self.new_object.get('name') is not None or self.new_object.get('name') is not None: new_object_params['name'] = self.new_object.get('name') or \ self.new_object.get('name') - if self.new_object.get('radiusServers') is not None or self.new_object.get('radius_servers') is not None: - new_object_params['radiusServers'] = self.new_object.get('radiusServers') or \ - self.new_object.get('radius_servers') if self.new_object.get('radius') is not None or self.new_object.get('radius') is not None: new_object_params['radius'] = self.new_object.get('radius') or \ self.new_object.get('radius') - if self.new_object.get('guestPortBouncing') is not None or self.new_object.get('guest_port_bouncing') is not None: - new_object_params['guestPortBouncing'] = self.new_object.get( - 'guestPortBouncing') - if self.new_object.get('radiusTestingEnabled') is not None or self.new_object.get('radius_testing_enabled') is not None: - new_object_params['radiusTestingEnabled'] = self.new_object.get( - 'radiusTestingEnabled') - if self.new_object.get('radiusCoaSupportEnabled') is not None or self.new_object.get('radius_coa_support_enabled') is not None: - new_object_params['radiusCoaSupportEnabled'] = self.new_object.get( - 'radiusCoaSupportEnabled') if self.new_object.get('radiusAccountingEnabled') is not None or self.new_object.get('radius_accounting_enabled') is not None: - new_object_params['radiusAccountingEnabled'] = self.new_object.get( - 'radiusAccountingEnabled') + new_object_params['radiusAccountingEnabled'] = self.new_object.get('radiusAccountingEnabled') if self.new_object.get('radiusAccountingServers') is not None or self.new_object.get('radius_accounting_servers') is not None: new_object_params['radiusAccountingServers'] = self.new_object.get('radiusAccountingServers') or \ self.new_object.get('radius_accounting_servers') + if self.new_object.get('radiusCoaSupportEnabled') is not None or self.new_object.get('radius_coa_support_enabled') is not None: + new_object_params['radiusCoaSupportEnabled'] = self.new_object.get('radiusCoaSupportEnabled') if self.new_object.get('radiusGroupAttribute') is not None or self.new_object.get('radius_group_attribute') is not None: new_object_params['radiusGroupAttribute'] = self.new_object.get('radiusGroupAttribute') or \ self.new_object.get('radius_group_attribute') - if self.new_object.get('hostMode') is not None or self.new_object.get('host_mode') is not None: - new_object_params['hostMode'] = self.new_object.get('hostMode') or \ - self.new_object.get('host_mode') - if self.new_object.get('accessPolicyType') is not None or self.new_object.get('access_policy_type') is not None: - new_object_params['accessPolicyType'] = self.new_object.get('accessPolicyType') or \ - self.new_object.get('access_policy_type') - if self.new_object.get('increaseAccessSpeed') is not None or self.new_object.get('increase_access_speed') is not None: - new_object_params['increaseAccessSpeed'] = self.new_object.get( - 'increaseAccessSpeed') - if self.new_object.get('guestVlanId') is not None or self.new_object.get('guest_vlan_id') is not None: - new_object_params['guestVlanId'] = self.new_object.get('guestVlanId') or \ - self.new_object.get('guest_vlan_id') - if self.new_object.get('dot1x') is not None or self.new_object.get('dot1x') is not None: - new_object_params['dot1x'] = self.new_object.get('dot1x') or \ - self.new_object.get('dot1x') - if self.new_object.get('voiceVlanClients') is not None or self.new_object.get('voice_vlan_clients') is not None: - new_object_params['voiceVlanClients'] = self.new_object.get( - 'voiceVlanClients') + if self.new_object.get('radiusServers') is not None or self.new_object.get('radius_servers') is not None: + new_object_params['radiusServers'] = self.new_object.get('radiusServers') or \ + self.new_object.get('radius_servers') + if self.new_object.get('radiusTestingEnabled') is not None or self.new_object.get('radius_testing_enabled') is not None: + new_object_params['radiusTestingEnabled'] = self.new_object.get('radiusTestingEnabled') if self.new_object.get('urlRedirectWalledGardenEnabled') is not None or self.new_object.get('url_redirect_walled_garden_enabled') is not None: - new_object_params['urlRedirectWalledGardenEnabled'] = self.new_object.get( - 'urlRedirectWalledGardenEnabled') + new_object_params['urlRedirectWalledGardenEnabled'] = self.new_object.get('urlRedirectWalledGardenEnabled') if self.new_object.get('urlRedirectWalledGardenRanges') is not None or self.new_object.get('url_redirect_walled_garden_ranges') is not None: new_object_params['urlRedirectWalledGardenRanges'] = self.new_object.get('urlRedirectWalledGardenRanges') or \ self.new_object.get('url_redirect_walled_garden_ranges') + if self.new_object.get('voiceVlanClients') is not None or self.new_object.get('voice_vlan_clients') is not None: + new_object_params['voiceVlanClients'] = self.new_object.get('voiceVlanClients') if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: new_object_params['networkId'] = self.new_object.get('networkId') or \ self.new_object.get('network_id') @@ -176,57 +167,50 @@ class NetworksSwitchAccessPolicies(object): def update_by_id_params(self): new_object_params = {} + if self.new_object.get('accessPolicyType') is not None or self.new_object.get('access_policy_type') is not None: + new_object_params['accessPolicyType'] = self.new_object.get('accessPolicyType') or \ + self.new_object.get('access_policy_type') + if self.new_object.get('dot1x') is not None or self.new_object.get('dot1x') is not None: + new_object_params['dot1x'] = self.new_object.get('dot1x') or \ + self.new_object.get('dot1x') + if self.new_object.get('guestPortBouncing') is not None or self.new_object.get('guest_port_bouncing') is not None: + new_object_params['guestPortBouncing'] = self.new_object.get('guestPortBouncing') + if self.new_object.get('guestVlanId') is not None or self.new_object.get('guest_vlan_id') is not None: + new_object_params['guestVlanId'] = self.new_object.get('guestVlanId') or \ + self.new_object.get('guest_vlan_id') + if self.new_object.get('hostMode') is not None or self.new_object.get('host_mode') is not None: + new_object_params['hostMode'] = self.new_object.get('hostMode') or \ + self.new_object.get('host_mode') + if self.new_object.get('increaseAccessSpeed') is not None or self.new_object.get('increase_access_speed') is not None: + new_object_params['increaseAccessSpeed'] = self.new_object.get('increaseAccessSpeed') if self.new_object.get('name') is not None or self.new_object.get('name') is not None: new_object_params['name'] = self.new_object.get('name') or \ self.new_object.get('name') - if self.new_object.get('radiusServers') is not None or self.new_object.get('radius_servers') is not None: - new_object_params['radiusServers'] = self.new_object.get('radiusServers') or \ - self.new_object.get('radius_servers') if self.new_object.get('radius') is not None or self.new_object.get('radius') is not None: new_object_params['radius'] = self.new_object.get('radius') or \ self.new_object.get('radius') - if self.new_object.get('guestPortBouncing') is not None or self.new_object.get('guest_port_bouncing') is not None: - new_object_params['guestPortBouncing'] = self.new_object.get( - 'guestPortBouncing') - if self.new_object.get('radiusTestingEnabled') is not None or self.new_object.get('radius_testing_enabled') is not None: - new_object_params['radiusTestingEnabled'] = self.new_object.get( - 'radiusTestingEnabled') - if self.new_object.get('radiusCoaSupportEnabled') is not None or self.new_object.get('radius_coa_support_enabled') is not None: - new_object_params['radiusCoaSupportEnabled'] = self.new_object.get( - 'radiusCoaSupportEnabled') if self.new_object.get('radiusAccountingEnabled') is not None or self.new_object.get('radius_accounting_enabled') is not None: - new_object_params['radiusAccountingEnabled'] = self.new_object.get( - 'radiusAccountingEnabled') + new_object_params['radiusAccountingEnabled'] = self.new_object.get('radiusAccountingEnabled') if self.new_object.get('radiusAccountingServers') is not None or self.new_object.get('radius_accounting_servers') is not None: new_object_params['radiusAccountingServers'] = self.new_object.get('radiusAccountingServers') or \ self.new_object.get('radius_accounting_servers') + if self.new_object.get('radiusCoaSupportEnabled') is not None or self.new_object.get('radius_coa_support_enabled') is not None: + new_object_params['radiusCoaSupportEnabled'] = self.new_object.get('radiusCoaSupportEnabled') if self.new_object.get('radiusGroupAttribute') is not None or self.new_object.get('radius_group_attribute') is not None: new_object_params['radiusGroupAttribute'] = self.new_object.get('radiusGroupAttribute') or \ self.new_object.get('radius_group_attribute') - if self.new_object.get('hostMode') is not None or self.new_object.get('host_mode') is not None: - new_object_params['hostMode'] = self.new_object.get('hostMode') or \ - self.new_object.get('host_mode') - if self.new_object.get('accessPolicyType') is not None or self.new_object.get('access_policy_type') is not None: - new_object_params['accessPolicyType'] = self.new_object.get('accessPolicyType') or \ - self.new_object.get('access_policy_type') - if self.new_object.get('increaseAccessSpeed') is not None or self.new_object.get('increase_access_speed') is not None: - new_object_params['increaseAccessSpeed'] = self.new_object.get( - 'increaseAccessSpeed') - if self.new_object.get('guestVlanId') is not None or self.new_object.get('guest_vlan_id') is not None: - new_object_params['guestVlanId'] = self.new_object.get('guestVlanId') or \ - self.new_object.get('guest_vlan_id') - if self.new_object.get('dot1x') is not None or self.new_object.get('dot1x') is not None: - new_object_params['dot1x'] = self.new_object.get('dot1x') or \ - self.new_object.get('dot1x') - if self.new_object.get('voiceVlanClients') is not None or self.new_object.get('voice_vlan_clients') is not None: - new_object_params['voiceVlanClients'] = self.new_object.get( - 'voiceVlanClients') + if self.new_object.get('radiusServers') is not None or self.new_object.get('radius_servers') is not None: + new_object_params['radiusServers'] = self.new_object.get('radiusServers') or \ + self.new_object.get('radius_servers') + if self.new_object.get('radiusTestingEnabled') is not None or self.new_object.get('radius_testing_enabled') is not None: + new_object_params['radiusTestingEnabled'] = self.new_object.get('radiusTestingEnabled') if self.new_object.get('urlRedirectWalledGardenEnabled') is not None or self.new_object.get('url_redirect_walled_garden_enabled') is not None: - new_object_params['urlRedirectWalledGardenEnabled'] = self.new_object.get( - 'urlRedirectWalledGardenEnabled') + new_object_params['urlRedirectWalledGardenEnabled'] = self.new_object.get('urlRedirectWalledGardenEnabled') if self.new_object.get('urlRedirectWalledGardenRanges') is not None or self.new_object.get('url_redirect_walled_garden_ranges') is not None: new_object_params['urlRedirectWalledGardenRanges'] = self.new_object.get('urlRedirectWalledGardenRanges') or \ self.new_object.get('url_redirect_walled_garden_ranges') + if self.new_object.get('voiceVlanClients') is not None or self.new_object.get('voice_vlan_clients') is not None: + new_object_params['voiceVlanClients'] = self.new_object.get('voiceVlanClients') if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: new_object_params['networkId'] = self.new_object.get('networkId') or \ self.new_object.get('network_id') @@ -304,23 +288,23 @@ class NetworksSwitchAccessPolicies(object): requested_obj = self.new_object obj_params = [ + ("accessPolicyType", "accessPolicyType"), + ("dot1x", "dot1x"), + ("guestPortBouncing", "guestPortBouncing"), + ("guestVlanId", "guestVlanId"), + ("hostMode", "hostMode"), + ("increaseAccessSpeed", "increaseAccessSpeed"), ("name", "name"), - ("radiusServers", "radiusServers"), ("radius", "radius"), - ("guestPortBouncing", "guestPortBouncing"), - ("radiusTestingEnabled", "radiusTestingEnabled"), - ("radiusCoaSupportEnabled", "radiusCoaSupportEnabled"), ("radiusAccountingEnabled", "radiusAccountingEnabled"), ("radiusAccountingServers", "radiusAccountingServers"), + ("radiusCoaSupportEnabled", "radiusCoaSupportEnabled"), ("radiusGroupAttribute", "radiusGroupAttribute"), - ("hostMode", "hostMode"), - ("accessPolicyType", "accessPolicyType"), - ("increaseAccessSpeed", "increaseAccessSpeed"), - ("guestVlanId", "guestVlanId"), - ("dot1x", "dot1x"), - ("voiceVlanClients", "voiceVlanClients"), + ("radiusServers", "radiusServers"), + ("radiusTestingEnabled", "radiusTestingEnabled"), ("urlRedirectWalledGardenEnabled", "urlRedirectWalledGardenEnabled"), ("urlRedirectWalledGardenRanges", "urlRedirectWalledGardenRanges"), + ("voiceVlanClients", "voiceVlanClients"), ("networkId", "networkId"), ("accessPolicyNumber", "accessPolicyNumber"), ] diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_switch_alternate_management_interface.py b/ansible_collections/cisco/meraki/plugins/action/networks_switch_alternate_management_interface.py index 7fd38d4f3..02d8d2c0c 100644 --- a/ansible_collections/cisco/meraki/plugins/action/networks_switch_alternate_management_interface.py +++ b/ansible_collections/cisco/meraki/plugins/action/networks_switch_alternate_management_interface.py @@ -33,9 +33,9 @@ argument_spec = meraki_argument_spec() argument_spec.update(dict( state=dict(type="str", default="present", choices=["present"]), enabled=dict(type="bool"), - vlanId=dict(type="int"), protocols=dict(type="list"), switches=dict(type="list"), + vlanId=dict(type="int"), networkId=dict(type="str"), )) @@ -52,9 +52,9 @@ class NetworksSwitchAlternateManagementInterface(object): self.meraki = meraki self.new_object = dict( enabled=params.get("enabled"), - vlanId=params.get("vlanId"), protocols=params.get("protocols"), switches=params.get("switches"), + vlanId=params.get("vlanId"), network_id=params.get("networkId"), ) @@ -69,15 +69,15 @@ class NetworksSwitchAlternateManagementInterface(object): new_object_params = {} if self.new_object.get('enabled') is not None or self.new_object.get('enabled') is not None: new_object_params['enabled'] = self.new_object.get('enabled') - if self.new_object.get('vlanId') is not None or self.new_object.get('vlan_id') is not None: - new_object_params['vlanId'] = self.new_object.get('vlanId') or \ - self.new_object.get('vlan_id') if self.new_object.get('protocols') is not None or self.new_object.get('protocols') is not None: new_object_params['protocols'] = self.new_object.get('protocols') or \ self.new_object.get('protocols') if self.new_object.get('switches') is not None or self.new_object.get('switches') is not None: new_object_params['switches'] = self.new_object.get('switches') or \ self.new_object.get('switches') + if self.new_object.get('vlanId') is not None or self.new_object.get('vlan_id') is not None: + new_object_params['vlanId'] = self.new_object.get('vlanId') or \ + self.new_object.get('vlan_id') if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: new_object_params['networkId'] = self.new_object.get('networkId') or \ self.new_object.get('network_id') @@ -135,9 +135,9 @@ class NetworksSwitchAlternateManagementInterface(object): obj_params = [ ("enabled", "enabled"), - ("vlanId", "vlanId"), ("protocols", "protocols"), ("switches", "switches"), + ("vlanId", "vlanId"), ("networkId", "networkId"), ] # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_switch_dhcp_server_policy.py b/ansible_collections/cisco/meraki/plugins/action/networks_switch_dhcp_server_policy.py index 70dae83da..4e3434058 100644 --- a/ansible_collections/cisco/meraki/plugins/action/networks_switch_dhcp_server_policy.py +++ b/ansible_collections/cisco/meraki/plugins/action/networks_switch_dhcp_server_policy.py @@ -33,10 +33,10 @@ argument_spec = meraki_argument_spec() argument_spec.update(dict( state=dict(type="str", default="present", choices=["present"]), alerts=dict(type="dict"), - defaultPolicy=dict(type="str"), allowedServers=dict(type="list"), - blockedServers=dict(type="list"), arpInspection=dict(type="dict"), + blockedServers=dict(type="list"), + defaultPolicy=dict(type="str"), networkId=dict(type="str"), )) @@ -53,10 +53,10 @@ class NetworksSwitchDhcpServerPolicy(object): self.meraki = meraki self.new_object = dict( alerts=params.get("alerts"), - defaultPolicy=params.get("defaultPolicy"), allowedServers=params.get("allowedServers"), - blockedServers=params.get("blockedServers"), arpInspection=params.get("arpInspection"), + blockedServers=params.get("blockedServers"), + defaultPolicy=params.get("defaultPolicy"), network_id=params.get("networkId"), ) @@ -72,18 +72,18 @@ class NetworksSwitchDhcpServerPolicy(object): if self.new_object.get('alerts') is not None or self.new_object.get('alerts') is not None: new_object_params['alerts'] = self.new_object.get('alerts') or \ self.new_object.get('alerts') - if self.new_object.get('defaultPolicy') is not None or self.new_object.get('default_policy') is not None: - new_object_params['defaultPolicy'] = self.new_object.get('defaultPolicy') or \ - self.new_object.get('default_policy') if self.new_object.get('allowedServers') is not None or self.new_object.get('allowed_servers') is not None: new_object_params['allowedServers'] = self.new_object.get('allowedServers') or \ self.new_object.get('allowed_servers') - if self.new_object.get('blockedServers') is not None or self.new_object.get('blocked_servers') is not None: - new_object_params['blockedServers'] = self.new_object.get('blockedServers') or \ - self.new_object.get('blocked_servers') if self.new_object.get('arpInspection') is not None or self.new_object.get('arp_inspection') is not None: new_object_params['arpInspection'] = self.new_object.get('arpInspection') or \ self.new_object.get('arp_inspection') + if self.new_object.get('blockedServers') is not None or self.new_object.get('blocked_servers') is not None: + new_object_params['blockedServers'] = self.new_object.get('blockedServers') or \ + self.new_object.get('blocked_servers') + if self.new_object.get('defaultPolicy') is not None or self.new_object.get('default_policy') is not None: + new_object_params['defaultPolicy'] = self.new_object.get('defaultPolicy') or \ + self.new_object.get('default_policy') if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: new_object_params['networkId'] = self.new_object.get('networkId') or \ self.new_object.get('network_id') @@ -141,10 +141,10 @@ class NetworksSwitchDhcpServerPolicy(object): obj_params = [ ("alerts", "alerts"), - ("defaultPolicy", "defaultPolicy"), ("allowedServers", "allowedServers"), - ("blockedServers", "blockedServers"), ("arpInspection", "arpInspection"), + ("blockedServers", "blockedServers"), + ("defaultPolicy", "defaultPolicy"), ("networkId", "networkId"), ] # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_switch_dhcp_server_policy_arp_inspection_trusted_servers.py b/ansible_collections/cisco/meraki/plugins/action/networks_switch_dhcp_server_policy_arp_inspection_trusted_servers.py index d0bd4b120..e6110049d 100644 --- a/ansible_collections/cisco/meraki/plugins/action/networks_switch_dhcp_server_policy_arp_inspection_trusted_servers.py +++ b/ansible_collections/cisco/meraki/plugins/action/networks_switch_dhcp_server_policy_arp_inspection_trusted_servers.py @@ -32,9 +32,9 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present", "absent"]), + ipv4=dict(type="dict"), mac=dict(type="str"), vlan=dict(type="int"), - ipv4=dict(type="dict"), networkId=dict(type="str"), trustedServerId=dict(type="str"), )) @@ -52,9 +52,9 @@ class NetworksSwitchDhcpServerPolicyArpInspectionTrustedServers(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( + ipv4=params.get("ipv4"), mac=params.get("mac"), vlan=params.get("vlan"), - ipv4=params.get("ipv4"), networkId=params.get("networkId"), trustedServerId=params.get("trustedServerId"), ) @@ -78,15 +78,15 @@ class NetworksSwitchDhcpServerPolicyArpInspectionTrustedServers(object): def create_params(self): new_object_params = {} + if self.new_object.get('ipv4') is not None or self.new_object.get('ipv4') is not None: + new_object_params['ipv4'] = self.new_object.get('ipv4') or \ + self.new_object.get('ipv4') if self.new_object.get('mac') is not None or self.new_object.get('mac') is not None: new_object_params['mac'] = self.new_object.get('mac') or \ self.new_object.get('mac') if self.new_object.get('vlan') is not None or self.new_object.get('vlan') is not None: new_object_params['vlan'] = self.new_object.get('vlan') or \ self.new_object.get('vlan') - if self.new_object.get('ipv4') is not None or self.new_object.get('ipv4') is not None: - new_object_params['ipv4'] = self.new_object.get('ipv4') or \ - self.new_object.get('ipv4') if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: new_object_params['networkId'] = self.new_object.get('networkId') or \ self.new_object.get('network_id') @@ -104,15 +104,15 @@ class NetworksSwitchDhcpServerPolicyArpInspectionTrustedServers(object): def update_by_id_params(self): new_object_params = {} + if self.new_object.get('ipv4') is not None or self.new_object.get('ipv4') is not None: + new_object_params['ipv4'] = self.new_object.get('ipv4') or \ + self.new_object.get('ipv4') if self.new_object.get('mac') is not None or self.new_object.get('mac') is not None: new_object_params['mac'] = self.new_object.get('mac') or \ self.new_object.get('mac') if self.new_object.get('vlan') is not None or self.new_object.get('vlan') is not None: new_object_params['vlan'] = self.new_object.get('vlan') or \ self.new_object.get('vlan') - if self.new_object.get('ipv4') is not None or self.new_object.get('ipv4') is not None: - new_object_params['ipv4'] = self.new_object.get('ipv4') or \ - self.new_object.get('ipv4') if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: new_object_params['networkId'] = self.new_object.get('networkId') or \ self.new_object.get('network_id') @@ -189,9 +189,9 @@ class NetworksSwitchDhcpServerPolicyArpInspectionTrustedServers(object): requested_obj = self.new_object obj_params = [ + ("ipv4", "ipv4"), ("mac", "mac"), ("vlan", "vlan"), - ("ipv4", "ipv4"), ("networkId", "networkId"), ("trustedServerId", "trustedServerId"), ] diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_switch_qos_rules_order.py b/ansible_collections/cisco/meraki/plugins/action/networks_switch_qos_rules_order.py index 33841d11c..430d78211 100644 --- a/ansible_collections/cisco/meraki/plugins/action/networks_switch_qos_rules_order.py +++ b/ansible_collections/cisco/meraki/plugins/action/networks_switch_qos_rules_order.py @@ -32,13 +32,13 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present", "absent"]), - vlan=dict(type="int"), + dscp=dict(type="int"), + dstPort=dict(type="int"), + dstPortRange=dict(type="str"), protocol=dict(type="str"), srcPort=dict(type="int"), srcPortRange=dict(type="str"), - dstPort=dict(type="int"), - dstPortRange=dict(type="str"), - dscp=dict(type="int"), + vlan=dict(type="int"), networkId=dict(type="str"), qosRuleId=dict(type="str"), )) @@ -56,13 +56,13 @@ class NetworksSwitchQosRulesOrder(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( - vlan=params.get("vlan"), + dscp=params.get("dscp"), + dstPort=params.get("dstPort"), + dstPortRange=params.get("dstPortRange"), protocol=params.get("protocol"), srcPort=params.get("srcPort"), srcPortRange=params.get("srcPortRange"), - dstPort=params.get("dstPort"), - dstPortRange=params.get("dstPortRange"), - dscp=params.get("dscp"), + vlan=params.get("vlan"), networkId=params.get("networkId"), qosRuleId=params.get("qosRuleId"), ) @@ -86,9 +86,15 @@ class NetworksSwitchQosRulesOrder(object): def create_params(self): new_object_params = {} - if self.new_object.get('vlan') is not None or self.new_object.get('vlan') is not None: - new_object_params['vlan'] = self.new_object.get('vlan') or \ - self.new_object.get('vlan') + if self.new_object.get('dscp') is not None or self.new_object.get('dscp') is not None: + new_object_params['dscp'] = self.new_object.get('dscp') or \ + self.new_object.get('dscp') + if self.new_object.get('dstPort') is not None or self.new_object.get('dst_port') is not None: + new_object_params['dstPort'] = self.new_object.get('dstPort') or \ + self.new_object.get('dst_port') + if self.new_object.get('dstPortRange') is not None or self.new_object.get('dst_port_range') is not None: + new_object_params['dstPortRange'] = self.new_object.get('dstPortRange') or \ + self.new_object.get('dst_port_range') if self.new_object.get('protocol') is not None or self.new_object.get('protocol') is not None: new_object_params['protocol'] = self.new_object.get('protocol') or \ self.new_object.get('protocol') @@ -98,15 +104,9 @@ class NetworksSwitchQosRulesOrder(object): if self.new_object.get('srcPortRange') is not None or self.new_object.get('src_port_range') is not None: new_object_params['srcPortRange'] = self.new_object.get('srcPortRange') or \ self.new_object.get('src_port_range') - if self.new_object.get('dstPort') is not None or self.new_object.get('dst_port') is not None: - new_object_params['dstPort'] = self.new_object.get('dstPort') or \ - self.new_object.get('dst_port') - if self.new_object.get('dstPortRange') is not None or self.new_object.get('dst_port_range') is not None: - new_object_params['dstPortRange'] = self.new_object.get('dstPortRange') or \ - self.new_object.get('dst_port_range') - if self.new_object.get('dscp') is not None or self.new_object.get('dscp') is not None: - new_object_params['dscp'] = self.new_object.get('dscp') or \ - self.new_object.get('dscp') + if self.new_object.get('vlan') is not None or self.new_object.get('vlan') is not None: + new_object_params['vlan'] = self.new_object.get('vlan') or \ + self.new_object.get('vlan') if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: new_object_params['networkId'] = self.new_object.get('networkId') or \ self.new_object.get('network_id') @@ -124,9 +124,15 @@ class NetworksSwitchQosRulesOrder(object): def update_by_id_params(self): new_object_params = {} - if self.new_object.get('vlan') is not None or self.new_object.get('vlan') is not None: - new_object_params['vlan'] = self.new_object.get('vlan') or \ - self.new_object.get('vlan') + if self.new_object.get('dscp') is not None or self.new_object.get('dscp') is not None: + new_object_params['dscp'] = self.new_object.get('dscp') or \ + self.new_object.get('dscp') + if self.new_object.get('dstPort') is not None or self.new_object.get('dst_port') is not None: + new_object_params['dstPort'] = self.new_object.get('dstPort') or \ + self.new_object.get('dst_port') + if self.new_object.get('dstPortRange') is not None or self.new_object.get('dst_port_range') is not None: + new_object_params['dstPortRange'] = self.new_object.get('dstPortRange') or \ + self.new_object.get('dst_port_range') if self.new_object.get('protocol') is not None or self.new_object.get('protocol') is not None: new_object_params['protocol'] = self.new_object.get('protocol') or \ self.new_object.get('protocol') @@ -136,15 +142,9 @@ class NetworksSwitchQosRulesOrder(object): if self.new_object.get('srcPortRange') is not None or self.new_object.get('src_port_range') is not None: new_object_params['srcPortRange'] = self.new_object.get('srcPortRange') or \ self.new_object.get('src_port_range') - if self.new_object.get('dstPort') is not None or self.new_object.get('dst_port') is not None: - new_object_params['dstPort'] = self.new_object.get('dstPort') or \ - self.new_object.get('dst_port') - if self.new_object.get('dstPortRange') is not None or self.new_object.get('dst_port_range') is not None: - new_object_params['dstPortRange'] = self.new_object.get('dstPortRange') or \ - self.new_object.get('dst_port_range') - if self.new_object.get('dscp') is not None or self.new_object.get('dscp') is not None: - new_object_params['dscp'] = self.new_object.get('dscp') or \ - self.new_object.get('dscp') + if self.new_object.get('vlan') is not None or self.new_object.get('vlan') is not None: + new_object_params['vlan'] = self.new_object.get('vlan') or \ + self.new_object.get('vlan') if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: new_object_params['networkId'] = self.new_object.get('networkId') or \ self.new_object.get('network_id') @@ -222,13 +222,13 @@ class NetworksSwitchQosRulesOrder(object): requested_obj = self.new_object obj_params = [ - ("vlan", "vlan"), + ("dscp", "dscp"), + ("dstPort", "dstPort"), + ("dstPortRange", "dstPortRange"), ("protocol", "protocol"), ("srcPort", "srcPort"), ("srcPortRange", "srcPortRange"), - ("dstPort", "dstPort"), - ("dstPortRange", "dstPortRange"), - ("dscp", "dscp"), + ("vlan", "vlan"), ("networkId", "networkId"), ("qosRuleId", "qosRuleId"), ] diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_switch_routing_ospf.py b/ansible_collections/cisco/meraki/plugins/action/networks_switch_routing_ospf.py index ec0eed0ee..aa72b735c 100644 --- a/ansible_collections/cisco/meraki/plugins/action/networks_switch_routing_ospf.py +++ b/ansible_collections/cisco/meraki/plugins/action/networks_switch_routing_ospf.py @@ -32,13 +32,13 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present"]), + areas=dict(type="list"), + deadTimerInSeconds=dict(type="int"), enabled=dict(type="bool"), helloTimerInSeconds=dict(type="int"), - deadTimerInSeconds=dict(type="int"), - areas=dict(type="list"), - v3=dict(type="dict"), md5AuthenticationEnabled=dict(type="bool"), md5AuthenticationKey=dict(type="dict"), + v3=dict(type="dict"), networkId=dict(type="str"), )) @@ -54,13 +54,13 @@ class NetworksSwitchRoutingOspf(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( + areas=params.get("areas"), + deadTimerInSeconds=params.get("deadTimerInSeconds"), enabled=params.get("enabled"), helloTimerInSeconds=params.get("helloTimerInSeconds"), - deadTimerInSeconds=params.get("deadTimerInSeconds"), - areas=params.get("areas"), - v3=params.get("v3"), md5AuthenticationEnabled=params.get("md5AuthenticationEnabled"), md5AuthenticationKey=params.get("md5AuthenticationKey"), + v3=params.get("v3"), network_id=params.get("networkId"), ) @@ -73,25 +73,25 @@ class NetworksSwitchRoutingOspf(object): def update_all_params(self): new_object_params = {} + if self.new_object.get('areas') is not None or self.new_object.get('areas') is not None: + new_object_params['areas'] = self.new_object.get('areas') or \ + self.new_object.get('areas') + if self.new_object.get('deadTimerInSeconds') is not None or self.new_object.get('dead_timer_in_seconds') is not None: + new_object_params['deadTimerInSeconds'] = self.new_object.get('deadTimerInSeconds') or \ + self.new_object.get('dead_timer_in_seconds') if self.new_object.get('enabled') is not None or self.new_object.get('enabled') is not None: new_object_params['enabled'] = self.new_object.get('enabled') if self.new_object.get('helloTimerInSeconds') is not None or self.new_object.get('hello_timer_in_seconds') is not None: new_object_params['helloTimerInSeconds'] = self.new_object.get('helloTimerInSeconds') or \ self.new_object.get('hello_timer_in_seconds') - if self.new_object.get('deadTimerInSeconds') is not None or self.new_object.get('dead_timer_in_seconds') is not None: - new_object_params['deadTimerInSeconds'] = self.new_object.get('deadTimerInSeconds') or \ - self.new_object.get('dead_timer_in_seconds') - if self.new_object.get('areas') is not None or self.new_object.get('areas') is not None: - new_object_params['areas'] = self.new_object.get('areas') or \ - self.new_object.get('areas') - if self.new_object.get('v3') is not None or self.new_object.get('v3') is not None: - new_object_params['v3'] = self.new_object.get('v3') or \ - self.new_object.get('v3') if self.new_object.get('md5AuthenticationEnabled') is not None or self.new_object.get('md5_authentication_enabled') is not None: new_object_params['md5AuthenticationEnabled'] = self.new_object.get('md5AuthenticationEnabled') if self.new_object.get('md5AuthenticationKey') is not None or self.new_object.get('md5_authentication_key') is not None: new_object_params['md5AuthenticationKey'] = self.new_object.get('md5AuthenticationKey') or \ self.new_object.get('md5_authentication_key') + if self.new_object.get('v3') is not None or self.new_object.get('v3') is not None: + new_object_params['v3'] = self.new_object.get('v3') or \ + self.new_object.get('v3') if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: new_object_params['networkId'] = self.new_object.get('networkId') or \ self.new_object.get('network_id') @@ -148,13 +148,13 @@ class NetworksSwitchRoutingOspf(object): requested_obj = self.new_object obj_params = [ + ("areas", "areas"), + ("deadTimerInSeconds", "deadTimerInSeconds"), ("enabled", "enabled"), ("helloTimerInSeconds", "helloTimerInSeconds"), - ("deadTimerInSeconds", "deadTimerInSeconds"), - ("areas", "areas"), - ("v3", "v3"), ("md5AuthenticationEnabled", "md5AuthenticationEnabled"), ("md5AuthenticationKey", "md5AuthenticationKey"), + ("v3", "v3"), ("networkId", "networkId"), ] # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_switch_settings.py b/ansible_collections/cisco/meraki/plugins/action/networks_switch_settings.py index 65ae85bab..66664b957 100644 --- a/ansible_collections/cisco/meraki/plugins/action/networks_switch_settings.py +++ b/ansible_collections/cisco/meraki/plugins/action/networks_switch_settings.py @@ -32,9 +32,11 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present"]), - vlan=dict(type="int"), - useCombinedPower=dict(type="bool"), + macBlocklist=dict(type="dict"), powerExceptions=dict(type="list"), + uplinkClientSampling=dict(type="dict"), + useCombinedPower=dict(type="bool"), + vlan=dict(type="int"), networkId=dict(type="str"), )) @@ -50,9 +52,11 @@ class NetworksSwitchSettings(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( - vlan=params.get("vlan"), - useCombinedPower=params.get("useCombinedPower"), + macBlocklist=params.get("macBlocklist"), powerExceptions=params.get("powerExceptions"), + uplinkClientSampling=params.get("uplinkClientSampling"), + useCombinedPower=params.get("useCombinedPower"), + vlan=params.get("vlan"), network_id=params.get("networkId"), ) @@ -65,14 +69,20 @@ class NetworksSwitchSettings(object): def update_all_params(self): new_object_params = {} - if self.new_object.get('vlan') is not None or self.new_object.get('vlan') is not None: - new_object_params['vlan'] = self.new_object.get('vlan') or \ - self.new_object.get('vlan') - if self.new_object.get('useCombinedPower') is not None or self.new_object.get('use_combined_power') is not None: - new_object_params['useCombinedPower'] = self.new_object.get('useCombinedPower') + if self.new_object.get('macBlocklist') is not None or self.new_object.get('mac_blocklist') is not None: + new_object_params['macBlocklist'] = self.new_object.get('macBlocklist') or \ + self.new_object.get('mac_blocklist') if self.new_object.get('powerExceptions') is not None or self.new_object.get('power_exceptions') is not None: new_object_params['powerExceptions'] = self.new_object.get('powerExceptions') or \ self.new_object.get('power_exceptions') + if self.new_object.get('uplinkClientSampling') is not None or self.new_object.get('uplink_client_sampling') is not None: + new_object_params['uplinkClientSampling'] = self.new_object.get('uplinkClientSampling') or \ + self.new_object.get('uplink_client_sampling') + if self.new_object.get('useCombinedPower') is not None or self.new_object.get('use_combined_power') is not None: + new_object_params['useCombinedPower'] = self.new_object.get('useCombinedPower') + if self.new_object.get('vlan') is not None or self.new_object.get('vlan') is not None: + new_object_params['vlan'] = self.new_object.get('vlan') or \ + self.new_object.get('vlan') if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: new_object_params['networkId'] = self.new_object.get('networkId') or \ self.new_object.get('network_id') @@ -129,9 +139,11 @@ class NetworksSwitchSettings(object): requested_obj = self.new_object obj_params = [ - ("vlan", "vlan"), - ("useCombinedPower", "useCombinedPower"), + ("macBlocklist", "macBlocklist"), ("powerExceptions", "powerExceptions"), + ("uplinkClientSampling", "uplinkClientSampling"), + ("useCombinedPower", "useCombinedPower"), + ("vlan", "vlan"), ("networkId", "networkId"), ] # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_switch_stacks_routing_interfaces.py b/ansible_collections/cisco/meraki/plugins/action/networks_switch_stacks_routing_interfaces.py index 948b77458..e126bce26 100644 --- a/ansible_collections/cisco/meraki/plugins/action/networks_switch_stacks_routing_interfaces.py +++ b/ansible_collections/cisco/meraki/plugins/action/networks_switch_stacks_routing_interfaces.py @@ -32,14 +32,14 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present", "absent"]), - name=dict(type="str"), - subnet=dict(type="str"), + defaultGateway=dict(type="str"), interfaceIp=dict(type="str"), + ipv6=dict(type="dict"), multicastRouting=dict(type="str"), - vlanId=dict(type="int"), - defaultGateway=dict(type="str"), + name=dict(type="str"), ospfSettings=dict(type="dict"), - ipv6=dict(type="dict"), + subnet=dict(type="str"), + vlanId=dict(type="int"), networkId=dict(type="str"), switchStackId=dict(type="str"), interfaceId=dict(type="str"), @@ -58,14 +58,14 @@ class NetworksSwitchStacksRoutingInterfaces(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( - name=params.get("name"), - subnet=params.get("subnet"), + defaultGateway=params.get("defaultGateway"), interfaceIp=params.get("interfaceIp"), + ipv6=params.get("ipv6"), multicastRouting=params.get("multicastRouting"), - vlanId=params.get("vlanId"), - defaultGateway=params.get("defaultGateway"), + name=params.get("name"), ospfSettings=params.get("ospfSettings"), - ipv6=params.get("ipv6"), + subnet=params.get("subnet"), + vlanId=params.get("vlanId"), networkId=params.get("networkId"), switchStackId=params.get("switchStackId"), interfaceId=params.get("interfaceId"), @@ -96,30 +96,30 @@ class NetworksSwitchStacksRoutingInterfaces(object): def create_params(self): new_object_params = {} - if self.new_object.get('name') is not None or self.new_object.get('name') is not None: - new_object_params['name'] = self.new_object.get('name') or \ - self.new_object.get('name') - if self.new_object.get('subnet') is not None or self.new_object.get('subnet') is not None: - new_object_params['subnet'] = self.new_object.get('subnet') or \ - self.new_object.get('subnet') + if self.new_object.get('defaultGateway') is not None or self.new_object.get('default_gateway') is not None: + new_object_params['defaultGateway'] = self.new_object.get('defaultGateway') or \ + self.new_object.get('default_gateway') if self.new_object.get('interfaceIp') is not None or self.new_object.get('interface_ip') is not None: new_object_params['interfaceIp'] = self.new_object.get('interfaceIp') or \ self.new_object.get('interface_ip') + if self.new_object.get('ipv6') is not None or self.new_object.get('ipv6') is not None: + new_object_params['ipv6'] = self.new_object.get('ipv6') or \ + self.new_object.get('ipv6') if self.new_object.get('multicastRouting') is not None or self.new_object.get('multicast_routing') is not None: new_object_params['multicastRouting'] = self.new_object.get('multicastRouting') or \ self.new_object.get('multicast_routing') - if self.new_object.get('vlanId') is not None or self.new_object.get('vlan_id') is not None: - new_object_params['vlanId'] = self.new_object.get('vlanId') or \ - self.new_object.get('vlan_id') - if self.new_object.get('defaultGateway') is not None or self.new_object.get('default_gateway') is not None: - new_object_params['defaultGateway'] = self.new_object.get('defaultGateway') or \ - self.new_object.get('default_gateway') + if self.new_object.get('name') is not None or self.new_object.get('name') is not None: + new_object_params['name'] = self.new_object.get('name') or \ + self.new_object.get('name') if self.new_object.get('ospfSettings') is not None or self.new_object.get('ospf_settings') is not None: new_object_params['ospfSettings'] = self.new_object.get('ospfSettings') or \ self.new_object.get('ospf_settings') - if self.new_object.get('ipv6') is not None or self.new_object.get('ipv6') is not None: - new_object_params['ipv6'] = self.new_object.get('ipv6') or \ - self.new_object.get('ipv6') + if self.new_object.get('subnet') is not None or self.new_object.get('subnet') is not None: + new_object_params['subnet'] = self.new_object.get('subnet') or \ + self.new_object.get('subnet') + if self.new_object.get('vlanId') is not None or self.new_object.get('vlan_id') is not None: + new_object_params['vlanId'] = self.new_object.get('vlanId') or \ + self.new_object.get('vlan_id') if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: new_object_params['networkId'] = self.new_object.get('networkId') or \ self.new_object.get('network_id') @@ -143,30 +143,30 @@ class NetworksSwitchStacksRoutingInterfaces(object): def update_by_id_params(self): new_object_params = {} - if self.new_object.get('name') is not None or self.new_object.get('name') is not None: - new_object_params['name'] = self.new_object.get('name') or \ - self.new_object.get('name') - if self.new_object.get('subnet') is not None or self.new_object.get('subnet') is not None: - new_object_params['subnet'] = self.new_object.get('subnet') or \ - self.new_object.get('subnet') + if self.new_object.get('defaultGateway') is not None or self.new_object.get('default_gateway') is not None: + new_object_params['defaultGateway'] = self.new_object.get('defaultGateway') or \ + self.new_object.get('default_gateway') if self.new_object.get('interfaceIp') is not None or self.new_object.get('interface_ip') is not None: new_object_params['interfaceIp'] = self.new_object.get('interfaceIp') or \ self.new_object.get('interface_ip') + if self.new_object.get('ipv6') is not None or self.new_object.get('ipv6') is not None: + new_object_params['ipv6'] = self.new_object.get('ipv6') or \ + self.new_object.get('ipv6') if self.new_object.get('multicastRouting') is not None or self.new_object.get('multicast_routing') is not None: new_object_params['multicastRouting'] = self.new_object.get('multicastRouting') or \ self.new_object.get('multicast_routing') - if self.new_object.get('vlanId') is not None or self.new_object.get('vlan_id') is not None: - new_object_params['vlanId'] = self.new_object.get('vlanId') or \ - self.new_object.get('vlan_id') - if self.new_object.get('defaultGateway') is not None or self.new_object.get('default_gateway') is not None: - new_object_params['defaultGateway'] = self.new_object.get('defaultGateway') or \ - self.new_object.get('default_gateway') + if self.new_object.get('name') is not None or self.new_object.get('name') is not None: + new_object_params['name'] = self.new_object.get('name') or \ + self.new_object.get('name') if self.new_object.get('ospfSettings') is not None or self.new_object.get('ospf_settings') is not None: new_object_params['ospfSettings'] = self.new_object.get('ospfSettings') or \ self.new_object.get('ospf_settings') - if self.new_object.get('ipv6') is not None or self.new_object.get('ipv6') is not None: - new_object_params['ipv6'] = self.new_object.get('ipv6') or \ - self.new_object.get('ipv6') + if self.new_object.get('subnet') is not None or self.new_object.get('subnet') is not None: + new_object_params['subnet'] = self.new_object.get('subnet') or \ + self.new_object.get('subnet') + if self.new_object.get('vlanId') is not None or self.new_object.get('vlan_id') is not None: + new_object_params['vlanId'] = self.new_object.get('vlanId') or \ + self.new_object.get('vlan_id') if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: new_object_params['networkId'] = self.new_object.get('networkId') or \ self.new_object.get('network_id') @@ -247,14 +247,14 @@ class NetworksSwitchStacksRoutingInterfaces(object): requested_obj = self.new_object obj_params = [ - ("name", "name"), - ("subnet", "subnet"), + ("defaultGateway", "defaultGateway"), ("interfaceIp", "interfaceIp"), + ("ipv6", "ipv6"), ("multicastRouting", "multicastRouting"), - ("vlanId", "vlanId"), - ("defaultGateway", "defaultGateway"), + ("name", "name"), ("ospfSettings", "ospfSettings"), - ("ipv6", "ipv6"), + ("subnet", "subnet"), + ("vlanId", "vlanId"), ("networkId", "networkId"), ("switchStackId", "switchStackId"), ("interfaceId", "interfaceId"), diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_switch_stacks_routing_interfaces_dhcp.py b/ansible_collections/cisco/meraki/plugins/action/networks_switch_stacks_routing_interfaces_dhcp.py index 0127666a5..e1addc98e 100644 --- a/ansible_collections/cisco/meraki/plugins/action/networks_switch_stacks_routing_interfaces_dhcp.py +++ b/ansible_collections/cisco/meraki/plugins/action/networks_switch_stacks_routing_interfaces_dhcp.py @@ -32,17 +32,17 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present"]), + bootFileName=dict(type="str"), + bootNextServer=dict(type="str"), + bootOptionsEnabled=dict(type="bool"), + dhcpLeaseTime=dict(type="str"), dhcpMode=dict(type="str"), + dhcpOptions=dict(type="list"), dhcpRelayServerIps=dict(type="list"), - dhcpLeaseTime=dict(type="str"), - dnsNameserversOption=dict(type="str"), dnsCustomNameservers=dict(type="list"), - bootOptionsEnabled=dict(type="bool"), - bootNextServer=dict(type="str"), - bootFileName=dict(type="str"), - dhcpOptions=dict(type="list"), - reservedIpRanges=dict(type="list"), + dnsNameserversOption=dict(type="str"), fixedIpAssignments=dict(type="list"), + reservedIpRanges=dict(type="list"), networkId=dict(type="str"), switchStackId=dict(type="str"), interfaceId=dict(type="str"), @@ -60,17 +60,17 @@ class NetworksSwitchStacksRoutingInterfacesDhcp(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( + bootFileName=params.get("bootFileName"), + bootNextServer=params.get("bootNextServer"), + bootOptionsEnabled=params.get("bootOptionsEnabled"), + dhcpLeaseTime=params.get("dhcpLeaseTime"), dhcpMode=params.get("dhcpMode"), + dhcpOptions=params.get("dhcpOptions"), dhcpRelayServerIps=params.get("dhcpRelayServerIps"), - dhcpLeaseTime=params.get("dhcpLeaseTime"), - dnsNameserversOption=params.get("dnsNameserversOption"), dnsCustomNameservers=params.get("dnsCustomNameservers"), - bootOptionsEnabled=params.get("bootOptionsEnabled"), - bootNextServer=params.get("bootNextServer"), - bootFileName=params.get("bootFileName"), - dhcpOptions=params.get("dhcpOptions"), - reservedIpRanges=params.get("reservedIpRanges"), + dnsNameserversOption=params.get("dnsNameserversOption"), fixedIpAssignments=params.get("fixedIpAssignments"), + reservedIpRanges=params.get("reservedIpRanges"), network_id=params.get("networkId"), switch_stack_id=params.get("switchStackId"), interface_id=params.get("interfaceId"), @@ -91,38 +91,38 @@ class NetworksSwitchStacksRoutingInterfacesDhcp(object): def update_all_params(self): new_object_params = {} + if self.new_object.get('bootFileName') is not None or self.new_object.get('boot_file_name') is not None: + new_object_params['bootFileName'] = self.new_object.get('bootFileName') or \ + self.new_object.get('boot_file_name') + if self.new_object.get('bootNextServer') is not None or self.new_object.get('boot_next_server') is not None: + new_object_params['bootNextServer'] = self.new_object.get('bootNextServer') or \ + self.new_object.get('boot_next_server') + if self.new_object.get('bootOptionsEnabled') is not None or self.new_object.get('boot_options_enabled') is not None: + new_object_params['bootOptionsEnabled'] = self.new_object.get('bootOptionsEnabled') + if self.new_object.get('dhcpLeaseTime') is not None or self.new_object.get('dhcp_lease_time') is not None: + new_object_params['dhcpLeaseTime'] = self.new_object.get('dhcpLeaseTime') or \ + self.new_object.get('dhcp_lease_time') if self.new_object.get('dhcpMode') is not None or self.new_object.get('dhcp_mode') is not None: new_object_params['dhcpMode'] = self.new_object.get('dhcpMode') or \ self.new_object.get('dhcp_mode') + if self.new_object.get('dhcpOptions') is not None or self.new_object.get('dhcp_options') is not None: + new_object_params['dhcpOptions'] = self.new_object.get('dhcpOptions') or \ + self.new_object.get('dhcp_options') if self.new_object.get('dhcpRelayServerIps') is not None or self.new_object.get('dhcp_relay_server_ips') is not None: new_object_params['dhcpRelayServerIps'] = self.new_object.get('dhcpRelayServerIps') or \ self.new_object.get('dhcp_relay_server_ips') - if self.new_object.get('dhcpLeaseTime') is not None or self.new_object.get('dhcp_lease_time') is not None: - new_object_params['dhcpLeaseTime'] = self.new_object.get('dhcpLeaseTime') or \ - self.new_object.get('dhcp_lease_time') - if self.new_object.get('dnsNameserversOption') is not None or self.new_object.get('dns_nameservers_option') is not None: - new_object_params['dnsNameserversOption'] = self.new_object.get('dnsNameserversOption') or \ - self.new_object.get('dns_nameservers_option') if self.new_object.get('dnsCustomNameservers') is not None or self.new_object.get('dns_custom_nameservers') is not None: new_object_params['dnsCustomNameservers'] = self.new_object.get('dnsCustomNameservers') or \ self.new_object.get('dns_custom_nameservers') - if self.new_object.get('bootOptionsEnabled') is not None or self.new_object.get('boot_options_enabled') is not None: - new_object_params['bootOptionsEnabled'] = self.new_object.get('bootOptionsEnabled') - if self.new_object.get('bootNextServer') is not None or self.new_object.get('boot_next_server') is not None: - new_object_params['bootNextServer'] = self.new_object.get('bootNextServer') or \ - self.new_object.get('boot_next_server') - if self.new_object.get('bootFileName') is not None or self.new_object.get('boot_file_name') is not None: - new_object_params['bootFileName'] = self.new_object.get('bootFileName') or \ - self.new_object.get('boot_file_name') - if self.new_object.get('dhcpOptions') is not None or self.new_object.get('dhcp_options') is not None: - new_object_params['dhcpOptions'] = self.new_object.get('dhcpOptions') or \ - self.new_object.get('dhcp_options') - if self.new_object.get('reservedIpRanges') is not None or self.new_object.get('reserved_ip_ranges') is not None: - new_object_params['reservedIpRanges'] = self.new_object.get('reservedIpRanges') or \ - self.new_object.get('reserved_ip_ranges') + if self.new_object.get('dnsNameserversOption') is not None or self.new_object.get('dns_nameservers_option') is not None: + new_object_params['dnsNameserversOption'] = self.new_object.get('dnsNameserversOption') or \ + self.new_object.get('dns_nameservers_option') if self.new_object.get('fixedIpAssignments') is not None or self.new_object.get('fixed_ip_assignments') is not None: new_object_params['fixedIpAssignments'] = self.new_object.get('fixedIpAssignments') or \ self.new_object.get('fixed_ip_assignments') + if self.new_object.get('reservedIpRanges') is not None or self.new_object.get('reserved_ip_ranges') is not None: + new_object_params['reservedIpRanges'] = self.new_object.get('reservedIpRanges') or \ + self.new_object.get('reserved_ip_ranges') if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: new_object_params['networkId'] = self.new_object.get('networkId') or \ self.new_object.get('network_id') @@ -185,17 +185,17 @@ class NetworksSwitchStacksRoutingInterfacesDhcp(object): requested_obj = self.new_object obj_params = [ + ("bootFileName", "bootFileName"), + ("bootNextServer", "bootNextServer"), + ("bootOptionsEnabled", "bootOptionsEnabled"), + ("dhcpLeaseTime", "dhcpLeaseTime"), ("dhcpMode", "dhcpMode"), + ("dhcpOptions", "dhcpOptions"), ("dhcpRelayServerIps", "dhcpRelayServerIps"), - ("dhcpLeaseTime", "dhcpLeaseTime"), - ("dnsNameserversOption", "dnsNameserversOption"), ("dnsCustomNameservers", "dnsCustomNameservers"), - ("bootOptionsEnabled", "bootOptionsEnabled"), - ("bootNextServer", "bootNextServer"), - ("bootFileName", "bootFileName"), - ("dhcpOptions", "dhcpOptions"), - ("reservedIpRanges", "reservedIpRanges"), + ("dnsNameserversOption", "dnsNameserversOption"), ("fixedIpAssignments", "fixedIpAssignments"), + ("reservedIpRanges", "reservedIpRanges"), ("networkId", "networkId"), ("switchStackId", "switchStackId"), ("interfaceId", "interfaceId"), diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_switch_stacks_routing_static_routes.py b/ansible_collections/cisco/meraki/plugins/action/networks_switch_stacks_routing_static_routes.py index 1ac473570..88d04e931 100644 --- a/ansible_collections/cisco/meraki/plugins/action/networks_switch_stacks_routing_static_routes.py +++ b/ansible_collections/cisco/meraki/plugins/action/networks_switch_stacks_routing_static_routes.py @@ -32,11 +32,11 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present", "absent"]), + advertiseViaOspfEnabled=dict(type="bool"), name=dict(type="str"), - subnet=dict(type="str"), nextHopIp=dict(type="str"), - advertiseViaOspfEnabled=dict(type="bool"), preferOverOspfRoutesEnabled=dict(type="bool"), + subnet=dict(type="str"), networkId=dict(type="str"), switchStackId=dict(type="str"), staticRouteId=dict(type="str"), @@ -55,11 +55,11 @@ class NetworksSwitchStacksRoutingStaticRoutes(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( + advertiseViaOspfEnabled=params.get("advertiseViaOspfEnabled"), name=params.get("name"), - subnet=params.get("subnet"), nextHopIp=params.get("nextHopIp"), - advertiseViaOspfEnabled=params.get("advertiseViaOspfEnabled"), preferOverOspfRoutesEnabled=params.get("preferOverOspfRoutesEnabled"), + subnet=params.get("subnet"), networkId=params.get("networkId"), switchStackId=params.get("switchStackId"), staticRouteId=params.get("staticRouteId"), @@ -90,19 +90,19 @@ class NetworksSwitchStacksRoutingStaticRoutes(object): def create_params(self): new_object_params = {} + if self.new_object.get('advertiseViaOspfEnabled') is not None or self.new_object.get('advertise_via_ospf_enabled') is not None: + new_object_params['advertiseViaOspfEnabled'] = self.new_object.get('advertiseViaOspfEnabled') if self.new_object.get('name') is not None or self.new_object.get('name') is not None: new_object_params['name'] = self.new_object.get('name') or \ self.new_object.get('name') - if self.new_object.get('subnet') is not None or self.new_object.get('subnet') is not None: - new_object_params['subnet'] = self.new_object.get('subnet') or \ - self.new_object.get('subnet') if self.new_object.get('nextHopIp') is not None or self.new_object.get('next_hop_ip') is not None: new_object_params['nextHopIp'] = self.new_object.get('nextHopIp') or \ self.new_object.get('next_hop_ip') - if self.new_object.get('advertiseViaOspfEnabled') is not None or self.new_object.get('advertise_via_ospf_enabled') is not None: - new_object_params['advertiseViaOspfEnabled'] = self.new_object.get('advertiseViaOspfEnabled') if self.new_object.get('preferOverOspfRoutesEnabled') is not None or self.new_object.get('prefer_over_ospf_routes_enabled') is not None: new_object_params['preferOverOspfRoutesEnabled'] = self.new_object.get('preferOverOspfRoutesEnabled') + if self.new_object.get('subnet') is not None or self.new_object.get('subnet') is not None: + new_object_params['subnet'] = self.new_object.get('subnet') or \ + self.new_object.get('subnet') if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: new_object_params['networkId'] = self.new_object.get('networkId') or \ self.new_object.get('network_id') @@ -126,19 +126,19 @@ class NetworksSwitchStacksRoutingStaticRoutes(object): def update_by_id_params(self): new_object_params = {} + if self.new_object.get('advertiseViaOspfEnabled') is not None or self.new_object.get('advertise_via_ospf_enabled') is not None: + new_object_params['advertiseViaOspfEnabled'] = self.new_object.get('advertiseViaOspfEnabled') if self.new_object.get('name') is not None or self.new_object.get('name') is not None: new_object_params['name'] = self.new_object.get('name') or \ self.new_object.get('name') - if self.new_object.get('subnet') is not None or self.new_object.get('subnet') is not None: - new_object_params['subnet'] = self.new_object.get('subnet') or \ - self.new_object.get('subnet') if self.new_object.get('nextHopIp') is not None or self.new_object.get('next_hop_ip') is not None: new_object_params['nextHopIp'] = self.new_object.get('nextHopIp') or \ self.new_object.get('next_hop_ip') - if self.new_object.get('advertiseViaOspfEnabled') is not None or self.new_object.get('advertise_via_ospf_enabled') is not None: - new_object_params['advertiseViaOspfEnabled'] = self.new_object.get('advertiseViaOspfEnabled') if self.new_object.get('preferOverOspfRoutesEnabled') is not None or self.new_object.get('prefer_over_ospf_routes_enabled') is not None: new_object_params['preferOverOspfRoutesEnabled'] = self.new_object.get('preferOverOspfRoutesEnabled') + if self.new_object.get('subnet') is not None or self.new_object.get('subnet') is not None: + new_object_params['subnet'] = self.new_object.get('subnet') or \ + self.new_object.get('subnet') if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: new_object_params['networkId'] = self.new_object.get('networkId') or \ self.new_object.get('network_id') @@ -219,11 +219,11 @@ class NetworksSwitchStacksRoutingStaticRoutes(object): requested_obj = self.new_object obj_params = [ + ("advertiseViaOspfEnabled", "advertiseViaOspfEnabled"), ("name", "name"), - ("subnet", "subnet"), ("nextHopIp", "nextHopIp"), - ("advertiseViaOspfEnabled", "advertiseViaOspfEnabled"), ("preferOverOspfRoutesEnabled", "preferOverOspfRoutesEnabled"), + ("subnet", "subnet"), ("networkId", "networkId"), ("switchStackId", "switchStackId"), ("staticRouteId", "staticRouteId"), diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_traffic_analysis.py b/ansible_collections/cisco/meraki/plugins/action/networks_traffic_analysis.py index eb815e34c..3a0362321 100644 --- a/ansible_collections/cisco/meraki/plugins/action/networks_traffic_analysis.py +++ b/ansible_collections/cisco/meraki/plugins/action/networks_traffic_analysis.py @@ -32,8 +32,8 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present"]), - mode=dict(type="str"), customPieChartItems=dict(type="list"), + mode=dict(type="str"), networkId=dict(type="str"), )) @@ -49,8 +49,8 @@ class NetworksTrafficAnalysis(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( - mode=params.get("mode"), customPieChartItems=params.get("customPieChartItems"), + mode=params.get("mode"), network_id=params.get("networkId"), ) @@ -63,12 +63,12 @@ class NetworksTrafficAnalysis(object): def update_all_params(self): new_object_params = {} - if self.new_object.get('mode') is not None or self.new_object.get('mode') is not None: - new_object_params['mode'] = self.new_object.get('mode') or \ - self.new_object.get('mode') if self.new_object.get('customPieChartItems') is not None or self.new_object.get('custom_pie_chart_items') is not None: new_object_params['customPieChartItems'] = self.new_object.get('customPieChartItems') or \ self.new_object.get('custom_pie_chart_items') + if self.new_object.get('mode') is not None or self.new_object.get('mode') is not None: + new_object_params['mode'] = self.new_object.get('mode') or \ + self.new_object.get('mode') if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: new_object_params['networkId'] = self.new_object.get('networkId') or \ self.new_object.get('network_id') @@ -125,8 +125,8 @@ class NetworksTrafficAnalysis(object): requested_obj = self.new_object obj_params = [ - ("mode", "mode"), ("customPieChartItems", "customPieChartItems"), + ("mode", "mode"), ("networkId", "networkId"), ] # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_vlan_profiles.py b/ansible_collections/cisco/meraki/plugins/action/networks_vlan_profiles.py new file mode 100644 index 000000000..c92346bea --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/action/networks_vlan_profiles.py @@ -0,0 +1,260 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or +# https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( + MERAKI, + meraki_argument_spec, + meraki_compare_equality, + get_dict_result, +) +from ansible_collections.cisco.meraki.plugins.plugin_utils.exceptions import ( + InconsistentParameters, +) + +# Get common arguments specification +argument_spec = meraki_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present", "absent"]), + name=dict(type="str"), + vlanGroups=dict(type="list"), + vlanNames=dict(type="list"), + networkId=dict(type="str"), + iname=dict(type="str"), +)) + +required_if = [ + ("state", "present", ["iname", "name", "networkId"], True), + ("state", "absent", ["iname", "name", "networkId"], True), +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class NetworksVlanProfiles(object): + def __init__(self, params, meraki): + self.meraki = meraki + self.new_object = dict( + name=params.get("name"), + vlanGroups=params.get("vlanGroups"), + vlanNames=params.get("vlanNames"), + network_id=params.get("networkId"), + iname=params.get("iname"), + ) + + def delete_by_name_params(self): + new_object_params = {} + if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: + new_object_params['networkId'] = self.new_object.get('networkId') or \ + self.new_object.get('network_id') + if self.new_object.get('iname') is not None or self.new_object.get('iname') is not None: + new_object_params['iname'] = self.new_object.get('iname') or \ + self.new_object.get('iname') + return new_object_params + + def update_by_name_params(self): + new_object_params = {} + if self.new_object.get('name') is not None or self.new_object.get('name') is not None: + new_object_params['name'] = self.new_object.get('name') or \ + self.new_object.get('name') + if self.new_object.get('vlanGroups') is not None or self.new_object.get('vlan_groups') is not None: + new_object_params['vlanGroups'] = self.new_object.get('vlanGroups') or \ + self.new_object.get('vlan_groups') + if self.new_object.get('vlanNames') is not None or self.new_object.get('vlan_names') is not None: + new_object_params['vlanNames'] = self.new_object.get('vlanNames') or \ + self.new_object.get('vlan_names') + if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: + new_object_params['networkId'] = self.new_object.get('networkId') or \ + self.new_object.get('network_id') + if self.new_object.get('iname') is not None or self.new_object.get('iname') is not None: + new_object_params['iname'] = self.new_object.get('iname') or \ + self.new_object.get('iname') + return new_object_params + + def get_object_by_name(self, name): + result = None + try: + items = self.meraki.exec_meraki( + family="networks", + function="getNetworkVlanProfile", + params={"iname": name} + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'iname', name) + except Exception: + result = None + return result + + def get_object_by_id(self, id): + result = None + # NOTE: Does not have a get by id method or it is in another action + return result + + def exists(self): + prev_obj = None + id_exists = False + name_exists = False + o_id = self.new_object.get("networkId") or self.new_object.get("network_id") + name = self.new_object.get("name") + name = name or self.new_object.get("iname") + if o_id: + prev_obj = self.get_object_by_name(o_id) + id_exists = prev_obj is not None and isinstance(prev_obj, dict) + if not id_exists and name: + prev_obj = self.get_object_by_name(name) + name_exists = prev_obj is not None and isinstance(prev_obj, dict) + if id_exists: + _name = prev_obj.get("name") + _name = _name or prev_obj.get("iname") + if _name: + self.new_object.update(dict(iname=_name)) + if name_exists: + _id = prev_obj.get("id") + if id_exists and name_exists and o_id != _id: + raise InconsistentParameters( + "The 'id' and 'name' params don't refer to the same object") + if _id: + self.new_object.update(dict(id=_id)) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object + + obj_params = [ + ("name", "name"), + ("vlanGroups", "vlanGroups"), + ("vlanNames", "vlanNames"), + ("networkId", "networkId"), + ("iname", "iname"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params + # If any does not have eq params, it requires update + return any(not meraki_compare_equality(current_obj.get(meraki_param), + requested_obj.get(ansible_param)) + for (meraki_param, ansible_param) in obj_params) + + def update(self): + id = self.new_object.get("id") + name = self.new_object.get("name") + name = name or self.new_object.get("iname") + result = None + if not name: + prev_obj_id = self.get_object_by_id(id) + name_ = None + if prev_obj_id: + name_ = prev_obj_id.get("name") + name_ = name_ or prev_obj_id.get("iname") + if name_: + self.new_object.update(dict(iname=name_)) + result = self.meraki.exec_meraki( + family="networks", + function="updateNetworkVlanProfile", + params=self.update_by_name_params(), + op_modifies=True, + ) + return result + + def delete(self): + id = self.new_object.get("id") + name = self.new_object.get("name") + name = name or self.new_object.get("iname") + result = None + if not name: + prev_obj_id = self.get_object_by_id(id) + name_ = None + if prev_obj_id: + name_ = prev_obj_id.get("name") + name_ = name_ or prev_obj_id.get("iname") + if name_: + self.new_object.update(dict(iname=name_)) + result = self.meraki.exec_meraki( + family="networks", + function="deleteNetworkVlanProfile", + params=self.delete_by_name_params(), + ) + return result + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail( + "ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + meraki = MERAKI(self._task.args) + obj = NetworksVlanProfiles(self._task.args, meraki) + + state = self._task.args.get("state") + + response = None + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = obj.update() + meraki.object_updated() + else: + response = prev_obj + meraki.object_already_present() + else: + meraki.fail_json( + "Object does not exists, plugin only has update") + elif state == "absent": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + response = obj.delete() + meraki.object_deleted() + else: + meraki.object_already_absent() + + self._result.update(dict(meraki_response=response)) + self._result.update(meraki.exit_json()) + return self._result diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_vlan_profiles_assignments_by_device_info.py b/ansible_collections/cisco/meraki/plugins/action/networks_vlan_profiles_assignments_by_device_info.py new file mode 100644 index 000000000..2e386c0ab --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/action/networks_vlan_profiles_assignments_by_device_info.py @@ -0,0 +1,120 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( + MERAKI, + meraki_argument_spec, +) + +# Get common arguments specification +argument_spec = meraki_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + networkId=dict(type="str"), + perPage=dict(type="int"), + total_pages=dict(type="int"), + direction=dict(type="str"), + startingAfter=dict(type="str"), + endingBefore=dict(type="str"), + serials=dict(type="list"), + productTypes=dict(type="list"), + stackIds=dict(type="list"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail( + "ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_all(self, params): + new_object = {} + if params.get("networkId") is not None: + new_object["networkId"] = params.get( + "networkId") + if params.get("perPage") is not None: + new_object["perPage"] = params.get( + "perPage") + new_object['total_pages'] = params.get( + "total_pages") or 1 + new_object['direction'] = params.get( + "direction") or "next" + if params.get("startingAfter") is not None: + new_object["startingAfter"] = params.get( + "startingAfter") + if params.get("endingBefore") is not None: + new_object["endingBefore"] = params.get( + "endingBefore") + if params.get("serials") is not None: + new_object["serials"] = params.get( + "serials") + if params.get("productTypes") is not None: + new_object["productTypes"] = params.get( + "productTypes") + if params.get("stackIds") is not None: + new_object["stackIds"] = params.get( + "stackIds") + + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(meraki_response={})) + + meraki = MERAKI(params=self._task.args) + + response = meraki.exec_meraki( + family="networks", + function='getNetworkVlanProfilesAssignmentsByDevice', + params=self.get_all(self._task.args), + ) + self._result.update(dict(meraki_response=response)) + self._result.update(meraki.exit_json()) + return self._result diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_vlan_profiles_assignments_reassign.py b/ansible_collections/cisco/meraki/plugins/action/networks_vlan_profiles_assignments_reassign.py new file mode 100644 index 000000000..96cb0a3a1 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/action/networks_vlan_profiles_assignments_reassign.py @@ -0,0 +1,93 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( + MERAKI, + meraki_argument_spec, +) + +# Get common arguements specification +argument_spec = meraki_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + serials=dict(type="list"), + stackIds=dict(type="list"), + vlanProfile=dict(type="dict"), + networkId=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail( + "ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + serials=params.get("serials"), + stackIds=params.get("stackIds"), + vlanProfile=params.get("vlanProfile"), + networkId=params.get("networkId"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + meraki = MERAKI(params=self._task.args) + + response = meraki.exec_meraki( + family="networks", + function='reassignNetworkVlanProfilesAssignments', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(meraki_response=response)) + self._result.update(meraki.exit_json()) + return self._result diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_vlan_profiles_info.py b/ansible_collections/cisco/meraki/plugins/action/networks_vlan_profiles_info.py new file mode 100644 index 000000000..74fa01c03 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/action/networks_vlan_profiles_info.py @@ -0,0 +1,92 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( + MERAKI, + meraki_argument_spec, +) + +# Get common arguments specification +argument_spec = meraki_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + networkId=dict(type="str"), + iname=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail( + "ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(meraki_response={})) + + meraki = MERAKI(params=self._task.args) + + name = self._task.args.get("iname") + if name: + response = meraki.exec_meraki( + family="networks", + function='getNetworkVlanProfile', + params=self.get_object(self._task.args), + ) + self._result.update(dict(meraki_response=response)) + self._result.update(meraki.exit_json()) + return self._result + if not name: + # NOTE: Does not have a get all method or it is in another action + response = None + meraki.object_modify_result(changed=False, result="Module does not have get all, check arguments of module") + self._result.update(dict(meraki_response=response)) + self._result.update(meraki.exit_json()) + return self._result diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_webhooks_http_servers.py b/ansible_collections/cisco/meraki/plugins/action/networks_webhooks_http_servers.py index ef9a6d29d..a893960f6 100644 --- a/ansible_collections/cisco/meraki/plugins/action/networks_webhooks_http_servers.py +++ b/ansible_collections/cisco/meraki/plugins/action/networks_webhooks_http_servers.py @@ -33,9 +33,9 @@ argument_spec = meraki_argument_spec() argument_spec.update(dict( state=dict(type="str", default="present", choices=["present", "absent"]), name=dict(type="str"), - url=dict(type="str"), - sharedSecret=dict(type="str"), payloadTemplate=dict(type="dict"), + sharedSecret=dict(type="str"), + url=dict(type="str"), networkId=dict(type="str"), httpServerId=dict(type="str"), )) @@ -54,9 +54,9 @@ class NetworksWebhooksHttpServers(object): self.meraki = meraki self.new_object = dict( name=params.get("name"), - url=params.get("url"), - sharedSecret=params.get("sharedSecret"), payloadTemplate=params.get("payloadTemplate"), + sharedSecret=params.get("sharedSecret"), + url=params.get("url"), networkId=params.get("networkId"), httpServerId=params.get("httpServerId"), ) @@ -83,15 +83,15 @@ class NetworksWebhooksHttpServers(object): if self.new_object.get('name') is not None or self.new_object.get('name') is not None: new_object_params['name'] = self.new_object.get('name') or \ self.new_object.get('name') - if self.new_object.get('url') is not None or self.new_object.get('url') is not None: - new_object_params['url'] = self.new_object.get('url') or \ - self.new_object.get('url') - if self.new_object.get('sharedSecret') is not None or self.new_object.get('shared_secret') is not None: - new_object_params['sharedSecret'] = self.new_object.get('sharedSecret') or \ - self.new_object.get('shared_secret') if self.new_object.get('payloadTemplate') is not None or self.new_object.get('payload_template') is not None: new_object_params['payloadTemplate'] = self.new_object.get('payloadTemplate') or \ self.new_object.get('payload_template') + if self.new_object.get('sharedSecret') is not None or self.new_object.get('shared_secret') is not None: + new_object_params['sharedSecret'] = self.new_object.get('sharedSecret') or \ + self.new_object.get('shared_secret') + if self.new_object.get('url') is not None or self.new_object.get('url') is not None: + new_object_params['url'] = self.new_object.get('url') or \ + self.new_object.get('url') if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: new_object_params['networkId'] = self.new_object.get('networkId') or \ self.new_object.get('network_id') @@ -112,12 +112,12 @@ class NetworksWebhooksHttpServers(object): if self.new_object.get('name') is not None or self.new_object.get('name') is not None: new_object_params['name'] = self.new_object.get('name') or \ self.new_object.get('name') - if self.new_object.get('sharedSecret') is not None or self.new_object.get('shared_secret') is not None: - new_object_params['sharedSecret'] = self.new_object.get('sharedSecret') or \ - self.new_object.get('shared_secret') if self.new_object.get('payloadTemplate') is not None or self.new_object.get('payload_template') is not None: new_object_params['payloadTemplate'] = self.new_object.get('payloadTemplate') or \ self.new_object.get('payload_template') + if self.new_object.get('sharedSecret') is not None or self.new_object.get('shared_secret') is not None: + new_object_params['sharedSecret'] = self.new_object.get('sharedSecret') or \ + self.new_object.get('shared_secret') if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: new_object_params['networkId'] = self.new_object.get('networkId') or \ self.new_object.get('network_id') @@ -196,9 +196,9 @@ class NetworksWebhooksHttpServers(object): obj_params = [ ("name", "name"), - ("url", "url"), - ("sharedSecret", "sharedSecret"), ("payloadTemplate", "payloadTemplate"), + ("sharedSecret", "sharedSecret"), + ("url", "url"), ("networkId", "networkId"), ("httpServerId", "httpServerId"), ] diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_webhooks_payload_templates.py b/ansible_collections/cisco/meraki/plugins/action/networks_webhooks_payload_templates.py index 335a112bc..9f1b32936 100644 --- a/ansible_collections/cisco/meraki/plugins/action/networks_webhooks_payload_templates.py +++ b/ansible_collections/cisco/meraki/plugins/action/networks_webhooks_payload_templates.py @@ -32,11 +32,11 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present", "absent"]), - name=dict(type="str"), body=dict(type="str"), - headers=dict(type="list"), bodyFile=dict(type="str"), + headers=dict(type="list"), headersFile=dict(type="str"), + name=dict(type="str"), networkId=dict(type="str"), payloadTemplateId=dict(type="str"), )) @@ -54,11 +54,11 @@ class NetworksWebhooksPayloadTemplates(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( - name=params.get("name"), body=params.get("body"), - headers=params.get("headers"), bodyFile=params.get("bodyFile"), + headers=params.get("headers"), headersFile=params.get("headersFile"), + name=params.get("name"), networkId=params.get("networkId"), payloadTemplateId=params.get("payloadTemplateId"), ) @@ -82,21 +82,21 @@ class NetworksWebhooksPayloadTemplates(object): def create_params(self): new_object_params = {} - if self.new_object.get('name') is not None or self.new_object.get('name') is not None: - new_object_params['name'] = self.new_object.get('name') or \ - self.new_object.get('name') if self.new_object.get('body') is not None or self.new_object.get('body') is not None: new_object_params['body'] = self.new_object.get('body') or \ self.new_object.get('body') - if self.new_object.get('headers') is not None or self.new_object.get('headers') is not None: - new_object_params['headers'] = self.new_object.get('headers') or \ - self.new_object.get('headers') if self.new_object.get('bodyFile') is not None or self.new_object.get('body_file') is not None: new_object_params['bodyFile'] = self.new_object.get('bodyFile') or \ self.new_object.get('body_file') + if self.new_object.get('headers') is not None or self.new_object.get('headers') is not None: + new_object_params['headers'] = self.new_object.get('headers') or \ + self.new_object.get('headers') if self.new_object.get('headersFile') is not None or self.new_object.get('headers_file') is not None: new_object_params['headersFile'] = self.new_object.get('headersFile') or \ self.new_object.get('headers_file') + if self.new_object.get('name') is not None or self.new_object.get('name') is not None: + new_object_params['name'] = self.new_object.get('name') or \ + self.new_object.get('name') if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: new_object_params['networkId'] = self.new_object.get('networkId') or \ self.new_object.get('network_id') @@ -114,21 +114,21 @@ class NetworksWebhooksPayloadTemplates(object): def update_by_id_params(self): new_object_params = {} - if self.new_object.get('name') is not None or self.new_object.get('name') is not None: - new_object_params['name'] = self.new_object.get('name') or \ - self.new_object.get('name') if self.new_object.get('body') is not None or self.new_object.get('body') is not None: new_object_params['body'] = self.new_object.get('body') or \ self.new_object.get('body') - if self.new_object.get('headers') is not None or self.new_object.get('headers') is not None: - new_object_params['headers'] = self.new_object.get('headers') or \ - self.new_object.get('headers') if self.new_object.get('bodyFile') is not None or self.new_object.get('body_file') is not None: new_object_params['bodyFile'] = self.new_object.get('bodyFile') or \ self.new_object.get('body_file') + if self.new_object.get('headers') is not None or self.new_object.get('headers') is not None: + new_object_params['headers'] = self.new_object.get('headers') or \ + self.new_object.get('headers') if self.new_object.get('headersFile') is not None or self.new_object.get('headers_file') is not None: new_object_params['headersFile'] = self.new_object.get('headersFile') or \ self.new_object.get('headers_file') + if self.new_object.get('name') is not None or self.new_object.get('name') is not None: + new_object_params['name'] = self.new_object.get('name') or \ + self.new_object.get('name') if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: new_object_params['networkId'] = self.new_object.get('networkId') or \ self.new_object.get('network_id') @@ -206,11 +206,11 @@ class NetworksWebhooksPayloadTemplates(object): requested_obj = self.new_object obj_params = [ - ("name", "name"), ("body", "body"), - ("headers", "headers"), ("bodyFile", "bodyFile"), + ("headers", "headers"), ("headersFile", "headersFile"), + ("name", "name"), ("networkId", "networkId"), ("payloadTemplateId", "payloadTemplateId"), ] diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_wireless_alternate_management_interface.py b/ansible_collections/cisco/meraki/plugins/action/networks_wireless_alternate_management_interface.py index 899d9f264..f21ab1696 100644 --- a/ansible_collections/cisco/meraki/plugins/action/networks_wireless_alternate_management_interface.py +++ b/ansible_collections/cisco/meraki/plugins/action/networks_wireless_alternate_management_interface.py @@ -32,10 +32,10 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present"]), + accessPoints=dict(type="list"), enabled=dict(type="bool"), - vlanId=dict(type="int"), protocols=dict(type="list"), - accessPoints=dict(type="list"), + vlanId=dict(type="int"), networkId=dict(type="str"), )) @@ -51,10 +51,10 @@ class NetworksWirelessAlternateManagementInterface(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( + accessPoints=params.get("accessPoints"), enabled=params.get("enabled"), - vlanId=params.get("vlanId"), protocols=params.get("protocols"), - accessPoints=params.get("accessPoints"), + vlanId=params.get("vlanId"), network_id=params.get("networkId"), ) @@ -67,17 +67,17 @@ class NetworksWirelessAlternateManagementInterface(object): def update_all_params(self): new_object_params = {} + if self.new_object.get('accessPoints') is not None or self.new_object.get('access_points') is not None: + new_object_params['accessPoints'] = self.new_object.get('accessPoints') or \ + self.new_object.get('access_points') if self.new_object.get('enabled') is not None or self.new_object.get('enabled') is not None: new_object_params['enabled'] = self.new_object.get('enabled') - if self.new_object.get('vlanId') is not None or self.new_object.get('vlan_id') is not None: - new_object_params['vlanId'] = self.new_object.get('vlanId') or \ - self.new_object.get('vlan_id') if self.new_object.get('protocols') is not None or self.new_object.get('protocols') is not None: new_object_params['protocols'] = self.new_object.get('protocols') or \ self.new_object.get('protocols') - if self.new_object.get('accessPoints') is not None or self.new_object.get('access_points') is not None: - new_object_params['accessPoints'] = self.new_object.get('accessPoints') or \ - self.new_object.get('access_points') + if self.new_object.get('vlanId') is not None or self.new_object.get('vlan_id') is not None: + new_object_params['vlanId'] = self.new_object.get('vlanId') or \ + self.new_object.get('vlan_id') if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: new_object_params['networkId'] = self.new_object.get('networkId') or \ self.new_object.get('network_id') @@ -134,10 +134,10 @@ class NetworksWirelessAlternateManagementInterface(object): requested_obj = self.new_object obj_params = [ + ("accessPoints", "accessPoints"), ("enabled", "enabled"), - ("vlanId", "vlanId"), ("protocols", "protocols"), - ("accessPoints", "accessPoints"), + ("vlanId", "vlanId"), ("networkId", "networkId"), ] # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_wireless_bluetooth_settings.py b/ansible_collections/cisco/meraki/plugins/action/networks_wireless_bluetooth_settings.py index 59f9f6c75..ea730674c 100644 --- a/ansible_collections/cisco/meraki/plugins/action/networks_wireless_bluetooth_settings.py +++ b/ansible_collections/cisco/meraki/plugins/action/networks_wireless_bluetooth_settings.py @@ -32,12 +32,12 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present"]), - scanningEnabled=dict(type="bool"), advertisingEnabled=dict(type="bool"), - uuid=dict(type="str"), - majorMinorAssignmentMode=dict(type="str"), major=dict(type="int"), + majorMinorAssignmentMode=dict(type="str"), minor=dict(type="int"), + scanningEnabled=dict(type="bool"), + uuid=dict(type="str"), networkId=dict(type="str"), )) @@ -53,12 +53,12 @@ class NetworksWirelessBluetoothSettings(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( - scanningEnabled=params.get("scanningEnabled"), advertisingEnabled=params.get("advertisingEnabled"), - uuid=params.get("uuid"), - majorMinorAssignmentMode=params.get("majorMinorAssignmentMode"), major=params.get("major"), + majorMinorAssignmentMode=params.get("majorMinorAssignmentMode"), minor=params.get("minor"), + scanningEnabled=params.get("scanningEnabled"), + uuid=params.get("uuid"), network_id=params.get("networkId"), ) @@ -71,22 +71,22 @@ class NetworksWirelessBluetoothSettings(object): def update_all_params(self): new_object_params = {} - if self.new_object.get('scanningEnabled') is not None or self.new_object.get('scanning_enabled') is not None: - new_object_params['scanningEnabled'] = self.new_object.get('scanningEnabled') if self.new_object.get('advertisingEnabled') is not None or self.new_object.get('advertising_enabled') is not None: new_object_params['advertisingEnabled'] = self.new_object.get('advertisingEnabled') - if self.new_object.get('uuid') is not None or self.new_object.get('uuid') is not None: - new_object_params['uuid'] = self.new_object.get('uuid') or \ - self.new_object.get('uuid') - if self.new_object.get('majorMinorAssignmentMode') is not None or self.new_object.get('major_minor_assignment_mode') is not None: - new_object_params['majorMinorAssignmentMode'] = self.new_object.get('majorMinorAssignmentMode') or \ - self.new_object.get('major_minor_assignment_mode') if self.new_object.get('major') is not None or self.new_object.get('major') is not None: new_object_params['major'] = self.new_object.get('major') or \ self.new_object.get('major') + if self.new_object.get('majorMinorAssignmentMode') is not None or self.new_object.get('major_minor_assignment_mode') is not None: + new_object_params['majorMinorAssignmentMode'] = self.new_object.get('majorMinorAssignmentMode') or \ + self.new_object.get('major_minor_assignment_mode') if self.new_object.get('minor') is not None or self.new_object.get('minor') is not None: new_object_params['minor'] = self.new_object.get('minor') or \ self.new_object.get('minor') + if self.new_object.get('scanningEnabled') is not None or self.new_object.get('scanning_enabled') is not None: + new_object_params['scanningEnabled'] = self.new_object.get('scanningEnabled') + if self.new_object.get('uuid') is not None or self.new_object.get('uuid') is not None: + new_object_params['uuid'] = self.new_object.get('uuid') or \ + self.new_object.get('uuid') if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: new_object_params['networkId'] = self.new_object.get('networkId') or \ self.new_object.get('network_id') @@ -143,12 +143,12 @@ class NetworksWirelessBluetoothSettings(object): requested_obj = self.new_object obj_params = [ - ("scanningEnabled", "scanningEnabled"), ("advertisingEnabled", "advertisingEnabled"), - ("uuid", "uuid"), - ("majorMinorAssignmentMode", "majorMinorAssignmentMode"), ("major", "major"), + ("majorMinorAssignmentMode", "majorMinorAssignmentMode"), ("minor", "minor"), + ("scanningEnabled", "scanningEnabled"), + ("uuid", "uuid"), ("networkId", "networkId"), ] # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_wireless_ethernet_ports_profiles.py b/ansible_collections/cisco/meraki/plugins/action/networks_wireless_ethernet_ports_profiles.py new file mode 100644 index 000000000..fc95256a5 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/action/networks_wireless_ethernet_ports_profiles.py @@ -0,0 +1,270 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or +# https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( + MERAKI, + meraki_argument_spec, + meraki_compare_equality, +) +from ansible_collections.cisco.meraki.plugins.plugin_utils.exceptions import ( + InconsistentParameters, +) + +# Get common arguments specification +argument_spec = meraki_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present", "absent"]), + name=dict(type="str"), + ports=dict(type="list"), + usbPorts=dict(type="list"), + networkId=dict(type="str"), + profileId=dict(type="str"), +)) + +required_if = [ + ("state", "present", ["name", "networkId", "profileId"], True), + ("state", "absent", ["name", "networkId", "profileId"], True), +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class NetworksWirelessEthernetPortsProfiles(object): + def __init__(self, params, meraki): + self.meraki = meraki + self.new_object = dict( + name=params.get("name"), + ports=params.get("ports"), + usbPorts=params.get("usbPorts"), + network_id=params.get("networkId"), + profile_id=params.get("profileId"), + ) + + def get_params_by_id(self, name=None, id=None): + new_object_params = {} + if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: + new_object_params['networkId'] = self.new_object.get('networkId') or \ + self.new_object.get('network_id') + if self.new_object.get('profileId') is not None or self.new_object.get('profile_id') is not None: + new_object_params['profileId'] = self.new_object.get('profileId') or \ + self.new_object.get('profile_id') + return new_object_params + + def delete_by_id_params(self): + new_object_params = {} + if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: + new_object_params['networkId'] = self.new_object.get('networkId') or \ + self.new_object.get('network_id') + if self.new_object.get('profileId') is not None or self.new_object.get('profile_id') is not None: + new_object_params['profileId'] = self.new_object.get('profileId') or \ + self.new_object.get('profile_id') + return new_object_params + + def update_by_id_params(self): + new_object_params = {} + if self.new_object.get('name') is not None or self.new_object.get('name') is not None: + new_object_params['name'] = self.new_object.get('name') or \ + self.new_object.get('name') + if self.new_object.get('ports') is not None or self.new_object.get('ports') is not None: + new_object_params['ports'] = self.new_object.get('ports') or \ + self.new_object.get('ports') + if self.new_object.get('usbPorts') is not None or self.new_object.get('usb_ports') is not None: + new_object_params['usbPorts'] = self.new_object.get('usbPorts') or \ + self.new_object.get('usb_ports') + if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: + new_object_params['networkId'] = self.new_object.get('networkId') or \ + self.new_object.get('network_id') + if self.new_object.get('profileId') is not None or self.new_object.get('profile_id') is not None: + new_object_params['profileId'] = self.new_object.get('profileId') or \ + self.new_object.get('profile_id') + return new_object_params + + def get_object_by_name(self, name): + result = None + # NOTE: Does not have a get by name and get all + return result + + def get_object_by_id(self, id): + result = None + try: + items = self.meraki.exec_meraki( + family="wireless", + function="getNetworkWirelessEthernetPortsProfile", + params=self.get_params_by_id() + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = items + except Exception as e: + print("Error: ", e) + result = None + return result + + def exists(self): + prev_obj = None + id_exists = False + name_exists = False + o_id = self.new_object.get("networkId") or self.new_object.get("network_id") + o_id = o_id or self.new_object.get( + "profile_id") or self.new_object.get("profileId") + name = self.new_object.get("name") + if o_id: + prev_obj = self.get_object_by_id(o_id) + id_exists = prev_obj is not None and isinstance(prev_obj, dict) + if not id_exists and name: + prev_obj = self.get_object_by_name(name) + name_exists = prev_obj is not None and isinstance(prev_obj, dict) + if name_exists: + _id = prev_obj.get("id") + _id = _id or prev_obj.get("profileId") + if id_exists and name_exists and o_id != _id: + raise InconsistentParameters( + "The 'id' and 'name' params don't refer to the same object") + if _id: + self.new_object.update(dict(id=_id)) + self.new_object.update(dict(profileId=_id)) + if _id: + prev_obj = self.get_object_by_id(_id) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object + + obj_params = [ + ("name", "name"), + ("ports", "ports"), + ("usbPorts", "usbPorts"), + ("networkId", "networkId"), + ("profileId", "profileId"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params + # If any does not have eq params, it requires update + return any(not meraki_compare_equality(current_obj.get(meraki_param), + requested_obj.get(ansible_param)) + for (meraki_param, ansible_param) in obj_params) + + def update(self): + id = self.new_object.get("id") + id = id or self.new_object.get("profileId") + name = self.new_object.get("name") + result = None + if not id: + prev_obj_name = self.get_object_by_name(name) + id_ = None + if prev_obj_name: + id_ = prev_obj_name.get("id") + id_ = id_ or prev_obj_name.get("profileId") + if id_: + self.new_object.update(dict(profileid=id_)) + result = self.meraki.exec_meraki( + family="wireless", + function="updateNetworkWirelessEthernetPortsProfile", + params=self.update_by_id_params(), + op_modifies=True, + ) + return result + + def delete(self): + id = self.new_object.get("id") + id = id or self.new_object.get("profileId") + name = self.new_object.get("name") + result = None + if not id: + prev_obj_name = self.get_object_by_name(name) + id_ = None + if prev_obj_name: + id_ = prev_obj_name.get("id") + id_ = id_ or prev_obj_name.get("profileId") + if id_: + self.new_object.update(dict(profileid=id_)) + result = self.meraki.exec_meraki( + family="wireless", + function="deleteNetworkWirelessEthernetPortsProfile", + params=self.delete_by_id_params(), + ) + return result + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail( + "ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + meraki = MERAKI(self._task.args) + obj = NetworksWirelessEthernetPortsProfiles(self._task.args, meraki) + + state = self._task.args.get("state") + + response = None + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = obj.update() + meraki.object_updated() + else: + response = prev_obj + meraki.object_already_present() + else: + meraki.fail_json( + "Object does not exists, plugin only has update") + elif state == "absent": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + response = obj.delete() + meraki.object_deleted() + else: + meraki.object_already_absent() + + self._result.update(dict(meraki_response=response)) + self._result.update(meraki.exit_json()) + return self._result diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_wireless_ethernet_ports_profiles_assign.py b/ansible_collections/cisco/meraki/plugins/action/networks_wireless_ethernet_ports_profiles_assign.py new file mode 100644 index 000000000..8e594fcae --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/action/networks_wireless_ethernet_ports_profiles_assign.py @@ -0,0 +1,91 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( + MERAKI, + meraki_argument_spec, +) + +# Get common arguements specification +argument_spec = meraki_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + profileId=dict(type="str"), + serials=dict(type="list"), + networkId=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail( + "ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + profileId=params.get("profileId"), + serials=params.get("serials"), + networkId=params.get("networkId"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + meraki = MERAKI(params=self._task.args) + + response = meraki.exec_meraki( + family="wireless", + function='assignNetworkWirelessEthernetPortsProfiles', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(meraki_response=response)) + self._result.update(meraki.exit_json()) + return self._result diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_wireless_ethernet_ports_profiles_info.py b/ansible_collections/cisco/meraki/plugins/action/networks_wireless_ethernet_ports_profiles_info.py new file mode 100644 index 000000000..1bf4c8dee --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/action/networks_wireless_ethernet_ports_profiles_info.py @@ -0,0 +1,102 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( + MERAKI, + meraki_argument_spec, +) + +# Get common arguments specification +argument_spec = meraki_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + networkId=dict(type="str"), + profileId=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail( + "ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = {} + if params.get("networkId") is not None: + new_object["networkId"] = params.get( + "networkId") + if params.get("profileId") is not None: + new_object["profileId"] = params.get( + "profileId") + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(meraki_response={})) + + meraki = MERAKI(params=self._task.args) + + id = self._task.args.get("profileId") + if id: + response = meraki.exec_meraki( + family="wireless", + function='getNetworkWirelessEthernetPortsProfile', + params=self.get_object(self._task.args), + ) + self._result.update(dict(meraki_response=response)) + self._result.update(meraki.exit_json()) + return self._result + if not id: + # NOTE: Does not have a get all method or it is in another action + response = None + meraki.object_modify_result(changed=False, result="Module does not have get all, check arguments of module") + self._result.update(dict(meraki_response=response)) + self._result.update(meraki.exit_json()) + return self._result diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_wireless_ethernet_ports_profiles_set_default.py b/ansible_collections/cisco/meraki/plugins/action/networks_wireless_ethernet_ports_profiles_set_default.py new file mode 100644 index 000000000..1cccd7aa1 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/action/networks_wireless_ethernet_ports_profiles_set_default.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( + MERAKI, + meraki_argument_spec, +) + +# Get common arguements specification +argument_spec = meraki_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + profileId=dict(type="str"), + networkId=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail( + "ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + profileId=params.get("profileId"), + networkId=params.get("networkId"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + meraki = MERAKI(params=self._task.args) + + response = meraki.exec_meraki( + family="wireless", + function='setNetworkWirelessEthernetPortsProfilesDefault', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(meraki_response=response)) + self._result.update(meraki.exit_json()) + return self._result diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_wireless_rf_profiles.py b/ansible_collections/cisco/meraki/plugins/action/networks_wireless_rf_profiles.py index ad3f0d8ec..c4d650c4d 100644 --- a/ansible_collections/cisco/meraki/plugins/action/networks_wireless_rf_profiles.py +++ b/ansible_collections/cisco/meraki/plugins/action/networks_wireless_rf_profiles.py @@ -32,16 +32,17 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present", "absent"]), - name=dict(type="str"), - clientBalancingEnabled=dict(type="bool"), - minBitrateType=dict(type="str"), - bandSelectionType=dict(type="str"), apBandSettings=dict(type="dict"), - twoFourGhzSettings=dict(type="dict"), + bandSelectionType=dict(type="str"), + clientBalancingEnabled=dict(type="bool"), fiveGhzSettings=dict(type="dict"), + flexRadios=dict(type="dict"), + minBitrateType=dict(type="str"), + name=dict(type="str"), + perSsidSettings=dict(type="dict"), sixGhzSettings=dict(type="dict"), transmission=dict(type="dict"), - perSsidSettings=dict(type="dict"), + twoFourGhzSettings=dict(type="dict"), networkId=dict(type="str"), rfProfileId=dict(type="str"), )) @@ -59,16 +60,17 @@ class NetworksWirelessRfProfiles(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( - name=params.get("name"), - clientBalancingEnabled=params.get("clientBalancingEnabled"), - minBitrateType=params.get("minBitrateType"), - bandSelectionType=params.get("bandSelectionType"), apBandSettings=params.get("apBandSettings"), - twoFourGhzSettings=params.get("twoFourGhzSettings"), + bandSelectionType=params.get("bandSelectionType"), + clientBalancingEnabled=params.get("clientBalancingEnabled"), fiveGhzSettings=params.get("fiveGhzSettings"), + flexRadios=params.get("flexRadios"), + minBitrateType=params.get("minBitrateType"), + name=params.get("name"), + perSsidSettings=params.get("perSsidSettings"), sixGhzSettings=params.get("sixGhzSettings"), transmission=params.get("transmission"), - perSsidSettings=params.get("perSsidSettings"), + twoFourGhzSettings=params.get("twoFourGhzSettings"), networkId=params.get("networkId"), rfProfileId=params.get("rfProfileId"), ) @@ -95,35 +97,38 @@ class NetworksWirelessRfProfiles(object): def create_params(self): new_object_params = {} - if self.new_object.get('name') is not None or self.new_object.get('name') is not None: - new_object_params['name'] = self.new_object.get('name') or \ - self.new_object.get('name') - if self.new_object.get('clientBalancingEnabled') is not None or self.new_object.get('client_balancing_enabled') is not None: - new_object_params['clientBalancingEnabled'] = self.new_object.get('clientBalancingEnabled') - if self.new_object.get('minBitrateType') is not None or self.new_object.get('min_bitrate_type') is not None: - new_object_params['minBitrateType'] = self.new_object.get('minBitrateType') or \ - self.new_object.get('min_bitrate_type') - if self.new_object.get('bandSelectionType') is not None or self.new_object.get('band_selection_type') is not None: - new_object_params['bandSelectionType'] = self.new_object.get('bandSelectionType') or \ - self.new_object.get('band_selection_type') if self.new_object.get('apBandSettings') is not None or self.new_object.get('ap_band_settings') is not None: new_object_params['apBandSettings'] = self.new_object.get('apBandSettings') or \ self.new_object.get('ap_band_settings') - if self.new_object.get('twoFourGhzSettings') is not None or self.new_object.get('two_four_ghz_settings') is not None: - new_object_params['twoFourGhzSettings'] = self.new_object.get('twoFourGhzSettings') or \ - self.new_object.get('two_four_ghz_settings') + if self.new_object.get('bandSelectionType') is not None or self.new_object.get('band_selection_type') is not None: + new_object_params['bandSelectionType'] = self.new_object.get('bandSelectionType') or \ + self.new_object.get('band_selection_type') + if self.new_object.get('clientBalancingEnabled') is not None or self.new_object.get('client_balancing_enabled') is not None: + new_object_params['clientBalancingEnabled'] = self.new_object.get('clientBalancingEnabled') if self.new_object.get('fiveGhzSettings') is not None or self.new_object.get('five_ghz_settings') is not None: new_object_params['fiveGhzSettings'] = self.new_object.get('fiveGhzSettings') or \ self.new_object.get('five_ghz_settings') + if self.new_object.get('flexRadios') is not None or self.new_object.get('flex_radios') is not None: + new_object_params['flexRadios'] = self.new_object.get('flexRadios') or \ + self.new_object.get('flex_radios') + if self.new_object.get('minBitrateType') is not None or self.new_object.get('min_bitrate_type') is not None: + new_object_params['minBitrateType'] = self.new_object.get('minBitrateType') or \ + self.new_object.get('min_bitrate_type') + if self.new_object.get('name') is not None or self.new_object.get('name') is not None: + new_object_params['name'] = self.new_object.get('name') or \ + self.new_object.get('name') + if self.new_object.get('perSsidSettings') is not None or self.new_object.get('per_ssid_settings') is not None: + new_object_params['perSsidSettings'] = self.new_object.get('perSsidSettings') or \ + self.new_object.get('per_ssid_settings') if self.new_object.get('sixGhzSettings') is not None or self.new_object.get('six_ghz_settings') is not None: new_object_params['sixGhzSettings'] = self.new_object.get('sixGhzSettings') or \ self.new_object.get('six_ghz_settings') if self.new_object.get('transmission') is not None or self.new_object.get('transmission') is not None: new_object_params['transmission'] = self.new_object.get('transmission') or \ self.new_object.get('transmission') - if self.new_object.get('perSsidSettings') is not None or self.new_object.get('per_ssid_settings') is not None: - new_object_params['perSsidSettings'] = self.new_object.get('perSsidSettings') or \ - self.new_object.get('per_ssid_settings') + if self.new_object.get('twoFourGhzSettings') is not None or self.new_object.get('two_four_ghz_settings') is not None: + new_object_params['twoFourGhzSettings'] = self.new_object.get('twoFourGhzSettings') or \ + self.new_object.get('two_four_ghz_settings') if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: new_object_params['networkId'] = self.new_object.get('networkId') or \ self.new_object.get('network_id') @@ -141,35 +146,38 @@ class NetworksWirelessRfProfiles(object): def update_by_id_params(self): new_object_params = {} - if self.new_object.get('name') is not None or self.new_object.get('name') is not None: - new_object_params['name'] = self.new_object.get('name') or \ - self.new_object.get('name') - if self.new_object.get('clientBalancingEnabled') is not None or self.new_object.get('client_balancing_enabled') is not None: - new_object_params['clientBalancingEnabled'] = self.new_object.get('clientBalancingEnabled') - if self.new_object.get('minBitrateType') is not None or self.new_object.get('min_bitrate_type') is not None: - new_object_params['minBitrateType'] = self.new_object.get('minBitrateType') or \ - self.new_object.get('min_bitrate_type') - if self.new_object.get('bandSelectionType') is not None or self.new_object.get('band_selection_type') is not None: - new_object_params['bandSelectionType'] = self.new_object.get('bandSelectionType') or \ - self.new_object.get('band_selection_type') if self.new_object.get('apBandSettings') is not None or self.new_object.get('ap_band_settings') is not None: new_object_params['apBandSettings'] = self.new_object.get('apBandSettings') or \ self.new_object.get('ap_band_settings') - if self.new_object.get('twoFourGhzSettings') is not None or self.new_object.get('two_four_ghz_settings') is not None: - new_object_params['twoFourGhzSettings'] = self.new_object.get('twoFourGhzSettings') or \ - self.new_object.get('two_four_ghz_settings') + if self.new_object.get('bandSelectionType') is not None or self.new_object.get('band_selection_type') is not None: + new_object_params['bandSelectionType'] = self.new_object.get('bandSelectionType') or \ + self.new_object.get('band_selection_type') + if self.new_object.get('clientBalancingEnabled') is not None or self.new_object.get('client_balancing_enabled') is not None: + new_object_params['clientBalancingEnabled'] = self.new_object.get('clientBalancingEnabled') if self.new_object.get('fiveGhzSettings') is not None or self.new_object.get('five_ghz_settings') is not None: new_object_params['fiveGhzSettings'] = self.new_object.get('fiveGhzSettings') or \ self.new_object.get('five_ghz_settings') + if self.new_object.get('flexRadios') is not None or self.new_object.get('flex_radios') is not None: + new_object_params['flexRadios'] = self.new_object.get('flexRadios') or \ + self.new_object.get('flex_radios') + if self.new_object.get('minBitrateType') is not None or self.new_object.get('min_bitrate_type') is not None: + new_object_params['minBitrateType'] = self.new_object.get('minBitrateType') or \ + self.new_object.get('min_bitrate_type') + if self.new_object.get('name') is not None or self.new_object.get('name') is not None: + new_object_params['name'] = self.new_object.get('name') or \ + self.new_object.get('name') + if self.new_object.get('perSsidSettings') is not None or self.new_object.get('per_ssid_settings') is not None: + new_object_params['perSsidSettings'] = self.new_object.get('perSsidSettings') or \ + self.new_object.get('per_ssid_settings') if self.new_object.get('sixGhzSettings') is not None or self.new_object.get('six_ghz_settings') is not None: new_object_params['sixGhzSettings'] = self.new_object.get('sixGhzSettings') or \ self.new_object.get('six_ghz_settings') if self.new_object.get('transmission') is not None or self.new_object.get('transmission') is not None: new_object_params['transmission'] = self.new_object.get('transmission') or \ self.new_object.get('transmission') - if self.new_object.get('perSsidSettings') is not None or self.new_object.get('per_ssid_settings') is not None: - new_object_params['perSsidSettings'] = self.new_object.get('perSsidSettings') or \ - self.new_object.get('per_ssid_settings') + if self.new_object.get('twoFourGhzSettings') is not None or self.new_object.get('two_four_ghz_settings') is not None: + new_object_params['twoFourGhzSettings'] = self.new_object.get('twoFourGhzSettings') or \ + self.new_object.get('two_four_ghz_settings') if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: new_object_params['networkId'] = self.new_object.get('networkId') or \ self.new_object.get('network_id') @@ -247,16 +255,17 @@ class NetworksWirelessRfProfiles(object): requested_obj = self.new_object obj_params = [ - ("name", "name"), - ("clientBalancingEnabled", "clientBalancingEnabled"), - ("minBitrateType", "minBitrateType"), - ("bandSelectionType", "bandSelectionType"), ("apBandSettings", "apBandSettings"), - ("twoFourGhzSettings", "twoFourGhzSettings"), + ("bandSelectionType", "bandSelectionType"), + ("clientBalancingEnabled", "clientBalancingEnabled"), ("fiveGhzSettings", "fiveGhzSettings"), + ("flexRadios", "flexRadios"), + ("minBitrateType", "minBitrateType"), + ("name", "name"), + ("perSsidSettings", "perSsidSettings"), ("sixGhzSettings", "sixGhzSettings"), ("transmission", "transmission"), - ("perSsidSettings", "perSsidSettings"), + ("twoFourGhzSettings", "twoFourGhzSettings"), ("networkId", "networkId"), ("rfProfileId", "rfProfileId"), ] diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_wireless_settings.py b/ansible_collections/cisco/meraki/plugins/action/networks_wireless_settings.py index 2a7543475..4fecff005 100644 --- a/ansible_collections/cisco/meraki/plugins/action/networks_wireless_settings.py +++ b/ansible_collections/cisco/meraki/plugins/action/networks_wireless_settings.py @@ -32,11 +32,12 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present"]), - meshingEnabled=dict(type="bool"), ipv6BridgeEnabled=dict(type="bool"), + ledLightsOn=dict(type="bool"), locationAnalyticsEnabled=dict(type="bool"), + meshingEnabled=dict(type="bool"), + namedVlans=dict(type="dict"), upgradeStrategy=dict(type="str"), - ledLightsOn=dict(type="bool"), networkId=dict(type="str"), )) @@ -52,11 +53,12 @@ class NetworksWirelessSettings(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( - meshingEnabled=params.get("meshingEnabled"), ipv6BridgeEnabled=params.get("ipv6BridgeEnabled"), + ledLightsOn=params.get("ledLightsOn"), locationAnalyticsEnabled=params.get("locationAnalyticsEnabled"), + meshingEnabled=params.get("meshingEnabled"), + namedVlans=params.get("namedVlans"), upgradeStrategy=params.get("upgradeStrategy"), - ledLightsOn=params.get("ledLightsOn"), network_id=params.get("networkId"), ) @@ -69,17 +71,20 @@ class NetworksWirelessSettings(object): def update_all_params(self): new_object_params = {} - if self.new_object.get('meshingEnabled') is not None or self.new_object.get('meshing_enabled') is not None: - new_object_params['meshingEnabled'] = self.new_object.get('meshingEnabled') if self.new_object.get('ipv6BridgeEnabled') is not None or self.new_object.get('ipv6_bridge_enabled') is not None: new_object_params['ipv6BridgeEnabled'] = self.new_object.get('ipv6BridgeEnabled') + if self.new_object.get('ledLightsOn') is not None or self.new_object.get('led_lights_on') is not None: + new_object_params['ledLightsOn'] = self.new_object.get('ledLightsOn') if self.new_object.get('locationAnalyticsEnabled') is not None or self.new_object.get('location_analytics_enabled') is not None: new_object_params['locationAnalyticsEnabled'] = self.new_object.get('locationAnalyticsEnabled') + if self.new_object.get('meshingEnabled') is not None or self.new_object.get('meshing_enabled') is not None: + new_object_params['meshingEnabled'] = self.new_object.get('meshingEnabled') + if self.new_object.get('namedVlans') is not None or self.new_object.get('named_vlans') is not None: + new_object_params['namedVlans'] = self.new_object.get('namedVlans') or \ + self.new_object.get('named_vlans') if self.new_object.get('upgradeStrategy') is not None or self.new_object.get('upgrade_strategy') is not None: new_object_params['upgradeStrategy'] = self.new_object.get('upgradeStrategy') or \ self.new_object.get('upgrade_strategy') - if self.new_object.get('ledLightsOn') is not None or self.new_object.get('led_lights_on') is not None: - new_object_params['ledLightsOn'] = self.new_object.get('ledLightsOn') if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: new_object_params['networkId'] = self.new_object.get('networkId') or \ self.new_object.get('network_id') @@ -136,11 +141,12 @@ class NetworksWirelessSettings(object): requested_obj = self.new_object obj_params = [ - ("meshingEnabled", "meshingEnabled"), ("ipv6BridgeEnabled", "ipv6BridgeEnabled"), + ("ledLightsOn", "ledLightsOn"), ("locationAnalyticsEnabled", "locationAnalyticsEnabled"), + ("meshingEnabled", "meshingEnabled"), + ("namedVlans", "namedVlans"), ("upgradeStrategy", "upgradeStrategy"), - ("ledLightsOn", "ledLightsOn"), ("networkId", "networkId"), ] # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_wireless_ssids.py b/ansible_collections/cisco/meraki/plugins/action/networks_wireless_ssids.py index eb8affa88..24272855d 100644 --- a/ansible_collections/cisco/meraki/plugins/action/networks_wireless_ssids.py +++ b/ansible_collections/cisco/meraki/plugins/action/networks_wireless_ssids.py @@ -32,64 +32,65 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present"]), - name=dict(type="str"), - enabled=dict(type="bool"), + activeDirectory=dict(type="dict"), + adultContentFilteringEnabled=dict(type="bool"), + apTagsAndVlanIds=dict(type="list"), authMode=dict(type="str"), - enterpriseAdminAccess=dict(type="str"), - encryptionMode=dict(type="str"), - psk=dict(type="str"), - wpaEncryptionMode=dict(type="str"), - dot11w=dict(type="dict"), + availabilityTags=dict(type="list"), + availableOnAllAps=dict(type="bool"), + bandSelection=dict(type="str"), + concentratorNetworkId=dict(type="str"), + defaultVlanId=dict(type="int"), + disassociateClientsOnVpnFailover=dict(type="bool"), + dnsRewrite=dict(type="dict"), dot11r=dict(type="dict"), - splashPage=dict(type="str"), - splashGuestSponsorDomains=dict(type="list"), - oauth=dict(type="dict"), - localRadius=dict(type="dict"), + dot11w=dict(type="dict"), + enabled=dict(type="bool"), + encryptionMode=dict(type="str"), + enterpriseAdminAccess=dict(type="str"), + gre=dict(type="dict"), + ipAssignmentMode=dict(type="str"), + lanIsolationEnabled=dict(type="bool"), ldap=dict(type="dict"), - activeDirectory=dict(type="dict"), - radiusServers=dict(type="list"), - radiusProxyEnabled=dict(type="bool"), - radiusTestingEnabled=dict(type="bool"), - radiusCalledStationId=dict(type="str"), + localRadius=dict(type="dict"), + mandatoryDhcpEnabled=dict(type="bool"), + minBitrate=dict(type="float"), + name=dict(type="str"), + namedVlans=dict(type="dict"), + oauth=dict(type="dict"), + perClientBandwidthLimitDown=dict(type="int"), + perClientBandwidthLimitUp=dict(type="int"), + perSsidBandwidthLimitDown=dict(type="int"), + perSsidBandwidthLimitUp=dict(type="int"), + psk=dict(type="str"), + radiusAccountingEnabled=dict(type="bool"), + radiusAccountingInterimInterval=dict(type="int"), + radiusAccountingServers=dict(type="list"), + radiusAttributeForGroupPolicies=dict(type="str"), radiusAuthenticationNasId=dict(type="str"), - radiusServerTimeout=dict(type="int"), - radiusServerAttemptsLimit=dict(type="int"), - radiusFallbackEnabled=dict(type="bool"), + radiusCalledStationId=dict(type="str"), radiusCoaEnabled=dict(type="bool"), radiusFailoverPolicy=dict(type="str"), + radiusFallbackEnabled=dict(type="bool"), + radiusGuestVlanEnabled=dict(type="bool"), + radiusGuestVlanId=dict(type="int"), radiusLoadBalancingPolicy=dict(type="str"), - radiusAccountingEnabled=dict(type="bool"), - radiusAccountingServers=dict(type="list"), - radiusAccountingInterimInterval=dict(type="int"), - radiusAttributeForGroupPolicies=dict(type="str"), - ipAssignmentMode=dict(type="str"), - useVlanTagging=dict(type="bool"), - concentratorNetworkId=dict(type="str"), + radiusOverride=dict(type="bool"), + radiusProxyEnabled=dict(type="bool"), + radiusServerAttemptsLimit=dict(type="int"), + radiusServerTimeout=dict(type="int"), + radiusServers=dict(type="list"), + radiusTestingEnabled=dict(type="bool"), secondaryConcentratorNetworkId=dict(type="str"), - disassociateClientsOnVpnFailover=dict(type="bool"), + speedBurst=dict(type="dict"), + splashGuestSponsorDomains=dict(type="list"), + splashPage=dict(type="str"), + useVlanTagging=dict(type="bool"), + visible=dict(type="bool"), vlanId=dict(type="int"), - defaultVlanId=dict(type="int"), - apTagsAndVlanIds=dict(type="list"), walledGardenEnabled=dict(type="bool"), walledGardenRanges=dict(type="list"), - gre=dict(type="dict"), - radiusOverride=dict(type="bool"), - radiusGuestVlanEnabled=dict(type="bool"), - radiusGuestVlanId=dict(type="int"), - minBitrate=dict(type="float"), - bandSelection=dict(type="str"), - perClientBandwidthLimitUp=dict(type="int"), - perClientBandwidthLimitDown=dict(type="int"), - perSsidBandwidthLimitUp=dict(type="int"), - perSsidBandwidthLimitDown=dict(type="int"), - lanIsolationEnabled=dict(type="bool"), - visible=dict(type="bool"), - availableOnAllAps=dict(type="bool"), - availabilityTags=dict(type="list"), - mandatoryDhcpEnabled=dict(type="bool"), - adultContentFilteringEnabled=dict(type="bool"), - dnsRewrite=dict(type="dict"), - speedBurst=dict(type="dict"), + wpaEncryptionMode=dict(type="str"), networkId=dict(type="str"), number=dict(type="str"), )) @@ -106,64 +107,65 @@ class NetworksWirelessSsids(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( - name=params.get("name"), - enabled=params.get("enabled"), + activeDirectory=params.get("activeDirectory"), + adultContentFilteringEnabled=params.get("adultContentFilteringEnabled"), + apTagsAndVlanIds=params.get("apTagsAndVlanIds"), authMode=params.get("authMode"), - enterpriseAdminAccess=params.get("enterpriseAdminAccess"), - encryptionMode=params.get("encryptionMode"), - psk=params.get("psk"), - wpaEncryptionMode=params.get("wpaEncryptionMode"), - dot11w=params.get("dot11w"), + availabilityTags=params.get("availabilityTags"), + availableOnAllAps=params.get("availableOnAllAps"), + bandSelection=params.get("bandSelection"), + concentratorNetworkId=params.get("concentratorNetworkId"), + defaultVlanId=params.get("defaultVlanId"), + disassociateClientsOnVpnFailover=params.get("disassociateClientsOnVpnFailover"), + dnsRewrite=params.get("dnsRewrite"), dot11r=params.get("dot11r"), - splashPage=params.get("splashPage"), - splashGuestSponsorDomains=params.get("splashGuestSponsorDomains"), - oauth=params.get("oauth"), - localRadius=params.get("localRadius"), + dot11w=params.get("dot11w"), + enabled=params.get("enabled"), + encryptionMode=params.get("encryptionMode"), + enterpriseAdminAccess=params.get("enterpriseAdminAccess"), + gre=params.get("gre"), + ipAssignmentMode=params.get("ipAssignmentMode"), + lanIsolationEnabled=params.get("lanIsolationEnabled"), ldap=params.get("ldap"), - activeDirectory=params.get("activeDirectory"), - radiusServers=params.get("radiusServers"), - radiusProxyEnabled=params.get("radiusProxyEnabled"), - radiusTestingEnabled=params.get("radiusTestingEnabled"), - radiusCalledStationId=params.get("radiusCalledStationId"), + localRadius=params.get("localRadius"), + mandatoryDhcpEnabled=params.get("mandatoryDhcpEnabled"), + minBitrate=params.get("minBitrate"), + name=params.get("name"), + namedVlans=params.get("namedVlans"), + oauth=params.get("oauth"), + perClientBandwidthLimitDown=params.get("perClientBandwidthLimitDown"), + perClientBandwidthLimitUp=params.get("perClientBandwidthLimitUp"), + perSsidBandwidthLimitDown=params.get("perSsidBandwidthLimitDown"), + perSsidBandwidthLimitUp=params.get("perSsidBandwidthLimitUp"), + psk=params.get("psk"), + radiusAccountingEnabled=params.get("radiusAccountingEnabled"), + radiusAccountingInterimInterval=params.get("radiusAccountingInterimInterval"), + radiusAccountingServers=params.get("radiusAccountingServers"), + radiusAttributeForGroupPolicies=params.get("radiusAttributeForGroupPolicies"), radiusAuthenticationNasId=params.get("radiusAuthenticationNasId"), - radiusServerTimeout=params.get("radiusServerTimeout"), - radiusServerAttemptsLimit=params.get("radiusServerAttemptsLimit"), - radiusFallbackEnabled=params.get("radiusFallbackEnabled"), + radiusCalledStationId=params.get("radiusCalledStationId"), radiusCoaEnabled=params.get("radiusCoaEnabled"), radiusFailoverPolicy=params.get("radiusFailoverPolicy"), + radiusFallbackEnabled=params.get("radiusFallbackEnabled"), + radiusGuestVlanEnabled=params.get("radiusGuestVlanEnabled"), + radiusGuestVlanId=params.get("radiusGuestVlanId"), radiusLoadBalancingPolicy=params.get("radiusLoadBalancingPolicy"), - radiusAccountingEnabled=params.get("radiusAccountingEnabled"), - radiusAccountingServers=params.get("radiusAccountingServers"), - radiusAccountingInterimInterval=params.get("radiusAccountingInterimInterval"), - radiusAttributeForGroupPolicies=params.get("radiusAttributeForGroupPolicies"), - ipAssignmentMode=params.get("ipAssignmentMode"), - useVlanTagging=params.get("useVlanTagging"), - concentratorNetworkId=params.get("concentratorNetworkId"), + radiusOverride=params.get("radiusOverride"), + radiusProxyEnabled=params.get("radiusProxyEnabled"), + radiusServerAttemptsLimit=params.get("radiusServerAttemptsLimit"), + radiusServerTimeout=params.get("radiusServerTimeout"), + radiusServers=params.get("radiusServers"), + radiusTestingEnabled=params.get("radiusTestingEnabled"), secondaryConcentratorNetworkId=params.get("secondaryConcentratorNetworkId"), - disassociateClientsOnVpnFailover=params.get("disassociateClientsOnVpnFailover"), + speedBurst=params.get("speedBurst"), + splashGuestSponsorDomains=params.get("splashGuestSponsorDomains"), + splashPage=params.get("splashPage"), + useVlanTagging=params.get("useVlanTagging"), + visible=params.get("visible"), vlanId=params.get("vlanId"), - defaultVlanId=params.get("defaultVlanId"), - apTagsAndVlanIds=params.get("apTagsAndVlanIds"), walledGardenEnabled=params.get("walledGardenEnabled"), walledGardenRanges=params.get("walledGardenRanges"), - gre=params.get("gre"), - radiusOverride=params.get("radiusOverride"), - radiusGuestVlanEnabled=params.get("radiusGuestVlanEnabled"), - radiusGuestVlanId=params.get("radiusGuestVlanId"), - minBitrate=params.get("minBitrate"), - bandSelection=params.get("bandSelection"), - perClientBandwidthLimitUp=params.get("perClientBandwidthLimitUp"), - perClientBandwidthLimitDown=params.get("perClientBandwidthLimitDown"), - perSsidBandwidthLimitUp=params.get("perSsidBandwidthLimitUp"), - perSsidBandwidthLimitDown=params.get("perSsidBandwidthLimitDown"), - lanIsolationEnabled=params.get("lanIsolationEnabled"), - visible=params.get("visible"), - availableOnAllAps=params.get("availableOnAllAps"), - availabilityTags=params.get("availabilityTags"), - mandatoryDhcpEnabled=params.get("mandatoryDhcpEnabled"), - adultContentFilteringEnabled=params.get("adultContentFilteringEnabled"), - dnsRewrite=params.get("dnsRewrite"), - speedBurst=params.get("speedBurst"), + wpaEncryptionMode=params.get("wpaEncryptionMode"), network_id=params.get("networkId"), number=params.get("number"), ) @@ -186,164 +188,167 @@ class NetworksWirelessSsids(object): def update_by_id_params(self): new_object_params = {} - if self.new_object.get('name') is not None or self.new_object.get('name') is not None: - new_object_params['name'] = self.new_object.get('name') or \ - self.new_object.get('name') - if self.new_object.get('enabled') is not None or self.new_object.get('enabled') is not None: - new_object_params['enabled'] = self.new_object.get('enabled') + if self.new_object.get('activeDirectory') is not None or self.new_object.get('active_directory') is not None: + new_object_params['activeDirectory'] = self.new_object.get('activeDirectory') or \ + self.new_object.get('active_directory') + if self.new_object.get('adultContentFilteringEnabled') is not None or self.new_object.get('adult_content_filtering_enabled') is not None: + new_object_params['adultContentFilteringEnabled'] = self.new_object.get('adultContentFilteringEnabled') + if self.new_object.get('apTagsAndVlanIds') is not None or self.new_object.get('ap_tags_and_vlan_ids') is not None: + new_object_params['apTagsAndVlanIds'] = self.new_object.get('apTagsAndVlanIds') or \ + self.new_object.get('ap_tags_and_vlan_ids') if self.new_object.get('authMode') is not None or self.new_object.get('auth_mode') is not None: new_object_params['authMode'] = self.new_object.get('authMode') or \ self.new_object.get('auth_mode') - if self.new_object.get('enterpriseAdminAccess') is not None or self.new_object.get('enterprise_admin_access') is not None: - new_object_params['enterpriseAdminAccess'] = self.new_object.get('enterpriseAdminAccess') or \ - self.new_object.get('enterprise_admin_access') - if self.new_object.get('encryptionMode') is not None or self.new_object.get('encryption_mode') is not None: - new_object_params['encryptionMode'] = self.new_object.get('encryptionMode') or \ - self.new_object.get('encryption_mode') - if self.new_object.get('psk') is not None or self.new_object.get('psk') is not None: - new_object_params['psk'] = self.new_object.get('psk') or \ - self.new_object.get('psk') - if self.new_object.get('wpaEncryptionMode') is not None or self.new_object.get('wpa_encryption_mode') is not None: - new_object_params['wpaEncryptionMode'] = self.new_object.get('wpaEncryptionMode') or \ - self.new_object.get('wpa_encryption_mode') - if self.new_object.get('dot11w') is not None or self.new_object.get('dot11w') is not None: - new_object_params['dot11w'] = self.new_object.get('dot11w') or \ - self.new_object.get('dot11w') + if self.new_object.get('availabilityTags') is not None or self.new_object.get('availability_tags') is not None: + new_object_params['availabilityTags'] = self.new_object.get('availabilityTags') or \ + self.new_object.get('availability_tags') + if self.new_object.get('availableOnAllAps') is not None or self.new_object.get('available_on_all_aps') is not None: + new_object_params['availableOnAllAps'] = self.new_object.get('availableOnAllAps') + if self.new_object.get('bandSelection') is not None or self.new_object.get('band_selection') is not None: + new_object_params['bandSelection'] = self.new_object.get('bandSelection') or \ + self.new_object.get('band_selection') + if self.new_object.get('concentratorNetworkId') is not None or self.new_object.get('concentrator_network_id') is not None: + new_object_params['concentratorNetworkId'] = self.new_object.get('concentratorNetworkId') or \ + self.new_object.get('concentrator_network_id') + if self.new_object.get('defaultVlanId') is not None or self.new_object.get('default_vlan_id') is not None: + new_object_params['defaultVlanId'] = self.new_object.get('defaultVlanId') or \ + self.new_object.get('default_vlan_id') + if self.new_object.get('disassociateClientsOnVpnFailover') is not None or self.new_object.get('disassociate_clients_on_vpn_failover') is not None: + new_object_params['disassociateClientsOnVpnFailover'] = self.new_object.get('disassociateClientsOnVpnFailover') + if self.new_object.get('dnsRewrite') is not None or self.new_object.get('dns_rewrite') is not None: + new_object_params['dnsRewrite'] = self.new_object.get('dnsRewrite') or \ + self.new_object.get('dns_rewrite') if self.new_object.get('dot11r') is not None or self.new_object.get('dot11r') is not None: new_object_params['dot11r'] = self.new_object.get('dot11r') or \ self.new_object.get('dot11r') - if self.new_object.get('splashPage') is not None or self.new_object.get('splash_page') is not None: - new_object_params['splashPage'] = self.new_object.get('splashPage') or \ - self.new_object.get('splash_page') - if self.new_object.get('splashGuestSponsorDomains') is not None or self.new_object.get('splash_guest_sponsor_domains') is not None: - new_object_params['splashGuestSponsorDomains'] = self.new_object.get('splashGuestSponsorDomains') or \ - self.new_object.get('splash_guest_sponsor_domains') - if self.new_object.get('oauth') is not None or self.new_object.get('oauth') is not None: - new_object_params['oauth'] = self.new_object.get('oauth') or \ - self.new_object.get('oauth') - if self.new_object.get('localRadius') is not None or self.new_object.get('local_radius') is not None: - new_object_params['localRadius'] = self.new_object.get('localRadius') or \ - self.new_object.get('local_radius') + if self.new_object.get('dot11w') is not None or self.new_object.get('dot11w') is not None: + new_object_params['dot11w'] = self.new_object.get('dot11w') or \ + self.new_object.get('dot11w') + if self.new_object.get('enabled') is not None or self.new_object.get('enabled') is not None: + new_object_params['enabled'] = self.new_object.get('enabled') + if self.new_object.get('encryptionMode') is not None or self.new_object.get('encryption_mode') is not None: + new_object_params['encryptionMode'] = self.new_object.get('encryptionMode') or \ + self.new_object.get('encryption_mode') + if self.new_object.get('enterpriseAdminAccess') is not None or self.new_object.get('enterprise_admin_access') is not None: + new_object_params['enterpriseAdminAccess'] = self.new_object.get('enterpriseAdminAccess') or \ + self.new_object.get('enterprise_admin_access') + if self.new_object.get('gre') is not None or self.new_object.get('gre') is not None: + new_object_params['gre'] = self.new_object.get('gre') or \ + self.new_object.get('gre') + if self.new_object.get('ipAssignmentMode') is not None or self.new_object.get('ip_assignment_mode') is not None: + new_object_params['ipAssignmentMode'] = self.new_object.get('ipAssignmentMode') or \ + self.new_object.get('ip_assignment_mode') + if self.new_object.get('lanIsolationEnabled') is not None or self.new_object.get('lan_isolation_enabled') is not None: + new_object_params['lanIsolationEnabled'] = self.new_object.get('lanIsolationEnabled') if self.new_object.get('ldap') is not None or self.new_object.get('ldap') is not None: new_object_params['ldap'] = self.new_object.get('ldap') or \ self.new_object.get('ldap') - if self.new_object.get('activeDirectory') is not None or self.new_object.get('active_directory') is not None: - new_object_params['activeDirectory'] = self.new_object.get('activeDirectory') or \ - self.new_object.get('active_directory') - if self.new_object.get('radiusServers') is not None or self.new_object.get('radius_servers') is not None: - new_object_params['radiusServers'] = self.new_object.get('radiusServers') or \ - self.new_object.get('radius_servers') - if self.new_object.get('radiusProxyEnabled') is not None or self.new_object.get('radius_proxy_enabled') is not None: - new_object_params['radiusProxyEnabled'] = self.new_object.get('radiusProxyEnabled') - if self.new_object.get('radiusTestingEnabled') is not None or self.new_object.get('radius_testing_enabled') is not None: - new_object_params['radiusTestingEnabled'] = self.new_object.get('radiusTestingEnabled') - if self.new_object.get('radiusCalledStationId') is not None or self.new_object.get('radius_called_station_id') is not None: - new_object_params['radiusCalledStationId'] = self.new_object.get('radiusCalledStationId') or \ - self.new_object.get('radius_called_station_id') + if self.new_object.get('localRadius') is not None or self.new_object.get('local_radius') is not None: + new_object_params['localRadius'] = self.new_object.get('localRadius') or \ + self.new_object.get('local_radius') + if self.new_object.get('mandatoryDhcpEnabled') is not None or self.new_object.get('mandatory_dhcp_enabled') is not None: + new_object_params['mandatoryDhcpEnabled'] = self.new_object.get('mandatoryDhcpEnabled') + if self.new_object.get('minBitrate') is not None or self.new_object.get('min_bitrate') is not None: + new_object_params['minBitrate'] = self.new_object.get('minBitrate') or \ + self.new_object.get('min_bitrate') + if self.new_object.get('name') is not None or self.new_object.get('name') is not None: + new_object_params['name'] = self.new_object.get('name') or \ + self.new_object.get('name') + if self.new_object.get('namedVlans') is not None or self.new_object.get('named_vlans') is not None: + new_object_params['namedVlans'] = self.new_object.get('namedVlans') or \ + self.new_object.get('named_vlans') + if self.new_object.get('oauth') is not None or self.new_object.get('oauth') is not None: + new_object_params['oauth'] = self.new_object.get('oauth') or \ + self.new_object.get('oauth') + if self.new_object.get('perClientBandwidthLimitDown') is not None or self.new_object.get('per_client_bandwidth_limit_down') is not None: + new_object_params['perClientBandwidthLimitDown'] = self.new_object.get('perClientBandwidthLimitDown') or \ + self.new_object.get('per_client_bandwidth_limit_down') + if self.new_object.get('perClientBandwidthLimitUp') is not None or self.new_object.get('per_client_bandwidth_limit_up') is not None: + new_object_params['perClientBandwidthLimitUp'] = self.new_object.get('perClientBandwidthLimitUp') or \ + self.new_object.get('per_client_bandwidth_limit_up') + if self.new_object.get('perSsidBandwidthLimitDown') is not None or self.new_object.get('per_ssid_bandwidth_limit_down') is not None: + new_object_params['perSsidBandwidthLimitDown'] = self.new_object.get('perSsidBandwidthLimitDown') or \ + self.new_object.get('per_ssid_bandwidth_limit_down') + if self.new_object.get('perSsidBandwidthLimitUp') is not None or self.new_object.get('per_ssid_bandwidth_limit_up') is not None: + new_object_params['perSsidBandwidthLimitUp'] = self.new_object.get('perSsidBandwidthLimitUp') or \ + self.new_object.get('per_ssid_bandwidth_limit_up') + if self.new_object.get('psk') is not None or self.new_object.get('psk') is not None: + new_object_params['psk'] = self.new_object.get('psk') or \ + self.new_object.get('psk') + if self.new_object.get('radiusAccountingEnabled') is not None or self.new_object.get('radius_accounting_enabled') is not None: + new_object_params['radiusAccountingEnabled'] = self.new_object.get('radiusAccountingEnabled') + if self.new_object.get('radiusAccountingInterimInterval') is not None or self.new_object.get('radius_accounting_interim_interval') is not None: + new_object_params['radiusAccountingInterimInterval'] = self.new_object.get('radiusAccountingInterimInterval') or \ + self.new_object.get('radius_accounting_interim_interval') + if self.new_object.get('radiusAccountingServers') is not None or self.new_object.get('radius_accounting_servers') is not None: + new_object_params['radiusAccountingServers'] = self.new_object.get('radiusAccountingServers') or \ + self.new_object.get('radius_accounting_servers') + if self.new_object.get('radiusAttributeForGroupPolicies') is not None or self.new_object.get('radius_attribute_for_group_policies') is not None: + new_object_params['radiusAttributeForGroupPolicies'] = self.new_object.get('radiusAttributeForGroupPolicies') or \ + self.new_object.get('radius_attribute_for_group_policies') if self.new_object.get('radiusAuthenticationNasId') is not None or self.new_object.get('radius_authentication_nas_id') is not None: new_object_params['radiusAuthenticationNasId'] = self.new_object.get('radiusAuthenticationNasId') or \ self.new_object.get('radius_authentication_nas_id') - if self.new_object.get('radiusServerTimeout') is not None or self.new_object.get('radius_server_timeout') is not None: - new_object_params['radiusServerTimeout'] = self.new_object.get('radiusServerTimeout') or \ - self.new_object.get('radius_server_timeout') - if self.new_object.get('radiusServerAttemptsLimit') is not None or self.new_object.get('radius_server_attempts_limit') is not None: - new_object_params['radiusServerAttemptsLimit'] = self.new_object.get('radiusServerAttemptsLimit') or \ - self.new_object.get('radius_server_attempts_limit') - if self.new_object.get('radiusFallbackEnabled') is not None or self.new_object.get('radius_fallback_enabled') is not None: - new_object_params['radiusFallbackEnabled'] = self.new_object.get('radiusFallbackEnabled') + if self.new_object.get('radiusCalledStationId') is not None or self.new_object.get('radius_called_station_id') is not None: + new_object_params['radiusCalledStationId'] = self.new_object.get('radiusCalledStationId') or \ + self.new_object.get('radius_called_station_id') if self.new_object.get('radiusCoaEnabled') is not None or self.new_object.get('radius_coa_enabled') is not None: new_object_params['radiusCoaEnabled'] = self.new_object.get('radiusCoaEnabled') if self.new_object.get('radiusFailoverPolicy') is not None or self.new_object.get('radius_failover_policy') is not None: new_object_params['radiusFailoverPolicy'] = self.new_object.get('radiusFailoverPolicy') or \ self.new_object.get('radius_failover_policy') + if self.new_object.get('radiusFallbackEnabled') is not None or self.new_object.get('radius_fallback_enabled') is not None: + new_object_params['radiusFallbackEnabled'] = self.new_object.get('radiusFallbackEnabled') + if self.new_object.get('radiusGuestVlanEnabled') is not None or self.new_object.get('radius_guest_vlan_enabled') is not None: + new_object_params['radiusGuestVlanEnabled'] = self.new_object.get('radiusGuestVlanEnabled') + if self.new_object.get('radiusGuestVlanId') is not None or self.new_object.get('radius_guest_vlan_id') is not None: + new_object_params['radiusGuestVlanId'] = self.new_object.get('radiusGuestVlanId') or \ + self.new_object.get('radius_guest_vlan_id') if self.new_object.get('radiusLoadBalancingPolicy') is not None or self.new_object.get('radius_load_balancing_policy') is not None: new_object_params['radiusLoadBalancingPolicy'] = self.new_object.get('radiusLoadBalancingPolicy') or \ self.new_object.get('radius_load_balancing_policy') - if self.new_object.get('radiusAccountingEnabled') is not None or self.new_object.get('radius_accounting_enabled') is not None: - new_object_params['radiusAccountingEnabled'] = self.new_object.get('radiusAccountingEnabled') - if self.new_object.get('radiusAccountingServers') is not None or self.new_object.get('radius_accounting_servers') is not None: - new_object_params['radiusAccountingServers'] = self.new_object.get('radiusAccountingServers') or \ - self.new_object.get('radius_accounting_servers') - if self.new_object.get('radiusAccountingInterimInterval') is not None or self.new_object.get('radius_accounting_interim_interval') is not None: - new_object_params['radiusAccountingInterimInterval'] = self.new_object.get('radiusAccountingInterimInterval') or \ - self.new_object.get('radius_accounting_interim_interval') - if self.new_object.get('radiusAttributeForGroupPolicies') is not None or self.new_object.get('radius_attribute_for_group_policies') is not None: - new_object_params['radiusAttributeForGroupPolicies'] = self.new_object.get('radiusAttributeForGroupPolicies') or \ - self.new_object.get('radius_attribute_for_group_policies') - if self.new_object.get('ipAssignmentMode') is not None or self.new_object.get('ip_assignment_mode') is not None: - new_object_params['ipAssignmentMode'] = self.new_object.get('ipAssignmentMode') or \ - self.new_object.get('ip_assignment_mode') - if self.new_object.get('useVlanTagging') is not None or self.new_object.get('use_vlan_tagging') is not None: - new_object_params['useVlanTagging'] = self.new_object.get('useVlanTagging') - if self.new_object.get('concentratorNetworkId') is not None or self.new_object.get('concentrator_network_id') is not None: - new_object_params['concentratorNetworkId'] = self.new_object.get('concentratorNetworkId') or \ - self.new_object.get('concentrator_network_id') + if self.new_object.get('radiusOverride') is not None or self.new_object.get('radius_override') is not None: + new_object_params['radiusOverride'] = self.new_object.get('radiusOverride') + if self.new_object.get('radiusProxyEnabled') is not None or self.new_object.get('radius_proxy_enabled') is not None: + new_object_params['radiusProxyEnabled'] = self.new_object.get('radiusProxyEnabled') + if self.new_object.get('radiusServerAttemptsLimit') is not None or self.new_object.get('radius_server_attempts_limit') is not None: + new_object_params['radiusServerAttemptsLimit'] = self.new_object.get('radiusServerAttemptsLimit') or \ + self.new_object.get('radius_server_attempts_limit') + if self.new_object.get('radiusServerTimeout') is not None or self.new_object.get('radius_server_timeout') is not None: + new_object_params['radiusServerTimeout'] = self.new_object.get('radiusServerTimeout') or \ + self.new_object.get('radius_server_timeout') + if self.new_object.get('radiusServers') is not None or self.new_object.get('radius_servers') is not None: + new_object_params['radiusServers'] = self.new_object.get('radiusServers') or \ + self.new_object.get('radius_servers') + if self.new_object.get('radiusTestingEnabled') is not None or self.new_object.get('radius_testing_enabled') is not None: + new_object_params['radiusTestingEnabled'] = self.new_object.get('radiusTestingEnabled') if self.new_object.get('secondaryConcentratorNetworkId') is not None or self.new_object.get('secondary_concentrator_network_id') is not None: new_object_params['secondaryConcentratorNetworkId'] = self.new_object.get('secondaryConcentratorNetworkId') or \ self.new_object.get('secondary_concentrator_network_id') - if self.new_object.get('disassociateClientsOnVpnFailover') is not None or self.new_object.get('disassociate_clients_on_vpn_failover') is not None: - new_object_params['disassociateClientsOnVpnFailover'] = self.new_object.get('disassociateClientsOnVpnFailover') + if self.new_object.get('speedBurst') is not None or self.new_object.get('speed_burst') is not None: + new_object_params['speedBurst'] = self.new_object.get('speedBurst') or \ + self.new_object.get('speed_burst') + if self.new_object.get('splashGuestSponsorDomains') is not None or self.new_object.get('splash_guest_sponsor_domains') is not None: + new_object_params['splashGuestSponsorDomains'] = self.new_object.get('splashGuestSponsorDomains') or \ + self.new_object.get('splash_guest_sponsor_domains') + if self.new_object.get('splashPage') is not None or self.new_object.get('splash_page') is not None: + new_object_params['splashPage'] = self.new_object.get('splashPage') or \ + self.new_object.get('splash_page') + if self.new_object.get('useVlanTagging') is not None or self.new_object.get('use_vlan_tagging') is not None: + new_object_params['useVlanTagging'] = self.new_object.get('useVlanTagging') + if self.new_object.get('visible') is not None or self.new_object.get('visible') is not None: + new_object_params['visible'] = self.new_object.get('visible') if self.new_object.get('vlanId') is not None or self.new_object.get('vlan_id') is not None: new_object_params['vlanId'] = self.new_object.get('vlanId') or \ self.new_object.get('vlan_id') - if self.new_object.get('defaultVlanId') is not None or self.new_object.get('default_vlan_id') is not None: - new_object_params['defaultVlanId'] = self.new_object.get('defaultVlanId') or \ - self.new_object.get('default_vlan_id') - if self.new_object.get('apTagsAndVlanIds') is not None or self.new_object.get('ap_tags_and_vlan_ids') is not None: - new_object_params['apTagsAndVlanIds'] = self.new_object.get('apTagsAndVlanIds') or \ - self.new_object.get('ap_tags_and_vlan_ids') if self.new_object.get('walledGardenEnabled') is not None or self.new_object.get('walled_garden_enabled') is not None: new_object_params['walledGardenEnabled'] = self.new_object.get('walledGardenEnabled') if self.new_object.get('walledGardenRanges') is not None or self.new_object.get('walled_garden_ranges') is not None: new_object_params['walledGardenRanges'] = self.new_object.get('walledGardenRanges') or \ self.new_object.get('walled_garden_ranges') - if self.new_object.get('gre') is not None or self.new_object.get('gre') is not None: - new_object_params['gre'] = self.new_object.get('gre') or \ - self.new_object.get('gre') - if self.new_object.get('radiusOverride') is not None or self.new_object.get('radius_override') is not None: - new_object_params['radiusOverride'] = self.new_object.get('radiusOverride') - if self.new_object.get('radiusGuestVlanEnabled') is not None or self.new_object.get('radius_guest_vlan_enabled') is not None: - new_object_params['radiusGuestVlanEnabled'] = self.new_object.get('radiusGuestVlanEnabled') - if self.new_object.get('radiusGuestVlanId') is not None or self.new_object.get('radius_guest_vlan_id') is not None: - new_object_params['radiusGuestVlanId'] = self.new_object.get('radiusGuestVlanId') or \ - self.new_object.get('radius_guest_vlan_id') - if self.new_object.get('minBitrate') is not None or self.new_object.get('min_bitrate') is not None: - new_object_params['minBitrate'] = self.new_object.get('minBitrate') or \ - self.new_object.get('min_bitrate') - if self.new_object.get('bandSelection') is not None or self.new_object.get('band_selection') is not None: - new_object_params['bandSelection'] = self.new_object.get('bandSelection') or \ - self.new_object.get('band_selection') - if self.new_object.get('perClientBandwidthLimitUp') is not None or self.new_object.get('per_client_bandwidth_limit_up') is not None: - new_object_params['perClientBandwidthLimitUp'] = self.new_object.get('perClientBandwidthLimitUp') or \ - self.new_object.get('per_client_bandwidth_limit_up') - if self.new_object.get('perClientBandwidthLimitDown') is not None or self.new_object.get('per_client_bandwidth_limit_down') is not None: - new_object_params['perClientBandwidthLimitDown'] = self.new_object.get('perClientBandwidthLimitDown') or \ - self.new_object.get('per_client_bandwidth_limit_down') - if self.new_object.get('perSsidBandwidthLimitUp') is not None or self.new_object.get('per_ssid_bandwidth_limit_up') is not None: - new_object_params['perSsidBandwidthLimitUp'] = self.new_object.get('perSsidBandwidthLimitUp') or \ - self.new_object.get('per_ssid_bandwidth_limit_up') - if self.new_object.get('perSsidBandwidthLimitDown') is not None or self.new_object.get('per_ssid_bandwidth_limit_down') is not None: - new_object_params['perSsidBandwidthLimitDown'] = self.new_object.get('perSsidBandwidthLimitDown') or \ - self.new_object.get('per_ssid_bandwidth_limit_down') - if self.new_object.get('lanIsolationEnabled') is not None or self.new_object.get('lan_isolation_enabled') is not None: - new_object_params['lanIsolationEnabled'] = self.new_object.get('lanIsolationEnabled') - if self.new_object.get('visible') is not None or self.new_object.get('visible') is not None: - new_object_params['visible'] = self.new_object.get('visible') - if self.new_object.get('availableOnAllAps') is not None or self.new_object.get('available_on_all_aps') is not None: - new_object_params['availableOnAllAps'] = self.new_object.get('availableOnAllAps') - if self.new_object.get('availabilityTags') is not None or self.new_object.get('availability_tags') is not None: - new_object_params['availabilityTags'] = self.new_object.get('availabilityTags') or \ - self.new_object.get('availability_tags') - if self.new_object.get('mandatoryDhcpEnabled') is not None or self.new_object.get('mandatory_dhcp_enabled') is not None: - new_object_params['mandatoryDhcpEnabled'] = self.new_object.get('mandatoryDhcpEnabled') - if self.new_object.get('adultContentFilteringEnabled') is not None or self.new_object.get('adult_content_filtering_enabled') is not None: - new_object_params['adultContentFilteringEnabled'] = self.new_object.get('adultContentFilteringEnabled') - if self.new_object.get('dnsRewrite') is not None or self.new_object.get('dns_rewrite') is not None: - new_object_params['dnsRewrite'] = self.new_object.get('dnsRewrite') or \ - self.new_object.get('dns_rewrite') - if self.new_object.get('speedBurst') is not None or self.new_object.get('speed_burst') is not None: - new_object_params['speedBurst'] = self.new_object.get('speedBurst') or \ - self.new_object.get('speed_burst') + if self.new_object.get('wpaEncryptionMode') is not None or self.new_object.get('wpa_encryption_mode') is not None: + new_object_params['wpaEncryptionMode'] = self.new_object.get('wpaEncryptionMode') or \ + self.new_object.get('wpa_encryption_mode') if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: new_object_params['networkId'] = self.new_object.get('networkId') or \ self.new_object.get('network_id') @@ -421,64 +426,65 @@ class NetworksWirelessSsids(object): requested_obj = self.new_object obj_params = [ - ("name", "name"), - ("enabled", "enabled"), + ("activeDirectory", "activeDirectory"), + ("adultContentFilteringEnabled", "adultContentFilteringEnabled"), + ("apTagsAndVlanIds", "apTagsAndVlanIds"), ("authMode", "authMode"), - ("enterpriseAdminAccess", "enterpriseAdminAccess"), - ("encryptionMode", "encryptionMode"), - ("psk", "psk"), - ("wpaEncryptionMode", "wpaEncryptionMode"), - ("dot11w", "dot11w"), + ("availabilityTags", "availabilityTags"), + ("availableOnAllAps", "availableOnAllAps"), + ("bandSelection", "bandSelection"), + ("concentratorNetworkId", "concentratorNetworkId"), + ("defaultVlanId", "defaultVlanId"), + ("disassociateClientsOnVpnFailover", "disassociateClientsOnVpnFailover"), + ("dnsRewrite", "dnsRewrite"), ("dot11r", "dot11r"), - ("splashPage", "splashPage"), - ("splashGuestSponsorDomains", "splashGuestSponsorDomains"), - ("oauth", "oauth"), - ("localRadius", "localRadius"), + ("dot11w", "dot11w"), + ("enabled", "enabled"), + ("encryptionMode", "encryptionMode"), + ("enterpriseAdminAccess", "enterpriseAdminAccess"), + ("gre", "gre"), + ("ipAssignmentMode", "ipAssignmentMode"), + ("lanIsolationEnabled", "lanIsolationEnabled"), ("ldap", "ldap"), - ("activeDirectory", "activeDirectory"), - ("radiusServers", "radiusServers"), - ("radiusProxyEnabled", "radiusProxyEnabled"), - ("radiusTestingEnabled", "radiusTestingEnabled"), - ("radiusCalledStationId", "radiusCalledStationId"), + ("localRadius", "localRadius"), + ("mandatoryDhcpEnabled", "mandatoryDhcpEnabled"), + ("minBitrate", "minBitrate"), + ("name", "name"), + ("namedVlans", "namedVlans"), + ("oauth", "oauth"), + ("perClientBandwidthLimitDown", "perClientBandwidthLimitDown"), + ("perClientBandwidthLimitUp", "perClientBandwidthLimitUp"), + ("perSsidBandwidthLimitDown", "perSsidBandwidthLimitDown"), + ("perSsidBandwidthLimitUp", "perSsidBandwidthLimitUp"), + ("psk", "psk"), + ("radiusAccountingEnabled", "radiusAccountingEnabled"), + ("radiusAccountingInterimInterval", "radiusAccountingInterimInterval"), + ("radiusAccountingServers", "radiusAccountingServers"), + ("radiusAttributeForGroupPolicies", "radiusAttributeForGroupPolicies"), ("radiusAuthenticationNasId", "radiusAuthenticationNasId"), - ("radiusServerTimeout", "radiusServerTimeout"), - ("radiusServerAttemptsLimit", "radiusServerAttemptsLimit"), - ("radiusFallbackEnabled", "radiusFallbackEnabled"), + ("radiusCalledStationId", "radiusCalledStationId"), ("radiusCoaEnabled", "radiusCoaEnabled"), ("radiusFailoverPolicy", "radiusFailoverPolicy"), + ("radiusFallbackEnabled", "radiusFallbackEnabled"), + ("radiusGuestVlanEnabled", "radiusGuestVlanEnabled"), + ("radiusGuestVlanId", "radiusGuestVlanId"), ("radiusLoadBalancingPolicy", "radiusLoadBalancingPolicy"), - ("radiusAccountingEnabled", "radiusAccountingEnabled"), - ("radiusAccountingServers", "radiusAccountingServers"), - ("radiusAccountingInterimInterval", "radiusAccountingInterimInterval"), - ("radiusAttributeForGroupPolicies", "radiusAttributeForGroupPolicies"), - ("ipAssignmentMode", "ipAssignmentMode"), - ("useVlanTagging", "useVlanTagging"), - ("concentratorNetworkId", "concentratorNetworkId"), + ("radiusOverride", "radiusOverride"), + ("radiusProxyEnabled", "radiusProxyEnabled"), + ("radiusServerAttemptsLimit", "radiusServerAttemptsLimit"), + ("radiusServerTimeout", "radiusServerTimeout"), + ("radiusServers", "radiusServers"), + ("radiusTestingEnabled", "radiusTestingEnabled"), ("secondaryConcentratorNetworkId", "secondaryConcentratorNetworkId"), - ("disassociateClientsOnVpnFailover", "disassociateClientsOnVpnFailover"), + ("speedBurst", "speedBurst"), + ("splashGuestSponsorDomains", "splashGuestSponsorDomains"), + ("splashPage", "splashPage"), + ("useVlanTagging", "useVlanTagging"), + ("visible", "visible"), ("vlanId", "vlanId"), - ("defaultVlanId", "defaultVlanId"), - ("apTagsAndVlanIds", "apTagsAndVlanIds"), ("walledGardenEnabled", "walledGardenEnabled"), ("walledGardenRanges", "walledGardenRanges"), - ("gre", "gre"), - ("radiusOverride", "radiusOverride"), - ("radiusGuestVlanEnabled", "radiusGuestVlanEnabled"), - ("radiusGuestVlanId", "radiusGuestVlanId"), - ("minBitrate", "minBitrate"), - ("bandSelection", "bandSelection"), - ("perClientBandwidthLimitUp", "perClientBandwidthLimitUp"), - ("perClientBandwidthLimitDown", "perClientBandwidthLimitDown"), - ("perSsidBandwidthLimitUp", "perSsidBandwidthLimitUp"), - ("perSsidBandwidthLimitDown", "perSsidBandwidthLimitDown"), - ("lanIsolationEnabled", "lanIsolationEnabled"), - ("visible", "visible"), - ("availableOnAllAps", "availableOnAllAps"), - ("availabilityTags", "availabilityTags"), - ("mandatoryDhcpEnabled", "mandatoryDhcpEnabled"), - ("adultContentFilteringEnabled", "adultContentFilteringEnabled"), - ("dnsRewrite", "dnsRewrite"), - ("speedBurst", "speedBurst"), + ("wpaEncryptionMode", "wpaEncryptionMode"), ("networkId", "networkId"), ("number", "number"), ] diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_wireless_ssids_bonjour_forwarding.py b/ansible_collections/cisco/meraki/plugins/action/networks_wireless_ssids_bonjour_forwarding.py index 43f69849a..85a078a39 100644 --- a/ansible_collections/cisco/meraki/plugins/action/networks_wireless_ssids_bonjour_forwarding.py +++ b/ansible_collections/cisco/meraki/plugins/action/networks_wireless_ssids_bonjour_forwarding.py @@ -33,6 +33,7 @@ argument_spec = meraki_argument_spec() argument_spec.update(dict( state=dict(type="str", default="present", choices=["present"]), enabled=dict(type="bool"), + exception=dict(type="dict"), rules=dict(type="list"), networkId=dict(type="str"), number=dict(type="str"), @@ -51,6 +52,7 @@ class NetworksWirelessSsidsBonjourForwarding(object): self.meraki = meraki self.new_object = dict( enabled=params.get("enabled"), + exception=params.get("exception"), rules=params.get("rules"), network_id=params.get("networkId"), number=params.get("number"), @@ -69,6 +71,9 @@ class NetworksWirelessSsidsBonjourForwarding(object): new_object_params = {} if self.new_object.get('enabled') is not None or self.new_object.get('enabled') is not None: new_object_params['enabled'] = self.new_object.get('enabled') + if self.new_object.get('exception') is not None or self.new_object.get('exception') is not None: + new_object_params['exception'] = self.new_object.get('exception') or \ + self.new_object.get('exception') if self.new_object.get('rules') is not None or self.new_object.get('rules') is not None: new_object_params['rules'] = self.new_object.get('rules') or \ self.new_object.get('rules') @@ -132,6 +137,7 @@ class NetworksWirelessSsidsBonjourForwarding(object): obj_params = [ ("enabled", "enabled"), + ("exception", "exception"), ("rules", "rules"), ("networkId", "networkId"), ("number", "number"), diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_wireless_ssids_device_type_group_policies.py b/ansible_collections/cisco/meraki/plugins/action/networks_wireless_ssids_device_type_group_policies.py index 7cc30fd3e..b3890afbe 100644 --- a/ansible_collections/cisco/meraki/plugins/action/networks_wireless_ssids_device_type_group_policies.py +++ b/ansible_collections/cisco/meraki/plugins/action/networks_wireless_ssids_device_type_group_policies.py @@ -32,8 +32,8 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present"]), - enabled=dict(type="bool"), deviceTypePolicies=dict(type="list"), + enabled=dict(type="bool"), networkId=dict(type="str"), number=dict(type="str"), )) @@ -50,8 +50,8 @@ class NetworksWirelessSsidsDeviceTypeGroupPolicies(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( - enabled=params.get("enabled"), deviceTypePolicies=params.get("deviceTypePolicies"), + enabled=params.get("enabled"), network_id=params.get("networkId"), number=params.get("number"), ) @@ -67,11 +67,11 @@ class NetworksWirelessSsidsDeviceTypeGroupPolicies(object): def update_all_params(self): new_object_params = {} - if self.new_object.get('enabled') is not None or self.new_object.get('enabled') is not None: - new_object_params['enabled'] = self.new_object.get('enabled') if self.new_object.get('deviceTypePolicies') is not None or self.new_object.get('device_type_policies') is not None: new_object_params['deviceTypePolicies'] = self.new_object.get('deviceTypePolicies') or \ self.new_object.get('device_type_policies') + if self.new_object.get('enabled') is not None or self.new_object.get('enabled') is not None: + new_object_params['enabled'] = self.new_object.get('enabled') if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: new_object_params['networkId'] = self.new_object.get('networkId') or \ self.new_object.get('network_id') @@ -131,8 +131,8 @@ class NetworksWirelessSsidsDeviceTypeGroupPolicies(object): requested_obj = self.new_object obj_params = [ - ("enabled", "enabled"), ("deviceTypePolicies", "deviceTypePolicies"), + ("enabled", "enabled"), ("networkId", "networkId"), ("number", "number"), ] diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_wireless_ssids_eap_override.py b/ansible_collections/cisco/meraki/plugins/action/networks_wireless_ssids_eap_override.py index d0e924aaa..2d0748958 100644 --- a/ansible_collections/cisco/meraki/plugins/action/networks_wireless_ssids_eap_override.py +++ b/ansible_collections/cisco/meraki/plugins/action/networks_wireless_ssids_eap_override.py @@ -32,10 +32,10 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present"]), - timeout=dict(type="int"), + eapolKey=dict(type="dict"), identity=dict(type="dict"), maxRetries=dict(type="int"), - eapolKey=dict(type="dict"), + timeout=dict(type="int"), networkId=dict(type="str"), number=dict(type="str"), )) @@ -52,10 +52,10 @@ class NetworksWirelessSsidsEapOverride(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( - timeout=params.get("timeout"), + eapolKey=params.get("eapolKey"), identity=params.get("identity"), maxRetries=params.get("maxRetries"), - eapolKey=params.get("eapolKey"), + timeout=params.get("timeout"), network_id=params.get("networkId"), number=params.get("number"), ) @@ -71,18 +71,18 @@ class NetworksWirelessSsidsEapOverride(object): def update_all_params(self): new_object_params = {} - if self.new_object.get('timeout') is not None or self.new_object.get('timeout') is not None: - new_object_params['timeout'] = self.new_object.get('timeout') or \ - self.new_object.get('timeout') + if self.new_object.get('eapolKey') is not None or self.new_object.get('eapol_key') is not None: + new_object_params['eapolKey'] = self.new_object.get('eapolKey') or \ + self.new_object.get('eapol_key') if self.new_object.get('identity') is not None or self.new_object.get('identity') is not None: new_object_params['identity'] = self.new_object.get('identity') or \ self.new_object.get('identity') if self.new_object.get('maxRetries') is not None or self.new_object.get('max_retries') is not None: new_object_params['maxRetries'] = self.new_object.get('maxRetries') or \ self.new_object.get('max_retries') - if self.new_object.get('eapolKey') is not None or self.new_object.get('eapol_key') is not None: - new_object_params['eapolKey'] = self.new_object.get('eapolKey') or \ - self.new_object.get('eapol_key') + if self.new_object.get('timeout') is not None or self.new_object.get('timeout') is not None: + new_object_params['timeout'] = self.new_object.get('timeout') or \ + self.new_object.get('timeout') if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: new_object_params['networkId'] = self.new_object.get('networkId') or \ self.new_object.get('network_id') @@ -142,10 +142,10 @@ class NetworksWirelessSsidsEapOverride(object): requested_obj = self.new_object obj_params = [ - ("timeout", "timeout"), + ("eapolKey", "eapolKey"), ("identity", "identity"), ("maxRetries", "maxRetries"), - ("eapolKey", "eapolKey"), + ("timeout", "timeout"), ("networkId", "networkId"), ("number", "number"), ] diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_wireless_ssids_firewall_l3_firewall_rules.py b/ansible_collections/cisco/meraki/plugins/action/networks_wireless_ssids_firewall_l3_firewall_rules.py index 178967038..909fc147c 100644 --- a/ansible_collections/cisco/meraki/plugins/action/networks_wireless_ssids_firewall_l3_firewall_rules.py +++ b/ansible_collections/cisco/meraki/plugins/action/networks_wireless_ssids_firewall_l3_firewall_rules.py @@ -32,8 +32,8 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present"]), - rules=dict(type="list"), allowLanAccess=dict(type="bool"), + rules=dict(type="list"), networkId=dict(type="str"), number=dict(type="str"), )) @@ -50,8 +50,8 @@ class NetworksWirelessSsidsFirewallL3FirewallRules(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( - rules=params.get("rules"), allowLanAccess=params.get("allowLanAccess"), + rules=params.get("rules"), network_id=params.get("networkId"), number=params.get("number"), ) @@ -67,11 +67,11 @@ class NetworksWirelessSsidsFirewallL3FirewallRules(object): def update_all_params(self): new_object_params = {} + if self.new_object.get('allowLanAccess') is not None or self.new_object.get('allow_lan_access') is not None: + new_object_params['allowLanAccess'] = self.new_object.get('allowLanAccess') if self.new_object.get('rules') is not None or self.new_object.get('rules') is not None: new_object_params['rules'] = self.new_object.get('rules') or \ self.new_object.get('rules') - if self.new_object.get('allowLanAccess') is not None or self.new_object.get('allow_lan_access') is not None: - new_object_params['allowLanAccess'] = self.new_object.get('allowLanAccess') if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: new_object_params['networkId'] = self.new_object.get('networkId') or \ self.new_object.get('network_id') @@ -131,8 +131,8 @@ class NetworksWirelessSsidsFirewallL3FirewallRules(object): requested_obj = self.new_object obj_params = [ - ("rules", "rules"), ("allowLanAccess", "allowLanAccess"), + ("rules", "rules"), ("networkId", "networkId"), ("number", "number"), ] diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_wireless_ssids_hotspot20.py b/ansible_collections/cisco/meraki/plugins/action/networks_wireless_ssids_hotspot20.py index 553ea6544..8efc94199 100644 --- a/ansible_collections/cisco/meraki/plugins/action/networks_wireless_ssids_hotspot20.py +++ b/ansible_collections/cisco/meraki/plugins/action/networks_wireless_ssids_hotspot20.py @@ -32,14 +32,14 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present"]), - enabled=dict(type="bool"), - operator=dict(type="dict"), - venue=dict(type="dict"), - networkAccessType=dict(type="str"), domains=dict(type="list"), - roamConsortOis=dict(type="list"), + enabled=dict(type="bool"), mccMncs=dict(type="list"), naiRealms=dict(type="list"), + networkAccessType=dict(type="str"), + operator=dict(type="dict"), + roamConsortOis=dict(type="list"), + venue=dict(type="dict"), networkId=dict(type="str"), number=dict(type="str"), )) @@ -56,14 +56,14 @@ class NetworksWirelessSsidsHotspot20(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( - enabled=params.get("enabled"), - operator=params.get("operator"), - venue=params.get("venue"), - networkAccessType=params.get("networkAccessType"), domains=params.get("domains"), - roamConsortOis=params.get("roamConsortOis"), + enabled=params.get("enabled"), mccMncs=params.get("mccMncs"), naiRealms=params.get("naiRealms"), + networkAccessType=params.get("networkAccessType"), + operator=params.get("operator"), + roamConsortOis=params.get("roamConsortOis"), + venue=params.get("venue"), network_id=params.get("networkId"), number=params.get("number"), ) @@ -79,29 +79,29 @@ class NetworksWirelessSsidsHotspot20(object): def update_all_params(self): new_object_params = {} - if self.new_object.get('enabled') is not None or self.new_object.get('enabled') is not None: - new_object_params['enabled'] = self.new_object.get('enabled') - if self.new_object.get('operator') is not None or self.new_object.get('operator') is not None: - new_object_params['operator'] = self.new_object.get('operator') or \ - self.new_object.get('operator') - if self.new_object.get('venue') is not None or self.new_object.get('venue') is not None: - new_object_params['venue'] = self.new_object.get('venue') or \ - self.new_object.get('venue') - if self.new_object.get('networkAccessType') is not None or self.new_object.get('network_access_type') is not None: - new_object_params['networkAccessType'] = self.new_object.get('networkAccessType') or \ - self.new_object.get('network_access_type') if self.new_object.get('domains') is not None or self.new_object.get('domains') is not None: new_object_params['domains'] = self.new_object.get('domains') or \ self.new_object.get('domains') - if self.new_object.get('roamConsortOis') is not None or self.new_object.get('roam_consort_ois') is not None: - new_object_params['roamConsortOis'] = self.new_object.get('roamConsortOis') or \ - self.new_object.get('roam_consort_ois') + if self.new_object.get('enabled') is not None or self.new_object.get('enabled') is not None: + new_object_params['enabled'] = self.new_object.get('enabled') if self.new_object.get('mccMncs') is not None or self.new_object.get('mcc_mncs') is not None: new_object_params['mccMncs'] = self.new_object.get('mccMncs') or \ self.new_object.get('mcc_mncs') if self.new_object.get('naiRealms') is not None or self.new_object.get('nai_realms') is not None: new_object_params['naiRealms'] = self.new_object.get('naiRealms') or \ self.new_object.get('nai_realms') + if self.new_object.get('networkAccessType') is not None or self.new_object.get('network_access_type') is not None: + new_object_params['networkAccessType'] = self.new_object.get('networkAccessType') or \ + self.new_object.get('network_access_type') + if self.new_object.get('operator') is not None or self.new_object.get('operator') is not None: + new_object_params['operator'] = self.new_object.get('operator') or \ + self.new_object.get('operator') + if self.new_object.get('roamConsortOis') is not None or self.new_object.get('roam_consort_ois') is not None: + new_object_params['roamConsortOis'] = self.new_object.get('roamConsortOis') or \ + self.new_object.get('roam_consort_ois') + if self.new_object.get('venue') is not None or self.new_object.get('venue') is not None: + new_object_params['venue'] = self.new_object.get('venue') or \ + self.new_object.get('venue') if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: new_object_params['networkId'] = self.new_object.get('networkId') or \ self.new_object.get('network_id') @@ -161,14 +161,14 @@ class NetworksWirelessSsidsHotspot20(object): requested_obj = self.new_object obj_params = [ - ("enabled", "enabled"), - ("operator", "operator"), - ("venue", "venue"), - ("networkAccessType", "networkAccessType"), ("domains", "domains"), - ("roamConsortOis", "roamConsortOis"), + ("enabled", "enabled"), ("mccMncs", "mccMncs"), ("naiRealms", "naiRealms"), + ("networkAccessType", "networkAccessType"), + ("operator", "operator"), + ("roamConsortOis", "roamConsortOis"), + ("venue", "venue"), ("networkId", "networkId"), ("number", "number"), ] diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_wireless_ssids_identity_psks.py b/ansible_collections/cisco/meraki/plugins/action/networks_wireless_ssids_identity_psks.py index 266306851..995997893 100644 --- a/ansible_collections/cisco/meraki/plugins/action/networks_wireless_ssids_identity_psks.py +++ b/ansible_collections/cisco/meraki/plugins/action/networks_wireless_ssids_identity_psks.py @@ -32,10 +32,10 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present", "absent"]), + expiresAt=dict(type="str"), + groupPolicyId=dict(type="str"), name=dict(type="str"), passphrase=dict(type="str"), - groupPolicyId=dict(type="str"), - expiresAt=dict(type="str"), networkId=dict(type="str"), number=dict(type="str"), identityPskId=dict(type="str"), @@ -54,10 +54,10 @@ class NetworksWirelessSsidsIdentityPsks(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( + expiresAt=params.get("expiresAt"), + groupPolicyId=params.get("groupPolicyId"), name=params.get("name"), passphrase=params.get("passphrase"), - groupPolicyId=params.get("groupPolicyId"), - expiresAt=params.get("expiresAt"), networkId=params.get("networkId"), number=params.get("number"), identityPskId=params.get("identityPskId"), @@ -86,18 +86,18 @@ class NetworksWirelessSsidsIdentityPsks(object): def create_params(self): new_object_params = {} + if self.new_object.get('expiresAt') is not None or self.new_object.get('expires_at') is not None: + new_object_params['expiresAt'] = self.new_object.get('expiresAt') or \ + self.new_object.get('expires_at') + if self.new_object.get('groupPolicyId') is not None or self.new_object.get('group_policy_id') is not None: + new_object_params['groupPolicyId'] = self.new_object.get('groupPolicyId') or \ + self.new_object.get('group_policy_id') if self.new_object.get('name') is not None or self.new_object.get('name') is not None: new_object_params['name'] = self.new_object.get('name') or \ self.new_object.get('name') if self.new_object.get('passphrase') is not None or self.new_object.get('passphrase') is not None: new_object_params['passphrase'] = self.new_object.get('passphrase') or \ self.new_object.get('passphrase') - if self.new_object.get('groupPolicyId') is not None or self.new_object.get('group_policy_id') is not None: - new_object_params['groupPolicyId'] = self.new_object.get('groupPolicyId') or \ - self.new_object.get('group_policy_id') - if self.new_object.get('expiresAt') is not None or self.new_object.get('expires_at') is not None: - new_object_params['expiresAt'] = self.new_object.get('expiresAt') or \ - self.new_object.get('expires_at') if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: new_object_params['networkId'] = self.new_object.get('networkId') or \ self.new_object.get('network_id') @@ -121,18 +121,18 @@ class NetworksWirelessSsidsIdentityPsks(object): def update_by_id_params(self): new_object_params = {} + if self.new_object.get('expiresAt') is not None or self.new_object.get('expires_at') is not None: + new_object_params['expiresAt'] = self.new_object.get('expiresAt') or \ + self.new_object.get('expires_at') + if self.new_object.get('groupPolicyId') is not None or self.new_object.get('group_policy_id') is not None: + new_object_params['groupPolicyId'] = self.new_object.get('groupPolicyId') or \ + self.new_object.get('group_policy_id') if self.new_object.get('name') is not None or self.new_object.get('name') is not None: new_object_params['name'] = self.new_object.get('name') or \ self.new_object.get('name') if self.new_object.get('passphrase') is not None or self.new_object.get('passphrase') is not None: new_object_params['passphrase'] = self.new_object.get('passphrase') or \ self.new_object.get('passphrase') - if self.new_object.get('groupPolicyId') is not None or self.new_object.get('group_policy_id') is not None: - new_object_params['groupPolicyId'] = self.new_object.get('groupPolicyId') or \ - self.new_object.get('group_policy_id') - if self.new_object.get('expiresAt') is not None or self.new_object.get('expires_at') is not None: - new_object_params['expiresAt'] = self.new_object.get('expiresAt') or \ - self.new_object.get('expires_at') if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: new_object_params['networkId'] = self.new_object.get('networkId') or \ self.new_object.get('network_id') @@ -213,10 +213,10 @@ class NetworksWirelessSsidsIdentityPsks(object): requested_obj = self.new_object obj_params = [ + ("expiresAt", "expiresAt"), + ("groupPolicyId", "groupPolicyId"), ("name", "name"), ("passphrase", "passphrase"), - ("groupPolicyId", "groupPolicyId"), - ("expiresAt", "expiresAt"), ("networkId", "networkId"), ("number", "number"), ("identityPskId", "identityPskId"), diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_wireless_ssids_splash_settings.py b/ansible_collections/cisco/meraki/plugins/action/networks_wireless_ssids_splash_settings.py index 71989ade2..b062af863 100644 --- a/ansible_collections/cisco/meraki/plugins/action/networks_wireless_ssids_splash_settings.py +++ b/ansible_collections/cisco/meraki/plugins/action/networks_wireless_ssids_splash_settings.py @@ -32,21 +32,22 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present"]), - splashUrl=dict(type="str"), - useSplashUrl=dict(type="bool"), - splashTimeout=dict(type="int"), - redirectUrl=dict(type="str"), - useRedirectUrl=dict(type="bool"), - welcomeMessage=dict(type="str"), - splashLogo=dict(type="dict"), - splashImage=dict(type="dict"), - splashPrepaidFront=dict(type="dict"), + allowSimultaneousLogins=dict(type="bool"), + billing=dict(type="dict"), blockAllTrafficBeforeSignOn=dict(type="bool"), controllerDisconnectionBehavior=dict(type="str"), - allowSimultaneousLogins=dict(type="bool"), guestSponsorship=dict(type="dict"), - billing=dict(type="dict"), + redirectUrl=dict(type="str"), sentryEnrollment=dict(type="dict"), + splashImage=dict(type="dict"), + splashLogo=dict(type="dict"), + splashPrepaidFront=dict(type="dict"), + splashTimeout=dict(type="int"), + splashUrl=dict(type="str"), + themeId=dict(type="str"), + useRedirectUrl=dict(type="bool"), + useSplashUrl=dict(type="bool"), + welcomeMessage=dict(type="str"), networkId=dict(type="str"), number=dict(type="str"), )) @@ -63,21 +64,22 @@ class NetworksWirelessSsidsSplashSettings(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( - splashUrl=params.get("splashUrl"), - useSplashUrl=params.get("useSplashUrl"), - splashTimeout=params.get("splashTimeout"), - redirectUrl=params.get("redirectUrl"), - useRedirectUrl=params.get("useRedirectUrl"), - welcomeMessage=params.get("welcomeMessage"), - splashLogo=params.get("splashLogo"), - splashImage=params.get("splashImage"), - splashPrepaidFront=params.get("splashPrepaidFront"), + allowSimultaneousLogins=params.get("allowSimultaneousLogins"), + billing=params.get("billing"), blockAllTrafficBeforeSignOn=params.get("blockAllTrafficBeforeSignOn"), controllerDisconnectionBehavior=params.get("controllerDisconnectionBehavior"), - allowSimultaneousLogins=params.get("allowSimultaneousLogins"), guestSponsorship=params.get("guestSponsorship"), - billing=params.get("billing"), + redirectUrl=params.get("redirectUrl"), sentryEnrollment=params.get("sentryEnrollment"), + splashImage=params.get("splashImage"), + splashLogo=params.get("splashLogo"), + splashPrepaidFront=params.get("splashPrepaidFront"), + splashTimeout=params.get("splashTimeout"), + splashUrl=params.get("splashUrl"), + themeId=params.get("themeId"), + useRedirectUrl=params.get("useRedirectUrl"), + useSplashUrl=params.get("useSplashUrl"), + welcomeMessage=params.get("welcomeMessage"), network_id=params.get("networkId"), number=params.get("number"), ) @@ -93,47 +95,50 @@ class NetworksWirelessSsidsSplashSettings(object): def update_all_params(self): new_object_params = {} - if self.new_object.get('splashUrl') is not None or self.new_object.get('splash_url') is not None: - new_object_params['splashUrl'] = self.new_object.get('splashUrl') or \ - self.new_object.get('splash_url') - if self.new_object.get('useSplashUrl') is not None or self.new_object.get('use_splash_url') is not None: - new_object_params['useSplashUrl'] = self.new_object.get('useSplashUrl') - if self.new_object.get('splashTimeout') is not None or self.new_object.get('splash_timeout') is not None: - new_object_params['splashTimeout'] = self.new_object.get('splashTimeout') or \ - self.new_object.get('splash_timeout') - if self.new_object.get('redirectUrl') is not None or self.new_object.get('redirect_url') is not None: - new_object_params['redirectUrl'] = self.new_object.get('redirectUrl') or \ - self.new_object.get('redirect_url') - if self.new_object.get('useRedirectUrl') is not None or self.new_object.get('use_redirect_url') is not None: - new_object_params['useRedirectUrl'] = self.new_object.get('useRedirectUrl') - if self.new_object.get('welcomeMessage') is not None or self.new_object.get('welcome_message') is not None: - new_object_params['welcomeMessage'] = self.new_object.get('welcomeMessage') or \ - self.new_object.get('welcome_message') - if self.new_object.get('splashLogo') is not None or self.new_object.get('splash_logo') is not None: - new_object_params['splashLogo'] = self.new_object.get('splashLogo') or \ - self.new_object.get('splash_logo') - if self.new_object.get('splashImage') is not None or self.new_object.get('splash_image') is not None: - new_object_params['splashImage'] = self.new_object.get('splashImage') or \ - self.new_object.get('splash_image') - if self.new_object.get('splashPrepaidFront') is not None or self.new_object.get('splash_prepaid_front') is not None: - new_object_params['splashPrepaidFront'] = self.new_object.get('splashPrepaidFront') or \ - self.new_object.get('splash_prepaid_front') + if self.new_object.get('allowSimultaneousLogins') is not None or self.new_object.get('allow_simultaneous_logins') is not None: + new_object_params['allowSimultaneousLogins'] = self.new_object.get('allowSimultaneousLogins') + if self.new_object.get('billing') is not None or self.new_object.get('billing') is not None: + new_object_params['billing'] = self.new_object.get('billing') or \ + self.new_object.get('billing') if self.new_object.get('blockAllTrafficBeforeSignOn') is not None or self.new_object.get('block_all_traffic_before_sign_on') is not None: new_object_params['blockAllTrafficBeforeSignOn'] = self.new_object.get('blockAllTrafficBeforeSignOn') if self.new_object.get('controllerDisconnectionBehavior') is not None or self.new_object.get('controller_disconnection_behavior') is not None: new_object_params['controllerDisconnectionBehavior'] = self.new_object.get('controllerDisconnectionBehavior') or \ self.new_object.get('controller_disconnection_behavior') - if self.new_object.get('allowSimultaneousLogins') is not None or self.new_object.get('allow_simultaneous_logins') is not None: - new_object_params['allowSimultaneousLogins'] = self.new_object.get('allowSimultaneousLogins') if self.new_object.get('guestSponsorship') is not None or self.new_object.get('guest_sponsorship') is not None: new_object_params['guestSponsorship'] = self.new_object.get('guestSponsorship') or \ self.new_object.get('guest_sponsorship') - if self.new_object.get('billing') is not None or self.new_object.get('billing') is not None: - new_object_params['billing'] = self.new_object.get('billing') or \ - self.new_object.get('billing') + if self.new_object.get('redirectUrl') is not None or self.new_object.get('redirect_url') is not None: + new_object_params['redirectUrl'] = self.new_object.get('redirectUrl') or \ + self.new_object.get('redirect_url') if self.new_object.get('sentryEnrollment') is not None or self.new_object.get('sentry_enrollment') is not None: new_object_params['sentryEnrollment'] = self.new_object.get('sentryEnrollment') or \ self.new_object.get('sentry_enrollment') + if self.new_object.get('splashImage') is not None or self.new_object.get('splash_image') is not None: + new_object_params['splashImage'] = self.new_object.get('splashImage') or \ + self.new_object.get('splash_image') + if self.new_object.get('splashLogo') is not None or self.new_object.get('splash_logo') is not None: + new_object_params['splashLogo'] = self.new_object.get('splashLogo') or \ + self.new_object.get('splash_logo') + if self.new_object.get('splashPrepaidFront') is not None or self.new_object.get('splash_prepaid_front') is not None: + new_object_params['splashPrepaidFront'] = self.new_object.get('splashPrepaidFront') or \ + self.new_object.get('splash_prepaid_front') + if self.new_object.get('splashTimeout') is not None or self.new_object.get('splash_timeout') is not None: + new_object_params['splashTimeout'] = self.new_object.get('splashTimeout') or \ + self.new_object.get('splash_timeout') + if self.new_object.get('splashUrl') is not None or self.new_object.get('splash_url') is not None: + new_object_params['splashUrl'] = self.new_object.get('splashUrl') or \ + self.new_object.get('splash_url') + if self.new_object.get('themeId') is not None or self.new_object.get('theme_id') is not None: + new_object_params['themeId'] = self.new_object.get('themeId') or \ + self.new_object.get('theme_id') + if self.new_object.get('useRedirectUrl') is not None or self.new_object.get('use_redirect_url') is not None: + new_object_params['useRedirectUrl'] = self.new_object.get('useRedirectUrl') + if self.new_object.get('useSplashUrl') is not None or self.new_object.get('use_splash_url') is not None: + new_object_params['useSplashUrl'] = self.new_object.get('useSplashUrl') + if self.new_object.get('welcomeMessage') is not None or self.new_object.get('welcome_message') is not None: + new_object_params['welcomeMessage'] = self.new_object.get('welcomeMessage') or \ + self.new_object.get('welcome_message') if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: new_object_params['networkId'] = self.new_object.get('networkId') or \ self.new_object.get('network_id') @@ -193,21 +198,22 @@ class NetworksWirelessSsidsSplashSettings(object): requested_obj = self.new_object obj_params = [ - ("splashUrl", "splashUrl"), - ("useSplashUrl", "useSplashUrl"), - ("splashTimeout", "splashTimeout"), - ("redirectUrl", "redirectUrl"), - ("useRedirectUrl", "useRedirectUrl"), - ("welcomeMessage", "welcomeMessage"), - ("splashLogo", "splashLogo"), - ("splashImage", "splashImage"), - ("splashPrepaidFront", "splashPrepaidFront"), + ("allowSimultaneousLogins", "allowSimultaneousLogins"), + ("billing", "billing"), ("blockAllTrafficBeforeSignOn", "blockAllTrafficBeforeSignOn"), ("controllerDisconnectionBehavior", "controllerDisconnectionBehavior"), - ("allowSimultaneousLogins", "allowSimultaneousLogins"), ("guestSponsorship", "guestSponsorship"), - ("billing", "billing"), + ("redirectUrl", "redirectUrl"), ("sentryEnrollment", "sentryEnrollment"), + ("splashImage", "splashImage"), + ("splashLogo", "splashLogo"), + ("splashPrepaidFront", "splashPrepaidFront"), + ("splashTimeout", "splashTimeout"), + ("splashUrl", "splashUrl"), + ("themeId", "themeId"), + ("useRedirectUrl", "useRedirectUrl"), + ("useSplashUrl", "useSplashUrl"), + ("welcomeMessage", "welcomeMessage"), ("networkId", "networkId"), ("number", "number"), ] diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_wireless_ssids_traffic_shaping_rules.py b/ansible_collections/cisco/meraki/plugins/action/networks_wireless_ssids_traffic_shaping_rules.py index de13a0d80..bddddcbea 100644 --- a/ansible_collections/cisco/meraki/plugins/action/networks_wireless_ssids_traffic_shaping_rules.py +++ b/ansible_collections/cisco/meraki/plugins/action/networks_wireless_ssids_traffic_shaping_rules.py @@ -32,9 +32,9 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present"]), - trafficShapingEnabled=dict(type="bool"), defaultRulesEnabled=dict(type="bool"), rules=dict(type="list"), + trafficShapingEnabled=dict(type="bool"), networkId=dict(type="str"), number=dict(type="str"), )) @@ -51,9 +51,9 @@ class NetworksWirelessSsidsTrafficShapingRules(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( - trafficShapingEnabled=params.get("trafficShapingEnabled"), defaultRulesEnabled=params.get("defaultRulesEnabled"), rules=params.get("rules"), + trafficShapingEnabled=params.get("trafficShapingEnabled"), network_id=params.get("networkId"), number=params.get("number"), ) @@ -69,13 +69,13 @@ class NetworksWirelessSsidsTrafficShapingRules(object): def update_all_params(self): new_object_params = {} - if self.new_object.get('trafficShapingEnabled') is not None or self.new_object.get('traffic_shaping_enabled') is not None: - new_object_params['trafficShapingEnabled'] = self.new_object.get('trafficShapingEnabled') if self.new_object.get('defaultRulesEnabled') is not None or self.new_object.get('default_rules_enabled') is not None: new_object_params['defaultRulesEnabled'] = self.new_object.get('defaultRulesEnabled') if self.new_object.get('rules') is not None or self.new_object.get('rules') is not None: new_object_params['rules'] = self.new_object.get('rules') or \ self.new_object.get('rules') + if self.new_object.get('trafficShapingEnabled') is not None or self.new_object.get('traffic_shaping_enabled') is not None: + new_object_params['trafficShapingEnabled'] = self.new_object.get('trafficShapingEnabled') if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: new_object_params['networkId'] = self.new_object.get('networkId') or \ self.new_object.get('network_id') @@ -135,9 +135,9 @@ class NetworksWirelessSsidsTrafficShapingRules(object): requested_obj = self.new_object obj_params = [ - ("trafficShapingEnabled", "trafficShapingEnabled"), ("defaultRulesEnabled", "defaultRulesEnabled"), ("rules", "rules"), + ("trafficShapingEnabled", "trafficShapingEnabled"), ("networkId", "networkId"), ("number", "number"), ] diff --git a/ansible_collections/cisco/meraki/plugins/action/networks_wireless_ssids_vpn.py b/ansible_collections/cisco/meraki/plugins/action/networks_wireless_ssids_vpn.py index cc3836353..a66830f81 100644 --- a/ansible_collections/cisco/meraki/plugins/action/networks_wireless_ssids_vpn.py +++ b/ansible_collections/cisco/meraki/plugins/action/networks_wireless_ssids_vpn.py @@ -33,8 +33,8 @@ argument_spec = meraki_argument_spec() argument_spec.update(dict( state=dict(type="str", default="present", choices=["present"]), concentrator=dict(type="dict"), - splitTunnel=dict(type="dict"), failover=dict(type="dict"), + splitTunnel=dict(type="dict"), networkId=dict(type="str"), number=dict(type="str"), )) @@ -52,8 +52,8 @@ class NetworksWirelessSsidsVpn(object): self.meraki = meraki self.new_object = dict( concentrator=params.get("concentrator"), - splitTunnel=params.get("splitTunnel"), failover=params.get("failover"), + splitTunnel=params.get("splitTunnel"), network_id=params.get("networkId"), number=params.get("number"), ) @@ -72,12 +72,12 @@ class NetworksWirelessSsidsVpn(object): if self.new_object.get('concentrator') is not None or self.new_object.get('concentrator') is not None: new_object_params['concentrator'] = self.new_object.get('concentrator') or \ self.new_object.get('concentrator') - if self.new_object.get('splitTunnel') is not None or self.new_object.get('split_tunnel') is not None: - new_object_params['splitTunnel'] = self.new_object.get('splitTunnel') or \ - self.new_object.get('split_tunnel') if self.new_object.get('failover') is not None or self.new_object.get('failover') is not None: new_object_params['failover'] = self.new_object.get('failover') or \ self.new_object.get('failover') + if self.new_object.get('splitTunnel') is not None or self.new_object.get('split_tunnel') is not None: + new_object_params['splitTunnel'] = self.new_object.get('splitTunnel') or \ + self.new_object.get('split_tunnel') if self.new_object.get('networkId') is not None or self.new_object.get('network_id') is not None: new_object_params['networkId'] = self.new_object.get('networkId') or \ self.new_object.get('network_id') @@ -138,8 +138,8 @@ class NetworksWirelessSsidsVpn(object): obj_params = [ ("concentrator", "concentrator"), - ("splitTunnel", "splitTunnel"), ("failover", "failover"), + ("splitTunnel", "splitTunnel"), ("networkId", "networkId"), ("number", "number"), ] diff --git a/ansible_collections/cisco/meraki/plugins/action/organizations.py b/ansible_collections/cisco/meraki/plugins/action/organizations.py index 0cb1670ef..410ebc37d 100644 --- a/ansible_collections/cisco/meraki/plugins/action/organizations.py +++ b/ansible_collections/cisco/meraki/plugins/action/organizations.py @@ -32,8 +32,8 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present", "absent"]), - name=dict(type="str"), management=dict(type="dict"), + name=dict(type="str"), organizationId=dict(type="str"), api=dict(type="dict"), )) @@ -51,14 +51,24 @@ class Organizations(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( - name=params.get("name"), management=params.get("management"), + name=params.get("name"), organizationId=params.get("organizationId"), api=params.get("api"), ) def get_all_params(self, name=None, id=None): new_object_params = {} + if self.new_object.get('perPage') is not None or self.new_object.get('per_page') is not None: + new_object_params['perPage'] = self.new_object.get('perPage') or \ + self.new_object.get('per_page') + new_object_params['total_pages'] = -1 + if self.new_object.get('startingAfter') is not None or self.new_object.get('starting_after') is not None: + new_object_params['startingAfter'] = self.new_object.get('startingAfter') or \ + self.new_object.get('starting_after') + if self.new_object.get('endingBefore') is not None or self.new_object.get('ending_before') is not None: + new_object_params['endingBefore'] = self.new_object.get('endingBefore') or \ + self.new_object.get('ending_before') return new_object_params def get_params_by_id(self, name=None, id=None): @@ -70,12 +80,12 @@ class Organizations(object): def create_params(self): new_object_params = {} - if self.new_object.get('name') is not None or self.new_object.get('name') is not None: - new_object_params['name'] = self.new_object.get('name') or \ - self.new_object.get('name') if self.new_object.get('management') is not None or self.new_object.get('management') is not None: new_object_params['management'] = self.new_object.get('management') or \ self.new_object.get('management') + if self.new_object.get('name') is not None or self.new_object.get('name') is not None: + new_object_params['name'] = self.new_object.get('name') or \ + self.new_object.get('name') return new_object_params def delete_by_id_params(self): @@ -87,15 +97,15 @@ class Organizations(object): def update_by_id_params(self): new_object_params = {} - if self.new_object.get('name') is not None or self.new_object.get('name') is not None: - new_object_params['name'] = self.new_object.get('name') or \ - self.new_object.get('name') - if self.new_object.get('management') is not None or self.new_object.get('management') is not None: - new_object_params['management'] = self.new_object.get('management') or \ - self.new_object.get('management') if self.new_object.get('api') is not None or self.new_object.get('api') is not None: new_object_params['api'] = self.new_object.get('api') or \ self.new_object.get('api') + if self.new_object.get('management') is not None or self.new_object.get('management') is not None: + new_object_params['management'] = self.new_object.get('management') or \ + self.new_object.get('management') + if self.new_object.get('name') is not None or self.new_object.get('name') is not None: + new_object_params['name'] = self.new_object.get('name') or \ + self.new_object.get('name') if self.new_object.get('organizationId') is not None or self.new_object.get('organization_id') is not None: new_object_params['organizationId'] = self.new_object.get('organizationId') or \ self.new_object.get('organization_id') @@ -170,8 +180,8 @@ class Organizations(object): requested_obj = self.new_object obj_params = [ - ("name", "name"), ("management", "management"), + ("name", "name"), ("organizationId", "organizationId"), ("api", "api"), ] diff --git a/ansible_collections/cisco/meraki/plugins/action/organizations_action_batches.py b/ansible_collections/cisco/meraki/plugins/action/organizations_action_batches.py index 8780b3e82..92a82e869 100644 --- a/ansible_collections/cisco/meraki/plugins/action/organizations_action_batches.py +++ b/ansible_collections/cisco/meraki/plugins/action/organizations_action_batches.py @@ -32,9 +32,10 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present", "absent"]), + actions=dict(type="list"), + callback=dict(type="dict"), confirmed=dict(type="bool"), synchronous=dict(type="bool"), - actions=dict(type="list"), organizationId=dict(type="str"), actionBatchId=dict(type="str"), )) @@ -52,9 +53,10 @@ class OrganizationsActionBatches(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( + actions=params.get("actions"), + callback=params.get("callback"), confirmed=params.get("confirmed"), synchronous=params.get("synchronous"), - actions=params.get("actions"), organizationId=params.get("organizationId"), actionBatchId=params.get("actionBatchId"), ) @@ -80,13 +82,16 @@ class OrganizationsActionBatches(object): def create_params(self): new_object_params = {} + if self.new_object.get('actions') is not None or self.new_object.get('actions') is not None: + new_object_params['actions'] = self.new_object.get('actions') or \ + self.new_object.get('actions') + if self.new_object.get('callback') is not None or self.new_object.get('callback') is not None: + new_object_params['callback'] = self.new_object.get('callback') or \ + self.new_object.get('callback') if self.new_object.get('confirmed') is not None or self.new_object.get('confirmed') is not None: new_object_params['confirmed'] = self.new_object.get('confirmed') if self.new_object.get('synchronous') is not None or self.new_object.get('synchronous') is not None: new_object_params['synchronous'] = self.new_object.get('synchronous') - if self.new_object.get('actions') is not None or self.new_object.get('actions') is not None: - new_object_params['actions'] = self.new_object.get('actions') or \ - self.new_object.get('actions') if self.new_object.get('organizationId') is not None or self.new_object.get('organization_id') is not None: new_object_params['organizationId'] = self.new_object.get('organizationId') or \ self.new_object.get('organization_id') @@ -185,9 +190,10 @@ class OrganizationsActionBatches(object): requested_obj = self.new_object obj_params = [ + ("actions", "actions"), + ("callback", "callback"), ("confirmed", "confirmed"), ("synchronous", "synchronous"), - ("actions", "actions"), ("organizationId", "organizationId"), ("actionBatchId", "actionBatchId"), ] diff --git a/ansible_collections/cisco/meraki/plugins/action/organizations_adaptive_policy_acls.py b/ansible_collections/cisco/meraki/plugins/action/organizations_adaptive_policy_acls.py index cc445e11f..b5249443c 100644 --- a/ansible_collections/cisco/meraki/plugins/action/organizations_adaptive_policy_acls.py +++ b/ansible_collections/cisco/meraki/plugins/action/organizations_adaptive_policy_acls.py @@ -32,10 +32,10 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present", "absent"]), - name=dict(type="str"), description=dict(type="str"), - rules=dict(type="list"), ipVersion=dict(type="str"), + name=dict(type="str"), + rules=dict(type="list"), organizationId=dict(type="str"), aclId=dict(type="str"), )) @@ -53,10 +53,10 @@ class OrganizationsAdaptivePolicyAcls(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( - name=params.get("name"), description=params.get("description"), - rules=params.get("rules"), ipVersion=params.get("ipVersion"), + name=params.get("name"), + rules=params.get("rules"), organizationId=params.get("organizationId"), aclId=params.get("aclId"), ) @@ -80,18 +80,18 @@ class OrganizationsAdaptivePolicyAcls(object): def create_params(self): new_object_params = {} - if self.new_object.get('name') is not None or self.new_object.get('name') is not None: - new_object_params['name'] = self.new_object.get('name') or \ - self.new_object.get('name') if self.new_object.get('description') is not None or self.new_object.get('description') is not None: new_object_params['description'] = self.new_object.get('description') or \ self.new_object.get('description') - if self.new_object.get('rules') is not None or self.new_object.get('rules') is not None: - new_object_params['rules'] = self.new_object.get('rules') or \ - self.new_object.get('rules') if self.new_object.get('ipVersion') is not None or self.new_object.get('ip_version') is not None: new_object_params['ipVersion'] = self.new_object.get('ipVersion') or \ self.new_object.get('ip_version') + if self.new_object.get('name') is not None or self.new_object.get('name') is not None: + new_object_params['name'] = self.new_object.get('name') or \ + self.new_object.get('name') + if self.new_object.get('rules') is not None or self.new_object.get('rules') is not None: + new_object_params['rules'] = self.new_object.get('rules') or \ + self.new_object.get('rules') if self.new_object.get('organizationId') is not None or self.new_object.get('organization_id') is not None: new_object_params['organizationId'] = self.new_object.get('organizationId') or \ self.new_object.get('organization_id') @@ -109,18 +109,18 @@ class OrganizationsAdaptivePolicyAcls(object): def update_by_id_params(self): new_object_params = {} - if self.new_object.get('name') is not None or self.new_object.get('name') is not None: - new_object_params['name'] = self.new_object.get('name') or \ - self.new_object.get('name') if self.new_object.get('description') is not None or self.new_object.get('description') is not None: new_object_params['description'] = self.new_object.get('description') or \ self.new_object.get('description') - if self.new_object.get('rules') is not None or self.new_object.get('rules') is not None: - new_object_params['rules'] = self.new_object.get('rules') or \ - self.new_object.get('rules') if self.new_object.get('ipVersion') is not None or self.new_object.get('ip_version') is not None: new_object_params['ipVersion'] = self.new_object.get('ipVersion') or \ self.new_object.get('ip_version') + if self.new_object.get('name') is not None or self.new_object.get('name') is not None: + new_object_params['name'] = self.new_object.get('name') or \ + self.new_object.get('name') + if self.new_object.get('rules') is not None or self.new_object.get('rules') is not None: + new_object_params['rules'] = self.new_object.get('rules') or \ + self.new_object.get('rules') if self.new_object.get('organizationId') is not None or self.new_object.get('organization_id') is not None: new_object_params['organizationId'] = self.new_object.get('organizationId') or \ self.new_object.get('organization_id') @@ -198,10 +198,10 @@ class OrganizationsAdaptivePolicyAcls(object): requested_obj = self.new_object obj_params = [ - ("name", "name"), ("description", "description"), - ("rules", "rules"), ("ipVersion", "ipVersion"), + ("name", "name"), + ("rules", "rules"), ("organizationId", "organizationId"), ("aclId", "aclId"), ] diff --git a/ansible_collections/cisco/meraki/plugins/action/organizations_adaptive_policy_groups.py b/ansible_collections/cisco/meraki/plugins/action/organizations_adaptive_policy_groups.py index f170a7ad0..7a871b57b 100644 --- a/ansible_collections/cisco/meraki/plugins/action/organizations_adaptive_policy_groups.py +++ b/ansible_collections/cisco/meraki/plugins/action/organizations_adaptive_policy_groups.py @@ -32,10 +32,10 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present", "absent"]), - name=dict(type="str"), - sgt=dict(type="int"), description=dict(type="str"), + name=dict(type="str"), policyObjects=dict(type="list"), + sgt=dict(type="int"), organizationId=dict(type="str"), id=dict(type="str"), )) @@ -53,10 +53,10 @@ class OrganizationsAdaptivePolicyGroups(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( - name=params.get("name"), - sgt=params.get("sgt"), description=params.get("description"), + name=params.get("name"), policyObjects=params.get("policyObjects"), + sgt=params.get("sgt"), organizationId=params.get("organizationId"), id=params.get("id"), ) @@ -79,18 +79,18 @@ class OrganizationsAdaptivePolicyGroups(object): def create_params(self): new_object_params = {} - if self.new_object.get('name') is not None or self.new_object.get('name') is not None: - new_object_params['name'] = self.new_object.get('name') or \ - self.new_object.get('name') - if self.new_object.get('sgt') is not None or self.new_object.get('sgt') is not None: - new_object_params['sgt'] = self.new_object.get('sgt') or \ - self.new_object.get('sgt') if self.new_object.get('description') is not None or self.new_object.get('description') is not None: new_object_params['description'] = self.new_object.get('description') or \ self.new_object.get('description') + if self.new_object.get('name') is not None or self.new_object.get('name') is not None: + new_object_params['name'] = self.new_object.get('name') or \ + self.new_object.get('name') if self.new_object.get('policyObjects') is not None or self.new_object.get('policy_objects') is not None: new_object_params['policyObjects'] = self.new_object.get('policyObjects') or \ self.new_object.get('policy_objects') + if self.new_object.get('sgt') is not None or self.new_object.get('sgt') is not None: + new_object_params['sgt'] = self.new_object.get('sgt') or \ + self.new_object.get('sgt') if self.new_object.get('organizationId') is not None or self.new_object.get('organization_id') is not None: new_object_params['organizationId'] = self.new_object.get('organizationId') or \ self.new_object.get('organization_id') @@ -108,18 +108,18 @@ class OrganizationsAdaptivePolicyGroups(object): def update_by_id_params(self): new_object_params = {} - if self.new_object.get('name') is not None or self.new_object.get('name') is not None: - new_object_params['name'] = self.new_object.get('name') or \ - self.new_object.get('name') - if self.new_object.get('sgt') is not None or self.new_object.get('sgt') is not None: - new_object_params['sgt'] = self.new_object.get('sgt') or \ - self.new_object.get('sgt') if self.new_object.get('description') is not None or self.new_object.get('description') is not None: new_object_params['description'] = self.new_object.get('description') or \ self.new_object.get('description') + if self.new_object.get('name') is not None or self.new_object.get('name') is not None: + new_object_params['name'] = self.new_object.get('name') or \ + self.new_object.get('name') if self.new_object.get('policyObjects') is not None or self.new_object.get('policy_objects') is not None: new_object_params['policyObjects'] = self.new_object.get('policyObjects') or \ self.new_object.get('policy_objects') + if self.new_object.get('sgt') is not None or self.new_object.get('sgt') is not None: + new_object_params['sgt'] = self.new_object.get('sgt') or \ + self.new_object.get('sgt') if self.new_object.get('organizationId') is not None or self.new_object.get('organization_id') is not None: new_object_params['organizationId'] = self.new_object.get('organizationId') or \ self.new_object.get('organization_id') @@ -193,10 +193,10 @@ class OrganizationsAdaptivePolicyGroups(object): requested_obj = self.new_object obj_params = [ - ("name", "name"), - ("sgt", "sgt"), ("description", "description"), + ("name", "name"), ("policyObjects", "policyObjects"), + ("sgt", "sgt"), ("organizationId", "organizationId"), ("id", "id"), ] diff --git a/ansible_collections/cisco/meraki/plugins/action/organizations_adaptive_policy_policies.py b/ansible_collections/cisco/meraki/plugins/action/organizations_adaptive_policy_policies.py index 9717b4aef..856b7ac16 100644 --- a/ansible_collections/cisco/meraki/plugins/action/organizations_adaptive_policy_policies.py +++ b/ansible_collections/cisco/meraki/plugins/action/organizations_adaptive_policy_policies.py @@ -32,10 +32,10 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present", "absent"]), - sourceGroup=dict(type="dict"), - destinationGroup=dict(type="dict"), acls=dict(type="list"), + destinationGroup=dict(type="dict"), lastEntryRule=dict(type="str"), + sourceGroup=dict(type="dict"), organizationId=dict(type="str"), id=dict(type="str"), )) @@ -53,10 +53,10 @@ class OrganizationsAdaptivePolicyPolicies(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( - sourceGroup=params.get("sourceGroup"), - destinationGroup=params.get("destinationGroup"), acls=params.get("acls"), + destinationGroup=params.get("destinationGroup"), lastEntryRule=params.get("lastEntryRule"), + sourceGroup=params.get("sourceGroup"), organizationId=params.get("organizationId"), id=params.get("id"), ) @@ -79,18 +79,18 @@ class OrganizationsAdaptivePolicyPolicies(object): def create_params(self): new_object_params = {} - if self.new_object.get('sourceGroup') is not None or self.new_object.get('source_group') is not None: - new_object_params['sourceGroup'] = self.new_object.get('sourceGroup') or \ - self.new_object.get('source_group') - if self.new_object.get('destinationGroup') is not None or self.new_object.get('destination_group') is not None: - new_object_params['destinationGroup'] = self.new_object.get('destinationGroup') or \ - self.new_object.get('destination_group') if self.new_object.get('acls') is not None or self.new_object.get('acls') is not None: new_object_params['acls'] = self.new_object.get('acls') or \ self.new_object.get('acls') + if self.new_object.get('destinationGroup') is not None or self.new_object.get('destination_group') is not None: + new_object_params['destinationGroup'] = self.new_object.get('destinationGroup') or \ + self.new_object.get('destination_group') if self.new_object.get('lastEntryRule') is not None or self.new_object.get('last_entry_rule') is not None: new_object_params['lastEntryRule'] = self.new_object.get('lastEntryRule') or \ self.new_object.get('last_entry_rule') + if self.new_object.get('sourceGroup') is not None or self.new_object.get('source_group') is not None: + new_object_params['sourceGroup'] = self.new_object.get('sourceGroup') or \ + self.new_object.get('source_group') if self.new_object.get('organizationId') is not None or self.new_object.get('organization_id') is not None: new_object_params['organizationId'] = self.new_object.get('organizationId') or \ self.new_object.get('organization_id') @@ -108,18 +108,18 @@ class OrganizationsAdaptivePolicyPolicies(object): def update_by_id_params(self): new_object_params = {} - if self.new_object.get('sourceGroup') is not None or self.new_object.get('source_group') is not None: - new_object_params['sourceGroup'] = self.new_object.get('sourceGroup') or \ - self.new_object.get('source_group') - if self.new_object.get('destinationGroup') is not None or self.new_object.get('destination_group') is not None: - new_object_params['destinationGroup'] = self.new_object.get('destinationGroup') or \ - self.new_object.get('destination_group') if self.new_object.get('acls') is not None or self.new_object.get('acls') is not None: new_object_params['acls'] = self.new_object.get('acls') or \ self.new_object.get('acls') + if self.new_object.get('destinationGroup') is not None or self.new_object.get('destination_group') is not None: + new_object_params['destinationGroup'] = self.new_object.get('destinationGroup') or \ + self.new_object.get('destination_group') if self.new_object.get('lastEntryRule') is not None or self.new_object.get('last_entry_rule') is not None: new_object_params['lastEntryRule'] = self.new_object.get('lastEntryRule') or \ self.new_object.get('last_entry_rule') + if self.new_object.get('sourceGroup') is not None or self.new_object.get('source_group') is not None: + new_object_params['sourceGroup'] = self.new_object.get('sourceGroup') or \ + self.new_object.get('source_group') if self.new_object.get('organizationId') is not None or self.new_object.get('organization_id') is not None: new_object_params['organizationId'] = self.new_object.get('organizationId') or \ self.new_object.get('organization_id') @@ -193,10 +193,10 @@ class OrganizationsAdaptivePolicyPolicies(object): requested_obj = self.new_object obj_params = [ - ("sourceGroup", "sourceGroup"), - ("destinationGroup", "destinationGroup"), ("acls", "acls"), + ("destinationGroup", "destinationGroup"), ("lastEntryRule", "lastEntryRule"), + ("sourceGroup", "sourceGroup"), ("organizationId", "organizationId"), ("id", "id"), ] diff --git a/ansible_collections/cisco/meraki/plugins/action/organizations_admins.py b/ansible_collections/cisco/meraki/plugins/action/organizations_admins.py index a9b2140ef..641befa29 100644 --- a/ansible_collections/cisco/meraki/plugins/action/organizations_admins.py +++ b/ansible_collections/cisco/meraki/plugins/action/organizations_admins.py @@ -32,12 +32,12 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present", "absent"]), + authenticationMethod=dict(type="str"), email=dict(type="str"), name=dict(type="str"), + networks=dict(type="list"), orgAccess=dict(type="str"), tags=dict(type="list"), - networks=dict(type="list"), - authenticationMethod=dict(type="str"), organizationId=dict(type="str"), adminId=dict(type="str"), )) @@ -55,12 +55,12 @@ class OrganizationsAdmins(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( + authenticationMethod=params.get("authenticationMethod"), email=params.get("email"), name=params.get("name"), + networks=params.get("networks"), orgAccess=params.get("orgAccess"), tags=params.get("tags"), - networks=params.get("networks"), - authenticationMethod=params.get("authenticationMethod"), organizationId=params.get("organizationId"), adminId=params.get("adminId"), ) @@ -74,24 +74,24 @@ class OrganizationsAdmins(object): def create_params(self): new_object_params = {} + if self.new_object.get('authenticationMethod') is not None or self.new_object.get('authentication_method') is not None: + new_object_params['authenticationMethod'] = self.new_object.get('authenticationMethod') or \ + self.new_object.get('authentication_method') if self.new_object.get('email') is not None or self.new_object.get('email') is not None: new_object_params['email'] = self.new_object.get('email') or \ self.new_object.get('email') if self.new_object.get('name') is not None or self.new_object.get('name') is not None: new_object_params['name'] = self.new_object.get('name') or \ self.new_object.get('name') + if self.new_object.get('networks') is not None or self.new_object.get('networks') is not None: + new_object_params['networks'] = self.new_object.get('networks') or \ + self.new_object.get('networks') if self.new_object.get('orgAccess') is not None or self.new_object.get('org_access') is not None: new_object_params['orgAccess'] = self.new_object.get('orgAccess') or \ self.new_object.get('org_access') if self.new_object.get('tags') is not None or self.new_object.get('tags') is not None: new_object_params['tags'] = self.new_object.get('tags') or \ self.new_object.get('tags') - if self.new_object.get('networks') is not None or self.new_object.get('networks') is not None: - new_object_params['networks'] = self.new_object.get('networks') or \ - self.new_object.get('networks') - if self.new_object.get('authenticationMethod') is not None or self.new_object.get('authentication_method') is not None: - new_object_params['authenticationMethod'] = self.new_object.get('authenticationMethod') or \ - self.new_object.get('authentication_method') if self.new_object.get('organizationId') is not None or self.new_object.get('organization_id') is not None: new_object_params['organizationId'] = self.new_object.get('organizationId') or \ self.new_object.get('organization_id') @@ -112,15 +112,15 @@ class OrganizationsAdmins(object): if self.new_object.get('name') is not None or self.new_object.get('name') is not None: new_object_params['name'] = self.new_object.get('name') or \ self.new_object.get('name') + if self.new_object.get('networks') is not None or self.new_object.get('networks') is not None: + new_object_params['networks'] = self.new_object.get('networks') or \ + self.new_object.get('networks') if self.new_object.get('orgAccess') is not None or self.new_object.get('org_access') is not None: new_object_params['orgAccess'] = self.new_object.get('orgAccess') or \ self.new_object.get('org_access') if self.new_object.get('tags') is not None or self.new_object.get('tags') is not None: new_object_params['tags'] = self.new_object.get('tags') or \ self.new_object.get('tags') - if self.new_object.get('networks') is not None or self.new_object.get('networks') is not None: - new_object_params['networks'] = self.new_object.get('networks') or \ - self.new_object.get('networks') if self.new_object.get('organizationId') is not None or self.new_object.get('organization_id') is not None: new_object_params['organizationId'] = self.new_object.get('organizationId') or \ self.new_object.get('organization_id') @@ -195,12 +195,12 @@ class OrganizationsAdmins(object): requested_obj = self.new_object obj_params = [ + ("authenticationMethod", "authenticationMethod"), ("email", "email"), ("name", "name"), + ("networks", "networks"), ("orgAccess", "orgAccess"), ("tags", "tags"), - ("networks", "networks"), - ("authenticationMethod", "authenticationMethod"), ("organizationId", "organizationId"), ("adminId", "adminId"), ] diff --git a/ansible_collections/cisco/meraki/plugins/action/organizations_alerts_profiles.py b/ansible_collections/cisco/meraki/plugins/action/organizations_alerts_profiles.py index cc046ea86..b773a76cc 100644 --- a/ansible_collections/cisco/meraki/plugins/action/organizations_alerts_profiles.py +++ b/ansible_collections/cisco/meraki/plugins/action/organizations_alerts_profiles.py @@ -31,11 +31,11 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present", "absent"]), - type=dict(type="str"), alertCondition=dict(type="dict"), - recipients=dict(type="dict"), - networkTags=dict(type="list"), description=dict(type="str"), + networkTags=dict(type="list"), + recipients=dict(type="dict"), + type=dict(type="str"), organizationId=dict(type="str"), enabled=dict(type="bool"), alertConfigId=dict(type="str"), @@ -54,11 +54,11 @@ class OrganizationsAlertsProfiles(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( - type=params.get("type"), alertCondition=params.get("alertCondition"), - recipients=params.get("recipients"), - networkTags=params.get("networkTags"), description=params.get("description"), + networkTags=params.get("networkTags"), + recipients=params.get("recipients"), + type=params.get("type"), organization_id=params.get("organizationId"), enabled=params.get("enabled"), alert_config_id=params.get("alertConfigId"), @@ -66,21 +66,21 @@ class OrganizationsAlertsProfiles(object): def create_params(self): new_object_params = {} - if self.new_object.get('type') is not None or self.new_object.get('type') is not None: - new_object_params['type'] = self.new_object.get('type') or \ - self.new_object.get('type') if self.new_object.get('alertCondition') is not None or self.new_object.get('alert_condition') is not None: new_object_params['alertCondition'] = self.new_object.get('alertCondition') or \ self.new_object.get('alert_condition') - if self.new_object.get('recipients') is not None or self.new_object.get('recipients') is not None: - new_object_params['recipients'] = self.new_object.get('recipients') or \ - self.new_object.get('recipients') - if self.new_object.get('networkTags') is not None or self.new_object.get('network_tags') is not None: - new_object_params['networkTags'] = self.new_object.get('networkTags') or \ - self.new_object.get('network_tags') if self.new_object.get('description') is not None or self.new_object.get('description') is not None: new_object_params['description'] = self.new_object.get('description') or \ self.new_object.get('description') + if self.new_object.get('networkTags') is not None or self.new_object.get('network_tags') is not None: + new_object_params['networkTags'] = self.new_object.get('networkTags') or \ + self.new_object.get('network_tags') + if self.new_object.get('recipients') is not None or self.new_object.get('recipients') is not None: + new_object_params['recipients'] = self.new_object.get('recipients') or \ + self.new_object.get('recipients') + if self.new_object.get('type') is not None or self.new_object.get('type') is not None: + new_object_params['type'] = self.new_object.get('type') or \ + self.new_object.get('type') if self.new_object.get('organizationId') is not None or self.new_object.get('organization_id') is not None: new_object_params['organizationId'] = self.new_object.get('organizationId') or \ self.new_object.get('organization_id') @@ -98,23 +98,23 @@ class OrganizationsAlertsProfiles(object): def update_by_id_params(self): new_object_params = {} - if self.new_object.get('enabled') is not None or self.new_object.get('enabled') is not None: - new_object_params['enabled'] = self.new_object.get('enabled') - if self.new_object.get('type') is not None or self.new_object.get('type') is not None: - new_object_params['type'] = self.new_object.get('type') or \ - self.new_object.get('type') if self.new_object.get('alertCondition') is not None or self.new_object.get('alert_condition') is not None: new_object_params['alertCondition'] = self.new_object.get('alertCondition') or \ self.new_object.get('alert_condition') - if self.new_object.get('recipients') is not None or self.new_object.get('recipients') is not None: - new_object_params['recipients'] = self.new_object.get('recipients') or \ - self.new_object.get('recipients') - if self.new_object.get('networkTags') is not None or self.new_object.get('network_tags') is not None: - new_object_params['networkTags'] = self.new_object.get('networkTags') or \ - self.new_object.get('network_tags') if self.new_object.get('description') is not None or self.new_object.get('description') is not None: new_object_params['description'] = self.new_object.get('description') or \ self.new_object.get('description') + if self.new_object.get('enabled') is not None or self.new_object.get('enabled') is not None: + new_object_params['enabled'] = self.new_object.get('enabled') + if self.new_object.get('networkTags') is not None or self.new_object.get('network_tags') is not None: + new_object_params['networkTags'] = self.new_object.get('networkTags') or \ + self.new_object.get('network_tags') + if self.new_object.get('recipients') is not None or self.new_object.get('recipients') is not None: + new_object_params['recipients'] = self.new_object.get('recipients') or \ + self.new_object.get('recipients') + if self.new_object.get('type') is not None or self.new_object.get('type') is not None: + new_object_params['type'] = self.new_object.get('type') or \ + self.new_object.get('type') if self.new_object.get('organizationId') is not None or self.new_object.get('organization_id') is not None: new_object_params['organizationId'] = self.new_object.get('organizationId') or \ self.new_object.get('organization_id') @@ -163,11 +163,11 @@ class OrganizationsAlertsProfiles(object): requested_obj = self.new_object obj_params = [ - ("type", "type"), ("alertCondition", "alertCondition"), - ("recipients", "recipients"), - ("networkTags", "networkTags"), ("description", "description"), + ("networkTags", "networkTags"), + ("recipients", "recipients"), + ("type", "type"), ("organizationId", "organizationId"), ("enabled", "enabled"), ("alertConfigId", "alertConfigId"), diff --git a/ansible_collections/cisco/meraki/plugins/action/organizations_appliance_traffic_shaping_vpn_exclusions_by_network_info.py b/ansible_collections/cisco/meraki/plugins/action/organizations_appliance_traffic_shaping_vpn_exclusions_by_network_info.py new file mode 100644 index 000000000..6aad7552f --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/action/organizations_appliance_traffic_shaping_vpn_exclusions_by_network_info.py @@ -0,0 +1,112 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( + MERAKI, + meraki_argument_spec, +) + +# Get common arguments specification +argument_spec = meraki_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + organizationId=dict(type="str"), + perPage=dict(type="int"), + total_pages=dict(type="int"), + direction=dict(type="str"), + startingAfter=dict(type="str"), + endingBefore=dict(type="str"), + networkIds=dict(type="list"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail( + "ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_all(self, params): + new_object = {} + if params.get("organizationId") is not None: + new_object["organizationId"] = params.get( + "organizationId") + if params.get("perPage") is not None: + new_object["perPage"] = params.get( + "perPage") + new_object['total_pages'] = params.get( + "total_pages") or 1 + new_object['direction'] = params.get( + "direction") or "next" + if params.get("startingAfter") is not None: + new_object["startingAfter"] = params.get( + "startingAfter") + if params.get("endingBefore") is not None: + new_object["endingBefore"] = params.get( + "endingBefore") + if params.get("networkIds") is not None: + new_object["networkIds"] = params.get( + "networkIds") + + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(meraki_response={})) + + meraki = MERAKI(params=self._task.args) + + response = meraki.exec_meraki( + family="appliance", + function='getOrganizationApplianceTrafficShapingVpnExclusionsByNetwork', + params=self.get_all(self._task.args), + ) + self._result.update(dict(meraki_response=response)) + self._result.update(meraki.exit_json()) + return self._result diff --git a/ansible_collections/cisco/meraki/plugins/action/organizations_appliance_uplinks_statuses_overview_info.py b/ansible_collections/cisco/meraki/plugins/action/organizations_appliance_uplinks_statuses_overview_info.py new file mode 100644 index 000000000..8180b0eb2 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/action/organizations_appliance_uplinks_statuses_overview_info.py @@ -0,0 +1,90 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( + MERAKI, + meraki_argument_spec, +) + +# Get common arguments specification +argument_spec = meraki_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + organizationId=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail( + "ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_all(self, params): + new_object = {} + if params.get("organizationId") is not None: + new_object["organizationId"] = params.get( + "organizationId") + + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(meraki_response={})) + + meraki = MERAKI(params=self._task.args) + + response = meraki.exec_meraki( + family="appliance", + function='getOrganizationApplianceUplinksStatusesOverview', + params=self.get_all(self._task.args), + ) + self._result.update(dict(meraki_response=response)) + self._result.update(meraki.exit_json()) + return self._result diff --git a/ansible_collections/cisco/meraki/plugins/action/organizations_appliance_uplinks_usage_by_network_info.py b/ansible_collections/cisco/meraki/plugins/action/organizations_appliance_uplinks_usage_by_network_info.py new file mode 100644 index 000000000..c52e2bac2 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/action/organizations_appliance_uplinks_usage_by_network_info.py @@ -0,0 +1,102 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( + MERAKI, + meraki_argument_spec, +) + +# Get common arguments specification +argument_spec = meraki_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + organizationId=dict(type="str"), + t0=dict(type="str"), + t1=dict(type="str"), + timespan=dict(type="float"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail( + "ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_all(self, params): + new_object = {} + if params.get("organizationId") is not None: + new_object["organizationId"] = params.get( + "organizationId") + if params.get("t0") is not None: + new_object["t0"] = params.get( + "t0") + if params.get("t1") is not None: + new_object["t1"] = params.get( + "t1") + if params.get("timespan") is not None: + new_object["timespan"] = params.get( + "timespan") + + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(meraki_response={})) + + meraki = MERAKI(params=self._task.args) + + response = meraki.exec_meraki( + family="appliance", + function='getOrganizationApplianceUplinksUsageByNetwork', + params=self.get_all(self._task.args), + ) + self._result.update(dict(meraki_response=response)) + self._result.update(meraki.exit_json()) + return self._result diff --git a/ansible_collections/cisco/meraki/plugins/action/organizations_branding_policies.py b/ansible_collections/cisco/meraki/plugins/action/organizations_branding_policies.py index 870c0370e..246f94575 100644 --- a/ansible_collections/cisco/meraki/plugins/action/organizations_branding_policies.py +++ b/ansible_collections/cisco/meraki/plugins/action/organizations_branding_policies.py @@ -32,11 +32,11 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present", "absent"]), - name=dict(type="str"), - enabled=dict(type="bool"), adminSettings=dict(type="dict"), - helpSettings=dict(type="dict"), customLogo=dict(type="dict"), + enabled=dict(type="bool"), + helpSettings=dict(type="dict"), + name=dict(type="str"), organizationId=dict(type="str"), brandingPolicyId=dict(type="str"), )) @@ -54,11 +54,11 @@ class OrganizationsBrandingPolicies(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( - name=params.get("name"), - enabled=params.get("enabled"), adminSettings=params.get("adminSettings"), - helpSettings=params.get("helpSettings"), customLogo=params.get("customLogo"), + enabled=params.get("enabled"), + helpSettings=params.get("helpSettings"), + name=params.get("name"), organizationId=params.get("organizationId"), brandingPolicyId=params.get("brandingPolicyId"), ) @@ -82,20 +82,20 @@ class OrganizationsBrandingPolicies(object): def create_params(self): new_object_params = {} - if self.new_object.get('name') is not None or self.new_object.get('name') is not None: - new_object_params['name'] = self.new_object.get('name') or \ - self.new_object.get('name') - if self.new_object.get('enabled') is not None or self.new_object.get('enabled') is not None: - new_object_params['enabled'] = self.new_object.get('enabled') if self.new_object.get('adminSettings') is not None or self.new_object.get('admin_settings') is not None: new_object_params['adminSettings'] = self.new_object.get('adminSettings') or \ self.new_object.get('admin_settings') - if self.new_object.get('helpSettings') is not None or self.new_object.get('help_settings') is not None: - new_object_params['helpSettings'] = self.new_object.get('helpSettings') or \ - self.new_object.get('help_settings') if self.new_object.get('customLogo') is not None or self.new_object.get('custom_logo') is not None: new_object_params['customLogo'] = self.new_object.get('customLogo') or \ self.new_object.get('custom_logo') + if self.new_object.get('enabled') is not None or self.new_object.get('enabled') is not None: + new_object_params['enabled'] = self.new_object.get('enabled') + if self.new_object.get('helpSettings') is not None or self.new_object.get('help_settings') is not None: + new_object_params['helpSettings'] = self.new_object.get('helpSettings') or \ + self.new_object.get('help_settings') + if self.new_object.get('name') is not None or self.new_object.get('name') is not None: + new_object_params['name'] = self.new_object.get('name') or \ + self.new_object.get('name') if self.new_object.get('organizationId') is not None or self.new_object.get('organization_id') is not None: new_object_params['organizationId'] = self.new_object.get('organizationId') or \ self.new_object.get('organization_id') @@ -113,20 +113,20 @@ class OrganizationsBrandingPolicies(object): def update_by_id_params(self): new_object_params = {} - if self.new_object.get('name') is not None or self.new_object.get('name') is not None: - new_object_params['name'] = self.new_object.get('name') or \ - self.new_object.get('name') - if self.new_object.get('enabled') is not None or self.new_object.get('enabled') is not None: - new_object_params['enabled'] = self.new_object.get('enabled') if self.new_object.get('adminSettings') is not None or self.new_object.get('admin_settings') is not None: new_object_params['adminSettings'] = self.new_object.get('adminSettings') or \ self.new_object.get('admin_settings') - if self.new_object.get('helpSettings') is not None or self.new_object.get('help_settings') is not None: - new_object_params['helpSettings'] = self.new_object.get('helpSettings') or \ - self.new_object.get('help_settings') if self.new_object.get('customLogo') is not None or self.new_object.get('custom_logo') is not None: new_object_params['customLogo'] = self.new_object.get('customLogo') or \ self.new_object.get('custom_logo') + if self.new_object.get('enabled') is not None or self.new_object.get('enabled') is not None: + new_object_params['enabled'] = self.new_object.get('enabled') + if self.new_object.get('helpSettings') is not None or self.new_object.get('help_settings') is not None: + new_object_params['helpSettings'] = self.new_object.get('helpSettings') or \ + self.new_object.get('help_settings') + if self.new_object.get('name') is not None or self.new_object.get('name') is not None: + new_object_params['name'] = self.new_object.get('name') or \ + self.new_object.get('name') if self.new_object.get('organizationId') is not None or self.new_object.get('organization_id') is not None: new_object_params['organizationId'] = self.new_object.get('organizationId') or \ self.new_object.get('organization_id') @@ -204,11 +204,11 @@ class OrganizationsBrandingPolicies(object): requested_obj = self.new_object obj_params = [ - ("name", "name"), - ("enabled", "enabled"), ("adminSettings", "adminSettings"), - ("helpSettings", "helpSettings"), ("customLogo", "customLogo"), + ("enabled", "enabled"), + ("helpSettings", "helpSettings"), + ("name", "name"), ("organizationId", "organizationId"), ("brandingPolicyId", "brandingPolicyId"), ] diff --git a/ansible_collections/cisco/meraki/plugins/action/organizations_camera_boundaries_areas_by_device_info.py b/ansible_collections/cisco/meraki/plugins/action/organizations_camera_boundaries_areas_by_device_info.py new file mode 100644 index 000000000..a54a4f830 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/action/organizations_camera_boundaries_areas_by_device_info.py @@ -0,0 +1,94 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( + MERAKI, + meraki_argument_spec, +) + +# Get common arguments specification +argument_spec = meraki_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + organizationId=dict(type="str"), + serials=dict(type="list"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail( + "ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_all(self, params): + new_object = {} + if params.get("organizationId") is not None: + new_object["organizationId"] = params.get( + "organizationId") + if params.get("serials") is not None: + new_object["serials"] = params.get( + "serials") + + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(meraki_response={})) + + meraki = MERAKI(params=self._task.args) + + response = meraki.exec_meraki( + family="camera", + function='getOrganizationCameraBoundariesAreasByDevice', + params=self.get_all(self._task.args), + ) + self._result.update(dict(meraki_response=response)) + self._result.update(meraki.exit_json()) + return self._result diff --git a/ansible_collections/cisco/meraki/plugins/action/organizations_camera_boundaries_lines_by_device_info.py b/ansible_collections/cisco/meraki/plugins/action/organizations_camera_boundaries_lines_by_device_info.py new file mode 100644 index 000000000..89f74a210 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/action/organizations_camera_boundaries_lines_by_device_info.py @@ -0,0 +1,94 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( + MERAKI, + meraki_argument_spec, +) + +# Get common arguments specification +argument_spec = meraki_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + organizationId=dict(type="str"), + serials=dict(type="list"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail( + "ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_all(self, params): + new_object = {} + if params.get("organizationId") is not None: + new_object["organizationId"] = params.get( + "organizationId") + if params.get("serials") is not None: + new_object["serials"] = params.get( + "serials") + + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(meraki_response={})) + + meraki = MERAKI(params=self._task.args) + + response = meraki.exec_meraki( + family="camera", + function='getOrganizationCameraBoundariesLinesByDevice', + params=self.get_all(self._task.args), + ) + self._result.update(dict(meraki_response=response)) + self._result.update(meraki.exit_json()) + return self._result diff --git a/ansible_collections/cisco/meraki/plugins/action/organizations_camera_detections_history_by_boundary_by_interval_info.py b/ansible_collections/cisco/meraki/plugins/action/organizations_camera_detections_history_by_boundary_by_interval_info.py new file mode 100644 index 000000000..fd9ef63d5 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/action/organizations_camera_detections_history_by_boundary_by_interval_info.py @@ -0,0 +1,116 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( + MERAKI, + meraki_argument_spec, +) + +# Get common arguments specification +argument_spec = meraki_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + organizationId=dict(type="str"), + boundaryIds=dict(type="list"), + ranges=dict(type="list"), + duration=dict(type="int"), + perPage=dict(type="int"), + total_pages=dict(type="int"), + direction=dict(type="str"), + boundaryTypes=dict(type="list"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail( + "ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_all(self, params): + new_object = {} + if params.get("organizationId") is not None: + new_object["organizationId"] = params.get( + "organizationId") + if params.get("boundaryIds") is not None: + new_object["boundaryIds"] = params.get( + "boundaryIds") + if params.get("ranges") is not None: + new_object["ranges"] = params.get( + "ranges") + if params.get("duration") is not None: + new_object["duration"] = params.get( + "duration") + if params.get("perPage") is not None: + new_object["perPage"] = params.get( + "perPage") + new_object['total_pages'] = params.get( + "total_pages") or 1 + new_object['direction'] = params.get( + "direction") or "next" + if params.get("boundaryTypes") is not None: + new_object["boundaryTypes"] = params.get( + "boundaryTypes") + + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(meraki_response={})) + + meraki = MERAKI(params=self._task.args) + + response = meraki.exec_meraki( + family="camera", + function='getOrganizationCameraDetectionsHistoryByBoundaryByInterval', + params=self.get_all(self._task.args), + ) + self._result.update(dict(meraki_response=response)) + self._result.update(meraki.exit_json()) + return self._result diff --git a/ansible_collections/cisco/meraki/plugins/action/organizations_camera_permissions_info.py b/ansible_collections/cisco/meraki/plugins/action/organizations_camera_permissions_info.py new file mode 100644 index 000000000..3eb13d08d --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/action/organizations_camera_permissions_info.py @@ -0,0 +1,102 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( + MERAKI, + meraki_argument_spec, +) + +# Get common arguments specification +argument_spec = meraki_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + organizationId=dict(type="str"), + permissionScopeId=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail( + "ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = {} + if params.get("organizationId") is not None: + new_object["organizationId"] = params.get( + "organizationId") + if params.get("permissionScopeId") is not None: + new_object["permissionScopeId"] = params.get( + "permissionScopeId") + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(meraki_response={})) + + meraki = MERAKI(params=self._task.args) + + id = self._task.args.get("permissionScopeId") + if id: + response = meraki.exec_meraki( + family="camera", + function='getOrganizationCameraPermission', + params=self.get_object(self._task.args), + ) + self._result.update(dict(meraki_response=response)) + self._result.update(meraki.exit_json()) + return self._result + if not id: + # NOTE: Does not have a get all method or it is in another action + response = None + meraki.object_modify_result(changed=False, result="Module does not have get all, check arguments of module") + self._result.update(dict(meraki_response=response)) + self._result.update(meraki.exit_json()) + return self._result diff --git a/ansible_collections/cisco/meraki/plugins/action/organizations_camera_roles.py b/ansible_collections/cisco/meraki/plugins/action/organizations_camera_roles.py new file mode 100644 index 000000000..222b2503d --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/action/organizations_camera_roles.py @@ -0,0 +1,252 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or +# https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( + MERAKI, + meraki_argument_spec, + meraki_compare_equality, + get_dict_result, +) +from ansible_collections.cisco.meraki.plugins.plugin_utils.exceptions import ( + InconsistentParameters, +) + +# Get common arguments specification +argument_spec = meraki_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present", "absent"]), + appliedOnDevices=dict(type="list"), + appliedOnNetworks=dict(type="list"), + appliedOrgWide=dict(type="list"), + name=dict(type="str"), + organizationId=dict(type="str"), +)) + +required_if = [ + ("state", "present", ["name", "organizationId"], True), + ("state", "absent", ["name", "organizationId"], True), +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class OrganizationsCameraRoles(object): + def __init__(self, params, meraki): + self.meraki = meraki + self.new_object = dict( + appliedOnDevices=params.get("appliedOnDevices"), + appliedOnNetworks=params.get("appliedOnNetworks"), + appliedOrgWide=params.get("appliedOrgWide"), + name=params.get("name"), + organizationId=params.get("organizationId"), + ) + + def get_all_params(self, name=None, id=None): + new_object_params = {} + if self.new_object.get('organizationId') is not None or self.new_object.get('organization_id') is not None: + new_object_params['organizationId'] = self.new_object.get('organizationId') or \ + self.new_object.get('organization_id') + return new_object_params + + def create_params(self): + new_object_params = {} + if self.new_object.get('appliedOnDevices') is not None or self.new_object.get('applied_on_devices') is not None: + new_object_params['appliedOnDevices'] = self.new_object.get('appliedOnDevices') or \ + self.new_object.get('applied_on_devices') + if self.new_object.get('appliedOnNetworks') is not None or self.new_object.get('applied_on_networks') is not None: + new_object_params['appliedOnNetworks'] = self.new_object.get('appliedOnNetworks') or \ + self.new_object.get('applied_on_networks') + if self.new_object.get('appliedOrgWide') is not None or self.new_object.get('applied_org_wide') is not None: + new_object_params['appliedOrgWide'] = self.new_object.get('appliedOrgWide') or \ + self.new_object.get('applied_org_wide') + if self.new_object.get('name') is not None or self.new_object.get('name') is not None: + new_object_params['name'] = self.new_object.get('name') or \ + self.new_object.get('name') + if self.new_object.get('organizationId') is not None or self.new_object.get('organization_id') is not None: + new_object_params['organizationId'] = self.new_object.get('organizationId') or \ + self.new_object.get('organization_id') + return new_object_params + + def get_object_by_name(self, name): + result = None + # NOTE: Does not have a get by name method or it is in another action + try: + items = self.meraki.exec_meraki( + family="camera", + function="getOrganizationCameraRoles", + params=self.get_all_params(name=name), + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'name', name) + if result is None: + result = items + except Exception as e: + print("Error: ", e) + result = None + return result + + def get_object_by_id(self, id): + result = None + # NOTE: Does not have a get by id method or it is in another action + try: + items = self.meraki.exec_meraki( + family="camera", + function="getOrganizationCameraRoles", + params=self.get_all_params(id=id), + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'id', id) + except Exception as e: + print("Error: ", e) + result = None + return result + + def exists(self): + id_exists = False + name_exists = False + prev_obj = None + o_id = self.new_object.get("id") + name = self.new_object.get("name") + if o_id: + prev_obj = self.get_object_by_id(o_id) + id_exists = prev_obj is not None and isinstance(prev_obj, dict) + if not id_exists and name: + prev_obj = self.get_object_by_name(name) + name_exists = prev_obj is not None and isinstance(prev_obj, dict) + if name_exists: + _id = prev_obj.get("id") + if id_exists and name_exists and o_id != _id: + raise InconsistentParameters( + "The 'id' and 'name' params don't refer to the same object") + if _id: + self.new_object.update(dict(id=_id)) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object + + obj_params = [ + ("appliedOnDevices", "appliedOnDevices"), + ("appliedOnNetworks", "appliedOnNetworks"), + ("appliedOrgWide", "appliedOrgWide"), + ("name", "name"), + ("organizationId", "organizationId"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (DNAC) params + # If any does not have eq params, it requires update + return any(not meraki_compare_equality(current_obj.get(meraki_param), + requested_obj.get(ansible_param)) + for (meraki_param, ansible_param) in obj_params) + + def create(self): + result = self.meraki.exec_meraki( + family="camera", + function="createOrganizationCameraRole", + params=self.create_params(), + op_modifies=True, + ) + return result + + def update(self): + id = self.new_object.get("id") + name = self.new_object.get("name") + result = None + # NOTE: Does not have update method. What do we do? + return result + + def delete(self): + id = self.new_object.get("id") + name = self.new_object.get("name") + result = None + # NOTE: Does not have delete method. What do we do? + return result + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail( + "ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + meraki = MERAKI(self._task.args) + obj = OrganizationsCameraRoles(self._task.args, meraki) + + state = self._task.args.get("state") + + response = None + + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = obj.update() + meraki.object_updated() + else: + response = prev_obj + meraki.object_already_present() + else: + response = obj.create() + meraki.object_created() + + elif state == "absent": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + response = obj.delete() + meraki.object_deleted() + else: + meraki.object_already_absent() + + self._result.update(dict(meraki_response=response)) + self._result.update(meraki.exit_json()) + return self._result diff --git a/ansible_collections/cisco/meraki/plugins/action/organizations_camera_roles_info.py b/ansible_collections/cisco/meraki/plugins/action/organizations_camera_roles_info.py new file mode 100644 index 000000000..2a100b4e2 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/action/organizations_camera_roles_info.py @@ -0,0 +1,90 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( + MERAKI, + meraki_argument_spec, +) + +# Get common arguments specification +argument_spec = meraki_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + organizationId=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail( + "ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_all(self, params): + new_object = {} + if params.get("organizationId") is not None: + new_object["organizationId"] = params.get( + "organizationId") + + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(meraki_response={})) + + meraki = MERAKI(params=self._task.args) + + response = meraki.exec_meraki( + family="camera", + function='getOrganizationCameraRoles', + params=self.get_all(self._task.args), + ) + self._result.update(dict(meraki_response=response)) + self._result.update(meraki.exit_json()) + return self._result diff --git a/ansible_collections/cisco/meraki/plugins/action/organizations_claim.py b/ansible_collections/cisco/meraki/plugins/action/organizations_claim.py index 5439a5af8..6f3a8ef92 100644 --- a/ansible_collections/cisco/meraki/plugins/action/organizations_claim.py +++ b/ansible_collections/cisco/meraki/plugins/action/organizations_claim.py @@ -25,9 +25,9 @@ from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( + licenses=dict(type="list"), orders=dict(type="list"), serials=dict(type="list"), - licenses=dict(type="list"), organizationId=dict(type="str"), )) @@ -67,9 +67,9 @@ class ActionModule(ActionBase): def get_object(self, params): new_object = dict( + licenses=params.get("licenses"), orders=params.get("orders"), serials=params.get("serials"), - licenses=params.get("licenses"), organizationId=params.get("organizationId"), ) return new_object diff --git a/ansible_collections/cisco/meraki/plugins/action/organizations_config_templates.py b/ansible_collections/cisco/meraki/plugins/action/organizations_config_templates.py index 09dc845b0..1811392e7 100644 --- a/ansible_collections/cisco/meraki/plugins/action/organizations_config_templates.py +++ b/ansible_collections/cisco/meraki/plugins/action/organizations_config_templates.py @@ -32,6 +32,7 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present", "absent"]), + copyFromNetworkId=dict(type="str"), name=dict(type="str"), timeZone=dict(type="str"), organizationId=dict(type="str"), @@ -51,6 +52,7 @@ class OrganizationsConfigTemplates(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( + copyFromNetworkId=params.get("copyFromNetworkId"), name=params.get("name"), timeZone=params.get("timeZone"), organizationId=params.get("organizationId"), @@ -76,6 +78,9 @@ class OrganizationsConfigTemplates(object): def create_params(self): new_object_params = {} + if self.new_object.get('copyFromNetworkId') is not None or self.new_object.get('copy_from_network_id') is not None: + new_object_params['copyFromNetworkId'] = self.new_object.get('copyFromNetworkId') or \ + self.new_object.get('copy_from_network_id') if self.new_object.get('name') is not None or self.new_object.get('name') is not None: new_object_params['name'] = self.new_object.get('name') or \ self.new_object.get('name') @@ -182,6 +187,7 @@ class OrganizationsConfigTemplates(object): requested_obj = self.new_object obj_params = [ + ("copyFromNetworkId", "copyFromNetworkId"), ("name", "name"), ("timeZone", "timeZone"), ("organizationId", "organizationId"), diff --git a/ansible_collections/cisco/meraki/plugins/action/organizations_config_templates_switch_profiles_ports.py b/ansible_collections/cisco/meraki/plugins/action/organizations_config_templates_switch_profiles_ports.py index 38cd937fc..82963b4b0 100644 --- a/ansible_collections/cisco/meraki/plugins/action/organizations_config_templates_switch_profiles_ports.py +++ b/ansible_collections/cisco/meraki/plugins/action/organizations_config_templates_switch_profiles_ports.py @@ -32,29 +32,29 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present"]), - name=dict(type="str"), - tags=dict(type="list"), - enabled=dict(type="bool"), - poeEnabled=dict(type="bool"), - type=dict(type="str"), - vlan=dict(type="int"), - voiceVlan=dict(type="int"), + accessPolicyNumber=dict(type="int"), + accessPolicyType=dict(type="str"), allowedVlans=dict(type="str"), + daiTrusted=dict(type="bool"), + enabled=dict(type="bool"), + flexibleStackingEnabled=dict(type="bool"), isolationEnabled=dict(type="bool"), - rstpEnabled=dict(type="bool"), - stpGuard=dict(type="str"), linkNegotiation=dict(type="str"), - portScheduleId=dict(type="str"), - udld=dict(type="str"), - accessPolicyType=dict(type="str"), - accessPolicyNumber=dict(type="int"), macAllowList=dict(type="list"), + name=dict(type="str"), + poeEnabled=dict(type="bool"), + portScheduleId=dict(type="str"), + profile=dict(type="dict"), + rstpEnabled=dict(type="bool"), stickyMacAllowList=dict(type="list"), stickyMacAllowListLimit=dict(type="int"), stormControlEnabled=dict(type="bool"), - flexibleStackingEnabled=dict(type="bool"), - daiTrusted=dict(type="bool"), - profile=dict(type="dict"), + stpGuard=dict(type="str"), + tags=dict(type="list"), + type=dict(type="str"), + udld=dict(type="str"), + vlan=dict(type="int"), + voiceVlan=dict(type="int"), organizationId=dict(type="str"), configTemplateId=dict(type="str"), profileId=dict(type="str"), @@ -73,29 +73,29 @@ class OrganizationsConfigTemplatesSwitchProfilesPorts(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( - name=params.get("name"), - tags=params.get("tags"), - enabled=params.get("enabled"), - poeEnabled=params.get("poeEnabled"), - type=params.get("type"), - vlan=params.get("vlan"), - voiceVlan=params.get("voiceVlan"), + accessPolicyNumber=params.get("accessPolicyNumber"), + accessPolicyType=params.get("accessPolicyType"), allowedVlans=params.get("allowedVlans"), + daiTrusted=params.get("daiTrusted"), + enabled=params.get("enabled"), + flexibleStackingEnabled=params.get("flexibleStackingEnabled"), isolationEnabled=params.get("isolationEnabled"), - rstpEnabled=params.get("rstpEnabled"), - stpGuard=params.get("stpGuard"), linkNegotiation=params.get("linkNegotiation"), - portScheduleId=params.get("portScheduleId"), - udld=params.get("udld"), - accessPolicyType=params.get("accessPolicyType"), - accessPolicyNumber=params.get("accessPolicyNumber"), macAllowList=params.get("macAllowList"), + name=params.get("name"), + poeEnabled=params.get("poeEnabled"), + portScheduleId=params.get("portScheduleId"), + profile=params.get("profile"), + rstpEnabled=params.get("rstpEnabled"), stickyMacAllowList=params.get("stickyMacAllowList"), stickyMacAllowListLimit=params.get("stickyMacAllowListLimit"), stormControlEnabled=params.get("stormControlEnabled"), - flexibleStackingEnabled=params.get("flexibleStackingEnabled"), - daiTrusted=params.get("daiTrusted"), - profile=params.get("profile"), + stpGuard=params.get("stpGuard"), + tags=params.get("tags"), + type=params.get("type"), + udld=params.get("udld"), + vlan=params.get("vlan"), + voiceVlan=params.get("voiceVlan"), organization_id=params.get("organizationId"), config_template_id=params.get("configTemplateId"), profile_id=params.get("profileId"), @@ -133,53 +133,42 @@ class OrganizationsConfigTemplatesSwitchProfilesPorts(object): def update_by_id_params(self): new_object_params = {} - if self.new_object.get('name') is not None or self.new_object.get('name') is not None: - new_object_params['name'] = self.new_object.get('name') or \ - self.new_object.get('name') - if self.new_object.get('tags') is not None or self.new_object.get('tags') is not None: - new_object_params['tags'] = self.new_object.get('tags') or \ - self.new_object.get('tags') - if self.new_object.get('enabled') is not None or self.new_object.get('enabled') is not None: - new_object_params['enabled'] = self.new_object.get('enabled') - if self.new_object.get('poeEnabled') is not None or self.new_object.get('poe_enabled') is not None: - new_object_params['poeEnabled'] = self.new_object.get('poeEnabled') - if self.new_object.get('type') is not None or self.new_object.get('type') is not None: - new_object_params['type'] = self.new_object.get('type') or \ - self.new_object.get('type') - if self.new_object.get('vlan') is not None or self.new_object.get('vlan') is not None: - new_object_params['vlan'] = self.new_object.get('vlan') or \ - self.new_object.get('vlan') - if self.new_object.get('voiceVlan') is not None or self.new_object.get('voice_vlan') is not None: - new_object_params['voiceVlan'] = self.new_object.get('voiceVlan') or \ - self.new_object.get('voice_vlan') + if self.new_object.get('accessPolicyNumber') is not None or self.new_object.get('access_policy_number') is not None: + new_object_params['accessPolicyNumber'] = self.new_object.get('accessPolicyNumber') or \ + self.new_object.get('access_policy_number') + if self.new_object.get('accessPolicyType') is not None or self.new_object.get('access_policy_type') is not None: + new_object_params['accessPolicyType'] = self.new_object.get('accessPolicyType') or \ + self.new_object.get('access_policy_type') if self.new_object.get('allowedVlans') is not None or self.new_object.get('allowed_vlans') is not None: new_object_params['allowedVlans'] = self.new_object.get('allowedVlans') or \ self.new_object.get('allowed_vlans') + if self.new_object.get('daiTrusted') is not None or self.new_object.get('dai_trusted') is not None: + new_object_params['daiTrusted'] = self.new_object.get('daiTrusted') + if self.new_object.get('enabled') is not None or self.new_object.get('enabled') is not None: + new_object_params['enabled'] = self.new_object.get('enabled') + if self.new_object.get('flexibleStackingEnabled') is not None or self.new_object.get('flexible_stacking_enabled') is not None: + new_object_params['flexibleStackingEnabled'] = self.new_object.get('flexibleStackingEnabled') if self.new_object.get('isolationEnabled') is not None or self.new_object.get('isolation_enabled') is not None: new_object_params['isolationEnabled'] = self.new_object.get('isolationEnabled') - if self.new_object.get('rstpEnabled') is not None or self.new_object.get('rstp_enabled') is not None: - new_object_params['rstpEnabled'] = self.new_object.get('rstpEnabled') - if self.new_object.get('stpGuard') is not None or self.new_object.get('stp_guard') is not None: - new_object_params['stpGuard'] = self.new_object.get('stpGuard') or \ - self.new_object.get('stp_guard') if self.new_object.get('linkNegotiation') is not None or self.new_object.get('link_negotiation') is not None: new_object_params['linkNegotiation'] = self.new_object.get('linkNegotiation') or \ self.new_object.get('link_negotiation') - if self.new_object.get('portScheduleId') is not None or self.new_object.get('port_schedule_id') is not None: - new_object_params['portScheduleId'] = self.new_object.get('portScheduleId') or \ - self.new_object.get('port_schedule_id') - if self.new_object.get('udld') is not None or self.new_object.get('udld') is not None: - new_object_params['udld'] = self.new_object.get('udld') or \ - self.new_object.get('udld') - if self.new_object.get('accessPolicyType') is not None or self.new_object.get('access_policy_type') is not None: - new_object_params['accessPolicyType'] = self.new_object.get('accessPolicyType') or \ - self.new_object.get('access_policy_type') - if self.new_object.get('accessPolicyNumber') is not None or self.new_object.get('access_policy_number') is not None: - new_object_params['accessPolicyNumber'] = self.new_object.get('accessPolicyNumber') or \ - self.new_object.get('access_policy_number') if self.new_object.get('macAllowList') is not None or self.new_object.get('mac_allow_list') is not None: new_object_params['macAllowList'] = self.new_object.get('macAllowList') or \ self.new_object.get('mac_allow_list') + if self.new_object.get('name') is not None or self.new_object.get('name') is not None: + new_object_params['name'] = self.new_object.get('name') or \ + self.new_object.get('name') + if self.new_object.get('poeEnabled') is not None or self.new_object.get('poe_enabled') is not None: + new_object_params['poeEnabled'] = self.new_object.get('poeEnabled') + if self.new_object.get('portScheduleId') is not None or self.new_object.get('port_schedule_id') is not None: + new_object_params['portScheduleId'] = self.new_object.get('portScheduleId') or \ + self.new_object.get('port_schedule_id') + if self.new_object.get('profile') is not None or self.new_object.get('profile') is not None: + new_object_params['profile'] = self.new_object.get('profile') or \ + self.new_object.get('profile') + if self.new_object.get('rstpEnabled') is not None or self.new_object.get('rstp_enabled') is not None: + new_object_params['rstpEnabled'] = self.new_object.get('rstpEnabled') if self.new_object.get('stickyMacAllowList') is not None or self.new_object.get('sticky_mac_allow_list') is not None: new_object_params['stickyMacAllowList'] = self.new_object.get('stickyMacAllowList') or \ self.new_object.get('sticky_mac_allow_list') @@ -188,13 +177,24 @@ class OrganizationsConfigTemplatesSwitchProfilesPorts(object): self.new_object.get('sticky_mac_allow_list_limit') if self.new_object.get('stormControlEnabled') is not None or self.new_object.get('storm_control_enabled') is not None: new_object_params['stormControlEnabled'] = self.new_object.get('stormControlEnabled') - if self.new_object.get('flexibleStackingEnabled') is not None or self.new_object.get('flexible_stacking_enabled') is not None: - new_object_params['flexibleStackingEnabled'] = self.new_object.get('flexibleStackingEnabled') - if self.new_object.get('daiTrusted') is not None or self.new_object.get('dai_trusted') is not None: - new_object_params['daiTrusted'] = self.new_object.get('daiTrusted') - if self.new_object.get('profile') is not None or self.new_object.get('profile') is not None: - new_object_params['profile'] = self.new_object.get('profile') or \ - self.new_object.get('profile') + if self.new_object.get('stpGuard') is not None or self.new_object.get('stp_guard') is not None: + new_object_params['stpGuard'] = self.new_object.get('stpGuard') or \ + self.new_object.get('stp_guard') + if self.new_object.get('tags') is not None or self.new_object.get('tags') is not None: + new_object_params['tags'] = self.new_object.get('tags') or \ + self.new_object.get('tags') + if self.new_object.get('type') is not None or self.new_object.get('type') is not None: + new_object_params['type'] = self.new_object.get('type') or \ + self.new_object.get('type') + if self.new_object.get('udld') is not None or self.new_object.get('udld') is not None: + new_object_params['udld'] = self.new_object.get('udld') or \ + self.new_object.get('udld') + if self.new_object.get('vlan') is not None or self.new_object.get('vlan') is not None: + new_object_params['vlan'] = self.new_object.get('vlan') or \ + self.new_object.get('vlan') + if self.new_object.get('voiceVlan') is not None or self.new_object.get('voice_vlan') is not None: + new_object_params['voiceVlan'] = self.new_object.get('voiceVlan') or \ + self.new_object.get('voice_vlan') if self.new_object.get('organizationId') is not None or self.new_object.get('organization_id') is not None: new_object_params['organizationId'] = self.new_object.get('organizationId') or \ self.new_object.get('organization_id') @@ -278,29 +278,29 @@ class OrganizationsConfigTemplatesSwitchProfilesPorts(object): requested_obj = self.new_object obj_params = [ - ("name", "name"), - ("tags", "tags"), - ("enabled", "enabled"), - ("poeEnabled", "poeEnabled"), - ("type", "type"), - ("vlan", "vlan"), - ("voiceVlan", "voiceVlan"), + ("accessPolicyNumber", "accessPolicyNumber"), + ("accessPolicyType", "accessPolicyType"), ("allowedVlans", "allowedVlans"), + ("daiTrusted", "daiTrusted"), + ("enabled", "enabled"), + ("flexibleStackingEnabled", "flexibleStackingEnabled"), ("isolationEnabled", "isolationEnabled"), - ("rstpEnabled", "rstpEnabled"), - ("stpGuard", "stpGuard"), ("linkNegotiation", "linkNegotiation"), - ("portScheduleId", "portScheduleId"), - ("udld", "udld"), - ("accessPolicyType", "accessPolicyType"), - ("accessPolicyNumber", "accessPolicyNumber"), ("macAllowList", "macAllowList"), + ("name", "name"), + ("poeEnabled", "poeEnabled"), + ("portScheduleId", "portScheduleId"), + ("profile", "profile"), + ("rstpEnabled", "rstpEnabled"), ("stickyMacAllowList", "stickyMacAllowList"), ("stickyMacAllowListLimit", "stickyMacAllowListLimit"), ("stormControlEnabled", "stormControlEnabled"), - ("flexibleStackingEnabled", "flexibleStackingEnabled"), - ("daiTrusted", "daiTrusted"), - ("profile", "profile"), + ("stpGuard", "stpGuard"), + ("tags", "tags"), + ("type", "type"), + ("udld", "udld"), + ("vlan", "vlan"), + ("voiceVlan", "voiceVlan"), ("organizationId", "organizationId"), ("configTemplateId", "configTemplateId"), ("profileId", "profileId"), diff --git a/ansible_collections/cisco/meraki/plugins/action/organizations_devices_availabilities_change_history_info.py b/ansible_collections/cisco/meraki/plugins/action/organizations_devices_availabilities_change_history_info.py new file mode 100644 index 000000000..feee0396e --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/action/organizations_devices_availabilities_change_history_info.py @@ -0,0 +1,136 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( + MERAKI, + meraki_argument_spec, +) + +# Get common arguments specification +argument_spec = meraki_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + organizationId=dict(type="str"), + perPage=dict(type="int"), + total_pages=dict(type="int"), + direction=dict(type="str"), + startingAfter=dict(type="str"), + endingBefore=dict(type="str"), + t0=dict(type="str"), + t1=dict(type="str"), + timespan=dict(type="float"), + serials=dict(type="list"), + productTypes=dict(type="list"), + networkIds=dict(type="list"), + statuses=dict(type="list"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail( + "ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_all(self, params): + new_object = {} + if params.get("organizationId") is not None: + new_object["organizationId"] = params.get( + "organizationId") + if params.get("perPage") is not None: + new_object["perPage"] = params.get( + "perPage") + new_object['total_pages'] = params.get( + "total_pages") or 1 + new_object['direction'] = params.get( + "direction") or "next" + if params.get("startingAfter") is not None: + new_object["startingAfter"] = params.get( + "startingAfter") + if params.get("endingBefore") is not None: + new_object["endingBefore"] = params.get( + "endingBefore") + if params.get("t0") is not None: + new_object["t0"] = params.get( + "t0") + if params.get("t1") is not None: + new_object["t1"] = params.get( + "t1") + if params.get("timespan") is not None: + new_object["timespan"] = params.get( + "timespan") + if params.get("serials") is not None: + new_object["serials"] = params.get( + "serials") + if params.get("productTypes") is not None: + new_object["productTypes"] = params.get( + "productTypes") + if params.get("networkIds") is not None: + new_object["networkIds"] = params.get( + "networkIds") + if params.get("statuses") is not None: + new_object["statuses"] = params.get( + "statuses") + + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(meraki_response={})) + + meraki = MERAKI(params=self._task.args) + + response = meraki.exec_meraki( + family="organizations", + function='getOrganizationDevicesAvailabilitiesChangeHistory', + params=self.get_all(self._task.args), + ) + self._result.update(dict(meraki_response=response)) + self._result.update(meraki.exit_json()) + return self._result diff --git a/ansible_collections/cisco/meraki/plugins/action/organizations_devices_boots_history_info.py b/ansible_collections/cisco/meraki/plugins/action/organizations_devices_boots_history_info.py new file mode 100644 index 000000000..53053eb7a --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/action/organizations_devices_boots_history_info.py @@ -0,0 +1,132 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( + MERAKI, + meraki_argument_spec, +) + +# Get common arguments specification +argument_spec = meraki_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + organizationId=dict(type="str"), + t0=dict(type="str"), + t1=dict(type="str"), + timespan=dict(type="float"), + serials=dict(type="list"), + mostRecentPerDevice=dict(type="bool"), + perPage=dict(type="int"), + total_pages=dict(type="int"), + direction=dict(type="str"), + startingAfter=dict(type="str"), + endingBefore=dict(type="str"), + sortOrder=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail( + "ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_all(self, params): + new_object = {} + if params.get("organizationId") is not None: + new_object["organizationId"] = params.get( + "organizationId") + if params.get("t0") is not None: + new_object["t0"] = params.get( + "t0") + if params.get("t1") is not None: + new_object["t1"] = params.get( + "t1") + if params.get("timespan") is not None: + new_object["timespan"] = params.get( + "timespan") + if params.get("serials") is not None: + new_object["serials"] = params.get( + "serials") + if params.get("mostRecentPerDevice") is not None: + new_object["mostRecentPerDevice"] = params.get( + "mostRecentPerDevice") + if params.get("perPage") is not None: + new_object["perPage"] = params.get( + "perPage") + new_object['total_pages'] = params.get( + "total_pages") or 1 + new_object['direction'] = params.get( + "direction") or "next" + if params.get("startingAfter") is not None: + new_object["startingAfter"] = params.get( + "startingAfter") + if params.get("endingBefore") is not None: + new_object["endingBefore"] = params.get( + "endingBefore") + if params.get("sortOrder") is not None: + new_object["sortOrder"] = params.get( + "sortOrder") + + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(meraki_response={})) + + meraki = MERAKI(params=self._task.args) + + response = meraki.exec_meraki( + family="organizations", + function='getOrganizationDevicesBootsHistory', + params=self.get_all(self._task.args), + ) + self._result.update(dict(meraki_response=response)) + self._result.update(meraki.exit_json()) + return self._result diff --git a/ansible_collections/cisco/meraki/plugins/action/organizations_early_access_features_opt_ins.py b/ansible_collections/cisco/meraki/plugins/action/organizations_early_access_features_opt_ins.py index 7a952168f..b0ebdf793 100644 --- a/ansible_collections/cisco/meraki/plugins/action/organizations_early_access_features_opt_ins.py +++ b/ansible_collections/cisco/meraki/plugins/action/organizations_early_access_features_opt_ins.py @@ -32,8 +32,8 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present", "absent"]), - shortName=dict(type="str"), limitScopeToNetworks=dict(type="list"), + shortName=dict(type="str"), organizationId=dict(type="str"), optInId=dict(type="str"), )) @@ -51,8 +51,8 @@ class OrganizationsEarlyAccessFeaturesOptIns(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( - shortName=params.get("shortName"), limitScopeToNetworks=params.get("limitScopeToNetworks"), + shortName=params.get("shortName"), organizationId=params.get("organizationId"), optInId=params.get("optInId"), ) @@ -76,12 +76,12 @@ class OrganizationsEarlyAccessFeaturesOptIns(object): def create_params(self): new_object_params = {} - if self.new_object.get('shortName') is not None or self.new_object.get('short_name') is not None: - new_object_params['shortName'] = self.new_object.get('shortName') or \ - self.new_object.get('short_name') if self.new_object.get('limitScopeToNetworks') is not None or self.new_object.get('limit_scope_to_networks') is not None: new_object_params['limitScopeToNetworks'] = self.new_object.get('limitScopeToNetworks') or \ self.new_object.get('limit_scope_to_networks') + if self.new_object.get('shortName') is not None or self.new_object.get('short_name') is not None: + new_object_params['shortName'] = self.new_object.get('shortName') or \ + self.new_object.get('short_name') if self.new_object.get('organizationId') is not None or self.new_object.get('organization_id') is not None: new_object_params['organizationId'] = self.new_object.get('organizationId') or \ self.new_object.get('organization_id') @@ -179,8 +179,8 @@ class OrganizationsEarlyAccessFeaturesOptIns(object): requested_obj = self.new_object obj_params = [ - ("shortName", "shortName"), ("limitScopeToNetworks", "limitScopeToNetworks"), + ("shortName", "shortName"), ("organizationId", "organizationId"), ("optInId", "optInId"), ] diff --git a/ansible_collections/cisco/meraki/plugins/action/organizations_firmware_upgrades_by_device_info.py b/ansible_collections/cisco/meraki/plugins/action/organizations_firmware_upgrades_by_device_info.py index 254770a93..942ee2ecb 100644 --- a/ansible_collections/cisco/meraki/plugins/action/organizations_firmware_upgrades_by_device_info.py +++ b/ansible_collections/cisco/meraki/plugins/action/organizations_firmware_upgrades_by_device_info.py @@ -34,8 +34,8 @@ argument_spec.update(dict( networkIds=dict(type="list"), serials=dict(type="list"), macs=dict(type="list"), - firmwareUpgradeIds=dict(type="list"), firmwareUpgradeBatchIds=dict(type="list"), + upgradeStatuses=dict(type="list"), )) required_if = [] @@ -99,12 +99,12 @@ class ActionModule(ActionBase): if params.get("macs") is not None: new_object["macs"] = params.get( "macs") - if params.get("firmwareUpgradeIds") is not None: - new_object["firmwareUpgradeIds"] = params.get( - "firmwareUpgradeIds") if params.get("firmwareUpgradeBatchIds") is not None: new_object["firmwareUpgradeBatchIds"] = params.get( "firmwareUpgradeBatchIds") + if params.get("upgradeStatuses") is not None: + new_object["upgradeStatuses"] = params.get( + "upgradeStatuses") return new_object diff --git a/ansible_collections/cisco/meraki/plugins/action/organizations_firmware_upgrades_info.py b/ansible_collections/cisco/meraki/plugins/action/organizations_firmware_upgrades_info.py index e8e72f6ce..afe4584e9 100644 --- a/ansible_collections/cisco/meraki/plugins/action/organizations_firmware_upgrades_info.py +++ b/ansible_collections/cisco/meraki/plugins/action/organizations_firmware_upgrades_info.py @@ -26,8 +26,13 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( organizationId=dict(type="str"), + perPage=dict(type="int"), + total_pages=dict(type="int"), + direction=dict(type="str"), + startingAfter=dict(type="str"), + endingBefore=dict(type="str"), status=dict(type="list"), - productType=dict(type="list"), + productTypes=dict(type="list"), )) required_if = [] @@ -69,12 +74,25 @@ class ActionModule(ActionBase): if params.get("organizationId") is not None: new_object["organizationId"] = params.get( "organizationId") + if params.get("perPage") is not None: + new_object["perPage"] = params.get( + "perPage") + new_object['total_pages'] = params.get( + "total_pages") or 1 + new_object['direction'] = params.get( + "direction") or "next" + if params.get("startingAfter") is not None: + new_object["startingAfter"] = params.get( + "startingAfter") + if params.get("endingBefore") is not None: + new_object["endingBefore"] = params.get( + "endingBefore") if params.get("status") is not None: new_object["status"] = params.get( "status") - if params.get("productType") is not None: - new_object["productType"] = params.get( - "productType") + if params.get("productTypes") is not None: + new_object["productTypes"] = params.get( + "productTypes") return new_object diff --git a/ansible_collections/cisco/meraki/plugins/action/organizations_info.py b/ansible_collections/cisco/meraki/plugins/action/organizations_info.py index e7dba48d4..3a48d1c4b 100644 --- a/ansible_collections/cisco/meraki/plugins/action/organizations_info.py +++ b/ansible_collections/cisco/meraki/plugins/action/organizations_info.py @@ -25,6 +25,11 @@ from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( + perPage=dict(type="int"), + total_pages=dict(type="int"), + direction=dict(type="str"), + startingAfter=dict(type="str"), + endingBefore=dict(type="str"), organizationId=dict(type="str"), )) @@ -71,6 +76,19 @@ class ActionModule(ActionBase): def get_all(self, params): new_object = {} + if params.get("perPage") is not None: + new_object["perPage"] = params.get( + "perPage") + new_object['total_pages'] = params.get( + "total_pages") or 1 + new_object['direction'] = params.get( + "direction") or "next" + if params.get("startingAfter") is not None: + new_object["startingAfter"] = params.get( + "startingAfter") + if params.get("endingBefore") is not None: + new_object["endingBefore"] = params.get( + "endingBefore") return new_object diff --git a/ansible_collections/cisco/meraki/plugins/action/organizations_insight_monitored_media_servers.py b/ansible_collections/cisco/meraki/plugins/action/organizations_insight_monitored_media_servers.py index 14957d943..dbead6d01 100644 --- a/ansible_collections/cisco/meraki/plugins/action/organizations_insight_monitored_media_servers.py +++ b/ansible_collections/cisco/meraki/plugins/action/organizations_insight_monitored_media_servers.py @@ -32,9 +32,9 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present", "absent"]), - name=dict(type="str"), address=dict(type="str"), bestEffortMonitoringEnabled=dict(type="bool"), + name=dict(type="str"), organizationId=dict(type="str"), monitoredMediaServerId=dict(type="str"), )) @@ -52,9 +52,9 @@ class OrganizationsInsightMonitoredMediaServers(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( - name=params.get("name"), address=params.get("address"), bestEffortMonitoringEnabled=params.get("bestEffortMonitoringEnabled"), + name=params.get("name"), organizationId=params.get("organizationId"), monitoredMediaServerId=params.get("monitoredMediaServerId"), ) @@ -78,14 +78,14 @@ class OrganizationsInsightMonitoredMediaServers(object): def create_params(self): new_object_params = {} - if self.new_object.get('name') is not None or self.new_object.get('name') is not None: - new_object_params['name'] = self.new_object.get('name') or \ - self.new_object.get('name') if self.new_object.get('address') is not None or self.new_object.get('address') is not None: new_object_params['address'] = self.new_object.get('address') or \ self.new_object.get('address') if self.new_object.get('bestEffortMonitoringEnabled') is not None or self.new_object.get('best_effort_monitoring_enabled') is not None: new_object_params['bestEffortMonitoringEnabled'] = self.new_object.get('bestEffortMonitoringEnabled') + if self.new_object.get('name') is not None or self.new_object.get('name') is not None: + new_object_params['name'] = self.new_object.get('name') or \ + self.new_object.get('name') if self.new_object.get('organizationId') is not None or self.new_object.get('organization_id') is not None: new_object_params['organizationId'] = self.new_object.get('organizationId') or \ self.new_object.get('organization_id') @@ -103,14 +103,14 @@ class OrganizationsInsightMonitoredMediaServers(object): def update_by_id_params(self): new_object_params = {} - if self.new_object.get('name') is not None or self.new_object.get('name') is not None: - new_object_params['name'] = self.new_object.get('name') or \ - self.new_object.get('name') if self.new_object.get('address') is not None or self.new_object.get('address') is not None: new_object_params['address'] = self.new_object.get('address') or \ self.new_object.get('address') if self.new_object.get('bestEffortMonitoringEnabled') is not None or self.new_object.get('best_effort_monitoring_enabled') is not None: new_object_params['bestEffortMonitoringEnabled'] = self.new_object.get('bestEffortMonitoringEnabled') + if self.new_object.get('name') is not None or self.new_object.get('name') is not None: + new_object_params['name'] = self.new_object.get('name') or \ + self.new_object.get('name') if self.new_object.get('organizationId') is not None or self.new_object.get('organization_id') is not None: new_object_params['organizationId'] = self.new_object.get('organizationId') or \ self.new_object.get('organization_id') @@ -188,9 +188,9 @@ class OrganizationsInsightMonitoredMediaServers(object): requested_obj = self.new_object obj_params = [ - ("name", "name"), ("address", "address"), ("bestEffortMonitoringEnabled", "bestEffortMonitoringEnabled"), + ("name", "name"), ("organizationId", "organizationId"), ("monitoredMediaServerId", "monitoredMediaServerId"), ] diff --git a/ansible_collections/cisco/meraki/plugins/action/organizations_inventory_claim.py b/ansible_collections/cisco/meraki/plugins/action/organizations_inventory_claim.py index 5bc648b91..e25a3d67b 100644 --- a/ansible_collections/cisco/meraki/plugins/action/organizations_inventory_claim.py +++ b/ansible_collections/cisco/meraki/plugins/action/organizations_inventory_claim.py @@ -25,9 +25,9 @@ from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( + licenses=dict(type="list"), orders=dict(type="list"), serials=dict(type="list"), - licenses=dict(type="list"), organizationId=dict(type="str"), )) @@ -67,9 +67,9 @@ class ActionModule(ActionBase): def get_object(self, params): new_object = dict( + licenses=params.get("licenses"), orders=params.get("orders"), serials=params.get("serials"), - licenses=params.get("licenses"), organizationId=params.get("organizationId"), ) return new_object diff --git a/ansible_collections/cisco/meraki/plugins/action/organizations_inventory_onboarding_cloud_monitoring_export_events.py b/ansible_collections/cisco/meraki/plugins/action/organizations_inventory_onboarding_cloud_monitoring_export_events.py index 11cefb220..6a03ab49f 100644 --- a/ansible_collections/cisco/meraki/plugins/action/organizations_inventory_onboarding_cloud_monitoring_export_events.py +++ b/ansible_collections/cisco/meraki/plugins/action/organizations_inventory_onboarding_cloud_monitoring_export_events.py @@ -26,9 +26,9 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( logEvent=dict(type="str"), - timestamp=dict(type="int"), - targetOS=dict(type="str"), request=dict(type="str"), + targetOS=dict(type="str"), + timestamp=dict(type="int"), organizationId=dict(type="str"), )) @@ -69,9 +69,9 @@ class ActionModule(ActionBase): def get_object(self, params): new_object = dict( logEvent=params.get("logEvent"), - timestamp=params.get("timestamp"), - targetOS=params.get("targetOS"), request=params.get("request"), + targetOS=params.get("targetOS"), + timestamp=params.get("timestamp"), organizationId=params.get("organizationId"), ) return new_object diff --git a/ansible_collections/cisco/meraki/plugins/action/organizations_inventory_onboarding_cloud_monitoring_networks_info.py b/ansible_collections/cisco/meraki/plugins/action/organizations_inventory_onboarding_cloud_monitoring_networks_info.py index 409b7abdb..bf953f272 100644 --- a/ansible_collections/cisco/meraki/plugins/action/organizations_inventory_onboarding_cloud_monitoring_networks_info.py +++ b/ansible_collections/cisco/meraki/plugins/action/organizations_inventory_onboarding_cloud_monitoring_networks_info.py @@ -27,6 +27,7 @@ argument_spec = meraki_argument_spec() argument_spec.update(dict( organizationId=dict(type="str"), deviceType=dict(type="str"), + search=dict(type="str"), perPage=dict(type="int"), total_pages=dict(type="int"), direction=dict(type="str"), @@ -76,6 +77,9 @@ class ActionModule(ActionBase): if params.get("deviceType") is not None: new_object["deviceType"] = params.get( "deviceType") + if params.get("search") is not None: + new_object["search"] = params.get( + "search") if params.get("perPage") is not None: new_object["perPage"] = params.get( "perPage") diff --git a/ansible_collections/cisco/meraki/plugins/action/organizations_login_security.py b/ansible_collections/cisco/meraki/plugins/action/organizations_login_security.py index 64f5ea7b4..d231966d9 100644 --- a/ansible_collections/cisco/meraki/plugins/action/organizations_login_security.py +++ b/ansible_collections/cisco/meraki/plugins/action/organizations_login_security.py @@ -32,19 +32,19 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present"]), - enforcePasswordExpiration=dict(type="bool"), - passwordExpirationDays=dict(type="int"), - enforceDifferentPasswords=dict(type="bool"), - numDifferentPasswords=dict(type="int"), - enforceStrongPasswords=dict(type="bool"), - enforceAccountLockout=dict(type="bool"), accountLockoutAttempts=dict(type="int"), + apiAuthentication=dict(type="dict"), + enforceAccountLockout=dict(type="bool"), + enforceDifferentPasswords=dict(type="bool"), enforceIdleTimeout=dict(type="bool"), - idleTimeoutMinutes=dict(type="int"), - enforceTwoFactorAuth=dict(type="bool"), enforceLoginIpRanges=dict(type="bool"), + enforcePasswordExpiration=dict(type="bool"), + enforceStrongPasswords=dict(type="bool"), + enforceTwoFactorAuth=dict(type="bool"), + idleTimeoutMinutes=dict(type="int"), loginIpRanges=dict(type="list"), - apiAuthentication=dict(type="dict"), + numDifferentPasswords=dict(type="int"), + passwordExpirationDays=dict(type="int"), organizationId=dict(type="str"), )) @@ -60,19 +60,19 @@ class OrganizationsLoginSecurity(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( - enforcePasswordExpiration=params.get("enforcePasswordExpiration"), - passwordExpirationDays=params.get("passwordExpirationDays"), - enforceDifferentPasswords=params.get("enforceDifferentPasswords"), - numDifferentPasswords=params.get("numDifferentPasswords"), - enforceStrongPasswords=params.get("enforceStrongPasswords"), - enforceAccountLockout=params.get("enforceAccountLockout"), accountLockoutAttempts=params.get("accountLockoutAttempts"), + apiAuthentication=params.get("apiAuthentication"), + enforceAccountLockout=params.get("enforceAccountLockout"), + enforceDifferentPasswords=params.get("enforceDifferentPasswords"), enforceIdleTimeout=params.get("enforceIdleTimeout"), - idleTimeoutMinutes=params.get("idleTimeoutMinutes"), - enforceTwoFactorAuth=params.get("enforceTwoFactorAuth"), enforceLoginIpRanges=params.get("enforceLoginIpRanges"), + enforcePasswordExpiration=params.get("enforcePasswordExpiration"), + enforceStrongPasswords=params.get("enforceStrongPasswords"), + enforceTwoFactorAuth=params.get("enforceTwoFactorAuth"), + idleTimeoutMinutes=params.get("idleTimeoutMinutes"), loginIpRanges=params.get("loginIpRanges"), - apiAuthentication=params.get("apiAuthentication"), + numDifferentPasswords=params.get("numDifferentPasswords"), + passwordExpirationDays=params.get("passwordExpirationDays"), organization_id=params.get("organizationId"), ) @@ -85,38 +85,38 @@ class OrganizationsLoginSecurity(object): def update_all_params(self): new_object_params = {} - if self.new_object.get('enforcePasswordExpiration') is not None or self.new_object.get('enforce_password_expiration') is not None: - new_object_params['enforcePasswordExpiration'] = self.new_object.get('enforcePasswordExpiration') - if self.new_object.get('passwordExpirationDays') is not None or self.new_object.get('password_expiration_days') is not None: - new_object_params['passwordExpirationDays'] = self.new_object.get('passwordExpirationDays') or \ - self.new_object.get('password_expiration_days') - if self.new_object.get('enforceDifferentPasswords') is not None or self.new_object.get('enforce_different_passwords') is not None: - new_object_params['enforceDifferentPasswords'] = self.new_object.get('enforceDifferentPasswords') - if self.new_object.get('numDifferentPasswords') is not None or self.new_object.get('num_different_passwords') is not None: - new_object_params['numDifferentPasswords'] = self.new_object.get('numDifferentPasswords') or \ - self.new_object.get('num_different_passwords') - if self.new_object.get('enforceStrongPasswords') is not None or self.new_object.get('enforce_strong_passwords') is not None: - new_object_params['enforceStrongPasswords'] = self.new_object.get('enforceStrongPasswords') - if self.new_object.get('enforceAccountLockout') is not None or self.new_object.get('enforce_account_lockout') is not None: - new_object_params['enforceAccountLockout'] = self.new_object.get('enforceAccountLockout') if self.new_object.get('accountLockoutAttempts') is not None or self.new_object.get('account_lockout_attempts') is not None: new_object_params['accountLockoutAttempts'] = self.new_object.get('accountLockoutAttempts') or \ self.new_object.get('account_lockout_attempts') + if self.new_object.get('apiAuthentication') is not None or self.new_object.get('api_authentication') is not None: + new_object_params['apiAuthentication'] = self.new_object.get('apiAuthentication') or \ + self.new_object.get('api_authentication') + if self.new_object.get('enforceAccountLockout') is not None or self.new_object.get('enforce_account_lockout') is not None: + new_object_params['enforceAccountLockout'] = self.new_object.get('enforceAccountLockout') + if self.new_object.get('enforceDifferentPasswords') is not None or self.new_object.get('enforce_different_passwords') is not None: + new_object_params['enforceDifferentPasswords'] = self.new_object.get('enforceDifferentPasswords') if self.new_object.get('enforceIdleTimeout') is not None or self.new_object.get('enforce_idle_timeout') is not None: new_object_params['enforceIdleTimeout'] = self.new_object.get('enforceIdleTimeout') + if self.new_object.get('enforceLoginIpRanges') is not None or self.new_object.get('enforce_login_ip_ranges') is not None: + new_object_params['enforceLoginIpRanges'] = self.new_object.get('enforceLoginIpRanges') + if self.new_object.get('enforcePasswordExpiration') is not None or self.new_object.get('enforce_password_expiration') is not None: + new_object_params['enforcePasswordExpiration'] = self.new_object.get('enforcePasswordExpiration') + if self.new_object.get('enforceStrongPasswords') is not None or self.new_object.get('enforce_strong_passwords') is not None: + new_object_params['enforceStrongPasswords'] = self.new_object.get('enforceStrongPasswords') + if self.new_object.get('enforceTwoFactorAuth') is not None or self.new_object.get('enforce_two_factor_auth') is not None: + new_object_params['enforceTwoFactorAuth'] = self.new_object.get('enforceTwoFactorAuth') if self.new_object.get('idleTimeoutMinutes') is not None or self.new_object.get('idle_timeout_minutes') is not None: new_object_params['idleTimeoutMinutes'] = self.new_object.get('idleTimeoutMinutes') or \ self.new_object.get('idle_timeout_minutes') - if self.new_object.get('enforceTwoFactorAuth') is not None or self.new_object.get('enforce_two_factor_auth') is not None: - new_object_params['enforceTwoFactorAuth'] = self.new_object.get('enforceTwoFactorAuth') - if self.new_object.get('enforceLoginIpRanges') is not None or self.new_object.get('enforce_login_ip_ranges') is not None: - new_object_params['enforceLoginIpRanges'] = self.new_object.get('enforceLoginIpRanges') if self.new_object.get('loginIpRanges') is not None or self.new_object.get('login_ip_ranges') is not None: new_object_params['loginIpRanges'] = self.new_object.get('loginIpRanges') or \ self.new_object.get('login_ip_ranges') - if self.new_object.get('apiAuthentication') is not None or self.new_object.get('api_authentication') is not None: - new_object_params['apiAuthentication'] = self.new_object.get('apiAuthentication') or \ - self.new_object.get('api_authentication') + if self.new_object.get('numDifferentPasswords') is not None or self.new_object.get('num_different_passwords') is not None: + new_object_params['numDifferentPasswords'] = self.new_object.get('numDifferentPasswords') or \ + self.new_object.get('num_different_passwords') + if self.new_object.get('passwordExpirationDays') is not None or self.new_object.get('password_expiration_days') is not None: + new_object_params['passwordExpirationDays'] = self.new_object.get('passwordExpirationDays') or \ + self.new_object.get('password_expiration_days') if self.new_object.get('organizationId') is not None or self.new_object.get('organization_id') is not None: new_object_params['organizationId'] = self.new_object.get('organizationId') or \ self.new_object.get('organization_id') @@ -152,7 +152,7 @@ class OrganizationsLoginSecurity(object): id_exists = False name_exists = False o_id = self.new_object.get("id") - name = self.new_object.get("organization_id") + name = self.new_object.get("name") if o_id: prev_obj = self.get_object_by_name(o_id) id_exists = prev_obj is not None and isinstance(prev_obj, dict) @@ -173,18 +173,18 @@ class OrganizationsLoginSecurity(object): requested_obj = self.new_object obj_params = [ - ("enforcePasswordExpiration", "enforcePasswordExpiration"), - ("enforceDifferentPasswords", "enforceDifferentPasswords"), - ("numDifferentPasswords", "numDifferentPasswords"), - ("enforceStrongPasswords", "enforceStrongPasswords"), - ("enforceAccountLockout", "enforceAccountLockout"), ("accountLockoutAttempts", "accountLockoutAttempts"), + ("apiAuthentication", "apiAuthentication"), + ("enforceAccountLockout", "enforceAccountLockout"), + ("enforceDifferentPasswords", "enforceDifferentPasswords"), ("enforceIdleTimeout", "enforceIdleTimeout"), - ("idleTimeoutMinutes", "idleTimeoutMinutes"), - ("enforceTwoFactorAuth", "enforceTwoFactorAuth"), ("enforceLoginIpRanges", "enforceLoginIpRanges"), + ("enforcePasswordExpiration", "enforcePasswordExpiration"), + ("enforceStrongPasswords", "enforceStrongPasswords"), + ("enforceTwoFactorAuth", "enforceTwoFactorAuth"), + ("idleTimeoutMinutes", "idleTimeoutMinutes"), ("loginIpRanges", "loginIpRanges"), - ("apiAuthentication", "apiAuthentication"), + ("numDifferentPasswords", "numDifferentPasswords"), ("organizationId", "organizationId"), ] # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params diff --git a/ansible_collections/cisco/meraki/plugins/action/organizations_networks_combine.py b/ansible_collections/cisco/meraki/plugins/action/organizations_networks_combine.py index c6d337d78..395cd6597 100644 --- a/ansible_collections/cisco/meraki/plugins/action/organizations_networks_combine.py +++ b/ansible_collections/cisco/meraki/plugins/action/organizations_networks_combine.py @@ -25,9 +25,9 @@ from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( + enrollmentString=dict(type="str"), name=dict(type="str"), networkIds=dict(type="list"), - enrollmentString=dict(type="str"), organizationId=dict(type="str"), )) @@ -67,9 +67,9 @@ class ActionModule(ActionBase): def get_object(self, params): new_object = dict( + enrollmentString=params.get("enrollmentString"), name=params.get("name"), networkIds=params.get("networkIds"), - enrollmentString=params.get("enrollmentString"), organizationId=params.get("organizationId"), ) return new_object diff --git a/ansible_collections/cisco/meraki/plugins/action/organizations_openapi_spec_info.py b/ansible_collections/cisco/meraki/plugins/action/organizations_openapi_spec_info.py index 6ad1215dc..2d6bb35ed 100644 --- a/ansible_collections/cisco/meraki/plugins/action/organizations_openapi_spec_info.py +++ b/ansible_collections/cisco/meraki/plugins/action/organizations_openapi_spec_info.py @@ -26,6 +26,7 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( organizationId=dict(type="str"), + version=dict(type="int"), )) required_if = [] @@ -67,6 +68,9 @@ class ActionModule(ActionBase): if params.get("organizationId") is not None: new_object["organizationId"] = params.get( "organizationId") + if params.get("version") is not None: + new_object["version"] = params.get( + "version") return new_object diff --git a/ansible_collections/cisco/meraki/plugins/action/organizations_policy_objects.py b/ansible_collections/cisco/meraki/plugins/action/organizations_policy_objects.py index 6e49366b2..e412ec4d4 100644 --- a/ansible_collections/cisco/meraki/plugins/action/organizations_policy_objects.py +++ b/ansible_collections/cisco/meraki/plugins/action/organizations_policy_objects.py @@ -32,14 +32,14 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present", "absent"]), - name=dict(type="str"), category=dict(type="str"), - type=dict(type="str"), cidr=dict(type="str"), fqdn=dict(type="str"), - mask=dict(type="str"), - ip=dict(type="str"), groupIds=dict(type="list"), + ip=dict(type="str"), + mask=dict(type="str"), + name=dict(type="str"), + type=dict(type="str"), organizationId=dict(type="str"), policyObjectId=dict(type="str"), )) @@ -57,14 +57,14 @@ class OrganizationsPolicyObjects(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( - name=params.get("name"), category=params.get("category"), - type=params.get("type"), cidr=params.get("cidr"), fqdn=params.get("fqdn"), - mask=params.get("mask"), - ip=params.get("ip"), groupIds=params.get("groupIds"), + ip=params.get("ip"), + mask=params.get("mask"), + name=params.get("name"), + type=params.get("type"), organizationId=params.get("organizationId"), policyObjectId=params.get("policyObjectId"), ) @@ -98,30 +98,30 @@ class OrganizationsPolicyObjects(object): def create_params(self): new_object_params = {} - if self.new_object.get('name') is not None or self.new_object.get('name') is not None: - new_object_params['name'] = self.new_object.get('name') or \ - self.new_object.get('name') if self.new_object.get('category') is not None or self.new_object.get('category') is not None: new_object_params['category'] = self.new_object.get('category') or \ self.new_object.get('category') - if self.new_object.get('type') is not None or self.new_object.get('type') is not None: - new_object_params['type'] = self.new_object.get('type') or \ - self.new_object.get('type') if self.new_object.get('cidr') is not None or self.new_object.get('cidr') is not None: new_object_params['cidr'] = self.new_object.get('cidr') or \ self.new_object.get('cidr') if self.new_object.get('fqdn') is not None or self.new_object.get('fqdn') is not None: new_object_params['fqdn'] = self.new_object.get('fqdn') or \ self.new_object.get('fqdn') - if self.new_object.get('mask') is not None or self.new_object.get('mask') is not None: - new_object_params['mask'] = self.new_object.get('mask') or \ - self.new_object.get('mask') - if self.new_object.get('ip') is not None or self.new_object.get('ip') is not None: - new_object_params['ip'] = self.new_object.get('ip') or \ - self.new_object.get('ip') if self.new_object.get('groupIds') is not None or self.new_object.get('group_ids') is not None: new_object_params['groupIds'] = self.new_object.get('groupIds') or \ self.new_object.get('group_ids') + if self.new_object.get('ip') is not None or self.new_object.get('ip') is not None: + new_object_params['ip'] = self.new_object.get('ip') or \ + self.new_object.get('ip') + if self.new_object.get('mask') is not None or self.new_object.get('mask') is not None: + new_object_params['mask'] = self.new_object.get('mask') or \ + self.new_object.get('mask') + if self.new_object.get('name') is not None or self.new_object.get('name') is not None: + new_object_params['name'] = self.new_object.get('name') or \ + self.new_object.get('name') + if self.new_object.get('type') is not None or self.new_object.get('type') is not None: + new_object_params['type'] = self.new_object.get('type') or \ + self.new_object.get('type') if self.new_object.get('organizationId') is not None or self.new_object.get('organization_id') is not None: new_object_params['organizationId'] = self.new_object.get('organizationId') or \ self.new_object.get('organization_id') @@ -139,24 +139,24 @@ class OrganizationsPolicyObjects(object): def update_by_id_params(self): new_object_params = {} - if self.new_object.get('name') is not None or self.new_object.get('name') is not None: - new_object_params['name'] = self.new_object.get('name') or \ - self.new_object.get('name') if self.new_object.get('cidr') is not None or self.new_object.get('cidr') is not None: new_object_params['cidr'] = self.new_object.get('cidr') or \ self.new_object.get('cidr') if self.new_object.get('fqdn') is not None or self.new_object.get('fqdn') is not None: new_object_params['fqdn'] = self.new_object.get('fqdn') or \ self.new_object.get('fqdn') - if self.new_object.get('mask') is not None or self.new_object.get('mask') is not None: - new_object_params['mask'] = self.new_object.get('mask') or \ - self.new_object.get('mask') - if self.new_object.get('ip') is not None or self.new_object.get('ip') is not None: - new_object_params['ip'] = self.new_object.get('ip') or \ - self.new_object.get('ip') if self.new_object.get('groupIds') is not None or self.new_object.get('group_ids') is not None: new_object_params['groupIds'] = self.new_object.get('groupIds') or \ self.new_object.get('group_ids') + if self.new_object.get('ip') is not None or self.new_object.get('ip') is not None: + new_object_params['ip'] = self.new_object.get('ip') or \ + self.new_object.get('ip') + if self.new_object.get('mask') is not None or self.new_object.get('mask') is not None: + new_object_params['mask'] = self.new_object.get('mask') or \ + self.new_object.get('mask') + if self.new_object.get('name') is not None or self.new_object.get('name') is not None: + new_object_params['name'] = self.new_object.get('name') or \ + self.new_object.get('name') if self.new_object.get('organizationId') is not None or self.new_object.get('organization_id') is not None: new_object_params['organizationId'] = self.new_object.get('organizationId') or \ self.new_object.get('organization_id') @@ -234,14 +234,14 @@ class OrganizationsPolicyObjects(object): requested_obj = self.new_object obj_params = [ - ("name", "name"), ("category", "category"), - ("type", "type"), ("cidr", "cidr"), ("fqdn", "fqdn"), - ("mask", "mask"), - ("ip", "ip"), ("groupIds", "groupIds"), + ("ip", "ip"), + ("mask", "mask"), + ("name", "name"), + ("type", "type"), ("organizationId", "organizationId"), ("policyObjectId", "policyObjectId"), ] diff --git a/ansible_collections/cisco/meraki/plugins/action/organizations_policy_objects_groups.py b/ansible_collections/cisco/meraki/plugins/action/organizations_policy_objects_groups.py index ff6b3f852..7de772a5e 100644 --- a/ansible_collections/cisco/meraki/plugins/action/organizations_policy_objects_groups.py +++ b/ansible_collections/cisco/meraki/plugins/action/organizations_policy_objects_groups.py @@ -32,8 +32,8 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present", "absent"]), - name=dict(type="str"), category=dict(type="str"), + name=dict(type="str"), objectIds=dict(type="list"), organizationId=dict(type="str"), policyObjectGroupId=dict(type="str"), @@ -52,8 +52,8 @@ class OrganizationsPolicyObjectsGroups(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( - name=params.get("name"), category=params.get("category"), + name=params.get("name"), objectIds=params.get("objectIds"), organizationId=params.get("organizationId"), policyObjectGroupId=params.get("policyObjectGroupId"), @@ -88,12 +88,12 @@ class OrganizationsPolicyObjectsGroups(object): def create_params(self): new_object_params = {} - if self.new_object.get('name') is not None or self.new_object.get('name') is not None: - new_object_params['name'] = self.new_object.get('name') or \ - self.new_object.get('name') if self.new_object.get('category') is not None or self.new_object.get('category') is not None: new_object_params['category'] = self.new_object.get('category') or \ self.new_object.get('category') + if self.new_object.get('name') is not None or self.new_object.get('name') is not None: + new_object_params['name'] = self.new_object.get('name') or \ + self.new_object.get('name') if self.new_object.get('objectIds') is not None or self.new_object.get('object_ids') is not None: new_object_params['objectIds'] = self.new_object.get('objectIds') or \ self.new_object.get('object_ids') @@ -197,8 +197,8 @@ class OrganizationsPolicyObjectsGroups(object): requested_obj = self.new_object obj_params = [ - ("name", "name"), ("category", "category"), + ("name", "name"), ("objectIds", "objectIds"), ("organizationId", "organizationId"), ("policyObjectGroupId", "policyObjectGroupId"), diff --git a/ansible_collections/cisco/meraki/plugins/action/organizations_saml_idps.py b/ansible_collections/cisco/meraki/plugins/action/organizations_saml_idps.py index e557665b9..196750ebf 100644 --- a/ansible_collections/cisco/meraki/plugins/action/organizations_saml_idps.py +++ b/ansible_collections/cisco/meraki/plugins/action/organizations_saml_idps.py @@ -32,8 +32,8 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present", "absent"]), - x509certSha1Fingerprint=dict(type="str"), sloLogoutUrl=dict(type="str"), + x509certSha1Fingerprint=dict(type="str"), organizationId=dict(type="str"), idpId=dict(type="str"), )) @@ -51,8 +51,8 @@ class OrganizationsSamlIdps(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( - x509certSha1Fingerprint=params.get("x509certSha1Fingerprint"), sloLogoutUrl=params.get("sloLogoutUrl"), + x509certSha1Fingerprint=params.get("x509certSha1Fingerprint"), organizationId=params.get("organizationId"), idpId=params.get("idpId"), ) @@ -76,12 +76,12 @@ class OrganizationsSamlIdps(object): def create_params(self): new_object_params = {} - if self.new_object.get('x509certSha1Fingerprint') is not None or self.new_object.get('x509cert_sha1_fingerprint') is not None: - new_object_params['x509certSha1Fingerprint'] = self.new_object.get('x509certSha1Fingerprint') or \ - self.new_object.get('x509cert_sha1_fingerprint') if self.new_object.get('sloLogoutUrl') is not None or self.new_object.get('slo_logout_url') is not None: new_object_params['sloLogoutUrl'] = self.new_object.get('sloLogoutUrl') or \ self.new_object.get('slo_logout_url') + if self.new_object.get('x509certSha1Fingerprint') is not None or self.new_object.get('x509cert_sha1_fingerprint') is not None: + new_object_params['x509certSha1Fingerprint'] = self.new_object.get('x509certSha1Fingerprint') or \ + self.new_object.get('x509cert_sha1_fingerprint') if self.new_object.get('organizationId') is not None or self.new_object.get('organization_id') is not None: new_object_params['organizationId'] = self.new_object.get('organizationId') or \ self.new_object.get('organization_id') @@ -99,12 +99,12 @@ class OrganizationsSamlIdps(object): def update_by_id_params(self): new_object_params = {} - if self.new_object.get('x509certSha1Fingerprint') is not None or self.new_object.get('x509cert_sha1_fingerprint') is not None: - new_object_params['x509certSha1Fingerprint'] = self.new_object.get('x509certSha1Fingerprint') or \ - self.new_object.get('x509cert_sha1_fingerprint') if self.new_object.get('sloLogoutUrl') is not None or self.new_object.get('slo_logout_url') is not None: new_object_params['sloLogoutUrl'] = self.new_object.get('sloLogoutUrl') or \ self.new_object.get('slo_logout_url') + if self.new_object.get('x509certSha1Fingerprint') is not None or self.new_object.get('x509cert_sha1_fingerprint') is not None: + new_object_params['x509certSha1Fingerprint'] = self.new_object.get('x509certSha1Fingerprint') or \ + self.new_object.get('x509cert_sha1_fingerprint') if self.new_object.get('organizationId') is not None or self.new_object.get('organization_id') is not None: new_object_params['organizationId'] = self.new_object.get('organizationId') or \ self.new_object.get('organization_id') @@ -182,8 +182,8 @@ class OrganizationsSamlIdps(object): requested_obj = self.new_object obj_params = [ - ("x509certSha1Fingerprint", "x509certSha1Fingerprint"), ("sloLogoutUrl", "sloLogoutUrl"), + ("x509certSha1Fingerprint", "x509certSha1Fingerprint"), ("organizationId", "organizationId"), ("idpId", "idpId"), ] diff --git a/ansible_collections/cisco/meraki/plugins/action/organizations_saml_roles.py b/ansible_collections/cisco/meraki/plugins/action/organizations_saml_roles.py index 48dc6dfdb..bfc4a978b 100644 --- a/ansible_collections/cisco/meraki/plugins/action/organizations_saml_roles.py +++ b/ansible_collections/cisco/meraki/plugins/action/organizations_saml_roles.py @@ -32,10 +32,10 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present", "absent"]), - role=dict(type="str"), + networks=dict(type="list"), orgAccess=dict(type="str"), + role=dict(type="str"), tags=dict(type="list"), - networks=dict(type="list"), organizationId=dict(type="str"), samlRoleId=dict(type="str"), )) @@ -53,10 +53,10 @@ class OrganizationsSamlRoles(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( - role=params.get("role"), + networks=params.get("networks"), orgAccess=params.get("orgAccess"), + role=params.get("role"), tags=params.get("tags"), - networks=params.get("networks"), organizationId=params.get("organizationId"), samlRoleId=params.get("samlRoleId"), ) @@ -80,18 +80,18 @@ class OrganizationsSamlRoles(object): def create_params(self): new_object_params = {} - if self.new_object.get('role') is not None or self.new_object.get('role') is not None: - new_object_params['role'] = self.new_object.get('role') or \ - self.new_object.get('role') + if self.new_object.get('networks') is not None or self.new_object.get('networks') is not None: + new_object_params['networks'] = self.new_object.get('networks') or \ + self.new_object.get('networks') if self.new_object.get('orgAccess') is not None or self.new_object.get('org_access') is not None: new_object_params['orgAccess'] = self.new_object.get('orgAccess') or \ self.new_object.get('org_access') + if self.new_object.get('role') is not None or self.new_object.get('role') is not None: + new_object_params['role'] = self.new_object.get('role') or \ + self.new_object.get('role') if self.new_object.get('tags') is not None or self.new_object.get('tags') is not None: new_object_params['tags'] = self.new_object.get('tags') or \ self.new_object.get('tags') - if self.new_object.get('networks') is not None or self.new_object.get('networks') is not None: - new_object_params['networks'] = self.new_object.get('networks') or \ - self.new_object.get('networks') if self.new_object.get('organizationId') is not None or self.new_object.get('organization_id') is not None: new_object_params['organizationId'] = self.new_object.get('organizationId') or \ self.new_object.get('organization_id') @@ -109,18 +109,18 @@ class OrganizationsSamlRoles(object): def update_by_id_params(self): new_object_params = {} - if self.new_object.get('role') is not None or self.new_object.get('role') is not None: - new_object_params['role'] = self.new_object.get('role') or \ - self.new_object.get('role') + if self.new_object.get('networks') is not None or self.new_object.get('networks') is not None: + new_object_params['networks'] = self.new_object.get('networks') or \ + self.new_object.get('networks') if self.new_object.get('orgAccess') is not None or self.new_object.get('org_access') is not None: new_object_params['orgAccess'] = self.new_object.get('orgAccess') or \ self.new_object.get('org_access') + if self.new_object.get('role') is not None or self.new_object.get('role') is not None: + new_object_params['role'] = self.new_object.get('role') or \ + self.new_object.get('role') if self.new_object.get('tags') is not None or self.new_object.get('tags') is not None: new_object_params['tags'] = self.new_object.get('tags') or \ self.new_object.get('tags') - if self.new_object.get('networks') is not None or self.new_object.get('networks') is not None: - new_object_params['networks'] = self.new_object.get('networks') or \ - self.new_object.get('networks') if self.new_object.get('organizationId') is not None or self.new_object.get('organization_id') is not None: new_object_params['organizationId'] = self.new_object.get('organizationId') or \ self.new_object.get('organization_id') @@ -198,10 +198,10 @@ class OrganizationsSamlRoles(object): requested_obj = self.new_object obj_params = [ - ("role", "role"), + ("networks", "networks"), ("orgAccess", "orgAccess"), + ("role", "role"), ("tags", "tags"), - ("networks", "networks"), ("organizationId", "organizationId"), ("samlRoleId", "samlRoleId"), ] diff --git a/ansible_collections/cisco/meraki/plugins/action/organizations_sm_admins_roles.py b/ansible_collections/cisco/meraki/plugins/action/organizations_sm_admins_roles.py new file mode 100644 index 000000000..4bbf8db98 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/action/organizations_sm_admins_roles.py @@ -0,0 +1,256 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or +# https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( + MERAKI, + meraki_argument_spec, + meraki_compare_equality, + get_dict_result, +) +from ansible_collections.cisco.meraki.plugins.plugin_utils.exceptions import ( + InconsistentParameters, +) + +# Get common arguments specification +argument_spec = meraki_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present", "absent"]), + name=dict(type="str"), + scope=dict(type="str"), + tags=dict(type="list"), + organizationId=dict(type="str"), +)) + +required_if = [ + ("state", "present", ["name", "organizationId"], True), + ("state", "absent", ["name", "organizationId"], True), +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class OrganizationsSmAdminsRoles(object): + def __init__(self, params, meraki): + self.meraki = meraki + self.new_object = dict( + name=params.get("name"), + scope=params.get("scope"), + tags=params.get("tags"), + organizationId=params.get("organizationId"), + ) + + def get_all_params(self, name=None, id=None): + new_object_params = {} + if self.new_object.get('perPage') is not None or self.new_object.get('per_page') is not None: + new_object_params['perPage'] = self.new_object.get('perPage') or \ + self.new_object.get('per_page') + new_object_params['total_pages'] = -1 + if self.new_object.get('startingAfter') is not None or self.new_object.get('starting_after') is not None: + new_object_params['startingAfter'] = self.new_object.get('startingAfter') or \ + self.new_object.get('starting_after') + if self.new_object.get('endingBefore') is not None or self.new_object.get('ending_before') is not None: + new_object_params['endingBefore'] = self.new_object.get('endingBefore') or \ + self.new_object.get('ending_before') + if self.new_object.get('organizationId') is not None or self.new_object.get('organization_id') is not None: + new_object_params['organizationId'] = self.new_object.get('organizationId') or \ + self.new_object.get('organization_id') + return new_object_params + + def create_params(self): + new_object_params = {} + if self.new_object.get('name') is not None or self.new_object.get('name') is not None: + new_object_params['name'] = self.new_object.get('name') or \ + self.new_object.get('name') + if self.new_object.get('scope') is not None or self.new_object.get('scope') is not None: + new_object_params['scope'] = self.new_object.get('scope') or \ + self.new_object.get('scope') + if self.new_object.get('tags') is not None or self.new_object.get('tags') is not None: + new_object_params['tags'] = self.new_object.get('tags') or \ + self.new_object.get('tags') + if self.new_object.get('organizationId') is not None or self.new_object.get('organization_id') is not None: + new_object_params['organizationId'] = self.new_object.get('organizationId') or \ + self.new_object.get('organization_id') + return new_object_params + + def get_object_by_name(self, name): + result = None + # NOTE: Does not have a get by name method or it is in another action + try: + items = self.meraki.exec_meraki( + family="sm", + function="getOrganizationSmAdminsRoles", + params=self.get_all_params(name=name), + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'name', name) + if result is None: + result = items + except Exception as e: + print("Error: ", e) + result = None + return result + + def get_object_by_id(self, id): + result = None + # NOTE: Does not have a get by id method or it is in another action + try: + items = self.meraki.exec_meraki( + family="sm", + function="getOrganizationSmAdminsRoles", + params=self.get_all_params(id=id), + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'id', id) + except Exception as e: + print("Error: ", e) + result = None + return result + + def exists(self): + id_exists = False + name_exists = False + prev_obj = None + o_id = self.new_object.get("id") + name = self.new_object.get("name") + if o_id: + prev_obj = self.get_object_by_id(o_id) + id_exists = prev_obj is not None and isinstance(prev_obj, dict) + if not id_exists and name: + prev_obj = self.get_object_by_name(name) + name_exists = prev_obj is not None and isinstance(prev_obj, dict) + if name_exists: + _id = prev_obj.get("id") + if id_exists and name_exists and o_id != _id: + raise InconsistentParameters( + "The 'id' and 'name' params don't refer to the same object") + if _id: + self.new_object.update(dict(id=_id)) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object + + obj_params = [ + ("name", "name"), + ("scope", "scope"), + ("tags", "tags"), + ("organizationId", "organizationId"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (DNAC) params + # If any does not have eq params, it requires update + return any(not meraki_compare_equality(current_obj.get(meraki_param), + requested_obj.get(ansible_param)) + for (meraki_param, ansible_param) in obj_params) + + def create(self): + result = self.meraki.exec_meraki( + family="sm", + function="createOrganizationSmAdminsRole", + params=self.create_params(), + op_modifies=True, + ) + return result + + def update(self): + id = self.new_object.get("id") + name = self.new_object.get("name") + result = None + # NOTE: Does not have update method. What do we do? + return result + + def delete(self): + id = self.new_object.get("id") + name = self.new_object.get("name") + result = None + # NOTE: Does not have delete method. What do we do? + return result + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail( + "ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + meraki = MERAKI(self._task.args) + obj = OrganizationsSmAdminsRoles(self._task.args, meraki) + + state = self._task.args.get("state") + + response = None + + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = obj.update() + meraki.object_updated() + else: + response = prev_obj + meraki.object_already_present() + else: + response = obj.create() + meraki.object_created() + + elif state == "absent": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + response = obj.delete() + meraki.object_deleted() + else: + meraki.object_already_absent() + + self._result.update(dict(meraki_response=response)) + self._result.update(meraki.exit_json()) + return self._result diff --git a/ansible_collections/cisco/meraki/plugins/action/organizations_sm_admins_roles_info.py b/ansible_collections/cisco/meraki/plugins/action/organizations_sm_admins_roles_info.py new file mode 100644 index 000000000..297c64b48 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/action/organizations_sm_admins_roles_info.py @@ -0,0 +1,108 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( + MERAKI, + meraki_argument_spec, +) + +# Get common arguments specification +argument_spec = meraki_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + organizationId=dict(type="str"), + perPage=dict(type="int"), + total_pages=dict(type="int"), + direction=dict(type="str"), + startingAfter=dict(type="str"), + endingBefore=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail( + "ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_all(self, params): + new_object = {} + if params.get("organizationId") is not None: + new_object["organizationId"] = params.get( + "organizationId") + if params.get("perPage") is not None: + new_object["perPage"] = params.get( + "perPage") + new_object['total_pages'] = params.get( + "total_pages") or 1 + new_object['direction'] = params.get( + "direction") or "next" + if params.get("startingAfter") is not None: + new_object["startingAfter"] = params.get( + "startingAfter") + if params.get("endingBefore") is not None: + new_object["endingBefore"] = params.get( + "endingBefore") + + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(meraki_response={})) + + meraki = MERAKI(params=self._task.args) + + response = meraki.exec_meraki( + family="sm", + function='getOrganizationSmAdminsRoles', + params=self.get_all(self._task.args), + ) + self._result.update(dict(meraki_response=response)) + self._result.update(meraki.exit_json()) + return self._result diff --git a/ansible_collections/cisco/meraki/plugins/action/organizations_sm_sentry_policies_assignments.py b/ansible_collections/cisco/meraki/plugins/action/organizations_sm_sentry_policies_assignments.py new file mode 100644 index 000000000..8e51a06e0 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/action/organizations_sm_sentry_policies_assignments.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( + MERAKI, + meraki_argument_spec, +) + +# Get common arguements specification +argument_spec = meraki_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + items=dict(type="list"), + organizationId=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail( + "ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + items=params.get("items"), + organizationId=params.get("organizationId"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + meraki = MERAKI(params=self._task.args) + + response = meraki.exec_meraki( + family="sm", + function='updateOrganizationSmSentryPoliciesAssignments', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(meraki_response=response)) + self._result.update(meraki.exit_json()) + return self._result diff --git a/ansible_collections/cisco/meraki/plugins/action/organizations_sm_sentry_policies_assignments_by_network_info.py b/ansible_collections/cisco/meraki/plugins/action/organizations_sm_sentry_policies_assignments_by_network_info.py new file mode 100644 index 000000000..fdc3bd05d --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/action/organizations_sm_sentry_policies_assignments_by_network_info.py @@ -0,0 +1,112 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( + MERAKI, + meraki_argument_spec, +) + +# Get common arguments specification +argument_spec = meraki_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + organizationId=dict(type="str"), + perPage=dict(type="int"), + total_pages=dict(type="int"), + direction=dict(type="str"), + startingAfter=dict(type="str"), + endingBefore=dict(type="str"), + networkIds=dict(type="list"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail( + "ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_all(self, params): + new_object = {} + if params.get("organizationId") is not None: + new_object["organizationId"] = params.get( + "organizationId") + if params.get("perPage") is not None: + new_object["perPage"] = params.get( + "perPage") + new_object['total_pages'] = params.get( + "total_pages") or 1 + new_object['direction'] = params.get( + "direction") or "next" + if params.get("startingAfter") is not None: + new_object["startingAfter"] = params.get( + "startingAfter") + if params.get("endingBefore") is not None: + new_object["endingBefore"] = params.get( + "endingBefore") + if params.get("networkIds") is not None: + new_object["networkIds"] = params.get( + "networkIds") + + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(meraki_response={})) + + meraki = MERAKI(params=self._task.args) + + response = meraki.exec_meraki( + family="sm", + function='getOrganizationSmSentryPoliciesAssignmentsByNetwork', + params=self.get_all(self._task.args), + ) + self._result.update(dict(meraki_response=response)) + self._result.update(meraki.exit_json()) + return self._result diff --git a/ansible_collections/cisco/meraki/plugins/action/organizations_snmp.py b/ansible_collections/cisco/meraki/plugins/action/organizations_snmp.py index aaf676ee7..4641a02e5 100644 --- a/ansible_collections/cisco/meraki/plugins/action/organizations_snmp.py +++ b/ansible_collections/cisco/meraki/plugins/action/organizations_snmp.py @@ -32,13 +32,13 @@ argument_spec = meraki_argument_spec() # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present"]), + peerIps=dict(type="list"), v2cEnabled=dict(type="bool"), - v3Enabled=dict(type="bool"), v3AuthMode=dict(type="str"), v3AuthPass=dict(type="str"), + v3Enabled=dict(type="bool"), v3PrivMode=dict(type="str"), v3PrivPass=dict(type="str"), - peerIps=dict(type="list"), organizationId=dict(type="str"), )) @@ -54,13 +54,13 @@ class OrganizationsSnmp(object): def __init__(self, params, meraki): self.meraki = meraki self.new_object = dict( + peerIps=params.get("peerIps"), v2cEnabled=params.get("v2cEnabled"), - v3Enabled=params.get("v3Enabled"), v3AuthMode=params.get("v3AuthMode"), v3AuthPass=params.get("v3AuthPass"), + v3Enabled=params.get("v3Enabled"), v3PrivMode=params.get("v3PrivMode"), v3PrivPass=params.get("v3PrivPass"), - peerIps=params.get("peerIps"), organization_id=params.get("organizationId"), ) @@ -73,25 +73,25 @@ class OrganizationsSnmp(object): def update_all_params(self): new_object_params = {} + if self.new_object.get('peerIps') is not None or self.new_object.get('peer_ips') is not None: + new_object_params['peerIps'] = self.new_object.get('peerIps') or \ + self.new_object.get('peer_ips') if self.new_object.get('v2cEnabled') is not None or self.new_object.get('v2c_enabled') is not None: new_object_params['v2cEnabled'] = self.new_object.get('v2cEnabled') - if self.new_object.get('v3Enabled') is not None or self.new_object.get('v3_enabled') is not None: - new_object_params['v3Enabled'] = self.new_object.get('v3Enabled') if self.new_object.get('v3AuthMode') is not None or self.new_object.get('v3_auth_mode') is not None: new_object_params['v3AuthMode'] = self.new_object.get('v3AuthMode') or \ self.new_object.get('v3_auth_mode') if self.new_object.get('v3AuthPass') is not None or self.new_object.get('v3_auth_pass') is not None: new_object_params['v3AuthPass'] = self.new_object.get('v3AuthPass') or \ self.new_object.get('v3_auth_pass') + if self.new_object.get('v3Enabled') is not None or self.new_object.get('v3_enabled') is not None: + new_object_params['v3Enabled'] = self.new_object.get('v3Enabled') if self.new_object.get('v3PrivMode') is not None or self.new_object.get('v3_priv_mode') is not None: new_object_params['v3PrivMode'] = self.new_object.get('v3PrivMode') or \ self.new_object.get('v3_priv_mode') if self.new_object.get('v3PrivPass') is not None or self.new_object.get('v3_priv_pass') is not None: new_object_params['v3PrivPass'] = self.new_object.get('v3PrivPass') or \ self.new_object.get('v3_priv_pass') - if self.new_object.get('peerIps') is not None or self.new_object.get('peer_ips') is not None: - new_object_params['peerIps'] = self.new_object.get('peerIps') or \ - self.new_object.get('peer_ips') if self.new_object.get('organizationId') is not None or self.new_object.get('organization_id') is not None: new_object_params['organizationId'] = self.new_object.get('organizationId') or \ self.new_object.get('organization_id') @@ -148,13 +148,13 @@ class OrganizationsSnmp(object): requested_obj = self.new_object obj_params = [ + ("peerIps", "peerIps"), ("v2cEnabled", "v2cEnabled"), - ("v3Enabled", "v3Enabled"), ("v3AuthMode", "v3AuthMode"), ("v3AuthPass", "v3AuthPass"), + ("v3Enabled", "v3Enabled"), ("v3PrivMode", "v3PrivMode"), ("v3PrivPass", "v3PrivPass"), - ("peerIps", "peerIps"), ("organizationId", "organizationId"), ] # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params diff --git a/ansible_collections/cisco/meraki/plugins/action/organizations_summary_top_networks_by_status_info.py b/ansible_collections/cisco/meraki/plugins/action/organizations_summary_top_networks_by_status_info.py new file mode 100644 index 000000000..c7091e152 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/action/organizations_summary_top_networks_by_status_info.py @@ -0,0 +1,108 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( + MERAKI, + meraki_argument_spec, +) + +# Get common arguments specification +argument_spec = meraki_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + organizationId=dict(type="str"), + perPage=dict(type="int"), + total_pages=dict(type="int"), + direction=dict(type="str"), + startingAfter=dict(type="str"), + endingBefore=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail( + "ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_all(self, params): + new_object = {} + if params.get("organizationId") is not None: + new_object["organizationId"] = params.get( + "organizationId") + if params.get("perPage") is not None: + new_object["perPage"] = params.get( + "perPage") + new_object['total_pages'] = params.get( + "total_pages") or 1 + new_object['direction'] = params.get( + "direction") or "next" + if params.get("startingAfter") is not None: + new_object["startingAfter"] = params.get( + "startingAfter") + if params.get("endingBefore") is not None: + new_object["endingBefore"] = params.get( + "endingBefore") + + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(meraki_response={})) + + meraki = MERAKI(params=self._task.args) + + response = meraki.exec_meraki( + family="organizations", + function='getOrganizationSummaryTopNetworksByStatus', + params=self.get_all(self._task.args), + ) + self._result.update(dict(meraki_response=response)) + self._result.update(meraki.exit_json()) + return self._result diff --git a/ansible_collections/cisco/meraki/plugins/action/organizations_webhooks_callbacks_statuses_info.py b/ansible_collections/cisco/meraki/plugins/action/organizations_webhooks_callbacks_statuses_info.py new file mode 100644 index 000000000..868d02371 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/action/organizations_webhooks_callbacks_statuses_info.py @@ -0,0 +1,102 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( + MERAKI, + meraki_argument_spec, +) + +# Get common arguments specification +argument_spec = meraki_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + organizationId=dict(type="str"), + callbackId=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail( + "ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = {} + if params.get("organizationId") is not None: + new_object["organizationId"] = params.get( + "organizationId") + if params.get("callbackId") is not None: + new_object["callbackId"] = params.get( + "callbackId") + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(meraki_response={})) + + meraki = MERAKI(params=self._task.args) + + id = self._task.args.get("callbackId") + if id: + response = meraki.exec_meraki( + family="organizations", + function='getOrganizationWebhooksCallbacksStatus', + params=self.get_object(self._task.args), + ) + self._result.update(dict(meraki_response=response)) + self._result.update(meraki.exit_json()) + return self._result + if not id: + # NOTE: Does not have a get all method or it is in another action + response = None + meraki.object_modify_result(changed=False, result="Module does not have get all, check arguments of module") + self._result.update(dict(meraki_response=response)) + self._result.update(meraki.exit_json()) + return self._result diff --git a/ansible_collections/cisco/meraki/plugins/action/organizations_wireless_devices_channel_utilization_by_device_info.py b/ansible_collections/cisco/meraki/plugins/action/organizations_wireless_devices_channel_utilization_by_device_info.py new file mode 100644 index 000000000..5d78f5a98 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/action/organizations_wireless_devices_channel_utilization_by_device_info.py @@ -0,0 +1,132 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( + MERAKI, + meraki_argument_spec, +) + +# Get common arguments specification +argument_spec = meraki_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + organizationId=dict(type="str"), + networkIds=dict(type="list"), + serials=dict(type="list"), + perPage=dict(type="int"), + total_pages=dict(type="int"), + direction=dict(type="str"), + startingAfter=dict(type="str"), + endingBefore=dict(type="str"), + t0=dict(type="str"), + t1=dict(type="str"), + timespan=dict(type="float"), + interval=dict(type="int"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail( + "ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_all(self, params): + new_object = {} + if params.get("organizationId") is not None: + new_object["organizationId"] = params.get( + "organizationId") + if params.get("networkIds") is not None: + new_object["networkIds"] = params.get( + "networkIds") + if params.get("serials") is not None: + new_object["serials"] = params.get( + "serials") + if params.get("perPage") is not None: + new_object["perPage"] = params.get( + "perPage") + new_object['total_pages'] = params.get( + "total_pages") or 1 + new_object['direction'] = params.get( + "direction") or "next" + if params.get("startingAfter") is not None: + new_object["startingAfter"] = params.get( + "startingAfter") + if params.get("endingBefore") is not None: + new_object["endingBefore"] = params.get( + "endingBefore") + if params.get("t0") is not None: + new_object["t0"] = params.get( + "t0") + if params.get("t1") is not None: + new_object["t1"] = params.get( + "t1") + if params.get("timespan") is not None: + new_object["timespan"] = params.get( + "timespan") + if params.get("interval") is not None: + new_object["interval"] = params.get( + "interval") + + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(meraki_response={})) + + meraki = MERAKI(params=self._task.args) + + response = meraki.exec_meraki( + family="wireless", + function='getOrganizationWirelessDevicesChannelUtilizationByDevice', + params=self.get_all(self._task.args), + ) + self._result.update(dict(meraki_response=response)) + self._result.update(meraki.exit_json()) + return self._result diff --git a/ansible_collections/cisco/meraki/plugins/action/organizations_wireless_devices_channel_utilization_by_network_info.py b/ansible_collections/cisco/meraki/plugins/action/organizations_wireless_devices_channel_utilization_by_network_info.py new file mode 100644 index 000000000..fb57fd52f --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/action/organizations_wireless_devices_channel_utilization_by_network_info.py @@ -0,0 +1,132 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( + MERAKI, + meraki_argument_spec, +) + +# Get common arguments specification +argument_spec = meraki_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + organizationId=dict(type="str"), + networkIds=dict(type="list"), + serials=dict(type="list"), + perPage=dict(type="int"), + total_pages=dict(type="int"), + direction=dict(type="str"), + startingAfter=dict(type="str"), + endingBefore=dict(type="str"), + t0=dict(type="str"), + t1=dict(type="str"), + timespan=dict(type="float"), + interval=dict(type="int"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail( + "ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_all(self, params): + new_object = {} + if params.get("organizationId") is not None: + new_object["organizationId"] = params.get( + "organizationId") + if params.get("networkIds") is not None: + new_object["networkIds"] = params.get( + "networkIds") + if params.get("serials") is not None: + new_object["serials"] = params.get( + "serials") + if params.get("perPage") is not None: + new_object["perPage"] = params.get( + "perPage") + new_object['total_pages'] = params.get( + "total_pages") or 1 + new_object['direction'] = params.get( + "direction") or "next" + if params.get("startingAfter") is not None: + new_object["startingAfter"] = params.get( + "startingAfter") + if params.get("endingBefore") is not None: + new_object["endingBefore"] = params.get( + "endingBefore") + if params.get("t0") is not None: + new_object["t0"] = params.get( + "t0") + if params.get("t1") is not None: + new_object["t1"] = params.get( + "t1") + if params.get("timespan") is not None: + new_object["timespan"] = params.get( + "timespan") + if params.get("interval") is not None: + new_object["interval"] = params.get( + "interval") + + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(meraki_response={})) + + meraki = MERAKI(params=self._task.args) + + response = meraki.exec_meraki( + family="wireless", + function='getOrganizationWirelessDevicesChannelUtilizationByNetwork', + params=self.get_all(self._task.args), + ) + self._result.update(dict(meraki_response=response)) + self._result.update(meraki.exit_json()) + return self._result diff --git a/ansible_collections/cisco/meraki/plugins/action/organizations_wireless_devices_channel_utilization_history_by_device_by_interval_info.py b/ansible_collections/cisco/meraki/plugins/action/organizations_wireless_devices_channel_utilization_history_by_device_by_interval_info.py new file mode 100644 index 000000000..9bd73d0b2 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/action/organizations_wireless_devices_channel_utilization_history_by_device_by_interval_info.py @@ -0,0 +1,132 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( + MERAKI, + meraki_argument_spec, +) + +# Get common arguments specification +argument_spec = meraki_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + organizationId=dict(type="str"), + networkIds=dict(type="list"), + serials=dict(type="list"), + perPage=dict(type="int"), + total_pages=dict(type="int"), + direction=dict(type="str"), + startingAfter=dict(type="str"), + endingBefore=dict(type="str"), + t0=dict(type="str"), + t1=dict(type="str"), + timespan=dict(type="float"), + interval=dict(type="int"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail( + "ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_all(self, params): + new_object = {} + if params.get("organizationId") is not None: + new_object["organizationId"] = params.get( + "organizationId") + if params.get("networkIds") is not None: + new_object["networkIds"] = params.get( + "networkIds") + if params.get("serials") is not None: + new_object["serials"] = params.get( + "serials") + if params.get("perPage") is not None: + new_object["perPage"] = params.get( + "perPage") + new_object['total_pages'] = params.get( + "total_pages") or 1 + new_object['direction'] = params.get( + "direction") or "next" + if params.get("startingAfter") is not None: + new_object["startingAfter"] = params.get( + "startingAfter") + if params.get("endingBefore") is not None: + new_object["endingBefore"] = params.get( + "endingBefore") + if params.get("t0") is not None: + new_object["t0"] = params.get( + "t0") + if params.get("t1") is not None: + new_object["t1"] = params.get( + "t1") + if params.get("timespan") is not None: + new_object["timespan"] = params.get( + "timespan") + if params.get("interval") is not None: + new_object["interval"] = params.get( + "interval") + + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(meraki_response={})) + + meraki = MERAKI(params=self._task.args) + + response = meraki.exec_meraki( + family="wireless", + function='getOrganizationWirelessDevicesChannelUtilizationHistoryByDeviceByInterval', + params=self.get_all(self._task.args), + ) + self._result.update(dict(meraki_response=response)) + self._result.update(meraki.exit_json()) + return self._result diff --git a/ansible_collections/cisco/meraki/plugins/action/organizations_wireless_devices_channel_utilization_history_by_network_by_interval_info.py b/ansible_collections/cisco/meraki/plugins/action/organizations_wireless_devices_channel_utilization_history_by_network_by_interval_info.py new file mode 100644 index 000000000..872cc59be --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/action/organizations_wireless_devices_channel_utilization_history_by_network_by_interval_info.py @@ -0,0 +1,132 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( + MERAKI, + meraki_argument_spec, +) + +# Get common arguments specification +argument_spec = meraki_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + organizationId=dict(type="str"), + networkIds=dict(type="list"), + serials=dict(type="list"), + perPage=dict(type="int"), + total_pages=dict(type="int"), + direction=dict(type="str"), + startingAfter=dict(type="str"), + endingBefore=dict(type="str"), + t0=dict(type="str"), + t1=dict(type="str"), + timespan=dict(type="float"), + interval=dict(type="int"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail( + "ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_all(self, params): + new_object = {} + if params.get("organizationId") is not None: + new_object["organizationId"] = params.get( + "organizationId") + if params.get("networkIds") is not None: + new_object["networkIds"] = params.get( + "networkIds") + if params.get("serials") is not None: + new_object["serials"] = params.get( + "serials") + if params.get("perPage") is not None: + new_object["perPage"] = params.get( + "perPage") + new_object['total_pages'] = params.get( + "total_pages") or 1 + new_object['direction'] = params.get( + "direction") or "next" + if params.get("startingAfter") is not None: + new_object["startingAfter"] = params.get( + "startingAfter") + if params.get("endingBefore") is not None: + new_object["endingBefore"] = params.get( + "endingBefore") + if params.get("t0") is not None: + new_object["t0"] = params.get( + "t0") + if params.get("t1") is not None: + new_object["t1"] = params.get( + "t1") + if params.get("timespan") is not None: + new_object["timespan"] = params.get( + "timespan") + if params.get("interval") is not None: + new_object["interval"] = params.get( + "interval") + + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(meraki_response={})) + + meraki = MERAKI(params=self._task.args) + + response = meraki.exec_meraki( + family="wireless", + function='getOrganizationWirelessDevicesChannelUtilizationHistoryByNetworkByInterval', + params=self.get_all(self._task.args), + ) + self._result.update(dict(meraki_response=response)) + self._result.update(meraki.exit_json()) + return self._result diff --git a/ansible_collections/cisco/meraki/plugins/action/organizations_wireless_devices_packet_loss_by_client_info.py b/ansible_collections/cisco/meraki/plugins/action/organizations_wireless_devices_packet_loss_by_client_info.py new file mode 100644 index 000000000..772ffac1a --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/action/organizations_wireless_devices_packet_loss_by_client_info.py @@ -0,0 +1,136 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( + MERAKI, + meraki_argument_spec, +) + +# Get common arguments specification +argument_spec = meraki_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + organizationId=dict(type="str"), + networkIds=dict(type="list"), + ssids=dict(type="list"), + bands=dict(type="list"), + macs=dict(type="list"), + perPage=dict(type="int"), + total_pages=dict(type="int"), + direction=dict(type="str"), + startingAfter=dict(type="str"), + endingBefore=dict(type="str"), + t0=dict(type="str"), + t1=dict(type="str"), + timespan=dict(type="float"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail( + "ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_all(self, params): + new_object = {} + if params.get("organizationId") is not None: + new_object["organizationId"] = params.get( + "organizationId") + if params.get("networkIds") is not None: + new_object["networkIds"] = params.get( + "networkIds") + if params.get("ssids") is not None: + new_object["ssids"] = params.get( + "ssids") + if params.get("bands") is not None: + new_object["bands"] = params.get( + "bands") + if params.get("macs") is not None: + new_object["macs"] = params.get( + "macs") + if params.get("perPage") is not None: + new_object["perPage"] = params.get( + "perPage") + new_object['total_pages'] = params.get( + "total_pages") or 1 + new_object['direction'] = params.get( + "direction") or "next" + if params.get("startingAfter") is not None: + new_object["startingAfter"] = params.get( + "startingAfter") + if params.get("endingBefore") is not None: + new_object["endingBefore"] = params.get( + "endingBefore") + if params.get("t0") is not None: + new_object["t0"] = params.get( + "t0") + if params.get("t1") is not None: + new_object["t1"] = params.get( + "t1") + if params.get("timespan") is not None: + new_object["timespan"] = params.get( + "timespan") + + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(meraki_response={})) + + meraki = MERAKI(params=self._task.args) + + response = meraki.exec_meraki( + family="wireless", + function='getOrganizationWirelessDevicesPacketLossByClient', + params=self.get_all(self._task.args), + ) + self._result.update(dict(meraki_response=response)) + self._result.update(meraki.exit_json()) + return self._result diff --git a/ansible_collections/cisco/meraki/plugins/action/organizations_wireless_devices_packet_loss_by_device_info.py b/ansible_collections/cisco/meraki/plugins/action/organizations_wireless_devices_packet_loss_by_device_info.py new file mode 100644 index 000000000..beef87f14 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/action/organizations_wireless_devices_packet_loss_by_device_info.py @@ -0,0 +1,136 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( + MERAKI, + meraki_argument_spec, +) + +# Get common arguments specification +argument_spec = meraki_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + organizationId=dict(type="str"), + networkIds=dict(type="list"), + serials=dict(type="list"), + ssids=dict(type="list"), + bands=dict(type="list"), + perPage=dict(type="int"), + total_pages=dict(type="int"), + direction=dict(type="str"), + startingAfter=dict(type="str"), + endingBefore=dict(type="str"), + t0=dict(type="str"), + t1=dict(type="str"), + timespan=dict(type="float"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail( + "ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_all(self, params): + new_object = {} + if params.get("organizationId") is not None: + new_object["organizationId"] = params.get( + "organizationId") + if params.get("networkIds") is not None: + new_object["networkIds"] = params.get( + "networkIds") + if params.get("serials") is not None: + new_object["serials"] = params.get( + "serials") + if params.get("ssids") is not None: + new_object["ssids"] = params.get( + "ssids") + if params.get("bands") is not None: + new_object["bands"] = params.get( + "bands") + if params.get("perPage") is not None: + new_object["perPage"] = params.get( + "perPage") + new_object['total_pages'] = params.get( + "total_pages") or 1 + new_object['direction'] = params.get( + "direction") or "next" + if params.get("startingAfter") is not None: + new_object["startingAfter"] = params.get( + "startingAfter") + if params.get("endingBefore") is not None: + new_object["endingBefore"] = params.get( + "endingBefore") + if params.get("t0") is not None: + new_object["t0"] = params.get( + "t0") + if params.get("t1") is not None: + new_object["t1"] = params.get( + "t1") + if params.get("timespan") is not None: + new_object["timespan"] = params.get( + "timespan") + + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(meraki_response={})) + + meraki = MERAKI(params=self._task.args) + + response = meraki.exec_meraki( + family="wireless", + function='getOrganizationWirelessDevicesPacketLossByDevice', + params=self.get_all(self._task.args), + ) + self._result.update(dict(meraki_response=response)) + self._result.update(meraki.exit_json()) + return self._result diff --git a/ansible_collections/cisco/meraki/plugins/action/organizations_wireless_devices_packet_loss_by_network_info.py b/ansible_collections/cisco/meraki/plugins/action/organizations_wireless_devices_packet_loss_by_network_info.py new file mode 100644 index 000000000..b871a3539 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/action/organizations_wireless_devices_packet_loss_by_network_info.py @@ -0,0 +1,136 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.meraki.plugins.plugin_utils.meraki import ( + MERAKI, + meraki_argument_spec, +) + +# Get common arguments specification +argument_spec = meraki_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + organizationId=dict(type="str"), + networkIds=dict(type="list"), + serials=dict(type="list"), + ssids=dict(type="list"), + bands=dict(type="list"), + perPage=dict(type="int"), + total_pages=dict(type="int"), + direction=dict(type="str"), + startingAfter=dict(type="str"), + endingBefore=dict(type="str"), + t0=dict(type="str"), + t1=dict(type="str"), + timespan=dict(type="float"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail( + "ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_all(self, params): + new_object = {} + if params.get("organizationId") is not None: + new_object["organizationId"] = params.get( + "organizationId") + if params.get("networkIds") is not None: + new_object["networkIds"] = params.get( + "networkIds") + if params.get("serials") is not None: + new_object["serials"] = params.get( + "serials") + if params.get("ssids") is not None: + new_object["ssids"] = params.get( + "ssids") + if params.get("bands") is not None: + new_object["bands"] = params.get( + "bands") + if params.get("perPage") is not None: + new_object["perPage"] = params.get( + "perPage") + new_object['total_pages'] = params.get( + "total_pages") or 1 + new_object['direction'] = params.get( + "direction") or "next" + if params.get("startingAfter") is not None: + new_object["startingAfter"] = params.get( + "startingAfter") + if params.get("endingBefore") is not None: + new_object["endingBefore"] = params.get( + "endingBefore") + if params.get("t0") is not None: + new_object["t0"] = params.get( + "t0") + if params.get("t1") is not None: + new_object["t1"] = params.get( + "t1") + if params.get("timespan") is not None: + new_object["timespan"] = params.get( + "timespan") + + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(meraki_response={})) + + meraki = MERAKI(params=self._task.args) + + response = meraki.exec_meraki( + family="wireless", + function='getOrganizationWirelessDevicesPacketLossByNetwork', + params=self.get_all(self._task.args), + ) + self._result.update(dict(meraki_response=response)) + self._result.update(meraki.exit_json()) + return self._result diff --git a/ansible_collections/cisco/meraki/plugins/modules/administered_identities_me_info.py b/ansible_collections/cisco/meraki/plugins/modules/administered_identities_me_info.py index 05a8f14d8..7f833e0d8 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/administered_identities_me_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/administered_identities_me_info.py @@ -67,22 +67,22 @@ meraki_response: type: dict sample: > { - "name": "string", - "email": "string", - "lastUsedDashboardAt": "string", "authentication": { - "mode": "string", "api": { "key": { "created": true } }, - "twoFactor": { + "mode": "string", + "saml": { "enabled": true }, - "saml": { + "twoFactor": { "enabled": true } - } + }, + "email": "string", + "lastUsedDashboardAt": "string", + "name": "string" } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/administered_licensing_subscription_entitlements_info.py b/ansible_collections/cisco/meraki/plugins/modules/administered_licensing_subscription_entitlements_info.py new file mode 100644 index 000000000..64b91eae9 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/modules/administered_licensing_subscription_entitlements_info.py @@ -0,0 +1,83 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: administered_licensing_subscription_entitlements_info +short_description: Information module for administered _licensing _subscription _entitlements +description: +- Get all administered _licensing _subscription _entitlements. +- Retrieve the list of purchasable entitlements. +version_added: '2.18.0' +extends_documentation_fragment: + - cisco.meraki.module_info +author: Francisco Munoz (@fmunoz) +options: + headers: + description: Additional headers. + type: dict + skus: + description: + - Skus query parameter. Filter to entitlements with the specified SKUs. + elements: str + type: list +requirements: +- meraki >= 2.4.9 +- python >= 3.5 +seealso: +- name: Cisco Meraki documentation for licensing getAdministeredLicensingSubscriptionEntitlements + description: Complete reference of the getAdministeredLicensingSubscriptionEntitlements API. + link: https://developer.cisco.com/meraki/api-v1/#!get-administered-licensing-subscription-entitlements +notes: + - SDK Method used are + licensing.Licensing.get_administered_licensing_subscription_entitlements, + + - Paths used are + get /administered/licensing/subscription/entitlements, +""" + +EXAMPLES = r""" +- name: Get all administered _licensing _subscription _entitlements + cisco.meraki.administered_licensing_subscription_entitlements_info: + meraki_api_key: "{{meraki_api_key}}" + meraki_base_url: "{{meraki_base_url}}" + meraki_single_request_timeout: "{{meraki_single_request_timeout}}" + meraki_certificate_path: "{{meraki_certificate_path}}" + meraki_requests_proxy: "{{meraki_requests_proxy}}" + meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" + meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" + meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" + meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" + meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" + meraki_maximum_retries: "{{meraki_maximum_retries}}" + meraki_output_log: "{{meraki_output_log}}" + meraki_log_file_prefix: "{{meraki_log_file_prefix}}" + meraki_log_path: "{{meraki_log_path}}" + meraki_print_console: "{{meraki_print_console}}" + meraki_suppress_logging: "{{meraki_suppress_logging}}" + meraki_simulate: "{{meraki_simulate}}" + meraki_be_geo_id: "{{meraki_be_geo_id}}" + meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" + meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" + skus: [] + register: result + +""" +RETURN = r""" +meraki_response: + description: A dictionary or list with the response returned by the Cisco Meraki Python SDK + returned: always + type: dict + sample: > + { + "featureTier": "string", + "isAddOn": true, + "name": "string", + "productClass": "string", + "productType": "string", + "sku": "string" + } +""" diff --git a/ansible_collections/cisco/meraki/plugins/modules/administered_licensing_subscription_subscriptions_bind.py b/ansible_collections/cisco/meraki/plugins/modules/administered_licensing_subscription_subscriptions_bind.py new file mode 100644 index 000000000..7ab09dfcf --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/modules/administered_licensing_subscription_subscriptions_bind.py @@ -0,0 +1,95 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: administered_licensing_subscription_subscriptions_bind +short_description: Resource module for administered _licensing _subscription _subscriptions _bind +description: +- Manage operation create of the resource administered _licensing _subscription _subscriptions _bind. +- Bind networks to a subscription. +version_added: '2.18.0' +extends_documentation_fragment: + - cisco.meraki.module +author: Francisco Munoz (@fmunoz) +options: + networkIds: + description: List of network ids to bind to the subscription. + elements: str + type: list + subscriptionId: + description: SubscriptionId path parameter. Subscription ID. + type: str +requirements: +- meraki >= 2.4.9 +- python >= 3.5 +seealso: +- name: Cisco Meraki documentation for licensing bindAdministeredLicensingSubscriptionSubscription + description: Complete reference of the bindAdministeredLicensingSubscriptionSubscription API. + link: https://developer.cisco.com/meraki/api-v1/#!bind-administered-licensing-subscription-subscription +notes: + - SDK Method used are + licensing.Licensing.bind_administered_licensing_subscription_subscription, + + - Paths used are + post /administered/licensing/subscription/subscriptions/{subscriptionId}/bind, +""" + +EXAMPLES = r""" +- name: Create + cisco.meraki.administered_licensing_subscription_subscriptions_bind: + meraki_api_key: "{{meraki_api_key}}" + meraki_base_url: "{{meraki_base_url}}" + meraki_single_request_timeout: "{{meraki_single_request_timeout}}" + meraki_certificate_path: "{{meraki_certificate_path}}" + meraki_requests_proxy: "{{meraki_requests_proxy}}" + meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" + meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" + meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" + meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" + meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" + meraki_maximum_retries: "{{meraki_maximum_retries}}" + meraki_output_log: "{{meraki_output_log}}" + meraki_log_file_prefix: "{{meraki_log_file_prefix}}" + meraki_log_path: "{{meraki_log_path}}" + meraki_print_console: "{{meraki_print_console}}" + meraki_suppress_logging: "{{meraki_suppress_logging}}" + meraki_simulate: "{{meraki_simulate}}" + meraki_be_geo_id: "{{meraki_be_geo_id}}" + meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" + meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" + networkIds: + - L_1234 + - N_5678 + subscriptionId: string + validate: true + +""" +RETURN = r""" +meraki_response: + description: A dictionary or list with the response returned by the Cisco Meraki Python SDK + returned: always + type: dict + sample: > + { + "errors": [ + "string" + ], + "insufficientEntitlements": [ + { + "quantity": 0, + "sku": "string" + } + ], + "networks": [ + { + "id": "string", + "name": "string" + } + ], + "subscriptionId": "string" + } +""" diff --git a/ansible_collections/cisco/meraki/plugins/modules/administered_licensing_subscription_subscriptions_claim.py b/ansible_collections/cisco/meraki/plugins/modules/administered_licensing_subscription_subscriptions_claim.py new file mode 100644 index 000000000..9049fb0f2 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/modules/administered_licensing_subscription_subscriptions_claim.py @@ -0,0 +1,112 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: administered_licensing_subscription_subscriptions_claim +short_description: Resource module for administered _licensing _subscription _subscriptions _claim +description: +- Manage operation create of the resource administered _licensing _subscription _subscriptions _claim. +- Claim a subscription into an organization. +version_added: '2.18.0' +extends_documentation_fragment: + - cisco.meraki.module +author: Francisco Munoz (@fmunoz) +options: + claimKey: + description: The subscription's claim key. + type: str + description: + description: Extra details or notes about the subscription. + type: str + name: + description: Friendly name to identify the subscription. + type: str + organizationId: + description: The id of the organization claiming the subscription. + type: str +requirements: +- meraki >= 2.4.9 +- python >= 3.5 +seealso: +- name: Cisco Meraki documentation for licensing claimAdministeredLicensingSubscriptionSubscriptions + description: Complete reference of the claimAdministeredLicensingSubscriptionSubscriptions API. + link: https://developer.cisco.com/meraki/api-v1/#!claim-administered-licensing-subscription-subscriptions +notes: + - SDK Method used are + licensing.Licensing.claim_administered_licensing_subscription_subscriptions, + + - Paths used are + post /administered/licensing/subscription/subscriptions/claim, +""" + +EXAMPLES = r""" +- name: Create + cisco.meraki.administered_licensing_subscription_subscriptions_claim: + meraki_api_key: "{{meraki_api_key}}" + meraki_base_url: "{{meraki_base_url}}" + meraki_single_request_timeout: "{{meraki_single_request_timeout}}" + meraki_certificate_path: "{{meraki_certificate_path}}" + meraki_requests_proxy: "{{meraki_requests_proxy}}" + meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" + meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" + meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" + meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" + meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" + meraki_maximum_retries: "{{meraki_maximum_retries}}" + meraki_output_log: "{{meraki_output_log}}" + meraki_log_file_prefix: "{{meraki_log_file_prefix}}" + meraki_log_path: "{{meraki_log_path}}" + meraki_print_console: "{{meraki_print_console}}" + meraki_suppress_logging: "{{meraki_suppress_logging}}" + meraki_simulate: "{{meraki_simulate}}" + meraki_be_geo_id: "{{meraki_be_geo_id}}" + meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" + meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" + claimKey: S2345-6789A-BCDEF-GHJKM + description: Subscription for all main offices + name: Corporate subscription + organizationId: '12345678910' + validate: true + +""" +RETURN = r""" +meraki_response: + description: A dictionary or list with the response returned by the Cisco Meraki Python SDK + returned: always + type: dict + sample: > + { + "counts": { + "networks": 0, + "seats": { + "assigned": 0, + "available": 0, + "limit": 0 + } + }, + "description": "string", + "endDate": "string", + "entitlements": [ + { + "seats": { + "assigned": 0, + "available": 0, + "limit": 0 + }, + "sku": "string" + } + ], + "name": "string", + "productTypes": [ + "string" + ], + "startDate": "string", + "status": "string", + "subscriptionId": "string", + "webOrderId": "string" + } +""" diff --git a/ansible_collections/cisco/meraki/plugins/modules/administered_licensing_subscription_subscriptions_claim_key_validate.py b/ansible_collections/cisco/meraki/plugins/modules/administered_licensing_subscription_subscriptions_claim_key_validate.py new file mode 100644 index 000000000..578a9603c --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/modules/administered_licensing_subscription_subscriptions_claim_key_validate.py @@ -0,0 +1,99 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: administered_licensing_subscription_subscriptions_claim_key_validate +short_description: Resource module for administered _licensing _subscription _subscriptions _claimkey _validate +description: +- Manage operation create of the resource administered _licensing _subscription _subscriptions _claimkey _validate. +- Find a subscription by claim key. Returns 400 if the key has already been claimed. +version_added: '2.18.0' +extends_documentation_fragment: + - cisco.meraki.module +author: Francisco Munoz (@fmunoz) +options: + claimKey: + description: The subscription's claim key. + type: str +requirements: +- meraki >= 2.4.9 +- python >= 3.5 +seealso: +- name: Cisco Meraki documentation for licensing validateAdministeredLicensingSubscriptionSubscriptionsClaimKey + description: Complete reference of the validateAdministeredLicensingSubscriptionSubscriptionsClaimKey API. + link: https://developer.cisco.com/meraki/api-v1/#!validate-administered-licensing-subscription-subscriptions-claim-key +notes: + - SDK Method used are + licensing.Licensing.validate_administered_licensing_subscription_subscriptions_claim_key, + + - Paths used are + post /administered/licensing/subscription/subscriptions/claimKey/validate, +""" + +EXAMPLES = r""" +- name: Create + cisco.meraki.administered_licensing_subscription_subscriptions_claim_key_validate: + meraki_api_key: "{{meraki_api_key}}" + meraki_base_url: "{{meraki_base_url}}" + meraki_single_request_timeout: "{{meraki_single_request_timeout}}" + meraki_certificate_path: "{{meraki_certificate_path}}" + meraki_requests_proxy: "{{meraki_requests_proxy}}" + meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" + meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" + meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" + meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" + meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" + meraki_maximum_retries: "{{meraki_maximum_retries}}" + meraki_output_log: "{{meraki_output_log}}" + meraki_log_file_prefix: "{{meraki_log_file_prefix}}" + meraki_log_path: "{{meraki_log_path}}" + meraki_print_console: "{{meraki_print_console}}" + meraki_suppress_logging: "{{meraki_suppress_logging}}" + meraki_simulate: "{{meraki_simulate}}" + meraki_be_geo_id: "{{meraki_be_geo_id}}" + meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" + meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" + claimKey: S2345-6789A-BCDEF-GHJKM + +""" +RETURN = r""" +meraki_response: + description: A dictionary or list with the response returned by the Cisco Meraki Python SDK + returned: always + type: dict + sample: > + { + "counts": { + "networks": 0, + "seats": { + "assigned": 0, + "available": 0, + "limit": 0 + } + }, + "description": "string", + "endDate": "string", + "entitlements": [ + { + "seats": { + "assigned": 0, + "available": 0, + "limit": 0 + }, + "sku": "string" + } + ], + "name": "string", + "productTypes": [ + "string" + ], + "startDate": "string", + "status": "string", + "subscriptionId": "string", + "webOrderId": "string" + } +""" diff --git a/ansible_collections/cisco/meraki/plugins/modules/administered_licensing_subscription_subscriptions_compliance_statuses_info.py b/ansible_collections/cisco/meraki/plugins/modules/administered_licensing_subscription_subscriptions_compliance_statuses_info.py new file mode 100644 index 000000000..08c0dfca8 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/modules/administered_licensing_subscription_subscriptions_compliance_statuses_info.py @@ -0,0 +1,107 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: administered_licensing_subscription_subscriptions_compliance_statuses_info +short_description: Information module for administered _licensing _subscription _subscriptions _compliance _statuses +description: +- Get all administered _licensing _subscription _subscriptions _compliance _statuses. +- Get compliance status for requested subscriptions. +version_added: '2.18.0' +extends_documentation_fragment: + - cisco.meraki.module_info +author: Francisco Munoz (@fmunoz) +options: + headers: + description: Additional headers. + type: dict + organizationIds: + description: + - OrganizationIds query parameter. Organizations to get subscription compliance information for. + elements: str + type: list + subscriptionIds: + description: + - SubscriptionIds query parameter. Subscription ids. + elements: str + type: list +requirements: +- meraki >= 2.4.9 +- python >= 3.5 +seealso: +- name: Cisco Meraki documentation for licensing getAdministeredLicensingSubscriptionSubscriptionsComplianceStatuses + description: Complete reference of the getAdministeredLicensingSubscriptionSubscriptionsComplianceStatuses API. + link: https://developer.cisco.com/meraki/api-v1/#!get-administered-licensing-subscription-subscriptions-compliance-statuses +notes: + - SDK Method used are + licensing.Licensing.get_administered_licensing_subscription_subscriptions_compliance_statuses, + + - Paths used are + get /administered/licensing/subscription/subscriptions/compliance/statuses, +""" + +EXAMPLES = r""" +- name: Get all administered _licensing _subscription _subscriptions _compliance _statuses + cisco.meraki.administered_licensing_subscription_subscriptions_compliance_statuses_info: + meraki_api_key: "{{meraki_api_key}}" + meraki_base_url: "{{meraki_base_url}}" + meraki_single_request_timeout: "{{meraki_single_request_timeout}}" + meraki_certificate_path: "{{meraki_certificate_path}}" + meraki_requests_proxy: "{{meraki_requests_proxy}}" + meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" + meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" + meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" + meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" + meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" + meraki_maximum_retries: "{{meraki_maximum_retries}}" + meraki_output_log: "{{meraki_output_log}}" + meraki_log_file_prefix: "{{meraki_log_file_prefix}}" + meraki_log_path: "{{meraki_log_path}}" + meraki_print_console: "{{meraki_print_console}}" + meraki_suppress_logging: "{{meraki_suppress_logging}}" + meraki_simulate: "{{meraki_simulate}}" + meraki_be_geo_id: "{{meraki_be_geo_id}}" + meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" + meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" + organizationIds: [] + subscriptionIds: [] + register: result + +""" +RETURN = r""" +meraki_response: + description: A dictionary or list with the response returned by the Cisco Meraki Python SDK + returned: always + type: list + elements: dict + sample: > + [ + { + "subscription": { + "id": "string", + "name": "string", + "status": "string" + }, + "violations": { + "byProductClass": [ + { + "gracePeriodEndsAt": "string", + "missing": { + "entitlements": [ + { + "quantity": 0, + "sku": "string" + } + ] + }, + "productClass": "string" + } + ] + } + } + ] +""" diff --git a/ansible_collections/cisco/meraki/plugins/modules/administered_licensing_subscription_subscriptions_info.py b/ansible_collections/cisco/meraki/plugins/modules/administered_licensing_subscription_subscriptions_info.py new file mode 100644 index 000000000..f60343cd7 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/modules/administered_licensing_subscription_subscriptions_info.py @@ -0,0 +1,164 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: administered_licensing_subscription_subscriptions_info +short_description: Information module for administered _licensing _subscription _subscriptions +description: +- Get all administered _licensing _subscription _subscriptions. +- List available subscriptions. +version_added: '2.18.0' +extends_documentation_fragment: + - cisco.meraki.module_info + - cisco.meraki.module_info_pagination +author: Francisco Munoz (@fmunoz) +options: + headers: + description: Additional headers. + type: dict + perPage: + description: + - PerPage query parameter. The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. + type: int + startingAfter: + description: + - > + StartingAfter query parameter. A token used by the server to indicate the start of the page. Often this is a + timestamp or an ID but it is not limited to those. This parameter should not be defined by client + applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + type: str + endingBefore: + description: + - > + EndingBefore query parameter. A token used by the server to indicate the end of the page. Often this is a + timestamp or an ID but it is not limited to those. This parameter should not be defined by client + applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + type: str + subscriptionIds: + description: + - SubscriptionIds query parameter. List of subscription ids to fetch. + elements: str + type: list + organizationIds: + description: + - OrganizationIds query parameter. Organizations to get associated subscriptions for. + elements: str + type: list + statuses: + description: + - Statuses query parameter. List of statuses that returned subscriptions can have. + elements: str + type: list + productTypes: + description: + - ProductTypes query parameter. List of product types that returned subscriptions need to have entitlements for. + elements: str + type: list + startDate: + description: + - > + StartDate query parameter. Filter subscriptions by start date, ISO 8601 format. To filter with a range of + dates, use 'startDate<option>=?' in the request. Accepted options include lt, gt, lte, gte. + type: str + endDate: + description: + - > + EndDate query parameter. Filter subscriptions by end date, ISO 8601 format. To filter with a range of dates, + use 'endDate<option>=?' in the request. Accepted options include lt, gt, lte, gte. + type: str +requirements: +- meraki >= 2.4.9 +- python >= 3.5 +seealso: +- name: Cisco Meraki documentation for licensing getAdministeredLicensingSubscriptionSubscriptions + description: Complete reference of the getAdministeredLicensingSubscriptionSubscriptions API. + link: https://developer.cisco.com/meraki/api-v1/#!get-administered-licensing-subscription-subscriptions +notes: + - SDK Method used are + licensing.Licensing.get_administered_licensing_subscription_subscriptions, + + - Paths used are + get /administered/licensing/subscription/subscriptions, +""" + +EXAMPLES = r""" +- name: Get all administered _licensing _subscription _subscriptions + cisco.meraki.administered_licensing_subscription_subscriptions_info: + meraki_api_key: "{{meraki_api_key}}" + meraki_base_url: "{{meraki_base_url}}" + meraki_single_request_timeout: "{{meraki_single_request_timeout}}" + meraki_certificate_path: "{{meraki_certificate_path}}" + meraki_requests_proxy: "{{meraki_requests_proxy}}" + meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" + meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" + meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" + meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" + meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" + meraki_maximum_retries: "{{meraki_maximum_retries}}" + meraki_output_log: "{{meraki_output_log}}" + meraki_log_file_prefix: "{{meraki_log_file_prefix}}" + meraki_log_path: "{{meraki_log_path}}" + meraki_print_console: "{{meraki_print_console}}" + meraki_suppress_logging: "{{meraki_suppress_logging}}" + meraki_simulate: "{{meraki_simulate}}" + meraki_be_geo_id: "{{meraki_be_geo_id}}" + meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" + meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" + perPage: 0 + startingAfter: string + endingBefore: string + subscriptionIds: [] + organizationIds: [] + statuses: [] + productTypes: [] + startDate: string + endDate: string + total_pages: -1 + direction: next + register: result + +""" +RETURN = r""" +meraki_response: + description: A dictionary or list with the response returned by the Cisco Meraki Python SDK + returned: always + type: list + elements: dict + sample: > + [ + { + "counts": { + "networks": 0, + "seats": { + "assigned": 0, + "available": 0, + "limit": 0 + } + }, + "description": "string", + "endDate": "string", + "entitlements": [ + { + "seats": { + "assigned": 0, + "available": 0, + "limit": 0 + }, + "sku": "string" + } + ], + "name": "string", + "productTypes": [ + "string" + ], + "startDate": "string", + "status": "string", + "subscriptionId": "string", + "webOrderId": "string" + } + ] +""" diff --git a/ansible_collections/cisco/meraki/plugins/modules/devices.py b/ansible_collections/cisco/meraki/plugins/modules/devices.py index 095ec27d8..2e17ef2ce 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/devices.py +++ b/ansible_collections/cisco/meraki/plugins/modules/devices.py @@ -29,9 +29,6 @@ options: lng: description: The longitude of a device. type: float - mac: - description: Mac. - type: str moveMapMarker: description: Whether or not to set the latitude and longitude of a device based on the new address. Only applies when lat and lng are not specified. diff --git a/ansible_collections/cisco/meraki/plugins/modules/devices_appliance_performance_info.py b/ansible_collections/cisco/meraki/plugins/modules/devices_appliance_performance_info.py index 5bdc0d6b0..1b0ef7ac6 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/devices_appliance_performance_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/devices_appliance_performance_info.py @@ -72,6 +72,8 @@ meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always type: dict - sample: - - {} + sample: > + { + "perfScore": 0 + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/devices_appliance_radio_settings.py b/ansible_collections/cisco/meraki/plugins/modules/devices_appliance_radio_settings.py new file mode 100644 index 000000000..ec5439141 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/modules/devices_appliance_radio_settings.py @@ -0,0 +1,128 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: devices_appliance_radio_settings +short_description: Resource module for devices _appliance _radio _settings +description: +- Manage operation update of the resource devices _appliance _radio _settings. +- Update the radio settings of an appliance. +version_added: '2.18.0' +extends_documentation_fragment: + - cisco.meraki.module +author: Francisco Munoz (@fmunoz) +options: + fiveGhzSettings: + description: Manual radio settings for 5 GHz. + suboptions: + channel: + description: Sets a manual channel for 5 GHz. Can be '36', '40', '44', '48', + '52', '56', '60', '64', '100', '104', '108', '112', '116', '120', '124', '128', + '132', '136', '140', '144', '149', '153', '157', '161', '165', '169', '173' + or '177' or null for using auto channel. + type: int + channelWidth: + description: Sets a manual channel width for 5 GHz. Can be '0', '20', '40', + '80' or '160' or null for using auto channel width. + type: int + targetPower: + description: Set a manual target power for 5 GHz. Can be between '8' or '30' + or null for using auto power range. + type: int + type: dict + rfProfileId: + description: The ID of an RF profile to assign to the device. If the value of this + parameter is null, the appropriate basic RF profile (indoor or outdoor) will be + assigned to the device. Assigning an RF profile will clear ALL manually configured + overrides on the device (channel width, channel, power). + type: str + serial: + description: Serial path parameter. + type: str + twoFourGhzSettings: + description: Manual radio settings for 2.4 GHz. + suboptions: + channel: + description: Sets a manual channel for 2.4 GHz. Can be '1', '2', '3', '4', '5', + '6', '7', '8', '9', '10', '11', '12', '13' or '14' or null for using auto + channel. + type: int + targetPower: + description: Set a manual target power for 2.4 GHz. Can be between '5' or '30' + or null for using auto power range. + type: int + type: dict +requirements: +- meraki >= 2.4.9 +- python >= 3.5 +seealso: +- name: Cisco Meraki documentation for appliance updateDeviceApplianceRadioSettings + description: Complete reference of the updateDeviceApplianceRadioSettings API. + link: https://developer.cisco.com/meraki/api-v1/#!update-device-appliance-radio-settings +notes: + - SDK Method used are + appliance.Appliance.update_device_appliance_radio_settings, + + - Paths used are + put /devices/{serial}/appliance/radio/settings, +""" + +EXAMPLES = r""" +- name: Update all + cisco.meraki.devices_appliance_radio_settings: + meraki_api_key: "{{meraki_api_key}}" + meraki_base_url: "{{meraki_base_url}}" + meraki_single_request_timeout: "{{meraki_single_request_timeout}}" + meraki_certificate_path: "{{meraki_certificate_path}}" + meraki_requests_proxy: "{{meraki_requests_proxy}}" + meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" + meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" + meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" + meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" + meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" + meraki_maximum_retries: "{{meraki_maximum_retries}}" + meraki_output_log: "{{meraki_output_log}}" + meraki_log_file_prefix: "{{meraki_log_file_prefix}}" + meraki_log_path: "{{meraki_log_path}}" + meraki_print_console: "{{meraki_print_console}}" + meraki_suppress_logging: "{{meraki_suppress_logging}}" + meraki_simulate: "{{meraki_simulate}}" + meraki_be_geo_id: "{{meraki_be_geo_id}}" + meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" + meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" + state: present + fiveGhzSettings: + channel: 149 + channelWidth: 20 + targetPower: 15 + rfProfileId: '1234' + serial: string + twoFourGhzSettings: + channel: 11 + targetPower: 21 + +""" +RETURN = r""" +meraki_response: + description: A dictionary or list with the response returned by the Cisco Meraki Python SDK + returned: always + type: dict + sample: > + { + "fiveGhzSettings": { + "channel": 0, + "channelWidth": 0, + "targetPower": 0 + }, + "rfProfileId": "string", + "serial": "string", + "twoFourGhzSettings": { + "channel": 0, + "targetPower": 0 + } + } +""" diff --git a/ansible_collections/cisco/meraki/plugins/modules/devices_appliance_radio_settings_info.py b/ansible_collections/cisco/meraki/plugins/modules/devices_appliance_radio_settings_info.py new file mode 100644 index 000000000..c2461ffed --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/modules/devices_appliance_radio_settings_info.py @@ -0,0 +1,87 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: devices_appliance_radio_settings_info +short_description: Information module for devices _appliance _radio _settings +description: +- Get all devices _appliance _radio _settings. +- Return the radio settings of an appliance. +version_added: '2.18.0' +extends_documentation_fragment: + - cisco.meraki.module_info +author: Francisco Munoz (@fmunoz) +options: + headers: + description: Additional headers. + type: dict + serial: + description: + - Serial path parameter. + type: str +requirements: +- meraki >= 2.4.9 +- python >= 3.5 +seealso: +- name: Cisco Meraki documentation for appliance getDeviceApplianceRadioSettings + description: Complete reference of the getDeviceApplianceRadioSettings API. + link: https://developer.cisco.com/meraki/api-v1/#!get-device-appliance-radio-settings +notes: + - SDK Method used are + appliance.Appliance.get_device_appliance_radio_settings, + + - Paths used are + get /devices/{serial}/appliance/radio/settings, +""" + +EXAMPLES = r""" +- name: Get all devices _appliance _radio _settings + cisco.meraki.devices_appliance_radio_settings_info: + meraki_api_key: "{{meraki_api_key}}" + meraki_base_url: "{{meraki_base_url}}" + meraki_single_request_timeout: "{{meraki_single_request_timeout}}" + meraki_certificate_path: "{{meraki_certificate_path}}" + meraki_requests_proxy: "{{meraki_requests_proxy}}" + meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" + meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" + meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" + meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" + meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" + meraki_maximum_retries: "{{meraki_maximum_retries}}" + meraki_output_log: "{{meraki_output_log}}" + meraki_log_file_prefix: "{{meraki_log_file_prefix}}" + meraki_log_path: "{{meraki_log_path}}" + meraki_print_console: "{{meraki_print_console}}" + meraki_suppress_logging: "{{meraki_suppress_logging}}" + meraki_simulate: "{{meraki_simulate}}" + meraki_be_geo_id: "{{meraki_be_geo_id}}" + meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" + meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" + serial: string + register: result + +""" +RETURN = r""" +meraki_response: + description: A dictionary or list with the response returned by the Cisco Meraki Python SDK + returned: always + type: dict + sample: > + { + "fiveGhzSettings": { + "channel": 0, + "channelWidth": 0, + "targetPower": 0 + }, + "rfProfileId": "string", + "serial": "string", + "twoFourGhzSettings": { + "channel": 0, + "targetPower": 0 + } + } +""" diff --git a/ansible_collections/cisco/meraki/plugins/modules/devices_appliance_uplinks_settings.py b/ansible_collections/cisco/meraki/plugins/modules/devices_appliance_uplinks_settings.py index 0b325882b..1b24e9dfb 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/devices_appliance_uplinks_settings.py +++ b/ansible_collections/cisco/meraki/plugins/modules/devices_appliance_uplinks_settings.py @@ -309,14 +309,17 @@ meraki_response: { "wan1": { "enabled": true, - "vlanTagging": { - "enabled": true, - "vlanId": 0 + "pppoe": { + "authentication": { + "enabled": true, + "username": "string" + }, + "enabled": true }, "svis": { "ipv4": { - "assignmentMode": "string", "address": "string", + "assignmentMode": "string", "gateway": "string", "nameservers": { "addresses": [ @@ -325,8 +328,8 @@ meraki_response: } }, "ipv6": { - "assignmentMode": "string", "address": "string", + "assignmentMode": "string", "gateway": "string", "nameservers": { "addresses": [ @@ -335,24 +338,24 @@ meraki_response: } } }, - "pppoe": { + "vlanTagging": { "enabled": true, - "authentication": { - "enabled": true, - "username": "string" - } + "vlanId": 0 } }, "wan2": { "enabled": true, - "vlanTagging": { - "enabled": true, - "vlanId": 0 + "pppoe": { + "authentication": { + "enabled": true, + "username": "string" + }, + "enabled": true }, "svis": { "ipv4": { - "assignmentMode": "string", "address": "string", + "assignmentMode": "string", "gateway": "string", "nameservers": { "addresses": [ @@ -361,8 +364,8 @@ meraki_response: } }, "ipv6": { - "assignmentMode": "string", "address": "string", + "assignmentMode": "string", "gateway": "string", "nameservers": { "addresses": [ @@ -371,12 +374,9 @@ meraki_response: } } }, - "pppoe": { + "vlanTagging": { "enabled": true, - "authentication": { - "enabled": true, - "username": "string" - } + "vlanId": 0 } } } diff --git a/ansible_collections/cisco/meraki/plugins/modules/devices_appliance_uplinks_settings_info.py b/ansible_collections/cisco/meraki/plugins/modules/devices_appliance_uplinks_settings_info.py index 57b2d8c2a..84ae86bfe 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/devices_appliance_uplinks_settings_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/devices_appliance_uplinks_settings_info.py @@ -74,14 +74,17 @@ meraki_response: { "wan1": { "enabled": true, - "vlanTagging": { - "enabled": true, - "vlanId": 0 + "pppoe": { + "authentication": { + "enabled": true, + "username": "string" + }, + "enabled": true }, "svis": { "ipv4": { - "assignmentMode": "string", "address": "string", + "assignmentMode": "string", "gateway": "string", "nameservers": { "addresses": [ @@ -90,8 +93,8 @@ meraki_response: } }, "ipv6": { - "assignmentMode": "string", "address": "string", + "assignmentMode": "string", "gateway": "string", "nameservers": { "addresses": [ @@ -100,24 +103,24 @@ meraki_response: } } }, - "pppoe": { + "vlanTagging": { "enabled": true, - "authentication": { - "enabled": true, - "username": "string" - } + "vlanId": 0 } }, "wan2": { "enabled": true, - "vlanTagging": { - "enabled": true, - "vlanId": 0 + "pppoe": { + "authentication": { + "enabled": true, + "username": "string" + }, + "enabled": true }, "svis": { "ipv4": { - "assignmentMode": "string", "address": "string", + "assignmentMode": "string", "gateway": "string", "nameservers": { "addresses": [ @@ -126,8 +129,8 @@ meraki_response: } }, "ipv6": { - "assignmentMode": "string", "address": "string", + "assignmentMode": "string", "gateway": "string", "nameservers": { "addresses": [ @@ -136,12 +139,9 @@ meraki_response: } } }, - "pppoe": { + "vlanTagging": { "enabled": true, - "authentication": { - "enabled": true, - "username": "string" - } + "vlanId": 0 } } } diff --git a/ansible_collections/cisco/meraki/plugins/modules/devices_appliance_vmx_authentication_token.py b/ansible_collections/cisco/meraki/plugins/modules/devices_appliance_vmx_authentication_token.py index 6b5f400af..80cfba930 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/devices_appliance_vmx_authentication_token.py +++ b/ansible_collections/cisco/meraki/plugins/modules/devices_appliance_vmx_authentication_token.py @@ -67,7 +67,7 @@ meraki_response: type: dict sample: > { - "token": "string", - "expiresAt": "string" + "expiresAt": "string", + "token": "string" } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/devices_blink_leds.py b/ansible_collections/cisco/meraki/plugins/modules/devices_blink_leds.py index e79e87a8e..bca7f62e5 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/devices_blink_leds.py +++ b/ansible_collections/cisco/meraki/plugins/modules/devices_blink_leds.py @@ -80,5 +80,9 @@ meraki_response: returned: always type: dict sample: > - {} + { + "duration": 0, + "duty": 0, + "period": 0 + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/devices_camera_analytics_live_info.py b/ansible_collections/cisco/meraki/plugins/modules/devices_camera_analytics_live_info.py index 33f83d4bd..55638a526 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/devices_camera_analytics_live_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/devices_camera_analytics_live_info.py @@ -70,6 +70,13 @@ meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always type: dict - sample: - - {} + sample: > + { + "ts": "string", + "zones": { + "0": { + "person": 0 + } + } + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/devices_camera_custom_analytics.py b/ansible_collections/cisco/meraki/plugins/modules/devices_camera_custom_analytics.py index e68f3ee98..40263f5cf 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/devices_camera_custom_analytics.py +++ b/ansible_collections/cisco/meraki/plugins/modules/devices_camera_custom_analytics.py @@ -40,12 +40,12 @@ requirements: - meraki >= 2.4.9 - python >= 3.5 seealso: -- name: Cisco Meraki documentation for devices updateDeviceCameraCustomAnalytics +- name: Cisco Meraki documentation for camera updateDeviceCameraCustomAnalytics description: Complete reference of the updateDeviceCameraCustomAnalytics API. link: https://developer.cisco.com/meraki/api-v1/#!update-device-camera-custom-analytics notes: - SDK Method used are - devices.Devices.update_device_camera_custom_analytics, + camera.Camera.update_device_camera_custom_analytics, - Paths used are put /devices/{serial}/camera/customAnalytics, @@ -89,5 +89,14 @@ meraki_response: returned: always type: dict sample: > - {} + { + "artifactId": "string", + "enabled": true, + "parameters": [ + { + "name": "string", + "value": 0 + } + ] + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/devices_camera_custom_analytics_info.py b/ansible_collections/cisco/meraki/plugins/modules/devices_camera_custom_analytics_info.py index 8a08930bc..235270b65 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/devices_camera_custom_analytics_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/devices_camera_custom_analytics_info.py @@ -27,12 +27,12 @@ requirements: - meraki >= 2.4.9 - python >= 3.5 seealso: -- name: Cisco Meraki documentation for devices getDeviceCameraCustomAnalytics +- name: Cisco Meraki documentation for camera getDeviceCameraCustomAnalytics description: Complete reference of the getDeviceCameraCustomAnalytics API. link: https://developer.cisco.com/meraki/api-v1/#!get-device-camera-custom-analytics notes: - SDK Method used are - devices.Devices.get_device_camera_custom_analytics, + camera.Camera.get_device_camera_custom_analytics, - Paths used are get /devices/{serial}/camera/customAnalytics, @@ -70,6 +70,15 @@ meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always type: dict - sample: - - {} + sample: > + { + "artifactId": "string", + "enabled": true, + "parameters": [ + { + "name": "string", + "value": 0 + } + ] + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/devices_camera_generate_snapshot.py b/ansible_collections/cisco/meraki/plugins/modules/devices_camera_generate_snapshot.py index 026e44fa8..a849306e5 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/devices_camera_generate_snapshot.py +++ b/ansible_collections/cisco/meraki/plugins/modules/devices_camera_generate_snapshot.py @@ -32,12 +32,12 @@ requirements: - meraki >= 2.4.9 - python >= 3.5 seealso: -- name: Cisco Meraki documentation for devices generateDeviceCameraSnapshot +- name: Cisco Meraki documentation for camera generateDeviceCameraSnapshot description: Complete reference of the generateDeviceCameraSnapshot API. link: https://developer.cisco.com/meraki/api-v1/#!generate-device-camera-snapshot notes: - SDK Method used are - devices.Devices.generate_device_camera_snapshot, + camera.Camera.generate_device_camera_snapshot, - Paths used are post /devices/{serial}/camera/generateSnapshot, diff --git a/ansible_collections/cisco/meraki/plugins/modules/devices_camera_quality_and_retention.py b/ansible_collections/cisco/meraki/plugins/modules/devices_camera_quality_and_retention.py index ab0e474ec..355aee8b7 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/devices_camera_quality_and_retention.py +++ b/ansible_collections/cisco/meraki/plugins/modules/devices_camera_quality_and_retention.py @@ -40,8 +40,8 @@ options: type: str resolution: description: Resolution of the camera. Can be one of '1280x720', '1920x1080', '1080x1080', - '2058x2058', '2112x2112', '2880x2880', '2688x1512' or '3840x2160'.Not all resolutions - are supported by every camera model. + '2112x2112', '2880x2880', '2688x1512' or '3840x2160'.Not all resolutions are supported + by every camera model. type: str restrictedBandwidthModeEnabled: description: Boolean indicating if restricted bandwidth is enabled(true) or disabled(false) @@ -54,12 +54,12 @@ requirements: - meraki >= 2.4.9 - python >= 3.5 seealso: -- name: Cisco Meraki documentation for devices updateDeviceCameraQualityAndRetention +- name: Cisco Meraki documentation for camera updateDeviceCameraQualityAndRetention description: Complete reference of the updateDeviceCameraQualityAndRetention API. link: https://developer.cisco.com/meraki/api-v1/#!update-device-camera-quality-and-retention notes: - SDK Method used are - devices.Devices.update_device_camera_quality_and_retention, + camera.Camera.update_device_camera_quality_and_retention, - Paths used are put /devices/{serial}/camera/qualityAndRetention, diff --git a/ansible_collections/cisco/meraki/plugins/modules/devices_camera_quality_and_retention_info.py b/ansible_collections/cisco/meraki/plugins/modules/devices_camera_quality_and_retention_info.py index 4c24df969..0a24bc07d 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/devices_camera_quality_and_retention_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/devices_camera_quality_and_retention_info.py @@ -27,12 +27,12 @@ requirements: - meraki >= 2.4.9 - python >= 3.5 seealso: -- name: Cisco Meraki documentation for devices getDeviceCameraQualityAndRetention +- name: Cisco Meraki documentation for camera getDeviceCameraQualityAndRetention description: Complete reference of the getDeviceCameraQualityAndRetention API. link: https://developer.cisco.com/meraki/api-v1/#!get-device-camera-quality-and-retention notes: - SDK Method used are - devices.Devices.get_device_camera_quality_and_retention, + camera.Camera.get_device_camera_quality_and_retention, - Paths used are get /devices/{serial}/camera/qualityAndRetention, @@ -70,6 +70,14 @@ meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always type: dict - sample: - - {} + sample: > + { + "audioRecordingEnabled": true, + "motionBasedRetentionEnabled": true, + "motionDetectorVersion": 0, + "profileId": "string", + "quality": "string", + "resolution": "string", + "restrictedBandwidthModeEnabled": true + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/devices_camera_sense.py b/ansible_collections/cisco/meraki/plugins/modules/devices_camera_sense.py index fba029c46..cb65eb3c4 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/devices_camera_sense.py +++ b/ansible_collections/cisco/meraki/plugins/modules/devices_camera_sense.py @@ -42,12 +42,12 @@ requirements: - meraki >= 2.4.9 - python >= 3.5 seealso: -- name: Cisco Meraki documentation for devices updateDeviceCameraSense +- name: Cisco Meraki documentation for camera updateDeviceCameraSense description: Complete reference of the updateDeviceCameraSense API. link: https://developer.cisco.com/meraki/api-v1/#!update-device-camera-sense notes: - SDK Method used are - devices.Devices.update_device_camera_sense, + camera.Camera.update_device_camera_sense, - Paths used are put /devices/{serial}/camera/sense, diff --git a/ansible_collections/cisco/meraki/plugins/modules/devices_camera_sense_info.py b/ansible_collections/cisco/meraki/plugins/modules/devices_camera_sense_info.py index 2dee743aa..319939da0 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/devices_camera_sense_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/devices_camera_sense_info.py @@ -27,12 +27,12 @@ requirements: - meraki >= 2.4.9 - python >= 3.5 seealso: -- name: Cisco Meraki documentation for devices getDeviceCameraSense +- name: Cisco Meraki documentation for camera getDeviceCameraSense description: Complete reference of the getDeviceCameraSense API. link: https://developer.cisco.com/meraki/api-v1/#!get-device-camera-sense notes: - SDK Method used are - devices.Devices.get_device_camera_sense, + camera.Camera.get_device_camera_sense, - Paths used are get /devices/{serial}/camera/sense, @@ -70,6 +70,15 @@ meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always type: dict - sample: - - {} + sample: > + { + "audioDetection": { + "enabled": true + }, + "mqttBrokerId": "string", + "mqttTopics": [ + "string" + ], + "senseEnabled": true + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/devices_camera_video_link_info.py b/ansible_collections/cisco/meraki/plugins/modules/devices_camera_video_link_info.py index a872336bc..2f409ed6a 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/devices_camera_video_link_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/devices_camera_video_link_info.py @@ -77,6 +77,9 @@ meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always type: dict - sample: - - {} + sample: > + { + "url": "string", + "visionUrl": "string" + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/devices_camera_video_settings.py b/ansible_collections/cisco/meraki/plugins/modules/devices_camera_video_settings.py index 27803c8dd..24a5896f3 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/devices_camera_video_settings.py +++ b/ansible_collections/cisco/meraki/plugins/modules/devices_camera_video_settings.py @@ -26,12 +26,12 @@ requirements: - meraki >= 2.4.9 - python >= 3.5 seealso: -- name: Cisco Meraki documentation for devices updateDeviceCameraVideoSettings +- name: Cisco Meraki documentation for camera updateDeviceCameraVideoSettings description: Complete reference of the updateDeviceCameraVideoSettings API. link: https://developer.cisco.com/meraki/api-v1/#!update-device-camera-video-settings notes: - SDK Method used are - devices.Devices.update_device_camera_video_settings, + camera.Camera.update_device_camera_video_settings, - Paths used are put /devices/{serial}/camera/video/settings, @@ -71,5 +71,8 @@ meraki_response: returned: always type: dict sample: > - {} + { + "externalRtspEnabled": true, + "rtspUrl": "string" + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/devices_camera_video_settings_info.py b/ansible_collections/cisco/meraki/plugins/modules/devices_camera_video_settings_info.py index 1a6deb42e..0610c46fe 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/devices_camera_video_settings_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/devices_camera_video_settings_info.py @@ -27,12 +27,12 @@ requirements: - meraki >= 2.4.9 - python >= 3.5 seealso: -- name: Cisco Meraki documentation for devices getDeviceCameraVideoSettings +- name: Cisco Meraki documentation for camera getDeviceCameraVideoSettings description: Complete reference of the getDeviceCameraVideoSettings API. link: https://developer.cisco.com/meraki/api-v1/#!get-device-camera-video-settings notes: - SDK Method used are - devices.Devices.get_device_camera_video_settings, + camera.Camera.get_device_camera_video_settings, - Paths used are get /devices/{serial}/camera/video/settings, @@ -70,6 +70,9 @@ meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always type: dict - sample: - - {} + sample: > + { + "externalRtspEnabled": true, + "rtspUrl": "string" + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/devices_camera_wireless_profiles.py b/ansible_collections/cisco/meraki/plugins/modules/devices_camera_wireless_profiles.py index 2453b6679..b7d480719 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/devices_camera_wireless_profiles.py +++ b/ansible_collections/cisco/meraki/plugins/modules/devices_camera_wireless_profiles.py @@ -38,12 +38,12 @@ requirements: - meraki >= 2.4.9 - python >= 3.5 seealso: -- name: Cisco Meraki documentation for devices updateDeviceCameraWirelessProfiles +- name: Cisco Meraki documentation for camera updateDeviceCameraWirelessProfiles description: Complete reference of the updateDeviceCameraWirelessProfiles API. link: https://developer.cisco.com/meraki/api-v1/#!update-device-camera-wireless-profiles notes: - SDK Method used are - devices.Devices.update_device_camera_wireless_profiles, + camera.Camera.update_device_camera_wireless_profiles, - Paths used are put /devices/{serial}/camera/wirelessProfiles, diff --git a/ansible_collections/cisco/meraki/plugins/modules/devices_camera_wireless_profiles_info.py b/ansible_collections/cisco/meraki/plugins/modules/devices_camera_wireless_profiles_info.py index f9939d5a4..e766acd51 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/devices_camera_wireless_profiles_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/devices_camera_wireless_profiles_info.py @@ -27,12 +27,12 @@ requirements: - meraki >= 2.4.9 - python >= 3.5 seealso: -- name: Cisco Meraki documentation for devices getDeviceCameraWirelessProfiles +- name: Cisco Meraki documentation for camera getDeviceCameraWirelessProfiles description: Complete reference of the getDeviceCameraWirelessProfiles API. link: https://developer.cisco.com/meraki/api-v1/#!get-device-camera-wireless-profiles notes: - SDK Method used are - devices.Devices.get_device_camera_wireless_profiles, + camera.Camera.get_device_camera_wireless_profiles, - Paths used are get /devices/{serial}/camera/wirelessProfiles, @@ -70,6 +70,10 @@ meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always type: dict - sample: - - {} + sample: > + { + "backup": "string", + "primary": "string", + "secondary": "string" + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/devices_cellular_gateway_lan.py b/ansible_collections/cisco/meraki/plugins/modules/devices_cellular_gateway_lan.py index 8c930e9e7..d5bd881e8 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/devices_cellular_gateway_lan.py +++ b/ansible_collections/cisco/meraki/plugins/modules/devices_cellular_gateway_lan.py @@ -52,12 +52,12 @@ requirements: - meraki >= 2.4.9 - python >= 3.5 seealso: -- name: Cisco Meraki documentation for devices updateDeviceCellularGatewayLan +- name: Cisco Meraki documentation for cellularGateway updateDeviceCellularGatewayLan description: Complete reference of the updateDeviceCellularGatewayLan API. link: https://developer.cisco.com/meraki/api-v1/#!update-device-cellular-gateway-lan notes: - SDK Method used are - devices.Devices.update_device_cellular_gateway_lan, + cellular_gateway.CellularGateway.update_device_cellular_gateway_lan, - Paths used are put /devices/{serial}/cellularGateway/lan, @@ -87,16 +87,10 @@ EXAMPLES = r""" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" state: present - deviceLanIp: 192.168.0.33 - deviceName: name of the MG - deviceSubnet: 192.168.0.32/27 fixedIpAssignments: - ip: 192.168.0.10 mac: 0b:00:00:00:00:ac name: server 1 - - ip: 192.168.0.20 - mac: 0b:00:00:00:00:ab - name: server 2 reservedIpRanges: - comment: A reserved IP range end: 192.168.1.1 @@ -110,5 +104,23 @@ meraki_response: returned: always type: dict sample: > - {} + { + "deviceLanIp": "string", + "deviceName": "string", + "deviceSubnet": "string", + "fixedIpAssignments": [ + { + "ip": "string", + "mac": "string", + "name": "string" + } + ], + "reservedIpRanges": [ + { + "comment": "string", + "end": "string", + "start": "string" + } + ] + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/devices_cellular_gateway_lan_info.py b/ansible_collections/cisco/meraki/plugins/modules/devices_cellular_gateway_lan_info.py index b16d76670..e5cf15868 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/devices_cellular_gateway_lan_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/devices_cellular_gateway_lan_info.py @@ -27,12 +27,12 @@ requirements: - meraki >= 2.4.9 - python >= 3.5 seealso: -- name: Cisco Meraki documentation for devices getDeviceCellularGatewayLan +- name: Cisco Meraki documentation for cellularGateway getDeviceCellularGatewayLan description: Complete reference of the getDeviceCellularGatewayLan API. link: https://developer.cisco.com/meraki/api-v1/#!get-device-cellular-gateway-lan notes: - SDK Method used are - devices.Devices.get_device_cellular_gateway_lan, + cellular_gateway.CellularGateway.get_device_cellular_gateway_lan, - Paths used are get /devices/{serial}/cellularGateway/lan, @@ -70,6 +70,24 @@ meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always type: dict - sample: - - {} + sample: > + { + "deviceLanIp": "string", + "deviceName": "string", + "deviceSubnet": "string", + "fixedIpAssignments": [ + { + "ip": "string", + "mac": "string", + "name": "string" + } + ], + "reservedIpRanges": [ + { + "comment": "string", + "end": "string", + "start": "string" + } + ] + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/devices_cellular_gateway_port_forwarding_rules_info.py b/ansible_collections/cisco/meraki/plugins/modules/devices_cellular_gateway_port_forwarding_rules_info.py index 6e8e713d2..76ffa1bb8 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/devices_cellular_gateway_port_forwarding_rules_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/devices_cellular_gateway_port_forwarding_rules_info.py @@ -27,12 +27,12 @@ requirements: - meraki >= 2.4.9 - python >= 3.5 seealso: -- name: Cisco Meraki documentation for devices getDeviceCellularGatewayPortForwardingRules +- name: Cisco Meraki documentation for cellularGateway getDeviceCellularGatewayPortForwardingRules description: Complete reference of the getDeviceCellularGatewayPortForwardingRules API. link: https://developer.cisco.com/meraki/api-v1/#!get-device-cellular-gateway-port-forwarding-rules notes: - SDK Method used are - devices.Devices.get_device_cellular_gateway_port_forwarding_rules, + cellular_gateway.CellularGateway.get_device_cellular_gateway_port_forwarding_rules, - Paths used are get /devices/{serial}/cellularGateway/portForwardingRules, @@ -69,7 +69,18 @@ RETURN = r""" meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always - type: dict - sample: - - {} + type: list + elements: dict + sample: > + [ + { + "access": "string", + "lanIp": "string", + "localPort": "string", + "name": "string", + "protocol": "string", + "publicPort": "string", + "uplink": "string" + } + ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/devices_cellular_sims.py b/ansible_collections/cisco/meraki/plugins/modules/devices_cellular_sims.py index a0c66c0d2..03a26c3f2 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/devices_cellular_sims.py +++ b/ansible_collections/cisco/meraki/plugins/modules/devices_cellular_sims.py @@ -25,6 +25,9 @@ options: enabled: description: Failover to secondary SIM (optional). type: bool + timeout: + description: Failover timeout in seconds (optional). + type: int type: dict sims: description: List of SIMs. If a SIM was previously configured and not specified diff --git a/ansible_collections/cisco/meraki/plugins/modules/devices_cellular_sims_info.py b/ansible_collections/cisco/meraki/plugins/modules/devices_cellular_sims_info.py index 5ae2eab96..3022b8e6f 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/devices_cellular_sims_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/devices_cellular_sims_info.py @@ -69,7 +69,25 @@ RETURN = r""" meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always - type: dict - sample: - - {} + type: list + elements: dict + sample: > + [ + { + "apns": [ + { + "allowedIpTypes": [ + "string" + ], + "authentication": { + "type": "string", + "username": "string" + }, + "name": "string" + } + ], + "isPrimary": true, + "slot": "string" + } + ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/devices_info.py b/ansible_collections/cisco/meraki/plugins/modules/devices_info.py index f230e826f..89fc1f92e 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/devices_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/devices_info.py @@ -226,26 +226,30 @@ RETURN = r""" meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always - type: list - elements: dict + type: dict sample: > - [ - { - "name": "string", - "lat": 0, - "lng": 0, - "address": "string", - "notes": "string", - "tags": [ - "string" - ], - "networkId": "string", - "serial": "string", - "model": "string", - "mac": "string", - "lanIp": "string", - "firmware": "string", - "productType": "string" - } - ] + { + "address": "string", + "details": [ + { + "name": "string", + "value": "string" + } + ], + "firmware": "string", + "imei": "string", + "lanIp": "string", + "lat": 0, + "lng": 0, + "mac": "string", + "model": "string", + "name": "string", + "networkId": "string", + "notes": "string", + "productType": "string", + "serial": "string", + "tags": [ + "string" + ] + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/devices_live_tools_arp_table.py b/ansible_collections/cisco/meraki/plugins/modules/devices_live_tools_arp_table.py new file mode 100644 index 000000000..2719794c8 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/modules/devices_live_tools_arp_table.py @@ -0,0 +1,120 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: devices_live_tools_arp_table +short_description: Resource module for devices _livetools _arptable +description: +- Manage operation create of the resource devices _livetools _arptable. +- Enqueue a job to perform a ARP table request for the device. This endpoint currently supports switches. +version_added: '2.18.0' +extends_documentation_fragment: + - cisco.meraki.module +author: Francisco Munoz (@fmunoz) +options: + callback: + description: Details for the callback. Please include either an httpServerId OR + url and sharedSecret. + suboptions: + httpServer: + description: The webhook receiver used for the callback webhook. + suboptions: + id: + description: The webhook receiver ID that will receive information. If specifying + this, please leave the url and sharedSecret fields blank. + type: str + type: dict + payloadTemplate: + description: The payload template of the webhook used for the callback. + suboptions: + id: + description: The ID of the payload template. Defaults to 'wpt_00005' for + the Callback (included) template. + type: str + type: dict + sharedSecret: + description: A shared secret that will be included in the requests sent to the + callback URL. It can be used to verify that the request was sent by Meraki. + If using this field, please also specify an url. + type: str + url: + description: The callback URL for the webhook target. If using this field, please + also specify a sharedSecret. + type: str + type: dict + serial: + description: Serial path parameter. + type: str +requirements: +- meraki >= 2.4.9 +- python >= 3.5 +seealso: +- name: Cisco Meraki documentation for devices createDeviceLiveToolsArpTable + description: Complete reference of the createDeviceLiveToolsArpTable API. + link: https://developer.cisco.com/meraki/api-v1/#!create-device-live-tools-arp-table +notes: + - SDK Method used are + devices.Devices.create_device_live_tools_arp_table, + + - Paths used are + post /devices/{serial}/liveTools/arpTable, +""" + +EXAMPLES = r""" +- name: Create + cisco.meraki.devices_live_tools_arp_table: + meraki_api_key: "{{meraki_api_key}}" + meraki_base_url: "{{meraki_base_url}}" + meraki_single_request_timeout: "{{meraki_single_request_timeout}}" + meraki_certificate_path: "{{meraki_certificate_path}}" + meraki_requests_proxy: "{{meraki_requests_proxy}}" + meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" + meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" + meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" + meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" + meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" + meraki_maximum_retries: "{{meraki_maximum_retries}}" + meraki_output_log: "{{meraki_output_log}}" + meraki_log_file_prefix: "{{meraki_log_file_prefix}}" + meraki_log_path: "{{meraki_log_path}}" + meraki_print_console: "{{meraki_print_console}}" + meraki_suppress_logging: "{{meraki_suppress_logging}}" + meraki_simulate: "{{meraki_simulate}}" + meraki_be_geo_id: "{{meraki_be_geo_id}}" + meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" + meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" + state: present + callback: + httpServer: + id: aHR0cHM6Ly93d3cuZXhhbXBsZS5jb20vd2ViaG9va3M= + payloadTemplate: + id: wpt_2100 + sharedSecret: secret + url: https://webhook.site/28efa24e-f830-4d9f-a12b-fbb9e5035031 + serial: string + +""" +RETURN = r""" +meraki_response: + description: A dictionary or list with the response returned by the Cisco Meraki Python SDK + returned: always + type: dict + sample: > + { + "arpTableId": "string", + "callback": { + "id": "string", + "status": "string", + "url": "string" + }, + "request": { + "serial": "string" + }, + "status": "string", + "url": "string" + } +""" diff --git a/ansible_collections/cisco/meraki/plugins/modules/devices_live_tools_arp_table_info.py b/ansible_collections/cisco/meraki/plugins/modules/devices_live_tools_arp_table_info.py new file mode 100644 index 000000000..fb9433a17 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/modules/devices_live_tools_arp_table_info.py @@ -0,0 +1,36 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: devices_live_tools_arp_table_info +short_description: Information module for devices _livetools _arptable +description: Information module for devices _livetools _arptable +version_added: '2.18.0' +extends_documentation_fragment: + - cisco.meraki.module_info +author: Francisco Munoz (@fmunoz) +options: + headers: + description: Additional headers. + type: dict +requirements: +- meraki >= 2.4.9 +- python >= 3.5 +notes: + - Paths used are +""" + +EXAMPLES = r""" +""" +RETURN = r""" +meraki_response: + description: A dictionary or list with the response returned by the Cisco Meraki Python SDK + returned: always + type: dict + sample: + - {} +""" diff --git a/ansible_collections/cisco/meraki/plugins/modules/devices_live_tools_cable_test.py b/ansible_collections/cisco/meraki/plugins/modules/devices_live_tools_cable_test.py new file mode 100644 index 000000000..fe7e47df9 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/modules/devices_live_tools_cable_test.py @@ -0,0 +1,130 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: devices_live_tools_cable_test +short_description: Resource module for devices _livetools _cabletest +description: +- Manage operation create of the resource devices _livetools _cabletest. +- Enqueue a job to perform a cable test for the device on the specified ports. +version_added: '2.18.0' +extends_documentation_fragment: + - cisco.meraki.module +author: Francisco Munoz (@fmunoz) +options: + callback: + description: Details for the callback. Please include either an httpServerId OR + url and sharedSecret. + suboptions: + httpServer: + description: The webhook receiver used for the callback webhook. + suboptions: + id: + description: The webhook receiver ID that will receive information. If specifying + this, please leave the url and sharedSecret fields blank. + type: str + type: dict + payloadTemplate: + description: The payload template of the webhook used for the callback. + suboptions: + id: + description: The ID of the payload template. Defaults to 'wpt_00005' for + the Callback (included) template. + type: str + type: dict + sharedSecret: + description: A shared secret that will be included in the requests sent to the + callback URL. It can be used to verify that the request was sent by Meraki. + If using this field, please also specify an url. + type: str + url: + description: The callback URL for the webhook target. If using this field, please + also specify a sharedSecret. + type: str + type: dict + ports: + description: A list of ports for which to perform the cable test. + elements: str + type: list + serial: + description: Serial path parameter. + type: str +requirements: +- meraki >= 2.4.9 +- python >= 3.5 +seealso: +- name: Cisco Meraki documentation for devices createDeviceLiveToolsCableTest + description: Complete reference of the createDeviceLiveToolsCableTest API. + link: https://developer.cisco.com/meraki/api-v1/#!create-device-live-tools-cable-test +notes: + - SDK Method used are + devices.Devices.create_device_live_tools_cable_test, + + - Paths used are + post /devices/{serial}/liveTools/cableTest, +""" + +EXAMPLES = r""" +- name: Create + cisco.meraki.devices_live_tools_cable_test: + meraki_api_key: "{{meraki_api_key}}" + meraki_base_url: "{{meraki_base_url}}" + meraki_single_request_timeout: "{{meraki_single_request_timeout}}" + meraki_certificate_path: "{{meraki_certificate_path}}" + meraki_requests_proxy: "{{meraki_requests_proxy}}" + meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" + meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" + meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" + meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" + meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" + meraki_maximum_retries: "{{meraki_maximum_retries}}" + meraki_output_log: "{{meraki_output_log}}" + meraki_log_file_prefix: "{{meraki_log_file_prefix}}" + meraki_log_path: "{{meraki_log_path}}" + meraki_print_console: "{{meraki_print_console}}" + meraki_suppress_logging: "{{meraki_suppress_logging}}" + meraki_simulate: "{{meraki_simulate}}" + meraki_be_geo_id: "{{meraki_be_geo_id}}" + meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" + meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" + state: present + callback: + httpServer: + id: aHR0cHM6Ly93d3cuZXhhbXBsZS5jb20vd2ViaG9va3M= + payloadTemplate: + id: wpt_2100 + sharedSecret: secret + url: https://webhook.site/28efa24e-f830-4d9f-a12b-fbb9e5035031 + ports: + - '2' + - '8' + serial: string + +""" +RETURN = r""" +meraki_response: + description: A dictionary or list with the response returned by the Cisco Meraki Python SDK + returned: always + type: dict + sample: > + { + "cableTestId": "string", + "callback": { + "id": "string", + "status": "string", + "url": "string" + }, + "request": { + "ports": [ + "string" + ], + "serial": "string" + }, + "status": "string", + "url": "string" + } +""" diff --git a/ansible_collections/cisco/meraki/plugins/modules/devices_live_tools_cable_test_info.py b/ansible_collections/cisco/meraki/plugins/modules/devices_live_tools_cable_test_info.py new file mode 100644 index 000000000..62ee49431 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/modules/devices_live_tools_cable_test_info.py @@ -0,0 +1,36 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: devices_live_tools_cable_test_info +short_description: Information module for devices _livetools _cabletest +description: Information module for devices _livetools _cabletest +version_added: '2.18.0' +extends_documentation_fragment: + - cisco.meraki.module_info +author: Francisco Munoz (@fmunoz) +options: + headers: + description: Additional headers. + type: dict +requirements: +- meraki >= 2.4.9 +- python >= 3.5 +notes: + - Paths used are +""" + +EXAMPLES = r""" +""" +RETURN = r""" +meraki_response: + description: A dictionary or list with the response returned by the Cisco Meraki Python SDK + returned: always + type: dict + sample: + - {} +""" diff --git a/ansible_collections/cisco/meraki/plugins/modules/devices_live_tools_ping.py b/ansible_collections/cisco/meraki/plugins/modules/devices_live_tools_ping.py index 791847c69..a3814c19c 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/devices_live_tools_ping.py +++ b/ansible_collections/cisco/meraki/plugins/modules/devices_live_tools_ping.py @@ -16,6 +16,36 @@ extends_documentation_fragment: - cisco.meraki.module author: Francisco Munoz (@fmunoz) options: + callback: + description: Details for the callback. Please include either an httpServerId OR + url and sharedSecret. + suboptions: + httpServer: + description: The webhook receiver used for the callback webhook. + suboptions: + id: + description: The webhook receiver ID that will receive information. If specifying + this, please leave the url and sharedSecret fields blank. + type: str + type: dict + payloadTemplate: + description: The payload template of the webhook used for the callback. + suboptions: + id: + description: The ID of the payload template. Defaults to 'wpt_00005' for + the Callback (included) template. + type: str + type: dict + sharedSecret: + description: A shared secret that will be included in the requests sent to the + callback URL. It can be used to verify that the request was sent by Meraki. + If using this field, please also specify an url. + type: str + url: + description: The callback URL for the webhook target. If using this field, please + also specify a sharedSecret. + type: str + type: dict count: description: Count parameter to pass to ping. 1..5, default 5. type: int @@ -64,6 +94,13 @@ EXAMPLES = r""" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" state: present + callback: + httpServer: + id: aHR0cHM6Ly93d3cuZXhhbXBsZS5jb20vd2ViaG9va3M= + payloadTemplate: + id: wpt_2100 + sharedSecret: secret + url: https://webhook.site/28efa24e-f830-4d9f-a12b-fbb9e5035031 count: 2 serial: string target: 75.75.75.75 @@ -76,13 +113,18 @@ meraki_response: type: dict sample: > { + "callback": { + "id": "string", + "status": "string", + "url": "string" + }, "pingId": "string", - "url": "string", "request": { + "count": 0, "serial": "string", - "target": "string", - "count": 0 + "target": "string" }, - "status": "string" + "status": "string", + "url": "string" } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/devices_live_tools_ping_device.py b/ansible_collections/cisco/meraki/plugins/modules/devices_live_tools_ping_device.py index ee6a137cf..65df1e314 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/devices_live_tools_ping_device.py +++ b/ansible_collections/cisco/meraki/plugins/modules/devices_live_tools_ping_device.py @@ -16,6 +16,36 @@ extends_documentation_fragment: - cisco.meraki.module author: Francisco Munoz (@fmunoz) options: + callback: + description: Details for the callback. Please include either an httpServerId OR + url and sharedSecret. + suboptions: + httpServer: + description: The webhook receiver used for the callback webhook. + suboptions: + id: + description: The webhook receiver ID that will receive information. If specifying + this, please leave the url and sharedSecret fields blank. + type: str + type: dict + payloadTemplate: + description: The payload template of the webhook used for the callback. + suboptions: + id: + description: The ID of the payload template. Defaults to 'wpt_00005' for + the Callback (included) template. + type: str + type: dict + sharedSecret: + description: A shared secret that will be included in the requests sent to the + callback URL. It can be used to verify that the request was sent by Meraki. + If using this field, please also specify an url. + type: str + url: + description: The callback URL for the webhook target. If using this field, please + also specify a sharedSecret. + type: str + type: dict count: description: Count parameter to pass to ping. 1..5, default 5. type: int @@ -61,6 +91,13 @@ EXAMPLES = r""" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" state: present + callback: + httpServer: + id: aHR0cHM6Ly93d3cuZXhhbXBsZS5jb20vd2ViaG9va3M= + payloadTemplate: + id: wpt_2100 + sharedSecret: secret + url: https://webhook.site/28efa24e-f830-4d9f-a12b-fbb9e5035031 count: 3 serial: string @@ -72,13 +109,18 @@ meraki_response: type: dict sample: > { + "callback": { + "id": "string", + "status": "string", + "url": "string" + }, "pingId": "string", - "url": "string", "request": { + "count": 0, "serial": "string", - "target": "string", - "count": 0 + "target": "string" }, - "status": "string" + "status": "string", + "url": "string" } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/devices_live_tools_ping_device_info.py b/ansible_collections/cisco/meraki/plugins/modules/devices_live_tools_ping_device_info.py index 3a5507001..4173b0a95 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/devices_live_tools_ping_device_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/devices_live_tools_ping_device_info.py @@ -77,32 +77,37 @@ meraki_response: type: dict sample: > { + "callback": { + "id": "string", + "status": "string", + "url": "string" + }, "pingId": "string", - "url": "string", "request": { + "count": 0, "serial": "string", - "target": "string", - "count": 0 + "target": "string" }, - "status": "string", "results": { - "sent": 0, - "received": 0, - "loss": { - "percentage": 0 - }, "latencies": { - "minimum": 0, "average": 0, - "maximum": 0 + "maximum": 0, + "minimum": 0 }, + "loss": { + "percentage": 0 + }, + "received": 0, "replies": [ { + "latency": 0, "sequenceId": 0, - "size": 0, - "latency": 0 + "size": 0 } - ] - } + ], + "sent": 0 + }, + "status": "string", + "url": "string" } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/devices_live_tools_ping_info.py b/ansible_collections/cisco/meraki/plugins/modules/devices_live_tools_ping_info.py index 65a11d488..2dcb32d7b 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/devices_live_tools_ping_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/devices_live_tools_ping_info.py @@ -78,31 +78,31 @@ meraki_response: sample: > { "pingId": "string", - "url": "string", "request": { + "count": 0, "serial": "string", - "target": "string", - "count": 0 + "target": "string" }, - "status": "string", "results": { - "sent": 0, - "received": 0, - "loss": { - "percentage": 0 - }, "latencies": { - "minimum": 0, "average": 0, - "maximum": 0 + "maximum": 0, + "minimum": 0 }, + "loss": { + "percentage": 0 + }, + "received": 0, "replies": [ { + "latency": 0, "sequenceId": 0, - "size": 0, - "latency": 0 + "size": 0 } - ] - } + ], + "sent": 0 + }, + "status": "string", + "url": "string" } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/devices_live_tools_throughput_test.py b/ansible_collections/cisco/meraki/plugins/modules/devices_live_tools_throughput_test.py new file mode 100644 index 000000000..2eefccd70 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/modules/devices_live_tools_throughput_test.py @@ -0,0 +1,126 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: devices_live_tools_throughput_test +short_description: Resource module for devices _livetools _throughputtest +description: +- Manage operation create of the resource devices _livetools _throughputtest. +- Enqueue a job to test a device throughput, the test will run for 10 secs to test throughput. +version_added: '2.18.0' +extends_documentation_fragment: + - cisco.meraki.module +author: Francisco Munoz (@fmunoz) +options: + callback: + description: Details for the callback. Please include either an httpServerId OR + url and sharedSecret. + suboptions: + httpServer: + description: The webhook receiver used for the callback webhook. + suboptions: + id: + description: The webhook receiver ID that will receive information. If specifying + this, please leave the url and sharedSecret fields blank. + type: str + type: dict + payloadTemplate: + description: The payload template of the webhook used for the callback. + suboptions: + id: + description: The ID of the payload template. Defaults to 'wpt_00005' for + the Callback (included) template. + type: str + type: dict + sharedSecret: + description: A shared secret that will be included in the requests sent to the + callback URL. It can be used to verify that the request was sent by Meraki. + If using this field, please also specify an url. + type: str + url: + description: The callback URL for the webhook target. If using this field, please + also specify a sharedSecret. + type: str + type: dict + serial: + description: Serial path parameter. + type: str +requirements: +- meraki >= 2.4.9 +- python >= 3.5 +seealso: +- name: Cisco Meraki documentation for devices createDeviceLiveToolsThroughputTest + description: Complete reference of the createDeviceLiveToolsThroughputTest API. + link: https://developer.cisco.com/meraki/api-v1/#!create-device-live-tools-throughput-test +notes: + - SDK Method used are + devices.Devices.create_device_live_tools_throughput_test, + + - Paths used are + post /devices/{serial}/liveTools/throughputTest, +""" + +EXAMPLES = r""" +- name: Create + cisco.meraki.devices_live_tools_throughput_test: + meraki_api_key: "{{meraki_api_key}}" + meraki_base_url: "{{meraki_base_url}}" + meraki_single_request_timeout: "{{meraki_single_request_timeout}}" + meraki_certificate_path: "{{meraki_certificate_path}}" + meraki_requests_proxy: "{{meraki_requests_proxy}}" + meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" + meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" + meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" + meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" + meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" + meraki_maximum_retries: "{{meraki_maximum_retries}}" + meraki_output_log: "{{meraki_output_log}}" + meraki_log_file_prefix: "{{meraki_log_file_prefix}}" + meraki_log_path: "{{meraki_log_path}}" + meraki_print_console: "{{meraki_print_console}}" + meraki_suppress_logging: "{{meraki_suppress_logging}}" + meraki_simulate: "{{meraki_simulate}}" + meraki_be_geo_id: "{{meraki_be_geo_id}}" + meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" + meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" + state: present + callback: + httpServer: + id: aHR0cHM6Ly93d3cuZXhhbXBsZS5jb20vd2ViaG9va3M= + payloadTemplate: + id: wpt_2100 + sharedSecret: secret + url: https://webhook.site/28efa24e-f830-4d9f-a12b-fbb9e5035031 + serial: string + +""" +RETURN = r""" +meraki_response: + description: A dictionary or list with the response returned by the Cisco Meraki Python SDK + returned: always + type: dict + sample: > + { + "callback": { + "id": "string", + "status": "string", + "url": "string" + }, + "error": "string", + "request": { + "serial": "string" + }, + "result": { + "speeds": { + "downstream": 0 + } + }, + "status": "string", + "throughputTestId": "string", + "url": "string" + } +""" diff --git a/ansible_collections/cisco/meraki/plugins/modules/devices_live_tools_throughput_test_info.py b/ansible_collections/cisco/meraki/plugins/modules/devices_live_tools_throughput_test_info.py new file mode 100644 index 000000000..3f01daf1a --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/modules/devices_live_tools_throughput_test_info.py @@ -0,0 +1,36 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: devices_live_tools_throughput_test_info +short_description: Information module for devices _livetools _throughputtest +description: Information module for devices _livetools _throughputtest +version_added: '2.18.0' +extends_documentation_fragment: + - cisco.meraki.module_info +author: Francisco Munoz (@fmunoz) +options: + headers: + description: Additional headers. + type: dict +requirements: +- meraki >= 2.4.9 +- python >= 3.5 +notes: + - Paths used are +""" + +EXAMPLES = r""" +""" +RETURN = r""" +meraki_response: + description: A dictionary or list with the response returned by the Cisco Meraki Python SDK + returned: always + type: dict + sample: + - {} +""" diff --git a/ansible_collections/cisco/meraki/plugins/modules/devices_live_tools_wake_on_lan.py b/ansible_collections/cisco/meraki/plugins/modules/devices_live_tools_wake_on_lan.py new file mode 100644 index 000000000..665fd2e4a --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/modules/devices_live_tools_wake_on_lan.py @@ -0,0 +1,131 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: devices_live_tools_wake_on_lan +short_description: Resource module for devices _livetools _wakeonlan +description: +- Manage operation create of the resource devices _livetools _wakeonlan. +- Enqueue a job to send a Wake-on-LAN packet from the device. +version_added: '2.18.0' +extends_documentation_fragment: + - cisco.meraki.module +author: Francisco Munoz (@fmunoz) +options: + callback: + description: Details for the callback. Please include either an httpServerId OR + url and sharedSecret. + suboptions: + httpServer: + description: The webhook receiver used for the callback webhook. + suboptions: + id: + description: The webhook receiver ID that will receive information. If specifying + this, please leave the url and sharedSecret fields blank. + type: str + type: dict + payloadTemplate: + description: The payload template of the webhook used for the callback. + suboptions: + id: + description: The ID of the payload template. Defaults to 'wpt_00005' for + the Callback (included) template. + type: str + type: dict + sharedSecret: + description: A shared secret that will be included in the requests sent to the + callback URL. It can be used to verify that the request was sent by Meraki. + If using this field, please also specify an url. + type: str + url: + description: The callback URL for the webhook target. If using this field, please + also specify a sharedSecret. + type: str + type: dict + mac: + description: The target's MAC address. + type: str + serial: + description: Serial path parameter. + type: str + vlanId: + description: The target's VLAN (1 to 4094). + type: int +requirements: +- meraki >= 2.4.9 +- python >= 3.5 +seealso: +- name: Cisco Meraki documentation for devices createDeviceLiveToolsWakeOnLan + description: Complete reference of the createDeviceLiveToolsWakeOnLan API. + link: https://developer.cisco.com/meraki/api-v1/#!create-device-live-tools-wake-on-lan +notes: + - SDK Method used are + devices.Devices.create_device_live_tools_wake_on_lan, + + - Paths used are + post /devices/{serial}/liveTools/wakeOnLan, +""" + +EXAMPLES = r""" +- name: Create + cisco.meraki.devices_live_tools_wake_on_lan: + meraki_api_key: "{{meraki_api_key}}" + meraki_base_url: "{{meraki_base_url}}" + meraki_single_request_timeout: "{{meraki_single_request_timeout}}" + meraki_certificate_path: "{{meraki_certificate_path}}" + meraki_requests_proxy: "{{meraki_requests_proxy}}" + meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" + meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" + meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" + meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" + meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" + meraki_maximum_retries: "{{meraki_maximum_retries}}" + meraki_output_log: "{{meraki_output_log}}" + meraki_log_file_prefix: "{{meraki_log_file_prefix}}" + meraki_log_path: "{{meraki_log_path}}" + meraki_print_console: "{{meraki_print_console}}" + meraki_suppress_logging: "{{meraki_suppress_logging}}" + meraki_simulate: "{{meraki_simulate}}" + meraki_be_geo_id: "{{meraki_be_geo_id}}" + meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" + meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" + state: present + callback: + httpServer: + id: aHR0cHM6Ly93d3cuZXhhbXBsZS5jb20vd2ViaG9va3M= + payloadTemplate: + id: wpt_2100 + sharedSecret: secret + url: https://webhook.site/28efa24e-f830-4d9f-a12b-fbb9e5035031 + mac: 00:11:22:33:44:55 + serial: string + vlanId: 12 + +""" +RETURN = r""" +meraki_response: + description: A dictionary or list with the response returned by the Cisco Meraki Python SDK + returned: always + type: dict + sample: > + { + "callback": { + "id": "string", + "status": "string", + "url": "string" + }, + "error": "string", + "request": { + "mac": "string", + "serial": "string", + "vlanId": 0 + }, + "status": "string", + "url": "string", + "wakeOnLanId": "string" + } +""" diff --git a/ansible_collections/cisco/meraki/plugins/modules/devices_live_tools_wake_on_lan_info.py b/ansible_collections/cisco/meraki/plugins/modules/devices_live_tools_wake_on_lan_info.py new file mode 100644 index 000000000..e6d709634 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/modules/devices_live_tools_wake_on_lan_info.py @@ -0,0 +1,36 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: devices_live_tools_wake_on_lan_info +short_description: Information module for devices _livetools _wakeonlan +description: Information module for devices _livetools _wakeonlan +version_added: '2.18.0' +extends_documentation_fragment: + - cisco.meraki.module_info +author: Francisco Munoz (@fmunoz) +options: + headers: + description: Additional headers. + type: dict +requirements: +- meraki >= 2.4.9 +- python >= 3.5 +notes: + - Paths used are +""" + +EXAMPLES = r""" +""" +RETURN = r""" +meraki_response: + description: A dictionary or list with the response returned by the Cisco Meraki Python SDK + returned: always + type: dict + sample: + - {} +""" diff --git a/ansible_collections/cisco/meraki/plugins/modules/devices_lldp_cdp_info.py b/ansible_collections/cisco/meraki/plugins/modules/devices_lldp_cdp_info.py index 6b164fafb..eea8e5e0e 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/devices_lldp_cdp_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/devices_lldp_cdp_info.py @@ -70,6 +70,9 @@ meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always type: dict - sample: - - {} + sample: > + { + "ports": {}, + "sourceMac": "string" + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/devices_management_interface.py b/ansible_collections/cisco/meraki/plugins/modules/devices_management_interface.py index 7935d66b8..26b3b91d9 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/devices_management_interface.py +++ b/ansible_collections/cisco/meraki/plugins/modules/devices_management_interface.py @@ -132,6 +132,12 @@ EXAMPLES = r""" vlan: 7 wanEnabled: not configured wan2: + staticDns: + - 1.2.3.2 + - 1.2.3.3 + staticGatewayIp: 1.2.3.1 + staticIp: 1.2.3.4 + staticSubnetMask: 255.255.255.0 usingStaticIp: false vlan: 2 wanEnabled: enabled @@ -168,5 +174,33 @@ meraki_response: returned: always type: dict sample: > - {} + { + "ddnsHostnames": { + "activeDdnsHostname": "string", + "ddnsHostnameWan1": "string", + "ddnsHostnameWan2": "string" + }, + "wan1": { + "staticDns": [ + "string" + ], + "staticGatewayIp": "string", + "staticIp": "string", + "staticSubnetMask": "string", + "usingStaticIp": true, + "vlan": 0, + "wanEnabled": "string" + }, + "wan2": { + "staticDns": [ + "string" + ], + "staticGatewayIp": "string", + "staticIp": "string", + "staticSubnetMask": "string", + "usingStaticIp": true, + "vlan": 0, + "wanEnabled": "string" + } + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/devices_management_interface_info.py b/ansible_collections/cisco/meraki/plugins/modules/devices_management_interface_info.py index d6c7b9f5a..6037634ab 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/devices_management_interface_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/devices_management_interface_info.py @@ -70,6 +70,34 @@ meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always type: dict - sample: - - {} + sample: > + { + "ddnsHostnames": { + "activeDdnsHostname": "string", + "ddnsHostnameWan1": "string", + "ddnsHostnameWan2": "string" + }, + "wan1": { + "staticDns": [ + "string" + ], + "staticGatewayIp": "string", + "staticIp": "string", + "staticSubnetMask": "string", + "usingStaticIp": true, + "vlan": 0, + "wanEnabled": "string" + }, + "wan2": { + "staticDns": [ + "string" + ], + "staticGatewayIp": "string", + "staticIp": "string", + "staticSubnetMask": "string", + "usingStaticIp": true, + "vlan": 0, + "wanEnabled": "string" + } + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/devices_sensor_relationships.py b/ansible_collections/cisco/meraki/plugins/modules/devices_sensor_relationships.py index 6807e39b3..16d18deb0 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/devices_sensor_relationships.py +++ b/ansible_collections/cisco/meraki/plugins/modules/devices_sensor_relationships.py @@ -37,12 +37,12 @@ requirements: - meraki >= 2.4.9 - python >= 3.5 seealso: -- name: Cisco Meraki documentation for devices updateDeviceSensorRelationships +- name: Cisco Meraki documentation for sensor updateDeviceSensorRelationships description: Complete reference of the updateDeviceSensorRelationships API. link: https://developer.cisco.com/meraki/api-v1/#!update-device-sensor-relationships notes: - SDK Method used are - devices.Devices.update_device_sensor_relationships, + sensor.Sensor.update_device_sensor_relationships, - Paths used are put /devices/{serial}/sensor/relationships, @@ -85,13 +85,11 @@ meraki_response: type: dict sample: > { - "livestream": { - "relatedDevices": [ - { - "serial": "string", - "productType": "string" - } - ] - } + "relatedDevices": [ + { + "productType": "string", + "serial": "string" + } + ] } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/devices_sensor_relationships_info.py b/ansible_collections/cisco/meraki/plugins/modules/devices_sensor_relationships_info.py index 10dfce37d..2bdf296c5 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/devices_sensor_relationships_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/devices_sensor_relationships_info.py @@ -27,12 +27,12 @@ requirements: - meraki >= 2.4.9 - python >= 3.5 seealso: -- name: Cisco Meraki documentation for devices getDeviceSensorRelationships +- name: Cisco Meraki documentation for sensor getDeviceSensorRelationships description: Complete reference of the getDeviceSensorRelationships API. link: https://developer.cisco.com/meraki/api-v1/#!get-device-sensor-relationships notes: - SDK Method used are - devices.Devices.get_device_sensor_relationships, + sensor.Sensor.get_device_sensor_relationships, - Paths used are get /devices/{serial}/sensor/relationships, @@ -69,19 +69,14 @@ RETURN = r""" meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always - type: list - elements: dict + type: dict sample: > - [ - { - "livestream": { - "relatedDevices": [ - { - "serial": "string", - "productType": "string" - } - ] + { + "relatedDevices": [ + { + "productType": "string", + "serial": "string" } - } - ] + ] + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/devices_switch_ports.py b/ansible_collections/cisco/meraki/plugins/modules/devices_switch_ports.py index 370a7c560..7a4414b83 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/devices_switch_ports.py +++ b/ansible_collections/cisco/meraki/plugins/modules/devices_switch_ports.py @@ -122,8 +122,8 @@ options: Enforce). Default configuration is Alert only. type: str vlan: - description: The VLAN of the switch port. A null value will clear the value set - for trunk ports. + description: The VLAN of the switch port. For a trunk port, this is the native VLAN. + A null value will clear the value set for trunk ports. type: int voiceVlan: description: The voice VLAN of the switch port. Only applicable to access ports. @@ -132,12 +132,12 @@ requirements: - meraki >= 2.4.9 - python >= 3.5 seealso: -- name: Cisco Meraki documentation for devices updateDeviceSwitchPort +- name: Cisco Meraki documentation for switch updateDeviceSwitchPort description: Complete reference of the updateDeviceSwitchPort API. link: https://developer.cisco.com/meraki/api-v1/#!update-device-switch-port notes: - SDK Method used are - devices.Devices.update_device_switch_port, + switch.Switch.update_device_switch_port, - Paths used are put /devices/{serial}/switch/ports/{portId}, @@ -212,44 +212,50 @@ meraki_response: type: dict sample: > { - "portId": "string", - "name": "string", - "tags": [ - "string" - ], - "enabled": true, - "poeEnabled": true, - "type": "string", - "vlan": 0, - "voiceVlan": 0, + "accessPolicyNumber": 0, + "accessPolicyType": "string", + "adaptivePolicyGroupId": "string", "allowedVlans": "string", + "daiTrusted": true, + "enabled": true, + "flexibleStackingEnabled": true, "isolationEnabled": true, - "rstpEnabled": true, - "stpGuard": "string", "linkNegotiation": "string", "linkNegotiationCapabilities": [ "string" ], - "portScheduleId": "string", - "udld": "string", - "accessPolicyType": "string", - "accessPolicyNumber": 0, "macAllowList": [ "string" ], - "stickyMacAllowList": [ - "string" - ], - "stickyMacAllowListLimit": 0, - "stormControlEnabled": true, - "adaptivePolicyGroupId": "string", + "mirror": { + "mode": "string" + }, + "module": { + "model": "string" + }, + "name": "string", "peerSgtCapable": true, - "flexibleStackingEnabled": true, - "daiTrusted": true, + "poeEnabled": true, + "portId": "string", + "portScheduleId": "string", "profile": { "enabled": true, "id": "string", "iname": "string" - } + }, + "rstpEnabled": true, + "stickyMacAllowList": [ + "string" + ], + "stickyMacAllowListLimit": 0, + "stormControlEnabled": true, + "stpGuard": "string", + "tags": [ + "string" + ], + "type": "string", + "udld": "string", + "vlan": 0, + "voiceVlan": 0 } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/devices_switch_ports_cycle.py b/ansible_collections/cisco/meraki/plugins/modules/devices_switch_ports_cycle.py index a408ad69f..9739b0427 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/devices_switch_ports_cycle.py +++ b/ansible_collections/cisco/meraki/plugins/modules/devices_switch_ports_cycle.py @@ -27,12 +27,12 @@ requirements: - meraki >= 2.4.9 - python >= 3.5 seealso: -- name: Cisco Meraki documentation for devices cycleDeviceSwitchPorts +- name: Cisco Meraki documentation for switch cycleDeviceSwitchPorts description: Complete reference of the cycleDeviceSwitchPorts API. link: https://developer.cisco.com/meraki/api-v1/#!cycle-device-switch-ports notes: - SDK Method used are - devices.Devices.cycle_device_switch_ports, + switch.Switch.cycle_device_switch_ports, - Paths used are post /devices/{serial}/switch/ports/cycle, diff --git a/ansible_collections/cisco/meraki/plugins/modules/devices_switch_ports_info.py b/ansible_collections/cisco/meraki/plugins/modules/devices_switch_ports_info.py index 668e18e12..f890001ed 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/devices_switch_ports_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/devices_switch_ports_info.py @@ -9,7 +9,9 @@ DOCUMENTATION = r""" module: devices_switch_ports_info short_description: Information module for devices _switch _ports description: +- Get all devices _switch _ports. - Get devices _switch _ports by id. +- List the switch ports for a switch. - Return a switch port. version_added: '2.16.0' extends_documentation_fragment: @@ -31,18 +33,48 @@ requirements: - meraki >= 2.4.9 - python >= 3.5 seealso: -- name: Cisco Meraki documentation for devices getDeviceSwitchPort +- name: Cisco Meraki documentation for switch getDeviceSwitchPort description: Complete reference of the getDeviceSwitchPort API. link: https://developer.cisco.com/meraki/api-v1/#!get-device-switch-port +- name: Cisco Meraki documentation for switch getDeviceSwitchPorts + description: Complete reference of the getDeviceSwitchPorts API. + link: https://developer.cisco.com/meraki/api-v1/#!get-device-switch-ports notes: - SDK Method used are - devices.Devices.get_device_switch_port, + switch.Switch.get_device_switch_port, + switch.Switch.get_device_switch_ports, - Paths used are + get /devices/{serial}/switch/ports, get /devices/{serial}/switch/ports/{portId}, """ EXAMPLES = r""" +- name: Get all devices _switch _ports + cisco.meraki.devices_switch_ports_info: + meraki_api_key: "{{meraki_api_key}}" + meraki_base_url: "{{meraki_base_url}}" + meraki_single_request_timeout: "{{meraki_single_request_timeout}}" + meraki_certificate_path: "{{meraki_certificate_path}}" + meraki_requests_proxy: "{{meraki_requests_proxy}}" + meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" + meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" + meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" + meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" + meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" + meraki_maximum_retries: "{{meraki_maximum_retries}}" + meraki_output_log: "{{meraki_output_log}}" + meraki_log_file_prefix: "{{meraki_log_file_prefix}}" + meraki_log_path: "{{meraki_log_path}}" + meraki_print_console: "{{meraki_print_console}}" + meraki_suppress_logging: "{{meraki_suppress_logging}}" + meraki_simulate: "{{meraki_simulate}}" + meraki_be_geo_id: "{{meraki_be_geo_id}}" + meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" + meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" + serial: string + register: result + - name: Get devices _switch _ports by id cisco.meraki.devices_switch_ports_info: meraki_api_key: "{{meraki_api_key}}" @@ -77,44 +109,50 @@ meraki_response: type: dict sample: > { - "portId": "string", - "name": "string", - "tags": [ - "string" - ], - "enabled": true, - "poeEnabled": true, - "type": "string", - "vlan": 0, - "voiceVlan": 0, + "accessPolicyNumber": 0, + "accessPolicyType": "string", + "adaptivePolicyGroupId": "string", "allowedVlans": "string", + "daiTrusted": true, + "enabled": true, + "flexibleStackingEnabled": true, "isolationEnabled": true, - "rstpEnabled": true, - "stpGuard": "string", "linkNegotiation": "string", "linkNegotiationCapabilities": [ "string" ], - "portScheduleId": "string", - "udld": "string", - "accessPolicyType": "string", - "accessPolicyNumber": 0, "macAllowList": [ "string" ], - "stickyMacAllowList": [ - "string" - ], - "stickyMacAllowListLimit": 0, - "stormControlEnabled": true, - "adaptivePolicyGroupId": "string", + "mirror": { + "mode": "string" + }, + "module": { + "model": "string" + }, + "name": "string", "peerSgtCapable": true, - "flexibleStackingEnabled": true, - "daiTrusted": true, + "poeEnabled": true, + "portId": "string", + "portScheduleId": "string", "profile": { "enabled": true, "id": "string", "iname": "string" - } + }, + "rstpEnabled": true, + "stickyMacAllowList": [ + "string" + ], + "stickyMacAllowListLimit": 0, + "stormControlEnabled": true, + "stpGuard": "string", + "tags": [ + "string" + ], + "type": "string", + "udld": "string", + "vlan": 0, + "voiceVlan": 0 } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/devices_switch_ports_statuses_info.py b/ansible_collections/cisco/meraki/plugins/modules/devices_switch_ports_statuses_info.py index 3d3c7964b..b85a401aa 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/devices_switch_ports_statuses_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/devices_switch_ports_statuses_info.py @@ -38,12 +38,12 @@ requirements: - meraki >= 2.4.9 - python >= 3.5 seealso: -- name: Cisco Meraki documentation for devices getDeviceSwitchPortsStatuses +- name: Cisco Meraki documentation for switch getDeviceSwitchPortsStatuses description: Complete reference of the getDeviceSwitchPortsStatuses API. link: https://developer.cisco.com/meraki/api-v1/#!get-device-switch-ports-statuses notes: - SDK Method used are - devices.Devices.get_device_switch_ports_statuses, + switch.Switch.get_device_switch_ports_statuses, - Paths used are get /devices/{serial}/switch/ports/statuses, @@ -87,64 +87,69 @@ meraki_response: sample: > [ { - "portId": "string", - "enabled": true, - "status": "string", - "isUplink": true, - "errors": [ - "string" - ], - "warnings": [ - "string" - ], - "speed": "string", - "duplex": "string", - "usageInKb": { - "total": 0, - "sent": 0, - "recv": 0 - }, "cdp": { - "systemName": "string", - "platform": "string", - "deviceId": "string", - "portId": "string", - "nativeVlan": 0, "address": "string", + "capabilities": "string", + "deviceId": "string", "managementAddress": "string", + "nativeVlan": 0, + "platform": "string", + "portId": "string", + "systemName": "string", "version": "string", - "vtpManagementDomain": "string", - "capabilities": "string" + "vtpManagementDomain": "string" }, + "clientCount": 0, + "duplex": "string", + "enabled": true, + "errors": [ + "string" + ], + "isUplink": true, "lldp": { - "systemName": "string", - "systemDescription": "string", "chassisId": "string", - "portId": "string", - "managementVlan": 0, - "portVlan": 0, "managementAddress": "string", + "managementVlan": 0, "portDescription": "string", - "systemCapabilities": "string" + "portId": "string", + "portVlan": 0, + "systemCapabilities": "string", + "systemDescription": "string", + "systemName": "string" }, - "clientCount": 0, + "portId": "string", "powerUsageInWh": 0, - "trafficInKbps": { - "total": 0, - "sent": 0, - "recv": 0 - }, "securePort": { - "enabled": true, "active": true, "authenticationStatus": "string", "configOverrides": { + "allowedVlans": "string", "type": "string", "vlan": 0, - "voiceVlan": 0, - "allowedVlans": "string" - } - } + "voiceVlan": 0 + }, + "enabled": true + }, + "spanningTree": { + "statuses": [ + "string" + ] + }, + "speed": "string", + "status": "string", + "trafficInKbps": { + "recv": 0, + "sent": 0, + "total": 0 + }, + "usageInKb": { + "recv": 0, + "sent": 0, + "total": 0 + }, + "warnings": [ + "string" + ] } ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/devices_switch_routing_interfaces.py b/ansible_collections/cisco/meraki/plugins/modules/devices_switch_routing_interfaces.py index 1a9d2d174..de05b3b3d 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/devices_switch_routing_interfaces.py +++ b/ansible_collections/cisco/meraki/plugins/modules/devices_switch_routing_interfaces.py @@ -102,20 +102,20 @@ requirements: - meraki >= 2.4.9 - python >= 3.5 seealso: -- name: Cisco Meraki documentation for devices createDeviceSwitchRoutingInterface +- name: Cisco Meraki documentation for switch createDeviceSwitchRoutingInterface description: Complete reference of the createDeviceSwitchRoutingInterface API. link: https://developer.cisco.com/meraki/api-v1/#!create-device-switch-routing-interface -- name: Cisco Meraki documentation for devices deleteDeviceSwitchRoutingInterface +- name: Cisco Meraki documentation for switch deleteDeviceSwitchRoutingInterface description: Complete reference of the deleteDeviceSwitchRoutingInterface API. link: https://developer.cisco.com/meraki/api-v1/#!delete-device-switch-routing-interface -- name: Cisco Meraki documentation for devices updateDeviceSwitchRoutingInterface +- name: Cisco Meraki documentation for switch updateDeviceSwitchRoutingInterface description: Complete reference of the updateDeviceSwitchRoutingInterface API. link: https://developer.cisco.com/meraki/api-v1/#!update-device-switch-routing-interface notes: - SDK Method used are - devices.Devices.create_device_switch_routing_interface, - devices.Devices.delete_device_switch_routing_interface, - devices.Devices.update_device_switch_routing_interface, + switch.Switch.create_device_switch_routing_interface, + switch.Switch.delete_device_switch_routing_interface, + switch.Switch.update_device_switch_routing_interface, - Paths used are post /devices/{serial}/switch/routing/interfaces, @@ -168,7 +168,7 @@ EXAMPLES = r""" subnet: 192.168.1.0/24 vlanId: 100 -- name: Update by id +- name: Delete by id cisco.meraki.devices_switch_routing_interfaces: meraki_api_key: "{{meraki_api_key}}" meraki_base_url: "{{meraki_base_url}}" @@ -190,30 +190,11 @@ EXAMPLES = r""" meraki_be_geo_id: "{{meraki_be_geo_id}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: present - defaultGateway: 192.168.1.1 + state: absent interfaceId: string - interfaceIp: 192.168.1.2 - ipv6: - address: 1:2:3:4::1 - assignmentMode: static - gateway: 1:2:3:4::2 - prefix: 1:2:3:4::/48 - multicastRouting: disabled - name: L3 interface - ospfSettings: - area: '0' - cost: 1 - isPassiveEnabled: true - ospfV3: - area: '1' - cost: 2 - isPassiveEnabled: true serial: string - subnet: 192.168.1.0/24 - vlanId: 100 -- name: Delete by id +- name: Update by id cisco.meraki.devices_switch_routing_interfaces: meraki_api_key: "{{meraki_api_key}}" meraki_base_url: "{{meraki_base_url}}" @@ -235,9 +216,28 @@ EXAMPLES = r""" meraki_be_geo_id: "{{meraki_be_geo_id}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: absent + state: present + defaultGateway: 192.168.1.1 interfaceId: string + interfaceIp: 192.168.1.2 + ipv6: + address: 1:2:3:4::1 + assignmentMode: static + gateway: 1:2:3:4::2 + prefix: 1:2:3:4::/48 + multicastRouting: disabled + name: L3 interface + ospfSettings: + area: '0' + cost: 1 + isPassiveEnabled: true + ospfV3: + area: '1' + cost: 2 + isPassiveEnabled: true serial: string + subnet: 192.168.1.0/24 + vlanId: 100 """ RETURN = r""" @@ -247,13 +247,17 @@ meraki_response: type: dict sample: > { + "defaultGateway": "string", "interfaceId": "string", - "name": "string", - "subnet": "string", "interfaceIp": "string", + "ipv6": { + "address": "string", + "assignmentMode": "string", + "gateway": "string", + "prefix": "string" + }, "multicastRouting": "string", - "vlanId": 0, - "defaultGateway": "string", + "name": "string", "ospfSettings": { "area": "string", "cost": 0, @@ -264,11 +268,7 @@ meraki_response: "cost": 0, "isPassiveEnabled": true }, - "ipv6": { - "assignmentMode": "string", - "address": "string", - "prefix": "string", - "gateway": "string" - } + "subnet": "string", + "vlanId": 0 } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/devices_switch_routing_interfaces_dhcp.py b/ansible_collections/cisco/meraki/plugins/modules/devices_switch_routing_interfaces_dhcp.py index 84500631d..1b8fb6e0b 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/devices_switch_routing_interfaces_dhcp.py +++ b/ansible_collections/cisco/meraki/plugins/modules/devices_switch_routing_interfaces_dhcp.py @@ -105,12 +105,12 @@ requirements: - meraki >= 2.4.9 - python >= 3.5 seealso: -- name: Cisco Meraki documentation for devices updateDeviceSwitchRoutingInterfaceDhcp +- name: Cisco Meraki documentation for switch updateDeviceSwitchRoutingInterfaceDhcp description: Complete reference of the updateDeviceSwitchRoutingInterfaceDhcp API. link: https://developer.cisco.com/meraki/api-v1/#!update-device-switch-routing-interface-dhcp notes: - SDK Method used are - devices.Devices.update_device_switch_routing_interface_dhcp, + switch.Switch.update_device_switch_routing_interface_dhcp, - Paths used are put /devices/{serial}/switch/routing/interfaces/{interfaceId}/dhcp, @@ -149,6 +149,8 @@ EXAMPLES = r""" - code: '5' type: text value: five + dhcpRelayServerIps: + - 1.2.3.4 dnsCustomNameservers: - 8.8.8.8, 8.8.4.4 dnsNameserversOption: custom @@ -170,5 +172,39 @@ meraki_response: returned: always type: dict sample: > - {} + { + "bootFileName": "string", + "bootNextServer": "string", + "bootOptionsEnabled": true, + "dhcpLeaseTime": "string", + "dhcpMode": "string", + "dhcpOptions": [ + { + "code": "string", + "type": "string", + "value": "string" + } + ], + "dhcpRelayServerIps": [ + "string" + ], + "dnsCustomNameservers": [ + "string" + ], + "dnsNameserversOption": "string", + "fixedIpAssignments": [ + { + "ip": "string", + "mac": "string", + "name": "string" + } + ], + "reservedIpRanges": [ + { + "comment": "string", + "end": "string", + "start": "string" + } + ] + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/devices_switch_routing_interfaces_dhcp_info.py b/ansible_collections/cisco/meraki/plugins/modules/devices_switch_routing_interfaces_dhcp_info.py index 12f0758e5..b4cb02f4e 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/devices_switch_routing_interfaces_dhcp_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/devices_switch_routing_interfaces_dhcp_info.py @@ -31,12 +31,12 @@ requirements: - meraki >= 2.4.9 - python >= 3.5 seealso: -- name: Cisco Meraki documentation for devices getDeviceSwitchRoutingInterfaceDhcp +- name: Cisco Meraki documentation for switch getDeviceSwitchRoutingInterfaceDhcp description: Complete reference of the getDeviceSwitchRoutingInterfaceDhcp API. link: https://developer.cisco.com/meraki/api-v1/#!get-device-switch-routing-interface-dhcp notes: - SDK Method used are - devices.Devices.get_device_switch_routing_interface_dhcp, + switch.Switch.get_device_switch_routing_interface_dhcp, - Paths used are get /devices/{serial}/switch/routing/interfaces/{interfaceId}/dhcp, @@ -75,6 +75,40 @@ meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always type: dict - sample: - - {} + sample: > + { + "bootFileName": "string", + "bootNextServer": "string", + "bootOptionsEnabled": true, + "dhcpLeaseTime": "string", + "dhcpMode": "string", + "dhcpOptions": [ + { + "code": "string", + "type": "string", + "value": "string" + } + ], + "dhcpRelayServerIps": [ + "string" + ], + "dnsCustomNameservers": [ + "string" + ], + "dnsNameserversOption": "string", + "fixedIpAssignments": [ + { + "ip": "string", + "mac": "string", + "name": "string" + } + ], + "reservedIpRanges": [ + { + "comment": "string", + "end": "string", + "start": "string" + } + ] + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/devices_switch_routing_interfaces_info.py b/ansible_collections/cisco/meraki/plugins/modules/devices_switch_routing_interfaces_info.py index 3797bc13c..697792d01 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/devices_switch_routing_interfaces_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/devices_switch_routing_interfaces_info.py @@ -33,16 +33,16 @@ requirements: - meraki >= 2.4.9 - python >= 3.5 seealso: -- name: Cisco Meraki documentation for devices getDeviceSwitchRoutingInterface +- name: Cisco Meraki documentation for switch getDeviceSwitchRoutingInterface description: Complete reference of the getDeviceSwitchRoutingInterface API. link: https://developer.cisco.com/meraki/api-v1/#!get-device-switch-routing-interface -- name: Cisco Meraki documentation for devices getDeviceSwitchRoutingInterfaces +- name: Cisco Meraki documentation for switch getDeviceSwitchRoutingInterfaces description: Complete reference of the getDeviceSwitchRoutingInterfaces API. link: https://developer.cisco.com/meraki/api-v1/#!get-device-switch-routing-interfaces notes: - SDK Method used are - devices.Devices.get_device_switch_routing_interface, - devices.Devices.get_device_switch_routing_interfaces, + switch.Switch.get_device_switch_routing_interface, + switch.Switch.get_device_switch_routing_interfaces, - Paths used are get /devices/{serial}/switch/routing/interfaces, @@ -109,13 +109,17 @@ meraki_response: type: dict sample: > { + "defaultGateway": "string", "interfaceId": "string", - "name": "string", - "subnet": "string", "interfaceIp": "string", + "ipv6": { + "address": "string", + "assignmentMode": "string", + "gateway": "string", + "prefix": "string" + }, "multicastRouting": "string", - "vlanId": 0, - "defaultGateway": "string", + "name": "string", "ospfSettings": { "area": "string", "cost": 0, @@ -126,11 +130,7 @@ meraki_response: "cost": 0, "isPassiveEnabled": true }, - "ipv6": { - "assignmentMode": "string", - "address": "string", - "prefix": "string", - "gateway": "string" - } + "subnet": "string", + "vlanId": 0 } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/devices_switch_routing_static_routes.py b/ansible_collections/cisco/meraki/plugins/modules/devices_switch_routing_static_routes.py index 88642d475..4393ddb56 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/devices_switch_routing_static_routes.py +++ b/ansible_collections/cisco/meraki/plugins/modules/devices_switch_routing_static_routes.py @@ -45,20 +45,20 @@ requirements: - meraki >= 2.4.9 - python >= 3.5 seealso: -- name: Cisco Meraki documentation for devices createDeviceSwitchRoutingStaticRoute +- name: Cisco Meraki documentation for switch createDeviceSwitchRoutingStaticRoute description: Complete reference of the createDeviceSwitchRoutingStaticRoute API. link: https://developer.cisco.com/meraki/api-v1/#!create-device-switch-routing-static-route -- name: Cisco Meraki documentation for devices deleteDeviceSwitchRoutingStaticRoute +- name: Cisco Meraki documentation for switch deleteDeviceSwitchRoutingStaticRoute description: Complete reference of the deleteDeviceSwitchRoutingStaticRoute API. link: https://developer.cisco.com/meraki/api-v1/#!delete-device-switch-routing-static-route -- name: Cisco Meraki documentation for devices updateDeviceSwitchRoutingStaticRoute +- name: Cisco Meraki documentation for switch updateDeviceSwitchRoutingStaticRoute description: Complete reference of the updateDeviceSwitchRoutingStaticRoute API. link: https://developer.cisco.com/meraki/api-v1/#!update-device-switch-routing-static-route notes: - SDK Method used are - devices.Devices.create_device_switch_routing_static_route, - devices.Devices.delete_device_switch_routing_static_route, - devices.Devices.update_device_switch_routing_static_route, + switch.Switch.create_device_switch_routing_static_route, + switch.Switch.delete_device_switch_routing_static_route, + switch.Switch.update_device_switch_routing_static_route, - Paths used are post /devices/{serial}/switch/routing/staticRoutes, @@ -97,7 +97,7 @@ EXAMPLES = r""" serial: string subnet: 192.168.1.0/24 -- name: Update by id +- name: Delete by id cisco.meraki.devices_switch_routing_static_routes: meraki_api_key: "{{meraki_api_key}}" meraki_base_url: "{{meraki_base_url}}" @@ -119,16 +119,11 @@ EXAMPLES = r""" meraki_be_geo_id: "{{meraki_be_geo_id}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: present - advertiseViaOspfEnabled: false - name: My route - nextHopIp: 1.2.3.4 - preferOverOspfRoutesEnabled: false + state: absent serial: string staticRouteId: string - subnet: 192.168.1.0/24 -- name: Delete by id +- name: Update by id cisco.meraki.devices_switch_routing_static_routes: meraki_api_key: "{{meraki_api_key}}" meraki_base_url: "{{meraki_base_url}}" @@ -150,9 +145,14 @@ EXAMPLES = r""" meraki_be_geo_id: "{{meraki_be_geo_id}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: absent + state: present + advertiseViaOspfEnabled: false + name: My route + nextHopIp: 1.2.3.4 + preferOverOspfRoutesEnabled: false serial: string staticRouteId: string + subnet: 192.168.1.0/24 """ RETURN = r""" @@ -161,5 +161,12 @@ meraki_response: returned: always type: dict sample: > - {} + { + "advertiseViaOspfEnabled": true, + "name": "string", + "nextHopIp": "string", + "preferOverOspfRoutesEnabled": true, + "staticRouteId": "string", + "subnet": "string" + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/devices_switch_routing_static_routes_info.py b/ansible_collections/cisco/meraki/plugins/modules/devices_switch_routing_static_routes_info.py index 2473a8989..d7611215e 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/devices_switch_routing_static_routes_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/devices_switch_routing_static_routes_info.py @@ -33,16 +33,16 @@ requirements: - meraki >= 2.4.9 - python >= 3.5 seealso: -- name: Cisco Meraki documentation for devices getDeviceSwitchRoutingStaticRoute +- name: Cisco Meraki documentation for switch getDeviceSwitchRoutingStaticRoute description: Complete reference of the getDeviceSwitchRoutingStaticRoute API. link: https://developer.cisco.com/meraki/api-v1/#!get-device-switch-routing-static-route -- name: Cisco Meraki documentation for devices getDeviceSwitchRoutingStaticRoutes +- name: Cisco Meraki documentation for switch getDeviceSwitchRoutingStaticRoutes description: Complete reference of the getDeviceSwitchRoutingStaticRoutes API. link: https://developer.cisco.com/meraki/api-v1/#!get-device-switch-routing-static-routes notes: - SDK Method used are - devices.Devices.get_device_switch_routing_static_route, - devices.Devices.get_device_switch_routing_static_routes, + switch.Switch.get_device_switch_routing_static_route, + switch.Switch.get_device_switch_routing_static_routes, - Paths used are get /devices/{serial}/switch/routing/staticRoutes, @@ -109,11 +109,11 @@ meraki_response: type: dict sample: > { - "staticRouteId": "string", + "advertiseViaOspfEnabled": true, "name": "string", - "subnet": "string", "nextHopIp": "string", - "advertiseViaOspfEnabled": true, - "preferOverOspfRoutesEnabled": true + "preferOverOspfRoutesEnabled": true, + "staticRouteId": "string", + "subnet": "string" } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/devices_switch_warm_spare.py b/ansible_collections/cisco/meraki/plugins/modules/devices_switch_warm_spare.py index 6fd5890f5..c386180fa 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/devices_switch_warm_spare.py +++ b/ansible_collections/cisco/meraki/plugins/modules/devices_switch_warm_spare.py @@ -31,12 +31,12 @@ requirements: - meraki >= 2.4.9 - python >= 3.5 seealso: -- name: Cisco Meraki documentation for devices updateDeviceSwitchWarmSpare +- name: Cisco Meraki documentation for switch updateDeviceSwitchWarmSpare description: Complete reference of the updateDeviceSwitchWarmSpare API. link: https://developer.cisco.com/meraki/api-v1/#!update-device-switch-warm-spare notes: - SDK Method used are - devices.Devices.update_device_switch_warm_spare, + switch.Switch.update_device_switch_warm_spare, - Paths used are put /devices/{serial}/switch/warmSpare, @@ -77,5 +77,9 @@ meraki_response: returned: always type: dict sample: > - {} + { + "enabled": true, + "primarySerial": "string", + "spareSerial": "string" + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/devices_switch_warm_spare_info.py b/ansible_collections/cisco/meraki/plugins/modules/devices_switch_warm_spare_info.py index b3f525c38..a5474e874 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/devices_switch_warm_spare_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/devices_switch_warm_spare_info.py @@ -27,12 +27,12 @@ requirements: - meraki >= 2.4.9 - python >= 3.5 seealso: -- name: Cisco Meraki documentation for devices getDeviceSwitchWarmSpare +- name: Cisco Meraki documentation for switch getDeviceSwitchWarmSpare description: Complete reference of the getDeviceSwitchWarmSpare API. link: https://developer.cisco.com/meraki/api-v1/#!get-device-switch-warm-spare notes: - SDK Method used are - devices.Devices.get_device_switch_warm_spare, + switch.Switch.get_device_switch_warm_spare, - Paths used are get /devices/{serial}/switch/warmSpare, @@ -70,6 +70,10 @@ meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always type: dict - sample: - - {} + sample: > + { + "enabled": true, + "primarySerial": "string", + "spareSerial": "string" + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/devices_wireless_alternate_management_interface_ipv6.py b/ansible_collections/cisco/meraki/plugins/modules/devices_wireless_alternate_management_interface_ipv6.py new file mode 100644 index 000000000..139085016 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/modules/devices_wireless_alternate_management_interface_ipv6.py @@ -0,0 +1,125 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: devices_wireless_alternate_management_interface_ipv6 +short_description: Resource module for devices _wireless _alternatemanagementinterface _ipv6 +description: +- Manage operation update of the resource devices _wireless _alternatemanagementinterface _ipv6. +- Update alternate management interface IPv6 address. +version_added: '2.18.0' +extends_documentation_fragment: + - cisco.meraki.module +author: Francisco Munoz (@fmunoz) +options: + addresses: + description: Configured alternate management interface addresses. + elements: dict + suboptions: + address: + description: The IP address configured for the alternate management interface. + type: str + assignmentMode: + description: The type of address assignment. Either static or dynamic. + type: str + gateway: + description: The gateway address configured for the alternate managment interface. + type: str + nameservers: + description: The DNS servers settings for this address. + suboptions: + addresses: + description: Up to 2 nameserver addresses to use, ordered in priority from + highest to lowest priority. + elements: str + type: list + type: dict + prefix: + description: The IPv6 prefix length of the IPv6 interface. Required if IPv6 + object is included. + type: str + protocol: + description: The IP protocol used for the address. + type: str + type: list + serial: + description: Serial path parameter. + type: str +requirements: +- meraki >= 2.4.9 +- python >= 3.5 +seealso: +- name: Cisco Meraki documentation for wireless updateDeviceWirelessAlternateManagementInterfaceIpv6 + description: Complete reference of the updateDeviceWirelessAlternateManagementInterfaceIpv6 API. + link: https://developer.cisco.com/meraki/api-v1/#!update-device-wireless-alternate-management-interface-ipv6 +notes: + - SDK Method used are + wireless.Wireless.update_device_wireless_alternate_management_interface_ipv6, + + - Paths used are + put /devices/{serial}/wireless/alternateManagementInterface/ipv6, +""" + +EXAMPLES = r""" +- name: Update all + cisco.meraki.devices_wireless_alternate_management_interface_ipv6: + meraki_api_key: "{{meraki_api_key}}" + meraki_base_url: "{{meraki_base_url}}" + meraki_single_request_timeout: "{{meraki_single_request_timeout}}" + meraki_certificate_path: "{{meraki_certificate_path}}" + meraki_requests_proxy: "{{meraki_requests_proxy}}" + meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" + meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" + meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" + meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" + meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" + meraki_maximum_retries: "{{meraki_maximum_retries}}" + meraki_output_log: "{{meraki_output_log}}" + meraki_log_file_prefix: "{{meraki_log_file_prefix}}" + meraki_log_path: "{{meraki_log_path}}" + meraki_print_console: "{{meraki_print_console}}" + meraki_suppress_logging: "{{meraki_suppress_logging}}" + meraki_simulate: "{{meraki_simulate}}" + meraki_be_geo_id: "{{meraki_be_geo_id}}" + meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" + meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" + addresses: + - address: 2001:db8:3c4d:15::1 + assignmentMode: static + gateway: fe80:db8:c15:c0:d0c::10ca:1d02 + nameservers: + addresses: + - 2001:db8:3c4d:15::1 + - 2001:db8:3c4d:15::1 + prefix: 2001:db8:3c4d:15::/64 + protocol: ipv6 + serial: string + +""" +RETURN = r""" +meraki_response: + description: A dictionary or list with the response returned by the Cisco Meraki Python SDK + returned: always + type: dict + sample: > + { + "addresses": [ + { + "address": "string", + "assignmentMode": "string", + "gateway": "string", + "nameservers": { + "addresses": [ + "string" + ] + }, + "prefix": "string", + "protocol": "string" + } + ] + } +""" diff --git a/ansible_collections/cisco/meraki/plugins/modules/devices_wireless_bluetooth_settings.py b/ansible_collections/cisco/meraki/plugins/modules/devices_wireless_bluetooth_settings.py index c30f4f45a..49c532417 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/devices_wireless_bluetooth_settings.py +++ b/ansible_collections/cisco/meraki/plugins/modules/devices_wireless_bluetooth_settings.py @@ -35,12 +35,12 @@ requirements: - meraki >= 2.4.9 - python >= 3.5 seealso: -- name: Cisco Meraki documentation for devices updateDeviceWirelessBluetoothSettings +- name: Cisco Meraki documentation for wireless updateDeviceWirelessBluetoothSettings description: Complete reference of the updateDeviceWirelessBluetoothSettings API. link: https://developer.cisco.com/meraki/api-v1/#!update-device-wireless-bluetooth-settings notes: - SDK Method used are - devices.Devices.update_device_wireless_bluetooth_settings, + wireless.Wireless.update_device_wireless_bluetooth_settings, - Paths used are put /devices/{serial}/wireless/bluetooth/settings, @@ -83,8 +83,8 @@ meraki_response: type: dict sample: > { - "uuid": "string", "major": 0, - "minor": 0 + "minor": 0, + "uuid": "string" } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/devices_wireless_bluetooth_settings_info.py b/ansible_collections/cisco/meraki/plugins/modules/devices_wireless_bluetooth_settings_info.py index ee2d74bbb..34e538774 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/devices_wireless_bluetooth_settings_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/devices_wireless_bluetooth_settings_info.py @@ -27,12 +27,12 @@ requirements: - meraki >= 2.4.9 - python >= 3.5 seealso: -- name: Cisco Meraki documentation for devices getDeviceWirelessBluetoothSettings +- name: Cisco Meraki documentation for wireless getDeviceWirelessBluetoothSettings description: Complete reference of the getDeviceWirelessBluetoothSettings API. link: https://developer.cisco.com/meraki/api-v1/#!get-device-wireless-bluetooth-settings notes: - SDK Method used are - devices.Devices.get_device_wireless_bluetooth_settings, + wireless.Wireless.get_device_wireless_bluetooth_settings, - Paths used are get /devices/{serial}/wireless/bluetooth/settings, @@ -72,8 +72,8 @@ meraki_response: type: dict sample: > { - "uuid": "string", "major": 0, - "minor": 0 + "minor": 0, + "uuid": "string" } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/devices_wireless_connection_stats_info.py b/ansible_collections/cisco/meraki/plugins/modules/devices_wireless_connection_stats_info.py index a580e3ed8..0beb65eb0 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/devices_wireless_connection_stats_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/devices_wireless_connection_stats_info.py @@ -111,13 +111,13 @@ meraki_response: type: dict sample: > { - "serial": "string", "connectionStats": { "assoc": 0, "auth": 0, "dhcp": 0, "dns": 0, "success": 0 - } + }, + "serial": "string" } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/devices_wireless_latency_stats_info.py b/ansible_collections/cisco/meraki/plugins/modules/devices_wireless_latency_stats_info.py index 6689b3cc5..2c11d2f45 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/devices_wireless_latency_stats_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/devices_wireless_latency_stats_info.py @@ -66,12 +66,12 @@ requirements: - meraki >= 2.4.9 - python >= 3.5 seealso: -- name: Cisco Meraki documentation for devices getDeviceWirelessLatencyStats +- name: Cisco Meraki documentation for wireless getDeviceWirelessLatencyStats description: Complete reference of the getDeviceWirelessLatencyStats API. link: https://developer.cisco.com/meraki/api-v1/#!get-device-wireless-latency-stats notes: - SDK Method used are - devices.Devices.get_device_wireless_latency_stats, + wireless.Wireless.get_device_wireless_latency_stats, - Paths used are get /devices/{serial}/wireless/latencyStats, @@ -117,6 +117,31 @@ meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always type: dict - sample: - - {} + sample: > + { + "latencyStats": { + "backgroundTraffic": { + "avg": 0, + "rawDistribution": { + "0": 0, + "1": 0, + "1024": 0, + "128": 0, + "16": 0, + "2": 0, + "2048": 0, + "256": 0, + "32": 0, + "4": 0, + "512": 0, + "64": 0, + "8": 0 + } + }, + "bestEffortTraffic": "string", + "videoTraffic": "string", + "voiceTraffic": "string" + }, + "serial": "string" + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/devices_wireless_radio_settings.py b/ansible_collections/cisco/meraki/plugins/modules/devices_wireless_radio_settings.py index fd4e1ce3b..57a5c01fe 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/devices_wireless_radio_settings.py +++ b/ansible_collections/cisco/meraki/plugins/modules/devices_wireless_radio_settings.py @@ -60,12 +60,12 @@ requirements: - meraki >= 2.4.9 - python >= 3.5 seealso: -- name: Cisco Meraki documentation for devices updateDeviceWirelessRadioSettings +- name: Cisco Meraki documentation for wireless updateDeviceWirelessRadioSettings description: Complete reference of the updateDeviceWirelessRadioSettings API. link: https://developer.cisco.com/meraki/api-v1/#!update-device-wireless-radio-settings notes: - SDK Method used are - devices.Devices.update_device_wireless_radio_settings, + wireless.Wireless.update_device_wireless_radio_settings, - Paths used are put /devices/{serial}/wireless/radio/settings, diff --git a/ansible_collections/cisco/meraki/plugins/modules/devices_wireless_radio_settings_info.py b/ansible_collections/cisco/meraki/plugins/modules/devices_wireless_radio_settings_info.py index b672510c2..0cbeb278b 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/devices_wireless_radio_settings_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/devices_wireless_radio_settings_info.py @@ -27,12 +27,12 @@ requirements: - meraki >= 2.4.9 - python >= 3.5 seealso: -- name: Cisco Meraki documentation for devices getDeviceWirelessRadioSettings +- name: Cisco Meraki documentation for wireless getDeviceWirelessRadioSettings description: Complete reference of the getDeviceWirelessRadioSettings API. link: https://developer.cisco.com/meraki/api-v1/#!get-device-wireless-radio-settings notes: - SDK Method used are - devices.Devices.get_device_wireless_radio_settings, + wireless.Wireless.get_device_wireless_radio_settings, - Paths used are get /devices/{serial}/wireless/radio/settings, @@ -70,6 +70,18 @@ meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always type: dict - sample: - - {} + sample: > + { + "fiveGhzSettings": { + "channel": 0, + "channelWidth": 0, + "targetPower": 0 + }, + "rfProfileId": "string", + "serial": "string", + "twoFourGhzSettings": { + "channel": 0, + "targetPower": 0 + } + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/devices_wireless_status_info.py b/ansible_collections/cisco/meraki/plugins/modules/devices_wireless_status_info.py index 196815d81..d4c67f4ad 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/devices_wireless_status_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/devices_wireless_status_info.py @@ -27,12 +27,12 @@ requirements: - meraki >= 2.4.9 - python >= 3.5 seealso: -- name: Cisco Meraki documentation for devices getDeviceWirelessStatus +- name: Cisco Meraki documentation for wireless getDeviceWirelessStatus description: Complete reference of the getDeviceWirelessStatus API. link: https://developer.cisco.com/meraki/api-v1/#!get-device-wireless-status notes: - SDK Method used are - devices.Devices.get_device_wireless_status, + wireless.Wireless.get_device_wireless_status, - Paths used are get /devices/{serial}/wireless/status, @@ -69,7 +69,21 @@ RETURN = r""" meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always - type: dict - sample: - - {} + type: list + elements: dict + sample: > + [ + { + "band": "string", + "broadcasting": true, + "bssid": "string", + "channel": 0, + "channelWidth": "string", + "enabled": true, + "power": "string", + "ssidName": "string", + "ssidNumber": 0, + "visible": true + } + ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks.py b/ansible_collections/cisco/meraki/plugins/modules/networks.py index 3b1a7adb0..b81eead05 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks.py @@ -58,20 +58,20 @@ requirements: - meraki >= 2.4.9 - python >= 3.5 seealso: -- name: Cisco Meraki documentation for organizations,networks createOrganizationNetwork +- name: Cisco Meraki documentation for networks createOrganizationNetwork description: Complete reference of the createOrganizationNetwork API. link: https://developer.cisco.com/meraki/api-v1/#!create-organization-network -- name: Cisco Meraki documentation for organizations,networks deleteNetwork +- name: Cisco Meraki documentation for networks deleteNetwork description: Complete reference of the deleteNetwork API. link: https://developer.cisco.com/meraki/api-v1/#!delete-network -- name: Cisco Meraki documentation for organizations,networks updateNetwork +- name: Cisco Meraki documentation for networks updateNetwork description: Complete reference of the updateNetwork API. link: https://developer.cisco.com/meraki/api-v1/#!update-network notes: - SDK Method used are - organizationsnetworks.Organizationsnetworks.create_organization_network, - organizationsnetworks.Organizationsnetworks.delete_network, - organizationsnetworks.Organizationsnetworks.update_network, + networks.Networks.create_organization_network, + networks.Networks.delete_network, + networks.Networks.update_network, - Paths used are post /organizations/{organizationId}/networks, @@ -80,7 +80,7 @@ notes: """ EXAMPLES = r""" -- name: Update by id +- name: Delete by id cisco.meraki.networks: meraki_api_key: "{{meraki_api_key}}" meraki_base_url: "{{meraki_base_url}}" @@ -102,17 +102,10 @@ EXAMPLES = r""" meraki_be_geo_id: "{{meraki_be_geo_id}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: present - enrollmentString: my-enrollment-string - name: Main Office + state: absent networkId: string - notes: Additional description of the network - tags: - - tag1 - - tag2 - timeZone: America/Los_Angeles -- name: Delete by id +- name: Update by id cisco.meraki.networks: meraki_api_key: "{{meraki_api_key}}" meraki_base_url: "{{meraki_base_url}}" @@ -134,8 +127,15 @@ EXAMPLES = r""" meraki_be_geo_id: "{{meraki_be_geo_id}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: absent + state: present + enrollmentString: my-enrollment-string + name: Main Office networkId: string + notes: Additional description of the network + tags: + - tag1 + - tag2 + timeZone: America/Los_Angeles - name: Create cisco.meraki.networks: @@ -181,19 +181,19 @@ meraki_response: type: dict sample: > { + "enrollmentString": "string", "id": "string", - "organizationId": "string", + "isBoundToConfigTemplate": true, "name": "string", + "notes": "string", + "organizationId": "string", "productTypes": [ "string" ], - "timeZone": "string", "tags": [ "string" ], - "enrollmentString": "string", - "url": "string", - "notes": "string", - "isBoundToConfigTemplate": true + "timeZone": "string", + "url": "string" } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_alerts_history_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_alerts_history_info.py index 6c9df8ebd..f1fba6042 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_alerts_history_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_alerts_history_info.py @@ -98,12 +98,9 @@ meraki_response: sample: > [ { - "occurredAt": "string", - "alertTypeId": "string", + "alertData": {}, "alertType": "string", - "device": { - "serial": "string" - }, + "alertTypeId": "string", "destinations": { "email": { "sentAt": "string" @@ -118,7 +115,10 @@ meraki_response: "sentAt": "string" } }, - "alertData": {} + "device": { + "serial": "string" + }, + "occurredAt": "string" } ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_alerts_settings.py b/ansible_collections/cisco/meraki/plugins/modules/networks_alerts_settings.py index 7e317f727..b00f76840 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_alerts_settings.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_alerts_settings.py @@ -59,7 +59,7 @@ options: description: If true, then all network admins will receive emails. type: bool emails: - description: A list of emails that will recieve the alert(s). + description: A list of emails that will receive the alert(s). elements: str type: list httpServerIds: @@ -71,6 +71,18 @@ options: server configured for this network. type: bool type: dict + muting: + description: Mute alerts under certain conditions. + suboptions: + byPortSchedules: + description: Mute wireless unreachable alerts based on switch port schedules. + suboptions: + enabled: + description: If true, then wireless unreachable alerts will be muted when + caused by a port schedule. + type: bool + type: dict + type: dict networkId: description: NetworkId path parameter. Network ID. type: str diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_alerts_settings_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_alerts_settings_info.py index 07032923b..69ed2c2c2 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_alerts_settings_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_alerts_settings_info.py @@ -70,6 +70,36 @@ meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always type: dict - sample: - - {} + sample: > + { + "alerts": [ + { + "alertDestinations": { + "allAdmins": true, + "emails": [ + "string" + ], + "httpServerIds": [ + "string" + ], + "snmp": true + }, + "enabled": true, + "filters": { + "timeout": 0 + }, + "type": "string" + } + ], + "defaultDestinations": { + "allAdmins": true, + "emails": [ + "string" + ], + "httpServerIds": [ + "string" + ], + "snmp": true + } + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_connectivity_monitoring_destinations_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_connectivity_monitoring_destinations_info.py index 859b797ad..fd8a50eb0 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_connectivity_monitoring_destinations_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_connectivity_monitoring_destinations_info.py @@ -69,7 +69,14 @@ RETURN = r""" meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always - type: dict - sample: - - {} + type: list + elements: dict + sample: > + [ + { + "default": true, + "description": "string", + "ip": "string" + } + ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_content_filtering_categories_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_content_filtering_categories_info.py index 845329185..6f91d2a13 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_content_filtering_categories_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_content_filtering_categories_info.py @@ -69,7 +69,13 @@ RETURN = r""" meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always - type: dict - sample: - - {} + type: list + elements: dict + sample: > + [ + { + "id": "string", + "name": "string" + } + ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_content_filtering_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_content_filtering_info.py index d63f8b86f..7c3ac5109 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_content_filtering_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_content_filtering_info.py @@ -70,6 +70,20 @@ meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always type: dict - sample: - - {} + sample: > + { + "allowedUrlPatterns": [ + "string" + ], + "blockedUrlCategories": [ + { + "id": "string", + "name": "string" + } + ], + "blockedUrlPatterns": [ + "string" + ], + "urlCategoryListSize": "string" + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_firewall_cellular_firewall_rules_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_firewall_cellular_firewall_rules_info.py index 1c2da7010..092140ef2 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_firewall_cellular_firewall_rules_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_firewall_cellular_firewall_rules_info.py @@ -69,7 +69,19 @@ RETURN = r""" meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always - type: dict - sample: - - {} + type: list + elements: dict + sample: > + [ + { + "comment": "string", + "destCidr": "string", + "destPort": "string", + "policy": "string", + "protocol": "string", + "srcCidr": "string", + "srcPort": "string", + "syslogEnabled": true + } + ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_firewall_firewalled_services.py b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_firewall_firewalled_services.py index 173b7f42a..3707507c3 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_firewall_firewalled_services.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_firewall_firewalled_services.py @@ -85,5 +85,11 @@ meraki_response: returned: always type: dict sample: > - {} + { + "access": "string", + "allowedIps": [ + "string" + ], + "service": "string" + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_firewall_firewalled_services_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_firewall_firewalled_services_info.py index e432299d4..bcd806d71 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_firewall_firewalled_services_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_firewall_firewalled_services_info.py @@ -75,6 +75,12 @@ meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always type: dict - sample: - - {} + sample: > + { + "access": "string", + "allowedIps": [ + "string" + ], + "service": "string" + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_firewall_inbound_firewall_rules.py b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_firewall_inbound_firewall_rules.py index dcfc8ad1a..8002caf5b 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_firewall_inbound_firewall_rules.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_firewall_inbound_firewall_rules.py @@ -107,6 +107,7 @@ EXAMPLES = r""" srcCidr: Any srcPort: Any syslogEnabled: false + syslogDefaultRule: true """ RETURN = r""" @@ -115,5 +116,19 @@ meraki_response: returned: always type: dict sample: > - {} + { + "rules": [ + { + "comment": "string", + "destCidr": "string", + "destPort": "string", + "policy": "string", + "protocol": "string", + "srcCidr": "string", + "srcPort": "string", + "syslogEnabled": true + } + ], + "syslogDefaultRule": true + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_firewall_inbound_firewall_rules_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_firewall_inbound_firewall_rules_info.py index f08a8082d..66fcfe80a 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_firewall_inbound_firewall_rules_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_firewall_inbound_firewall_rules_info.py @@ -70,6 +70,20 @@ meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always type: dict - sample: - - {} + sample: > + { + "rules": [ + { + "comment": "string", + "destCidr": "string", + "destPort": "string", + "policy": "string", + "protocol": "string", + "srcCidr": "string", + "srcPort": "string", + "syslogEnabled": true + } + ], + "syslogDefaultRule": true + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_firewall_l3_firewall_rules_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_firewall_l3_firewall_rules_info.py index de1148922..961c86455 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_firewall_l3_firewall_rules_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_firewall_l3_firewall_rules_info.py @@ -69,7 +69,19 @@ RETURN = r""" meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always - type: dict - sample: - - {} + type: list + elements: dict + sample: > + [ + { + "comment": "string", + "destCidr": "string", + "destPort": "string", + "policy": "string", + "protocol": "string", + "srcCidr": "string", + "srcPort": "string", + "syslogEnabled": true + } + ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_firewall_l7_firewall_rules_application_categories_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_firewall_l7_firewall_rules_application_categories_info.py index 5ff02017d..5fe611e5c 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_firewall_l7_firewall_rules_application_categories_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_firewall_l7_firewall_rules_application_categories_info.py @@ -69,7 +69,19 @@ RETURN = r""" meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always - type: dict - sample: - - {} + type: list + elements: dict + sample: > + [ + { + "applications": [ + { + "id": "string", + "name": "string" + } + ], + "id": "string", + "name": "string" + } + ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_firewall_l7_firewall_rules_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_firewall_l7_firewall_rules_info.py index eeb013d18..dcc39ca0d 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_firewall_l7_firewall_rules_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_firewall_l7_firewall_rules_info.py @@ -69,7 +69,14 @@ RETURN = r""" meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always - type: dict - sample: - - {} + type: list + elements: dict + sample: > + [ + { + "policy": "string", + "type": "string", + "value": "string" + } + ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_firewall_one_to_many_nat_rules_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_firewall_one_to_many_nat_rules_info.py index 9c2dc9618..0f9772c5b 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_firewall_one_to_many_nat_rules_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_firewall_one_to_many_nat_rules_info.py @@ -69,7 +69,25 @@ RETURN = r""" meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always - type: dict - sample: - - {} + type: list + elements: dict + sample: > + [ + { + "portRules": [ + { + "allowedIps": [ + "string" + ], + "localIp": "string", + "localPort": "string", + "name": "string", + "protocol": "string", + "publicPort": "string" + } + ], + "publicIp": "string", + "uplink": "string" + } + ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_firewall_one_to_one_nat_rules_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_firewall_one_to_one_nat_rules_info.py index c27fdfe0a..d5ec00afe 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_firewall_one_to_one_nat_rules_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_firewall_one_to_one_nat_rules_info.py @@ -69,7 +69,26 @@ RETURN = r""" meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always - type: dict - sample: - - {} + type: list + elements: dict + sample: > + [ + { + "allowedInbound": [ + { + "allowedIps": [ + "string" + ], + "destinationPorts": [ + "string" + ], + "protocol": "string" + } + ], + "lanIp": "string", + "name": "string", + "publicIp": "string", + "uplink": "string" + } + ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_firewall_port_forwarding_rules_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_firewall_port_forwarding_rules_info.py index df2070a01..fdbbdb318 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_firewall_port_forwarding_rules_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_firewall_port_forwarding_rules_info.py @@ -69,7 +69,20 @@ RETURN = r""" meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always - type: dict - sample: - - {} + type: list + elements: dict + sample: > + [ + { + "allowedIps": [ + "string" + ], + "lanIp": "string", + "localPort": "string", + "name": "string", + "protocol": "string", + "publicPort": "string", + "uplink": "string" + } + ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_firewall_settings_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_firewall_settings_info.py index f0c04a984..fdd74c905 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_firewall_settings_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_firewall_settings_info.py @@ -70,6 +70,10 @@ meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always type: dict - sample: - - {} + sample: > + { + "ipSourceGuard": { + "mode": "string" + } + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_ports.py b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_ports.py index f1f4acf6e..2701431f3 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_ports.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_ports.py @@ -102,12 +102,12 @@ meraki_response: type: dict sample: > { - "number": 0, + "accessPolicy": "string", + "allowedVlans": "string", + "dropUntaggedTraffic": true, "enabled": true, + "number": 0, "type": "string", - "dropUntaggedTraffic": true, - "vlan": 0, - "allowedVlans": "string", - "accessPolicy": "string" + "vlan": 0 } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_ports_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_ports_info.py index edbf8b584..3fbe13138 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_ports_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_ports_info.py @@ -109,12 +109,12 @@ meraki_response: type: dict sample: > { - "number": 0, + "accessPolicy": "string", + "allowedVlans": "string", + "dropUntaggedTraffic": true, "enabled": true, + "number": 0, "type": "string", - "dropUntaggedTraffic": true, - "vlan": 0, - "allowedVlans": "string", - "accessPolicy": "string" + "vlan": 0 } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_prefixes_delegated_statics.py b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_prefixes_delegated_statics.py index 0af536fa5..503495828 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_prefixes_delegated_statics.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_prefixes_delegated_statics.py @@ -98,7 +98,7 @@ EXAMPLES = r""" type: internet prefix: 2001:db8:3c4d:15::/64 -- name: Update by id +- name: Delete by id cisco.meraki.networks_appliance_prefixes_delegated_statics: meraki_api_key: "{{meraki_api_key}}" meraki_base_url: "{{meraki_base_url}}" @@ -120,17 +120,11 @@ EXAMPLES = r""" meraki_be_geo_id: "{{meraki_be_geo_id}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: present - description: Prefix on WAN 1 of Long Island Office network + state: absent networkId: string - origin: - interfaces: - - wan1 - type: internet - prefix: 2001:db8:3c4d:15::/64 staticDelegatedPrefixId: string -- name: Delete by id +- name: Update by id cisco.meraki.networks_appliance_prefixes_delegated_statics: meraki_api_key: "{{meraki_api_key}}" meraki_base_url: "{{meraki_base_url}}" @@ -152,8 +146,14 @@ EXAMPLES = r""" meraki_be_geo_id: "{{meraki_be_geo_id}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: absent + state: present + description: Prefix on WAN 1 of Long Island Office network networkId: string + origin: + interfaces: + - wan1 + type: internet + prefix: 2001:db8:3c4d:15::/64 staticDelegatedPrefixId: string """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_prefixes_delegated_statics_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_prefixes_delegated_statics_info.py index bf28378fc..829708d54 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_prefixes_delegated_statics_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_prefixes_delegated_statics_info.py @@ -109,16 +109,16 @@ meraki_response: type: dict sample: > { - "staticDelegatedPrefixId": "string", - "prefix": "string", + "createdAt": "string", + "description": "string", "origin": { - "type": "string", "interfaces": [ "string" - ] + ], + "type": "string" }, - "description": "string", - "createdAt": "string", + "prefix": "string", + "staticDelegatedPrefixId": "string", "updatedAt": "string" } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_rf_profiles.py b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_rf_profiles.py new file mode 100644 index 000000000..52178c6e6 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_rf_profiles.py @@ -0,0 +1,199 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: networks_appliance_rf_profiles +short_description: Resource module for networks _appliance _rfprofiles +description: +- Manage operations create, update and delete of the resource networks _appliance _rfprofiles. +- Creates new RF profile for this network. +version_added: '2.18.0' +extends_documentation_fragment: + - cisco.meraki.module +author: Francisco Munoz (@fmunoz) +options: + fiveGhzSettings: + description: Settings related to 5Ghz band. + suboptions: + axEnabled: + description: Determines whether ax radio on 5Ghz band is on or off. Can be either + true or false. If false, we highly recommend disabling band steering. Defaults + to true. + type: bool + minBitrate: + description: Sets min bitrate (Mbps) of 5Ghz band. Can be one of '6', '9', '12', + '18', '24', '36', '48' or '54'. Defaults to 12. + type: int + type: dict + name: + description: The name of the new profile. Must be unique. This param is required + on creation. + type: str + networkId: + description: NetworkId path parameter. Network ID. + type: str + perSsidSettings: + description: Per-SSID radio settings by number. + suboptions: + '1': + description: Settings for SSID 1. + suboptions: + bandOperationMode: + description: Choice between 'dual', '2.4ghz', '5ghz', '6ghz' or 'multi'. + type: str + bandSteeringEnabled: + description: Steers client to most open band between 2.4 GHz and 5 GHz. + Can be either true or false. + type: bool + type: dict + '2': + description: Settings for SSID 2. + suboptions: + bandOperationMode: + description: Choice between 'dual', '2.4ghz', '5ghz', '6ghz' or 'multi'. + type: str + bandSteeringEnabled: + description: Steers client to most open band between 2.4 GHz and 5 GHz. + Can be either true or false. + type: bool + type: dict + '3': + description: Settings for SSID 3. + suboptions: + bandOperationMode: + description: Choice between 'dual', '2.4ghz', '5ghz', '6ghz' or 'multi'. + type: str + bandSteeringEnabled: + description: Steers client to most open band between 2.4 GHz and 5 GHz. + Can be either true or false. + type: bool + type: dict + '4': + description: Settings for SSID 4. + suboptions: + bandOperationMode: + description: Choice between 'dual', '2.4ghz', '5ghz', '6ghz' or 'multi'. + type: str + bandSteeringEnabled: + description: Steers client to most open band between 2.4 GHz and 5 GHz. + Can be either true or false. + type: bool + type: dict + type: dict + twoFourGhzSettings: + description: Settings related to 2.4Ghz band. + suboptions: + axEnabled: + description: Determines whether ax radio on 2.4Ghz band is on or off. Can be + either true or false. If false, we highly recommend disabling band steering. + Defaults to true. + type: bool + minBitrate: + description: Sets min bitrate (Mbps) of 2.4Ghz band. Can be one of '1', '2', + '5.5', '6', '9', '11', '12', '18', '24', '36', '48' or '54'. Defaults to 11. + type: float + type: dict +requirements: +- meraki >= 2.4.9 +- python >= 3.5 +seealso: +- name: Cisco Meraki documentation for appliance createNetworkApplianceRfProfile + description: Complete reference of the createNetworkApplianceRfProfile API. + link: https://developer.cisco.com/meraki/api-v1/#!create-network-appliance-rf-profile +notes: + - SDK Method used are + appliance.Appliance.create_network_appliance_rf_profile, + + - Paths used are + post /networks/{networkId}/appliance/rfProfiles, +""" + +EXAMPLES = r""" +- name: Create + cisco.meraki.networks_appliance_rf_profiles: + meraki_api_key: "{{meraki_api_key}}" + meraki_base_url: "{{meraki_base_url}}" + meraki_single_request_timeout: "{{meraki_single_request_timeout}}" + meraki_certificate_path: "{{meraki_certificate_path}}" + meraki_requests_proxy: "{{meraki_requests_proxy}}" + meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" + meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" + meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" + meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" + meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" + meraki_maximum_retries: "{{meraki_maximum_retries}}" + meraki_output_log: "{{meraki_output_log}}" + meraki_log_file_prefix: "{{meraki_log_file_prefix}}" + meraki_log_path: "{{meraki_log_path}}" + meraki_print_console: "{{meraki_print_console}}" + meraki_suppress_logging: "{{meraki_suppress_logging}}" + meraki_simulate: "{{meraki_simulate}}" + meraki_be_geo_id: "{{meraki_be_geo_id}}" + meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" + meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" + state: present + fiveGhzSettings: + axEnabled: true + minBitrate: 48 + name: MX RF Profile + networkId: string + perSsidSettings: + '1': + bandOperationMode: dual + bandSteeringEnabled: true + '2': + bandOperationMode: dual + bandSteeringEnabled: true + '3': + bandOperationMode: dual + bandSteeringEnabled: true + '4': + bandOperationMode: dual + bandSteeringEnabled: true + twoFourGhzSettings: + axEnabled: true + minBitrate: 12.0 + +""" +RETURN = r""" +meraki_response: + description: A dictionary or list with the response returned by the Cisco Meraki Python SDK + returned: always + type: dict + sample: > + { + "fiveGhzSettings": { + "axEnabled": true, + "minBitrate": 0 + }, + "id": "string", + "name": "string", + "networkId": "string", + "perSsidSettings": { + "1": { + "bandOperationMode": "string", + "bandSteeringEnabled": true + }, + "2": { + "bandOperationMode": "string", + "bandSteeringEnabled": true + }, + "3": { + "bandOperationMode": "string", + "bandSteeringEnabled": true + }, + "4": { + "bandOperationMode": "string", + "bandSteeringEnabled": true + } + }, + "twoFourGhzSettings": { + "axEnabled": true, + "minBitrate": 0 + } + } +""" diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_rf_profiles_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_rf_profiles_info.py new file mode 100644 index 000000000..8826509f0 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_rf_profiles_info.py @@ -0,0 +1,108 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: networks_appliance_rf_profiles_info +short_description: Information module for networks _appliance _rfprofiles +description: +- Get all networks _appliance _rfprofiles. +- List the RF profiles for this network. +version_added: '2.18.0' +extends_documentation_fragment: + - cisco.meraki.module_info +author: Francisco Munoz (@fmunoz) +options: + headers: + description: Additional headers. + type: dict + networkId: + description: + - NetworkId path parameter. Network ID. + type: str +requirements: +- meraki >= 2.4.9 +- python >= 3.5 +seealso: +- name: Cisco Meraki documentation for appliance getNetworkApplianceRfProfiles + description: Complete reference of the getNetworkApplianceRfProfiles API. + link: https://developer.cisco.com/meraki/api-v1/#!get-network-appliance-rf-profiles +notes: + - SDK Method used are + appliance.Appliance.get_network_appliance_rf_profiles, + + - Paths used are + get /networks/{networkId}/appliance/rfProfiles, +""" + +EXAMPLES = r""" +- name: Get all networks _appliance _rfprofiles + cisco.meraki.networks_appliance_rf_profiles_info: + meraki_api_key: "{{meraki_api_key}}" + meraki_base_url: "{{meraki_base_url}}" + meraki_single_request_timeout: "{{meraki_single_request_timeout}}" + meraki_certificate_path: "{{meraki_certificate_path}}" + meraki_requests_proxy: "{{meraki_requests_proxy}}" + meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" + meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" + meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" + meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" + meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" + meraki_maximum_retries: "{{meraki_maximum_retries}}" + meraki_output_log: "{{meraki_output_log}}" + meraki_log_file_prefix: "{{meraki_log_file_prefix}}" + meraki_log_path: "{{meraki_log_path}}" + meraki_print_console: "{{meraki_print_console}}" + meraki_suppress_logging: "{{meraki_suppress_logging}}" + meraki_simulate: "{{meraki_simulate}}" + meraki_be_geo_id: "{{meraki_be_geo_id}}" + meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" + meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" + networkId: string + register: result + +""" +RETURN = r""" +meraki_response: + description: A dictionary or list with the response returned by the Cisco Meraki Python SDK + returned: always + type: list + elements: dict + sample: > + [ + { + "fiveGhzSettings": { + "axEnabled": true, + "minBitrate": 0 + }, + "id": "string", + "name": "string", + "networkId": "string", + "perSsidSettings": { + "1": { + "bandOperationMode": "string", + "bandSteeringEnabled": true + }, + "2": { + "bandOperationMode": "string", + "bandSteeringEnabled": true + }, + "3": { + "bandOperationMode": "string", + "bandSteeringEnabled": true + }, + "4": { + "bandOperationMode": "string", + "bandSteeringEnabled": true + } + }, + "twoFourGhzSettings": { + "axEnabled": true, + "minBitrate": 0 + } + } + ] +""" diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_security_intrusion.py b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_security_intrusion.py index 1dc684761..7c3b4aa6f 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_security_intrusion.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_security_intrusion.py @@ -108,5 +108,17 @@ meraki_response: returned: always type: dict sample: > - {} + { + "idsRulesets": "string", + "mode": "string", + "protectedNetworks": { + "excludedCidr": [ + "string" + ], + "includedCidr": [ + "string" + ], + "useDefault": true + } + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_security_intrusion_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_security_intrusion_info.py index 9ff5173ff..b08270d2a 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_security_intrusion_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_security_intrusion_info.py @@ -70,6 +70,18 @@ meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always type: dict - sample: - - {} + sample: > + { + "idsRulesets": "string", + "mode": "string", + "protectedNetworks": { + "excludedCidr": [ + "string" + ], + "includedCidr": [ + "string" + ], + "useDefault": true + } + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_security_malware.py b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_security_malware.py index 50344af2c..90247f131 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_security_malware.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_security_malware.py @@ -91,8 +91,6 @@ EXAMPLES = r""" - comment: allow ZIP file sha256: e82c5f7d75004727e1f3b94426b9a11c8bc4c312a9170ac9a73abace40aef503 allowedUrls: - - comment: allow example.org - url: example.org - comment: allow help.com.au url: help.com.au mode: enabled @@ -105,5 +103,19 @@ meraki_response: returned: always type: dict sample: > - {} + { + "allowedFiles": [ + { + "comment": "string", + "sha256": "string" + } + ], + "allowedUrls": [ + { + "comment": "string", + "url": "string" + } + ], + "mode": "string" + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_security_malware_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_security_malware_info.py index f3bd19640..272bbcd85 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_security_malware_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_security_malware_info.py @@ -70,6 +70,20 @@ meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always type: dict - sample: - - {} + sample: > + { + "allowedFiles": [ + { + "comment": "string", + "sha256": "string" + } + ], + "allowedUrls": [ + { + "comment": "string", + "url": "string" + } + ], + "mode": "string" + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_single_lan.py b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_single_lan.py index 993f07768..ae5ab8e48 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_single_lan.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_single_lan.py @@ -129,26 +129,26 @@ meraki_response: type: dict sample: > { - "subnet": "string", "applianceIp": "string", - "mandatoryDhcp": { - "enabled": true - }, "ipv6": { "enabled": true, "prefixAssignments": [ { "autonomous": true, - "staticPrefix": "string", - "staticApplianceIp6": "string", "origin": { - "type": "string", "interfaces": [ "string" - ] - } + ], + "type": "string" + }, + "staticApplianceIp6": "string", + "staticPrefix": "string" } ] - } + }, + "mandatoryDhcp": { + "enabled": true + }, + "subnet": "string" } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_single_lan_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_single_lan_info.py index a6261b106..7582d6147 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_single_lan_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_single_lan_info.py @@ -72,26 +72,26 @@ meraki_response: type: dict sample: > { - "subnet": "string", "applianceIp": "string", - "mandatoryDhcp": { - "enabled": true - }, "ipv6": { "enabled": true, "prefixAssignments": [ { "autonomous": true, - "staticPrefix": "string", - "staticApplianceIp6": "string", "origin": { - "type": "string", "interfaces": [ "string" - ] - } + ], + "type": "string" + }, + "staticApplianceIp6": "string", + "staticPrefix": "string" } ] - } + }, + "mandatoryDhcp": { + "enabled": true + }, + "subnet": "string" } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_ssids.py b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_ssids.py index 5e9273f81..26aa0602d 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_ssids.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_ssids.py @@ -33,6 +33,16 @@ options: description: Enable DCHP Enforced Deauthentication on the SSID. type: bool type: dict + dot11w: + description: The current setting for Protected Management Frames (802.11w). + suboptions: + enabled: + description: Whether 802.11w is enabled or not. + type: bool + required: + description: (Optional) Whether 802.11w is required or not. + type: bool + type: dict enabled: description: Whether or not the SSID is enabled. type: bool @@ -120,6 +130,9 @@ EXAMPLES = r""" defaultVlanId: 1 dhcpEnforcedDeauthentication: enabled: true + dot11w: + enabled: true + required: true enabled: true encryptionMode: wpa name: My SSID @@ -141,19 +154,19 @@ meraki_response: type: dict sample: > { - "number": 0, - "name": "string", - "enabled": true, - "defaultVlanId": 0, "authMode": "string", + "defaultVlanId": 0, + "enabled": true, + "encryptionMode": "string", + "name": "string", + "number": 0, "radiusServers": [ { "host": "string", "port": 0 } ], - "encryptionMode": "string", - "wpaEncryptionMode": "string", - "visible": true + "visible": true, + "wpaEncryptionMode": "string" } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_ssids_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_ssids_info.py index 912d5d1fb..86d6d7307 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_ssids_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_ssids_info.py @@ -109,19 +109,19 @@ meraki_response: type: dict sample: > { - "number": 0, - "name": "string", - "enabled": true, - "defaultVlanId": 0, "authMode": "string", + "defaultVlanId": 0, + "enabled": true, + "encryptionMode": "string", + "name": "string", + "number": 0, "radiusServers": [ { "host": "string", "port": 0 } ], - "encryptionMode": "string", - "wpaEncryptionMode": "string", - "visible": true + "visible": true, + "wpaEncryptionMode": "string" } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_traffic_shaping_custom_performance_classes.py b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_traffic_shaping_custom_performance_classes.py index a1913416a..63324ba6c 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_traffic_shaping_custom_performance_classes.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_traffic_shaping_custom_performance_classes.py @@ -82,5 +82,11 @@ meraki_response: returned: always type: dict sample: > - {} + { + "customPerformanceClassId": "string", + "maxJitter": 0, + "maxLatency": 0, + "maxLossPercentage": 0, + "name": "string" + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_traffic_shaping_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_traffic_shaping_info.py index ff936ddae..e929508ae 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_traffic_shaping_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_traffic_shaping_info.py @@ -70,6 +70,9 @@ meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always type: dict - sample: - - {} + sample: > + { + "limitDown": 0, + "limitUp": 0 + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_traffic_shaping_rules_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_traffic_shaping_rules_info.py index c691a5aba..4bb9e3826 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_traffic_shaping_rules_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_traffic_shaping_rules_info.py @@ -70,6 +70,27 @@ meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always type: dict - sample: - - {} + sample: > + { + "defaultRulesEnabled": true, + "rules": [ + { + "definitions": [ + { + "type": "string", + "value": "string" + } + ], + "dscpTagValue": 0, + "perClientBandwidthLimits": { + "bandwidthLimits": { + "limitDown": 0, + "limitUp": 0 + }, + "settings": "string" + }, + "priority": "string" + } + ] + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_traffic_shaping_uplink_bandwidth.py b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_traffic_shaping_uplink_bandwidth.py index 6a516b4a0..685dcd409 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_traffic_shaping_uplink_bandwidth.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_traffic_shaping_uplink_bandwidth.py @@ -101,8 +101,8 @@ EXAMPLES = r""" state: present bandwidthLimits: cellular: - limitDown: 51200 - limitUp: 51200 + limitDown: 1000000 + limitUp: 1000000 wan1: limitDown: 1000000 limitUp: 1000000 diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_traffic_shaping_uplink_bandwidth_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_traffic_shaping_uplink_bandwidth_info.py index 6d79cb2b2..088766c6f 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_traffic_shaping_uplink_bandwidth_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_traffic_shaping_uplink_bandwidth_info.py @@ -75,17 +75,17 @@ meraki_response: type: dict sample: > { + "cellular": { + "limitDown": 0, + "limitUp": 0 + }, "wan1": { - "limitUp": 0, - "limitDown": 0 + "limitDown": 0, + "limitUp": 0 }, "wan2": { - "limitUp": 0, - "limitDown": 0 - }, - "cellular": { - "limitUp": 0, - "limitDown": 0 + "limitDown": 0, + "limitUp": 0 } } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_traffic_shaping_uplink_selection.py b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_traffic_shaping_uplink_selection.py index 1c89f8150..627405c95 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_traffic_shaping_uplink_selection.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_traffic_shaping_uplink_selection.py @@ -301,68 +301,68 @@ meraki_response: { "activeActiveAutoVpnEnabled": true, "defaultUplink": "string", - "loadBalancingEnabled": true, "failoverAndFailback": { "immediate": { "enabled": true } }, - "wanTrafficUplinkPreferences": [ + "loadBalancingEnabled": true, + "vpnTrafficUplinkPreferences": [ { + "failOverCriterion": "string", + "performanceClass": { + "builtinPerformanceClassName": "string", + "customPerformanceClassId": "string", + "type": "string" + }, + "preferredUplink": "string", "trafficFilters": [ { "type": "string", "value": { + "destination": { + "cidr": "string", + "fqdn": "string", + "host": 0, + "network": "string", + "port": "string", + "vlan": 0 + }, + "id": "string", "protocol": "string", "source": { - "port": "string", "cidr": "string", - "vlan": 0, - "host": 0 - }, - "destination": { + "host": 0, + "network": "string", "port": "string", - "cidr": "string" + "vlan": 0 } } } - ], - "preferredUplink": "string" + ] } ], - "vpnTrafficUplinkPreferences": [ + "wanTrafficUplinkPreferences": [ { + "preferredUplink": "string", "trafficFilters": [ { "type": "string", "value": { - "id": "string", - "protocol": "string", - "source": { - "port": "string", + "destination": { "cidr": "string", - "network": "string", - "vlan": 0, - "host": 0 + "port": "string" }, - "destination": { - "port": "string", + "protocol": "string", + "source": { "cidr": "string", - "network": "string", - "vlan": 0, "host": 0, - "fqdn": "string" + "port": "string", + "vlan": 0 } } } - ], - "preferredUplink": "string", - "failOverCriterion": "string", - "performanceClass": { - "type": "string", - "builtinPerformanceClassName": "string", - "customPerformanceClassId": "string" - } + ] } ] } diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_traffic_shaping_uplink_selection_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_traffic_shaping_uplink_selection_info.py index 5041d31b4..7194ca460 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_traffic_shaping_uplink_selection_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_traffic_shaping_uplink_selection_info.py @@ -74,68 +74,68 @@ meraki_response: { "activeActiveAutoVpnEnabled": true, "defaultUplink": "string", - "loadBalancingEnabled": true, "failoverAndFailback": { "immediate": { "enabled": true } }, - "wanTrafficUplinkPreferences": [ + "loadBalancingEnabled": true, + "vpnTrafficUplinkPreferences": [ { + "failOverCriterion": "string", + "performanceClass": { + "builtinPerformanceClassName": "string", + "customPerformanceClassId": "string", + "type": "string" + }, + "preferredUplink": "string", "trafficFilters": [ { "type": "string", "value": { + "destination": { + "cidr": "string", + "fqdn": "string", + "host": 0, + "network": "string", + "port": "string", + "vlan": 0 + }, + "id": "string", "protocol": "string", "source": { - "port": "string", "cidr": "string", - "vlan": 0, - "host": 0 - }, - "destination": { + "host": 0, + "network": "string", "port": "string", - "cidr": "string" + "vlan": 0 } } } - ], - "preferredUplink": "string" + ] } ], - "vpnTrafficUplinkPreferences": [ + "wanTrafficUplinkPreferences": [ { + "preferredUplink": "string", "trafficFilters": [ { "type": "string", "value": { - "id": "string", - "protocol": "string", - "source": { - "port": "string", + "destination": { "cidr": "string", - "network": "string", - "vlan": 0, - "host": 0 + "port": "string" }, - "destination": { - "port": "string", + "protocol": "string", + "source": { "cidr": "string", - "network": "string", - "vlan": 0, "host": 0, - "fqdn": "string" + "port": "string", + "vlan": 0 } } } - ], - "preferredUplink": "string", - "failOverCriterion": "string", - "performanceClass": { - "type": "string", - "builtinPerformanceClassName": "string", - "customPerformanceClassId": "string" - } + ] } ] } diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_traffic_shaping_vpn_exclusions.py b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_traffic_shaping_vpn_exclusions.py new file mode 100644 index 000000000..cc338979b --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_traffic_shaping_vpn_exclusions.py @@ -0,0 +1,119 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: networks_appliance_traffic_shaping_vpn_exclusions +short_description: Resource module for networks _appliance _trafficshaping _vpnexclusions +description: +- Manage operation update of the resource networks _appliance _trafficshaping _vpnexclusions. +- Update VPN exclusion rules for an MX network. +version_added: '2.18.0' +extends_documentation_fragment: + - cisco.meraki.module +author: Francisco Munoz (@fmunoz) +options: + custom: + description: Custom VPN exclusion rules. Pass an empty array to clear existing rules. + elements: dict + suboptions: + destination: + description: Destination address; hostname required for DNS, IPv4 otherwise. + type: str + port: + description: Destination port. + type: str + protocol: + description: Protocol. + type: str + type: list + majorApplications: + description: Major Application based VPN exclusion rules. Pass an empty array to + clear existing rules. + elements: dict + suboptions: + id: + description: Application's Meraki ID. + type: str + name: + description: Application's name. + type: str + type: list + networkId: + description: NetworkId path parameter. Network ID. + type: str +requirements: +- meraki >= 2.4.9 +- python >= 3.5 +seealso: +- name: Cisco Meraki documentation for appliance updateNetworkApplianceTrafficShapingVpnExclusions + description: Complete reference of the updateNetworkApplianceTrafficShapingVpnExclusions API. + link: https://developer.cisco.com/meraki/api-v1/#!update-network-appliance-traffic-shaping-vpn-exclusions +notes: + - SDK Method used are + appliance.Appliance.update_network_appliance_traffic_shaping_vpn_exclusions, + + - Paths used are + put /networks/{networkId}/appliance/trafficShaping/vpnExclusions, +""" + +EXAMPLES = r""" +- name: Update all + cisco.meraki.networks_appliance_traffic_shaping_vpn_exclusions: + meraki_api_key: "{{meraki_api_key}}" + meraki_base_url: "{{meraki_base_url}}" + meraki_single_request_timeout: "{{meraki_single_request_timeout}}" + meraki_certificate_path: "{{meraki_certificate_path}}" + meraki_requests_proxy: "{{meraki_requests_proxy}}" + meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" + meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" + meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" + meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" + meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" + meraki_maximum_retries: "{{meraki_maximum_retries}}" + meraki_output_log: "{{meraki_output_log}}" + meraki_log_file_prefix: "{{meraki_log_file_prefix}}" + meraki_log_path: "{{meraki_log_path}}" + meraki_print_console: "{{meraki_print_console}}" + meraki_suppress_logging: "{{meraki_suppress_logging}}" + meraki_simulate: "{{meraki_simulate}}" + meraki_be_geo_id: "{{meraki_be_geo_id}}" + meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" + meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" + custom: + - destination: 192.168.3.0/24 + port: '8000' + protocol: tcp + majorApplications: + - id: meraki:vpnExclusion/application/2 + name: Office 365 Sharepoint + networkId: string + +""" +RETURN = r""" +meraki_response: + description: A dictionary or list with the response returned by the Cisco Meraki Python SDK + returned: always + type: dict + sample: > + { + "custom": [ + { + "destination": "string", + "port": "string", + "protocol": "string" + } + ], + "majorApplications": [ + { + "id": "string", + "name": "string" + } + ], + "networkId": "string", + "networkName": "string" + } +""" diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_vlans.py b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_vlans.py index 1f7c9cf27..0e0212dbd 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_vlans.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_vlans.py @@ -230,6 +230,32 @@ EXAMPLES = r""" subnet: 192.168.1.0/24 templateVlanType: same +- name: Delete by id + cisco.meraki.networks_appliance_vlans: + meraki_api_key: "{{meraki_api_key}}" + meraki_base_url: "{{meraki_base_url}}" + meraki_single_request_timeout: "{{meraki_single_request_timeout}}" + meraki_certificate_path: "{{meraki_certificate_path}}" + meraki_requests_proxy: "{{meraki_requests_proxy}}" + meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" + meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" + meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" + meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" + meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" + meraki_maximum_retries: "{{meraki_maximum_retries}}" + meraki_output_log: "{{meraki_output_log}}" + meraki_log_file_prefix: "{{meraki_log_file_prefix}}" + meraki_log_path: "{{meraki_log_path}}" + meraki_print_console: "{{meraki_print_console}}" + meraki_suppress_logging: "{{meraki_suppress_logging}}" + meraki_simulate: "{{meraki_simulate}}" + meraki_be_geo_id: "{{meraki_be_geo_id}}" + meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" + meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" + state: absent + networkId: string + vlanId: string + - name: Update by id cisco.meraki.networks_appliance_vlans: meraki_api_key: "{{meraki_api_key}}" @@ -298,32 +324,6 @@ EXAMPLES = r""" vlanId: string vpnNatSubnet: 192.168.1.0/24 -- name: Delete by id - cisco.meraki.networks_appliance_vlans: - meraki_api_key: "{{meraki_api_key}}" - meraki_base_url: "{{meraki_base_url}}" - meraki_single_request_timeout: "{{meraki_single_request_timeout}}" - meraki_certificate_path: "{{meraki_certificate_path}}" - meraki_requests_proxy: "{{meraki_requests_proxy}}" - meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" - meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" - meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" - meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" - meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" - meraki_maximum_retries: "{{meraki_maximum_retries}}" - meraki_output_log: "{{meraki_output_log}}" - meraki_log_file_prefix: "{{meraki_log_file_prefix}}" - meraki_log_path: "{{meraki_log_path}}" - meraki_print_console: "{{meraki_print_console}}" - meraki_suppress_logging: "{{meraki_suppress_logging}}" - meraki_simulate: "{{meraki_simulate}}" - meraki_be_geo_id: "{{meraki_be_geo_id}}" - meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" - meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: absent - networkId: string - vlanId: string - """ RETURN = r""" meraki_response: @@ -332,33 +332,33 @@ meraki_response: type: dict sample: > { - "id": "string", - "interfaceId": "string", - "name": "string", - "subnet": "string", "applianceIp": "string", - "groupPolicyId": "string", - "templateVlanType": "string", "cidr": "string", - "mask": 0, - "mandatoryDhcp": { - "enabled": true - }, + "groupPolicyId": "string", + "id": "string", + "interfaceId": "string", "ipv6": { "enabled": true, "prefixAssignments": [ { "autonomous": true, - "staticPrefix": "string", - "staticApplianceIp6": "string", "origin": { - "type": "string", "interfaces": [ "string" - ] - } + ], + "type": "string" + }, + "staticApplianceIp6": "string", + "staticPrefix": "string" } ] - } + }, + "mandatoryDhcp": { + "enabled": true + }, + "mask": 0, + "name": "string", + "subnet": "string", + "templateVlanType": "string" } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_vlans_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_vlans_info.py index 015566a3c..6274223e3 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_vlans_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_vlans_info.py @@ -109,32 +109,13 @@ meraki_response: type: dict sample: > { - "id": "string", - "interfaceId": "string", - "name": "string", - "subnet": "string", "applianceIp": "string", - "groupPolicyId": "string", - "templateVlanType": "string", "cidr": "string", - "mask": 0, - "dhcpRelayServerIps": [ - "string" - ], + "dhcpBootFilename": "string", + "dhcpBootNextServer": "string", + "dhcpBootOptionsEnabled": true, "dhcpHandling": "string", "dhcpLeaseTime": "string", - "dhcpBootOptionsEnabled": true, - "dhcpBootNextServer": "string", - "dhcpBootFilename": "string", - "fixedIpAssignments": {}, - "reservedIpRanges": [ - { - "start": "string", - "end": "string", - "comment": "string" - } - ], - "dnsNameservers": "string", "dhcpOptions": [ { "code": "string", @@ -142,25 +123,44 @@ meraki_response: "value": "string" } ], - "vpnNatSubnet": "string", - "mandatoryDhcp": { - "enabled": true - }, + "dhcpRelayServerIps": [ + "string" + ], + "dnsNameservers": "string", + "fixedIpAssignments": {}, + "groupPolicyId": "string", + "id": "string", + "interfaceId": "string", "ipv6": { "enabled": true, "prefixAssignments": [ { "autonomous": true, - "staticPrefix": "string", - "staticApplianceIp6": "string", "origin": { - "type": "string", "interfaces": [ "string" - ] - } + ], + "type": "string" + }, + "staticApplianceIp6": "string", + "staticPrefix": "string" } ] - } + }, + "mandatoryDhcp": { + "enabled": true + }, + "mask": 0, + "name": "string", + "reservedIpRanges": [ + { + "comment": "string", + "end": "string", + "start": "string" + } + ], + "subnet": "string", + "templateVlanType": "string", + "vpnNatSubnet": "string" } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_vlans_settings.py b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_vlans_settings.py index f5bd2750f..b106cf31d 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_vlans_settings.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_vlans_settings.py @@ -72,5 +72,5 @@ meraki_response: returned: always type: dict sample: > - {} + true """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_vlans_settings_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_vlans_settings_info.py index c4afd72c2..81dc964de 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_vlans_settings_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_vlans_settings_info.py @@ -69,7 +69,7 @@ RETURN = r""" meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always - type: dict - sample: - - {} + type: int + sample: > + true """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_vpn_bgp.py b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_vpn_bgp.py index 7696f737e..16cd474e8 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_vpn_bgp.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_vpn_bgp.py @@ -29,7 +29,7 @@ options: at other Hubs or a default value if there is no ASN configured. type: bool ibgpHoldTimer: - description: The IBGP holdtimer in seconds. The IBGP holdtimer must be an integer + description: The iBGP holdtimer in seconds. The iBGP holdtimer must be an integer between 12 and 240. When absent, this field is not updated. If no value exists then it defaults to 240. type: int @@ -51,11 +51,11 @@ options: type: str type: dict ebgpHoldTimer: - description: The EBGP hold timer in seconds for each neighbor. The EBGP hold + description: The eBGP hold timer in seconds for each neighbor. The eBGP hold timer must be an integer between 12 and 240. type: int ebgpMultihop: - description: Configure this if the neighbor is not adjacent. The EBGP multi-hop + description: Configure this if the neighbor is not adjacent. The eBGP multi-hop must be an integer between 1 and 255. type: int ip: @@ -84,7 +84,7 @@ options: type: int sourceInterface: description: The output interface for peering with the remote BGP peer. Valid - values are 'wired0', 'wired1' or 'vlan{VLAN ID}'(e.g. 'vlan123'). + values are 'wan1', 'wan2' or 'vlan{VLAN ID}'(e.g. 'vlan123'). type: str ttlSecurity: description: Settings for BGP TTL security to protect BGP peering sessions from diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_vpn_bgp_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_vpn_bgp_info.py index c2dda6cd0..7bdc3af9e 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_vpn_bgp_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_vpn_bgp_info.py @@ -70,6 +70,20 @@ meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always type: dict - sample: - - {} + sample: > + { + "asNumber": 0, + "enabled": true, + "ibgpHoldTimer": 0, + "neighbors": [ + { + "allowTransit": true, + "ebgpHoldTimer": 0, + "ebgpMultihop": 0, + "ip": "string", + "receiveLimit": 0, + "remoteAsNumber": 0 + } + ] + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_vpn_site_to_site_vpn.py b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_vpn_site_to_site_vpn.py index f0f579bae..a1b725548 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_vpn_site_to_site_vpn.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_vpn_site_to_site_vpn.py @@ -102,13 +102,13 @@ meraki_response: type: dict sample: > { - "mode": "string", "hubs": [ { "hubId": "string", "useDefaultRoute": true } ], + "mode": "string", "subnets": [ { "localSubnet": "string", diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_vpn_site_to_site_vpn_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_vpn_site_to_site_vpn_info.py index 66c039cca..407338ffe 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_vpn_site_to_site_vpn_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_vpn_site_to_site_vpn_info.py @@ -72,13 +72,13 @@ meraki_response: type: dict sample: > { - "mode": "string", "hubs": [ { "hubId": "string", "useDefaultRoute": true } ], + "mode": "string", "subnets": [ { "localSubnet": "string", diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_warm_spare_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_warm_spare_info.py index dffb15b9f..9444954f5 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_warm_spare_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_appliance_warm_spare_info.py @@ -70,6 +70,19 @@ meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always type: dict - sample: - - {} + sample: > + { + "enabled": true, + "primarySerial": "string", + "spareSerial": "string", + "uplinkMode": "string", + "wan1": { + "ip": "string", + "subnet": "string" + }, + "wan2": { + "ip": "string", + "subnet": "string" + } + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_bind.py b/ansible_collections/cisco/meraki/plugins/modules/networks_bind.py index c285acd32..9a5de7451 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_bind.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_bind.py @@ -78,5 +78,21 @@ meraki_response: returned: always type: dict sample: > - {} + { + "configTemplateId": "string", + "enrollmentString": "string", + "id": "string", + "isBoundToConfigTemplate": true, + "name": "string", + "notes": "string", + "organizationId": "string", + "productTypes": [ + "string" + ], + "tags": [ + "string" + ], + "timeZone": "string", + "url": "string" + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_bluetooth_clients_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_bluetooth_clients_info.py index 4b6ffedef..7f035c2f3 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_bluetooth_clients_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_bluetooth_clients_info.py @@ -87,6 +87,20 @@ meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always type: dict - sample: - - {} + sample: > + { + "deviceName": "string", + "id": "string", + "inSightAlert": true, + "lastSeen": 0, + "mac": "string", + "manufacturer": "string", + "name": "string", + "networkId": "string", + "outOfSightAlert": true, + "seenByDeviceMac": "string", + "tags": [ + "string" + ] + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_camera_quality_retention_profiles.py b/ansible_collections/cisco/meraki/plugins/modules/networks_camera_quality_retention_profiles.py index 07d1c5567..1da5aee67 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_camera_quality_retention_profiles.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_camera_quality_retention_profiles.py @@ -92,7 +92,8 @@ options: or 'High'. type: str resolution: - description: Resolution of the camera. Can be one of '1080x1080' or '2688x1512'. + description: Resolution of the camera. Can be one of '1920x1080', '2688x1512' + or '3840x2160'. type: str type: dict MV21/MV71: @@ -126,7 +127,7 @@ options: or 'High'. type: str resolution: - description: Resolution of the camera. Can be one of '1080x1080' or '2058x2058'. + description: Resolution of the camera. Can be one of '1080x1080' or '2112x2112'. type: str type: dict MV33: @@ -137,7 +138,8 @@ options: or 'High'. type: str resolution: - description: Resolution of the camera. Can be one of '1080x1080' or '2112x2112'. + description: Resolution of the camera. Can be one of '1080x1080', '2112x2112' + or '2880x2880'. type: str type: dict MV52: @@ -251,6 +253,32 @@ EXAMPLES = r""" name: Sample quality retention profile networkId: string +- name: Delete by id + cisco.meraki.networks_camera_quality_retention_profiles: + meraki_api_key: "{{meraki_api_key}}" + meraki_base_url: "{{meraki_base_url}}" + meraki_single_request_timeout: "{{meraki_single_request_timeout}}" + meraki_certificate_path: "{{meraki_certificate_path}}" + meraki_requests_proxy: "{{meraki_requests_proxy}}" + meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" + meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" + meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" + meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" + meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" + meraki_maximum_retries: "{{meraki_maximum_retries}}" + meraki_output_log: "{{meraki_output_log}}" + meraki_log_file_prefix: "{{meraki_log_file_prefix}}" + meraki_log_path: "{{meraki_log_path}}" + meraki_print_console: "{{meraki_print_console}}" + meraki_suppress_logging: "{{meraki_suppress_logging}}" + meraki_simulate: "{{meraki_simulate}}" + meraki_be_geo_id: "{{meraki_be_geo_id}}" + meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" + meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" + state: absent + networkId: string + qualityRetentionProfileId: string + - name: Update by id cisco.meraki.networks_camera_quality_retention_profiles: meraki_api_key: "{{meraki_api_key}}" @@ -322,32 +350,6 @@ EXAMPLES = r""" quality: string resolution: string -- name: Delete by id - cisco.meraki.networks_camera_quality_retention_profiles: - meraki_api_key: "{{meraki_api_key}}" - meraki_base_url: "{{meraki_base_url}}" - meraki_single_request_timeout: "{{meraki_single_request_timeout}}" - meraki_certificate_path: "{{meraki_certificate_path}}" - meraki_requests_proxy: "{{meraki_requests_proxy}}" - meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" - meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" - meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" - meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" - meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" - meraki_maximum_retries: "{{meraki_maximum_retries}}" - meraki_output_log: "{{meraki_output_log}}" - meraki_log_file_prefix: "{{meraki_log_file_prefix}}" - meraki_log_path: "{{meraki_log_path}}" - meraki_print_console: "{{meraki_print_console}}" - meraki_suppress_logging: "{{meraki_suppress_logging}}" - meraki_simulate: "{{meraki_simulate}}" - meraki_be_geo_id: "{{meraki_be_geo_id}}" - meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" - meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: absent - networkId: string - qualityRetentionProfileId: string - """ RETURN = r""" meraki_response: diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_camera_quality_retention_profiles_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_camera_quality_retention_profiles_info.py index d6db755e8..5102000bc 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_camera_quality_retention_profiles_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_camera_quality_retention_profiles_info.py @@ -106,10 +106,36 @@ RETURN = r""" meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always - type: list - elements: dict + type: dict sample: > - [ - {} - ] + { + "audioRecordingEnabled": true, + "cloudArchiveEnabled": true, + "id": "string", + "maxRetentionDays": 0, + "motionBasedRetentionEnabled": true, + "motionDetectorVersion": 0, + "name": "string", + "networkId": "string", + "restrictedBandwidthModeEnabled": true, + "scheduleId": "string", + "videoSettings": { + "MV12/MV22/MV72": { + "quality": "string", + "resolution": "string" + }, + "MV12WE": { + "quality": "string", + "resolution": "string" + }, + "MV21/MV71": { + "quality": "string", + "resolution": "string" + }, + "MV32": { + "quality": "string", + "resolution": "string" + } + } + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_camera_wireless_profiles.py b/ansible_collections/cisco/meraki/plugins/modules/networks_camera_wireless_profiles.py index b5b602f26..dfda03766 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_camera_wireless_profiles.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_camera_wireless_profiles.py @@ -112,7 +112,7 @@ EXAMPLES = r""" encryptionMode: wpa-eap name: ssid test -- name: Update by id +- name: Delete by id cisco.meraki.networks_camera_wireless_profiles: meraki_api_key: "{{meraki_api_key}}" meraki_base_url: "{{meraki_base_url}}" @@ -134,20 +134,11 @@ EXAMPLES = r""" meraki_be_geo_id: "{{meraki_be_geo_id}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: present - identity: - password: string - username: string - name: string + state: absent networkId: string - ssid: - authMode: string - encryptionMode: string - name: string - psk: string wirelessProfileId: string -- name: Delete by id +- name: Update by id cisco.meraki.networks_camera_wireless_profiles: meraki_api_key: "{{meraki_api_key}}" meraki_base_url: "{{meraki_base_url}}" @@ -169,8 +160,17 @@ EXAMPLES = r""" meraki_be_geo_id: "{{meraki_be_geo_id}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: absent + state: present + identity: + password: string + username: string + name: string networkId: string + ssid: + authMode: string + encryptionMode: string + name: string + psk: string wirelessProfileId: string """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_camera_wireless_profiles_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_camera_wireless_profiles_info.py index 89628d32f..9e6f37ca0 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_camera_wireless_profiles_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_camera_wireless_profiles_info.py @@ -106,10 +106,20 @@ RETURN = r""" meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always - type: list - elements: dict + type: dict sample: > - [ - {} - ] + { + "appliedDeviceCount": 0, + "id": "string", + "identity": { + "password": "string", + "username": "string" + }, + "name": "string", + "ssid": { + "authMode": "string", + "encryptionMode": "string", + "name": "string" + } + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_cellular_gateway_connectivity_monitoring_destinations_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_cellular_gateway_connectivity_monitoring_destinations_info.py index 03e1d295c..49540cd21 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_cellular_gateway_connectivity_monitoring_destinations_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_cellular_gateway_connectivity_monitoring_destinations_info.py @@ -69,7 +69,14 @@ RETURN = r""" meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always - type: dict - sample: - - {} + type: list + elements: dict + sample: > + [ + { + "default": true, + "description": "string", + "ip": "string" + } + ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_cellular_gateway_dhcp.py b/ansible_collections/cisco/meraki/plugins/modules/networks_cellular_gateway_dhcp.py index a2ee4ddc7..a67358a21 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_cellular_gateway_dhcp.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_cellular_gateway_dhcp.py @@ -87,9 +87,9 @@ meraki_response: sample: > { "dhcpLeaseTime": "string", - "dnsNameservers": "string", "dnsCustomNameservers": [ "string" - ] + ], + "dnsNameservers": "string" } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_cellular_gateway_dhcp_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_cellular_gateway_dhcp_info.py index 51263c0cf..a146d5e7d 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_cellular_gateway_dhcp_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_cellular_gateway_dhcp_info.py @@ -73,9 +73,9 @@ meraki_response: sample: > { "dhcpLeaseTime": "string", - "dnsNameservers": "string", "dnsCustomNameservers": [ "string" - ] + ], + "dnsNameservers": "string" } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_cellular_gateway_subnet_pool.py b/ansible_collections/cisco/meraki/plugins/modules/networks_cellular_gateway_subnet_pool.py index 8e2586106..9b949e9ca 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_cellular_gateway_subnet_pool.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_cellular_gateway_subnet_pool.py @@ -66,7 +66,6 @@ EXAMPLES = r""" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" state: present cidr: 192.168.0.0/16 - deploymentMode: routed mask: 24 networkId: string diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_cellular_gateway_subnet_pool_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_cellular_gateway_subnet_pool_info.py index 270363463..ec65da656 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_cellular_gateway_subnet_pool_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_cellular_gateway_subnet_pool_info.py @@ -70,6 +70,18 @@ meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always type: dict - sample: - - {} + sample: > + { + "cidr": "string", + "deploymentMode": "string", + "mask": 0, + "subnets": [ + { + "applianceIp": "string", + "name": "string", + "serial": "string", + "subnet": "string" + } + ] + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_cellular_gateway_uplink.py b/ansible_collections/cisco/meraki/plugins/modules/networks_cellular_gateway_uplink.py index b3d5f70ae..692c10607 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_cellular_gateway_uplink.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_cellular_gateway_uplink.py @@ -71,8 +71,8 @@ EXAMPLES = r""" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" state: present bandwidthLimits: - limitDown: 0 - limitUp: 0 + limitDown: 1000000 + limitUp: 1000000 networkId: string """ @@ -82,5 +82,8 @@ meraki_response: returned: always type: dict sample: > - {} + { + "limitDown": 0, + "limitUp": 0 + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_cellular_gateway_uplink_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_cellular_gateway_uplink_info.py index 8c46b24c3..839557474 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_cellular_gateway_uplink_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_cellular_gateway_uplink_info.py @@ -70,6 +70,9 @@ meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always type: dict - sample: - - {} + sample: > + { + "limitDown": 0, + "limitUp": 0 + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_clients_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_clients_info.py index fb08a9ba1..ce0976a7b 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_clients_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_clients_info.py @@ -9,12 +9,13 @@ DOCUMENTATION = r""" module: networks_clients_info short_description: Information module for networks _clients description: -- Get all networks _clients. -- List the clients that have used this network in the timespan. -version_added: '1.0.0' +- Get networks _clients by id. +- > + Return the client associated with the given identifier. Clients can be identified by a client key or either the + MAC or IP depending on whether the network uses Track-by-IP. +version_added: '2.16.0' extends_documentation_fragment: - cisco.meraki.module_info - - cisco.meraki.module_info_pagination author: Francisco Munoz (@fmunoz) options: headers: @@ -24,96 +25,27 @@ options: description: - NetworkId path parameter. Network ID. type: str - t0: + clientId: description: - - T0 query parameter. The beginning of the timespan for the data. The maximum lookback period is 31 days from today. + - ClientId path parameter. Client ID. type: str - timespan: - description: - - > - Timespan query parameter. The timespan for which the information will be fetched. If specifying timespan, do - not specify parameter t0. The value must be in seconds and be less than or equal to 31 days. The default is - 1 day. - type: float - perPage: - description: - - PerPage query parameter. The number of entries per page returned. Acceptable range is 3 - 1000. Default is 10. - type: int - startingAfter: - description: - - > - StartingAfter query parameter. A token used by the server to indicate the start of the page. Often this is a - timestamp or an ID but it is not limited to those. This parameter should not be defined by client - applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - type: str - endingBefore: - description: - - > - EndingBefore query parameter. A token used by the server to indicate the end of the page. Often this is a - timestamp or an ID but it is not limited to those. This parameter should not be defined by client - applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - type: str - statuses: - description: - - Statuses query parameter. Filters clients based on status. Can be one of 'Online' or 'Offline'. - elements: str - type: list - ip: - description: - - Ip query parameter. Filters clients based on a partial or full match for the ip address field. - type: str - ip6: - description: - - Ip6 query parameter. Filters clients based on a partial or full match for the ip6 address field. - type: str - ip6Local: - description: - - Ip6Local query parameter. Filters clients based on a partial or full match for the ip6Local address field. - type: str - mac: - description: - - Mac query parameter. Filters clients based on a partial or full match for the mac address field. - type: str - os: - description: - - Os query parameter. Filters clients based on a partial or full match for the os (operating system) field. - type: str - pskGroup: - description: - - PskGroup query parameter. Filters clients based on partial or full match for the iPSK name field. - type: str - description: - description: - - Description query parameter. Filters clients based on a partial or full match for the description field. - type: str - vlan: - description: - - Vlan query parameter. Filters clients based on the full match for the VLAN field. - type: str - recentDeviceConnections: - description: - - > - RecentDeviceConnections query parameter. Filters clients based on recent connection type. Can be one of - 'Wired' or 'Wireless'. - elements: str - type: list requirements: - meraki >= 2.4.9 - python >= 3.5 seealso: -- name: Cisco Meraki documentation for networks getNetworkClients - description: Complete reference of the getNetworkClients API. - link: https://developer.cisco.com/meraki/api-v1/#!get-network-clients +- name: Cisco Meraki documentation for networks getNetworkClient + description: Complete reference of the getNetworkClient API. + link: https://developer.cisco.com/meraki/api-v1/#!get-network-client notes: - SDK Method used are - networks.Networks.get_network_clients, + networks.Networks.get_network_client, - Paths used are - get /networks/{networkId}/clients, + get /networks/{networkId}/clients/{clientId}, """ EXAMPLES = r""" -- name: Get all networks _clients +- name: Get networks _clients by id cisco.meraki.networks_clients_info: meraki_api_key: "{{meraki_api_key}}" meraki_base_url: "{{meraki_base_url}}" @@ -133,27 +65,10 @@ EXAMPLES = r""" meraki_suppress_logging: "{{meraki_suppress_logging}}" meraki_simulate: "{{meraki_simulate}}" meraki_be_geo_id: "{{meraki_be_geo_id}}" - meraki_caller: "{{meraki_caller}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - t0: string - timespan: 0 - perPage: 0 - startingAfter: string - endingBefore: string - statuses: [] - ip: string - ip6: string - ip6Local: string - mac: string - os: string - pskGroup: string - description: string - vlan: string - recentDeviceConnections: [] networkId: string - total_pages: -1 - direction: next + clientId: string register: result """ @@ -164,36 +79,39 @@ meraki_response: type: dict sample: > { + "cdp": [ + [ + "string" + ] + ], + "clientVpnConnections": [ + { + "connectedAt": 0, + "disconnectedAt": 0, + "remoteIp": "string" + } + ], + "description": "string", + "firstSeen": 0, "id": "string", - "mac": "string", "ip": "string", "ip6": "string", - "description": "string", - "firstSeen": 0, "lastSeen": 0, + "lldp": [ + [ + "string" + ] + ], + "mac": "string", "manufacturer": "string", "os": "string", - "user": "string", - "vlan": "string", - "ssid": "string", - "switchport": "string", - "wirelessCapabilities": "string", - "smInstalled": true, "recentDeviceMac": "string", + "smInstalled": true, + "ssid": "string", "status": "string", - "usage": { - "sent": 0, - "recv": 0 - }, - "namedVlan": "string", - "adaptivePolicyGroup": "string", - "deviceTypePrediction": "string", - "recentDeviceSerial": "string", - "recentDeviceName": "string", - "recentDeviceConnection": "string", - "notes": "string", - "ip6Local": "string", - "groupPolicy8021x": "string", - "pskGroup": "string" + "switchport": "string", + "user": "string", + "vlan": "string", + "wirelessCapabilities": "string" } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_clients_overview_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_clients_overview_info.py index 834ea73ed..df042de24 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_clients_overview_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_clients_overview_info.py @@ -95,6 +95,15 @@ meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always type: dict - sample: - - {} + sample: > + { + "counts": { + "total": 0, + "withHeavyUsage": 0 + }, + "usages": { + "average": 0, + "withHeavyUsageAverage": 0 + } + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_clients_policy.py b/ansible_collections/cisco/meraki/plugins/modules/networks_clients_policy.py index 445d19e37..a597962a3 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_clients_policy.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_clients_policy.py @@ -74,7 +74,6 @@ EXAMPLES = r""" clientId: string devicePolicy: Group policy groupPolicyId: '101' - mac: 00:11:22:33:44:55 networkId: string """ @@ -84,5 +83,9 @@ meraki_response: returned: always type: dict sample: > - {} + { + "devicePolicy": "string", + "groupPolicyId": "string", + "mac": "string" + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_clients_policy_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_clients_policy_info.py index c1d7205e9..180956b7f 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_clients_policy_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_clients_policy_info.py @@ -77,6 +77,10 @@ meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always type: dict - sample: - - {} + sample: > + { + "devicePolicy": "string", + "groupPolicyId": "string", + "mac": "string" + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_clients_provision.py b/ansible_collections/cisco/meraki/plugins/modules/networks_clients_provision.py index b605f7fbf..399015fb8 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_clients_provision.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_clients_provision.py @@ -288,12 +288,59 @@ EXAMPLES = r""" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" clients: - - clientId: k74272e - mac: 00:11:22:33:44:55 + - mac: 00:11:22:33:44:55 name: Miles's phone devicePolicy: Group policy groupPolicyId: '101' networkId: string + policiesBySecurityAppliance: + devicePolicy: Normal + policiesBySsid: + '0': + devicePolicy: Group policy + groupPolicyId: '101' + '1': + devicePolicy: Group policy + groupPolicyId: '101' + '10': + devicePolicy: Group policy + groupPolicyId: '101' + '11': + devicePolicy: Group policy + groupPolicyId: '101' + '12': + devicePolicy: Group policy + groupPolicyId: '101' + '13': + devicePolicy: Group policy + groupPolicyId: '101' + '14': + devicePolicy: Group policy + groupPolicyId: '101' + '2': + devicePolicy: Group policy + groupPolicyId: '101' + '3': + devicePolicy: Group policy + groupPolicyId: '101' + '4': + devicePolicy: Group policy + groupPolicyId: '101' + '5': + devicePolicy: Group policy + groupPolicyId: '101' + '6': + devicePolicy: Group policy + groupPolicyId: '101' + '7': + devicePolicy: Group policy + groupPolicyId: '101' + '8': + devicePolicy: Group policy + groupPolicyId: '101' + '9': + devicePolicy: Group policy + groupPolicyId: '101' """ RETURN = r""" @@ -302,5 +349,16 @@ meraki_response: returned: always type: dict sample: > - {} + { + "clients": [ + { + "clientId": "string", + "mac": "string", + "message": "string", + "name": "string" + } + ], + "devicePolicy": "string", + "groupPolicyId": "string" + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_clients_splash_authorization_status_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_clients_splash_authorization_status_info.py index 972f09e64..533d54bf4 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_clients_splash_authorization_status_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_clients_splash_authorization_status_info.py @@ -78,6 +78,15 @@ meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always type: dict - sample: - - {} + sample: > + { + "0": { + "authorizedAt": "string", + "expiresAt": "string", + "isAuthorized": true + }, + "2": { + "isAuthorized": true + } + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_devices_claim.py b/ansible_collections/cisco/meraki/plugins/modules/networks_devices_claim.py index 81aca9acd..ebac12f92 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_devices_claim.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_devices_claim.py @@ -11,8 +11,8 @@ short_description: Resource module for networks _devices _claim description: - Manage operation create of the resource networks _devices _claim. - > - Claim devices into a network. Note for recently claimed devices, it may take a few minutes for API requsts against - that device to succeed . + Claim devices into a network. Note for recently claimed devices, it may take a few minutes for API requests + against that device to succeed. This operation can be used up to ten times within a single five minute window. version_added: '2.16.0' extends_documentation_fragment: - cisco.meraki.module @@ -76,5 +76,9 @@ meraki_response: returned: always type: dict sample: > - {} + { + "serials": [ + "string" + ] + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_devices_claim_vmx.py b/ansible_collections/cisco/meraki/plugins/modules/networks_devices_claim_vmx.py index ba4165db7..369be1c2a 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_devices_claim_vmx.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_devices_claim_vmx.py @@ -21,7 +21,7 @@ options: type: str size: description: The size of the vMX you claim. It can be one of small, medium, large, - 100. + xlarge, 100. type: str requirements: - meraki >= 2.4.9 @@ -71,5 +71,28 @@ meraki_response: returned: always type: dict sample: > - {} + { + "address": "string", + "details": [ + { + "name": "string", + "value": "string" + } + ], + "firmware": "string", + "imei": "string", + "lanIp": "string", + "lat": 0, + "lng": 0, + "mac": "string", + "model": "string", + "name": "string", + "networkId": "string", + "notes": "string", + "productType": "string", + "serial": "string", + "tags": [ + "string" + ] + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_events_event_types_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_events_event_types_info.py index 98cbd5079..a1b16cb2e 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_events_event_types_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_events_event_types_info.py @@ -75,8 +75,8 @@ meraki_response: [ { "category": "string", - "type": "string", - "description": "string" + "description": "string", + "type": "string" } ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_events_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_events_info.py index 98ed26a1f..f344826df 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_events_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_events_info.py @@ -170,32 +170,32 @@ meraki_response: type: dict sample: > { - "message": "string", - "pageStartAt": "string", - "pageEndAt": "string", "events": [ { - "occurredAt": "string", - "networkId": "string", - "type": "string", - "description": "string", "category": "string", - "clientId": "string", "clientDescription": "string", + "clientId": "string", "clientMac": "string", - "deviceSerial": "string", + "description": "string", "deviceName": "string", - "ssidNumber": 0, + "deviceSerial": "string", "eventData": { - "radio": "string", - "vap": "string", - "client_mac": "string", - "client_ip": "string", + "aid": "string", "channel": "string", + "client_ip": "string", + "client_mac": "string", + "radio": "string", "rssi": "string", - "aid": "string" - } + "vap": "string" + }, + "networkId": "string", + "occurredAt": "string", + "ssidNumber": 0, + "type": "string" } - ] + ], + "message": "string", + "pageEndAt": "string", + "pageStartAt": "string" } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_firmware_upgrades.py b/ansible_collections/cisco/meraki/plugins/modules/networks_firmware_upgrades.py index 54e5cc1de..6413c41b8 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_firmware_upgrades.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_firmware_upgrades.py @@ -127,6 +127,27 @@ options: description: Whether or not the network wants beta firmware. type: bool type: dict + switchCatalyst: + description: The network device to be updated. + suboptions: + nextUpgrade: + description: The pending firmware upgrade if it exists. + suboptions: + time: + description: The time of the last successful upgrade. + type: str + toVersion: + description: The version to be updated to. + suboptions: + id: + description: The version ID. + type: str + type: dict + type: dict + participateInNextBetaRelease: + description: Whether or not the network wants beta firmware. + type: bool + type: dict wireless: description: The network device to be updated. suboptions: @@ -233,6 +254,12 @@ EXAMPLES = r""" toVersion: id: '1002' participateInNextBetaRelease: false + switchCatalyst: + nextUpgrade: + time: '2019-03-17T17:22:52Z' + toVersion: + id: '1234' + participateInNextBetaRelease: false wireless: nextUpgrade: time: '2019-03-17T17:22:52Z' @@ -252,288 +279,288 @@ meraki_response: type: dict sample: > { - "upgradeWindow": { - "dayOfWeek": "string", - "hourOfDay": "string" - }, - "timezone": "string", "products": { - "wireless": { + "appliance": { + "availableVersions": [ + { + "firmware": "string", + "id": "string", + "releaseDate": "string", + "releaseType": "string", + "shortName": "string" + } + ], "currentVersion": { - "id": "string", "firmware": "string", - "shortName": "string", + "id": "string", + "releaseDate": "string", "releaseType": "string", - "releaseDate": "string" + "shortName": "string" }, "lastUpgrade": { - "time": "string", "fromVersion": { - "id": "string", "firmware": "string", - "shortName": "string", + "id": "string", + "releaseDate": "string", "releaseType": "string", - "releaseDate": "string" + "shortName": "string" }, + "time": "string", "toVersion": { - "id": "string", "firmware": "string", - "shortName": "string", + "id": "string", + "releaseDate": "string", "releaseType": "string", - "releaseDate": "string" + "shortName": "string" } }, "nextUpgrade": { "time": "string", "toVersion": { - "id": "string", "firmware": "string", - "shortName": "string", + "id": "string", + "releaseDate": "string", "releaseType": "string", - "releaseDate": "string" + "shortName": "string" } }, + "participateInNextBetaRelease": true + }, + "camera": { "availableVersions": [ { - "id": "string", "firmware": "string", - "shortName": "string", + "id": "string", + "releaseDate": "string", "releaseType": "string", - "releaseDate": "string" + "shortName": "string" } ], - "participateInNextBetaRelease": true - }, - "appliance": { "currentVersion": { - "id": "string", "firmware": "string", - "shortName": "string", + "id": "string", + "releaseDate": "string", "releaseType": "string", - "releaseDate": "string" + "shortName": "string" }, "lastUpgrade": { - "time": "string", "fromVersion": { - "id": "string", "firmware": "string", - "shortName": "string", + "id": "string", + "releaseDate": "string", "releaseType": "string", - "releaseDate": "string" + "shortName": "string" }, + "time": "string", "toVersion": { - "id": "string", "firmware": "string", - "shortName": "string", + "id": "string", + "releaseDate": "string", "releaseType": "string", - "releaseDate": "string" + "shortName": "string" } }, "nextUpgrade": { "time": "string", "toVersion": { - "id": "string", "firmware": "string", - "shortName": "string", + "id": "string", + "releaseDate": "string", "releaseType": "string", - "releaseDate": "string" + "shortName": "string" } }, + "participateInNextBetaRelease": true + }, + "cellularGateway": { "availableVersions": [ { - "id": "string", "firmware": "string", - "shortName": "string", + "id": "string", + "releaseDate": "string", "releaseType": "string", - "releaseDate": "string" + "shortName": "string" } ], - "participateInNextBetaRelease": true - }, - "switch": { "currentVersion": { - "id": "string", "firmware": "string", - "shortName": "string", + "id": "string", + "releaseDate": "string", "releaseType": "string", - "releaseDate": "string" + "shortName": "string" }, "lastUpgrade": { - "time": "string", "fromVersion": { - "id": "string", "firmware": "string", - "shortName": "string", + "id": "string", + "releaseDate": "string", "releaseType": "string", - "releaseDate": "string" + "shortName": "string" }, + "time": "string", "toVersion": { - "id": "string", "firmware": "string", - "shortName": "string", + "id": "string", + "releaseDate": "string", "releaseType": "string", - "releaseDate": "string" + "shortName": "string" } }, "nextUpgrade": { "time": "string", "toVersion": { - "id": "string", "firmware": "string", - "shortName": "string", + "id": "string", + "releaseDate": "string", "releaseType": "string", - "releaseDate": "string" + "shortName": "string" } }, + "participateInNextBetaRelease": true + }, + "sensor": { "availableVersions": [ { - "id": "string", "firmware": "string", - "shortName": "string", + "id": "string", + "releaseDate": "string", "releaseType": "string", - "releaseDate": "string" + "shortName": "string" } ], - "participateInNextBetaRelease": true - }, - "camera": { "currentVersion": { - "id": "string", "firmware": "string", - "shortName": "string", + "id": "string", + "releaseDate": "string", "releaseType": "string", - "releaseDate": "string" + "shortName": "string" }, "lastUpgrade": { - "time": "string", "fromVersion": { - "id": "string", "firmware": "string", - "shortName": "string", + "id": "string", + "releaseDate": "string", "releaseType": "string", - "releaseDate": "string" + "shortName": "string" }, + "time": "string", "toVersion": { - "id": "string", "firmware": "string", - "shortName": "string", + "id": "string", + "releaseDate": "string", "releaseType": "string", - "releaseDate": "string" + "shortName": "string" } }, "nextUpgrade": { "time": "string", "toVersion": { - "id": "string", "firmware": "string", - "shortName": "string", + "id": "string", + "releaseDate": "string", "releaseType": "string", - "releaseDate": "string" + "shortName": "string" } }, + "participateInNextBetaRelease": true + }, + "switch": { "availableVersions": [ { - "id": "string", "firmware": "string", - "shortName": "string", + "id": "string", + "releaseDate": "string", "releaseType": "string", - "releaseDate": "string" + "shortName": "string" } ], - "participateInNextBetaRelease": true - }, - "cellularGateway": { "currentVersion": { - "id": "string", "firmware": "string", - "shortName": "string", + "id": "string", + "releaseDate": "string", "releaseType": "string", - "releaseDate": "string" + "shortName": "string" }, "lastUpgrade": { - "time": "string", "fromVersion": { - "id": "string", "firmware": "string", - "shortName": "string", + "id": "string", + "releaseDate": "string", "releaseType": "string", - "releaseDate": "string" + "shortName": "string" }, + "time": "string", "toVersion": { - "id": "string", "firmware": "string", - "shortName": "string", + "id": "string", + "releaseDate": "string", "releaseType": "string", - "releaseDate": "string" + "shortName": "string" } }, "nextUpgrade": { "time": "string", "toVersion": { - "id": "string", "firmware": "string", - "shortName": "string", + "id": "string", + "releaseDate": "string", "releaseType": "string", - "releaseDate": "string" + "shortName": "string" } }, + "participateInNextBetaRelease": true + }, + "wireless": { "availableVersions": [ { - "id": "string", "firmware": "string", - "shortName": "string", + "id": "string", + "releaseDate": "string", "releaseType": "string", - "releaseDate": "string" + "shortName": "string" } ], - "participateInNextBetaRelease": true - }, - "sensor": { "currentVersion": { - "id": "string", "firmware": "string", - "shortName": "string", + "id": "string", + "releaseDate": "string", "releaseType": "string", - "releaseDate": "string" + "shortName": "string" }, "lastUpgrade": { - "time": "string", "fromVersion": { - "id": "string", "firmware": "string", - "shortName": "string", + "id": "string", + "releaseDate": "string", "releaseType": "string", - "releaseDate": "string" + "shortName": "string" }, + "time": "string", "toVersion": { - "id": "string", "firmware": "string", - "shortName": "string", + "id": "string", + "releaseDate": "string", "releaseType": "string", - "releaseDate": "string" + "shortName": "string" } }, "nextUpgrade": { "time": "string", "toVersion": { - "id": "string", "firmware": "string", - "shortName": "string", - "releaseType": "string", - "releaseDate": "string" - } - }, - "availableVersions": [ - { "id": "string", - "firmware": "string", - "shortName": "string", + "releaseDate": "string", "releaseType": "string", - "releaseDate": "string" + "shortName": "string" } - ], + }, "participateInNextBetaRelease": true } + }, + "timezone": "string", + "upgradeWindow": { + "dayOfWeek": "string", + "hourOfDay": "string" } } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_firmware_upgrades_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_firmware_upgrades_info.py index 49cf472c2..2c046fc66 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_firmware_upgrades_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_firmware_upgrades_info.py @@ -72,288 +72,288 @@ meraki_response: type: dict sample: > { - "upgradeWindow": { - "dayOfWeek": "string", - "hourOfDay": "string" - }, - "timezone": "string", "products": { - "wireless": { + "appliance": { + "availableVersions": [ + { + "firmware": "string", + "id": "string", + "releaseDate": "string", + "releaseType": "string", + "shortName": "string" + } + ], "currentVersion": { - "id": "string", "firmware": "string", - "shortName": "string", + "id": "string", + "releaseDate": "string", "releaseType": "string", - "releaseDate": "string" + "shortName": "string" }, "lastUpgrade": { - "time": "string", "fromVersion": { - "id": "string", "firmware": "string", - "shortName": "string", + "id": "string", + "releaseDate": "string", "releaseType": "string", - "releaseDate": "string" + "shortName": "string" }, + "time": "string", "toVersion": { - "id": "string", "firmware": "string", - "shortName": "string", + "id": "string", + "releaseDate": "string", "releaseType": "string", - "releaseDate": "string" + "shortName": "string" } }, "nextUpgrade": { "time": "string", "toVersion": { - "id": "string", "firmware": "string", - "shortName": "string", + "id": "string", + "releaseDate": "string", "releaseType": "string", - "releaseDate": "string" + "shortName": "string" } }, + "participateInNextBetaRelease": true + }, + "camera": { "availableVersions": [ { - "id": "string", "firmware": "string", - "shortName": "string", + "id": "string", + "releaseDate": "string", "releaseType": "string", - "releaseDate": "string" + "shortName": "string" } ], - "participateInNextBetaRelease": true - }, - "appliance": { "currentVersion": { - "id": "string", "firmware": "string", - "shortName": "string", + "id": "string", + "releaseDate": "string", "releaseType": "string", - "releaseDate": "string" + "shortName": "string" }, "lastUpgrade": { - "time": "string", "fromVersion": { - "id": "string", "firmware": "string", - "shortName": "string", + "id": "string", + "releaseDate": "string", "releaseType": "string", - "releaseDate": "string" + "shortName": "string" }, + "time": "string", "toVersion": { - "id": "string", "firmware": "string", - "shortName": "string", + "id": "string", + "releaseDate": "string", "releaseType": "string", - "releaseDate": "string" + "shortName": "string" } }, "nextUpgrade": { "time": "string", "toVersion": { - "id": "string", "firmware": "string", - "shortName": "string", + "id": "string", + "releaseDate": "string", "releaseType": "string", - "releaseDate": "string" + "shortName": "string" } }, + "participateInNextBetaRelease": true + }, + "cellularGateway": { "availableVersions": [ { - "id": "string", "firmware": "string", - "shortName": "string", + "id": "string", + "releaseDate": "string", "releaseType": "string", - "releaseDate": "string" + "shortName": "string" } ], - "participateInNextBetaRelease": true - }, - "switch": { "currentVersion": { - "id": "string", "firmware": "string", - "shortName": "string", + "id": "string", + "releaseDate": "string", "releaseType": "string", - "releaseDate": "string" + "shortName": "string" }, "lastUpgrade": { - "time": "string", "fromVersion": { - "id": "string", "firmware": "string", - "shortName": "string", + "id": "string", + "releaseDate": "string", "releaseType": "string", - "releaseDate": "string" + "shortName": "string" }, + "time": "string", "toVersion": { - "id": "string", "firmware": "string", - "shortName": "string", + "id": "string", + "releaseDate": "string", "releaseType": "string", - "releaseDate": "string" + "shortName": "string" } }, "nextUpgrade": { "time": "string", "toVersion": { - "id": "string", "firmware": "string", - "shortName": "string", + "id": "string", + "releaseDate": "string", "releaseType": "string", - "releaseDate": "string" + "shortName": "string" } }, + "participateInNextBetaRelease": true + }, + "sensor": { "availableVersions": [ { - "id": "string", "firmware": "string", - "shortName": "string", + "id": "string", + "releaseDate": "string", "releaseType": "string", - "releaseDate": "string" + "shortName": "string" } ], - "participateInNextBetaRelease": true - }, - "camera": { "currentVersion": { - "id": "string", "firmware": "string", - "shortName": "string", + "id": "string", + "releaseDate": "string", "releaseType": "string", - "releaseDate": "string" + "shortName": "string" }, "lastUpgrade": { - "time": "string", "fromVersion": { - "id": "string", "firmware": "string", - "shortName": "string", + "id": "string", + "releaseDate": "string", "releaseType": "string", - "releaseDate": "string" + "shortName": "string" }, + "time": "string", "toVersion": { - "id": "string", "firmware": "string", - "shortName": "string", + "id": "string", + "releaseDate": "string", "releaseType": "string", - "releaseDate": "string" + "shortName": "string" } }, "nextUpgrade": { "time": "string", "toVersion": { - "id": "string", "firmware": "string", - "shortName": "string", + "id": "string", + "releaseDate": "string", "releaseType": "string", - "releaseDate": "string" + "shortName": "string" } }, + "participateInNextBetaRelease": true + }, + "switch": { "availableVersions": [ { - "id": "string", "firmware": "string", - "shortName": "string", + "id": "string", + "releaseDate": "string", "releaseType": "string", - "releaseDate": "string" + "shortName": "string" } ], - "participateInNextBetaRelease": true - }, - "cellularGateway": { "currentVersion": { - "id": "string", "firmware": "string", - "shortName": "string", + "id": "string", + "releaseDate": "string", "releaseType": "string", - "releaseDate": "string" + "shortName": "string" }, "lastUpgrade": { - "time": "string", "fromVersion": { - "id": "string", "firmware": "string", - "shortName": "string", + "id": "string", + "releaseDate": "string", "releaseType": "string", - "releaseDate": "string" + "shortName": "string" }, + "time": "string", "toVersion": { - "id": "string", "firmware": "string", - "shortName": "string", + "id": "string", + "releaseDate": "string", "releaseType": "string", - "releaseDate": "string" + "shortName": "string" } }, "nextUpgrade": { "time": "string", "toVersion": { - "id": "string", "firmware": "string", - "shortName": "string", + "id": "string", + "releaseDate": "string", "releaseType": "string", - "releaseDate": "string" + "shortName": "string" } }, + "participateInNextBetaRelease": true + }, + "wireless": { "availableVersions": [ { - "id": "string", "firmware": "string", - "shortName": "string", + "id": "string", + "releaseDate": "string", "releaseType": "string", - "releaseDate": "string" + "shortName": "string" } ], - "participateInNextBetaRelease": true - }, - "sensor": { "currentVersion": { - "id": "string", "firmware": "string", - "shortName": "string", + "id": "string", + "releaseDate": "string", "releaseType": "string", - "releaseDate": "string" + "shortName": "string" }, "lastUpgrade": { - "time": "string", "fromVersion": { - "id": "string", "firmware": "string", - "shortName": "string", + "id": "string", + "releaseDate": "string", "releaseType": "string", - "releaseDate": "string" + "shortName": "string" }, + "time": "string", "toVersion": { - "id": "string", "firmware": "string", - "shortName": "string", + "id": "string", + "releaseDate": "string", "releaseType": "string", - "releaseDate": "string" + "shortName": "string" } }, "nextUpgrade": { "time": "string", "toVersion": { - "id": "string", "firmware": "string", - "shortName": "string", - "releaseType": "string", - "releaseDate": "string" - } - }, - "availableVersions": [ - { "id": "string", - "firmware": "string", - "shortName": "string", + "releaseDate": "string", "releaseType": "string", - "releaseDate": "string" + "shortName": "string" } - ], + }, "participateInNextBetaRelease": true } + }, + "timezone": "string", + "upgradeWindow": { + "dayOfWeek": "string", + "hourOfDay": "string" } } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_firmware_upgrades_rollbacks.py b/ansible_collections/cisco/meraki/plugins/modules/networks_firmware_upgrades_rollbacks.py index f68a20e14..bd2ad6f6f 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_firmware_upgrades_rollbacks.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_firmware_upgrades_rollbacks.py @@ -99,21 +99,21 @@ meraki_response: sample: > { "product": "string", + "reasons": [ + { + "category": "string", + "comment": "string" + } + ], "status": "string", - "upgradeBatchId": "string", "time": "string", "toVersion": { - "id": "string", "firmware": "string", - "shortName": "string", + "id": "string", + "releaseDate": "string", "releaseType": "string", - "releaseDate": "string" + "shortName": "string" }, - "reasons": [ - { - "category": "string", - "comment": "string" - } - ] + "upgradeBatchId": "string" } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_firmware_upgrades_staged_events.py b/ansible_collections/cisco/meraki/plugins/modules/networks_firmware_upgrades_staged_events.py index 7602effc6..1fc0e256a 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_firmware_upgrades_staged_events.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_firmware_upgrades_staged_events.py @@ -38,6 +38,21 @@ options: type: dict type: dict type: dict + switchCatalyst: + description: Version information for the switch network being upgraded. + suboptions: + nextUpgrade: + description: The next upgrade version for the switch network. + suboptions: + toVersion: + description: The version to be updated to for switch Catalyst devices. + suboptions: + id: + description: The version ID. + type: str + type: dict + type: dict + type: dict type: dict stages: description: All firmware upgrade stages in the network with their start time. @@ -80,7 +95,7 @@ notes: """ EXAMPLES = r""" -- name: Update all +- name: Create cisco.meraki.networks_firmware_upgrades_staged_events: meraki_api_key: "{{meraki_api_key}}" meraki_base_url: "{{meraki_base_url}}" @@ -104,13 +119,22 @@ EXAMPLES = r""" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" state: present networkId: string + products: + switch: + nextUpgrade: + toVersion: + id: '1234' + switchCatalyst: + nextUpgrade: + toVersion: + id: '4321' stages: - group: id: '1234' milestones: scheduledFor: '2018-02-11T00:00:00Z' -- name: Create +- name: Update all cisco.meraki.networks_firmware_upgrades_staged_events: meraki_api_key: "{{meraki_api_key}}" meraki_base_url: "{{meraki_base_url}}" @@ -134,11 +158,6 @@ EXAMPLES = r""" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" state: present networkId: string - products: - switch: - nextUpgrade: - toVersion: - id: '1234' stages: - group: id: '1234' @@ -163,27 +182,27 @@ meraki_response: } } }, + "reasons": [ + { + "category": "string", + "comment": "string" + } + ], "stages": [ { "group": { + "description": "string", "id": "string", - "name": "string", - "description": "string" + "name": "string" }, "milestones": { - "scheduledFor": "string", - "startedAt": "string", + "canceledAt": "string", "completedAt": "string", - "canceledAt": "string" + "scheduledFor": "string", + "startedAt": "string" }, "status": "string" } - ], - "reasons": [ - { - "category": "string", - "comment": "string" - } ] } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_firmware_upgrades_staged_events_defer.py b/ansible_collections/cisco/meraki/plugins/modules/networks_firmware_upgrades_staged_events_defer.py index eb7bd60d4..a0e7440ee 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_firmware_upgrades_staged_events_defer.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_firmware_upgrades_staged_events_defer.py @@ -77,27 +77,27 @@ meraki_response: } } }, + "reasons": [ + { + "category": "string", + "comment": "string" + } + ], "stages": [ { "group": { + "description": "string", "id": "string", - "name": "string", - "description": "string" + "name": "string" }, "milestones": { - "scheduledFor": "string", - "startedAt": "string", + "canceledAt": "string", "completedAt": "string", - "canceledAt": "string" + "scheduledFor": "string", + "startedAt": "string" }, "status": "string" } - ], - "reasons": [ - { - "category": "string", - "comment": "string" - } ] } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_firmware_upgrades_staged_events_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_firmware_upgrades_staged_events_info.py index 5a2bc160c..14282197a 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_firmware_upgrades_staged_events_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_firmware_upgrades_staged_events_info.py @@ -82,27 +82,27 @@ meraki_response: } } }, + "reasons": [ + { + "category": "string", + "comment": "string" + } + ], "stages": [ { "group": { + "description": "string", "id": "string", - "name": "string", - "description": "string" + "name": "string" }, "milestones": { - "scheduledFor": "string", - "startedAt": "string", + "canceledAt": "string", "completedAt": "string", - "canceledAt": "string" + "scheduledFor": "string", + "startedAt": "string" }, "status": "string" } - ], - "reasons": [ - { - "category": "string", - "comment": "string" - } ] } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_firmware_upgrades_staged_events_rollbacks.py b/ansible_collections/cisco/meraki/plugins/modules/networks_firmware_upgrades_staged_events_rollbacks.py index 91393eaf1..ba96d49c1 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_firmware_upgrades_staged_events_rollbacks.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_firmware_upgrades_staged_events_rollbacks.py @@ -117,27 +117,27 @@ meraki_response: } } }, + "reasons": [ + { + "category": "string", + "comment": "string" + } + ], "stages": [ { "group": { + "description": "string", "id": "string", - "name": "string", - "description": "string" + "name": "string" }, "milestones": { - "scheduledFor": "string", - "startedAt": "string", + "canceledAt": "string", "completedAt": "string", - "canceledAt": "string" + "scheduledFor": "string", + "startedAt": "string" }, "status": "string" } - ], - "reasons": [ - { - "category": "string", - "comment": "string" - } ] } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_firmware_upgrades_staged_groups.py b/ansible_collections/cisco/meraki/plugins/modules/networks_firmware_upgrades_staged_groups.py index 8d152996d..066426acd 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_firmware_upgrades_staged_groups.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_firmware_upgrades_staged_groups.py @@ -121,7 +121,7 @@ EXAMPLES = r""" name: My Staged Upgrade Group networkId: string -- name: Update by id +- name: Delete by id cisco.meraki.networks_firmware_upgrades_staged_groups: meraki_api_key: "{{meraki_api_key}}" meraki_base_url: "{{meraki_base_url}}" @@ -143,21 +143,11 @@ EXAMPLES = r""" meraki_be_geo_id: "{{meraki_be_geo_id}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: present - assignedDevices: - devices: - - name: Device Name - serial: Q234-ABCD-5678 - switchStacks: - - id: '1234' - name: Stack Name - description: The description of the group + state: absent groupId: string - isDefault: false - name: My Staged Upgrade Group networkId: string -- name: Delete by id +- name: Update by id cisco.meraki.networks_firmware_upgrades_staged_groups: meraki_api_key: "{{meraki_api_key}}" meraki_base_url: "{{meraki_base_url}}" @@ -179,8 +169,18 @@ EXAMPLES = r""" meraki_be_geo_id: "{{meraki_be_geo_id}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: absent + state: present + assignedDevices: + devices: + - name: Device Name + serial: Q234-ABCD-5678 + switchStacks: + - id: '1234' + name: Stack Name + description: The description of the group groupId: string + isDefault: false + name: My Staged Upgrade Group networkId: string """ @@ -190,5 +190,24 @@ meraki_response: returned: always type: dict sample: > - {} + { + "assignedDevices": { + "devices": [ + { + "name": "string", + "serial": "string" + } + ], + "switchStacks": [ + { + "id": "string", + "name": "string" + } + ] + }, + "description": "string", + "groupId": "string", + "isDefault": true, + "name": "string" + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_firmware_upgrades_staged_groups_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_firmware_upgrades_staged_groups_info.py index 27e1bb7a9..e329e3a59 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_firmware_upgrades_staged_groups_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_firmware_upgrades_staged_groups_info.py @@ -109,15 +109,11 @@ meraki_response: type: dict sample: > { - "groupId": "string", - "name": "string", - "description": "string", - "isDefault": true, "assignedDevices": { "devices": [ { - "serial": "string", - "name": "string" + "name": "string", + "serial": "string" } ], "switchStacks": [ @@ -126,6 +122,10 @@ meraki_response: "name": "string" } ] - } + }, + "description": "string", + "groupId": "string", + "isDefault": true, + "name": "string" } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_firmware_upgrades_staged_stages.py b/ansible_collections/cisco/meraki/plugins/modules/networks_firmware_upgrades_staged_stages.py index 2222ee097..53066ce50 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_firmware_upgrades_staged_stages.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_firmware_upgrades_staged_stages.py @@ -85,9 +85,9 @@ meraki_response: [ { "group": { + "description": "string", "id": "string", - "name": "string", - "description": "string" + "name": "string" } } ] diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_firmware_upgrades_staged_stages_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_firmware_upgrades_staged_stages_info.py index 150aa58af..e43004be7 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_firmware_upgrades_staged_stages_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_firmware_upgrades_staged_stages_info.py @@ -75,9 +75,9 @@ meraki_response: [ { "group": { + "description": "string", "id": "string", - "name": "string", - "description": "string" + "name": "string" } } ] diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_floor_plans.py b/ansible_collections/cisco/meraki/plugins/modules/networks_floor_plans.py index 6873a0ca4..01b2a1241 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_floor_plans.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_floor_plans.py @@ -141,11 +141,26 @@ EXAMPLES = r""" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" state: present - imageContents: Q2lzY28gTWVyYWtp + bottomLeftCorner: + lat: 37.770040510499996 + lng: -122.38714009525 + bottomRightCorner: + lat: 37.770040510499996 + lng: -122.38714009525 + center: + lat: 37.770040510499996 + lng: -122.38714009525 + imageContents: 2a9edd3f4ffd80130c647d13eacb59f3 name: HQ Floor Plan networkId: string + topLeftCorner: + lat: 37.770040510499996 + lng: -122.38714009525 + topRightCorner: + lat: 37.770040510499996 + lng: -122.38714009525 -- name: Update by id +- name: Delete by id cisco.meraki.networks_floor_plans: meraki_api_key: "{{meraki_api_key}}" meraki_base_url: "{{meraki_base_url}}" @@ -167,28 +182,11 @@ EXAMPLES = r""" meraki_be_geo_id: "{{meraki_be_geo_id}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: present - bottomLeftCorner: - lat: 0 - lng: 0 - bottomRightCorner: - lat: 0 - lng: 0 - center: - lat: 0 - lng: 0 + state: absent floorPlanId: string - imageContents: string - name: string networkId: string - topLeftCorner: - lat: 0 - lng: 0 - topRightCorner: - lat: 0 - lng: 0 -- name: Delete by id +- name: Update by id cisco.meraki.networks_floor_plans: meraki_api_key: "{{meraki_api_key}}" meraki_base_url: "{{meraki_base_url}}" @@ -210,9 +208,26 @@ EXAMPLES = r""" meraki_be_geo_id: "{{meraki_be_geo_id}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: absent + state: present + bottomLeftCorner: + lat: 37.770040510499996 + lng: -122.38714009525 + bottomRightCorner: + lat: 37.770040510499996 + lng: -122.38714009525 + center: + lat: 37.770040510499996 + lng: -122.38714009525 floorPlanId: string + imageContents: 2a9edd3f4ffd80130c647d13eacb59f3 + name: HQ Floor Plan networkId: string + topLeftCorner: + lat: 37.770040510499996 + lng: -122.38714009525 + topRightCorner: + lat: 37.770040510499996 + lng: -122.38714009525 """ RETURN = r""" @@ -221,5 +236,60 @@ meraki_response: returned: always type: dict sample: > - {} + { + "bottomLeftCorner": { + "lat": 0, + "lng": 0 + }, + "bottomRightCorner": { + "lat": 0, + "lng": 0 + }, + "center": { + "lat": 0, + "lng": 0 + }, + "devices": [ + { + "address": "string", + "details": [ + { + "name": "string", + "value": "string" + } + ], + "firmware": "string", + "imei": "string", + "lanIp": "string", + "lat": 0, + "lng": 0, + "mac": "string", + "model": "string", + "name": "string", + "networkId": "string", + "notes": "string", + "productType": "string", + "serial": "string", + "tags": [ + "string" + ] + } + ], + "floorPlanId": "string", + "height": 0, + "imageExtension": "string", + "imageMd5": "string", + "imageUrl": "string", + "imageUrlExpiresAt": "string", + "name": "string", + "topLeftCorner": { + "lat": 0, + "lng": 0 + }, + "topRightCorner": { + "lat": 0, + "lng": 0 + }, + "width": 0 + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_floor_plans_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_floor_plans_info.py index 6925db738..df4d139ae 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_floor_plans_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_floor_plans_info.py @@ -106,10 +106,62 @@ RETURN = r""" meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always - type: list - elements: dict + type: dict sample: > - [ - {} - ] + { + "bottomLeftCorner": { + "lat": 0, + "lng": 0 + }, + "bottomRightCorner": { + "lat": 0, + "lng": 0 + }, + "center": { + "lat": 0, + "lng": 0 + }, + "devices": [ + { + "address": "string", + "details": [ + { + "name": "string", + "value": "string" + } + ], + "firmware": "string", + "imei": "string", + "lanIp": "string", + "lat": 0, + "lng": 0, + "mac": "string", + "model": "string", + "name": "string", + "networkId": "string", + "notes": "string", + "productType": "string", + "serial": "string", + "tags": [ + "string" + ] + } + ], + "floorPlanId": "string", + "height": 0, + "imageExtension": "string", + "imageMd5": "string", + "imageUrl": "string", + "imageUrlExpiresAt": "string", + "name": "string", + "topLeftCorner": { + "lat": 0, + "lng": 0 + }, + "topRightCorner": { + "lat": 0, + "lng": 0 + }, + "width": 0 + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_group_policies.py b/ansible_collections/cisco/meraki/plugins/modules/networks_group_policies.py index 62689ee9f..2cd4091e6 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_group_policies.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_group_policies.py @@ -467,30 +467,11 @@ EXAMPLES = r""" - policy: deny type: host value: google.com - - policy: deny - type: port - value: '23' - - policy: deny - type: ipRange - value: 10.11.12.00/24 - - policy: deny - type: ipRange - value: 10.11.12.00/24:5555 settings: custom trafficShapingRules: - definitions: - type: host value: google.com - - type: port - value: '9090' - - type: ipRange - value: 192.1.0.0 - - type: ipRange - value: 192.1.0.0/16 - - type: ipRange - value: 10.1.0.0/16:80 - - type: localNet - value: 192.168.0.0/16 dscpTagValue: 0 pcpTagValue: 0 perClientBandwidthLimits: @@ -498,6 +479,7 @@ EXAMPLES = r""" limitDown: 1000000 limitUp: 1000000 settings: custom + priority: normal name: No video streaming networkId: string scheduling: @@ -511,13 +493,13 @@ EXAMPLES = r""" from: '9:00' to: '17:00' saturday: - active: false - from: 0:00 - to: '24:00' + active: true + from: '9:00' + to: '17:00' sunday: - active: false - from: 0:00 - to: '24:00' + active: true + from: '9:00' + to: '17:00' thursday: active: true from: '9:00' @@ -535,6 +517,32 @@ EXAMPLES = r""" settings: custom vlanId: '1' +- name: Delete by id + cisco.meraki.networks_group_policies: + meraki_api_key: "{{meraki_api_key}}" + meraki_base_url: "{{meraki_base_url}}" + meraki_single_request_timeout: "{{meraki_single_request_timeout}}" + meraki_certificate_path: "{{meraki_certificate_path}}" + meraki_requests_proxy: "{{meraki_requests_proxy}}" + meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" + meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" + meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" + meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" + meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" + meraki_maximum_retries: "{{meraki_maximum_retries}}" + meraki_output_log: "{{meraki_output_log}}" + meraki_log_file_prefix: "{{meraki_log_file_prefix}}" + meraki_log_path: "{{meraki_log_path}}" + meraki_print_console: "{{meraki_print_console}}" + meraki_suppress_logging: "{{meraki_suppress_logging}}" + meraki_simulate: "{{meraki_simulate}}" + meraki_be_geo_id: "{{meraki_be_geo_id}}" + meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" + meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" + state: absent + groupPolicyId: string + networkId: string + - name: Update by id cisco.meraki.networks_group_policies: meraki_api_key: "{{meraki_api_key}}" @@ -595,30 +603,11 @@ EXAMPLES = r""" - policy: deny type: host value: google.com - - policy: deny - type: port - value: '23' - - policy: deny - type: ipRange - value: 10.11.12.00/24 - - policy: deny - type: ipRange - value: 10.11.12.00/24:5555 settings: custom trafficShapingRules: - definitions: - type: host value: google.com - - type: port - value: '9090' - - type: ipRange - value: 192.1.0.0 - - type: ipRange - value: 192.1.0.0/16 - - type: ipRange - value: 10.1.0.0/16:80 - - type: localNet - value: 192.168.0.0/16 dscpTagValue: 0 pcpTagValue: 0 perClientBandwidthLimits: @@ -626,6 +615,7 @@ EXAMPLES = r""" limitDown: 1000000 limitUp: 1000000 settings: custom + priority: normal groupPolicyId: string name: No video streaming networkId: string @@ -640,13 +630,13 @@ EXAMPLES = r""" from: '9:00' to: '17:00' saturday: - active: false - from: 0:00 - to: '24:00' + active: true + from: '9:00' + to: '17:00' sunday: - active: false - from: 0:00 - to: '24:00' + active: true + from: '9:00' + to: '17:00' thursday: active: true from: '9:00' @@ -664,32 +654,6 @@ EXAMPLES = r""" settings: custom vlanId: '1' -- name: Delete by id - cisco.meraki.networks_group_policies: - meraki_api_key: "{{meraki_api_key}}" - meraki_base_url: "{{meraki_base_url}}" - meraki_single_request_timeout: "{{meraki_single_request_timeout}}" - meraki_certificate_path: "{{meraki_certificate_path}}" - meraki_requests_proxy: "{{meraki_requests_proxy}}" - meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" - meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" - meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" - meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" - meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" - meraki_maximum_retries: "{{meraki_maximum_retries}}" - meraki_output_log: "{{meraki_output_log}}" - meraki_log_file_prefix: "{{meraki_log_file_prefix}}" - meraki_log_path: "{{meraki_log_path}}" - meraki_print_console: "{{meraki_print_console}}" - meraki_suppress_logging: "{{meraki_suppress_logging}}" - meraki_simulate: "{{meraki_simulate}}" - meraki_be_geo_id: "{{meraki_be_geo_id}}" - meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" - meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: absent - groupPolicyId: string - networkId: string - """ RETURN = r""" meraki_response: @@ -697,5 +661,128 @@ meraki_response: returned: always type: dict sample: > - {} + { + "bandwidth": { + "bandwidthLimits": { + "limitDown": 0, + "limitUp": 0 + }, + "settings": "string" + }, + "bonjourForwarding": { + "rules": [ + { + "description": "string", + "services": [ + "string" + ], + "vlanId": "string" + } + ], + "settings": "string" + }, + "contentFiltering": { + "allowedUrlPatterns": { + "patterns": [ + "string" + ], + "settings": "string" + }, + "blockedUrlCategories": { + "categories": [ + "string" + ], + "settings": "string" + }, + "blockedUrlPatterns": { + "patterns": [ + "string" + ], + "settings": "string" + } + }, + "firewallAndTrafficShaping": { + "l3FirewallRules": [ + { + "comment": "string", + "destCidr": "string", + "destPort": "string", + "policy": "string", + "protocol": "string" + } + ], + "l7FirewallRules": [ + { + "policy": "string", + "type": "string", + "value": "string" + } + ], + "settings": "string", + "trafficShapingRules": [ + { + "definitions": [ + { + "type": "string", + "value": "string" + } + ], + "dscpTagValue": 0, + "pcpTagValue": 0, + "perClientBandwidthLimits": { + "bandwidthLimits": { + "limitDown": 0, + "limitUp": 0 + }, + "settings": "string" + }, + "priority": "string" + } + ] + }, + "groupPolicyId": "string", + "scheduling": { + "enabled": true, + "friday": { + "active": true, + "from": "string", + "to": "string" + }, + "monday": { + "active": true, + "from": "string", + "to": "string" + }, + "saturday": { + "active": true, + "from": "string", + "to": "string" + }, + "sunday": { + "active": true, + "from": "string", + "to": "string" + }, + "thursday": { + "active": true, + "from": "string", + "to": "string" + }, + "tuesday": { + "active": true, + "from": "string", + "to": "string" + }, + "wednesday": { + "active": true, + "from": "string", + "to": "string" + } + }, + "splashAuthSettings": "string", + "vlanTagging": { + "settings": "string", + "vlanId": "string" + } + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_group_policies_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_group_policies_info.py index 29bb06cbe..6913657eb 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_group_policies_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_group_policies_info.py @@ -106,10 +106,130 @@ RETURN = r""" meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always - type: list - elements: dict + type: dict sample: > - [ - {} - ] + { + "bandwidth": { + "bandwidthLimits": { + "limitDown": 0, + "limitUp": 0 + }, + "settings": "string" + }, + "bonjourForwarding": { + "rules": [ + { + "description": "string", + "services": [ + "string" + ], + "vlanId": "string" + } + ], + "settings": "string" + }, + "contentFiltering": { + "allowedUrlPatterns": { + "patterns": [ + "string" + ], + "settings": "string" + }, + "blockedUrlCategories": { + "categories": [ + "string" + ], + "settings": "string" + }, + "blockedUrlPatterns": { + "patterns": [ + "string" + ], + "settings": "string" + } + }, + "firewallAndTrafficShaping": { + "l3FirewallRules": [ + { + "comment": "string", + "destCidr": "string", + "destPort": "string", + "policy": "string", + "protocol": "string" + } + ], + "l7FirewallRules": [ + { + "policy": "string", + "type": "string", + "value": "string" + } + ], + "settings": "string", + "trafficShapingRules": [ + { + "definitions": [ + { + "type": "string", + "value": "string" + } + ], + "dscpTagValue": 0, + "pcpTagValue": 0, + "perClientBandwidthLimits": { + "bandwidthLimits": { + "limitDown": 0, + "limitUp": 0 + }, + "settings": "string" + }, + "priority": "string" + } + ] + }, + "groupPolicyId": "string", + "scheduling": { + "enabled": true, + "friday": { + "active": true, + "from": "string", + "to": "string" + }, + "monday": { + "active": true, + "from": "string", + "to": "string" + }, + "saturday": { + "active": true, + "from": "string", + "to": "string" + }, + "sunday": { + "active": true, + "from": "string", + "to": "string" + }, + "thursday": { + "active": true, + "from": "string", + "to": "string" + }, + "tuesday": { + "active": true, + "from": "string", + "to": "string" + }, + "wednesday": { + "active": true, + "from": "string", + "to": "string" + } + }, + "splashAuthSettings": "string", + "vlanTagging": { + "settings": "string", + "vlanId": "string" + } + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_health_alerts_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_health_alerts_info.py index 1bae1b67b..3cbb0776f 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_health_alerts_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_health_alerts_info.py @@ -74,44 +74,44 @@ meraki_response: sample: > [ { - "id": "string", "category": "string", - "type": "string", - "severity": "string", + "id": "string", "scope": { - "devices": [ + "applications": [ { - "url": "string", "name": "string", - "productType": "string", - "serial": "string", - "mac": "string", - "lldp": { - "portId": "string" - }, + "url": "string" + } + ], + "devices": [ + { "clients": [ { "mac": "string" } - ] - } - ], - "applications": [ - { - "url": "string", - "name": "string" + ], + "lldp": { + "portId": "string" + }, + "mac": "string", + "name": "string", + "productType": "string", + "serial": "string", + "url": "string" } ], "peers": [ { - "url": "string", "network": { - "name": "string", - "id": "string" - } + "id": "string", + "name": "string" + }, + "url": "string" } ] - } + }, + "severity": "string", + "type": "string" } ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_info.py index 2d4b88cb4..7aa697f10 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_info.py @@ -78,16 +78,16 @@ requirements: - meraki >= 2.4.9 - python >= 3.5 seealso: -- name: Cisco Meraki documentation for organizations,networks getNetwork +- name: Cisco Meraki documentation for networks getNetwork description: Complete reference of the getNetwork API. link: https://developer.cisco.com/meraki/api-v1/#!get-network -- name: Cisco Meraki documentation for organizations,networks getOrganizationNetworks +- name: Cisco Meraki documentation for networks getOrganizationNetworks description: Complete reference of the getOrganizationNetworks API. link: https://developer.cisco.com/meraki/api-v1/#!get-organization-networks notes: - SDK Method used are - organizationsnetworks.Organizationsnetworks.get_network, - organizationsnetworks.Organizationsnetworks.get_organization_networks, + networks.Networks.get_network, + networks.Networks.get_organization_networks, - Paths used are get /networks/{networkId}, @@ -162,19 +162,19 @@ meraki_response: type: dict sample: > { + "enrollmentString": "string", "id": "string", - "organizationId": "string", + "isBoundToConfigTemplate": true, "name": "string", + "notes": "string", + "organizationId": "string", "productTypes": [ "string" ], - "timeZone": "string", "tags": [ "string" ], - "enrollmentString": "string", - "url": "string", - "notes": "string", - "isBoundToConfigTemplate": true + "timeZone": "string", + "url": "string" } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_insight_applications_health_by_time_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_insight_applications_health_by_time_info.py index 955f5beee..3da4aedb1 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_insight_applications_health_by_time_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_insight_applications_health_by_time_info.py @@ -104,18 +104,18 @@ meraki_response: sample: > [ { - "startTs": "string", "endTs": "string", - "wanGoodput": 0, "lanGoodput": 0, - "wanLatencyMs": 0, "lanLatencyMs": 0, - "wanLossPercent": 0, "lanLossPercent": 0, + "numClients": 0, + "recv": 0, "responseDuration": 0, "sent": 0, - "recv": 0, - "numClients": 0 + "startTs": "string", + "wanGoodput": 0, + "wanLatencyMs": 0, + "wanLossPercent": 0 } ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_meraki_auth_users.py b/ansible_collections/cisco/meraki/plugins/modules/networks_meraki_auth_users.py index 41f61c823..39578076a 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_meraki_auth_users.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_meraki_auth_users.py @@ -13,9 +13,7 @@ description: - > Authorize a user configured with Meraki Authentication for a network currently supports 802.1X, splash guest, and client VPN users, and currently, organizations have a 50,000 user cap . -- > - Deauthorize a user. To reauthorize a user after deauthorizing them, POST to this endpoint. Currently, 802.1X - RADIUS, splash guest, and client VPN users can be deauthorized. . +- Delete an 802.1X RADIUS user, or deauthorize and optionally delete a splash guest or client VPN user. - > Update a user configured with Meraki Authentication currently, 802.1X RADIUS, splash guest, and client VPN users can be updated . @@ -26,7 +24,7 @@ author: Francisco Munoz (@fmunoz) options: accountType: description: Authorization type for user. Can be 'Guest' or '802.1X' for wireless - networks, or 'Client VPN' for wired networks. Defaults to '802.1X'. + networks, or 'Client VPN' for MX networks. Defaults to '802.1X'. type: str authorizations: description: Authorization zones and expiration dates for the user. @@ -41,6 +39,12 @@ options: being authorized, which must be configured for the user's given accountType. type: int type: list + delete: + description: Delete query parameter. If the ID supplied is for a splash guest or + client VPN user, and that user is not authorized for any other networks in the + organization, then also delete the user. 802.1X RADIUS users are always deleted + regardless of this optional attribute. + type: bool email: description: Email address of the user. type: str @@ -124,7 +128,7 @@ EXAMPLES = r""" networkId: string password: secret -- name: Update by id +- name: Delete by id cisco.meraki.networks_meraki_auth_users: meraki_api_key: "{{meraki_api_key}}" meraki_base_url: "{{meraki_base_url}}" @@ -146,17 +150,12 @@ EXAMPLES = r""" meraki_be_geo_id: "{{meraki_be_geo_id}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: present - authorizations: - - expiresAt: '2018-03-13T00:00:00.090210Z' - ssidNumber: 1 - emailPasswordToUser: false + state: absent + delete: true merakiAuthUserId: string - name: Miles Meraki networkId: string - password: secret -- name: Delete by id +- name: Update by id cisco.meraki.networks_meraki_auth_users: meraki_api_key: "{{meraki_api_key}}" meraki_base_url: "{{meraki_base_url}}" @@ -178,9 +177,15 @@ EXAMPLES = r""" meraki_be_geo_id: "{{meraki_be_geo_id}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: absent + state: present + authorizations: + - expiresAt: '2018-03-13T00:00:00.090210Z' + ssidNumber: 1 + emailPasswordToUser: false merakiAuthUserId: string + name: Miles Meraki networkId: string + password: secret """ RETURN = r""" @@ -190,20 +195,20 @@ meraki_response: type: dict sample: > { - "id": "string", - "email": "string", - "name": "string", - "createdAt": "string", "accountType": "string", - "isAdmin": true, "authorizations": [ { - "ssidNumber": 0, + "authorizedByEmail": "string", + "authorizedByName": "string", "authorizedZone": "string", "expiresAt": "string", - "authorizedByName": "string", - "authorizedByEmail": "string" + "ssidNumber": 0 } - ] + ], + "createdAt": "string", + "email": "string", + "id": "string", + "isAdmin": true, + "name": "string" } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_meraki_auth_users_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_meraki_auth_users_info.py index 5d1e15e3d..f7a2293d9 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_meraki_auth_users_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_meraki_auth_users_info.py @@ -13,7 +13,7 @@ description: - Get networks _merakiauthusers by id. - > List the users configured under Meraki Authentication for a network splash guest or RADIUS users for a wireless - network, or client VPN users for a wired network . + network, or client VPN users for a MX network . - Return the Meraki Auth splash guest, RADIUS, or client VPN user. version_added: '2.16.0' extends_documentation_fragment: @@ -111,20 +111,20 @@ meraki_response: type: dict sample: > { - "id": "string", - "email": "string", - "name": "string", - "createdAt": "string", "accountType": "string", - "isAdmin": true, "authorizations": [ { - "ssidNumber": 0, + "authorizedByEmail": "string", + "authorizedByName": "string", "authorizedZone": "string", "expiresAt": "string", - "authorizedByName": "string", - "authorizedByEmail": "string" + "ssidNumber": 0 } - ] + ], + "createdAt": "string", + "email": "string", + "id": "string", + "isAdmin": true, + "name": "string" } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_mqtt_brokers.py b/ansible_collections/cisco/meraki/plugins/modules/networks_mqtt_brokers.py index a5c897a17..a52f4fe29 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_mqtt_brokers.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_mqtt_brokers.py @@ -18,6 +18,13 @@ author: Francisco Munoz (@fmunoz) options: authentication: description: Authentication settings of the MQTT broker. + suboptions: + password: + description: Password for the MQTT broker. + type: str + username: + description: Username for the MQTT broker. + type: str type: dict host: description: Host name/IP address where the MQTT broker runs. @@ -37,7 +44,7 @@ options: mode: description: Security protocol of the MQTT broker. type: str - security: + tls: description: TLS settings of the MQTT broker. suboptions: caCertificate: @@ -88,15 +95,16 @@ EXAMPLES = r""" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" authentication: - username: Username - host: 1.1.1.1 + password: '*****' + username: milesmeraki + host: 1.2.3.4 name: MQTT_Broker_1 networkId: string - port: 1234 + port: 443 security: mode: tls tls: - hasCaCertificate: true + caCertificate: '*****' verifyHostnames: true """ @@ -106,5 +114,20 @@ meraki_response: returned: always type: dict sample: > - {} + { + "authentication": { + "username": "string" + }, + "host": "string", + "id": "string", + "name": "string", + "port": 0, + "security": { + "mode": "string", + "tls": { + "hasCaCertificate": true, + "verifyHostnames": true + } + } + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_netflow.py b/ansible_collections/cisco/meraki/plugins/modules/networks_netflow.py index e3bc1b646..10acb1d5e 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_netflow.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_netflow.py @@ -90,5 +90,11 @@ meraki_response: returned: always type: dict sample: > - {} + { + "collectorIp": "string", + "collectorPort": 0, + "etaDstPort": 0, + "etaEnabled": true, + "reportingEnabled": true + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_netflow_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_netflow_info.py index d5fb5dcc9..fb3168440 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_netflow_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_netflow_info.py @@ -70,6 +70,12 @@ meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always type: dict - sample: - - {} + sample: > + { + "collectorIp": "string", + "collectorPort": 0, + "etaDstPort": 0, + "etaEnabled": true, + "reportingEnabled": true + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_pii_pii_keys_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_pii_pii_keys_info.py index a96737ef0..4dfb193f5 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_pii_pii_keys_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_pii_pii_keys_info.py @@ -103,6 +103,25 @@ meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always type: dict - sample: - - {} + sample: > + { + "bluetoothMacs": [ + "string" + ], + "emails": [ + "string" + ], + "imeis": [ + "string" + ], + "macs": [ + "string" + ], + "serials": [ + "string" + ], + "usernames": [ + "string" + ] + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_pii_requests_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_pii_requests_info.py index 6536069b6..5608b757a 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_pii_requests_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_pii_requests_info.py @@ -106,10 +106,17 @@ RETURN = r""" meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always - type: list - elements: dict + type: dict sample: > - [ - {} - ] + { + "completedAt": 0, + "createdAt": 0, + "datasets": "string", + "id": "string", + "mac": "string", + "networkId": "string", + "organizationWide": true, + "status": "string", + "type": "string" + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_pii_sm_devices_for_key_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_pii_sm_devices_for_key_info.py index 488dd4d24..f3be5aaf2 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_pii_sm_devices_for_key_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_pii_sm_devices_for_key_info.py @@ -102,7 +102,10 @@ RETURN = r""" meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always - type: dict - sample: - - {} + type: list + elements: str + sample: > + [ + "string" + ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_pii_sm_owners_for_key_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_pii_sm_owners_for_key_info.py index 1387ce301..b3369a8e0 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_pii_sm_owners_for_key_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_pii_sm_owners_for_key_info.py @@ -102,7 +102,10 @@ RETURN = r""" meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always - type: dict - sample: - - {} + type: list + elements: str + sample: > + [ + "string" + ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_policies_by_client_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_policies_by_client_info.py index 36c8ca8fd..309902377 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_policies_by_client_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_policies_by_client_info.py @@ -111,20 +111,20 @@ meraki_response: sample: > [ { - "name": "string", - "clientId": "string", "assigned": [ { - "name": "string", - "type": "string", "groupPolicyId": "string", + "name": "string", "ssid": [ { "ssidNumber": 0 } - ] + ], + "type": "string" } - ] + ], + "clientId": "string", + "name": "string" } ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_sensor_alerts_current_overview_by_metric_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_sensor_alerts_current_overview_by_metric_info.py index 252fccc0d..8396447d2 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_sensor_alerts_current_overview_by_metric_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_sensor_alerts_current_overview_by_metric_info.py @@ -72,20 +72,28 @@ meraki_response: type: dict sample: > { - "supportedMetrics": [ - "string" - ], "counts": { + "apparentPower": 0, + "co2": 0, + "current": 0, "door": 0, + "frequency": 0, "humidity": 0, "indoorAirQuality": 0, "noise": { "ambient": 0 }, "pm25": 0, + "powerFactor": 0, + "realPower": 0, "temperature": 0, "tvoc": 0, + "upstreamPower": 0, + "voltage": 0, "water": 0 - } + }, + "supportedMetrics": [ + "string" + ] } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_sensor_alerts_overview_by_metric_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_sensor_alerts_overview_by_metric_info.py index 591800095..8d3b31ab9 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_sensor_alerts_overview_by_metric_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_sensor_alerts_overview_by_metric_info.py @@ -99,20 +99,28 @@ meraki_response: sample: > [ { - "startTs": "string", - "endTs": "string", "counts": { + "apparentPower": 0, + "co2": 0, + "current": 0, "door": 0, + "frequency": 0, "humidity": 0, "indoorAirQuality": 0, "noise": { "ambient": 0 }, "pm25": 0, + "powerFactor": 0, + "realPower": 0, "temperature": 0, "tvoc": 0, + "upstreamPower": 0, + "voltage": 0, "water": 0 - } + }, + "endTs": "string", + "startTs": "string" } ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_sensor_alerts_profiles.py b/ansible_collections/cisco/meraki/plugins/modules/networks_sensor_alerts_profiles.py index 67b7f3c87..6b8cfb841 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_sensor_alerts_profiles.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_sensor_alerts_profiles.py @@ -25,17 +25,19 @@ options: direction: description: If 'above', an alert will be sent when a sensor reads above the threshold. If 'below', an alert will be sent when a sensor reads below the - threshold. Only applicable for temperature and humidity thresholds. + threshold. Only applicable for temperature, humidity, realPower, apparentPower, + powerFactor, voltage, current, and frequency thresholds. type: str duration: description: Length of time in seconds that the triggering state must persist before an alert is sent. Available options are 0 seconds, 1 minute, 2 minutes, - 3 minutes, 4 minutes, 5 minutes, 10 minutes, 15 minutes, 30 minutes, and 1 - hour. Default is 0. + 3 minutes, 4 minutes, 5 minutes, 10 minutes, 15 minutes, 30 minutes, 1 hour, + 2 hours, 4 hours, and 8 hours. Default is 0. type: int metric: description: The type of sensor metric that will be monitored for changes. Available - metrics are door, humidity, indoorAirQuality, noise, pm25, temperature, tvoc, + metrics are apparentPower, co2, current, door, frequency, humidity, indoorAirQuality, + noise, pm25, powerFactor, realPower, temperature, tvoc, upstreamPower, voltage, and water. type: str threshold: @@ -43,6 +45,21 @@ options: This object should contain a single property key matching the condition's 'metric' value. suboptions: + apparentPower: + description: Apparent power threshold. 'draw' must be provided. + suboptions: + draw: + description: Alerting threshold in volt-amps. Must be between 0 and + 3750. + type: float + type: dict + current: + description: Electrical current threshold. 'level' must be provided. + suboptions: + draw: + description: Alerting threshold in amps. Must be between 0 and 15. + type: float + type: dict door: description: Door open threshold. 'open' must be provided and set to true. suboptions: @@ -51,6 +68,13 @@ options: true. type: bool type: dict + frequency: + description: Electrical frequency threshold. 'level' must be provided. + suboptions: + level: + description: Alerting threshold in hertz. Must be between 0 and 60. + type: float + type: dict humidity: description: Humidity threshold. One of 'relativePercentage' or 'quality' must be provided. @@ -100,6 +124,21 @@ options: description: Alerting threshold as a qualitative PM2.5 level. type: str type: dict + powerFactor: + description: Power factor threshold. 'percentage' must be provided. + suboptions: + percentage: + description: Alerting threshold as the ratio of active power to apparent + power. Must be between 0 and 100. + type: int + type: dict + realPower: + description: Real power threshold. 'draw' must be provided. + suboptions: + draw: + description: Alerting threshold in watts. Must be between 0 and 3750. + type: float + type: dict temperature: description: Temperature threshold. One of 'celsius', 'fahrenheit', or 'quality' must be provided. @@ -125,6 +164,22 @@ options: description: Alerting threshold as a qualitative TVOC level. type: str type: dict + upstreamPower: + description: Upstream power threshold. 'outageDetected' must be provided + and set to true. + suboptions: + outageDetected: + description: Alerting threshold for an upstream power event. Must be + set to true. + type: bool + type: dict + voltage: + description: Voltage threshold. 'level' must be provided. + suboptions: + level: + description: Alerting threshold in volts. Must be between 0 and 250. + type: float + type: dict water: description: Water detection threshold. 'present' must be provided and set to true. @@ -146,7 +201,7 @@ options: description: NetworkId path parameter. Network ID. type: str recipients: - description: List of recipients that will recieve the alert. + description: List of recipients that will receive the alert. suboptions: emails: description: A list of emails that will receive information about the alert. @@ -228,8 +283,14 @@ EXAMPLES = r""" duration: 60 metric: temperature threshold: + apparentPower: + draw: 17.2 + current: + draw: 0.14 door: open: true + frequency: + level: 58.8 humidity: quality: inadequate relativePercentage: 65 @@ -243,13 +304,21 @@ EXAMPLES = r""" pm25: concentration: 90 quality: fair + powerFactor: + percentage: 81 + realPower: + draw: 14.1 temperature: celsius: 20.5 - fahrenheit: 70 + fahrenheit: 70.0 quality: good tvoc: concentration: 400 quality: poor + upstreamPower: + outageDetected: true + voltage: + level: 119.5 water: present: true name: My Sensor Alert Profile @@ -268,6 +337,32 @@ EXAMPLES = r""" - Q234-ABCD-0002 - Q234-ABCD-0003 +- name: Delete by id + cisco.meraki.networks_sensor_alerts_profiles: + meraki_api_key: "{{meraki_api_key}}" + meraki_base_url: "{{meraki_base_url}}" + meraki_single_request_timeout: "{{meraki_single_request_timeout}}" + meraki_certificate_path: "{{meraki_certificate_path}}" + meraki_requests_proxy: "{{meraki_requests_proxy}}" + meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" + meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" + meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" + meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" + meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" + meraki_maximum_retries: "{{meraki_maximum_retries}}" + meraki_output_log: "{{meraki_output_log}}" + meraki_log_file_prefix: "{{meraki_log_file_prefix}}" + meraki_log_path: "{{meraki_log_path}}" + meraki_print_console: "{{meraki_print_console}}" + meraki_suppress_logging: "{{meraki_suppress_logging}}" + meraki_simulate: "{{meraki_simulate}}" + meraki_be_geo_id: "{{meraki_be_geo_id}}" + meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" + meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" + state: absent + id: string + networkId: string + - name: Update by id cisco.meraki.networks_sensor_alerts_profiles: meraki_api_key: "{{meraki_api_key}}" @@ -296,8 +391,14 @@ EXAMPLES = r""" duration: 60 metric: temperature threshold: + apparentPower: + draw: 17.2 + current: + draw: 0.14 door: open: true + frequency: + level: 58.8 humidity: quality: inadequate relativePercentage: 65 @@ -311,13 +412,21 @@ EXAMPLES = r""" pm25: concentration: 90 quality: fair + powerFactor: + percentage: 81 + realPower: + draw: 14.1 temperature: celsius: 20.5 - fahrenheit: 70 + fahrenheit: 70.0 quality: good tvoc: concentration: 400 quality: poor + upstreamPower: + outageDetected: true + voltage: + level: 119.5 water: present: true id: string @@ -337,32 +446,6 @@ EXAMPLES = r""" - Q234-ABCD-0002 - Q234-ABCD-0003 -- name: Delete by id - cisco.meraki.networks_sensor_alerts_profiles: - meraki_api_key: "{{meraki_api_key}}" - meraki_base_url: "{{meraki_base_url}}" - meraki_single_request_timeout: "{{meraki_single_request_timeout}}" - meraki_certificate_path: "{{meraki_certificate_path}}" - meraki_requests_proxy: "{{meraki_requests_proxy}}" - meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" - meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" - meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" - meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" - meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" - meraki_maximum_retries: "{{meraki_maximum_retries}}" - meraki_output_log: "{{meraki_output_log}}" - meraki_log_file_prefix: "{{meraki_log_file_prefix}}" - meraki_log_path: "{{meraki_log_path}}" - meraki_print_console: "{{meraki_print_console}}" - meraki_suppress_logging: "{{meraki_suppress_logging}}" - meraki_simulate: "{{meraki_simulate}}" - meraki_be_geo_id: "{{meraki_be_geo_id}}" - meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" - meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: absent - id: string - networkId: string - """ RETURN = r""" meraki_response: @@ -371,38 +454,31 @@ meraki_response: type: dict sample: > { - "profileId": "string", - "name": "string", - "schedule": { - "id": "string", - "name": "string" - }, "conditions": [ { + "direction": "string", + "duration": 0, "metric": "string", "threshold": { - "temperature": { - "celsius": 0, - "fahrenheit": 0, - "quality": "string" + "apparentPower": { + "draw": 0 }, - "humidity": { - "relativePercentage": 0, - "quality": "string" - }, - "water": { - "present": true + "current": { + "draw": 0 }, "door": { "open": true }, - "tvoc": { - "concentration": 0, - "quality": "string" + "frequency": { + "level": 0 }, - "pm25": { - "concentration": 0, - "quality": "string" + "humidity": { + "quality": "string", + "relativePercentage": 0 + }, + "indoorAirQuality": { + "quality": "string", + "score": 0 }, "noise": { "ambient": { @@ -410,26 +486,54 @@ meraki_response: "quality": "string" } }, - "indoorAirQuality": { - "score": 0, + "pm25": { + "concentration": 0, + "quality": "string" + }, + "powerFactor": { + "percentage": 0 + }, + "realPower": { + "draw": 0 + }, + "temperature": { + "celsius": 0, + "fahrenheit": 0, + "quality": "string" + }, + "tvoc": { + "concentration": 0, "quality": "string" + }, + "upstreamPower": { + "outageDetected": true + }, + "voltage": { + "level": 0 + }, + "water": { + "present": true } - }, - "direction": "string", - "duration": 0 + } } ], + "name": "string", + "profileId": "string", "recipients": { "emails": [ "string" ], - "smsNumbers": [ + "httpServerIds": [ "string" ], - "httpServerIds": [ + "smsNumbers": [ "string" ] }, + "schedule": { + "id": "string", + "name": "string" + }, "serials": [ "string" ] diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_sensor_alerts_profiles_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_sensor_alerts_profiles_info.py index 151433194..9f3ca1d12 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_sensor_alerts_profiles_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_sensor_alerts_profiles_info.py @@ -109,38 +109,31 @@ meraki_response: type: dict sample: > { - "profileId": "string", - "name": "string", - "schedule": { - "id": "string", - "name": "string" - }, "conditions": [ { + "direction": "string", + "duration": 0, "metric": "string", "threshold": { - "temperature": { - "celsius": 0, - "fahrenheit": 0, - "quality": "string" - }, - "humidity": { - "relativePercentage": 0, - "quality": "string" + "apparentPower": { + "draw": 0 }, - "water": { - "present": true + "current": { + "draw": 0 }, "door": { "open": true }, - "tvoc": { - "concentration": 0, - "quality": "string" + "frequency": { + "level": 0 }, - "pm25": { - "concentration": 0, - "quality": "string" + "humidity": { + "quality": "string", + "relativePercentage": 0 + }, + "indoorAirQuality": { + "quality": "string", + "score": 0 }, "noise": { "ambient": { @@ -148,26 +141,54 @@ meraki_response: "quality": "string" } }, - "indoorAirQuality": { - "score": 0, + "pm25": { + "concentration": 0, "quality": "string" + }, + "powerFactor": { + "percentage": 0 + }, + "realPower": { + "draw": 0 + }, + "temperature": { + "celsius": 0, + "fahrenheit": 0, + "quality": "string" + }, + "tvoc": { + "concentration": 0, + "quality": "string" + }, + "upstreamPower": { + "outageDetected": true + }, + "voltage": { + "level": 0 + }, + "water": { + "present": true } - }, - "direction": "string", - "duration": 0 + } } ], + "name": "string", + "profileId": "string", "recipients": { "emails": [ "string" ], - "smsNumbers": [ + "httpServerIds": [ "string" ], - "httpServerIds": [ + "smsNumbers": [ "string" ] }, + "schedule": { + "id": "string", + "name": "string" + }, "serials": [ "string" ] diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_sensor_mqtt_brokers.py b/ansible_collections/cisco/meraki/plugins/modules/networks_sensor_mqtt_brokers.py index 7503606ba..db086be0a 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_sensor_mqtt_brokers.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_sensor_mqtt_brokers.py @@ -78,7 +78,7 @@ meraki_response: type: dict sample: > { - "mqttBrokerId": "string", - "enabled": true + "enabled": true, + "mqttBrokerId": "string" } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_sensor_mqtt_brokers_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_sensor_mqtt_brokers_info.py index e4bf71113..27956dec0 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_sensor_mqtt_brokers_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_sensor_mqtt_brokers_info.py @@ -113,7 +113,7 @@ meraki_response: type: dict sample: > { - "mqttBrokerId": "string", - "enabled": true + "enabled": true, + "mqttBrokerId": "string" } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_sensor_relationships_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_sensor_relationships_info.py index 759d7ecc1..f976325ff 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_sensor_relationships_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_sensor_relationships_info.py @@ -76,15 +76,15 @@ meraki_response: { "device": { "name": "string", - "serial": "string", - "productType": "string" + "productType": "string", + "serial": "string" }, "relationships": { "livestream": { "relatedDevices": [ { - "serial": "string", - "productType": "string" + "productType": "string", + "serial": "string" } ] } diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_settings.py b/ansible_collections/cisco/meraki/plugins/modules/networks_settings.py index 06a298a59..a6529b36f 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_settings.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_settings.py @@ -40,6 +40,13 @@ options: </a><a target='_blank' href='http //wired.meraki.com/'>wired.meraki.com</a>). Optional (defaults to false). type: bool + namedVlans: + description: A hash of Named VLANs options applied to the Network. + suboptions: + enabled: + description: Enables / disables Named VLANs on the Network. + type: bool + type: dict networkId: description: NetworkId path parameter. Network ID. type: str @@ -99,6 +106,8 @@ EXAMPLES = r""" enabled: false password: miles123 localStatusPageEnabled: true + namedVlans: + enabled: true networkId: string remoteStatusPageEnabled: true securePort: @@ -112,26 +121,22 @@ meraki_response: type: dict sample: > { - "localStatusPageEnabled": true, - "remoteStatusPageEnabled": true, + "fips": { + "enabled": true + }, "localStatusPage": { "authentication": { "enabled": true, "username": "string" } }, - "securePort": { - "enabled": true - }, - "fips": { - "enabled": true - }, + "localStatusPageEnabled": true, "namedVlans": { "enabled": true }, - "clientPrivacy": { - "expireDataOlderThan": 0, - "expireDataBefore": "string" + "remoteStatusPageEnabled": true, + "securePort": { + "enabled": true } } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_settings_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_settings_info.py index 981f935ef..b42f23284 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_settings_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_settings_info.py @@ -72,26 +72,22 @@ meraki_response: type: dict sample: > { - "localStatusPageEnabled": true, - "remoteStatusPageEnabled": true, + "fips": { + "enabled": true + }, "localStatusPage": { "authentication": { "enabled": true, "username": "string" } }, - "securePort": { - "enabled": true - }, - "fips": { - "enabled": true - }, + "localStatusPageEnabled": true, "namedVlans": { "enabled": true }, - "clientPrivacy": { - "expireDataOlderThan": 0, - "expireDataBefore": "string" + "remoteStatusPageEnabled": true, + "securePort": { + "enabled": true } } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_sm_bypass_activation_lock_attempts_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_sm_bypass_activation_lock_attempts_info.py index a0ced3278..827557db1 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_sm_bypass_activation_lock_attempts_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_sm_bypass_activation_lock_attempts_info.py @@ -75,6 +75,20 @@ meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always type: dict - sample: - - {} + sample: > + { + "data": { + "2090938209": { + "errors": [ + "string" + ], + "success": true + }, + "38290139892": { + "success": true + } + }, + "id": "string", + "status": "string" + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_sm_devices_certs_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_sm_devices_certs_info.py index 2a220ae72..fb367f2e0 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_sm_devices_certs_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_sm_devices_certs_info.py @@ -79,14 +79,14 @@ meraki_response: sample: > [ { - "name": "string", - "notValidAfter": "string", - "notValidBefore": "string", "certPem": "string", "deviceId": "string", + "id": "string", "issuer": "string", - "subject": "string", - "id": "string" + "name": "string", + "notValidAfter": "string", + "notValidBefore": "string", + "subject": "string" } ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_sm_devices_checkin.py b/ansible_collections/cisco/meraki/plugins/modules/networks_sm_devices_checkin.py index 1dfc1c63b..cd679eb9e 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_sm_devices_checkin.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_sm_devices_checkin.py @@ -83,9 +83,9 @@ EXAMPLES = r""" - tag1 - tag2 serials: - - Q234-ABCD-0001 - - Q234-ABCD-0002 - - Q234-ABCD-0003 + - XY0XX0Y0X0 + - A01B01CD00E + - X02YZ1ZYZX wifiMacs: - 00:11:22:33:44:55 diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_sm_devices_desktop_logs_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_sm_devices_desktop_logs_info.py index 0b90c88b4..6b67442bd 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_sm_devices_desktop_logs_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_sm_devices_desktop_logs_info.py @@ -103,24 +103,24 @@ meraki_response: sample: > [ { + "dhcpServer": "string", + "dnsServer": "string", + "gateway": "string", + "ip": "string", "measuredAt": "string", - "user": "string", "networkDevice": "string", "networkDriver": "string", - "wifiChannel": "string", + "networkMTU": "string", + "publicIP": "string", + "subnet": "string", + "ts": "string", + "user": "string", "wifiAuth": "string", "wifiBssid": "string", - "wifiSsid": "string", - "wifiRssi": "string", + "wifiChannel": "string", "wifiNoise": "string", - "dhcpServer": "string", - "ip": "string", - "networkMTU": "string", - "subnet": "string", - "gateway": "string", - "publicIP": "string", - "dnsServer": "string", - "ts": "string" + "wifiRssi": "string", + "wifiSsid": "string" } ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_sm_devices_device_command_logs_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_sm_devices_device_command_logs_info.py index 255e05013..f3d21b8b1 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_sm_devices_device_command_logs_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_sm_devices_device_command_logs_info.py @@ -107,9 +107,9 @@ meraki_response: [ { "action": "string", - "name": "string", - "details": "string", "dashboardUser": "string", + "details": "string", + "name": "string", "ts": "string" } ] diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_sm_devices_device_profiles_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_sm_devices_device_profiles_info.py index fe6883bb9..0a076c7ae 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_sm_devices_device_profiles_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_sm_devices_device_profiles_info.py @@ -83,9 +83,9 @@ meraki_response: "id": "string", "isEncrypted": true, "isManaged": true, + "name": "string", "profileData": "string", "profileIdentifier": "string", - "name": "string", "version": "string" } ] diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_sm_devices_fields.py b/ansible_collections/cisco/meraki/plugins/modules/networks_sm_devices_fields.py index 57b97c54f..5560a6e52 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_sm_devices_fields.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_sm_devices_fields.py @@ -81,7 +81,7 @@ EXAMPLES = r""" notes: Here's some info about my device id: '1284392014819' networkId: string - serial: Q234-ABCD-5678 + serial: XY0XX0Y0X0 wifiMac: 00:11:22:33:44:55 """ @@ -95,9 +95,9 @@ meraki_response: { "id": "string", "name": "string", - "wifiMac": "string", + "notes": "string", "serial": "string", - "notes": "string" + "wifiMac": "string" } ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_sm_devices_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_sm_devices_info.py index ca4a080e0..7826fa7c8 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_sm_devices_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_sm_devices_info.py @@ -35,7 +35,7 @@ options: cellularDataUsed, isHotspotEnabled, createdAt, batteryEstCharge, quarantined, avName, avRunning, asName, fwName, isRooted, loginRequired, screenLockEnabled, screenLockDelay, autoLoginDisabled, autoTags, hasMdm, hasDesktopAgent, diskEncryptionEnabled, hardwareEncryptionCaps, passCodeLock, usesHardwareKeystore, - androidSecurityPatchVersion, and url. + androidSecurityPatchVersion, cellular, and url. elements: str type: list wifiMacs: @@ -53,6 +53,16 @@ options: - Ids query parameter. Filter devices by id(s). elements: str type: list + uuids: + description: + - Uuids query parameter. Filter devices by uuid(s). + elements: str + type: list + systemTypes: + description: + - SystemTypes query parameter. Filter devices by system type(s). + elements: str + type: list scope: description: - > @@ -120,6 +130,8 @@ EXAMPLES = r""" wifiMacs: [] serials: [] ids: [] + uuids: [] + systemTypes: [] scope: [] perPage: 0 startingAfter: string @@ -140,19 +152,19 @@ meraki_response: [ { "id": "string", + "ip": "string", "name": "string", + "notes": "string", + "osName": "string", + "serial": "string", + "serialNumber": "string", + "ssid": "string", + "systemModel": "string", "tags": [ "string" ], - "ssid": "string", - "wifiMac": "string", - "osName": "string", - "systemModel": "string", "uuid": "string", - "serialNumber": "string", - "serial": "string", - "ip": "string", - "notes": "string" + "wifiMac": "string" } ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_sm_devices_install_apps.py b/ansible_collections/cisco/meraki/plugins/modules/networks_sm_devices_install_apps.py new file mode 100644 index 000000000..8038f69f0 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_sm_devices_install_apps.py @@ -0,0 +1,87 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: networks_sm_devices_install_apps +short_description: Resource module for networks _sm _devices _installapps +description: +- Manage operation create of the resource networks _sm _devices _installapps. +- Install applications on a device. +version_added: '2.18.0' +extends_documentation_fragment: + - cisco.meraki.module +author: Francisco Munoz (@fmunoz) +options: + appIds: + description: Ids of applications to be installed. + elements: str + type: list + deviceId: + description: DeviceId path parameter. Device ID. + type: str + force: + description: By default, installation of an app which is believed to already be + present on the device will be skipped. If you'd like to force the installation + of the app, set this parameter to true. + type: bool + networkId: + description: NetworkId path parameter. Network ID. + type: str +requirements: +- meraki >= 2.4.9 +- python >= 3.5 +seealso: +- name: Cisco Meraki documentation for sm installNetworkSmDeviceApps + description: Complete reference of the installNetworkSmDeviceApps API. + link: https://developer.cisco.com/meraki/api-v1/#!install-network-sm-device-apps +notes: + - SDK Method used are + sm.Sm.install_network_sm_device_apps, + + - Paths used are + post /networks/{networkId}/sm/devices/{deviceId}/installApps, +""" + +EXAMPLES = r""" +- name: Create + cisco.meraki.networks_sm_devices_install_apps: + meraki_api_key: "{{meraki_api_key}}" + meraki_base_url: "{{meraki_base_url}}" + meraki_single_request_timeout: "{{meraki_single_request_timeout}}" + meraki_certificate_path: "{{meraki_certificate_path}}" + meraki_requests_proxy: "{{meraki_requests_proxy}}" + meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" + meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" + meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" + meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" + meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" + meraki_maximum_retries: "{{meraki_maximum_retries}}" + meraki_output_log: "{{meraki_output_log}}" + meraki_log_file_prefix: "{{meraki_log_file_prefix}}" + meraki_log_path: "{{meraki_log_path}}" + meraki_print_console: "{{meraki_print_console}}" + meraki_suppress_logging: "{{meraki_suppress_logging}}" + meraki_simulate: "{{meraki_simulate}}" + meraki_be_geo_id: "{{meraki_be_geo_id}}" + meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" + meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" + appIds: + - '1284392014819' + - '2983092129865' + deviceId: string + force: false + networkId: string + +""" +RETURN = r""" +meraki_response: + description: A dictionary or list with the response returned by the Cisco Meraki Python SDK + returned: always + type: dict + sample: > + {} +""" diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_sm_devices_lock.py b/ansible_collections/cisco/meraki/plugins/modules/networks_sm_devices_lock.py index 9f4c7c560..e55489942 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_sm_devices_lock.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_sm_devices_lock.py @@ -29,7 +29,7 @@ options: type: int scope: description: The scope (one of all, none, withAny, withAll, withoutAny, or withoutAll) - and a set of tags of the devices to be wiped. + and a set of tags of the devices to be locked. elements: str type: list serials: @@ -88,9 +88,9 @@ EXAMPLES = r""" - tag1 - tag2 serials: - - Q234-ABCD-0001 - - Q234-ABCD-0002 - - Q234-ABCD-0003 + - XY0XX0Y0X0 + - A01B01CD00E + - X02YZ1ZYZX wifiMacs: - 00:11:22:33:44:55 diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_sm_devices_modify_tags.py b/ansible_collections/cisco/meraki/plugins/modules/networks_sm_devices_modify_tags.py index a67885428..71dbec17a 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_sm_devices_modify_tags.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_sm_devices_modify_tags.py @@ -89,9 +89,9 @@ EXAMPLES = r""" scope: - withAny, old_tag serials: - - Q234-ABCD-0001 - - Q234-ABCD-0002 - - Q234-ABCD-0003 + - XY0XX0Y0X0 + - A01B01CD00E + - X02YZ1ZYZX tags: - tag1 - tag2 @@ -109,11 +109,11 @@ meraki_response: [ { "id": "string", + "serial": "string", "tags": [ "string" ], - "wifiMac": "string", - "serial": "string" + "wifiMac": "string" } ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_sm_devices_move.py b/ansible_collections/cisco/meraki/plugins/modules/networks_sm_devices_move.py index 822eb7715..0a4a627c1 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_sm_devices_move.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_sm_devices_move.py @@ -87,9 +87,9 @@ EXAMPLES = r""" - tag1 - tag2 serials: - - Q234-ABCD-0001 - - Q234-ABCD-0002 - - Q234-ABCD-0003 + - XY0XX0Y0X0 + - A01B01CD00E + - X02YZ1ZYZX wifiMacs: - 00:11:22:33:44:55 diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_sm_devices_performance_history_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_sm_devices_performance_history_info.py index 08ce482cf..e624aa532 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_sm_devices_performance_history_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_sm_devices_performance_history_info.py @@ -104,19 +104,19 @@ meraki_response: [ { "cpuPercentUsed": 0, - "memFree": 0, - "memWired": 0, - "memActive": 0, - "memInactive": 0, - "networkSent": 0, - "networkReceived": 0, - "swapUsed": 0, "diskUsage": { "c": { - "used": 0, - "space": 0 + "space": 0, + "used": 0 } }, + "memActive": 0, + "memFree": 0, + "memInactive": 0, + "memWired": 0, + "networkReceived": 0, + "networkSent": 0, + "swapUsed": 0, "ts": "string" } ] diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_sm_devices_reboot.py b/ansible_collections/cisco/meraki/plugins/modules/networks_sm_devices_reboot.py new file mode 100644 index 000000000..915ef3e40 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_sm_devices_reboot.py @@ -0,0 +1,126 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: networks_sm_devices_reboot +short_description: Resource module for networks _sm _devices _reboot +description: +- Manage operation create of the resource networks _sm _devices _reboot. +- Reboot a set of endpoints. +version_added: '2.18.0' +extends_documentation_fragment: + - cisco.meraki.module +author: Francisco Munoz (@fmunoz) +options: + ids: + description: The ids of the endpoints to be rebooted. + elements: str + type: list + kextPaths: + description: The KextPaths of the endpoints to be rebooted. Available for macOS + 11+. + elements: str + type: list + networkId: + description: NetworkId path parameter. Network ID. + type: str + notifyUser: + description: Whether or not to notify the user before rebooting the endpoint. Available + for macOS 11.3+. + type: bool + rebuildKernelCache: + description: Whether or not to rebuild the kernel cache when rebooting the endpoint. + Available for macOS 11+. + type: bool + requestRequiresNetworkTether: + description: Whether or not the request requires network tethering. Available for + macOS and supervised iOS or tvOS. + type: bool + scope: + description: The scope (one of all, none, withAny, withAll, withoutAny, or withoutAll) + and a set of tags of the endpoints to be rebooted. + elements: str + type: list + serials: + description: The serials of the endpoints to be rebooted. + elements: str + type: list + wifiMacs: + description: The wifiMacs of the endpoints to be rebooted. + elements: str + type: list +requirements: +- meraki >= 2.4.9 +- python >= 3.5 +seealso: +- name: Cisco Meraki documentation for sm rebootNetworkSmDevices + description: Complete reference of the rebootNetworkSmDevices API. + link: https://developer.cisco.com/meraki/api-v1/#!reboot-network-sm-devices +notes: + - SDK Method used are + sm.Sm.reboot_network_sm_devices, + + - Paths used are + post /networks/{networkId}/sm/devices/reboot, +""" + +EXAMPLES = r""" +- name: Create + cisco.meraki.networks_sm_devices_reboot: + meraki_api_key: "{{meraki_api_key}}" + meraki_base_url: "{{meraki_base_url}}" + meraki_single_request_timeout: "{{meraki_single_request_timeout}}" + meraki_certificate_path: "{{meraki_certificate_path}}" + meraki_requests_proxy: "{{meraki_requests_proxy}}" + meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" + meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" + meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" + meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" + meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" + meraki_maximum_retries: "{{meraki_maximum_retries}}" + meraki_output_log: "{{meraki_output_log}}" + meraki_log_file_prefix: "{{meraki_log_file_prefix}}" + meraki_log_path: "{{meraki_log_path}}" + meraki_print_console: "{{meraki_print_console}}" + meraki_suppress_logging: "{{meraki_suppress_logging}}" + meraki_simulate: "{{meraki_simulate}}" + meraki_be_geo_id: "{{meraki_be_geo_id}}" + meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" + meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" + ids: + - '1284392014819' + - '2983092129865' + kextPaths: + - test + networkId: string + notifyUser: true + rebuildKernelCache: true + requestRequiresNetworkTether: true + scope: + - withAny + - tag1 + - tag2 + serials: + - XY0XX0Y0X0 + - A01B01CD00E + - X02YZ1ZYZX + wifiMacs: + - 00:11:22:33:44:55 + +""" +RETURN = r""" +meraki_response: + description: A dictionary or list with the response returned by the Cisco Meraki Python SDK + returned: always + type: dict + sample: > + { + "ids": [ + "string" + ] + } +""" diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_sm_devices_security_centers_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_sm_devices_security_centers_info.py index 0b375bccf..22874c3b3 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_sm_devices_security_centers_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_sm_devices_security_centers_info.py @@ -92,7 +92,6 @@ meraki_response: "id": "string", "identifier": "string", "installedAt": "string", - "toInstall": true, "iosRedemptionCode": true, "isManaged": true, "itunesId": "string", @@ -102,6 +101,7 @@ meraki_response: "redemptionCode": 0, "shortVersion": "string", "status": "string", + "toInstall": true, "toUninstall": true, "uninstalledAt": "string", "updatedAt": "string", diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_sm_devices_shutdown.py b/ansible_collections/cisco/meraki/plugins/modules/networks_sm_devices_shutdown.py new file mode 100644 index 000000000..0c92fcb85 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_sm_devices_shutdown.py @@ -0,0 +1,104 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: networks_sm_devices_shutdown +short_description: Resource module for networks _sm _devices _shutdown +description: +- Manage operation create of the resource networks _sm _devices _shutdown. +- Shutdown a set of endpoints. +version_added: '2.18.0' +extends_documentation_fragment: + - cisco.meraki.module +author: Francisco Munoz (@fmunoz) +options: + ids: + description: The ids of the endpoints to be shutdown. + elements: str + type: list + networkId: + description: NetworkId path parameter. Network ID. + type: str + scope: + description: The scope (one of all, none, withAny, withAll, withoutAny, or withoutAll) + and a set of tags of the endpoints to be shutdown. + elements: str + type: list + serials: + description: The serials of the endpoints to be shutdown. + elements: str + type: list + wifiMacs: + description: The wifiMacs of the endpoints to be shutdown. + elements: str + type: list +requirements: +- meraki >= 2.4.9 +- python >= 3.5 +seealso: +- name: Cisco Meraki documentation for sm shutdownNetworkSmDevices + description: Complete reference of the shutdownNetworkSmDevices API. + link: https://developer.cisco.com/meraki/api-v1/#!shutdown-network-sm-devices +notes: + - SDK Method used are + sm.Sm.shutdown_network_sm_devices, + + - Paths used are + post /networks/{networkId}/sm/devices/shutdown, +""" + +EXAMPLES = r""" +- name: Create + cisco.meraki.networks_sm_devices_shutdown: + meraki_api_key: "{{meraki_api_key}}" + meraki_base_url: "{{meraki_base_url}}" + meraki_single_request_timeout: "{{meraki_single_request_timeout}}" + meraki_certificate_path: "{{meraki_certificate_path}}" + meraki_requests_proxy: "{{meraki_requests_proxy}}" + meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" + meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" + meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" + meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" + meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" + meraki_maximum_retries: "{{meraki_maximum_retries}}" + meraki_output_log: "{{meraki_output_log}}" + meraki_log_file_prefix: "{{meraki_log_file_prefix}}" + meraki_log_path: "{{meraki_log_path}}" + meraki_print_console: "{{meraki_print_console}}" + meraki_suppress_logging: "{{meraki_suppress_logging}}" + meraki_simulate: "{{meraki_simulate}}" + meraki_be_geo_id: "{{meraki_be_geo_id}}" + meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" + meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" + ids: + - '1284392014819' + - '2983092129865' + networkId: string + scope: + - withAny + - tag1 + - tag2 + serials: + - XY0XX0Y0X0 + - A01B01CD00E + - X02YZ1ZYZX + wifiMacs: + - 00:11:22:33:44:55 + +""" +RETURN = r""" +meraki_response: + description: A dictionary or list with the response returned by the Cisco Meraki Python SDK + returned: always + type: dict + sample: > + { + "ids": [ + "string" + ] + } +""" diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_sm_devices_unenroll.py b/ansible_collections/cisco/meraki/plugins/modules/networks_sm_devices_unenroll.py index aa23004df..560571fe2 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_sm_devices_unenroll.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_sm_devices_unenroll.py @@ -70,5 +70,7 @@ meraki_response: returned: always type: dict sample: > - {} + { + "success": true + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_sm_devices_uninstall_apps.py b/ansible_collections/cisco/meraki/plugins/modules/networks_sm_devices_uninstall_apps.py new file mode 100644 index 000000000..938728a96 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_sm_devices_uninstall_apps.py @@ -0,0 +1,81 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: networks_sm_devices_uninstall_apps +short_description: Resource module for networks _sm _devices _uninstallapps +description: +- Manage operation create of the resource networks _sm _devices _uninstallapps. +- Uninstall applications on a device. +version_added: '2.18.0' +extends_documentation_fragment: + - cisco.meraki.module +author: Francisco Munoz (@fmunoz) +options: + appIds: + description: Ids of applications to be uninstalled. + elements: str + type: list + deviceId: + description: DeviceId path parameter. Device ID. + type: str + networkId: + description: NetworkId path parameter. Network ID. + type: str +requirements: +- meraki >= 2.4.9 +- python >= 3.5 +seealso: +- name: Cisco Meraki documentation for sm uninstallNetworkSmDeviceApps + description: Complete reference of the uninstallNetworkSmDeviceApps API. + link: https://developer.cisco.com/meraki/api-v1/#!uninstall-network-sm-device-apps +notes: + - SDK Method used are + sm.Sm.uninstall_network_sm_device_apps, + + - Paths used are + post /networks/{networkId}/sm/devices/{deviceId}/uninstallApps, +""" + +EXAMPLES = r""" +- name: Create + cisco.meraki.networks_sm_devices_uninstall_apps: + meraki_api_key: "{{meraki_api_key}}" + meraki_base_url: "{{meraki_base_url}}" + meraki_single_request_timeout: "{{meraki_single_request_timeout}}" + meraki_certificate_path: "{{meraki_certificate_path}}" + meraki_requests_proxy: "{{meraki_requests_proxy}}" + meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" + meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" + meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" + meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" + meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" + meraki_maximum_retries: "{{meraki_maximum_retries}}" + meraki_output_log: "{{meraki_output_log}}" + meraki_log_file_prefix: "{{meraki_log_file_prefix}}" + meraki_log_path: "{{meraki_log_path}}" + meraki_print_console: "{{meraki_print_console}}" + meraki_suppress_logging: "{{meraki_suppress_logging}}" + meraki_simulate: "{{meraki_simulate}}" + meraki_be_geo_id: "{{meraki_be_geo_id}}" + meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" + meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" + appIds: + - '1284392014819' + - '2983092129865' + deviceId: string + networkId: string + +""" +RETURN = r""" +meraki_response: + description: A dictionary or list with the response returned by the Cisco Meraki Python SDK + returned: always + type: dict + sample: > + {} +""" diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_sm_devices_wipe.py b/ansible_collections/cisco/meraki/plugins/modules/networks_sm_devices_wipe.py index 898ef5533..fe83157b0 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_sm_devices_wipe.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_sm_devices_wipe.py @@ -73,7 +73,7 @@ EXAMPLES = r""" id: '1284392014819' networkId: string pin: 123456 - serial: Q234-ABCD-5678 + serial: XY0XX0Y0X0 wifiMac: 00:11:22:33:44:55 """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_sm_profiles_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_sm_profiles_info.py index d604680c3..9deb6ed0f 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_sm_profiles_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_sm_profiles_info.py @@ -23,6 +23,11 @@ options: description: - NetworkId path parameter. Network ID. type: str + payloadTypes: + description: + - PayloadTypes query parameter. Filter by payload types. + elements: str + type: list requirements: - meraki >= 2.4.9 - python >= 3.5 @@ -61,6 +66,7 @@ EXAMPLES = r""" meraki_be_geo_id: "{{meraki_be_geo_id}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" + payloadTypes: [] networkId: string register: result @@ -74,9 +80,12 @@ meraki_response: sample: > [ { + "description": "string", "id": "string", "name": "string", - "description": "string", + "payloadTypes": [ + "string" + ], "scope": "string", "tags": [ "string" diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_sm_target_groups.py b/ansible_collections/cisco/meraki/plugins/modules/networks_sm_target_groups.py index d9f5747d0..f6f047caa 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_sm_target_groups.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_sm_target_groups.py @@ -81,13 +81,11 @@ EXAMPLES = r""" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" state: present - name: My target group + name: Target group name networkId: string - scope: none - tags: '[]' - type: devices + scope: withAny, tag1, tag2 -- name: Update by id +- name: Delete by id cisco.meraki.networks_sm_target_groups: meraki_api_key: "{{meraki_api_key}}" meraki_base_url: "{{meraki_base_url}}" @@ -109,15 +107,11 @@ EXAMPLES = r""" meraki_be_geo_id: "{{meraki_be_geo_id}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: present - name: My target group + state: absent networkId: string - scope: none - tags: '[]' targetGroupId: string - type: devices -- name: Delete by id +- name: Update by id cisco.meraki.networks_sm_target_groups: meraki_api_key: "{{meraki_api_key}}" meraki_base_url: "{{meraki_base_url}}" @@ -139,8 +133,10 @@ EXAMPLES = r""" meraki_be_geo_id: "{{meraki_be_geo_id}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: absent + state: present + name: Target group name networkId: string + scope: withAny, tag1, tag2 targetGroupId: string """ @@ -150,5 +146,12 @@ meraki_response: returned: always type: dict sample: > - {} + { + "id": "string", + "name": "string", + "scope": "string", + "tags": [ + "string" + ] + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_sm_target_groups_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_sm_target_groups_info.py index 89fdccd5b..ffeee56aa 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_sm_target_groups_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_sm_target_groups_info.py @@ -114,10 +114,14 @@ RETURN = r""" meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always - type: list - elements: dict + type: dict sample: > - [ - {} - ] + { + "id": "string", + "name": "string", + "scope": "string", + "tags": [ + "string" + ] + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_sm_trusted_access_configs_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_sm_trusted_access_configs_info.py index 186fadc18..eff8e9682 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_sm_trusted_access_configs_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_sm_trusted_access_configs_info.py @@ -98,16 +98,19 @@ meraki_response: sample: > [ { + "accessEndAt": "string", + "accessStartAt": "string", + "additionalEmailText": "string", "id": "string", - "ssidName": "string", "name": "string", + "notifyTimeBeforeAccessEnds": 0, "scope": "string", + "sendExpirationEmails": true, + "ssidName": "string", "tags": [ "string" ], - "timeboundType": "string", - "accessStartAt": "string", - "accessEndAt": "string" + "timeboundType": "string" } ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_sm_user_access_devices_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_sm_user_access_devices_info.py index 8062c6c51..92e448472 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_sm_user_access_devices_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_sm_user_access_devices_info.py @@ -98,23 +98,23 @@ meraki_response: sample: > [ { + "email": "string", "id": "string", + "mac": "string", "name": "string", "systemType": "string", - "mac": "string", - "username": "string", - "email": "string", "tags": [ "string" ], "trustedAccessConnections": [ { - "trustedAccessConfigId": "string", "downloadedAt": "string", + "lastConnectedAt": "string", "scepCompletedAt": "string", - "lastConnectedAt": "string" + "trustedAccessConfigId": "string" } - ] + ], + "username": "string" } ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_sm_users_device_profiles_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_sm_users_device_profiles_info.py index c431cc0f7..585e2cffe 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_sm_users_device_profiles_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_sm_users_device_profiles_info.py @@ -83,9 +83,9 @@ meraki_response: "id": "string", "isEncrypted": true, "isManaged": true, + "name": "string", "profileData": "string", "profileIdentifier": "string", - "name": "string", "version": "string" } ] diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_sm_users_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_sm_users_info.py index 415e8595f..80b6839b8 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_sm_users_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_sm_users_info.py @@ -100,28 +100,28 @@ meraki_response: sample: > [ { - "id": "string", - "email": "string", - "fullName": "string", - "username": "string", - "hasPassword": true, - "tags": "string", "adGroups": [ "string" ], - "azureAdGroups": [ - "string" - ], - "samlGroups": [ + "asmGroups": [ "string" ], - "asmGroups": [ + "azureAdGroups": [ "string" ], - "isExternal": true, "displayName": "string", + "email": "string", + "fullName": "string", "hasIdentityCertificate": true, - "userThumbnail": "string" + "hasPassword": true, + "id": "string", + "isExternal": true, + "samlGroups": [ + "string" + ], + "tags": "string", + "userThumbnail": "string", + "username": "string" } ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_sm_users_softwares_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_sm_users_softwares_info.py index 03f436cc1..6ae05cbb9 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_sm_users_softwares_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_sm_users_softwares_info.py @@ -87,7 +87,6 @@ meraki_response: "id": "string", "identifier": "string", "installedAt": "string", - "toInstall": true, "iosRedemptionCode": true, "isManaged": true, "itunesId": "string", @@ -97,6 +96,7 @@ meraki_response: "redemptionCode": 0, "shortVersion": "string", "status": "string", + "toInstall": true, "toUninstall": true, "uninstalledAt": "string", "updatedAt": "string", diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_snmp.py b/ansible_collections/cisco/meraki/plugins/modules/networks_snmp.py index 5c17335a7..f9b6c0a6d 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_snmp.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_snmp.py @@ -77,6 +77,7 @@ EXAMPLES = r""" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" state: present access: users + communityString: sample networkId: string users: - passphrase: hunter2 @@ -89,5 +90,14 @@ meraki_response: returned: always type: dict sample: > - {} + { + "access": "string", + "communityString": "string", + "users": [ + { + "passphrase": "string", + "username": "string" + } + ] + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_snmp_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_snmp_info.py index 4ca9958df..31fbc2aab 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_snmp_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_snmp_info.py @@ -70,6 +70,15 @@ meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always type: dict - sample: - - {} + sample: > + { + "access": "string", + "communityString": "string", + "users": [ + { + "passphrase": "string", + "username": "string" + } + ] + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_split.py b/ansible_collections/cisco/meraki/plugins/modules/networks_split.py index 9eda61958..af15765be 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_split.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_split.py @@ -69,20 +69,20 @@ meraki_response: { "resultingNetworks": [ { + "enrollmentString": "string", "id": "string", - "organizationId": "string", + "isBoundToConfigTemplate": true, "name": "string", + "notes": "string", + "organizationId": "string", "productTypes": [ "string" ], - "timeZone": "string", "tags": [ "string" ], - "enrollmentString": "string", - "url": "string", - "notes": "string", - "isBoundToConfigTemplate": true + "timeZone": "string", + "url": "string" } ] } diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_access_control_lists.py b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_access_control_lists.py index fac22efdb..be67e1c03 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_access_control_lists.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_access_control_lists.py @@ -117,13 +117,13 @@ meraki_response: [ { "comment": "string", - "policy": "string", + "dstCidr": "string", + "dstPort": "string", "ipVersion": "string", + "policy": "string", "protocol": "string", "srcCidr": "string", "srcPort": "string", - "dstCidr": "string", - "dstPort": "string", "vlan": "string" } ] diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_access_control_lists_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_access_control_lists_info.py index 782199ed5..62bf7eeef 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_access_control_lists_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_access_control_lists_info.py @@ -75,13 +75,13 @@ meraki_response: [ { "comment": "string", - "policy": "string", + "dstCidr": "string", + "dstPort": "string", "ipVersion": "string", + "policy": "string", "protocol": "string", "srcCidr": "string", "srcPort": "string", - "dstCidr": "string", - "dstPort": "string", "vlan": "string" } ] diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_access_policies.py b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_access_policies.py index 6362763ed..3322ecc19 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_access_policies.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_access_policies.py @@ -228,6 +228,32 @@ EXAMPLES = r""" - 192.168.1.0/24 voiceVlanClients: true +- name: Delete by id + cisco.meraki.networks_switch_access_policies: + meraki_api_key: "{{meraki_api_key}}" + meraki_base_url: "{{meraki_base_url}}" + meraki_single_request_timeout: "{{meraki_single_request_timeout}}" + meraki_certificate_path: "{{meraki_certificate_path}}" + meraki_requests_proxy: "{{meraki_requests_proxy}}" + meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" + meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" + meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" + meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" + meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" + meraki_maximum_retries: "{{meraki_maximum_retries}}" + meraki_output_log: "{{meraki_output_log}}" + meraki_log_file_prefix: "{{meraki_log_file_prefix}}" + meraki_log_path: "{{meraki_log_path}}" + meraki_print_console: "{{meraki_print_console}}" + meraki_suppress_logging: "{{meraki_suppress_logging}}" + meraki_simulate: "{{meraki_simulate}}" + meraki_be_geo_id: "{{meraki_be_geo_id}}" + meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" + meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" + state: absent + accessPolicyNumber: string + networkId: string + - name: Update by id cisco.meraki.networks_switch_access_policies: meraki_api_key: "{{meraki_api_key}}" @@ -285,32 +311,6 @@ EXAMPLES = r""" - 192.168.1.0/24 voiceVlanClients: true -- name: Delete by id - cisco.meraki.networks_switch_access_policies: - meraki_api_key: "{{meraki_api_key}}" - meraki_base_url: "{{meraki_base_url}}" - meraki_single_request_timeout: "{{meraki_single_request_timeout}}" - meraki_certificate_path: "{{meraki_certificate_path}}" - meraki_requests_proxy: "{{meraki_requests_proxy}}" - meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" - meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" - meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" - meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" - meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" - meraki_maximum_retries: "{{meraki_maximum_retries}}" - meraki_output_log: "{{meraki_output_log}}" - meraki_log_file_prefix: "{{meraki_log_file_prefix}}" - meraki_log_path: "{{meraki_log_path}}" - meraki_print_console: "{{meraki_print_console}}" - meraki_suppress_logging: "{{meraki_suppress_logging}}" - meraki_simulate: "{{meraki_simulate}}" - meraki_be_geo_id: "{{meraki_be_geo_id}}" - meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" - meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: absent - accessPolicyNumber: string - networkId: string - """ RETURN = r""" meraki_response: @@ -319,25 +319,29 @@ meraki_response: type: dict sample: > { - "name": "string", - "radiusServers": [ - { - "host": "string", - "port": 0 + "accessPolicyType": "string", + "counts": { + "ports": { + "withThisPolicy": 0 } - ], + }, + "dot1x": { + "controlDirection": "string" + }, + "guestPortBouncing": true, + "guestVlanId": 0, + "hostMode": "string", + "increaseAccessSpeed": true, + "name": "string", "radius": { "criticalAuth": { "dataVlanId": 0, - "voiceVlanId": 0, - "suspendPortBounce": true + "suspendPortBounce": true, + "voiceVlanId": 0 }, "failedAuthVlanId": 0, "reAuthenticationInterval": 0 }, - "guestPortBouncing": true, - "radiusTestingEnabled": true, - "radiusCoaSupportEnabled": true, "radiusAccountingEnabled": true, "radiusAccountingServers": [ { @@ -345,18 +349,19 @@ meraki_response: "port": 0 } ], + "radiusCoaSupportEnabled": true, "radiusGroupAttribute": "string", - "hostMode": "string", - "accessPolicyType": "string", - "increaseAccessSpeed": true, - "guestVlanId": 0, - "dot1x": { - "controlDirection": "string" - }, - "voiceVlanClients": true, + "radiusServers": [ + { + "host": "string", + "port": 0 + } + ], + "radiusTestingEnabled": true, "urlRedirectWalledGardenEnabled": true, "urlRedirectWalledGardenRanges": [ "string" - ] + ], + "voiceVlanClients": true } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_access_policies_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_access_policies_info.py index fe1c7310e..fe9dddbaf 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_access_policies_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_access_policies_info.py @@ -111,25 +111,29 @@ meraki_response: type: dict sample: > { - "name": "string", - "radiusServers": [ - { - "host": "string", - "port": 0 + "accessPolicyType": "string", + "counts": { + "ports": { + "withThisPolicy": 0 } - ], + }, + "dot1x": { + "controlDirection": "string" + }, + "guestPortBouncing": true, + "guestVlanId": 0, + "hostMode": "string", + "increaseAccessSpeed": true, + "name": "string", "radius": { "criticalAuth": { "dataVlanId": 0, - "voiceVlanId": 0, - "suspendPortBounce": true + "suspendPortBounce": true, + "voiceVlanId": 0 }, "failedAuthVlanId": 0, "reAuthenticationInterval": 0 }, - "guestPortBouncing": true, - "radiusTestingEnabled": true, - "radiusCoaSupportEnabled": true, "radiusAccountingEnabled": true, "radiusAccountingServers": [ { @@ -137,18 +141,19 @@ meraki_response: "port": 0 } ], + "radiusCoaSupportEnabled": true, "radiusGroupAttribute": "string", - "hostMode": "string", - "accessPolicyType": "string", - "increaseAccessSpeed": true, - "guestVlanId": 0, - "dot1x": { - "controlDirection": "string" - }, - "voiceVlanClients": true, + "radiusServers": [ + { + "host": "string", + "port": 0 + } + ], + "radiusTestingEnabled": true, "urlRedirectWalledGardenEnabled": true, "urlRedirectWalledGardenRanges": [ "string" - ] + ], + "voiceVlanClients": true } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_alternate_management_interface_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_alternate_management_interface_info.py index a576b95ec..af4d2ba80 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_alternate_management_interface_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_alternate_management_interface_info.py @@ -70,6 +70,20 @@ meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always type: dict - sample: - - {} + sample: > + { + "enabled": true, + "protocols": [ + "string" + ], + "switches": [ + { + "alternateManagementIp": "string", + "gateway": "string", + "serial": "string", + "subnetMask": "string" + } + ], + "vlanId": 0 + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_dhcp_server_policy.py b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_dhcp_server_policy.py index b381c0d4a..7cee1227d 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_dhcp_server_policy.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_dhcp_server_policy.py @@ -95,12 +95,12 @@ EXAMPLES = r""" state: present alerts: email: - enabled: false + enabled: true allowedServers: - 00:50:56:00:00:01 - 00:50:56:00:00:02 arpInspection: - enabled: false + enabled: true blockedServers: - 00:50:56:00:00:03 - 00:50:56:00:00:04 @@ -114,5 +114,24 @@ meraki_response: returned: always type: dict sample: > - {} + { + "alerts": { + "email": { + "enabled": true + } + }, + "allowedServers": [ + "string" + ], + "arpInspection": { + "enabled": true, + "unsupportedModels": [ + "string" + ] + }, + "blockedServers": [ + "string" + ], + "defaultPolicy": "string" + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_dhcp_server_policy_arp_inspection_trusted_servers.py b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_dhcp_server_policy_arp_inspection_trusted_servers.py index b44011380..abc33d08a 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_dhcp_server_policy_arp_inspection_trusted_servers.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_dhcp_server_policy_arp_inspection_trusted_servers.py @@ -93,7 +93,7 @@ EXAMPLES = r""" networkId: string vlan: 100 -- name: Update by id +- name: Delete by id cisco.meraki.networks_switch_dhcp_server_policy_arp_inspection_trusted_servers: meraki_api_key: "{{meraki_api_key}}" meraki_base_url: "{{meraki_base_url}}" @@ -115,15 +115,11 @@ EXAMPLES = r""" meraki_be_geo_id: "{{meraki_be_geo_id}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: present - ipv4: - address: 1.2.3.4 - mac: 00:11:22:33:44:55 + state: absent networkId: string trustedServerId: string - vlan: 100 -- name: Delete by id +- name: Update by id cisco.meraki.networks_switch_dhcp_server_policy_arp_inspection_trusted_servers: meraki_api_key: "{{meraki_api_key}}" meraki_base_url: "{{meraki_base_url}}" @@ -145,9 +141,13 @@ EXAMPLES = r""" meraki_be_geo_id: "{{meraki_be_geo_id}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: absent + state: present + ipv4: + address: 1.2.3.4 + mac: 00:11:22:33:44:55 networkId: string trustedServerId: string + vlan: 100 """ RETURN = r""" @@ -157,11 +157,11 @@ meraki_response: type: dict sample: > { - "trustedServerId": "string", - "mac": "string", - "vlan": 0, "ipv4": { "address": "string" - } + }, + "mac": "string", + "trustedServerId": "string", + "vlan": 0 } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_dhcp_server_policy_arp_inspection_trusted_servers_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_dhcp_server_policy_arp_inspection_trusted_servers_info.py index e654b5159..c9b72ace5 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_dhcp_server_policy_arp_inspection_trusted_servers_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_dhcp_server_policy_arp_inspection_trusted_servers_info.py @@ -100,12 +100,12 @@ meraki_response: sample: > [ { - "trustedServerId": "string", - "mac": "string", - "vlan": 0, "ipv4": { "address": "string" - } + }, + "mac": "string", + "trustedServerId": "string", + "vlan": 0 } ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_dhcp_server_policy_arp_inspection_warnings_by_device_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_dhcp_server_policy_arp_inspection_warnings_by_device_info.py index ea6429340..f21ec3b9c 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_dhcp_server_policy_arp_inspection_warnings_by_device_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_dhcp_server_policy_arp_inspection_warnings_by_device_info.py @@ -98,11 +98,11 @@ meraki_response: sample: > [ { - "serial": "string", + "hasTrustedPort": true, "name": "string", - "url": "string", + "serial": "string", "supportsInspection": true, - "hasTrustedPort": true + "url": "string" } ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_dhcp_server_policy_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_dhcp_server_policy_info.py index 471741bc3..895a259d0 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_dhcp_server_policy_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_dhcp_server_policy_info.py @@ -72,6 +72,25 @@ meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always type: dict - sample: - - {} + sample: > + { + "alerts": { + "email": { + "enabled": true + } + }, + "allowedServers": [ + "string" + ], + "arpInspection": { + "enabled": true, + "unsupportedModels": [ + "string" + ] + }, + "blockedServers": [ + "string" + ], + "defaultPolicy": "string" + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_dhcp_v4_servers_seen_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_dhcp_v4_servers_seen_info.py index 824bbceea..b95a1890f 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_dhcp_v4_servers_seen_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_dhcp_v4_servers_seen_info.py @@ -111,98 +111,98 @@ meraki_response: sample: > [ { - "mac": "string", - "vlan": 0, "clientId": "string", - "isAllowed": true, - "lastSeenAt": "string", - "seenBy": [ - { - "serial": "string", - "name": "string", - "url": "string" - } - ], - "type": "string", "device": { - "serial": "string", - "name": "string", - "url": "string", "interface": { "name": "string", "url": "string" - } + }, + "name": "string", + "serial": "string", + "url": "string" }, "ipv4": { "address": "string", - "subnet": "string", - "gateway": "string" + "gateway": "string", + "subnet": "string" }, + "isAllowed": true, "isConfigured": true, "lastAck": { - "ts": "string", "ipv4": { "address": "string" - } + }, + "ts": "string" }, "lastPacket": { - "source": { - "mac": "string", - "ipv4": { - "address": "string" - }, - "port": 0 - }, "destination": { - "mac": "string", "ipv4": { "address": "string" }, + "mac": "string", "port": 0 }, - "type": "string", "ethernet": { "type": "string" }, - "ip": { - "id": "string", - "version": 0, - "length": 0, - "headerLength": 0, - "protocol": 0, - "ttl": 0, - "dscp": { - "tag": 0, - "ecn": 0 - } - }, - "udp": { - "length": 0, - "checksum": "string" - }, "fields": { - "op": 0, - "htype": 0, - "hlen": 0, - "hops": 0, - "xid": "string", - "secs": 0, - "flags": "string", + "chaddr": "string", "ciaddr": "string", - "yiaddr": "string", - "siaddr": "string", + "flags": "string", "giaddr": "string", - "chaddr": "string", - "sname": "string", + "hlen": 0, + "hops": 0, + "htype": 0, "magicCookie": "string", + "op": 0, "options": [ { "name": "string", "value": "string" } - ] + ], + "secs": 0, + "siaddr": "string", + "sname": "string", + "xid": "string", + "yiaddr": "string" + }, + "ip": { + "dscp": { + "ecn": 0, + "tag": 0 + }, + "headerLength": 0, + "id": "string", + "length": 0, + "protocol": 0, + "ttl": 0, + "version": 0 + }, + "source": { + "ipv4": { + "address": "string" + }, + "mac": "string", + "port": 0 + }, + "type": "string", + "udp": { + "checksum": "string", + "length": 0 } - } + }, + "lastSeenAt": "string", + "mac": "string", + "seenBy": [ + { + "name": "string", + "serial": "string", + "url": "string" + } + ], + "type": "string", + "vlan": 0 } ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_dscp_to_cos_mappings_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_dscp_to_cos_mappings_info.py index b13cc894c..9bc619a76 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_dscp_to_cos_mappings_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_dscp_to_cos_mappings_info.py @@ -69,7 +69,14 @@ RETURN = r""" meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always - type: dict - sample: - - {} + type: list + elements: dict + sample: > + [ + { + "cos": 0, + "dscp": 0, + "title": "string" + } + ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_link_aggregations.py b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_link_aggregations.py index 297dc628a..8a2b66e20 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_link_aggregations.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_link_aggregations.py @@ -120,7 +120,7 @@ EXAMPLES = r""" - portId: '8' serial: Q234-ABCD-0008 -- name: Update by id +- name: Delete by id cisco.meraki.networks_switch_link_aggregations: meraki_api_key: "{{meraki_api_key}}" meraki_base_url: "{{meraki_base_url}}" @@ -142,29 +142,11 @@ EXAMPLES = r""" meraki_be_geo_id: "{{meraki_be_geo_id}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: present - id: NDU2N18yXzM= + state: absent linkAggregationId: string networkId: string - switchPorts: - - portId: '1' - serial: Q234-ABCD-0001 - - portId: '2' - serial: Q234-ABCD-0002 - - portId: '3' - serial: Q234-ABCD-0003 - - portId: '4' - serial: Q234-ABCD-0004 - - portId: '5' - serial: Q234-ABCD-0005 - - portId: '6' - serial: Q234-ABCD-0006 - - portId: '7' - serial: Q234-ABCD-0007 - - portId: '8' - serial: Q234-ABCD-0008 -- name: Delete by id +- name: Update by id cisco.meraki.networks_switch_link_aggregations: meraki_api_key: "{{meraki_api_key}}" meraki_base_url: "{{meraki_base_url}}" @@ -186,9 +168,27 @@ EXAMPLES = r""" meraki_be_geo_id: "{{meraki_be_geo_id}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: absent + state: present + id: NDU2N18yXzM= linkAggregationId: string networkId: string + switchPorts: + - portId: '1' + serial: Q234-ABCD-0001 + - portId: '2' + serial: Q234-ABCD-0002 + - portId: '3' + serial: Q234-ABCD-0003 + - portId: '4' + serial: Q234-ABCD-0004 + - portId: '5' + serial: Q234-ABCD-0005 + - portId: '6' + serial: Q234-ABCD-0006 + - portId: '7' + serial: Q234-ABCD-0007 + - portId: '8' + serial: Q234-ABCD-0008 """ RETURN = r""" diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_link_aggregations_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_link_aggregations_info.py index 5b2d93fe6..a18dab1a4 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_link_aggregations_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_link_aggregations_info.py @@ -77,8 +77,8 @@ meraki_response: "id": "string", "switchPorts": [ { - "serial": "string", - "portId": "string" + "portId": "string", + "serial": "string" } ] } diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_mtu.py b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_mtu.py index 1d981d779..c0cecd5a0 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_mtu.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_mtu.py @@ -23,15 +23,15 @@ options: description: NetworkId path parameter. Network ID. type: str overrides: - description: Override MTU size for individual switches or switch profiles. An empty + description: Override MTU size for individual switches or switch templates. An empty array will clear overrides. elements: dict suboptions: mtuSize: - description: MTU size for the switches or switch profiles. + description: MTU size for the switches or switch templates. type: int switchProfiles: - description: List of switch profile IDs. Applicable only for template network. + description: List of switch template IDs. Applicable only for template network. elements: str type: list switches: diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_mtu_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_mtu_info.py index 1cc1be9bf..b037ff64b 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_mtu_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_mtu_info.py @@ -75,13 +75,13 @@ meraki_response: "defaultMtuSize": 0, "overrides": [ { - "switches": [ - "string" - ], + "mtuSize": 0, "switchProfiles": [ "string" ], - "mtuSize": 0 + "switches": [ + "string" + ] } ] } diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_port_schedules.py b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_port_schedules.py index 9b714e198..f07e52f59 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_port_schedules.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_port_schedules.py @@ -241,6 +241,32 @@ EXAMPLES = r""" from: '9:00' to: '17:00' +- name: Delete by id + cisco.meraki.networks_switch_port_schedules: + meraki_api_key: "{{meraki_api_key}}" + meraki_base_url: "{{meraki_base_url}}" + meraki_single_request_timeout: "{{meraki_single_request_timeout}}" + meraki_certificate_path: "{{meraki_certificate_path}}" + meraki_requests_proxy: "{{meraki_requests_proxy}}" + meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" + meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" + meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" + meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" + meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" + meraki_maximum_retries: "{{meraki_maximum_retries}}" + meraki_output_log: "{{meraki_output_log}}" + meraki_log_file_prefix: "{{meraki_log_file_prefix}}" + meraki_log_path: "{{meraki_log_path}}" + meraki_print_console: "{{meraki_print_console}}" + meraki_suppress_logging: "{{meraki_suppress_logging}}" + meraki_simulate: "{{meraki_simulate}}" + meraki_be_geo_id: "{{meraki_be_geo_id}}" + meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" + meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" + state: absent + networkId: string + portScheduleId: string + - name: Update by id cisco.meraki.networks_switch_port_schedules: meraki_api_key: "{{meraki_api_key}}" @@ -297,32 +323,6 @@ EXAMPLES = r""" to: '17:00' portScheduleId: string -- name: Delete by id - cisco.meraki.networks_switch_port_schedules: - meraki_api_key: "{{meraki_api_key}}" - meraki_base_url: "{{meraki_base_url}}" - meraki_single_request_timeout: "{{meraki_single_request_timeout}}" - meraki_certificate_path: "{{meraki_certificate_path}}" - meraki_requests_proxy: "{{meraki_requests_proxy}}" - meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" - meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" - meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" - meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" - meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" - meraki_maximum_retries: "{{meraki_maximum_retries}}" - meraki_output_log: "{{meraki_output_log}}" - meraki_log_file_prefix: "{{meraki_log_file_prefix}}" - meraki_log_path: "{{meraki_log_path}}" - meraki_print_console: "{{meraki_print_console}}" - meraki_suppress_logging: "{{meraki_suppress_logging}}" - meraki_simulate: "{{meraki_simulate}}" - meraki_be_geo_id: "{{meraki_be_geo_id}}" - meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" - meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: absent - networkId: string - portScheduleId: string - """ RETURN = r""" meraki_response: @@ -330,5 +330,46 @@ meraki_response: returned: always type: dict sample: > - {} + { + "id": "string", + "name": "string", + "networkId": "string", + "portSchedule": { + "friday": { + "active": true, + "from": "string", + "to": "string" + }, + "monday": { + "active": true, + "from": "string", + "to": "string" + }, + "saturday": { + "active": true, + "from": "string", + "to": "string" + }, + "sunday": { + "active": true, + "from": "string", + "to": "string" + }, + "thursday": { + "active": true, + "from": "string", + "to": "string" + }, + "tuesday": { + "active": true, + "from": "string", + "to": "string" + }, + "wednesday": { + "active": true, + "from": "string", + "to": "string" + } + } + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_port_schedules_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_port_schedules_info.py index 8a409eb51..aef71adc7 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_port_schedules_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_port_schedules_info.py @@ -76,38 +76,39 @@ meraki_response: { "id": "string", "name": "string", + "networkId": "string", "portSchedule": { - "monday": { + "friday": { "active": true, "from": "string", "to": "string" }, - "tuesday": { + "monday": { "active": true, "from": "string", "to": "string" }, - "wednesday": { + "saturday": { "active": true, "from": "string", "to": "string" }, - "thursday": { + "sunday": { "active": true, "from": "string", "to": "string" }, - "friday": { + "thursday": { "active": true, "from": "string", "to": "string" }, - "saturday": { + "tuesday": { "active": true, "from": "string", "to": "string" }, - "sunday": { + "wednesday": { "active": true, "from": "string", "to": "string" diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_qos_rules_order.py b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_qos_rules_order.py index f3bddd377..e5cc50e47 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_qos_rules_order.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_qos_rules_order.py @@ -108,7 +108,7 @@ EXAMPLES = r""" srcPortRange: 70-80 vlan: 100 -- name: Update by id +- name: Delete by id cisco.meraki.networks_switch_qos_rules_order: meraki_api_key: "{{meraki_api_key}}" meraki_base_url: "{{meraki_base_url}}" @@ -130,18 +130,11 @@ EXAMPLES = r""" meraki_be_geo_id: "{{meraki_be_geo_id}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: present - dscp: 0 - dstPort: 3000 - dstPortRange: 3000-3100 + state: absent networkId: string - protocol: TCP qosRuleId: string - srcPort: 2000 - srcPortRange: 70-80 - vlan: 100 -- name: Delete by id +- name: Update by id cisco.meraki.networks_switch_qos_rules_order: meraki_api_key: "{{meraki_api_key}}" meraki_base_url: "{{meraki_base_url}}" @@ -163,9 +156,16 @@ EXAMPLES = r""" meraki_be_geo_id: "{{meraki_be_geo_id}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: absent + state: present + dscp: 0 + dstPort: 3000 + dstPortRange: 3000-3100 networkId: string + protocol: TCP qosRuleId: string + srcPort: 2000 + srcPortRange: 70-80 + vlan: 100 """ RETURN = r""" @@ -174,5 +174,14 @@ meraki_response: returned: always type: dict sample: > - {} + { + "dscp": 0, + "dstPort": 0, + "dstPortRange": "string", + "id": "string", + "protocol": "string", + "srcPort": 0, + "srcPortRange": "string", + "vlan": 0 + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_qos_rules_order_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_qos_rules_order_info.py index 653bfd482..0ae4a4428 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_qos_rules_order_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_qos_rules_order_info.py @@ -106,10 +106,16 @@ RETURN = r""" meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always - type: list - elements: dict + type: dict sample: > - [ - {} - ] + { + "dscp": 0, + "dstPort": 0, + "dstPortRange": "string", + "id": "string", + "protocol": "string", + "srcPort": 0, + "srcPortRange": "string", + "vlan": 0 + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_routing_multicast.py b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_routing_multicast.py index 11f4d4269..2169b2ee9 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_routing_multicast.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_routing_multicast.py @@ -37,17 +37,17 @@ options: suboptions: floodUnknownMulticastTrafficEnabled: description: Flood unknown multicast traffic setting for switches, switch stacks - or switch profiles. + or switch templates. type: bool igmpSnoopingEnabled: - description: IGMP snooping setting for switches, switch stacks or switch profiles. + description: IGMP snooping setting for switches, switch stacks or switch templates. type: bool stacks: description: List of switch stack ids for non-template network. elements: str type: list switchProfiles: - description: List of switch profiles ids for template network. + description: List of switch templates ids for template network. elements: str type: list switches: @@ -101,16 +101,17 @@ EXAMPLES = r""" overrides: - floodUnknownMulticastTrafficEnabled: true igmpSnoopingEnabled: true - switches: - - Q234-ABCD-0001 - - Q234-ABCD-0002 - - Q234-ABCD-0003 - - floodUnknownMulticastTrafficEnabled: true - igmpSnoopingEnabled: true stacks: - '789102' - '123456' - '129102' + switchProfiles: + - '1234' + - '4567' + switches: + - Q234-ABCD-0001 + - Q234-ABCD-0002 + - Q234-ABCD-0003 """ RETURN = r""" @@ -119,5 +120,25 @@ meraki_response: returned: always type: dict sample: > - {} + { + "defaultSettings": { + "floodUnknownMulticastTrafficEnabled": true, + "igmpSnoopingEnabled": true + }, + "overrides": [ + { + "floodUnknownMulticastTrafficEnabled": true, + "igmpSnoopingEnabled": true, + "stacks": [ + "string" + ], + "switchProfiles": [ + "string" + ], + "switches": [ + "string" + ] + } + ] + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_routing_multicast_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_routing_multicast_info.py index 85afebe2e..a2b220be0 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_routing_multicast_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_routing_multicast_info.py @@ -70,6 +70,26 @@ meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always type: dict - sample: - - {} + sample: > + { + "defaultSettings": { + "floodUnknownMulticastTrafficEnabled": true, + "igmpSnoopingEnabled": true + }, + "overrides": [ + { + "floodUnknownMulticastTrafficEnabled": true, + "igmpSnoopingEnabled": true, + "stacks": [ + "string" + ], + "switchProfiles": [ + "string" + ], + "switches": [ + "string" + ] + } + ] + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_routing_multicast_rendezvous_points.py b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_routing_multicast_rendezvous_points.py index 77e3eb80d..c72cd9a7e 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_routing_multicast_rendezvous_points.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_routing_multicast_rendezvous_points.py @@ -19,7 +19,7 @@ extends_documentation_fragment: author: Francisco Munoz (@fmunoz) options: interfaceIp: - description: The IP address of the interface where the RP needs to be created. + description: "The\_IP address of the interface where the RP needs to be created." type: str multicastGroup: description: '''Any'', or the IP address of a multicast group.' @@ -80,10 +80,10 @@ EXAMPLES = r""" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" state: present interfaceIp: 192.168.1.2 - multicastGroup: 192.168.128.0/24 + multicastGroup: Any networkId: string -- name: Update by id +- name: Delete by id cisco.meraki.networks_switch_routing_multicast_rendezvous_points: meraki_api_key: "{{meraki_api_key}}" meraki_base_url: "{{meraki_base_url}}" @@ -105,13 +105,11 @@ EXAMPLES = r""" meraki_be_geo_id: "{{meraki_be_geo_id}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: present - interfaceIp: 192.168.1.2 - multicastGroup: 192.168.128.0/24 + state: absent networkId: string rendezvousPointId: string -- name: Delete by id +- name: Update by id cisco.meraki.networks_switch_routing_multicast_rendezvous_points: meraki_api_key: "{{meraki_api_key}}" meraki_base_url: "{{meraki_base_url}}" @@ -133,7 +131,9 @@ EXAMPLES = r""" meraki_be_geo_id: "{{meraki_be_geo_id}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: absent + state: present + interfaceIp: 192.168.1.2 + multicastGroup: Any networkId: string rendezvousPointId: string @@ -144,5 +144,11 @@ meraki_response: returned: always type: dict sample: > - {} + { + "interfaceIp": "string", + "interfaceName": "string", + "multicastGroup": "string", + "rendezvousPointId": "string", + "serial": "string" + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_routing_multicast_rendezvous_points_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_routing_multicast_rendezvous_points_info.py index de278e2bb..bb79e214e 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_routing_multicast_rendezvous_points_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_routing_multicast_rendezvous_points_info.py @@ -106,12 +106,13 @@ RETURN = r""" meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always - type: list - elements: list + type: dict sample: > - [ - [ - {} - ] - ] + { + "interfaceIp": "string", + "interfaceName": "string", + "multicastGroup": "string", + "rendezvousPointId": "string", + "serial": "string" + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_routing_ospf_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_routing_ospf_info.py index e8a33c356..4f42c51f8 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_routing_ospf_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_routing_ospf_info.py @@ -70,6 +70,34 @@ meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always type: dict - sample: - - {} + sample: > + { + "areas": [ + { + "areaId": "string", + "areaName": "string", + "areaType": "string" + } + ], + "deadTimerInSeconds": 0, + "enabled": true, + "helloTimerInSeconds": 0, + "md5AuthenticationEnabled": true, + "md5AuthenticationKey": { + "id": 0, + "passphrase": "string" + }, + "v3": { + "areas": [ + { + "areaId": "string", + "areaName": "string", + "areaType": "string" + } + ], + "deadTimerInSeconds": 0, + "enabled": true, + "helloTimerInSeconds": 0 + } + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_settings.py b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_settings.py index 61bff048d..239a875a1 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_settings.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_settings.py @@ -16,6 +16,13 @@ extends_documentation_fragment: - cisco.meraki.module author: Francisco Munoz (@fmunoz) options: + macBlocklist: + description: MAC blocklist. + suboptions: + enabled: + description: Enable MAC blocklist. + type: bool + type: dict networkId: description: NetworkId path parameter. Network ID. type: str @@ -30,6 +37,13 @@ options: description: Serial number of the switch. type: str type: list + uplinkClientSampling: + description: Uplink client sampling. + suboptions: + enabled: + description: Enable uplink client sampling. + type: bool + type: dict useCombinedPower: description: The use Combined Power as the default behavior of secondary power supplies on supported devices. @@ -76,10 +90,14 @@ EXAMPLES = r""" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" state: present + macBlocklist: + enabled: true networkId: string powerExceptions: - powerType: string serial: string + uplinkClientSampling: + enabled: true useCombinedPower: true vlan: 0 @@ -91,13 +109,19 @@ meraki_response: type: dict sample: > { - "vlan": 0, - "useCombinedPower": true, + "macBlocklist": { + "enabled": true + }, "powerExceptions": [ { - "serial": "string", - "powerType": "string" + "powerType": "string", + "serial": "string" } - ] + ], + "uplinkClientSampling": { + "enabled": true + }, + "useCombinedPower": true, + "vlan": 0 } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_settings_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_settings_info.py index 5328f4b5f..3a34301fb 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_settings_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_settings_info.py @@ -72,13 +72,19 @@ meraki_response: type: dict sample: > { - "vlan": 0, - "useCombinedPower": true, + "macBlocklist": { + "enabled": true + }, "powerExceptions": [ { - "serial": "string", - "powerType": "string" + "powerType": "string", + "serial": "string" } - ] + ], + "uplinkClientSampling": { + "enabled": true + }, + "useCombinedPower": true, + "vlan": 0 } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_stacks.py b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_stacks.py index 7d6303ed6..27eaa73be 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_stacks.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_stacks.py @@ -10,7 +10,7 @@ module: networks_switch_stacks short_description: Resource module for networks _switch _stacks description: - Manage operations create and delete of the resource networks _switch _stacks. -- Create a stack. +- Create a switch stack. - Delete a stack. version_added: '2.16.0' extends_documentation_fragment: @@ -113,5 +113,11 @@ meraki_response: returned: always type: dict sample: > - {} + { + "id": "string", + "name": "string", + "serials": [ + "string" + ] + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_stacks_remove.py b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_stacks_remove.py index 3eb4a79b7..bed0266e5 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_stacks_remove.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_stacks_remove.py @@ -74,5 +74,11 @@ meraki_response: returned: always type: dict sample: > - {} + { + "id": "string", + "name": "string", + "serials": [ + "string" + ] + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_stacks_routing_interfaces.py b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_stacks_routing_interfaces.py index 7fad46342..3337cfd51 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_stacks_routing_interfaces.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_stacks_routing_interfaces.py @@ -148,15 +148,11 @@ EXAMPLES = r""" area: '0' cost: 1 isPassiveEnabled: true - ospfV3: - area: '1' - cost: 2 - isPassiveEnabled: true subnet: 192.168.1.0/24 switchStackId: string vlanId: 100 -- name: Update by id +- name: Delete by id cisco.meraki.networks_switch_stacks_routing_interfaces: meraki_api_key: "{{meraki_api_key}}" meraki_base_url: "{{meraki_base_url}}" @@ -178,30 +174,12 @@ EXAMPLES = r""" meraki_be_geo_id: "{{meraki_be_geo_id}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: present + state: absent interfaceId: string - interfaceIp: 192.168.1.2 - ipv6: - address: 1:2:3:4::1 - assignmentMode: static - gateway: 1:2:3:4::2 - prefix: 1:2:3:4::/48 - multicastRouting: disabled - name: L3 interface networkId: string - ospfSettings: - area: '0' - cost: 1 - isPassiveEnabled: true - ospfV3: - area: '1' - cost: 2 - isPassiveEnabled: true - subnet: 192.168.1.0/24 switchStackId: string - vlanId: 100 -- name: Delete by id +- name: Update by id cisco.meraki.networks_switch_stacks_routing_interfaces: meraki_api_key: "{{meraki_api_key}}" meraki_base_url: "{{meraki_base_url}}" @@ -223,10 +201,25 @@ EXAMPLES = r""" meraki_be_geo_id: "{{meraki_be_geo_id}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: absent + state: present + defaultGateway: 192.168.1.1 interfaceId: string + interfaceIp: 192.168.1.2 + ipv6: + address: 1:2:3:4::1 + assignmentMode: static + gateway: 1:2:3:4::2 + prefix: 1:2:3:4::/48 + multicastRouting: disabled + name: L3 interface networkId: string + ospfSettings: + area: '0' + cost: 1 + isPassiveEnabled: true + subnet: 192.168.1.0/24 switchStackId: string + vlanId: 100 """ RETURN = r""" @@ -235,5 +228,29 @@ meraki_response: returned: always type: dict sample: > - {} + { + "defaultGateway": "string", + "interfaceId": "string", + "interfaceIp": "string", + "ipv6": { + "address": "string", + "assignmentMode": "string", + "gateway": "string", + "prefix": "string" + }, + "multicastRouting": "string", + "name": "string", + "ospfSettings": { + "area": "string", + "cost": 0, + "isPassiveEnabled": true + }, + "ospfV3": { + "area": "string", + "cost": 0, + "isPassiveEnabled": true + }, + "subnet": "string", + "vlanId": 0 + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_stacks_routing_interfaces_dhcp.py b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_stacks_routing_interfaces_dhcp.py index 1e4601086..f2e12148b 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_stacks_routing_interfaces_dhcp.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_stacks_routing_interfaces_dhcp.py @@ -58,7 +58,7 @@ options: elements: str type: list dnsCustomNameservers: - description: The DHCP name server IPs when DHCP name server option is 'custom'. + description: The DHCP name server IPs when DHCP name server option is ' custom'. elements: str type: list dnsNameserversOption: @@ -153,6 +153,8 @@ EXAMPLES = r""" - code: '5' type: text value: five + dhcpRelayServerIps: + - 1.2.3.4 dnsCustomNameservers: - 8.8.8.8, 8.8.4.4 dnsNameserversOption: custom @@ -175,5 +177,39 @@ meraki_response: returned: always type: dict sample: > - {} + { + "bootFileName": "string", + "bootNextServer": "string", + "bootOptionsEnabled": true, + "dhcpLeaseTime": "string", + "dhcpMode": "string", + "dhcpOptions": [ + { + "code": "string", + "type": "string", + "value": "string" + } + ], + "dhcpRelayServerIps": [ + "string" + ], + "dnsCustomNameservers": [ + "string" + ], + "dnsNameserversOption": "string", + "fixedIpAssignments": [ + { + "ip": "string", + "mac": "string", + "name": "string" + } + ], + "reservedIpRanges": [ + { + "comment": "string", + "end": "string", + "start": "string" + } + ] + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_stacks_routing_interfaces_dhcp_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_stacks_routing_interfaces_dhcp_info.py index 1ac626503..82e3ab21f 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_stacks_routing_interfaces_dhcp_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_stacks_routing_interfaces_dhcp_info.py @@ -80,6 +80,40 @@ meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always type: dict - sample: - - {} + sample: > + { + "bootFileName": "string", + "bootNextServer": "string", + "bootOptionsEnabled": true, + "dhcpLeaseTime": "string", + "dhcpMode": "string", + "dhcpOptions": [ + { + "code": "string", + "type": "string", + "value": "string" + } + ], + "dhcpRelayServerIps": [ + "string" + ], + "dnsCustomNameservers": [ + "string" + ], + "dnsNameserversOption": "string", + "fixedIpAssignments": [ + { + "ip": "string", + "mac": "string", + "name": "string" + } + ], + "reservedIpRanges": [ + { + "comment": "string", + "end": "string", + "start": "string" + } + ] + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_stacks_routing_interfaces_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_stacks_routing_interfaces_info.py index 93cb8ed58..1350158ec 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_stacks_routing_interfaces_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_stacks_routing_interfaces_info.py @@ -112,10 +112,31 @@ RETURN = r""" meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always - type: list - elements: dict + type: dict sample: > - [ - {} - ] + { + "defaultGateway": "string", + "interfaceId": "string", + "interfaceIp": "string", + "ipv6": { + "address": "string", + "assignmentMode": "string", + "gateway": "string", + "prefix": "string" + }, + "multicastRouting": "string", + "name": "string", + "ospfSettings": { + "area": "string", + "cost": 0, + "isPassiveEnabled": true + }, + "ospfV3": { + "area": "string", + "cost": 0, + "isPassiveEnabled": true + }, + "subnet": "string", + "vlanId": 0 + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_stacks_routing_static_routes.py b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_stacks_routing_static_routes.py index 70f468f0e..63a174e99 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_stacks_routing_static_routes.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_stacks_routing_static_routes.py @@ -101,7 +101,7 @@ EXAMPLES = r""" subnet: 192.168.1.0/24 switchStackId: string -- name: Update by id +- name: Delete by id cisco.meraki.networks_switch_stacks_routing_static_routes: meraki_api_key: "{{meraki_api_key}}" meraki_base_url: "{{meraki_base_url}}" @@ -123,17 +123,12 @@ EXAMPLES = r""" meraki_be_geo_id: "{{meraki_be_geo_id}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: present - advertiseViaOspfEnabled: false - name: My route + state: absent networkId: string - nextHopIp: 1.2.3.4 - preferOverOspfRoutesEnabled: false staticRouteId: string - subnet: 192.168.1.0/24 switchStackId: string -- name: Delete by id +- name: Update by id cisco.meraki.networks_switch_stacks_routing_static_routes: meraki_api_key: "{{meraki_api_key}}" meraki_base_url: "{{meraki_base_url}}" @@ -155,9 +150,14 @@ EXAMPLES = r""" meraki_be_geo_id: "{{meraki_be_geo_id}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: absent + state: present + advertiseViaOspfEnabled: false + name: My route networkId: string + nextHopIp: 1.2.3.4 + preferOverOspfRoutesEnabled: false staticRouteId: string + subnet: 192.168.1.0/24 switchStackId: string """ @@ -167,5 +167,12 @@ meraki_response: returned: always type: dict sample: > - {} + { + "advertiseViaOspfEnabled": true, + "name": "string", + "nextHopIp": "string", + "preferOverOspfRoutesEnabled": true, + "staticRouteId": "string", + "subnet": "string" + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_stacks_routing_static_routes_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_stacks_routing_static_routes_info.py index 18cda8040..a7e8d9812 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_stacks_routing_static_routes_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_stacks_routing_static_routes_info.py @@ -112,10 +112,14 @@ RETURN = r""" meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always - type: list - elements: dict + type: dict sample: > - [ - {} - ] + { + "advertiseViaOspfEnabled": true, + "name": "string", + "nextHopIp": "string", + "preferOverOspfRoutesEnabled": true, + "staticRouteId": "string", + "subnet": "string" + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_storm_control.py b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_storm_control.py index 403b16840..722348dc9 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_storm_control.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_storm_control.py @@ -83,5 +83,9 @@ meraki_response: returned: always type: dict sample: > - {} + { + "broadcastThreshold": 0, + "multicastThreshold": 0, + "unknownUnicastThreshold": 0 + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_stp.py b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_stp.py index c084f6cc7..71d324660 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_stp.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_stp.py @@ -23,7 +23,7 @@ options: description: The spanning tree protocol status in network. type: bool stpBridgePriority: - description: STP bridge priority for switches/stacks or switch profiles. An empty + description: STP bridge priority for switches/stacks or switch templates. An empty array will clear the STP bridge priority settings. elements: dict suboptions: @@ -32,10 +32,10 @@ options: elements: str type: list stpPriority: - description: STP priority for switch, stacks, or switch profiles. + description: STP priority for switch, stacks, or switch templates. type: int switchProfiles: - description: List of switch profile IDs. + description: List of switch template IDs. elements: str type: list switches: diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_stp_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_stp_info.py index 05b82dd34..dc58fcdf5 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_switch_stp_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_switch_stp_info.py @@ -70,6 +70,16 @@ meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always type: dict - sample: - - {} + sample: > + { + "rstpEnabled": true, + "stpBridgePriority": [ + { + "stpPriority": 0, + "switches": [ + "string" + ] + } + ] + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_topology_link_layer_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_topology_link_layer_info.py index 9c32d682a..6342f5fc4 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_topology_link_layer_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_topology_link_layer_info.py @@ -10,7 +10,9 @@ module: networks_topology_link_layer_info short_description: Information module for networks _topology _linklayer description: - Get all networks _topology _linklayer. -- List the LLDP and CDP information for all discovered devices and connections in a network. +- > + List the LLDP and CDP information for all discovered devices and connections in a network. At least one MX or MS + device must be in the network in order to build the topology. version_added: '2.16.0' extends_documentation_fragment: - cisco.meraki.module_info @@ -70,6 +72,57 @@ meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always type: dict - sample: - - {} + sample: > + { + "errors": [ + "string" + ], + "links": [ + { + "ends": [ + { + "device": { + "name": "string", + "serial": "string" + }, + "discovered": { + "cdp": { + "nativeVlan": 0, + "portId": "string" + }, + "lldp": { + "portDescription": "string", + "portId": "string" + } + }, + "node": { + "derivedId": "string", + "type": "string" + } + } + ], + "lastReportedAt": "string" + } + ], + "nodes": [ + { + "derivedId": "string", + "discovered": { + "cdp": "string", + "lldp": { + "chassisId": "string", + "managementAddress": "string", + "systemCapabilities": [ + "string" + ], + "systemDescription": "string", + "systemName": "string" + } + }, + "mac": "string", + "root": true, + "type": "string" + } + ] + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_traffic_analysis.py b/ansible_collections/cisco/meraki/plugins/modules/networks_traffic_analysis.py index 52798d642..3a8d3d9d6 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_traffic_analysis.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_traffic_analysis.py @@ -84,19 +84,7 @@ EXAMPLES = r""" - name: Item from hostname type: host value: example.com - - name: Item from port - type: port - value: '440' - - name: Item from IP - type: ipRange - value: 192.1.0.0 - - name: Item from IP range (CIDR) - type: ipRange - value: 192.2.0.0/16 - - name: Item from IP range with port - type: ipRange - value: 192.3.0.0/16:80 - mode: detailed + mode: disabled networkId: string """ @@ -106,5 +94,14 @@ meraki_response: returned: always type: dict sample: > - {} + { + "customPieChartItems": [ + { + "name": "string", + "type": "string", + "value": "string" + } + ], + "mode": "string" + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_traffic_analysis_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_traffic_analysis_info.py index a44c639eb..5d354ebdf 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_traffic_analysis_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_traffic_analysis_info.py @@ -70,6 +70,15 @@ meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always type: dict - sample: - - {} + sample: > + { + "customPieChartItems": [ + { + "name": "string", + "type": "string", + "value": "string" + } + ], + "mode": "string" + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_traffic_shaping_application_categories_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_traffic_shaping_application_categories_info.py index 4c39e70cd..96b4960aa 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_traffic_shaping_application_categories_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_traffic_shaping_application_categories_info.py @@ -10,7 +10,7 @@ module: networks_traffic_shaping_application_categories_info short_description: Information module for networks _trafficshaping _applicationcategories description: - Get all networks _trafficshaping _applicationcategories. -- Returns the application categories for traffic shaping rules. +- Returns the application categories for traffic shaping rules. Only applicable on networks with a security applicance. version_added: '2.16.0' extends_documentation_fragment: - cisco.meraki.module_info @@ -69,7 +69,19 @@ RETURN = r""" meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always - type: dict - sample: - - {} + type: list + elements: dict + sample: > + [ + { + "applications": [ + { + "id": "string", + "name": "string" + } + ], + "id": "string", + "name": "string" + } + ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_traffic_shaping_dscp_tagging_options_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_traffic_shaping_dscp_tagging_options_info.py index eba6d516d..87d9cc7e9 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_traffic_shaping_dscp_tagging_options_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_traffic_shaping_dscp_tagging_options_info.py @@ -73,6 +73,9 @@ meraki_response: elements: dict sample: > [ - {} + { + "description": "string", + "dscpTagValue": 0 + } ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_unbind.py b/ansible_collections/cisco/meraki/plugins/modules/networks_unbind.py index 8abfdb77c..6ad50aaff 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_unbind.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_unbind.py @@ -71,19 +71,19 @@ meraki_response: type: dict sample: > { + "enrollmentString": "string", "id": "string", - "organizationId": "string", + "isBoundToConfigTemplate": true, "name": "string", + "notes": "string", + "organizationId": "string", "productTypes": [ "string" ], - "timeZone": "string", "tags": [ "string" ], - "enrollmentString": "string", - "url": "string", - "notes": "string", - "isBoundToConfigTemplate": true + "timeZone": "string", + "url": "string" } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_vlan_profiles.py b/ansible_collections/cisco/meraki/plugins/modules/networks_vlan_profiles.py new file mode 100644 index 000000000..4ea375e74 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_vlan_profiles.py @@ -0,0 +1,168 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: networks_vlan_profiles +short_description: Resource module for networks _vlanprofiles +description: +- Manage operations update and delete of the resource networks _vlanprofiles. +- Delete a VLAN profile of a network. +- Update an existing VLAN profile of a network. +version_added: '2.18.0' +extends_documentation_fragment: + - cisco.meraki.module +author: Francisco Munoz (@fmunoz) +options: + iname: + description: Iname path parameter. + type: str + name: + description: Name of the profile, string length must be from 1 to 255 characters. + type: str + networkId: + description: NetworkId path parameter. Network ID. + type: str + vlanGroups: + description: An array of VLAN groups. + elements: dict + suboptions: + name: + description: Name of the VLAN, string length must be from 1 to 32 characters. + type: str + vlanIds: + description: Comma-separated VLAN IDs or ID ranges. + type: str + type: list + vlanNames: + description: An array of named VLANs. + elements: dict + suboptions: + adaptivePolicyGroup: + description: Adaptive Policy Group assigned to Vlan ID. + suboptions: + id: + description: Adaptive Policy Group ID. + type: str + type: dict + name: + description: Name of the VLAN, string length must be from 1 to 32 characters. + type: str + vlanId: + description: VLAN ID. + type: str + type: list +requirements: +- meraki >= 2.4.9 +- python >= 3.5 +seealso: +- name: Cisco Meraki documentation for networks deleteNetworkVlanProfile + description: Complete reference of the deleteNetworkVlanProfile API. + link: https://developer.cisco.com/meraki/api-v1/#!delete-network-vlan-profile +- name: Cisco Meraki documentation for networks updateNetworkVlanProfile + description: Complete reference of the updateNetworkVlanProfile API. + link: https://developer.cisco.com/meraki/api-v1/#!update-network-vlan-profile +notes: + - SDK Method used are + networks.Networks.delete_network_vlan_profile, + networks.Networks.update_network_vlan_profile, + + - Paths used are + delete /networks/{networkId}/vlanProfiles/{iname}, + put /networks/{networkId}/vlanProfiles/{iname}, +""" + +EXAMPLES = r""" +- name: Delete by name + cisco.meraki.networks_vlan_profiles: + meraki_api_key: "{{meraki_api_key}}" + meraki_base_url: "{{meraki_base_url}}" + meraki_single_request_timeout: "{{meraki_single_request_timeout}}" + meraki_certificate_path: "{{meraki_certificate_path}}" + meraki_requests_proxy: "{{meraki_requests_proxy}}" + meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" + meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" + meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" + meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" + meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" + meraki_maximum_retries: "{{meraki_maximum_retries}}" + meraki_output_log: "{{meraki_output_log}}" + meraki_log_file_prefix: "{{meraki_log_file_prefix}}" + meraki_log_path: "{{meraki_log_path}}" + meraki_print_console: "{{meraki_print_console}}" + meraki_suppress_logging: "{{meraki_suppress_logging}}" + meraki_simulate: "{{meraki_simulate}}" + meraki_be_geo_id: "{{meraki_be_geo_id}}" + meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" + meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" + state: absent + iname: string + networkId: string + +- name: Update by name + cisco.meraki.networks_vlan_profiles: + meraki_api_key: "{{meraki_api_key}}" + meraki_base_url: "{{meraki_base_url}}" + meraki_single_request_timeout: "{{meraki_single_request_timeout}}" + meraki_certificate_path: "{{meraki_certificate_path}}" + meraki_requests_proxy: "{{meraki_requests_proxy}}" + meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" + meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" + meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" + meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" + meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" + meraki_maximum_retries: "{{meraki_maximum_retries}}" + meraki_output_log: "{{meraki_output_log}}" + meraki_log_file_prefix: "{{meraki_log_file_prefix}}" + meraki_log_path: "{{meraki_log_path}}" + meraki_print_console: "{{meraki_print_console}}" + meraki_suppress_logging: "{{meraki_suppress_logging}}" + meraki_simulate: "{{meraki_simulate}}" + meraki_be_geo_id: "{{meraki_be_geo_id}}" + meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" + meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" + state: present + iname: string + name: My VLAN profile name + networkId: string + vlanGroups: + - name: named-group-1 + vlanIds: 2,5-7 + vlanNames: + - adaptivePolicyGroup: + id: '791' + name: named-1 + vlanId: '1' + +""" +RETURN = r""" +meraki_response: + description: A dictionary or list with the response returned by the Cisco Meraki Python SDK + returned: always + type: dict + sample: > + { + "iname": "string", + "isDefault": true, + "name": "string", + "vlanGroups": [ + { + "name": "string", + "vlanIds": "string" + } + ], + "vlanNames": [ + { + "adaptivePolicyGroup": { + "id": "string", + "name": "string" + }, + "name": "string", + "vlanId": "string" + } + ] + } +""" diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_vlan_profiles_assignments_by_device_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_vlan_profiles_assignments_by_device_info.py new file mode 100644 index 000000000..7d4c96dee --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_vlan_profiles_assignments_by_device_info.py @@ -0,0 +1,135 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: networks_vlan_profiles_assignments_by_device_info +short_description: Information module for networks _vlanprofiles _assignments _bydevice +description: +- Get all networks _vlanprofiles _assignments _bydevice. +- Get the assigned VLAN Profiles for devices in a network. +version_added: '2.18.0' +extends_documentation_fragment: + - cisco.meraki.module_info + - cisco.meraki.module_info_pagination +author: Francisco Munoz (@fmunoz) +options: + headers: + description: Additional headers. + type: dict + networkId: + description: + - NetworkId path parameter. Network ID. + type: str + perPage: + description: + - PerPage query parameter. The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. + type: int + startingAfter: + description: + - > + StartingAfter query parameter. A token used by the server to indicate the start of the page. Often this is a + timestamp or an ID but it is not limited to those. This parameter should not be defined by client + applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + type: str + endingBefore: + description: + - > + EndingBefore query parameter. A token used by the server to indicate the end of the page. Often this is a + timestamp or an ID but it is not limited to those. This parameter should not be defined by client + applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + type: str + serials: + description: + - > + Serials query parameter. Optional parameter to filter devices by serials. All devices returned belong to + serial numbers that are an exact match. + elements: str + type: list + productTypes: + description: + - ProductTypes query parameter. Optional parameter to filter devices by product types. + elements: str + type: list + stackIds: + description: + - StackIds query parameter. Optional parameter to filter devices by Switch Stack ids. + elements: str + type: list +requirements: +- meraki >= 2.4.9 +- python >= 3.5 +seealso: +- name: Cisco Meraki documentation for networks getNetworkVlanProfilesAssignmentsByDevice + description: Complete reference of the getNetworkVlanProfilesAssignmentsByDevice API. + link: https://developer.cisco.com/meraki/api-v1/#!get-network-vlan-profiles-assignments-by-device +notes: + - SDK Method used are + networks.Networks.get_network_vlan_profiles_assignments_by_device, + + - Paths used are + get /networks/{networkId}/vlanProfiles/assignments/byDevice, +""" + +EXAMPLES = r""" +- name: Get all networks _vlanprofiles _assignments _bydevice + cisco.meraki.networks_vlan_profiles_assignments_by_device_info: + meraki_api_key: "{{meraki_api_key}}" + meraki_base_url: "{{meraki_base_url}}" + meraki_single_request_timeout: "{{meraki_single_request_timeout}}" + meraki_certificate_path: "{{meraki_certificate_path}}" + meraki_requests_proxy: "{{meraki_requests_proxy}}" + meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" + meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" + meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" + meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" + meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" + meraki_maximum_retries: "{{meraki_maximum_retries}}" + meraki_output_log: "{{meraki_output_log}}" + meraki_log_file_prefix: "{{meraki_log_file_prefix}}" + meraki_log_path: "{{meraki_log_path}}" + meraki_print_console: "{{meraki_print_console}}" + meraki_suppress_logging: "{{meraki_suppress_logging}}" + meraki_simulate: "{{meraki_simulate}}" + meraki_be_geo_id: "{{meraki_be_geo_id}}" + meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" + meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" + perPage: 0 + startingAfter: string + endingBefore: string + serials: [] + productTypes: [] + stackIds: [] + networkId: string + total_pages: -1 + direction: next + register: result + +""" +RETURN = r""" +meraki_response: + description: A dictionary or list with the response returned by the Cisco Meraki Python SDK + returned: always + type: list + elements: dict + sample: > + [ + { + "mac": "string", + "name": "string", + "productType": "string", + "serial": "string", + "stack": { + "id": "string" + }, + "vlanProfile": { + "iname": "string", + "isDefault": true, + "name": "string" + } + } + ] +""" diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_vlan_profiles_assignments_reassign.py b/ansible_collections/cisco/meraki/plugins/modules/networks_vlan_profiles_assignments_reassign.py new file mode 100644 index 000000000..781e30ebf --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_vlan_profiles_assignments_reassign.py @@ -0,0 +1,102 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: networks_vlan_profiles_assignments_reassign +short_description: Resource module for networks _vlanprofiles _assignments _reassign +description: +- Manage operation create of the resource networks _vlanprofiles _assignments _reassign. +- Update the assigned VLAN Profile for devices in a network. +version_added: '2.18.0' +extends_documentation_fragment: + - cisco.meraki.module +author: Francisco Munoz (@fmunoz) +options: + networkId: + description: NetworkId path parameter. Network ID. + type: str + serials: + description: Array of Device Serials. + elements: str + type: list + stackIds: + description: Array of Switch Stack IDs. + elements: str + type: list + vlanProfile: + description: The VLAN Profile. + suboptions: + iname: + description: IName of the VLAN Profile. + type: str + type: dict +requirements: +- meraki >= 2.4.9 +- python >= 3.5 +seealso: +- name: Cisco Meraki documentation for networks reassignNetworkVlanProfilesAssignments + description: Complete reference of the reassignNetworkVlanProfilesAssignments API. + link: https://developer.cisco.com/meraki/api-v1/#!reassign-network-vlan-profiles-assignments +notes: + - SDK Method used are + networks.Networks.reassign_network_vlan_profiles_assignments, + + - Paths used are + post /networks/{networkId}/vlanProfiles/assignments/reassign, +""" + +EXAMPLES = r""" +- name: Create + cisco.meraki.networks_vlan_profiles_assignments_reassign: + meraki_api_key: "{{meraki_api_key}}" + meraki_base_url: "{{meraki_base_url}}" + meraki_single_request_timeout: "{{meraki_single_request_timeout}}" + meraki_certificate_path: "{{meraki_certificate_path}}" + meraki_requests_proxy: "{{meraki_requests_proxy}}" + meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" + meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" + meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" + meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" + meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" + meraki_maximum_retries: "{{meraki_maximum_retries}}" + meraki_output_log: "{{meraki_output_log}}" + meraki_log_file_prefix: "{{meraki_log_file_prefix}}" + meraki_log_path: "{{meraki_log_path}}" + meraki_print_console: "{{meraki_print_console}}" + meraki_suppress_logging: "{{meraki_suppress_logging}}" + meraki_simulate: "{{meraki_simulate}}" + meraki_be_geo_id: "{{meraki_be_geo_id}}" + meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" + meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" + networkId: string + serials: + - Q234-ABCD-5678 + stackIds: + - '1234' + vlanProfile: + iname: Profile1 + +""" +RETURN = r""" +meraki_response: + description: A dictionary or list with the response returned by the Cisco Meraki Python SDK + returned: always + type: dict + sample: > + { + "serials": [ + "string" + ], + "stackIds": [ + "string" + ], + "vlanProfile": { + "iname": "string", + "name": "string" + } + } +""" diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_vlan_profiles_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_vlan_profiles_info.py new file mode 100644 index 000000000..35572e874 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_vlan_profiles_info.py @@ -0,0 +1,100 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: networks_vlan_profiles_info +short_description: Information module for networks _vlanprofiles +description: +- Get networks _vlanprofiles by name. +- Get an existing VLAN profile of a network. +version_added: '2.18.0' +extends_documentation_fragment: + - cisco.meraki.module_info +author: Francisco Munoz (@fmunoz) +options: + headers: + description: Additional headers. + type: dict + networkId: + description: + - NetworkId path parameter. Network ID. + type: str + iname: + description: + - Iname path parameter. + type: str +requirements: +- meraki >= 2.4.9 +- python >= 3.5 +seealso: +- name: Cisco Meraki documentation for networks getNetworkVlanProfile + description: Complete reference of the getNetworkVlanProfile API. + link: https://developer.cisco.com/meraki/api-v1/#!get-network-vlan-profile +notes: + - SDK Method used are + networks.Networks.get_network_vlan_profile, + + - Paths used are + get /networks/{networkId}/vlanProfiles/{iname}, +""" + +EXAMPLES = r""" +- name: Get networks _vlanprofiles by name + cisco.meraki.networks_vlan_profiles_info: + meraki_api_key: "{{meraki_api_key}}" + meraki_base_url: "{{meraki_base_url}}" + meraki_single_request_timeout: "{{meraki_single_request_timeout}}" + meraki_certificate_path: "{{meraki_certificate_path}}" + meraki_requests_proxy: "{{meraki_requests_proxy}}" + meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" + meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" + meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" + meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" + meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" + meraki_maximum_retries: "{{meraki_maximum_retries}}" + meraki_output_log: "{{meraki_output_log}}" + meraki_log_file_prefix: "{{meraki_log_file_prefix}}" + meraki_log_path: "{{meraki_log_path}}" + meraki_print_console: "{{meraki_print_console}}" + meraki_suppress_logging: "{{meraki_suppress_logging}}" + meraki_simulate: "{{meraki_simulate}}" + meraki_be_geo_id: "{{meraki_be_geo_id}}" + meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" + meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" + networkId: string + iname: string + register: result + +""" +RETURN = r""" +meraki_response: + description: A dictionary or list with the response returned by the Cisco Meraki Python SDK + returned: always + type: dict + sample: > + { + "iname": "string", + "isDefault": true, + "name": "string", + "vlanGroups": [ + { + "name": "string", + "vlanIds": "string" + } + ], + "vlanNames": [ + { + "adaptivePolicyGroup": { + "id": "string", + "name": "string" + }, + "name": "string", + "vlanId": "string" + } + ] + } +""" diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_webhooks_http_servers.py b/ansible_collections/cisco/meraki/plugins/modules/networks_webhooks_http_servers.py index 5e6bfaa31..dc08f0579 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_webhooks_http_servers.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_webhooks_http_servers.py @@ -105,7 +105,7 @@ EXAMPLES = r""" sharedSecret: shhh url: https://example.com -- name: Update by id +- name: Delete by id cisco.meraki.networks_webhooks_http_servers: meraki_api_key: "{{meraki_api_key}}" meraki_base_url: "{{meraki_base_url}}" @@ -127,15 +127,11 @@ EXAMPLES = r""" meraki_be_geo_id: "{{meraki_be_geo_id}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: present + state: absent httpServerId: string - name: Example Webhook Server networkId: string - payloadTemplate: - payloadTemplateId: wpt_00001 - sharedSecret: shhh -- name: Delete by id +- name: Update by id cisco.meraki.networks_webhooks_http_servers: meraki_api_key: "{{meraki_api_key}}" meraki_base_url: "{{meraki_base_url}}" @@ -157,9 +153,13 @@ EXAMPLES = r""" meraki_be_geo_id: "{{meraki_be_geo_id}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: absent + state: present httpServerId: string + name: Example Webhook Server networkId: string + payloadTemplate: + payloadTemplateId: wpt_00001 + sharedSecret: shhh """ RETURN = r""" @@ -171,11 +171,11 @@ meraki_response: { "id": "string", "name": "string", - "url": "string", "networkId": "string", "payloadTemplate": { - "payloadTemplateId": "string", - "name": "string" - } + "name": "string", + "payloadTemplateId": "string" + }, + "url": "string" } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_webhooks_http_servers_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_webhooks_http_servers_info.py index d28736f47..056394ba9 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_webhooks_http_servers_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_webhooks_http_servers_info.py @@ -111,11 +111,11 @@ meraki_response: { "id": "string", "name": "string", - "url": "string", "networkId": "string", "payloadTemplate": { - "payloadTemplateId": "string", - "name": "string" - } + "name": "string", + "payloadTemplateId": "string" + }, + "url": "string" } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_webhooks_payload_templates.py b/ansible_collections/cisco/meraki/plugins/modules/networks_webhooks_payload_templates.py index 971a6651f..b62b18214 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_webhooks_payload_templates.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_webhooks_payload_templates.py @@ -109,7 +109,7 @@ EXAMPLES = r""" name: Custom Template networkId: string -- name: Update by id +- name: Delete by id cisco.meraki.networks_webhooks_payload_templates: meraki_api_key: "{{meraki_api_key}}" meraki_base_url: "{{meraki_base_url}}" @@ -131,18 +131,11 @@ EXAMPLES = r""" meraki_be_geo_id: "{{meraki_be_geo_id}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: present - body: '{"event_type":"{{alertTypeId}}","client_payload":{"text":"{{alertData}}"}}' - bodyFile: Qm9keSBGaWxl - headers: - - name: Authorization - template: Bearer {{sharedSecret}} - headersFile: SGVhZGVycyBGaWxl - name: Custom Template + state: absent networkId: string payloadTemplateId: string -- name: Delete by id +- name: Update by id cisco.meraki.networks_webhooks_payload_templates: meraki_api_key: "{{meraki_api_key}}" meraki_base_url: "{{meraki_base_url}}" @@ -164,7 +157,14 @@ EXAMPLES = r""" meraki_be_geo_id: "{{meraki_be_geo_id}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: absent + state: present + body: '{"event_type":"{{alertTypeId}}","client_payload":{"text":"{{alertData}}"}}' + bodyFile: Qm9keSBGaWxl + headers: + - name: Authorization + template: Bearer {{sharedSecret}} + headersFile: SGVhZGVycyBGaWxl + name: Custom Template networkId: string payloadTemplateId: string @@ -176,20 +176,20 @@ meraki_response: type: dict sample: > { - "payloadTemplateId": "string", - "type": "string", - "name": "string", + "body": "string", "headers": [ { "name": "string", "template": "string" } ], - "body": "string", + "name": "string", + "payloadTemplateId": "string", "sharing": { "byNetwork": { "adminsCanModify": true } - } + }, + "type": "string" } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_webhooks_payload_templates_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_webhooks_payload_templates_info.py index 9e96aad4e..b008f262e 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_webhooks_payload_templates_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_webhooks_payload_templates_info.py @@ -109,20 +109,20 @@ meraki_response: type: dict sample: > { - "payloadTemplateId": "string", - "type": "string", - "name": "string", + "body": "string", "headers": [ { "name": "string", "template": "string" } ], - "body": "string", + "name": "string", + "payloadTemplateId": "string", "sharing": { "byNetwork": { "adminsCanModify": true } - } + }, + "type": "string" } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_webhooks_webhook_tests_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_webhooks_webhook_tests_info.py index 7ebdf0eb5..1c505a70a 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_webhooks_webhook_tests_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_webhooks_webhook_tests_info.py @@ -78,7 +78,7 @@ meraki_response: sample: > { "id": "string", - "url": "string", - "status": "string" + "status": "string", + "url": "string" } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_alternate_management_interface_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_alternate_management_interface_info.py index ec090d355..fc7fb0840 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_alternate_management_interface_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_alternate_management_interface_info.py @@ -70,6 +70,22 @@ meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always type: dict - sample: - - {} + sample: > + { + "accessPoints": [ + { + "alternateManagementIp": "string", + "dns1": "string", + "dns2": "string", + "gateway": "string", + "serial": "string", + "subnetMask": "string" + } + ], + "enabled": true, + "protocols": [ + "string" + ], + "vlanId": 0 + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_billing.py b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_billing.py index 9296df094..2e6db99f7 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_billing.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_billing.py @@ -93,10 +93,10 @@ EXAMPLES = r""" networkId: string plans: - bandwidthLimits: - limitDown: 1000 - limitUp: 1000 + limitDown: 1000000 + limitUp: 1000000 id: '1' - price: 5 + price: 5.0 timeLimit: 1 hour """ @@ -106,5 +106,18 @@ meraki_response: returned: always type: dict sample: > - {} + { + "currency": "string", + "plans": [ + { + "bandwidthLimits": { + "limitDown": 0, + "limitUp": 0 + }, + "id": "string", + "price": 0, + "timeLimit": "string" + } + ] + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_billing_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_billing_info.py index 581341573..0cb11b1e4 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_billing_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_billing_info.py @@ -70,6 +70,19 @@ meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always type: dict - sample: - - {} + sample: > + { + "currency": "string", + "plans": [ + { + "bandwidthLimits": { + "limitDown": 0, + "limitUp": 0 + }, + "id": "string", + "price": 0, + "timeLimit": "string" + } + ] + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_bluetooth_settings.py b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_bluetooth_settings.py index 1b46a685a..6c28d9d68 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_bluetooth_settings.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_bluetooth_settings.py @@ -95,12 +95,12 @@ meraki_response: type: dict sample: > { - "scanningEnabled": true, "advertisingEnabled": true, - "uuid": "string", - "majorMinorAssignmentMode": "string", + "eslEnabled": true, "major": 0, + "majorMinorAssignmentMode": "string", "minor": 0, - "eslEnabled": true + "scanningEnabled": true, + "uuid": "string" } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_bluetooth_settings_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_bluetooth_settings_info.py index 7b7aa351c..3a801e0b8 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_bluetooth_settings_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_bluetooth_settings_info.py @@ -72,12 +72,12 @@ meraki_response: type: dict sample: > { - "scanningEnabled": true, "advertisingEnabled": true, - "uuid": "string", - "majorMinorAssignmentMode": "string", + "eslEnabled": true, "major": 0, + "majorMinorAssignmentMode": "string", "minor": 0, - "eslEnabled": true + "scanningEnabled": true, + "uuid": "string" } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_channel_utilization_history_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_channel_utilization_history_info.py index 497be9f02..4d8f39eed 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_channel_utilization_history_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_channel_utilization_history_info.py @@ -132,11 +132,11 @@ meraki_response: sample: > [ { - "startTs": "string", "endTs": "string", - "utilizationTotal": 0, + "startTs": "string", "utilization80211": 0, - "utilizationNon80211": 0 + "utilizationNon80211": 0, + "utilizationTotal": 0 } ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_client_count_history_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_client_count_history_info.py index e9fe2d829..ade0b0495 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_client_count_history_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_client_count_history_info.py @@ -133,9 +133,9 @@ meraki_response: sample: > [ { - "startTs": "string", + "clientCount": 0, "endTs": "string", - "clientCount": 0 + "startTs": "string" } ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_clients_connection_stats_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_clients_connection_stats_info.py index 05ab31873..f32e5f05b 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_clients_connection_stats_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_clients_connection_stats_info.py @@ -114,6 +114,15 @@ meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always type: dict - sample: - - {} + sample: > + { + "connectionStats": { + "assoc": 0, + "auth": 0, + "dhcp": 0, + "dns": 0, + "success": 0 + }, + "mac": "string" + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_clients_latency_stats_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_clients_latency_stats_info.py index 89477e7be..cdc08a9dd 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_clients_latency_stats_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_clients_latency_stats_info.py @@ -122,6 +122,31 @@ meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always type: dict - sample: - - {} + sample: > + { + "latencyStats": { + "backgroundTraffic": { + "avg": 0, + "rawDistribution": { + "0": 0, + "1": 0, + "1024": 0, + "128": 0, + "16": 0, + "2": 0, + "2048": 0, + "256": 0, + "32": 0, + "4": 0, + "512": 0, + "64": 0, + "8": 0 + } + }, + "bestEffortTraffic": "string", + "videoTraffic": "string", + "voiceTraffic": "string" + }, + "mac": "string" + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_data_rate_history_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_data_rate_history_info.py index 92c65db8a..2b11d2655 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_data_rate_history_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_data_rate_history_info.py @@ -131,10 +131,10 @@ meraki_response: sample: > [ { - "startTs": "string", - "endTs": "string", "averageKbps": 0, "downloadKbps": 0, + "endTs": "string", + "startTs": "string", "uploadKbps": 0 } ] diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_devices_connection_stats_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_devices_connection_stats_info.py index 90a2f716a..b16d4aeb7 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_devices_connection_stats_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_devices_connection_stats_info.py @@ -113,14 +113,14 @@ meraki_response: sample: > [ { - "serial": "string", "connectionStats": { "assoc": 0, "auth": 0, "dhcp": 0, "dns": 0, "success": 0 - } + }, + "serial": "string" } ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ethernet_ports_profiles.py b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ethernet_ports_profiles.py new file mode 100644 index 000000000..39a42b08d --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ethernet_ports_profiles.py @@ -0,0 +1,171 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: networks_wireless_ethernet_ports_profiles +short_description: Resource module for networks _wireless _ethernet _ports _profiles +description: +- Manage operations update and delete of the resource networks _wireless _ethernet _ports _profiles. +- Delete an AP port profile. +- Update the AP port profile by ID for this network. +version_added: '2.18.0' +extends_documentation_fragment: + - cisco.meraki.module +author: Francisco Munoz (@fmunoz) +options: + name: + description: AP port profile name. + type: str + networkId: + description: NetworkId path parameter. Network ID. + type: str + ports: + description: AP ports configuration. + elements: dict + suboptions: + enabled: + description: AP port enabled. + type: bool + name: + description: AP port name. + type: str + pskGroupId: + description: AP port PSK Group number. + type: str + ssid: + description: AP port ssid number. + type: int + type: list + profileId: + description: ProfileId path parameter. Profile ID. + type: str + usbPorts: + description: AP usb ports configuration. + elements: dict + suboptions: + enabled: + description: AP usb port enabled. + type: bool + name: + description: AP usb port name. + type: str + ssid: + description: AP usb port ssid number. + type: int + type: list +requirements: +- meraki >= 2.4.9 +- python >= 3.5 +seealso: +- name: Cisco Meraki documentation for wireless deleteNetworkWirelessEthernetPortsProfile + description: Complete reference of the deleteNetworkWirelessEthernetPortsProfile API. + link: https://developer.cisco.com/meraki/api-v1/#!delete-network-wireless-ethernet-ports-profile +- name: Cisco Meraki documentation for wireless updateNetworkWirelessEthernetPortsProfile + description: Complete reference of the updateNetworkWirelessEthernetPortsProfile API. + link: https://developer.cisco.com/meraki/api-v1/#!update-network-wireless-ethernet-ports-profile +notes: + - SDK Method used are + wireless.Wireless.delete_network_wireless_ethernet_ports_profile, + wireless.Wireless.update_network_wireless_ethernet_ports_profile, + + - Paths used are + delete /networks/{networkId}/wireless/ethernet/ports/profiles/{profileId}, + put /networks/{networkId}/wireless/ethernet/ports/profiles/{profileId}, +""" + +EXAMPLES = r""" +- name: Delete by id + cisco.meraki.networks_wireless_ethernet_ports_profiles: + meraki_api_key: "{{meraki_api_key}}" + meraki_base_url: "{{meraki_base_url}}" + meraki_single_request_timeout: "{{meraki_single_request_timeout}}" + meraki_certificate_path: "{{meraki_certificate_path}}" + meraki_requests_proxy: "{{meraki_requests_proxy}}" + meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" + meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" + meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" + meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" + meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" + meraki_maximum_retries: "{{meraki_maximum_retries}}" + meraki_output_log: "{{meraki_output_log}}" + meraki_log_file_prefix: "{{meraki_log_file_prefix}}" + meraki_log_path: "{{meraki_log_path}}" + meraki_print_console: "{{meraki_print_console}}" + meraki_suppress_logging: "{{meraki_suppress_logging}}" + meraki_simulate: "{{meraki_simulate}}" + meraki_be_geo_id: "{{meraki_be_geo_id}}" + meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" + meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" + state: absent + networkId: string + profileId: string + +- name: Update by id + cisco.meraki.networks_wireless_ethernet_ports_profiles: + meraki_api_key: "{{meraki_api_key}}" + meraki_base_url: "{{meraki_base_url}}" + meraki_single_request_timeout: "{{meraki_single_request_timeout}}" + meraki_certificate_path: "{{meraki_certificate_path}}" + meraki_requests_proxy: "{{meraki_requests_proxy}}" + meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" + meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" + meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" + meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" + meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" + meraki_maximum_retries: "{{meraki_maximum_retries}}" + meraki_output_log: "{{meraki_output_log}}" + meraki_log_file_prefix: "{{meraki_log_file_prefix}}" + meraki_log_path: "{{meraki_log_path}}" + meraki_print_console: "{{meraki_print_console}}" + meraki_suppress_logging: "{{meraki_suppress_logging}}" + meraki_simulate: "{{meraki_simulate}}" + meraki_be_geo_id: "{{meraki_be_geo_id}}" + meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" + meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" + state: present + name: string + networkId: string + ports: + - enabled: true + name: string + pskGroupId: string + ssid: 0 + profileId: string + usbPorts: + - enabled: true + name: string + ssid: 0 + +""" +RETURN = r""" +meraki_response: + description: A dictionary or list with the response returned by the Cisco Meraki Python SDK + returned: always + type: dict + sample: > + { + "isDefault": true, + "name": "string", + "ports": [ + { + "enabled": true, + "name": "string", + "number": 0, + "pskGroupId": "string", + "ssid": 0 + } + ], + "profileId": "string", + "usbPorts": [ + { + "enabled": true, + "name": "string", + "ssid": 0 + } + ] + } +""" diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ethernet_ports_profiles_assign.py b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ethernet_ports_profiles_assign.py new file mode 100644 index 000000000..5177a1688 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ethernet_ports_profiles_assign.py @@ -0,0 +1,87 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: networks_wireless_ethernet_ports_profiles_assign +short_description: Resource module for networks _wireless _ethernet _ports _profiles _assign +description: +- Manage operation create of the resource networks _wireless _ethernet _ports _profiles _assign. +- Assign AP port profile to list of APs. +version_added: '2.18.0' +extends_documentation_fragment: + - cisco.meraki.module +author: Francisco Munoz (@fmunoz) +options: + networkId: + description: NetworkId path parameter. Network ID. + type: str + profileId: + description: AP profile ID. + type: str + serials: + description: List of AP serials. + elements: str + type: list +requirements: +- meraki >= 2.4.9 +- python >= 3.5 +seealso: +- name: Cisco Meraki documentation for wireless assignNetworkWirelessEthernetPortsProfiles + description: Complete reference of the assignNetworkWirelessEthernetPortsProfiles API. + link: https://developer.cisco.com/meraki/api-v1/#!assign-network-wireless-ethernet-ports-profiles +notes: + - SDK Method used are + wireless.Wireless.assign_network_wireless_ethernet_ports_profiles, + + - Paths used are + post /networks/{networkId}/wireless/ethernet/ports/profiles/assign, +""" + +EXAMPLES = r""" +- name: Create + cisco.meraki.networks_wireless_ethernet_ports_profiles_assign: + meraki_api_key: "{{meraki_api_key}}" + meraki_base_url: "{{meraki_base_url}}" + meraki_single_request_timeout: "{{meraki_single_request_timeout}}" + meraki_certificate_path: "{{meraki_certificate_path}}" + meraki_requests_proxy: "{{meraki_requests_proxy}}" + meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" + meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" + meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" + meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" + meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" + meraki_maximum_retries: "{{meraki_maximum_retries}}" + meraki_output_log: "{{meraki_output_log}}" + meraki_log_file_prefix: "{{meraki_log_file_prefix}}" + meraki_log_path: "{{meraki_log_path}}" + meraki_print_console: "{{meraki_print_console}}" + meraki_suppress_logging: "{{meraki_suppress_logging}}" + meraki_simulate: "{{meraki_simulate}}" + meraki_be_geo_id: "{{meraki_be_geo_id}}" + meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" + meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" + networkId: string + profileId: '1001' + serials: + - Q234-ABCD-0001 + - Q234-ABCD-0002 + - Q234-ABCD-0003 + +""" +RETURN = r""" +meraki_response: + description: A dictionary or list with the response returned by the Cisco Meraki Python SDK + returned: always + type: dict + sample: > + { + "profileId": "string", + "serials": [ + "string" + ] + } +""" diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ethernet_ports_profiles_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ethernet_ports_profiles_info.py new file mode 100644 index 000000000..e6f9aeea9 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ethernet_ports_profiles_info.py @@ -0,0 +1,100 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: networks_wireless_ethernet_ports_profiles_info +short_description: Information module for networks _wireless _ethernet _ports _profiles +description: +- Get networks _wireless _ethernet _ports _profiles by id. +- Show the AP port profile by ID for this network. +version_added: '2.18.0' +extends_documentation_fragment: + - cisco.meraki.module_info +author: Francisco Munoz (@fmunoz) +options: + headers: + description: Additional headers. + type: dict + networkId: + description: + - NetworkId path parameter. Network ID. + type: str + profileId: + description: + - ProfileId path parameter. Profile ID. + type: str +requirements: +- meraki >= 2.4.9 +- python >= 3.5 +seealso: +- name: Cisco Meraki documentation for wireless getNetworkWirelessEthernetPortsProfile + description: Complete reference of the getNetworkWirelessEthernetPortsProfile API. + link: https://developer.cisco.com/meraki/api-v1/#!get-network-wireless-ethernet-ports-profile +notes: + - SDK Method used are + wireless.Wireless.get_network_wireless_ethernet_ports_profile, + + - Paths used are + get /networks/{networkId}/wireless/ethernet/ports/profiles/{profileId}, +""" + +EXAMPLES = r""" +- name: Get networks _wireless _ethernet _ports _profiles by id + cisco.meraki.networks_wireless_ethernet_ports_profiles_info: + meraki_api_key: "{{meraki_api_key}}" + meraki_base_url: "{{meraki_base_url}}" + meraki_single_request_timeout: "{{meraki_single_request_timeout}}" + meraki_certificate_path: "{{meraki_certificate_path}}" + meraki_requests_proxy: "{{meraki_requests_proxy}}" + meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" + meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" + meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" + meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" + meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" + meraki_maximum_retries: "{{meraki_maximum_retries}}" + meraki_output_log: "{{meraki_output_log}}" + meraki_log_file_prefix: "{{meraki_log_file_prefix}}" + meraki_log_path: "{{meraki_log_path}}" + meraki_print_console: "{{meraki_print_console}}" + meraki_suppress_logging: "{{meraki_suppress_logging}}" + meraki_simulate: "{{meraki_simulate}}" + meraki_be_geo_id: "{{meraki_be_geo_id}}" + meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" + meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" + networkId: string + profileId: string + register: result + +""" +RETURN = r""" +meraki_response: + description: A dictionary or list with the response returned by the Cisco Meraki Python SDK + returned: always + type: dict + sample: > + { + "isDefault": true, + "name": "string", + "ports": [ + { + "enabled": true, + "name": "string", + "number": 0, + "pskGroupId": "string", + "ssid": 0 + } + ], + "profileId": "string", + "usbPorts": [ + { + "enabled": true, + "name": "string", + "ssid": 0 + } + ] + } +""" diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ethernet_ports_profiles_set_default.py b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ethernet_ports_profiles_set_default.py new file mode 100644 index 000000000..47549ea9f --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ethernet_ports_profiles_set_default.py @@ -0,0 +1,76 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: networks_wireless_ethernet_ports_profiles_set_default +short_description: Resource module for networks _wireless _ethernet _ports _profiles _setdefault +description: +- Manage operation create of the resource networks _wireless _ethernet _ports _profiles _setdefault. +- Set the AP port profile to be default for this network. +version_added: '2.18.0' +extends_documentation_fragment: + - cisco.meraki.module +author: Francisco Munoz (@fmunoz) +options: + networkId: + description: NetworkId path parameter. Network ID. + type: str + profileId: + description: AP profile ID. + type: str +requirements: +- meraki >= 2.4.9 +- python >= 3.5 +seealso: +- name: Cisco Meraki documentation for wireless setNetworkWirelessEthernetPortsProfilesDefault + description: Complete reference of the setNetworkWirelessEthernetPortsProfilesDefault API. + link: https://developer.cisco.com/meraki/api-v1/#!set-network-wireless-ethernet-ports-profiles-default +notes: + - SDK Method used are + wireless.Wireless.set_network_wireless_ethernet_ports_profiles_default, + + - Paths used are + post /networks/{networkId}/wireless/ethernet/ports/profiles/setDefault, +""" + +EXAMPLES = r""" +- name: Create + cisco.meraki.networks_wireless_ethernet_ports_profiles_set_default: + meraki_api_key: "{{meraki_api_key}}" + meraki_base_url: "{{meraki_base_url}}" + meraki_single_request_timeout: "{{meraki_single_request_timeout}}" + meraki_certificate_path: "{{meraki_certificate_path}}" + meraki_requests_proxy: "{{meraki_requests_proxy}}" + meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" + meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" + meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" + meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" + meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" + meraki_maximum_retries: "{{meraki_maximum_retries}}" + meraki_output_log: "{{meraki_output_log}}" + meraki_log_file_prefix: "{{meraki_log_file_prefix}}" + meraki_log_path: "{{meraki_log_path}}" + meraki_print_console: "{{meraki_print_console}}" + meraki_suppress_logging: "{{meraki_suppress_logging}}" + meraki_simulate: "{{meraki_simulate}}" + meraki_be_geo_id: "{{meraki_be_geo_id}}" + meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" + meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" + networkId: string + profileId: '1001' + +""" +RETURN = r""" +meraki_response: + description: A dictionary or list with the response returned by the Cisco Meraki Python SDK + returned: always + type: dict + sample: > + { + "profileId": "string" + } +""" diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_failed_connections_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_failed_connections_info.py index b929330ff..2e5626ec3 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_failed_connections_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_failed_connections_info.py @@ -123,13 +123,13 @@ meraki_response: sample: > [ { - "ssidNumber": 0, - "vlan": 0, "clientMac": "string", - "serial": "string", "failureStep": "string", + "serial": "string", + "ssidNumber": 0, + "ts": "string", "type": "string", - "ts": "string" + "vlan": 0 } ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_latency_history_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_latency_history_info.py index 536ed128f..65ceeb3c8 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_latency_history_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_latency_history_info.py @@ -136,9 +136,9 @@ meraki_response: sample: > [ { - "startTs": "string", + "avgLatencyMs": 0, "endTs": "string", - "avgLatencyMs": 0 + "startTs": "string" } ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_latency_stats_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_latency_stats_info.py index cf8300995..7ae0fc8e0 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_latency_stats_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_latency_stats_info.py @@ -117,6 +117,28 @@ meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always type: dict - sample: - - {} + sample: > + { + "backgroundTraffic": { + "avg": 0, + "rawDistribution": { + "0": 0, + "1": 0, + "1024": 0, + "128": 0, + "16": 0, + "2": 0, + "2048": 0, + "256": 0, + "32": 0, + "4": 0, + "512": 0, + "64": 0, + "8": 0 + } + }, + "bestEffortTraffic": "string", + "videoTraffic": "string", + "voiceTraffic": "string" + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_mesh_statuses_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_mesh_statuses_info.py index b7ba8f763..0616d38e4 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_mesh_statuses_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_mesh_statuses_info.py @@ -93,7 +93,20 @@ RETURN = r""" meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always - type: dict - sample: - - {} + type: list + elements: dict + sample: > + [ + { + "latestMeshPerformance": { + "mbps": 0, + "metric": 0, + "usagePercentage": "string" + }, + "meshRoute": [ + "string" + ], + "serial": "string" + } + ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_rf_profiles.py b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_rf_profiles.py index c5f15bbd1..753217c31 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_rf_profiles.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_rf_profiles.py @@ -22,12 +22,21 @@ options: description: Settings that will be enabled if selectionType is set to 'ap'. suboptions: bandOperationMode: - description: Choice between 'dual', '2.4ghz' or '5ghz'. Defaults to dual. + description: Choice between 'dual', '2.4ghz', '5ghz', '6ghz' or 'multi'. Defaults + to dual. type: str bandSteeringEnabled: description: Steers client to most open band. Can be either true or false. Defaults to true. type: bool + bands: + description: Settings related to all bands. + suboptions: + enabled: + description: List of enabled bands. Can include "2.4", "5", "6", "disabled". + elements: str + type: list + type: dict type: dict bandSelectionType: description: Band selection can be set to either 'ssid' or 'ap'. This param is required @@ -71,6 +80,23 @@ options: elements: int type: list type: dict + flexRadios: + description: Flex radio settings. + suboptions: + byModel: + description: Flex radios by model. + elements: dict + suboptions: + bands: + description: Band to use for each flex radio. For example, '6' will set + the AP's first flex radio to 6 GHz. + elements: str + type: list + model: + description: Model of the AP. + type: str + type: list + type: dict minBitrateType: description: Minimum bitrate can be set to either 'band' or 'ssid'. Defaults to band. @@ -89,12 +115,20 @@ options: description: Settings for SSID 0. suboptions: bandOperationMode: - description: Choice between 'dual', '2.4ghz' or '5ghz'. + description: Choice between 'dual', '2.4ghz', '5ghz', '6ghz' or 'multi'. type: str bandSteeringEnabled: description: Steers client to most open band between 2.4 GHz and 5 GHz. Can be either true or false. type: bool + bands: + description: Settings related to all bands. + suboptions: + enabled: + description: List of enabled bands. Can include "2.4", "5", "6", "disabled". + elements: str + type: list + type: dict minBitrate: description: Sets min bitrate (Mbps) of this SSID. Can be one of '1', '2', '5.5', '6', '9', '11', '12', '18', '24', '36', '48' or '54'. @@ -104,12 +138,20 @@ options: description: Settings for SSID 1. suboptions: bandOperationMode: - description: Choice between 'dual', '2.4ghz' or '5ghz'. + description: Choice between 'dual', '2.4ghz', '5ghz', '6ghz' or 'multi'. type: str bandSteeringEnabled: description: Steers client to most open band between 2.4 GHz and 5 GHz. Can be either true or false. type: bool + bands: + description: Settings related to all bands. + suboptions: + enabled: + description: List of enabled bands. Can include "2.4", "5", "6", "disabled". + elements: str + type: list + type: dict minBitrate: description: Sets min bitrate (Mbps) of this SSID. Can be one of '1', '2', '5.5', '6', '9', '11', '12', '18', '24', '36', '48' or '54'. @@ -119,12 +161,20 @@ options: description: Settings for SSID 10. suboptions: bandOperationMode: - description: Choice between 'dual', '2.4ghz' or '5ghz'. + description: Choice between 'dual', '2.4ghz', '5ghz', '6ghz' or 'multi'. type: str bandSteeringEnabled: description: Steers client to most open band between 2.4 GHz and 5 GHz. Can be either true or false. type: bool + bands: + description: Settings related to all bands. + suboptions: + enabled: + description: List of enabled bands. Can include "2.4", "5", "6", "disabled". + elements: str + type: list + type: dict minBitrate: description: Sets min bitrate (Mbps) of this SSID. Can be one of '1', '2', '5.5', '6', '9', '11', '12', '18', '24', '36', '48' or '54'. @@ -134,12 +184,20 @@ options: description: Settings for SSID 11. suboptions: bandOperationMode: - description: Choice between 'dual', '2.4ghz' or '5ghz'. + description: Choice between 'dual', '2.4ghz', '5ghz', '6ghz' or 'multi'. type: str bandSteeringEnabled: description: Steers client to most open band between 2.4 GHz and 5 GHz. Can be either true or false. type: bool + bands: + description: Settings related to all bands. + suboptions: + enabled: + description: List of enabled bands. Can include "2.4", "5", "6", "disabled". + elements: str + type: list + type: dict minBitrate: description: Sets min bitrate (Mbps) of this SSID. Can be one of '1', '2', '5.5', '6', '9', '11', '12', '18', '24', '36', '48' or '54'. @@ -149,12 +207,20 @@ options: description: Settings for SSID 12. suboptions: bandOperationMode: - description: Choice between 'dual', '2.4ghz' or '5ghz'. + description: Choice between 'dual', '2.4ghz', '5ghz', '6ghz' or 'multi'. type: str bandSteeringEnabled: description: Steers client to most open band between 2.4 GHz and 5 GHz. Can be either true or false. type: bool + bands: + description: Settings related to all bands. + suboptions: + enabled: + description: List of enabled bands. Can include "2.4", "5", "6", "disabled". + elements: str + type: list + type: dict minBitrate: description: Sets min bitrate (Mbps) of this SSID. Can be one of '1', '2', '5.5', '6', '9', '11', '12', '18', '24', '36', '48' or '54'. @@ -164,12 +230,20 @@ options: description: Settings for SSID 13. suboptions: bandOperationMode: - description: Choice between 'dual', '2.4ghz' or '5ghz'. + description: Choice between 'dual', '2.4ghz', '5ghz', '6ghz' or 'multi'. type: str bandSteeringEnabled: description: Steers client to most open band between 2.4 GHz and 5 GHz. Can be either true or false. type: bool + bands: + description: Settings related to all bands. + suboptions: + enabled: + description: List of enabled bands. Can include "2.4","5", "6", "disabled". + elements: str + type: list + type: dict minBitrate: description: Sets min bitrate (Mbps) of this SSID. Can be one of '1', '2', '5.5', '6', '9', '11', '12', '18', '24', '36', '48' or '54'. @@ -179,12 +253,20 @@ options: description: Settings for SSID 14. suboptions: bandOperationMode: - description: Choice between 'dual', '2.4ghz' or '5ghz'. + description: Choice between 'dual', '2.4ghz', '5ghz', '6ghz' or 'multi'. type: str bandSteeringEnabled: description: Steers client to most open band between 2.4 GHz and 5 GHz. Can be either true or false. type: bool + bands: + description: Settings related to all bands. + suboptions: + enabled: + description: List of enabled bands. Can include "2.4","5", "6", "disabled". + elements: str + type: list + type: dict minBitrate: description: Sets min bitrate (Mbps) of this SSID. Can be one of '1', '2', '5.5', '6', '9', '11', '12', '18', '24', '36', '48' or '54'. @@ -194,12 +276,20 @@ options: description: Settings for SSID 2. suboptions: bandOperationMode: - description: Choice between 'dual', '2.4ghz' or '5ghz'. + description: Choice between 'dual', '2.4ghz', '5ghz', '6ghz' or 'multi'. type: str bandSteeringEnabled: description: Steers client to most open band between 2.4 GHz and 5 GHz. Can be either true or false. type: bool + bands: + description: Settings related to all bands. + suboptions: + enabled: + description: List of enabled bands. Can include "2.4","5", "6", "disabled". + elements: str + type: list + type: dict minBitrate: description: Sets min bitrate (Mbps) of this SSID. Can be one of '1', '2', '5.5', '6', '9', '11', '12', '18', '24', '36', '48' or '54'. @@ -209,12 +299,20 @@ options: description: Settings for SSID 3. suboptions: bandOperationMode: - description: Choice between 'dual', '2.4ghz' or '5ghz'. + description: Choice between 'dual', '2.4ghz', '5ghz', '6ghz' or 'multi'. type: str bandSteeringEnabled: description: Steers client to most open band between 2.4 GHz and 5 GHz. Can be either true or false. type: bool + bands: + description: Settings related to all bands. + suboptions: + enabled: + description: List of enabled bands. Can include "2.4","5", "6", "disabled". + elements: str + type: list + type: dict minBitrate: description: Sets min bitrate (Mbps) of this SSID. Can be one of '1', '2', '5.5', '6', '9', '11', '12', '18', '24', '36', '48' or '54'. @@ -224,12 +322,20 @@ options: description: Settings for SSID 4. suboptions: bandOperationMode: - description: Choice between 'dual', '2.4ghz' or '5ghz'. + description: Choice between 'dual', '2.4ghz', '5ghz', '6ghz' or 'multi'. type: str bandSteeringEnabled: description: Steers client to most open band between 2.4 GHz and 5 GHz. Can be either true or false. type: bool + bands: + description: Settings related to all bands. + suboptions: + enabled: + description: List of enabled bands. Can include "2.4","5", "6", "disabled". + elements: str + type: list + type: dict minBitrate: description: Sets min bitrate (Mbps) of this SSID. Can be one of '1', '2', '5.5', '6', '9', '11', '12', '18', '24', '36', '48' or '54'. @@ -239,12 +345,20 @@ options: description: Settings for SSID 5. suboptions: bandOperationMode: - description: Choice between 'dual', '2.4ghz' or '5ghz'. + description: Choice between 'dual', '2.4ghz', '5ghz', '6ghz' or 'multi'. type: str bandSteeringEnabled: description: Steers client to most open band between 2.4 GHz and 5 GHz. Can be either true or false. type: bool + bands: + description: Settings related to all bands. + suboptions: + enabled: + description: List of enabled bands. Can include "2.4","5", "6", "disabled". + elements: str + type: list + type: dict minBitrate: description: Sets min bitrate (Mbps) of this SSID. Can be one of '1', '2', '5.5', '6', '9', '11', '12', '18', '24', '36', '48' or '54'. @@ -254,12 +368,20 @@ options: description: Settings for SSID 6. suboptions: bandOperationMode: - description: Choice between 'dual', '2.4ghz' or '5ghz'. + description: Choice between 'dual', '2.4ghz', '5ghz', '6ghz' or 'multi'. type: str bandSteeringEnabled: description: Steers client to most open band between 2.4 GHz and 5 GHz. Can be either true or false. type: bool + bands: + description: Settings related to all bands. + suboptions: + enabled: + description: List of enabled bands. Can include "2.4","5", "6", "disabled". + elements: str + type: list + type: dict minBitrate: description: Sets min bitrate (Mbps) of this SSID. Can be one of '1', '2', '5.5', '6', '9', '11', '12', '18', '24', '36', '48' or '54'. @@ -269,12 +391,20 @@ options: description: Settings for SSID 7. suboptions: bandOperationMode: - description: Choice between 'dual', '2.4ghz' or '5ghz'. + description: Choice between 'dual', '2.4ghz', '5ghz', '6ghz' or 'multi'. type: str bandSteeringEnabled: description: Steers client to most open band between 2.4 GHz and 5 GHz. Can be either true or false. type: bool + bands: + description: Settings related to all bands. + suboptions: + enabled: + description: List of enabled bands. Can include "2.4","5", "6", "disabled". + elements: str + type: list + type: dict minBitrate: description: Sets min bitrate (Mbps) of this SSID. Can be one of '1', '2', '5.5', '6', '9', '11', '12', '18', '24', '36', '48' or '54'. @@ -284,12 +414,20 @@ options: description: Settings for SSID 8. suboptions: bandOperationMode: - description: Choice between 'dual', '2.4ghz' or '5ghz'. + description: Choice between 'dual', '2.4ghz', '5ghz', '6ghz' or 'multi'. type: str bandSteeringEnabled: description: Steers client to most open band between 2.4 GHz and 5 GHz. Can be either true or false. type: bool + bands: + description: Settings related to all bands. + suboptions: + enabled: + description: List of enabled bands. Can include "2.4","5", "6", "disabled". + elements: str + type: list + type: dict minBitrate: description: Sets min bitrate (Mbps) of this SSID. Can be one of '1', '2', '5.5', '6', '9', '11', '12', '18', '24', '36', '48' or '54'. @@ -299,12 +437,20 @@ options: description: Settings for SSID 9. suboptions: bandOperationMode: - description: Choice between 'dual', '2.4ghz' or '5ghz'. + description: Choice between 'dual', '2.4ghz', '5ghz', '6ghz' or 'multi'. type: str bandSteeringEnabled: description: Steers client to most open band between 2.4 GHz and 5 GHz. Can be either true or false. type: bool + bands: + description: Settings related to all bands. + suboptions: + enabled: + description: List of enabled bands. Can include "2.4","5", "6", "disabled". + elements: str + type: list + type: dict minBitrate: description: Sets min bitrate (Mbps) of this SSID. Can be one of '1', '2', '5.5', '6', '9', '11', '12', '18', '24', '36', '48' or '54'. @@ -315,7 +461,8 @@ options: description: RfProfileId path parameter. Rf profile ID. type: str sixGhzSettings: - description: Settings related to 6Ghz band. + description: Settings related to 6Ghz band. Only applicable to networks with 6Ghz + capable APs. suboptions: channelWidth: description: Sets channel width (MHz) for 6Ghz band. Can be one of '0', '20', @@ -445,6 +592,10 @@ EXAMPLES = r""" apBandSettings: bandOperationMode: dual bandSteeringEnabled: true + bands: + enabled: + - '2.4' + - '5' bandSelectionType: ap clientBalancingEnabled: true fiveGhzSettings: @@ -479,6 +630,11 @@ EXAMPLES = r""" - 157 - 161 - 165 + flexRadios: + byModel: + - bands: + - '5' + model: MR34 minBitrateType: band name: Main Office networkId: string @@ -486,63 +642,123 @@ EXAMPLES = r""" '0': bandOperationMode: dual bandSteeringEnabled: true - minBitrate: 11 + bands: + enabled: + - '2.4' + - '5' + minBitrate: 11.0 '1': bandOperationMode: dual bandSteeringEnabled: true - minBitrate: 11 + bands: + enabled: + - '2.4' + - '5' + minBitrate: 11.0 '10': bandOperationMode: dual bandSteeringEnabled: true - minBitrate: 11 + bands: + enabled: + - '2.4' + - '5' + minBitrate: 11.0 '11': bandOperationMode: dual bandSteeringEnabled: true - minBitrate: 11 + bands: + enabled: + - '2.4' + - '5' + minBitrate: 11.0 '12': bandOperationMode: dual bandSteeringEnabled: true - minBitrate: 11 + bands: + enabled: + - '2.4' + - '5' + minBitrate: 11.0 '13': bandOperationMode: dual bandSteeringEnabled: true - minBitrate: 11 + bands: + enabled: + - '2.4' + - '5' + minBitrate: 11.0 '14': bandOperationMode: dual bandSteeringEnabled: true - minBitrate: 11 + bands: + enabled: + - '2.4' + - '5' + minBitrate: 11.0 '2': bandOperationMode: dual bandSteeringEnabled: true - minBitrate: 11 + bands: + enabled: + - '2.4' + - '5' + minBitrate: 11.0 '3': bandOperationMode: dual bandSteeringEnabled: true - minBitrate: 11 + bands: + enabled: + - '2.4' + - '5' + minBitrate: 11.0 '4': bandOperationMode: dual bandSteeringEnabled: true - minBitrate: 11 + bands: + enabled: + - '2.4' + - '5' + minBitrate: 11.0 '5': bandOperationMode: dual bandSteeringEnabled: true - minBitrate: 11 + bands: + enabled: + - '2.4' + - '5' + minBitrate: 11.0 '6': bandOperationMode: dual bandSteeringEnabled: true - minBitrate: 11 + bands: + enabled: + - '2.4' + - '5' + minBitrate: 11.0 '7': bandOperationMode: dual bandSteeringEnabled: true - minBitrate: 11 + bands: + enabled: + - '2.4' + - '5' + minBitrate: 11.0 '8': bandOperationMode: dual bandSteeringEnabled: true - minBitrate: 11 + bands: + enabled: + - '2.4' + - '5' + minBitrate: 11.0 '9': bandOperationMode: dual bandSteeringEnabled: true - minBitrate: 11 + bands: + enabled: + - '2.4' + - '5' + minBitrate: 11.0 sixGhzSettings: channelWidth: auto maxPower: 30 @@ -614,7 +830,7 @@ EXAMPLES = r""" twoFourGhzSettings: axEnabled: true maxPower: 30 - minBitrate: 11 + minBitrate: 11.0 minPower: 5 rxsop: -95 validAutoChannels: @@ -622,6 +838,32 @@ EXAMPLES = r""" - 6 - 11 +- name: Delete by id + cisco.meraki.networks_wireless_rf_profiles: + meraki_api_key: "{{meraki_api_key}}" + meraki_base_url: "{{meraki_base_url}}" + meraki_single_request_timeout: "{{meraki_single_request_timeout}}" + meraki_certificate_path: "{{meraki_certificate_path}}" + meraki_requests_proxy: "{{meraki_requests_proxy}}" + meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" + meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" + meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" + meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" + meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" + meraki_maximum_retries: "{{meraki_maximum_retries}}" + meraki_output_log: "{{meraki_output_log}}" + meraki_log_file_prefix: "{{meraki_log_file_prefix}}" + meraki_log_path: "{{meraki_log_path}}" + meraki_print_console: "{{meraki_print_console}}" + meraki_suppress_logging: "{{meraki_suppress_logging}}" + meraki_simulate: "{{meraki_simulate}}" + meraki_be_geo_id: "{{meraki_be_geo_id}}" + meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" + meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" + state: absent + networkId: string + rfProfileId: string + - name: Update by id cisco.meraki.networks_wireless_rf_profiles: meraki_api_key: "{{meraki_api_key}}" @@ -648,6 +890,10 @@ EXAMPLES = r""" apBandSettings: bandOperationMode: dual bandSteeringEnabled: true + bands: + enabled: + - '2.4' + - '5' bandSelectionType: ap clientBalancingEnabled: true fiveGhzSettings: @@ -682,6 +928,11 @@ EXAMPLES = r""" - 157 - 161 - 165 + flexRadios: + byModel: + - bands: + - '5' + model: MR34 minBitrateType: band name: '1234' networkId: string @@ -689,63 +940,123 @@ EXAMPLES = r""" '0': bandOperationMode: dual bandSteeringEnabled: true - minBitrate: 11 + bands: + enabled: + - '2.4' + - '5' + minBitrate: 11.0 '1': bandOperationMode: dual bandSteeringEnabled: true - minBitrate: 11 + bands: + enabled: + - '2.4' + - '5' + minBitrate: 11.0 '10': bandOperationMode: dual bandSteeringEnabled: true - minBitrate: 11 + bands: + enabled: + - '2.4' + - '5' + minBitrate: 11.0 '11': bandOperationMode: dual bandSteeringEnabled: true - minBitrate: 11 + bands: + enabled: + - '2.4' + - '5' + minBitrate: 11.0 '12': bandOperationMode: dual bandSteeringEnabled: true - minBitrate: 11 + bands: + enabled: + - '2.4' + - '5' + minBitrate: 11.0 '13': bandOperationMode: dual bandSteeringEnabled: true - minBitrate: 11 + bands: + enabled: + - '2.4' + - '5' + minBitrate: 11.0 '14': bandOperationMode: dual bandSteeringEnabled: true - minBitrate: 11 + bands: + enabled: + - '2.4' + - '5' + minBitrate: 11.0 '2': bandOperationMode: dual bandSteeringEnabled: true - minBitrate: 11 + bands: + enabled: + - '2.4' + - '5' + minBitrate: 11.0 '3': bandOperationMode: dual bandSteeringEnabled: true - minBitrate: 11 + bands: + enabled: + - '2.4' + - '5' + minBitrate: 11.0 '4': bandOperationMode: dual bandSteeringEnabled: true - minBitrate: 11 + bands: + enabled: + - '2.4' + - '5' + minBitrate: 11.0 '5': bandOperationMode: dual bandSteeringEnabled: true - minBitrate: 11 + bands: + enabled: + - '2.4' + - '5' + minBitrate: 11.0 '6': bandOperationMode: dual bandSteeringEnabled: true - minBitrate: 11 + bands: + enabled: + - '2.4' + - '5' + minBitrate: 11.0 '7': bandOperationMode: dual bandSteeringEnabled: true - minBitrate: 11 + bands: + enabled: + - '2.4' + - '5' + minBitrate: 11.0 '8': bandOperationMode: dual bandSteeringEnabled: true - minBitrate: 11 + bands: + enabled: + - '2.4' + - '5' + minBitrate: 11.0 '9': bandOperationMode: dual bandSteeringEnabled: true - minBitrate: 11 + bands: + enabled: + - '2.4' + - '5' + minBitrate: 11.0 rfProfileId: string sixGhzSettings: channelWidth: auto @@ -818,7 +1129,7 @@ EXAMPLES = r""" twoFourGhzSettings: axEnabled: true maxPower: 30 - minBitrate: 11 + minBitrate: 11.0 minPower: 5 rxsop: -95 validAutoChannels: @@ -826,32 +1137,6 @@ EXAMPLES = r""" - 6 - 11 -- name: Delete by id - cisco.meraki.networks_wireless_rf_profiles: - meraki_api_key: "{{meraki_api_key}}" - meraki_base_url: "{{meraki_base_url}}" - meraki_single_request_timeout: "{{meraki_single_request_timeout}}" - meraki_certificate_path: "{{meraki_certificate_path}}" - meraki_requests_proxy: "{{meraki_requests_proxy}}" - meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" - meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" - meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" - meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" - meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" - meraki_maximum_retries: "{{meraki_maximum_retries}}" - meraki_output_log: "{{meraki_output_log}}" - meraki_log_file_prefix: "{{meraki_log_file_prefix}}" - meraki_log_path: "{{meraki_log_path}}" - meraki_print_console: "{{meraki_print_console}}" - meraki_suppress_logging: "{{meraki_suppress_logging}}" - meraki_simulate: "{{meraki_simulate}}" - meraki_be_geo_id: "{{meraki_be_geo_id}}" - meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" - meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: absent - networkId: string - rfProfileId: string - """ RETURN = r""" meraki_response: @@ -860,130 +1145,220 @@ meraki_response: type: dict sample: > { - "id": "string", - "networkId": "string", - "name": "string", - "clientBalancingEnabled": true, - "minBitrateType": "string", - "bandSelectionType": "string", "apBandSettings": { "bandOperationMode": "string", - "bandSteeringEnabled": true - }, - "twoFourGhzSettings": { - "maxPower": 0, - "minPower": 0, - "minBitrate": 0, - "validAutoChannels": [ - 0 - ], - "axEnabled": true, - "rxsop": 0 + "bandSteeringEnabled": true, + "bands": { + "enabled": [ + "string" + ] + } }, + "bandSelectionType": "string", + "clientBalancingEnabled": true, "fiveGhzSettings": { + "channelWidth": "string", "maxPower": 0, - "minPower": 0, "minBitrate": 0, + "minPower": 0, + "rxsop": 0, "validAutoChannels": [ 0 - ], - "channelWidth": "string", - "rxsop": 0 - }, - "transmission": { - "enabled": true + ] }, + "id": "string", + "minBitrateType": "string", + "name": "string", + "networkId": "string", "perSsidSettings": { "0": { - "name": "string", - "minBitrate": 0, "bandOperationMode": "string", - "bandSteeringEnabled": true + "bandSteeringEnabled": true, + "bands": { + "enabled": [ + "string" + ] + }, + "minBitrate": 0, + "name": "string" }, "1": { - "name": "string", - "minBitrate": 0, "bandOperationMode": "string", - "bandSteeringEnabled": true - }, - "2": { - "name": "string", + "bandSteeringEnabled": true, + "bands": { + "enabled": [ + "string" + ] + }, "minBitrate": 0, - "bandOperationMode": "string", - "bandSteeringEnabled": true + "name": "string" }, - "3": { - "name": "string", - "minBitrate": 0, + "10": { "bandOperationMode": "string", - "bandSteeringEnabled": true - }, - "4": { - "name": "string", + "bandSteeringEnabled": true, + "bands": { + "enabled": [ + "string" + ] + }, "minBitrate": 0, - "bandOperationMode": "string", - "bandSteeringEnabled": true + "name": "string" }, - "5": { - "name": "string", - "minBitrate": 0, + "11": { "bandOperationMode": "string", - "bandSteeringEnabled": true - }, - "6": { - "name": "string", + "bandSteeringEnabled": true, + "bands": { + "enabled": [ + "string" + ] + }, "minBitrate": 0, - "bandOperationMode": "string", - "bandSteeringEnabled": true + "name": "string" }, - "7": { - "name": "string", - "minBitrate": 0, + "12": { "bandOperationMode": "string", - "bandSteeringEnabled": true - }, - "8": { - "name": "string", + "bandSteeringEnabled": true, + "bands": { + "enabled": [ + "string" + ] + }, "minBitrate": 0, - "bandOperationMode": "string", - "bandSteeringEnabled": true + "name": "string" }, - "9": { - "name": "string", - "minBitrate": 0, + "13": { "bandOperationMode": "string", - "bandSteeringEnabled": true - }, - "10": { - "name": "string", + "bandSteeringEnabled": true, + "bands": { + "enabled": [ + "string" + ] + }, "minBitrate": 0, + "name": "string" + }, + "14": { "bandOperationMode": "string", - "bandSteeringEnabled": true + "bandSteeringEnabled": true, + "bands": { + "enabled": [ + "string" + ] + }, + "minBitrate": 0, + "name": "string" }, - "11": { - "name": "string", + "2": { + "bandOperationMode": "string", + "bandSteeringEnabled": true, + "bands": { + "enabled": [ + "string" + ] + }, "minBitrate": 0, + "name": "string" + }, + "3": { "bandOperationMode": "string", - "bandSteeringEnabled": true + "bandSteeringEnabled": true, + "bands": { + "enabled": [ + "string" + ] + }, + "minBitrate": 0, + "name": "string" }, - "12": { - "name": "string", + "4": { + "bandOperationMode": "string", + "bandSteeringEnabled": true, + "bands": { + "enabled": [ + "string" + ] + }, "minBitrate": 0, + "name": "string" + }, + "5": { "bandOperationMode": "string", - "bandSteeringEnabled": true + "bandSteeringEnabled": true, + "bands": { + "enabled": [ + "string" + ] + }, + "minBitrate": 0, + "name": "string" }, - "13": { - "name": "string", + "6": { + "bandOperationMode": "string", + "bandSteeringEnabled": true, + "bands": { + "enabled": [ + "string" + ] + }, "minBitrate": 0, + "name": "string" + }, + "7": { "bandOperationMode": "string", - "bandSteeringEnabled": true + "bandSteeringEnabled": true, + "bands": { + "enabled": [ + "string" + ] + }, + "minBitrate": 0, + "name": "string" }, - "14": { - "name": "string", + "8": { + "bandOperationMode": "string", + "bandSteeringEnabled": true, + "bands": { + "enabled": [ + "string" + ] + }, "minBitrate": 0, + "name": "string" + }, + "9": { "bandOperationMode": "string", - "bandSteeringEnabled": true + "bandSteeringEnabled": true, + "bands": { + "enabled": [ + "string" + ] + }, + "minBitrate": 0, + "name": "string" } + }, + "sixGhzSettings": { + "channelWidth": "string", + "maxPower": 0, + "minBitrate": 0, + "minPower": 0, + "rxsop": 0, + "validAutoChannels": [ + 0 + ] + }, + "transmission": { + "enabled": true + }, + "twoFourGhzSettings": { + "axEnabled": true, + "maxPower": 0, + "minBitrate": 0, + "minPower": 0, + "rxsop": 0, + "validAutoChannels": [ + 0 + ] } } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_rf_profiles_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_rf_profiles_info.py index 29609886a..5d7a0abcb 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_rf_profiles_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_rf_profiles_info.py @@ -11,7 +11,7 @@ short_description: Information module for networks _wireless _rfprofiles description: - Get all networks _wireless _rfprofiles. - Get networks _wireless _rfprofiles by id. -- List the non-basic RF profiles for this network. +- List RF profiles for this network. - Return a RF profile. version_added: '2.16.0' extends_documentation_fragment: @@ -114,10 +114,223 @@ RETURN = r""" meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always - type: list - elements: dict + type: dict sample: > - [ - {} - ] + { + "apBandSettings": { + "bandOperationMode": "string", + "bandSteeringEnabled": true, + "bands": { + "enabled": [ + "string" + ] + } + }, + "bandSelectionType": "string", + "clientBalancingEnabled": true, + "fiveGhzSettings": { + "channelWidth": "string", + "maxPower": 0, + "minBitrate": 0, + "minPower": 0, + "rxsop": 0, + "validAutoChannels": [ + 0 + ] + }, + "id": "string", + "minBitrateType": "string", + "name": "string", + "networkId": "string", + "perSsidSettings": { + "0": { + "bandOperationMode": "string", + "bandSteeringEnabled": true, + "bands": { + "enabled": [ + "string" + ] + }, + "minBitrate": 0, + "name": "string" + }, + "1": { + "bandOperationMode": "string", + "bandSteeringEnabled": true, + "bands": { + "enabled": [ + "string" + ] + }, + "minBitrate": 0, + "name": "string" + }, + "10": { + "bandOperationMode": "string", + "bandSteeringEnabled": true, + "bands": { + "enabled": [ + "string" + ] + }, + "minBitrate": 0, + "name": "string" + }, + "11": { + "bandOperationMode": "string", + "bandSteeringEnabled": true, + "bands": { + "enabled": [ + "string" + ] + }, + "minBitrate": 0, + "name": "string" + }, + "12": { + "bandOperationMode": "string", + "bandSteeringEnabled": true, + "bands": { + "enabled": [ + "string" + ] + }, + "minBitrate": 0, + "name": "string" + }, + "13": { + "bandOperationMode": "string", + "bandSteeringEnabled": true, + "bands": { + "enabled": [ + "string" + ] + }, + "minBitrate": 0, + "name": "string" + }, + "14": { + "bandOperationMode": "string", + "bandSteeringEnabled": true, + "bands": { + "enabled": [ + "string" + ] + }, + "minBitrate": 0, + "name": "string" + }, + "2": { + "bandOperationMode": "string", + "bandSteeringEnabled": true, + "bands": { + "enabled": [ + "string" + ] + }, + "minBitrate": 0, + "name": "string" + }, + "3": { + "bandOperationMode": "string", + "bandSteeringEnabled": true, + "bands": { + "enabled": [ + "string" + ] + }, + "minBitrate": 0, + "name": "string" + }, + "4": { + "bandOperationMode": "string", + "bandSteeringEnabled": true, + "bands": { + "enabled": [ + "string" + ] + }, + "minBitrate": 0, + "name": "string" + }, + "5": { + "bandOperationMode": "string", + "bandSteeringEnabled": true, + "bands": { + "enabled": [ + "string" + ] + }, + "minBitrate": 0, + "name": "string" + }, + "6": { + "bandOperationMode": "string", + "bandSteeringEnabled": true, + "bands": { + "enabled": [ + "string" + ] + }, + "minBitrate": 0, + "name": "string" + }, + "7": { + "bandOperationMode": "string", + "bandSteeringEnabled": true, + "bands": { + "enabled": [ + "string" + ] + }, + "minBitrate": 0, + "name": "string" + }, + "8": { + "bandOperationMode": "string", + "bandSteeringEnabled": true, + "bands": { + "enabled": [ + "string" + ] + }, + "minBitrate": 0, + "name": "string" + }, + "9": { + "bandOperationMode": "string", + "bandSteeringEnabled": true, + "bands": { + "enabled": [ + "string" + ] + }, + "minBitrate": 0, + "name": "string" + } + }, + "sixGhzSettings": { + "channelWidth": "string", + "maxPower": 0, + "minBitrate": 0, + "minPower": 0, + "rxsop": 0, + "validAutoChannels": [ + 0 + ] + }, + "transmission": { + "enabled": true + }, + "twoFourGhzSettings": { + "axEnabled": true, + "maxPower": 0, + "minBitrate": 0, + "minPower": 0, + "rxsop": 0, + "validAutoChannels": [ + 0 + ] + } + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_settings.py b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_settings.py index 9f990b5ac..91f4d4ef7 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_settings.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_settings.py @@ -30,6 +30,23 @@ options: meshingEnabled: description: Toggle for enabling or disabling meshing in a network. type: bool + namedVlans: + description: Named VLAN settings for wireless networks. + suboptions: + poolDhcpMonitoring: + description: Named VLAN Pool DHCP Monitoring settings. + suboptions: + duration: + description: The duration in minutes that devices will refrain from using + dirty VLANs before adding them back to the pool. + type: int + enabled: + description: Whether or not devices using named VLAN pools should remove + dirty VLANs from the pool, thereby preventing clients from being assigned + to VLANs where they would be unable to obtain an IP address via DHCP. + type: bool + type: dict + type: dict networkId: description: NetworkId path parameter. Network ID. type: str @@ -80,6 +97,10 @@ EXAMPLES = r""" ledLightsOn: false locationAnalyticsEnabled: false meshingEnabled: true + namedVlans: + poolDhcpMonitoring: + duration: 5 + enabled: true networkId: string upgradeStrategy: minimizeUpgradeTime @@ -91,16 +112,21 @@ meraki_response: type: dict sample: > { - "meshingEnabled": true, "ipv6BridgeEnabled": true, - "locationAnalyticsEnabled": true, - "upgradeStrategy": "string", "ledLightsOn": true, + "locationAnalyticsEnabled": true, + "meshingEnabled": true, "namedVlans": { "poolDhcpMonitoring": { - "enabled": true, - "duration": 0 + "duration": 0, + "enabled": true } - } + }, + "regulatoryDomain": { + "countryCode": "string", + "name": "string", + "permits6e": true + }, + "upgradeStrategy": "string" } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_settings_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_settings_info.py index 9c19a807f..56f3a698e 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_settings_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_settings_info.py @@ -72,16 +72,21 @@ meraki_response: type: dict sample: > { - "meshingEnabled": true, "ipv6BridgeEnabled": true, - "locationAnalyticsEnabled": true, - "upgradeStrategy": "string", "ledLightsOn": true, + "locationAnalyticsEnabled": true, + "meshingEnabled": true, "namedVlans": { "poolDhcpMonitoring": { - "enabled": true, - "duration": 0 + "duration": 0, + "enabled": true } - } + }, + "regulatoryDomain": { + "countryCode": "string", + "name": "string", + "permits6e": true + }, + "upgradeStrategy": "string" } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_signal_quality_history_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_signal_quality_history_info.py index e5cd31632..4e1bdb3fe 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_signal_quality_history_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_signal_quality_history_info.py @@ -131,10 +131,10 @@ meraki_response: sample: > [ { - "startTs": "string", "endTs": "string", + "rssi": 0, "snr": 0, - "rssi": 0 + "startTs": "string" } ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids.py b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids.py index 9938106c5..e16510d2e 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids.py @@ -38,7 +38,7 @@ options: elements: dict suboptions: host: - description: IP address of your Active Directory server. + description: IP address (or FQDN) of your Active Directory server. type: str port: description: (Optional) UDP port the Active Directory server listens on. @@ -65,7 +65,8 @@ options: authMode: description: The association control method for the SSID ('open', 'open-enhanced', 'psk', 'open-with-radius', 'open-with-nac', '8021x-meraki', '8021x-nac', '8021x-radius', - '8021x-google', '8021x-localradius', 'ipsk-with-radius' or 'ipsk-without-radius'). + '8021x-google', '8021x-localradius', 'ipsk-with-radius', 'ipsk-without-radius' + or 'ipsk-with-nac'). type: str availabilityTags: description: Accepts a list of tags for this SSID. If availableOnAllAps is false, @@ -194,7 +195,7 @@ options: elements: dict suboptions: host: - description: IP address of your LDAP server. + description: IP address (or FQDN) of your LDAP server. type: str port: description: UDP port the LDAP server listens on. @@ -255,6 +256,54 @@ options: name: description: The name of the SSID. type: str + namedVlans: + description: Named VLAN settings. + suboptions: + radius: + description: RADIUS settings. This param is only valid when authMode is 'open-with-radius' + and ipAssignmentMode is not 'NAT mode'. + suboptions: + guestVlan: + description: Guest VLAN settings. Used to direct traffic to a guest VLAN + when none of the RADIUS servers are reachable or a client receives access-reject + from the RADIUS server. + suboptions: + enabled: + description: Whether or not RADIUS guest named VLAN is enabled. + type: bool + name: + description: RADIUS guest VLAN name. + type: str + type: dict + type: dict + tagging: + description: VLAN tagging settings. This param is only valid when ipAssignmentMode + is 'Bridge mode' or 'Layer 3 roaming'. + suboptions: + byApTags: + description: The list of AP tags and VLAN names used for named VLAN tagging. + If an AP has a tag matching one in the list, then traffic on this SSID + will be directed to use the VLAN name associated to the tag. + elements: dict + suboptions: + tags: + description: List of AP tags. + elements: str + type: list + vlanName: + description: VLAN name that will be used to tag traffic. + type: str + type: list + defaultVlanName: + description: The default VLAN name used to tag traffic in the absence of + a matching AP tag. + type: str + enabled: + description: Whether or not traffic should be directed to use specific VLAN + names. + type: bool + type: dict + type: dict networkId: description: NetworkId path parameter. Network ID. type: str @@ -304,7 +353,8 @@ options: description: Certificate used for authorization for the RADSEC Server. type: str host: - description: IP address to which the APs will send RADIUS accounting messages. + description: IP address (or FQDN) to which the APs will send RADIUS accounting + messages. type: str port: description: Port on the RADIUS server that is listening for accounting messages. @@ -384,7 +434,7 @@ options: description: Certificate used for authorization for the RADSEC Server. type: str host: - description: IP address of your RADIUS server. + description: IP address (or FQDN) of your RADIUS server. type: str openRoamingCertificateId: description: The ID of the Openroaming Certificate attached to radius server. @@ -497,10 +547,234 @@ EXAMPLES = r""" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" state: present + activeDirectory: + credentials: + logonName: user + password: password + servers: + - host: 127.0.0.1 + port: 3268 + adultContentFilteringEnabled: false + apTagsAndVlanIds: + - tags: + - tag1 + - tag2 + vlanId: 100 + authMode: 8021x-radius + availabilityTags: + - tag1 + - tag2 + availableOnAllAps: false + bandSelection: 5 GHz band only + concentratorNetworkId: N_24329156 + defaultVlanId: 1 + disassociateClientsOnVpnFailover: false + dnsRewrite: + dnsCustomNameservers: + - 8.8.8.8 + - 8.8.4.4 + enabled: true + dot11r: + adaptive: true + enabled: true + dot11w: + enabled: true + required: false enabled: true + encryptionMode: wpa + enterpriseAdminAccess: access enabled + gre: + concentrator: + host: 192.168.1.1 + key: 5 + ipAssignmentMode: NAT mode + lanIsolationEnabled: true + ldap: + baseDistinguishedName: dc=example,dc=com + credentials: + distinguishedName: cn=user,dc=example,dc=com + password: password + serverCaCertificate: + contents: '-----BEGIN CERTIFICATE----- + MIIEKjCCAxKgAwIBAgIRANb+lsED3eb4+6YKLFFYqEkwDQYJKoZIhvcNAQELBQAw + gYcxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlhMREwDwYDVQQHDAhT + YW4gSm9zZTEcMBoGA1UECgwTQ2lzY28gU3lzdGVtcywgSW5jLjESMBAGA1UECwwJ + RE5BU3BhY2VzMR4wHAYDVQQDDBVjaXNjby5vcGVucm9hbWluZy5vcmcwHhcNMjAx + MTA1MjEzMzM1WhcNMjExMTA1MjIzMzM1WjCBpDEcMBoGCgmSJomT8ixkAQETDGRu + YXNwYWNlczpVUzELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMQ4wDAYDVQQKEwVD + aXNjbzEcMBoGA1UECxMTV0JBOldSSVggRW5kLUVudGl0eTE8MDoGA1UEAxMzNjQ3 + MDcwNDM4NDQ5NjQxMjAwMDAuMTg4MzQuaHMuY2lzY28ub3BlbnJvYW1pbmcub3Jn + MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAoqjP9QgRGyUO3p7SH9QK + uTq6UYK7nAyjImgS4yQxeBkyZ5f2EUkX8m/AOcewpPxxPBhjPKRwxGeX3S50ksiA + ayFomUeslR0S0Z7RN9rzJa+CFyi9MwWIHMbLgXpB8tsSpgTAqwrzoTzOGq9fgC6u + pZhdZrBkg3FeJgD88goCi9mZDsY2YAoeGRLFJ2fR8iICqIVQy+Htq9pE22WBLpnS + KjL3+mR9FArHNFtWlhKF2YHMUqyHHrnZnF/Ns7QNoMMF7/CK18iAKgnb+2wuGKM + aEMddOeOTtz+i/rgjkp/RGMt011EdCsso0/cTo9qqX/bxOOCE4/Mne/ChMkQPnNU + CwIDAQABo3IwcDAJBgNVHRMEAjAAMB8GA1UdIwQYMBaAFIG+4l5yiB01gP0sw4ML + USopqYcuMB0GA1UdDgQWBBSby1T9leYVOVVdOZXiHCSaDDEMiDAOBgNVHQ8BAf8E + BAMCBaAwEwYDVR0lBAwwCgYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAEyE + 1mjSUyY6uNp6W4l20w7SskALSJDRKkOeZxAgF3VMxlsCuEl70s9oEfntwIpyQtSa + jON/9yJHbwm/Az824bmk8Dc7AXIPhay+dftXb8j529gPuYB9AKoPNg0NctkyYCQh + a/3YQVdDWX7XgmEiXkL57M7G6+IdcPDONLArfjOcT9qHdkVVq1AIjlMSx3OQQmm/ + uoLb/G9q/97QA2/l8shG/Na8HjVqGLcl5TNZdbNhs2w9ogxr/GNzqdvym6RQ8vT/ + UR2n+uwH4n1MUxmHYYeyot5dnIV1IJ6hQ54JAncM9HvCLFk1WHz6RKshQUCuPBiJ + wTw70BVktzJnb0VLeDg= + -----END CERTIFICATE-----' + servers: + - host: 127.0.0.1 + port: 389 + localRadius: + cacheTimeout: 60 + certificateAuthentication: + clientRootCaCertificate: + contents: '-----BEGIN CERTIFICATE----- + MIIEKjCCAxKgAwIBAgIRANb+lsED3eb4+6YKLFFYqEkwDQYJKoZIhvcNAQELBQAw + gYcxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlhMREwDwYDVQQHDAhT + YW4gSm9zZTEcMBoGA1UECgwTQ2lzY28gU3lzdGVtcywgSW5jLjESMBAGA1UECwwJ + RE5BU3BhY2VzMR4wHAYDVQQDDBVjaXNjby5vcGVucm9hbWluZy5vcmcwHhcNMjAx + MTA1MjEzMzM1WhcNMjExMTA1MjIzMzM1WjCBpDEcMBoGCgmSJomT8ixkAQETDGRu + YXNwYWNlczpVUzELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMQ4wDAYDVQQKEwVD + aXNjbzEcMBoGA1UECxMTV0JBOldSSVggRW5kLUVudGl0eTE8MDoGA1UEAxMzNjQ3 + MDcwNDM4NDQ5NjQxMjAwMDAuMTg4MzQuaHMuY2lzY28ub3BlbnJvYW1pbmcub3Jn + MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAoqjP9QgRGyUO3p7SH9QK + uTq6UYK7nAyjImgS4yQxeBkyZ5f2EUkX8m/AOcewpPxxPBhjPKRwxGeX3S50ksiA + ayFomUeslR0S0Z7RN9rzJa+CFyi9MwWIHMbLgXpB8tsSpgTAqwrzoTzOGq9fgC6u + pZhdZrBkg3FeJgD88goCi9mZDsY2YAoeGRLFJ2fR8iICqIVQy+Htq9pE22WBLpnS + KjL3+mR9FArHNFtWlhKF2YHMUqyHHrnZnF/Ns7QNoMMF7/CK18iAKgnb+2wuGKM + aEMddOeOTtz+i/rgjkp/RGMt011EdCsso0/cTo9qqX/bxOOCE4/Mne/ChMkQPnNU + CwIDAQABo3IwcDAJBgNVHRMEAjAAMB8GA1UdIwQYMBaAFIG+4l5yiB01gP0sw4ML + USopqYcuMB0GA1UdDgQWBBSby1T9leYVOVVdOZXiHCSaDDEMiDAOBgNVHQ8BAf8E + BAMCBaAwEwYDVR0lBAwwCgYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAEyE + 1mjSUyY6uNp6W4l20w7SskALSJDRKkOeZxAgF3VMxlsCuEl70s9oEfntwIpyQtSa + jON/9yJHbwm/Az824bmk8Dc7AXIPhay+dftXb8j529gPuYB9AKoPNg0NctkyYCQh + a/3YQVdDWX7XgmEiXkL57M7G6+IdcPDONLArfjOcT9qHdkVVq1AIjlMSx3OQQmm/ + uoLb/G9q/97QA2/l8shG/Na8HjVqGLcl5TNZdbNhs2w9ogxr/GNzqdvym6RQ8vT/ + UR2n+uwH4n1MUxmHYYeyot5dnIV1IJ6hQ54JAncM9HvCLFk1WHz6RKshQUCuPBiJ + wTw70BVktzJnb0VLeDg= + -----END CERTIFICATE-----' + enabled: true + ocspResponderUrl: http://ocsp-server.example.com + useLdap: false + useOcsp: true + passwordAuthentication: + enabled: false + mandatoryDhcpEnabled: false + minBitrate: 5.5 name: My SSID + namedVlans: + radius: + guestVlan: + enabled: true + name: Guest VLAN + tagging: + byApTags: + - tags: + - tag1 + - tag2 + vlanName: My VLAN + defaultVlanName: My VLAN + enabled: true networkId: string number: string + oauth: + allowedDomains: + - example.com + perClientBandwidthLimitDown: 0 + perClientBandwidthLimitUp: 0 + perSsidBandwidthLimitDown: 0 + perSsidBandwidthLimitUp: 0 + psk: deadbeef + radiusAccountingEnabled: true + radiusAccountingInterimInterval: 5 + radiusAccountingServers: + - caCertificate: '-----BEGIN CERTIFICATE----- + MIIEKjCCAxKgAwIBAgIRANb+lsED3eb4+6YKLFFYqEkwDQYJKoZIhvcNAQELBQAw + gYcxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlhMREwDwYDVQQHDAhT + YW4gSm9zZTEcMBoGA1UECgwTQ2lzY28gU3lzdGVtcywgSW5jLjESMBAGA1UECwwJ + RE5BU3BhY2VzMR4wHAYDVQQDDBVjaXNjby5vcGVucm9hbWluZy5vcmcwHhcNMjAx + MTA1MjEzMzM1WhcNMjExMTA1MjIzMzM1WjCBpDEcMBoGCgmSJomT8ixkAQETDGRu + YXNwYWNlczpVUzELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMQ4wDAYDVQQKEwVD + aXNjbzEcMBoGA1UECxMTV0JBOldSSVggRW5kLUVudGl0eTE8MDoGA1UEAxMzNjQ3 + MDcwNDM4NDQ5NjQxMjAwMDAuMTg4MzQuaHMuY2lzY28ub3BlbnJvYW1pbmcub3Jn + MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAoqjP9QgRGyUO3p7SH9QK + uTq6UYK7nAyjImgS4yQxeBkyZ5f2EUkX8m/AOcewpPxxPBhjPKRwxGeX3S50ksiA + ayFomUeslR0S0Z7RN9rzJa+CFyi9MwWIHMbLgXpB8tsSpgTAqwrzoTzOGq9fgC6u + pZhdZrBkg3FeJgD88goCi9mZDsY2YAoeGRLFJ2fR8iICqIVQy+Htq9pE22WBLpnS + KjL3+mR9FArHNFtWlhKF2YHMUqyHHrnZnF/Ns7QNoMMF7/CK18iAKgnb+2wuGKM + aEMddOeOTtz+i/rgjkp/RGMt011EdCsso0/cTo9qqX/bxOOCE4/Mne/ChMkQPnNU + CwIDAQABo3IwcDAJBgNVHRMEAjAAMB8GA1UdIwQYMBaAFIG+4l5yiB01gP0sw4ML + USopqYcuMB0GA1UdDgQWBBSby1T9leYVOVVdOZXiHCSaDDEMiDAOBgNVHQ8BAf8E + BAMCBaAwEwYDVR0lBAwwCgYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAEyE + 1mjSUyY6uNp6W4l20w7SskALSJDRKkOeZxAgF3VMxlsCuEl70s9oEfntwIpyQtSa + jON/9yJHbwm/Az824bmk8Dc7AXIPhay+dftXb8j529gPuYB9AKoPNg0NctkyYCQh + a/3YQVdDWX7XgmEiXkL57M7G6+IdcPDONLArfjOcT9qHdkVVq1AIjlMSx3OQQmm/ + uoLb/G9q/97QA2/l8shG/Na8HjVqGLcl5TNZdbNhs2w9ogxr/GNzqdvym6RQ8vT/ + UR2n+uwH4n1MUxmHYYeyot5dnIV1IJ6hQ54JAncM9HvCLFk1WHz6RKshQUCuPBiJ + wTw70BVktzJnb0VLeDg= + -----END CERTIFICATE-----' + host: 0.0.0.0 + port: 3000 + radsecEnabled: true + secret: secret-string + radiusAttributeForGroupPolicies: Filter-Id + radiusAuthenticationNasId: 00-11-22-33-44-55:AP1 + radiusCalledStationId: 00-11-22-33-44-55:AP1 + radiusCoaEnabled: true + radiusFailoverPolicy: Deny access + radiusFallbackEnabled: true + radiusGuestVlanEnabled: true + radiusGuestVlanId: 1 + radiusLoadBalancingPolicy: Round robin + radiusOverride: false + radiusProxyEnabled: false + radiusServerAttemptsLimit: 5 + radiusServerTimeout: 5 + radiusServers: + - caCertificate: '-----BEGIN CERTIFICATE----- + MIIEKjCCAxKgAwIBAgIRANb+lsED3eb4+6YKLFFYqEkwDQYJKoZIhvcNAQELBQAw + gYcxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlhMREwDwYDVQQHDAhT + YW4gSm9zZTEcMBoGA1UECgwTQ2lzY28gU3lzdGVtcywgSW5jLjESMBAGA1UECwwJ + RE5BU3BhY2VzMR4wHAYDVQQDDBVjaXNjby5vcGVucm9hbWluZy5vcmcwHhcNMjAx + MTA1MjEzMzM1WhcNMjExMTA1MjIzMzM1WjCBpDEcMBoGCgmSJomT8ixkAQETDGRu + YXNwYWNlczpVUzELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMQ4wDAYDVQQKEwVD + aXNjbzEcMBoGA1UECxMTV0JBOldSSVggRW5kLUVudGl0eTE8MDoGA1UEAxMzNjQ3 + MDcwNDM4NDQ5NjQxMjAwMDAuMTg4MzQuaHMuY2lzY28ub3BlbnJvYW1pbmcub3Jn + MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAoqjP9QgRGyUO3p7SH9QK + uTq6UYK7nAyjImgS4yQxeBkyZ5f2EUkX8m/AOcewpPxxPBhjPKRwxGeX3S50ksiA + ayFomUeslR0S0Z7RN9rzJa+CFyi9MwWIHMbLgXpB8tsSpgTAqwrzoTzOGq9fgC6u + pZhdZrBkg3FeJgD88goCi9mZDsY2YAoeGRLFJ2fR8iICqIVQy+Htq9pE22WBLpnS + KjL3+mR9FArHNFtWlhKF2YHMUqyHHrnZnF/Ns7QNoMMF7/CK18iAKgnb+2wuGKM + aEMddOeOTtz+i/rgjkp/RGMt011EdCsso0/cTo9qqX/bxOOCE4/Mne/ChMkQPnNU + CwIDAQABo3IwcDAJBgNVHRMEAjAAMB8GA1UdIwQYMBaAFIG+4l5yiB01gP0sw4ML + USopqYcuMB0GA1UdDgQWBBSby1T9leYVOVVdOZXiHCSaDDEMiDAOBgNVHQ8BAf8E + BAMCBaAwEwYDVR0lBAwwCgYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAEyE + 1mjSUyY6uNp6W4l20w7SskALSJDRKkOeZxAgF3VMxlsCuEl70s9oEfntwIpyQtSa + jON/9yJHbwm/Az824bmk8Dc7AXIPhay+dftXb8j529gPuYB9AKoPNg0NctkyYCQh + a/3YQVdDWX7XgmEiXkL57M7G6+IdcPDONLArfjOcT9qHdkVVq1AIjlMSx3OQQmm/ + uoLb/G9q/97QA2/l8shG/Na8HjVqGLcl5TNZdbNhs2w9ogxr/GNzqdvym6RQ8vT/ + UR2n+uwH4n1MUxmHYYeyot5dnIV1IJ6hQ54JAncM9HvCLFk1WHz6RKshQUCuPBiJ + wTw70BVktzJnb0VLeDg= + -----END CERTIFICATE-----' + host: 0.0.0.0 + openRoamingCertificateId: 2 + port: 3000 + radsecEnabled: true + secret: secret-string + radiusTestingEnabled: true + secondaryConcentratorNetworkId: disabled + speedBurst: + enabled: true + splashGuestSponsorDomains: + - example.com + splashPage: Click-through splash page + useVlanTagging: false + visible: true + vlanId: 10 + walledGardenEnabled: true + walledGardenRanges: + - example.com + - 1.1.1.1/32 + wpaEncryptionMode: WPA2 only """ RETURN = r""" @@ -509,5 +783,55 @@ meraki_response: returned: always type: dict sample: > - {} + { + "adminSplashUrl": "string", + "authMode": "string", + "availabilityTags": [ + "string" + ], + "availableOnAllAps": true, + "bandSelection": "string", + "enabled": true, + "encryptionMode": "string", + "ipAssignmentMode": "string", + "localAuth": true, + "mandatoryDhcpEnabled": true, + "minBitrate": 0, + "name": "string", + "number": 0, + "perClientBandwidthLimitDown": 0, + "perClientBandwidthLimitUp": 0, + "perSsidBandwidthLimitDown": 0, + "perSsidBandwidthLimitUp": 0, + "radiusAccountingEnabled": true, + "radiusAccountingServers": [ + { + "caCertificate": "string", + "host": "string", + "openRoamingCertificateId": 0, + "port": 0 + } + ], + "radiusAttributeForGroupPolicies": "string", + "radiusEnabled": true, + "radiusFailoverPolicy": "string", + "radiusLoadBalancingPolicy": "string", + "radiusServers": [ + { + "caCertificate": "string", + "host": "string", + "openRoamingCertificateId": 0, + "port": 0 + } + ], + "splashPage": "string", + "splashTimeout": "string", + "ssidAdminAccessible": true, + "visible": true, + "walledGardenEnabled": true, + "walledGardenRanges": [ + "string" + ], + "wpaEncryptionMode": "string" + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_bonjour_forwarding.py b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_bonjour_forwarding.py index 6ceb22c1c..cd44977c8 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_bonjour_forwarding.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_bonjour_forwarding.py @@ -19,6 +19,15 @@ options: enabled: description: If true, Bonjour forwarding is enabled on this SSID. type: bool + exception: + description: Bonjour forwarding exception. + suboptions: + enabled: + description: If true, Bonjour forwarding exception is enabled on this SSID. + Exception is required to enable L2 isolation and Bonjour forwarding to work + together. + type: bool + type: dict networkId: description: NetworkId path parameter. Network ID. type: str @@ -82,6 +91,8 @@ EXAMPLES = r""" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" state: present enabled: true + exception: + enabled: true networkId: string number: string rules: @@ -97,5 +108,19 @@ meraki_response: returned: always type: dict sample: > - {} + { + "enabled": true, + "exception": { + "enabled": true + }, + "rules": [ + { + "description": "string", + "services": [ + "string" + ], + "vlanId": "string" + } + ] + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_bonjour_forwarding_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_bonjour_forwarding_info.py index 6ca1b1a89..2d438a635 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_bonjour_forwarding_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_bonjour_forwarding_info.py @@ -75,6 +75,20 @@ meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always type: dict - sample: - - {} + sample: > + { + "enabled": true, + "exception": { + "enabled": true + }, + "rules": [ + { + "description": "string", + "services": [ + "string" + ], + "vlanId": "string" + } + ] + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_device_type_group_policies_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_device_type_group_policies_info.py index 1e340bb06..3a8c62ea3 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_device_type_group_policies_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_device_type_group_policies_info.py @@ -75,6 +75,14 @@ meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always type: dict - sample: - - {} + sample: > + { + "deviceTypePolicies": [ + { + "devicePolicy": "string", + "deviceType": "string" + } + ], + "enabled": true + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_eap_override.py b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_eap_override.py index f669a8cf0..4f4291051 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_eap_override.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_eap_override.py @@ -106,15 +106,15 @@ meraki_response: type: dict sample: > { - "timeout": 0, - "maxRetries": 0, + "eapolKey": { + "retries": 0, + "timeoutInMs": 0 + }, "identity": { "retries": 0, "timeout": 0 }, - "eapolKey": { - "retries": 0, - "timeoutInMs": 0 - } + "maxRetries": 0, + "timeout": 0 } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_eap_override_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_eap_override_info.py index 91c3de4fc..ad6f293a6 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_eap_override_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_eap_override_info.py @@ -77,15 +77,15 @@ meraki_response: type: dict sample: > { - "timeout": 0, - "maxRetries": 0, + "eapolKey": { + "retries": 0, + "timeoutInMs": 0 + }, "identity": { "retries": 0, "timeout": 0 }, - "eapolKey": { - "retries": 0, - "timeoutInMs": 0 - } + "maxRetries": 0, + "timeout": 0 } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_firewall_l3_firewall_rules.py b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_firewall_l3_firewall_rules.py index 4c8df7919..433c2347a 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_firewall_l3_firewall_rules.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_firewall_l3_firewall_rules.py @@ -89,6 +89,7 @@ EXAMPLES = r""" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" state: present + allowLanAccess: true networkId: string number: string rules: @@ -105,5 +106,13 @@ meraki_response: returned: always type: dict sample: > - {} + [ + { + "comment": "string", + "destCidr": "string", + "destPort": "string", + "policy": "string", + "protocol": "string" + } + ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_firewall_l3_firewall_rules_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_firewall_l3_firewall_rules_info.py index a0980ff8a..568e8eb11 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_firewall_l3_firewall_rules_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_firewall_l3_firewall_rules_info.py @@ -74,7 +74,16 @@ RETURN = r""" meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always - type: dict - sample: - - {} + type: list + elements: dict + sample: > + [ + { + "comment": "string", + "destCidr": "string", + "destPort": "string", + "policy": "string", + "protocol": "string" + } + ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_firewall_l7_firewall_rules.py b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_firewall_l7_firewall_rules.py index c31b070d6..ce95401b6 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_firewall_l7_firewall_rules.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_firewall_l7_firewall_rules.py @@ -85,15 +85,6 @@ EXAMPLES = r""" - policy: deny type: host value: google.com - - policy: deny - type: port - value: '23' - - policy: deny - type: ipRange - value: 10.11.12.00/24 - - policy: deny - type: ipRange - value: 10.11.12.00/24:5555 """ RETURN = r""" @@ -102,5 +93,11 @@ meraki_response: returned: always type: dict sample: > - {} + [ + { + "policy": "string", + "type": "string", + "value": "string" + } + ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_firewall_l7_firewall_rules_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_firewall_l7_firewall_rules_info.py index b70038bc4..01e84baa5 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_firewall_l7_firewall_rules_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_firewall_l7_firewall_rules_info.py @@ -74,7 +74,14 @@ RETURN = r""" meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always - type: dict - sample: - - {} + type: list + elements: dict + sample: > + [ + { + "policy": "string", + "type": "string", + "value": "string" + } + ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_hotspot20_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_hotspot20_info.py index fa08c602e..1586e3580 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_hotspot20_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_hotspot20_info.py @@ -75,6 +75,53 @@ meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always type: dict - sample: - - {} + sample: > + { + "domains": [ + "string" + ], + "enabled": true, + "mccMncs": [ + { + "mcc": "string", + "mnc": "string" + } + ], + "naiRealms": [ + { + "format": "string", + "methods": [ + { + "authenticationTypes": { + "credentials": [ + "string" + ], + "eapInnerAuthentication": [ + "string" + ], + "nonEapInnerAuthentication": [ + "string" + ], + "tunneledEapMethodCredentials": [ + "string" + ] + }, + "id": "string" + } + ], + "name": "string" + } + ], + "networkAccessType": "string", + "operator": { + "name": "string" + }, + "roamConsortOis": [ + "string" + ], + "venue": { + "name": "string", + "type": "string" + } + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_identity_psks.py b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_identity_psks.py index 6418280d4..1bb2fd16d 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_identity_psks.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_identity_psks.py @@ -92,13 +92,12 @@ EXAMPLES = r""" state: present expiresAt: '2018-02-11T00:00:00.090210Z' groupPolicyId: '101' - id: '1284392014819' name: Sample Identity PSK networkId: string number: string passphrase: secret -- name: Update by id +- name: Delete by id cisco.meraki.networks_wireless_ssids_identity_psks: meraki_api_key: "{{meraki_api_key}}" meraki_base_url: "{{meraki_base_url}}" @@ -120,17 +119,12 @@ EXAMPLES = r""" meraki_be_geo_id: "{{meraki_be_geo_id}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: present - expiresAt: '2018-02-11T00:00:00.090210Z' - groupPolicyId: '101' - id: '1284392014819' + state: absent identityPskId: string - name: Sample Identity PSK networkId: string number: string - passphrase: secret -- name: Delete by id +- name: Update by id cisco.meraki.networks_wireless_ssids_identity_psks: meraki_api_key: "{{meraki_api_key}}" meraki_base_url: "{{meraki_base_url}}" @@ -152,10 +146,14 @@ EXAMPLES = r""" meraki_be_geo_id: "{{meraki_be_geo_id}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: absent + state: present + expiresAt: '2018-02-11T00:00:00.090210Z' + groupPolicyId: '101' identityPskId: string + name: Sample Identity PSK networkId: string number: string + passphrase: secret """ RETURN = r""" @@ -164,5 +162,13 @@ meraki_response: returned: always type: dict sample: > - {} + { + "email": "string", + "expiresAt": "string", + "groupPolicyId": "string", + "id": "string", + "name": "string", + "passphrase": "string", + "wifiPersonalNetworkId": "string" + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_identity_psks_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_identity_psks_info.py index 091eed857..0ddb95c88 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_identity_psks_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_identity_psks_info.py @@ -115,12 +115,12 @@ meraki_response: type: dict sample: > { - "name": "string", - "id": "string", + "email": "string", + "expiresAt": "string", "groupPolicyId": "string", + "id": "string", + "name": "string", "passphrase": "string", - "wifiPersonalNetworkId": "string", - "email": "string", - "expiresAt": "string" + "wifiPersonalNetworkId": "string" } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_info.py index 4b67150ae..9f3fa4dbf 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_info.py @@ -106,10 +106,57 @@ RETURN = r""" meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always - type: list - elements: dict + type: dict sample: > - [ - {} - ] + { + "adminSplashUrl": "string", + "authMode": "string", + "availabilityTags": [ + "string" + ], + "availableOnAllAps": true, + "bandSelection": "string", + "enabled": true, + "encryptionMode": "string", + "ipAssignmentMode": "string", + "localAuth": true, + "mandatoryDhcpEnabled": true, + "minBitrate": 0, + "name": "string", + "number": 0, + "perClientBandwidthLimitDown": 0, + "perClientBandwidthLimitUp": 0, + "perSsidBandwidthLimitDown": 0, + "perSsidBandwidthLimitUp": 0, + "radiusAccountingEnabled": true, + "radiusAccountingServers": [ + { + "caCertificate": "string", + "host": "string", + "openRoamingCertificateId": 0, + "port": 0 + } + ], + "radiusAttributeForGroupPolicies": "string", + "radiusEnabled": true, + "radiusFailoverPolicy": "string", + "radiusLoadBalancingPolicy": "string", + "radiusServers": [ + { + "caCertificate": "string", + "host": "string", + "openRoamingCertificateId": 0, + "port": 0 + } + ], + "splashPage": "string", + "splashTimeout": "string", + "ssidAdminAccessible": true, + "visible": true, + "walledGardenEnabled": true, + "walledGardenRanges": [ + "string" + ], + "wpaEncryptionMode": "string" + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_schedules_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_schedules_info.py index f77aba8b9..d6cc8e334 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_schedules_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_schedules_info.py @@ -75,6 +75,16 @@ meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always type: dict - sample: - - {} + sample: > + { + "enabled": true, + "ranges": [ + { + "endDay": "string", + "endTime": "string", + "startDay": "string", + "startTime": "string" + } + ] + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_splash_settings.py b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_splash_settings.py index c238ed192..0f3807fb1 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_splash_settings.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_splash_settings.py @@ -164,6 +164,9 @@ options: that the URL can be configured without necessarily being used. In order to enable the custom URL, see 'useSplashUrl'. type: str + themeId: + description: The id of the selected splash theme. + type: str useRedirectUrl: description: The Boolean indicating whether the the user will be redirected to the custom redirect URL after the splash page. A custom redirect URL must be set if @@ -258,6 +261,7 @@ EXAMPLES = r""" md5: 542cccac8d7dedee0f185311d154d194 splashTimeout: 1440 splashUrl: https://www.custom_splash_url.com + themeId: c3ddcb4f16785ee747ab5ffc10867d6c8ea704be useRedirectUrl: true useSplashUrl: true welcomeMessage: Welcome! @@ -270,53 +274,54 @@ meraki_response: type: dict sample: > { - "ssidNumber": 0, - "splashPage": "string", - "useSplashUrl": true, - "splashUrl": "string", - "splashTimeout": 0, - "redirectUrl": "string", - "useRedirectUrl": true, - "welcomeMessage": "string", - "splashLogo": { - "md5": "string", - "extension": "string" - }, - "splashImage": { - "md5": "string", - "extension": "string" - }, - "splashPrepaidFront": { - "md5": "string", - "extension": "string" - }, - "guestSponsorship": { - "durationInMinutes": 0, - "guestCanRequestTimeframe": true - }, - "blockAllTrafficBeforeSignOn": true, - "controllerDisconnectionBehavior": "string", "allowSimultaneousLogins": true, "billing": { "freeAccess": { - "enabled": true, - "durationInMinutes": 0 + "durationInMinutes": 0, + "enabled": true }, "prepaidAccessFastLoginEnabled": true, "replyToEmailAddress": "string" }, + "blockAllTrafficBeforeSignOn": true, + "controllerDisconnectionBehavior": "string", + "guestSponsorship": { + "durationInMinutes": 0, + "guestCanRequestTimeframe": true + }, + "redirectUrl": "string", + "selfRegistration": { + "authorizationType": "string", + "enabled": true + }, "sentryEnrollment": { - "systemsManagerNetwork": { - "id": "string" - }, - "strength": "string", "enforcedSystems": [ "string" - ] + ], + "strength": "string", + "systemsManagerNetwork": { + "id": "string" + } }, - "selfRegistration": { - "enabled": true, - "authorizationType": "string" - } + "splashImage": { + "extension": "string", + "md5": "string" + }, + "splashLogo": { + "extension": "string", + "md5": "string" + }, + "splashPage": "string", + "splashPrepaidFront": { + "extension": "string", + "md5": "string" + }, + "splashTimeout": 0, + "splashUrl": "string", + "ssidNumber": 0, + "themeId": "string", + "useRedirectUrl": true, + "useSplashUrl": true, + "welcomeMessage": "string" } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_splash_settings_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_splash_settings_info.py index f5950e0ac..6a3f33d02 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_splash_settings_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_splash_settings_info.py @@ -77,53 +77,54 @@ meraki_response: type: dict sample: > { - "ssidNumber": 0, - "splashPage": "string", - "useSplashUrl": true, - "splashUrl": "string", - "splashTimeout": 0, - "redirectUrl": "string", - "useRedirectUrl": true, - "welcomeMessage": "string", - "splashLogo": { - "md5": "string", - "extension": "string" - }, - "splashImage": { - "md5": "string", - "extension": "string" - }, - "splashPrepaidFront": { - "md5": "string", - "extension": "string" - }, - "guestSponsorship": { - "durationInMinutes": 0, - "guestCanRequestTimeframe": true - }, - "blockAllTrafficBeforeSignOn": true, - "controllerDisconnectionBehavior": "string", "allowSimultaneousLogins": true, "billing": { "freeAccess": { - "enabled": true, - "durationInMinutes": 0 + "durationInMinutes": 0, + "enabled": true }, "prepaidAccessFastLoginEnabled": true, "replyToEmailAddress": "string" }, + "blockAllTrafficBeforeSignOn": true, + "controllerDisconnectionBehavior": "string", + "guestSponsorship": { + "durationInMinutes": 0, + "guestCanRequestTimeframe": true + }, + "redirectUrl": "string", + "selfRegistration": { + "authorizationType": "string", + "enabled": true + }, "sentryEnrollment": { - "systemsManagerNetwork": { - "id": "string" - }, - "strength": "string", "enforcedSystems": [ "string" - ] + ], + "strength": "string", + "systemsManagerNetwork": { + "id": "string" + } }, - "selfRegistration": { - "enabled": true, - "authorizationType": "string" - } + "splashImage": { + "extension": "string", + "md5": "string" + }, + "splashLogo": { + "extension": "string", + "md5": "string" + }, + "splashPage": "string", + "splashPrepaidFront": { + "extension": "string", + "md5": "string" + }, + "splashTimeout": 0, + "splashUrl": "string", + "ssidNumber": 0, + "themeId": "string", + "useRedirectUrl": true, + "useSplashUrl": true, + "welcomeMessage": "string" } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_traffic_shaping_rules.py b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_traffic_shaping_rules.py index ec03f02c9..0258c1f8e 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_traffic_shaping_rules.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_traffic_shaping_rules.py @@ -10,7 +10,7 @@ module: networks_wireless_ssids_traffic_shaping_rules short_description: Resource module for networks _wireless _ssids _trafficshaping _rules description: - Manage operation update of the resource networks _wireless _ssids _trafficshaping _rules. -- Update the traffic shaping settings for an SSID on an MR network. +- Update the traffic shaping rules for an SSID on an MR network. version_added: '2.16.0' extends_documentation_fragment: - cisco.meraki.module @@ -132,16 +132,6 @@ EXAMPLES = r""" - definitions: - type: host value: google.com - - type: port - value: '9090' - - type: ipRange - value: 192.1.0.0 - - type: ipRange - value: 192.1.0.0/16 - - type: ipRange - value: 10.1.0.0/16:80 - - type: localNet - value: 192.168.0.0/16 dscpTagValue: 0 pcpTagValue: 0 perClientBandwidthLimits: @@ -158,5 +148,27 @@ meraki_response: returned: always type: dict sample: > - {} + { + "defaultRulesEnabled": true, + "rules": [ + { + "definitions": [ + { + "type": "string", + "value": "string" + } + ], + "dscpTagValue": 0, + "pcpTagValue": 0, + "perClientBandwidthLimits": { + "bandwidthLimits": { + "limitDown": 0, + "limitUp": 0 + }, + "settings": "string" + } + } + ], + "trafficShapingEnabled": true + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_traffic_shaping_rules_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_traffic_shaping_rules_info.py index d83212867..1e4a8ba59 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_traffic_shaping_rules_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_traffic_shaping_rules_info.py @@ -75,6 +75,28 @@ meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always type: dict - sample: - - {} + sample: > + { + "defaultRulesEnabled": true, + "rules": [ + { + "definitions": [ + { + "type": "string", + "value": "string" + } + ], + "dscpTagValue": 0, + "pcpTagValue": 0, + "perClientBandwidthLimits": { + "bandwidthLimits": { + "limitDown": 0, + "limitUp": 0 + }, + "settings": "string" + } + } + ], + "trafficShapingEnabled": true + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_vpn_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_vpn_info.py index fd9ec3bee..3b19e185a 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_vpn_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_ssids_vpn_info.py @@ -75,6 +75,29 @@ meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always type: dict - sample: - - {} + sample: > + { + "concentrator": { + "name": "string", + "networkId": "string", + "vlanId": 0 + }, + "failover": { + "heartbeatInterval": 0, + "idleTimeout": 0, + "requestIp": "string" + }, + "splitTunnel": { + "enabled": true, + "rules": [ + { + "comment": "string", + "destCidr": "string", + "destPort": "string", + "policy": "string", + "protocol": "string" + } + ] + } + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_usage_history_info.py b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_usage_history_info.py index 9166b505a..74a7bf9f4 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_usage_history_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/networks_wireless_usage_history_info.py @@ -133,11 +133,11 @@ meraki_response: sample: > [ { - "startTs": "string", "endTs": "string", - "totalKbps": 0, + "receivedKbps": 0, "sentKbps": 0, - "receivedKbps": 0 + "startTs": "string", + "totalKbps": 0 } ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations.py b/ansible_collections/cisco/meraki/plugins/modules/organizations.py index 9f9e15b11..843c816ef 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations.py @@ -101,7 +101,7 @@ EXAMPLES = r""" value: '123456' name: My organization -- name: Update by id +- name: Delete by id cisco.meraki.organizations: meraki_api_key: "{{meraki_api_key}}" meraki_base_url: "{{meraki_base_url}}" @@ -123,17 +123,10 @@ EXAMPLES = r""" meraki_be_geo_id: "{{meraki_be_geo_id}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: present - api: - enabled: true - management: - details: - - name: MSP ID - value: '123456' - name: My organization + state: absent organizationId: string -- name: Delete by id +- name: Update by id cisco.meraki.organizations: meraki_api_key: "{{meraki_api_key}}" meraki_base_url: "{{meraki_base_url}}" @@ -155,7 +148,14 @@ EXAMPLES = r""" meraki_be_geo_id: "{{meraki_be_geo_id}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: absent + state: present + api: + enabled: true + management: + details: + - name: MSP ID + value: '123456' + name: My organization organizationId: string """ @@ -166,20 +166,18 @@ meraki_response: type: dict sample: > { - "id": "string", - "name": "string", - "url": "string", "api": { "enabled": true }, - "licensing": { - "model": "string" - }, "cloud": { "region": { "name": "string" } }, + "id": "string", + "licensing": { + "model": "string" + }, "management": { "details": [ { @@ -187,6 +185,8 @@ meraki_response: "value": "string" } ] - } + }, + "name": "string", + "url": "string" } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_action_batches.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_action_batches.py index 3671ddcb6..32b75500e 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_action_batches.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_action_batches.py @@ -36,6 +36,36 @@ options: description: Unique identifier for the resource to be acted on. type: str type: list + callback: + description: Details for the callback. Please include either an httpServerId OR + url and sharedSecret. + suboptions: + httpServer: + description: The webhook receiver used for the callback webhook. + suboptions: + id: + description: The webhook receiver ID that will receive information. If specifying + this, please leave the url and sharedSecret fields blank. + type: str + type: dict + payloadTemplate: + description: The payload template of the webhook used for the callback. + suboptions: + id: + description: The ID of the payload template. Defaults to 'wpt_00005' for + the Callback (included) template. + type: str + type: dict + sharedSecret: + description: A shared secret that will be included in the requests sent to the + callback URL. It can be used to verify that the request was sent by Meraki. + If using this field, please also specify an url. + type: str + url: + description: The callback URL for the webhook target. If using this field, please + also specify a sharedSecret. + type: str + type: dict confirmed: description: Set to true for immediate execution. Set to false if the action should be previewed before executing. This property cannot be unset once it is true. @@ -100,11 +130,18 @@ EXAMPLES = r""" actions: - operation: create resource: /devices/QXXX-XXXX-XXXX/switch/ports/3 + callback: + httpServer: + id: aHR0cHM6Ly93d3cuZXhhbXBsZS5jb20vd2ViaG9va3M= + payloadTemplate: + id: wpt_2100 + sharedSecret: secret + url: https://webhook.site/28efa24e-f830-4d9f-a12b-fbb9e5035031 confirmed: true organizationId: string synchronous: true -- name: Update by id +- name: Delete by id cisco.meraki.organizations_action_batches: meraki_api_key: "{{meraki_api_key}}" meraki_base_url: "{{meraki_base_url}}" @@ -126,13 +163,11 @@ EXAMPLES = r""" meraki_be_geo_id: "{{meraki_be_geo_id}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: present + state: absent actionBatchId: string - confirmed: true organizationId: string - synchronous: false -- name: Delete by id +- name: Update by id cisco.meraki.organizations_action_batches: meraki_api_key: "{{meraki_api_key}}" meraki_base_url: "{{meraki_base_url}}" @@ -154,9 +189,11 @@ EXAMPLES = r""" meraki_be_geo_id: "{{meraki_be_geo_id}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: absent + state: present actionBatchId: string + confirmed: true organizationId: string + synchronous: false """ RETURN = r""" @@ -166,28 +203,34 @@ meraki_response: type: dict sample: > { + "actions": [ + { + "body": {}, + "operation": "string", + "resource": "string" + } + ], + "callback": { + "id": "string", + "status": "string", + "url": "string" + }, + "confirmed": true, "id": "string", "organizationId": "string", - "confirmed": true, - "synchronous": true, "status": { "completed": true, - "failed": true, - "errors": [ - "string" - ], "createdResources": [ { "id": "string", "uri": "string" } - ] + ], + "errors": [ + "string" + ], + "failed": true }, - "actions": [ - { - "resource": "string", - "operation": "string" - } - ] + "synchronous": true } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_action_batches_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_action_batches_info.py index 11bdde6ad..acf6d6e25 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_action_batches_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_action_batches_info.py @@ -114,28 +114,34 @@ meraki_response: type: dict sample: > { + "actions": [ + { + "body": {}, + "operation": "string", + "resource": "string" + } + ], + "callback": { + "id": "string", + "status": "string", + "url": "string" + }, + "confirmed": true, "id": "string", "organizationId": "string", - "confirmed": true, - "synchronous": true, "status": { "completed": true, - "failed": true, - "errors": [ - "string" - ], "createdResources": [ { "id": "string", "uri": "string" } - ] + ], + "errors": [ + "string" + ], + "failed": true }, - "actions": [ - { - "resource": "string", - "operation": "string" - } - ] + "synchronous": true } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_adaptive_policy_acls.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_adaptive_policy_acls.py index 4be633cc5..b94f77261 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_adaptive_policy_acls.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_adaptive_policy_acls.py @@ -113,7 +113,7 @@ EXAMPLES = r""" protocol: tcp srcPort: 1,33 -- name: Update by id +- name: Delete by id cisco.meraki.organizations_adaptive_policy_acls: meraki_api_key: "{{meraki_api_key}}" meraki_base_url: "{{meraki_base_url}}" @@ -135,19 +135,11 @@ EXAMPLES = r""" meraki_be_geo_id: "{{meraki_be_geo_id}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: present + state: absent aclId: string - description: Blocks sensitive web traffic - ipVersion: ipv6 - name: Block sensitive web traffic organizationId: string - rules: - - dstPort: 22-30 - policy: deny - protocol: tcp - srcPort: 1,33 -- name: Delete by id +- name: Update by id cisco.meraki.organizations_adaptive_policy_acls: meraki_api_key: "{{meraki_api_key}}" meraki_base_url: "{{meraki_base_url}}" @@ -169,9 +161,17 @@ EXAMPLES = r""" meraki_be_geo_id: "{{meraki_be_geo_id}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: absent + state: present aclId: string + description: Blocks sensitive web traffic + ipVersion: ipv6 + name: Block sensitive web traffic organizationId: string + rules: + - dstPort: 22-30 + policy: deny + protocol: tcp + srcPort: 1,33 """ RETURN = r""" @@ -182,18 +182,18 @@ meraki_response: sample: > { "aclId": "string", - "name": "string", + "createdAt": "string", "description": "string", "ipVersion": "string", + "name": "string", "rules": [ { + "dstPort": "string", "policy": "string", "protocol": "string", - "srcPort": "string", - "dstPort": "string" + "srcPort": "string" } ], - "createdAt": "string", "updatedAt": "string" } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_adaptive_policy_acls_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_adaptive_policy_acls_info.py index 088e6e37a..8fa5bc8ea 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_adaptive_policy_acls_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_adaptive_policy_acls_info.py @@ -110,18 +110,18 @@ meraki_response: sample: > { "aclId": "string", - "name": "string", + "createdAt": "string", "description": "string", "ipVersion": "string", + "name": "string", "rules": [ { + "dstPort": "string", "policy": "string", "protocol": "string", - "srcPort": "string", - "dstPort": "string" + "srcPort": "string" } ], - "createdAt": "string", "updatedAt": "string" } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_adaptive_policy_groups.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_adaptive_policy_groups.py index 63238c804..689bcc610 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_adaptive_policy_groups.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_adaptive_policy_groups.py @@ -33,8 +33,7 @@ options: policyObjects: description: The policy objects that belong to this group; traffic from addresses specified by these policy objects will be tagged with this group's SGT value if - no other tagging scheme is being used (each requires one unique attribute) (default - ). + no other tagging scheme is being used (each requires one unique attribute) (). elements: dict suboptions: id: @@ -106,7 +105,7 @@ EXAMPLES = r""" requiredIpMappings: [] sgt: 1000 -- name: Update by id +- name: Delete by id cisco.meraki.organizations_adaptive_policy_groups: meraki_api_key: "{{meraki_api_key}}" meraki_base_url: "{{meraki_base_url}}" @@ -128,19 +127,11 @@ EXAMPLES = r""" meraki_be_geo_id: "{{meraki_be_geo_id}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: present - description: Group of XYZ Corp Employees + state: absent id: string - isDefaultGroup: false - name: Employee Group organizationId: string - policyObjects: - - id: '2345' - name: Example Policy Object - requiredIpMappings: [] - sgt: 1000 -- name: Delete by id +- name: Update by id cisco.meraki.organizations_adaptive_policy_groups: meraki_api_key: "{{meraki_api_key}}" meraki_base_url: "{{meraki_base_url}}" @@ -162,9 +153,17 @@ EXAMPLES = r""" meraki_be_geo_id: "{{meraki_be_geo_id}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: absent + state: present + description: Group of XYZ Corp Employees id: string + isDefaultGroup: false + name: Employee Group organizationId: string + policyObjects: + - id: '2345' + name: Example Policy Object + requiredIpMappings: [] + sgt: 1000 """ RETURN = r""" diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_adaptive_policy_groups_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_adaptive_policy_groups_info.py index 6dc20e932..44f4ddd5f 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_adaptive_policy_groups_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_adaptive_policy_groups_info.py @@ -106,10 +106,24 @@ RETURN = r""" meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always - type: list - elements: dict + type: dict sample: > - [ - {} - ] + { + "createdAt": "string", + "description": "string", + "groupId": "string", + "isDefaultGroup": true, + "name": "string", + "policyObjects": [ + { + "id": "string", + "name": "string" + } + ], + "requiredIpMappings": [ + "string" + ], + "sgt": 0, + "updatedAt": "string" + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_adaptive_policy_overview_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_adaptive_policy_overview_info.py index 4512b4b57..c991e72b2 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_adaptive_policy_overview_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_adaptive_policy_overview_info.py @@ -73,19 +73,19 @@ meraki_response: sample: > { "counts": { - "groups": 0, - "customGroups": 0, + "allowPolicies": 0, "customAcls": 0, - "policies": 0, + "customGroups": 0, "denyPolicies": 0, - "allowPolicies": 0, + "groups": 0, + "policies": 0, "policyObjects": 0 }, "limits": { - "customGroups": 0, - "rulesInAnAcl": 0, "aclsInAPolicy": 0, - "policyObjects": 0 + "customGroups": 0, + "policyObjects": 0, + "rulesInAnAcl": 0 } } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_adaptive_policy_policies.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_adaptive_policy_policies.py index 738c6998d..b468ac14e 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_adaptive_policy_policies.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_adaptive_policy_policies.py @@ -20,7 +20,7 @@ author: Francisco Munoz (@fmunoz) options: acls: description: An ordered array of adaptive policy ACLs (each requires one unique - attribute) that apply to this policy (default ). + attribute) that apply to this policy (). elements: dict suboptions: id: @@ -128,7 +128,7 @@ EXAMPLES = r""" name: IoT Devices sgt: 50 -- name: Update by id +- name: Delete by id cisco.meraki.organizations_adaptive_policy_policies: meraki_api_key: "{{meraki_api_key}}" meraki_base_url: "{{meraki_base_url}}" @@ -150,23 +150,11 @@ EXAMPLES = r""" meraki_be_geo_id: "{{meraki_be_geo_id}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: present - acls: - - id: '444' - name: Block web - destinationGroup: - id: '333' - name: IoT Servers - sgt: 51 + state: absent id: string - lastEntryRule: allow organizationId: string - sourceGroup: - id: '222' - name: IoT Devices - sgt: 50 -- name: Delete by id +- name: Update by id cisco.meraki.organizations_adaptive_policy_policies: meraki_api_key: "{{meraki_api_key}}" meraki_base_url: "{{meraki_base_url}}" @@ -188,9 +176,21 @@ EXAMPLES = r""" meraki_be_geo_id: "{{meraki_be_geo_id}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: absent + state: present + acls: + - id: '444' + name: Block web + destinationGroup: + id: '333' + name: IoT Servers + sgt: 51 id: string + lastEntryRule: allow organizationId: string + sourceGroup: + id: '222' + name: IoT Devices + sgt: 50 """ RETURN = r""" diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_adaptive_policy_policies_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_adaptive_policy_policies_info.py index 227305973..b13523b03 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_adaptive_policy_policies_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_adaptive_policy_policies_info.py @@ -106,10 +106,28 @@ RETURN = r""" meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always - type: list - elements: dict + type: dict sample: > - [ - {} - ] + { + "acls": [ + { + "id": "string", + "name": "string" + } + ], + "adaptivePolicyId": "string", + "createdAt": "string", + "destinationGroup": { + "id": "string", + "name": "string", + "sgt": 0 + }, + "lastEntryRule": "string", + "sourceGroup": { + "id": "string", + "name": "string", + "sgt": 0 + }, + "updatedAt": "string" + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_adaptive_policy_settings_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_adaptive_policy_settings_info.py index ab4a4d196..0a1408d88 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_adaptive_policy_settings_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_adaptive_policy_settings_info.py @@ -69,7 +69,10 @@ RETURN = r""" meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always - type: dict - sample: - - {} + type: list + elements: str + sample: > + [ + "string" + ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_admins.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_admins.py index bdee8ec50..edbc2c326 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_admins.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_admins.py @@ -126,7 +126,7 @@ EXAMPLES = r""" - access: read-only tag: west -- name: Update by id +- name: Delete by id cisco.meraki.organizations_admins: meraki_api_key: "{{meraki_api_key}}" meraki_base_url: "{{meraki_base_url}}" @@ -148,19 +148,11 @@ EXAMPLES = r""" meraki_be_geo_id: "{{meraki_be_geo_id}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: present + state: absent adminId: string - name: Miles Meraki - networks: - - access: full - id: N_24329156 - orgAccess: none organizationId: string - tags: - - access: read-only - tag: west -- name: Delete by id +- name: Update by id cisco.meraki.organizations_admins: meraki_api_key: "{{meraki_api_key}}" meraki_base_url: "{{meraki_base_url}}" @@ -182,9 +174,17 @@ EXAMPLES = r""" meraki_be_geo_id: "{{meraki_be_geo_id}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: absent + state: present adminId: string + name: Miles Meraki + networks: + - access: full + id: N_24329156 + orgAccess: none organizationId: string + tags: + - access: read-only + tag: west """ RETURN = r""" @@ -194,26 +194,26 @@ meraki_response: type: dict sample: > { - "id": "string", - "name": "string", - "email": "string", - "orgAccess": "string", "accountStatus": "string", - "twoFactorAuthEnabled": true, + "authenticationMethod": "string", + "email": "string", "hasApiKey": true, + "id": "string", "lastActive": "string", - "tags": [ + "name": "string", + "networks": [ { - "tag": "string", - "access": "string" + "access": "string", + "id": "string" } ], - "networks": [ + "orgAccess": "string", + "tags": [ { - "id": "string", - "access": "string" + "access": "string", + "tag": "string" } ], - "authenticationMethod": "string" + "twoFactorAuthEnabled": true } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_admins_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_admins_info.py index ae00991dc..0049ba6a4 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_admins_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_admins_info.py @@ -74,27 +74,27 @@ meraki_response: sample: > [ { - "id": "string", - "name": "string", - "email": "string", - "orgAccess": "string", "accountStatus": "string", - "twoFactorAuthEnabled": true, + "authenticationMethod": "string", + "email": "string", "hasApiKey": true, + "id": "string", "lastActive": "string", - "tags": [ + "name": "string", + "networks": [ { - "tag": "string", - "access": "string" + "access": "string", + "id": "string" } ], - "networks": [ + "orgAccess": "string", + "tags": [ { - "id": "string", - "access": "string" + "access": "string", + "tag": "string" } ], - "authenticationMethod": "string" + "twoFactorAuthEnabled": true } ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_alerts_profiles.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_alerts_profiles.py index 935aa39d9..e57f96bee 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_alerts_profiles.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_alerts_profiles.py @@ -31,7 +31,7 @@ options: type: int interface: description: The uplink observed for the alert. Interface must be one of the - following wan1, wan2, cellular. + following wan1, wan2, wan3, cellular. type: str jitter_ms: description: The threshold the metric must cross to be valid for alerting. Used @@ -138,9 +138,12 @@ EXAMPLES = r""" bit_rate_bps: 10000 duration: 60 interface: wan1 + jitter_ms: 100 + latency_ms: 100 + loss_ratio: 0.1 + mos: 3.5 window: 600 description: WAN 1 high utilization - enabled: true networkTags: - tag1 - tag2 @@ -152,7 +155,7 @@ EXAMPLES = r""" - aHR0cHM6Ly93d3cuZXhhbXBsZS5jb20vcGF0aA== type: wanUtilization -- name: Update by id +- name: Delete by id cisco.meraki.organizations_alerts_profiles: meraki_api_key: "{{meraki_api_key}}" meraki_base_url: "{{meraki_base_url}}" @@ -174,12 +177,11 @@ EXAMPLES = r""" meraki_be_geo_id: "{{meraki_be_geo_id}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: present + state: absent alertConfigId: string - enabled: true organizationId: string -- name: Delete by id +- name: Update by id cisco.meraki.organizations_alerts_profiles: meraki_api_key: "{{meraki_api_key}}" meraki_base_url: "{{meraki_base_url}}" @@ -201,9 +203,29 @@ EXAMPLES = r""" meraki_be_geo_id: "{{meraki_be_geo_id}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: absent + state: present + alertCondition: + bit_rate_bps: 10000 + duration: 60 + interface: wan1 + jitter_ms: 100 + latency_ms: 100 + loss_ratio: 0.1 + mos: 3.5 + window: 600 alertConfigId: string + description: WAN 1 high utilization + enabled: true + networkTags: + - tag1 + - tag2 organizationId: string + recipients: + emails: + - admin@example.org + httpServerIds: + - aHR0cHM6Ly93d3cuZXhhbXBsZS5jb20vcGF0aA== + type: wanUtilization """ RETURN = r""" @@ -212,5 +234,27 @@ meraki_response: returned: always type: dict sample: > - {} + { + "alertCondition": { + "bit_rate_bps": 0, + "duration": 0, + "interface": "string", + "window": 0 + }, + "description": "string", + "enabled": true, + "id": "string", + "networkTags": [ + "string" + ], + "recipients": { + "emails": [ + "string" + ], + "httpServerIds": [ + "string" + ] + }, + "type": "string" + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_api_requests_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_api_requests_info.py index e12499b04..095f83e88 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_api_requests_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_api_requests_info.py @@ -160,16 +160,16 @@ meraki_response: [ { "adminId": "string", - "method": "string", "host": "string", + "method": "string", + "operationId": "string", "path": "string", "queryString": "string", - "userAgent": "string", - "ts": "string", "responseCode": 0, "sourceIp": "string", - "version": 0, - "operationId": "string" + "ts": "string", + "userAgent": "string", + "version": 0 } ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_api_requests_overview_response_codes_by_interval_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_api_requests_overview_response_codes_by_interval_info.py index 4a591fe1b..f4e488a49 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_api_requests_overview_response_codes_by_interval_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_api_requests_overview_response_codes_by_interval_info.py @@ -129,14 +129,14 @@ meraki_response: sample: > [ { - "startTs": "string", - "endTs": "string", "counts": [ { "code": 0, "count": 0 } - ] + ], + "endTs": "string", + "startTs": "string" } ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_appliance_security_intrusion_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_appliance_security_intrusion_info.py index 6218bc347..369f406ab 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_appliance_security_intrusion_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_appliance_security_intrusion_info.py @@ -69,7 +69,13 @@ RETURN = r""" meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always - type: dict - sample: - - {} + type: list + elements: dict + sample: > + [ + { + "message": "string", + "ruleId": "string" + } + ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_appliance_traffic_shaping_vpn_exclusions_by_network_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_appliance_traffic_shaping_vpn_exclusions_by_network_info.py new file mode 100644 index 000000000..1230c35b6 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_appliance_traffic_shaping_vpn_exclusions_by_network_info.py @@ -0,0 +1,124 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: organizations_appliance_traffic_shaping_vpn_exclusions_by_network_info +short_description: Information module for organizations _appliance _trafficshaping _vpnexclusions _bynetwork +description: +- Get all organizations _appliance _trafficshaping _vpnexclusions _bynetwork. +- Display VPN exclusion rules for MX networks. +version_added: '2.18.0' +extends_documentation_fragment: + - cisco.meraki.module_info + - cisco.meraki.module_info_pagination +author: Francisco Munoz (@fmunoz) +options: + headers: + description: Additional headers. + type: dict + organizationId: + description: + - OrganizationId path parameter. Organization ID. + type: str + perPage: + description: + - PerPage query parameter. The number of entries per page returned. Acceptable range is 3 - 1000. Default is 50. + type: int + startingAfter: + description: + - > + StartingAfter query parameter. A token used by the server to indicate the start of the page. Often this is a + timestamp or an ID but it is not limited to those. This parameter should not be defined by client + applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + type: str + endingBefore: + description: + - > + EndingBefore query parameter. A token used by the server to indicate the end of the page. Often this is a + timestamp or an ID but it is not limited to those. This parameter should not be defined by client + applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + type: str + networkIds: + description: + - NetworkIds query parameter. Optional parameter to filter the results by network IDs. + elements: str + type: list +requirements: +- meraki >= 2.4.9 +- python >= 3.5 +seealso: +- name: Cisco Meraki documentation for appliance getOrganizationApplianceTrafficShapingVpnExclusionsByNetwork + description: Complete reference of the getOrganizationApplianceTrafficShapingVpnExclusionsByNetwork API. + link: https://developer.cisco.com/meraki/api-v1/#!get-organization-appliance-traffic-shaping-vpn-exclusions-by-network +notes: + - SDK Method used are + appliance.Appliance.get_organization_appliance_traffic_shaping_vpn_exclusions_by_network, + + - Paths used are + get /organizations/{organizationId}/appliance/trafficShaping/vpnExclusions/byNetwork, +""" + +EXAMPLES = r""" +- name: Get all organizations _appliance _trafficshaping _vpnexclusions _bynetwork + cisco.meraki.organizations_appliance_traffic_shaping_vpn_exclusions_by_network_info: + meraki_api_key: "{{meraki_api_key}}" + meraki_base_url: "{{meraki_base_url}}" + meraki_single_request_timeout: "{{meraki_single_request_timeout}}" + meraki_certificate_path: "{{meraki_certificate_path}}" + meraki_requests_proxy: "{{meraki_requests_proxy}}" + meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" + meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" + meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" + meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" + meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" + meraki_maximum_retries: "{{meraki_maximum_retries}}" + meraki_output_log: "{{meraki_output_log}}" + meraki_log_file_prefix: "{{meraki_log_file_prefix}}" + meraki_log_path: "{{meraki_log_path}}" + meraki_print_console: "{{meraki_print_console}}" + meraki_suppress_logging: "{{meraki_suppress_logging}}" + meraki_simulate: "{{meraki_simulate}}" + meraki_be_geo_id: "{{meraki_be_geo_id}}" + meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" + meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" + perPage: 0 + startingAfter: string + endingBefore: string + networkIds: [] + organizationId: string + total_pages: -1 + direction: next + register: result + +""" +RETURN = r""" +meraki_response: + description: A dictionary or list with the response returned by the Cisco Meraki Python SDK + returned: always + type: list + elements: dict + sample: > + [ + { + "custom": [ + { + "destination": "string", + "port": "string", + "protocol": "string" + } + ], + "majorApplications": [ + { + "id": "string", + "name": "string" + } + ], + "networkId": "string", + "networkName": "string" + } + ] +""" diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_appliance_uplinks_statuses_overview_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_appliance_uplinks_statuses_overview_info.py new file mode 100644 index 000000000..1c10f74a4 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_appliance_uplinks_statuses_overview_info.py @@ -0,0 +1,83 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: organizations_appliance_uplinks_statuses_overview_info +short_description: Information module for organizations _appliance _uplinks _statuses _overview +description: +- Get all organizations _appliance _uplinks _statuses _overview. +- Returns an overview of uplink statuses. +version_added: '2.18.0' +extends_documentation_fragment: + - cisco.meraki.module_info +author: Francisco Munoz (@fmunoz) +options: + headers: + description: Additional headers. + type: dict + organizationId: + description: + - OrganizationId path parameter. Organization ID. + type: str +requirements: +- meraki >= 2.4.9 +- python >= 3.5 +seealso: +- name: Cisco Meraki documentation for appliance getOrganizationApplianceUplinksStatusesOverview + description: Complete reference of the getOrganizationApplianceUplinksStatusesOverview API. + link: https://developer.cisco.com/meraki/api-v1/#!get-organization-appliance-uplinks-statuses-overview +notes: + - SDK Method used are + appliance.Appliance.get_organization_appliance_uplinks_statuses_overview, + + - Paths used are + get /organizations/{organizationId}/appliance/uplinks/statuses/overview, +""" + +EXAMPLES = r""" +- name: Get all organizations _appliance _uplinks _statuses _overview + cisco.meraki.organizations_appliance_uplinks_statuses_overview_info: + meraki_api_key: "{{meraki_api_key}}" + meraki_base_url: "{{meraki_base_url}}" + meraki_single_request_timeout: "{{meraki_single_request_timeout}}" + meraki_certificate_path: "{{meraki_certificate_path}}" + meraki_requests_proxy: "{{meraki_requests_proxy}}" + meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" + meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" + meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" + meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" + meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" + meraki_maximum_retries: "{{meraki_maximum_retries}}" + meraki_output_log: "{{meraki_output_log}}" + meraki_log_file_prefix: "{{meraki_log_file_prefix}}" + meraki_log_path: "{{meraki_log_path}}" + meraki_print_console: "{{meraki_print_console}}" + meraki_suppress_logging: "{{meraki_suppress_logging}}" + meraki_simulate: "{{meraki_simulate}}" + meraki_be_geo_id: "{{meraki_be_geo_id}}" + meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" + meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" + organizationId: string + register: result + +""" +RETURN = r""" +meraki_response: + description: A dictionary or list with the response returned by the Cisco Meraki Python SDK + returned: always + type: dict + sample: > + { + "byStatus": { + "active": 0, + "connecting": 0, + "failed": 0, + "notConnected": 0, + "ready": 0 + } + } +""" diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_appliance_uplinks_usage_by_network_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_appliance_uplinks_usage_by_network_info.py new file mode 100644 index 000000000..14a03b2e2 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_appliance_uplinks_usage_by_network_info.py @@ -0,0 +1,109 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: organizations_appliance_uplinks_usage_by_network_info +short_description: Information module for organizations _appliance _uplinks _usage _bynetwork +description: +- Get all organizations _appliance _uplinks _usage _bynetwork. +- > + Get the sent and received bytes for each uplink of all MX and Z networks within an organization. If more than one + device was active during the specified timespan, then the sent and received bytes will be aggregated by interface. +version_added: '2.18.0' +extends_documentation_fragment: + - cisco.meraki.module_info +author: Francisco Munoz (@fmunoz) +options: + headers: + description: Additional headers. + type: dict + organizationId: + description: + - OrganizationId path parameter. Organization ID. + type: str + t0: + description: + - T0 query parameter. The beginning of the timespan for the data. The maximum lookback period is 365 days from today. + type: str + t1: + description: + - T1 query parameter. The end of the timespan for the data. T1 can be a maximum of 14 days after t0. + type: str + timespan: + description: + - > + Timespan query parameter. The timespan for which the information will be fetched. If specifying timespan, do + not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 14 days. The + default is 1 day. + type: float +requirements: +- meraki >= 2.4.9 +- python >= 3.5 +seealso: +- name: Cisco Meraki documentation for appliance getOrganizationApplianceUplinksUsageByNetwork + description: Complete reference of the getOrganizationApplianceUplinksUsageByNetwork API. + link: https://developer.cisco.com/meraki/api-v1/#!get-organization-appliance-uplinks-usage-by-network +notes: + - SDK Method used are + appliance.Appliance.get_organization_appliance_uplinks_usage_by_network, + + - Paths used are + get /organizations/{organizationId}/appliance/uplinks/usage/byNetwork, +""" + +EXAMPLES = r""" +- name: Get all organizations _appliance _uplinks _usage _bynetwork + cisco.meraki.organizations_appliance_uplinks_usage_by_network_info: + meraki_api_key: "{{meraki_api_key}}" + meraki_base_url: "{{meraki_base_url}}" + meraki_single_request_timeout: "{{meraki_single_request_timeout}}" + meraki_certificate_path: "{{meraki_certificate_path}}" + meraki_requests_proxy: "{{meraki_requests_proxy}}" + meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" + meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" + meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" + meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" + meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" + meraki_maximum_retries: "{{meraki_maximum_retries}}" + meraki_output_log: "{{meraki_output_log}}" + meraki_log_file_prefix: "{{meraki_log_file_prefix}}" + meraki_log_path: "{{meraki_log_path}}" + meraki_print_console: "{{meraki_print_console}}" + meraki_suppress_logging: "{{meraki_suppress_logging}}" + meraki_simulate: "{{meraki_simulate}}" + meraki_be_geo_id: "{{meraki_be_geo_id}}" + meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" + meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" + t0: string + t1: string + timespan: 0 + organizationId: string + register: result + +""" +RETURN = r""" +meraki_response: + description: A dictionary or list with the response returned by the Cisco Meraki Python SDK + returned: always + type: list + elements: dict + sample: > + [ + { + "byUplink": [ + { + "interface": "string", + "received": 0, + "sent": 0, + "serial": "string" + } + ], + "name": "string", + "networkId": "string" + } + ] +""" diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_appliance_vpn_third_party_vpnpeers.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_appliance_vpn_third_party_vpnpeers.py index 3f29c60ff..4808d0857 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_appliance_vpn_third_party_vpnpeers.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_appliance_vpn_third_party_vpnpeers.py @@ -193,44 +193,44 @@ meraki_response: sample: > [ { - "name": "string", - "publicIp": "string", - "remoteId": "string", - "localId": "string", - "secret": "string", - "privateSubnets": [ - "string" - ], + "ikeVersion": "string", "ipsecPolicies": { - "ikeCipherAlgo": [ + "childAuthAlgo": [ "string" ], - "ikeAuthAlgo": [ + "childCipherAlgo": [ "string" ], - "ikePrfAlgo": [ + "childLifetime": 0, + "childPfsGroup": [ "string" ], - "ikeDiffieHellmanGroup": [ + "ikeAuthAlgo": [ "string" ], - "ikeLifetime": 0, - "childCipherAlgo": [ + "ikeCipherAlgo": [ "string" ], - "childAuthAlgo": [ + "ikeDiffieHellmanGroup": [ "string" ], - "childPfsGroup": [ + "ikeLifetime": 0, + "ikePrfAlgo": [ "string" - ], - "childLifetime": 0 + ] }, "ipsecPoliciesPreset": "string", - "ikeVersion": "string", + "localId": "string", + "name": "string", "networkTags": [ "string" - ] + ], + "privateSubnets": [ + "string" + ], + "publicIp": "string", + "remoteId": "string", + "secret": "string" } ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_appliance_vpn_third_party_vpnpeers_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_appliance_vpn_third_party_vpnpeers_info.py index 780115b2d..7dd923632 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_appliance_vpn_third_party_vpnpeers_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_appliance_vpn_third_party_vpnpeers_info.py @@ -74,44 +74,44 @@ meraki_response: sample: > [ { - "name": "string", - "publicIp": "string", - "remoteId": "string", - "localId": "string", - "secret": "string", - "privateSubnets": [ - "string" - ], + "ikeVersion": "string", "ipsecPolicies": { - "ikeCipherAlgo": [ + "childAuthAlgo": [ "string" ], - "ikeAuthAlgo": [ + "childCipherAlgo": [ "string" ], - "ikePrfAlgo": [ + "childLifetime": 0, + "childPfsGroup": [ "string" ], - "ikeDiffieHellmanGroup": [ + "ikeAuthAlgo": [ "string" ], - "ikeLifetime": 0, - "childCipherAlgo": [ + "ikeCipherAlgo": [ "string" ], - "childAuthAlgo": [ + "ikeDiffieHellmanGroup": [ "string" ], - "childPfsGroup": [ + "ikeLifetime": 0, + "ikePrfAlgo": [ "string" - ], - "childLifetime": 0 + ] }, "ipsecPoliciesPreset": "string", - "ikeVersion": "string", + "localId": "string", + "name": "string", "networkTags": [ "string" - ] + ], + "privateSubnets": [ + "string" + ], + "publicIp": "string", + "remoteId": "string", + "secret": "string" } ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_appliance_vpn_vpn_firewall_rules.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_appliance_vpn_vpn_firewall_rules.py index 8773b7c97..5750088e1 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_appliance_vpn_vpn_firewall_rules.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_appliance_vpn_vpn_firewall_rules.py @@ -116,18 +116,16 @@ meraki_response: returned: always type: dict sample: > - { - "rules": [ - { - "comment": "string", - "policy": "string", - "protocol": "string", - "srcPort": "string", - "srcCidr": "string", - "destPort": "string", - "destCidr": "string", - "syslogEnabled": true - } - ] - } + [ + { + "comment": "string", + "destCidr": "string", + "destPort": "string", + "policy": "string", + "protocol": "string", + "srcCidr": "string", + "srcPort": "string", + "syslogEnabled": true + } + ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_appliance_vpn_vpn_firewall_rules_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_appliance_vpn_vpn_firewall_rules_info.py index a98db73ac..7d66ec5e0 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_appliance_vpn_vpn_firewall_rules_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_appliance_vpn_vpn_firewall_rules_info.py @@ -69,7 +69,19 @@ RETURN = r""" meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always - type: dict - sample: - - {} + type: list + elements: dict + sample: > + [ + { + "comment": "string", + "destCidr": "string", + "destPort": "string", + "policy": "string", + "protocol": "string", + "srcCidr": "string", + "srcPort": "string", + "syslogEnabled": true + } + ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_branding_policies.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_branding_policies.py index ca170c929..c4c4276c1 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_branding_policies.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_branding_policies.py @@ -231,6 +231,32 @@ EXAMPLES = r""" name: My Branding Policy organizationId: string +- name: Delete by id + cisco.meraki.organizations_branding_policies: + meraki_api_key: "{{meraki_api_key}}" + meraki_base_url: "{{meraki_base_url}}" + meraki_single_request_timeout: "{{meraki_single_request_timeout}}" + meraki_certificate_path: "{{meraki_certificate_path}}" + meraki_requests_proxy: "{{meraki_requests_proxy}}" + meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" + meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" + meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" + meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" + meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" + meraki_maximum_retries: "{{meraki_maximum_retries}}" + meraki_output_log: "{{meraki_output_log}}" + meraki_log_file_prefix: "{{meraki_log_file_prefix}}" + meraki_log_path: "{{meraki_log_path}}" + meraki_print_console: "{{meraki_print_console}}" + meraki_suppress_logging: "{{meraki_suppress_logging}}" + meraki_simulate: "{{meraki_simulate}}" + meraki_be_geo_id: "{{meraki_be_geo_id}}" + meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" + meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" + state: absent + brandingPolicyId: string + organizationId: string + - name: Update by id cisco.meraki.organizations_branding_policies: meraki_api_key: "{{meraki_api_key}}" @@ -285,32 +311,6 @@ EXAMPLES = r""" name: My Branding Policy organizationId: string -- name: Delete by id - cisco.meraki.organizations_branding_policies: - meraki_api_key: "{{meraki_api_key}}" - meraki_base_url: "{{meraki_base_url}}" - meraki_single_request_timeout: "{{meraki_single_request_timeout}}" - meraki_certificate_path: "{{meraki_certificate_path}}" - meraki_requests_proxy: "{{meraki_requests_proxy}}" - meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" - meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" - meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" - meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" - meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" - meraki_maximum_retries: "{{meraki_maximum_retries}}" - meraki_output_log: "{{meraki_output_log}}" - meraki_log_file_prefix: "{{meraki_log_file_prefix}}" - meraki_log_path: "{{meraki_log_path}}" - meraki_print_console: "{{meraki_print_console}}" - meraki_suppress_logging: "{{meraki_suppress_logging}}" - meraki_simulate: "{{meraki_simulate}}" - meraki_be_geo_id: "{{meraki_be_geo_id}}" - meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" - meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: absent - brandingPolicyId: string - organizationId: string - """ RETURN = r""" meraki_response: @@ -319,39 +319,39 @@ meraki_response: type: dict sample: > { - "name": "string", - "enabled": true, "adminSettings": { "appliesTo": "string", "values": [ "string" ] }, + "customLogo": { + "enabled": true, + "image": { + "preview": { + "expiresAt": "string", + "url": "string" + } + } + }, + "enabled": true, "helpSettings": { - "helpTab": "string", - "getHelpSubtab": "string", - "communitySubtab": "string", + "apiDocsSubtab": "string", "casesSubtab": "string", - "dataProtectionRequestsSubtab": "string", - "getHelpSubtabKnowledgeBaseSearch": "string", - "universalSearchKnowledgeBaseSearch": "string", "ciscoMerakiProductDocumentation": "string", - "supportContactInfo": "string", - "newFeaturesSubtab": "string", + "communitySubtab": "string", + "dataProtectionRequestsSubtab": "string", "firewallInfoSubtab": "string", - "apiDocsSubtab": "string", + "getHelpSubtab": "string", + "getHelpSubtabKnowledgeBaseSearch": "string", "hardwareReplacementsSubtab": "string", + "helpTab": "string", + "helpWidget": "string", + "newFeaturesSubtab": "string", "smForums": "string", - "helpWidget": "string" + "supportContactInfo": "string", + "universalSearchKnowledgeBaseSearch": "string" }, - "customLogo": { - "enabled": true, - "image": { - "preview": { - "url": "string", - "expiresAt": "string" - } - } - } + "name": "string" } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_branding_policies_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_branding_policies_info.py index f1c61ced5..b052d28a1 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_branding_policies_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_branding_policies_info.py @@ -109,39 +109,39 @@ meraki_response: type: dict sample: > { - "name": "string", - "enabled": true, "adminSettings": { "appliesTo": "string", "values": [ "string" ] }, + "customLogo": { + "enabled": true, + "image": { + "preview": { + "expiresAt": "string", + "url": "string" + } + } + }, + "enabled": true, "helpSettings": { - "helpTab": "string", - "getHelpSubtab": "string", - "communitySubtab": "string", + "apiDocsSubtab": "string", "casesSubtab": "string", - "dataProtectionRequestsSubtab": "string", - "getHelpSubtabKnowledgeBaseSearch": "string", - "universalSearchKnowledgeBaseSearch": "string", "ciscoMerakiProductDocumentation": "string", - "supportContactInfo": "string", - "newFeaturesSubtab": "string", + "communitySubtab": "string", + "dataProtectionRequestsSubtab": "string", "firewallInfoSubtab": "string", - "apiDocsSubtab": "string", + "getHelpSubtab": "string", + "getHelpSubtabKnowledgeBaseSearch": "string", "hardwareReplacementsSubtab": "string", + "helpTab": "string", + "helpWidget": "string", + "newFeaturesSubtab": "string", "smForums": "string", - "helpWidget": "string" + "supportContactInfo": "string", + "universalSearchKnowledgeBaseSearch": "string" }, - "customLogo": { - "enabled": true, - "image": { - "preview": { - "url": "string", - "expiresAt": "string" - } - } - } + "name": "string" } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_camera_boundaries_areas_by_device_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_camera_boundaries_areas_by_device_info.py new file mode 100644 index 000000000..26b79303c --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_camera_boundaries_areas_by_device_info.py @@ -0,0 +1,100 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: organizations_camera_boundaries_areas_by_device_info +short_description: Information module for organizations _camera _boundaries _areas _bydevice +description: +- Get all organizations _camera _boundaries _areas _bydevice. +- Returns all configured area boundaries of cameras. +version_added: '2.18.0' +extends_documentation_fragment: + - cisco.meraki.module_info +author: Francisco Munoz (@fmunoz) +options: + headers: + description: Additional headers. + type: dict + organizationId: + description: + - OrganizationId path parameter. Organization ID. + type: str + serials: + description: + - > + Serials query parameter. A list of serial numbers. The returned cameras will be filtered to only include + these serials. + elements: str + type: list +requirements: +- meraki >= 2.4.9 +- python >= 3.5 +seealso: +- name: Cisco Meraki documentation for camera getOrganizationCameraBoundariesAreasByDevice + description: Complete reference of the getOrganizationCameraBoundariesAreasByDevice API. + link: https://developer.cisco.com/meraki/api-v1/#!get-organization-camera-boundaries-areas-by-device +notes: + - SDK Method used are + camera.Camera.get_organization_camera_boundaries_areas_by_device, + + - Paths used are + get /organizations/{organizationId}/camera/boundaries/areas/byDevice, +""" + +EXAMPLES = r""" +- name: Get all organizations _camera _boundaries _areas _bydevice + cisco.meraki.organizations_camera_boundaries_areas_by_device_info: + meraki_api_key: "{{meraki_api_key}}" + meraki_base_url: "{{meraki_base_url}}" + meraki_single_request_timeout: "{{meraki_single_request_timeout}}" + meraki_certificate_path: "{{meraki_certificate_path}}" + meraki_requests_proxy: "{{meraki_requests_proxy}}" + meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" + meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" + meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" + meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" + meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" + meraki_maximum_retries: "{{meraki_maximum_retries}}" + meraki_output_log: "{{meraki_output_log}}" + meraki_log_file_prefix: "{{meraki_log_file_prefix}}" + meraki_log_path: "{{meraki_log_path}}" + meraki_print_console: "{{meraki_print_console}}" + meraki_suppress_logging: "{{meraki_suppress_logging}}" + meraki_simulate: "{{meraki_simulate}}" + meraki_be_geo_id: "{{meraki_be_geo_id}}" + meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" + meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" + serials: [] + organizationId: string + register: result + +""" +RETURN = r""" +meraki_response: + description: A dictionary or list with the response returned by the Cisco Meraki Python SDK + returned: always + type: list + elements: dict + sample: > + [ + { + "boundaries": { + "id": "string", + "name": "string", + "type": "string", + "vertices": [ + { + "x": 0, + "y": 0 + } + ] + }, + "networkId": "string", + "serial": "string" + } + ] +""" diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_camera_boundaries_lines_by_device_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_camera_boundaries_lines_by_device_info.py new file mode 100644 index 000000000..e2d3be61b --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_camera_boundaries_lines_by_device_info.py @@ -0,0 +1,104 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: organizations_camera_boundaries_lines_by_device_info +short_description: Information module for organizations _camera _boundaries _lines _bydevice +description: +- Get all organizations _camera _boundaries _lines _bydevice. +- Returns all configured crossingline boundaries of cameras. +version_added: '2.18.0' +extends_documentation_fragment: + - cisco.meraki.module_info +author: Francisco Munoz (@fmunoz) +options: + headers: + description: Additional headers. + type: dict + organizationId: + description: + - OrganizationId path parameter. Organization ID. + type: str + serials: + description: + - > + Serials query parameter. A list of serial numbers. The returned cameras will be filtered to only include + these serials. + elements: str + type: list +requirements: +- meraki >= 2.4.9 +- python >= 3.5 +seealso: +- name: Cisco Meraki documentation for camera getOrganizationCameraBoundariesLinesByDevice + description: Complete reference of the getOrganizationCameraBoundariesLinesByDevice API. + link: https://developer.cisco.com/meraki/api-v1/#!get-organization-camera-boundaries-lines-by-device +notes: + - SDK Method used are + camera.Camera.get_organization_camera_boundaries_lines_by_device, + + - Paths used are + get /organizations/{organizationId}/camera/boundaries/lines/byDevice, +""" + +EXAMPLES = r""" +- name: Get all organizations _camera _boundaries _lines _bydevice + cisco.meraki.organizations_camera_boundaries_lines_by_device_info: + meraki_api_key: "{{meraki_api_key}}" + meraki_base_url: "{{meraki_base_url}}" + meraki_single_request_timeout: "{{meraki_single_request_timeout}}" + meraki_certificate_path: "{{meraki_certificate_path}}" + meraki_requests_proxy: "{{meraki_requests_proxy}}" + meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" + meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" + meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" + meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" + meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" + meraki_maximum_retries: "{{meraki_maximum_retries}}" + meraki_output_log: "{{meraki_output_log}}" + meraki_log_file_prefix: "{{meraki_log_file_prefix}}" + meraki_log_path: "{{meraki_log_path}}" + meraki_print_console: "{{meraki_print_console}}" + meraki_suppress_logging: "{{meraki_suppress_logging}}" + meraki_simulate: "{{meraki_simulate}}" + meraki_be_geo_id: "{{meraki_be_geo_id}}" + meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" + meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" + serials: [] + organizationId: string + register: result + +""" +RETURN = r""" +meraki_response: + description: A dictionary or list with the response returned by the Cisco Meraki Python SDK + returned: always + type: list + elements: dict + sample: > + [ + { + "boundaries": { + "directionVertex": { + "x": 0, + "y": 0 + }, + "id": "string", + "name": "string", + "type": "string", + "vertices": [ + { + "x": 0, + "y": 0 + } + ] + }, + "networkId": "string", + "serial": "string" + } + ] +""" diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_camera_custom_analytics_artifacts.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_camera_custom_analytics_artifacts.py index 3783eb460..709c10270 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_camera_custom_analytics_artifacts.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_camera_custom_analytics_artifacts.py @@ -108,5 +108,16 @@ meraki_response: returned: always type: dict sample: > - {} + { + "artifactId": "string", + "name": "string", + "organizationId": "string", + "status": { + "message": "string", + "type": "string" + }, + "uploadId": "string", + "uploadUrl": "string", + "uploadUrlExpiry": "string" + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_camera_custom_analytics_artifacts_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_camera_custom_analytics_artifacts_info.py index 2335fb10a..8dfb82020 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_camera_custom_analytics_artifacts_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_camera_custom_analytics_artifacts_info.py @@ -106,10 +106,15 @@ RETURN = r""" meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always - type: list - elements: dict + type: dict sample: > - [ - {} - ] + { + "artifactId": "string", + "name": "string", + "organizationId": "string", + "status": { + "message": "string", + "type": "string" + } + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_camera_detections_history_by_boundary_by_interval_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_camera_detections_history_by_boundary_by_interval_info.py new file mode 100644 index 000000000..9d0461f4e --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_camera_detections_history_by_boundary_by_interval_info.py @@ -0,0 +1,123 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: organizations_camera_detections_history_by_boundary_by_interval_info +short_description: Information module for organizations _camera _detections _history _byboundary _byinterval +description: +- Get all organizations _camera _detections _history _byboundary _byinterval. +- Returns analytics data for timespans. +version_added: '2.18.0' +extends_documentation_fragment: + - cisco.meraki.module_info + - cisco.meraki.module_info_pagination +author: Francisco Munoz (@fmunoz) +options: + headers: + description: Additional headers. + type: dict + organizationId: + description: + - OrganizationId path parameter. Organization ID. + type: str + boundaryIds: + description: + - > + BoundaryIds query parameter. A list of boundary ids. The returned cameras will be filtered to only include + these ids. + elements: str + type: list + ranges: + description: + - Ranges query parameter. A list of time ranges with intervals. + elements: dict + type: list + duration: + description: + - > + Duration query parameter. The minimum time, in seconds, that the person or car remains in the area to be + counted. Defaults to boundary configuration or 60. + type: int + perPage: + description: + - PerPage query parameter. The number of entries per page returned. Acceptable range is 1 - 1000. Defaults to 1000. + type: int + boundaryTypes: + description: + - BoundaryTypes query parameter. The detection types. Defaults to 'person'. + elements: str + type: list +requirements: +- meraki >= 2.4.9 +- python >= 3.5 +seealso: +- name: Cisco Meraki documentation for camera getOrganizationCameraDetectionsHistoryByBoundaryByInterval + description: Complete reference of the getOrganizationCameraDetectionsHistoryByBoundaryByInterval API. + link: https://developer.cisco.com/meraki/api-v1/#!get-organization-camera-detections-history-by-boundary-by-interval +notes: + - SDK Method used are + camera.Camera.get_organization_camera_detections_history_by_boundary_by_interval, + + - Paths used are + get /organizations/{organizationId}/camera/detections/history/byBoundary/byInterval, +""" + +EXAMPLES = r""" +- name: Get all organizations _camera _detections _history _byboundary _byinterval + cisco.meraki.organizations_camera_detections_history_by_boundary_by_interval_info: + meraki_api_key: "{{meraki_api_key}}" + meraki_base_url: "{{meraki_base_url}}" + meraki_single_request_timeout: "{{meraki_single_request_timeout}}" + meraki_certificate_path: "{{meraki_certificate_path}}" + meraki_requests_proxy: "{{meraki_requests_proxy}}" + meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" + meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" + meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" + meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" + meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" + meraki_maximum_retries: "{{meraki_maximum_retries}}" + meraki_output_log: "{{meraki_output_log}}" + meraki_log_file_prefix: "{{meraki_log_file_prefix}}" + meraki_log_path: "{{meraki_log_path}}" + meraki_print_console: "{{meraki_print_console}}" + meraki_suppress_logging: "{{meraki_suppress_logging}}" + meraki_simulate: "{{meraki_simulate}}" + meraki_be_geo_id: "{{meraki_be_geo_id}}" + meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" + meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" + boundaryIds: [] + ranges: [] + duration: 0 + perPage: 0 + boundaryTypes: [] + organizationId: string + total_pages: -1 + direction: next + register: result + +""" +RETURN = r""" +meraki_response: + description: A dictionary or list with the response returned by the Cisco Meraki Python SDK + returned: always + type: list + elements: dict + sample: > + [ + { + "boundaryId": "string", + "results": { + "endTime": "string", + "in": 0, + "objectType": "string", + "out": 0, + "startTime": "string" + }, + "type": "string" + } + ] +""" diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_camera_permissions_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_camera_permissions_info.py new file mode 100644 index 000000000..53e969fc0 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_camera_permissions_info.py @@ -0,0 +1,84 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: organizations_camera_permissions_info +short_description: Information module for organizations _camera _permissions +description: +- Get organizations _camera _permissions by id. +- Retrieve a single permission scope. +version_added: '2.18.0' +extends_documentation_fragment: + - cisco.meraki.module_info +author: Francisco Munoz (@fmunoz) +options: + headers: + description: Additional headers. + type: dict + organizationId: + description: + - OrganizationId path parameter. Organization ID. + type: str + permissionScopeId: + description: + - PermissionScopeId path parameter. Permission scope ID. + type: str +requirements: +- meraki >= 2.4.9 +- python >= 3.5 +seealso: +- name: Cisco Meraki documentation for camera getOrganizationCameraPermission + description: Complete reference of the getOrganizationCameraPermission API. + link: https://developer.cisco.com/meraki/api-v1/#!get-organization-camera-permission +notes: + - SDK Method used are + camera.Camera.get_organization_camera_permission, + + - Paths used are + get /organizations/{organizationId}/camera/permissions/{permissionScopeId}, +""" + +EXAMPLES = r""" +- name: Get organizations _camera _permissions by id + cisco.meraki.organizations_camera_permissions_info: + meraki_api_key: "{{meraki_api_key}}" + meraki_base_url: "{{meraki_base_url}}" + meraki_single_request_timeout: "{{meraki_single_request_timeout}}" + meraki_certificate_path: "{{meraki_certificate_path}}" + meraki_requests_proxy: "{{meraki_requests_proxy}}" + meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" + meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" + meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" + meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" + meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" + meraki_maximum_retries: "{{meraki_maximum_retries}}" + meraki_output_log: "{{meraki_output_log}}" + meraki_log_file_prefix: "{{meraki_log_file_prefix}}" + meraki_log_path: "{{meraki_log_path}}" + meraki_print_console: "{{meraki_print_console}}" + meraki_suppress_logging: "{{meraki_suppress_logging}}" + meraki_simulate: "{{meraki_simulate}}" + meraki_be_geo_id: "{{meraki_be_geo_id}}" + meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" + meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" + organizationId: string + permissionScopeId: string + register: result + +""" +RETURN = r""" +meraki_response: + description: A dictionary or list with the response returned by the Cisco Meraki Python SDK + returned: always + type: dict + sample: > + { + "id": "string", + "level": "string", + "name": "string" + } +""" diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_camera_roles.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_camera_roles.py new file mode 100644 index 000000000..cb141d37a --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_camera_roles.py @@ -0,0 +1,129 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: organizations_camera_roles +short_description: Resource module for organizations _camera _roles +description: +- Manage operations create, update and delete of the resource organizations _camera _roles. +- Creates new role for this organization. +version_added: '2.18.0' +extends_documentation_fragment: + - cisco.meraki.module +author: Francisco Munoz (@fmunoz) +options: + appliedOnDevices: + description: Device tag on which this specified permission is applied. + elements: dict + suboptions: + id: + description: Device id. + type: str + inNetworksWithId: + description: Network id scope. + type: str + inNetworksWithTag: + description: Network tag scope. + type: str + permissionScopeId: + description: Permission scope id. + type: str + tag: + description: Device tag. + type: str + type: list + appliedOnNetworks: + description: Network tag on which this specified permission is applied. + elements: dict + suboptions: + id: + description: Network id. + type: str + permissionScopeId: + description: Permission scope id. + type: str + tag: + description: Network tag. + type: str + type: list + appliedOrgWide: + description: Permissions to be applied org wide. + elements: dict + suboptions: + permissionScopeId: + description: Permission scope id. + type: str + type: list + name: + description: The name of the new role. Must be unique. This parameter is required. + type: str + organizationId: + description: OrganizationId path parameter. Organization ID. + type: str +requirements: +- meraki >= 2.4.9 +- python >= 3.5 +seealso: +- name: Cisco Meraki documentation for camera createOrganizationCameraRole + description: Complete reference of the createOrganizationCameraRole API. + link: https://developer.cisco.com/meraki/api-v1/#!create-organization-camera-role +notes: + - SDK Method used are + camera.Camera.create_organization_camera_role, + + - Paths used are + post /organizations/{organizationId}/camera/roles, +""" + +EXAMPLES = r""" +- name: Create + cisco.meraki.organizations_camera_roles: + meraki_api_key: "{{meraki_api_key}}" + meraki_base_url: "{{meraki_base_url}}" + meraki_single_request_timeout: "{{meraki_single_request_timeout}}" + meraki_certificate_path: "{{meraki_certificate_path}}" + meraki_requests_proxy: "{{meraki_requests_proxy}}" + meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" + meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" + meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" + meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" + meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" + meraki_maximum_retries: "{{meraki_maximum_retries}}" + meraki_output_log: "{{meraki_output_log}}" + meraki_log_file_prefix: "{{meraki_log_file_prefix}}" + meraki_log_path: "{{meraki_log_path}}" + meraki_print_console: "{{meraki_print_console}}" + meraki_suppress_logging: "{{meraki_suppress_logging}}" + meraki_simulate: "{{meraki_simulate}}" + meraki_be_geo_id: "{{meraki_be_geo_id}}" + meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" + meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" + state: present + appliedOnDevices: + - id: '' + permissionScopeId: '1' + tag: reception-desk + appliedOnNetworks: + - id: '' + permissionScopeId: '2' + tag: building-a + appliedOrgWide: + - id: '' + permissionScopeId: '2' + tag: building-a + name: Security_Guard + organizationId: string + +""" +RETURN = r""" +meraki_response: + description: A dictionary or list with the response returned by the Cisco Meraki Python SDK + returned: always + type: dict + sample: > + {} +""" diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_camera_roles_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_camera_roles_info.py new file mode 100644 index 000000000..53c293aeb --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_camera_roles_info.py @@ -0,0 +1,106 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: organizations_camera_roles_info +short_description: Information module for organizations _camera _roles +description: +- Get all organizations _camera _roles. +- List all the roles in this organization. +version_added: '2.18.0' +extends_documentation_fragment: + - cisco.meraki.module_info +author: Francisco Munoz (@fmunoz) +options: + headers: + description: Additional headers. + type: dict + organizationId: + description: + - OrganizationId path parameter. Organization ID. + type: str +requirements: +- meraki >= 2.4.9 +- python >= 3.5 +seealso: +- name: Cisco Meraki documentation for camera getOrganizationCameraRoles + description: Complete reference of the getOrganizationCameraRoles API. + link: https://developer.cisco.com/meraki/api-v1/#!get-organization-camera-roles +notes: + - SDK Method used are + camera.Camera.get_organization_camera_roles, + + - Paths used are + get /organizations/{organizationId}/camera/roles, +""" + +EXAMPLES = r""" +- name: Get all organizations _camera _roles + cisco.meraki.organizations_camera_roles_info: + meraki_api_key: "{{meraki_api_key}}" + meraki_base_url: "{{meraki_base_url}}" + meraki_single_request_timeout: "{{meraki_single_request_timeout}}" + meraki_certificate_path: "{{meraki_certificate_path}}" + meraki_requests_proxy: "{{meraki_requests_proxy}}" + meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" + meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" + meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" + meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" + meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" + meraki_maximum_retries: "{{meraki_maximum_retries}}" + meraki_output_log: "{{meraki_output_log}}" + meraki_log_file_prefix: "{{meraki_log_file_prefix}}" + meraki_log_path: "{{meraki_log_path}}" + meraki_print_console: "{{meraki_print_console}}" + meraki_suppress_logging: "{{meraki_suppress_logging}}" + meraki_simulate: "{{meraki_simulate}}" + meraki_be_geo_id: "{{meraki_be_geo_id}}" + meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" + meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" + organizationId: string + register: result + +""" +RETURN = r""" +meraki_response: + description: A dictionary or list with the response returned by the Cisco Meraki Python SDK + returned: always + type: list + elements: dict + sample: > + [ + { + "appliedOnDevices": [ + { + "id": "string", + "permissionLevel": "string", + "permissionScope": "string", + "permissionScopeId": "string", + "tag": "string" + } + ], + "appliedOnNetworks": [ + { + "id": "string", + "permissionLevel": "string", + "permissionScope": "string", + "permissionScopeId": "string", + "tag": "string" + } + ], + "appliedOrgWide": [ + { + "permissionLevel": "string", + "permissionScope": "string", + "permissionScopeId": "string", + "tag": "string" + } + ], + "name": "string" + } + ] +""" diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_cellular_gateway_uplink_statuses_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_cellular_gateway_uplink_statuses_info.py index 9c503aee6..6e1dce91a 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_cellular_gateway_uplink_statuses_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_cellular_gateway_uplink_statuses_info.py @@ -120,29 +120,29 @@ meraki_response: sample: > [ { + "lastReportedAt": "string", + "model": "string", "networkId": "string", "serial": "string", - "model": "string", - "lastReportedAt": "string", "uplinks": [ { + "apn": "string", + "connectionType": "string", + "dns1": "string", + "dns2": "string", + "gateway": "string", + "iccid": "string", "interface": "string", - "status": "string", "ip": "string", + "model": "string", "provider": "string", "publicIp": "string", - "model": "string", "signalStat": { "rsrp": "string", "rsrq": "string" }, - "connectionType": "string", - "apn": "string", - "gateway": "string", - "dns1": "string", - "dns2": "string", "signalType": "string", - "iccid": "string" + "status": "string" } ] } diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_claim.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_claim.py index 38331e5b7..cafc57763 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_claim.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_claim.py @@ -11,9 +11,10 @@ short_description: Resource module for organizations _claim description: - Manage operation create of the resource organizations _claim. - > - Claim a list of devices, licenses, and/or orders into an organization. When claiming by order, all devices and - licenses in the order will be claimed; licenses will be added to the organization and devices will be placed in - the organization's inventory. + Claim a list of devices, licenses, and/or orders into an organization inventory. When claiming by order, all + devices and licenses in the order will be claimed; licenses will be added to the organization and devices will be + placed in the organization's inventory. This operation can be used up to ten times within a single five minute + window. version_added: '2.16.0' extends_documentation_fragment: - cisco.meraki.module @@ -99,5 +100,18 @@ meraki_response: returned: always type: dict sample: > - {} + { + "licenses": [ + { + "key": "string", + "mode": "string" + } + ], + "orders": [ + "string" + ], + "serials": [ + "string" + ] + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_clients_bandwidth_usage_history_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_clients_bandwidth_usage_history_info.py index c7e8ebc7c..2d913a00e 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_clients_bandwidth_usage_history_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_clients_bandwidth_usage_history_info.py @@ -94,10 +94,10 @@ meraki_response: sample: > [ { - "ts": "string", + "downstream": 0, "total": 0, - "upstream": 0, - "downstream": 0 + "ts": "string", + "upstream": 0 } ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_clients_overview_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_clients_overview_info.py index f197340cc..0a8f9d231 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_clients_overview_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_clients_overview_info.py @@ -90,16 +90,16 @@ meraki_response: type: dict sample: > { + "counts": { + "total": 0 + }, "usage": { + "average": 0, "overall": { - "total": 0, "downstream": 0, + "total": 0, "upstream": 0 - }, - "average": 0 - }, - "counts": { - "total": 0 + } } } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_clients_search_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_clients_search_info.py index 6ad0c555c..ddd9c9236 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_clients_search_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_clients_search_info.py @@ -99,6 +99,53 @@ meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always type: dict - sample: - - {} + sample: > + { + "clientId": "string", + "mac": "string", + "manufacturer": "string", + "records": [ + { + "cdp": "string", + "clientVpnConnections": [ + { + "connectedAt": 0, + "disconnectedAt": 0, + "remoteIp": "string" + } + ], + "description": "string", + "firstSeen": 0, + "ip": "string", + "ip6": "string", + "lastSeen": 0, + "lldp": [ + "string" + ], + "network": { + "enrollmentString": "string", + "id": "string", + "isBoundToConfigTemplate": true, + "name": "string", + "notes": "string", + "organizationId": "string", + "productTypes": [ + "string" + ], + "tags": [ + "string" + ], + "timeZone": "string" + }, + "os": "string", + "smInstalled": true, + "ssid": "string", + "status": "string", + "switchport": "string", + "user": "string", + "vlan": "string", + "wirelessCapabilities": "string" + } + ] + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_clone.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_clone.py index 1b2aedb18..300371f86 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_clone.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_clone.py @@ -71,20 +71,18 @@ meraki_response: type: dict sample: > { - "id": "string", - "name": "string", - "url": "string", "api": { "enabled": true }, - "licensing": { - "model": "string" - }, "cloud": { "region": { "name": "string" } }, + "id": "string", + "licensing": { + "model": "string" + }, "management": { "details": [ { @@ -92,6 +90,8 @@ meraki_response: "value": "string" } ] - } + }, + "name": "string", + "url": "string" } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_config_templates.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_config_templates.py index 87073467e..c0ebb3702 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_config_templates.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_config_templates.py @@ -21,6 +21,9 @@ options: configTemplateId: description: ConfigTemplateId path parameter. Config template ID. type: str + copyFromNetworkId: + description: The ID of the network or config template to copy configuration from. + type: str name: description: The name of the configuration template. type: str @@ -81,11 +84,12 @@ EXAMPLES = r""" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" state: present + copyFromNetworkId: N_24329156 name: My config template organizationId: string timeZone: America/Los_Angeles -- name: Update by id +- name: Delete by id cisco.meraki.organizations_config_templates: meraki_api_key: "{{meraki_api_key}}" meraki_base_url: "{{meraki_base_url}}" @@ -107,13 +111,11 @@ EXAMPLES = r""" meraki_be_geo_id: "{{meraki_be_geo_id}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: present + state: absent configTemplateId: string - name: My config template organizationId: string - timeZone: America/Los_Angeles -- name: Delete by id +- name: Update by id cisco.meraki.organizations_config_templates: meraki_api_key: "{{meraki_api_key}}" meraki_base_url: "{{meraki_base_url}}" @@ -135,9 +137,11 @@ EXAMPLES = r""" meraki_be_geo_id: "{{meraki_be_geo_id}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: absent + state: present configTemplateId: string + name: My config template organizationId: string + timeZone: America/Los_Angeles """ RETURN = r""" @@ -146,5 +150,12 @@ meraki_response: returned: always type: dict sample: > - {} + { + "id": "string", + "name": "string", + "productTypes": [ + "string" + ], + "timeZone": "string" + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_config_templates_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_config_templates_info.py index 24c619cdc..9c12ff69f 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_config_templates_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_config_templates_info.py @@ -106,10 +106,14 @@ RETURN = r""" meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always - type: list - elements: dict + type: dict sample: > - [ - {} - ] + { + "id": "string", + "name": "string", + "productTypes": [ + "string" + ], + "timeZone": "string" + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_config_templates_switch_profiles_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_config_templates_switch_profiles_info.py index bdae89ac3..2c9c8747f 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_config_templates_switch_profiles_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_config_templates_switch_profiles_info.py @@ -10,7 +10,7 @@ module: organizations_config_templates_switch_profiles_info short_description: Information module for organizations _configtemplates _switch _profiles description: - Get all organizations _configtemplates _switch _profiles. -- List the switch profiles for your switch template configuration. +- List the switch templates for your switch template configuration. version_added: '2.16.0' extends_documentation_fragment: - cisco.meraki.module_info @@ -74,11 +74,14 @@ RETURN = r""" meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always - type: dict + type: list + elements: dict sample: > - { - "switchProfileId": "string", - "name": "string", - "model": "string" - } + [ + { + "model": "string", + "name": "string", + "switchProfileId": "string" + } + ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_config_templates_switch_profiles_ports.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_config_templates_switch_profiles_ports.py index 3fe154c30..eec8506a2 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_config_templates_switch_profiles_ports.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_config_templates_switch_profiles_ports.py @@ -10,23 +10,23 @@ module: organizations_config_templates_switch_profiles_ports short_description: Resource module for organizations _configtemplates _switch _profiles _ports description: - Manage operation update of the resource organizations _configtemplates _switch _profiles _ports. -- Update a switch profile port. +- Update a switch template port. version_added: '2.16.0' extends_documentation_fragment: - cisco.meraki.module author: Francisco Munoz (@fmunoz) options: accessPolicyNumber: - description: The number of a custom access policy to configure on the switch profile + description: The number of a custom access policy to configure on the switch template port. Only applicable when 'accessPolicyType' is 'Custom access policy'. type: int accessPolicyType: - description: The type of the access policy of the switch profile port. Only applicable + description: The type of the access policy of the switch template port. Only applicable to access ports. Can be one of 'Open', 'Custom access policy', 'MAC allow list' or 'Sticky MAC allow list'. type: str allowedVlans: - description: The VLANs allowed on the switch profile port. Only applicable to trunk + description: The VLANs allowed on the switch template port. Only applicable to trunk ports. type: str configTemplateId: @@ -37,17 +37,17 @@ options: Dynamic ARP Inspection will allow the traffic. type: bool enabled: - description: The status of the switch profile port. + description: The status of the switch template port. type: bool flexibleStackingEnabled: description: For supported switches (e.g. MS420/MS425), whether or not the port has flexible stacking enabled. type: bool isolationEnabled: - description: The isolation status of the switch profile port. + description: The isolation status of the switch template port. type: bool linkNegotiation: - description: The link speed for the switch profile port. + description: The link speed for the switch template port. type: str macAllowList: description: Only devices with MAC addresses specified in this list will have access @@ -56,13 +56,13 @@ options: elements: str type: list name: - description: The name of the switch profile port. + description: The name of the switch template port. type: str organizationId: description: OrganizationId path parameter. Organization ID. type: str poeEnabled: - description: The PoE status of the switch profile port. + description: The PoE status of the switch template port. type: bool portId: description: PortId path parameter. Port ID. @@ -100,29 +100,29 @@ options: applicable when 'accessPolicyType' is 'Sticky MAC allow list'. type: int stormControlEnabled: - description: The storm control status of the switch profile port. + description: The storm control status of the switch template port. type: bool stpGuard: description: The state of the STP guard ('disabled', 'root guard', 'bpdu guard' or 'loop guard'). type: str tags: - description: The list of tags of the switch profile port. + description: The list of tags of the switch template port. elements: str type: list type: - description: The type of the switch profile port ('trunk' or 'access'). + description: The type of the switch template port ('trunk' or 'access'). type: str udld: description: The action to take when Unidirectional Link is detected (Alert only, Enforce). Default configuration is Alert only. type: str vlan: - description: The VLAN of the switch profile port. A null value will clear the value - set for trunk ports. + description: The VLAN of the switch template port. For a trunk port, this is the + native VLAN. A null value will clear the value set for trunk ports. type: int voiceVlan: - description: The voice VLAN of the switch profile port. Only applicable to access + description: The voice VLAN of the switch template port. Only applicable to access ports. type: int requirements: @@ -209,42 +209,48 @@ meraki_response: type: dict sample: > { - "portId": "string", - "name": "string", - "tags": [ - "string" - ], - "enabled": true, - "poeEnabled": true, - "type": "string", - "vlan": 0, - "voiceVlan": 0, + "accessPolicyNumber": 0, + "accessPolicyType": "string", "allowedVlans": "string", + "daiTrusted": true, + "enabled": true, + "flexibleStackingEnabled": true, "isolationEnabled": true, - "rstpEnabled": true, - "stpGuard": "string", "linkNegotiation": "string", "linkNegotiationCapabilities": [ "string" ], - "portScheduleId": "string", - "udld": "string", - "accessPolicyType": "string", - "accessPolicyNumber": 0, "macAllowList": [ "string" ], + "mirror": { + "mode": "string" + }, + "module": { + "model": "string" + }, + "name": "string", + "poeEnabled": true, + "portId": "string", + "portScheduleId": "string", + "profile": { + "enabled": true, + "id": "string", + "iname": "string" + }, + "rstpEnabled": true, "stickyMacAllowList": [ "string" ], "stickyMacAllowListLimit": 0, "stormControlEnabled": true, - "flexibleStackingEnabled": true, - "daiTrusted": true, - "profile": { - "enabled": true, - "id": "string", - "iname": "string" - } + "stpGuard": "string", + "tags": [ + "string" + ], + "type": "string", + "udld": "string", + "vlan": 0, + "voiceVlan": 0 } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_config_templates_switch_profiles_ports_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_config_templates_switch_profiles_ports_info.py index 3d3351bef..8d23b3e89 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_config_templates_switch_profiles_ports_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_config_templates_switch_profiles_ports_info.py @@ -11,8 +11,8 @@ short_description: Information module for organizations _configtemplates _switch description: - Get all organizations _configtemplates _switch _profiles _ports. - Get organizations _configtemplates _switch _profiles _ports by id. -- Return a switch profile port. -- Return all the ports of a switch profile. +- Return a switch template port. +- Return all the ports of a switch template. version_added: '2.16.0' extends_documentation_fragment: - cisco.meraki.module_info @@ -121,42 +121,48 @@ meraki_response: type: dict sample: > { - "portId": "string", - "name": "string", - "tags": [ - "string" - ], - "enabled": true, - "poeEnabled": true, - "type": "string", - "vlan": 0, - "voiceVlan": 0, + "accessPolicyNumber": 0, + "accessPolicyType": "string", "allowedVlans": "string", + "daiTrusted": true, + "enabled": true, + "flexibleStackingEnabled": true, "isolationEnabled": true, - "rstpEnabled": true, - "stpGuard": "string", "linkNegotiation": "string", "linkNegotiationCapabilities": [ "string" ], - "portScheduleId": "string", - "udld": "string", - "accessPolicyType": "string", - "accessPolicyNumber": 0, "macAllowList": [ "string" ], + "mirror": { + "mode": "string" + }, + "module": { + "model": "string" + }, + "name": "string", + "poeEnabled": true, + "portId": "string", + "portScheduleId": "string", + "profile": { + "enabled": true, + "id": "string", + "iname": "string" + }, + "rstpEnabled": true, "stickyMacAllowList": [ "string" ], "stickyMacAllowListLimit": 0, "stormControlEnabled": true, - "flexibleStackingEnabled": true, - "daiTrusted": true, - "profile": { - "enabled": true, - "id": "string", - "iname": "string" - } + "stpGuard": "string", + "tags": [ + "string" + ], + "type": "string", + "udld": "string", + "vlan": 0, + "voiceVlan": 0 } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_devices_availabilities_change_history_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_devices_availabilities_change_history_info.py new file mode 100644 index 000000000..1e9c3ec71 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_devices_availabilities_change_history_info.py @@ -0,0 +1,174 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: organizations_devices_availabilities_change_history_info +short_description: Information module for organizations _devices _availabilities _changehistory +description: +- Get all organizations _devices _availabilities _changehistory. +- List the availability history information for devices in an organization. +version_added: '2.18.0' +extends_documentation_fragment: + - cisco.meraki.module_info + - cisco.meraki.module_info_pagination +author: Francisco Munoz (@fmunoz) +options: + headers: + description: Additional headers. + type: dict + organizationId: + description: + - OrganizationId path parameter. Organization ID. + type: str + perPage: + description: + - PerPage query parameter. The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. + type: int + startingAfter: + description: + - > + StartingAfter query parameter. A token used by the server to indicate the start of the page. Often this is a + timestamp or an ID but it is not limited to those. This parameter should not be defined by client + applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + type: str + endingBefore: + description: + - > + EndingBefore query parameter. A token used by the server to indicate the end of the page. Often this is a + timestamp or an ID but it is not limited to those. This parameter should not be defined by client + applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + type: str + t0: + description: + - T0 query parameter. The beginning of the timespan for the data. The maximum lookback period is 31 days from today. + type: str + t1: + description: + - T1 query parameter. The end of the timespan for the data. T1 can be a maximum of 31 days after t0. + type: str + timespan: + description: + - > + Timespan query parameter. The timespan for which the information will be fetched. If specifying timespan, do + not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 31 days. The + default is 1 day. + type: float + serials: + description: + - Serials query parameter. Optional parameter to filter device availabilities history by device serial numbers. + elements: str + type: list + productTypes: + description: + - ProductTypes query parameter. Optional parameter to filter device availabilities history by device product types. + elements: str + type: list + networkIds: + description: + - NetworkIds query parameter. Optional parameter to filter device availabilities history by network IDs. + elements: str + type: list + statuses: + description: + - Statuses query parameter. Optional parameter to filter device availabilities history by device statuses. + elements: str + type: list +requirements: +- meraki >= 2.4.9 +- python >= 3.5 +seealso: +- name: Cisco Meraki documentation for organizations getOrganizationDevicesAvailabilitiesChangeHistory + description: Complete reference of the getOrganizationDevicesAvailabilitiesChangeHistory API. + link: https://developer.cisco.com/meraki/api-v1/#!get-organization-devices-availabilities-change-history +notes: + - SDK Method used are + organizations.Organizations.get_organization_devices_availabilities_change_history, + + - Paths used are + get /organizations/{organizationId}/devices/availabilities/changeHistory, +""" + +EXAMPLES = r""" +- name: Get all organizations _devices _availabilities _changehistory + cisco.meraki.organizations_devices_availabilities_change_history_info: + meraki_api_key: "{{meraki_api_key}}" + meraki_base_url: "{{meraki_base_url}}" + meraki_single_request_timeout: "{{meraki_single_request_timeout}}" + meraki_certificate_path: "{{meraki_certificate_path}}" + meraki_requests_proxy: "{{meraki_requests_proxy}}" + meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" + meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" + meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" + meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" + meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" + meraki_maximum_retries: "{{meraki_maximum_retries}}" + meraki_output_log: "{{meraki_output_log}}" + meraki_log_file_prefix: "{{meraki_log_file_prefix}}" + meraki_log_path: "{{meraki_log_path}}" + meraki_print_console: "{{meraki_print_console}}" + meraki_suppress_logging: "{{meraki_suppress_logging}}" + meraki_simulate: "{{meraki_simulate}}" + meraki_be_geo_id: "{{meraki_be_geo_id}}" + meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" + meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" + perPage: 0 + startingAfter: string + endingBefore: string + t0: string + t1: string + timespan: 0 + serials: [] + productTypes: [] + networkIds: [] + statuses: [] + organizationId: string + total_pages: -1 + direction: next + register: result + +""" +RETURN = r""" +meraki_response: + description: A dictionary or list with the response returned by the Cisco Meraki Python SDK + returned: always + type: list + elements: dict + sample: > + [ + { + "details": { + "new": [ + { + "name": "string", + "value": "string" + } + ], + "old": [ + { + "name": "string", + "value": "string" + } + ] + }, + "device": { + "model": "string", + "name": "string", + "productType": "string", + "serial": "string" + }, + "network": { + "id": "string", + "name": "string", + "tags": [ + "string" + ], + "url": "string" + }, + "ts": "string" + } + ] +""" diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_devices_boots_history_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_devices_boots_history_info.py new file mode 100644 index 000000000..3a5530741 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_devices_boots_history_info.py @@ -0,0 +1,149 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: organizations_devices_boots_history_info +short_description: Information module for organizations _devices _boots _history +description: +- Get all organizations _devices _boots _history. +- > + Returns the history of device boots in reverse chronological order most recent first. Currently supported for MS + devices only. +version_added: '2.18.0' +extends_documentation_fragment: + - cisco.meraki.module_info + - cisco.meraki.module_info_pagination +author: Francisco Munoz (@fmunoz) +options: + headers: + description: Additional headers. + type: dict + organizationId: + description: + - OrganizationId path parameter. Organization ID. + type: str + t0: + description: + - T0 query parameter. The beginning of the timespan for the data. + type: str + t1: + description: + - T1 query parameter. The end of the timespan for the data. T1 can be a maximum of 730 days after t0. + type: str + timespan: + description: + - > + Timespan query parameter. The timespan for which the information will be fetched. If specifying timespan, do + not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 730 days. + type: float + serials: + description: + - > + Serials query parameter. Optional parameter to filter device by device serial numbers. This filter uses + multiple exact matches. + elements: str + type: list + mostRecentPerDevice: + description: + - MostRecentPerDevice query parameter. If true, only the most recent boot for each device is returned. + type: bool + perPage: + description: + - PerPage query parameter. The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. + type: int + startingAfter: + description: + - > + StartingAfter query parameter. A token used by the server to indicate the start of the page. Often this is a + timestamp or an ID but it is not limited to those. This parameter should not be defined by client + applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + type: str + endingBefore: + description: + - > + EndingBefore query parameter. A token used by the server to indicate the end of the page. Often this is a + timestamp or an ID but it is not limited to those. This parameter should not be defined by client + applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + type: str + sortOrder: + description: + - > + SortOrder query parameter. Sorted order of entries. Order options are 'ascending' and 'descending'. Default + is 'descending'. + type: str +requirements: +- meraki >= 2.4.9 +- python >= 3.5 +seealso: +- name: Cisco Meraki documentation for organizations getOrganizationDevicesBootsHistory + description: Complete reference of the getOrganizationDevicesBootsHistory API. + link: https://developer.cisco.com/meraki/api-v1/#!get-organization-devices-boots-history +notes: + - SDK Method used are + organizations.Organizations.get_organization_devices_boots_history, + + - Paths used are + get /organizations/{organizationId}/devices/boots/history, +""" + +EXAMPLES = r""" +- name: Get all organizations _devices _boots _history + cisco.meraki.organizations_devices_boots_history_info: + meraki_api_key: "{{meraki_api_key}}" + meraki_base_url: "{{meraki_base_url}}" + meraki_single_request_timeout: "{{meraki_single_request_timeout}}" + meraki_certificate_path: "{{meraki_certificate_path}}" + meraki_requests_proxy: "{{meraki_requests_proxy}}" + meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" + meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" + meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" + meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" + meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" + meraki_maximum_retries: "{{meraki_maximum_retries}}" + meraki_output_log: "{{meraki_output_log}}" + meraki_log_file_prefix: "{{meraki_log_file_prefix}}" + meraki_log_path: "{{meraki_log_path}}" + meraki_print_console: "{{meraki_print_console}}" + meraki_suppress_logging: "{{meraki_suppress_logging}}" + meraki_simulate: "{{meraki_simulate}}" + meraki_be_geo_id: "{{meraki_be_geo_id}}" + meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" + meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" + t0: string + t1: string + timespan: 0 + serials: [] + mostRecentPerDevice: True + perPage: 0 + startingAfter: string + endingBefore: string + sortOrder: string + organizationId: string + total_pages: -1 + direction: next + register: result + +""" +RETURN = r""" +meraki_response: + description: A dictionary or list with the response returned by the Cisco Meraki Python SDK + returned: always + type: list + elements: dict + sample: > + [ + { + "network": { + "id": "string" + }, + "serial": "string", + "start": { + "bootedAt": "string" + } + } + ] +""" diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_devices_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_devices_info.py index ea91eff27..ecfd3310f 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_devices_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_devices_info.py @@ -201,21 +201,28 @@ meraki_response: sample: > [ { - "name": "string", + "address": "string", + "details": [ + { + "name": "string", + "value": "string" + } + ], + "firmware": "string", + "imei": "string", + "lanIp": "string", "lat": 0, "lng": 0, - "address": "string", + "mac": "string", + "model": "string", + "name": "string", + "networkId": "string", "notes": "string", + "productType": "string", + "serial": "string", "tags": [ "string" - ], - "networkId": "string", - "serial": "string", - "model": "string", - "mac": "string", - "lanIp": "string", - "firmware": "string", - "productType": "string" + ] } ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_devices_power_modules_statuses_by_device_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_devices_power_modules_statuses_by_device_info.py index ea3eeaf79..ff092b120 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_devices_power_modules_statuses_by_device_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_devices_power_modules_statuses_by_device_info.py @@ -11,8 +11,8 @@ short_description: Information module for organizations _devices _powermodules _ description: - Get all organizations _devices _powermodules _statuses _bydevice. - > - List the power status information for devices in an organization. The data returned by this endpoint is updated - every 5 minutes. + List the most recent status information for power modules in rackmount MX and MS devices that support them. The + data returned by this endpoint is updated every 5 minutes. version_added: '2.16.0' extends_documentation_fragment: - cisco.meraki.module_info @@ -148,16 +148,16 @@ meraki_response: }, "productType": "string", "serial": "string", - "tags": [ - "string" - ], "slots": [ { + "model": "string", "number": 0, "serial": "string", - "model": "string", "status": "string" } + ], + "tags": [ + "string" ] } ] diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_devices_statuses_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_devices_statuses_info.py index 535d692b1..62584e39f 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_devices_statuses_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_devices_statuses_info.py @@ -143,30 +143,42 @@ RETURN = r""" meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always - type: dict + type: list + elements: dict sample: > - { - "name": "string", - "serial": "string", - "mac": "string", - "publicIp": "string", - "networkId": "string", - "status": "string", - "lastReportedAt": "string", - "lanIp": "string", - "gateway": "string", - "ipType": "string", - "primaryDns": "string", - "secondaryDns": "string", - "productType": "string", - "components": { - "powerSupplies": [ + [ + { + "components": { + "powerSupplies": [ + { + "model": "string", + "poe": { + "maximum": 0, + "unit": "string" + }, + "serial": "string", + "slot": 0, + "status": "string" + } + ] + }, + "gateway": "string", + "ipType": "string", + "lanIp": "string", + "lastReportedAt": "string", + "mac": "string", + "model": "string", + "name": "string", + "networkId": "string", + "primaryDns": "string", + "productType": "string", + "publicIp": "string", + "secondaryDns": "string", + "serial": "string", + "status": "string", + "tags": [ "string" ] - }, - "model": "string", - "tags": [ - "string" - ] - } + } + ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_devices_statuses_overview_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_devices_statuses_overview_info.py index 2ba8069d6..f7ad0ce56 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_devices_statuses_overview_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_devices_statuses_overview_info.py @@ -87,10 +87,10 @@ meraki_response: sample: > { "byStatus": { - "online": 0, "alerting": 0, + "dormant": 0, "offline": 0, - "dormant": 0 + "online": 0 } } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_devices_uplinks_addresses_by_device_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_devices_uplinks_addresses_by_device_info.py index b29c6a345..eb8b99d0a 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_devices_uplinks_addresses_by_device_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_devices_uplinks_addresses_by_device_info.py @@ -151,18 +151,18 @@ meraki_response: ], "uplinks": [ { - "interface": "string", "addresses": [ { - "protocol": "string", - "assignmentMode": "string", "address": "string", + "assignmentMode": "string", "gateway": "string", + "protocol": "string", "public": { "address": "string" } } - ] + ], + "interface": "string" } ] } diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_devices_uplinks_loss_and_latency_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_devices_uplinks_loss_and_latency_info.py index ee4226017..85b5b8b4a 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_devices_uplinks_loss_and_latency_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_devices_uplinks_loss_and_latency_info.py @@ -43,8 +43,8 @@ options: uplink: description: - > - Uplink query parameter. Optional filter for a specific WAN uplink. Valid uplinks are wan1, wan2, cellular. - Default will return all uplinks. + Uplink query parameter. Optional filter for a specific WAN uplink. Valid uplinks are wan1, wan2, wan3, + cellular. Default will return all uplinks. type: str ip: description: @@ -106,17 +106,17 @@ meraki_response: sample: > [ { + "ip": "string", "networkId": "string", "serial": "string", - "uplink": "string", - "ip": "string", "timeSeries": [ { - "ts": "string", + "latencyMs": 0, "lossPercent": 0, - "latencyMs": 0 + "ts": "string" } - ] + ], + "uplink": "string" } ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_early_access_features_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_early_access_features_info.py index 12f704ef6..ba2620508 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_early_access_features_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_early_access_features_info.py @@ -74,16 +74,16 @@ meraki_response: sample: > [ { - "shortName": "string", - "name": "string", "descriptions": { - "short": "string", - "long": "string" + "long": "string", + "short": "string" }, - "topic": "string", - "isOrgScopedOnly": true, "documentationLink": "string", - "supportLink": "string" + "isOrgScopedOnly": true, + "name": "string", + "shortName": "string", + "supportLink": "string", + "topic": "string" } ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_early_access_features_opt_ins.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_early_access_features_opt_ins.py index cc2b37c20..c0fb0ea9d 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_early_access_features_opt_ins.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_early_access_features_opt_ins.py @@ -85,7 +85,7 @@ EXAMPLES = r""" organizationId: string shortName: has_magnetic_beta -- name: Update by id +- name: Delete by id cisco.meraki.organizations_early_access_features_opt_ins: meraki_api_key: "{{meraki_api_key}}" meraki_base_url: "{{meraki_base_url}}" @@ -107,13 +107,11 @@ EXAMPLES = r""" meraki_be_geo_id: "{{meraki_be_geo_id}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: present - limitScopeToNetworks: - - N_12345 + state: absent optInId: string organizationId: string -- name: Delete by id +- name: Update by id cisco.meraki.organizations_early_access_features_opt_ins: meraki_api_key: "{{meraki_api_key}}" meraki_base_url: "{{meraki_base_url}}" @@ -135,7 +133,9 @@ EXAMPLES = r""" meraki_be_geo_id: "{{meraki_be_geo_id}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: absent + state: present + limitScopeToNetworks: + - N_12345 optInId: string organizationId: string @@ -146,5 +146,15 @@ meraki_response: returned: always type: dict sample: > - {} + { + "createdAt": "string", + "id": "string", + "limitScopeToNetworks": [ + { + "id": "string", + "name": "string" + } + ], + "shortName": "string" + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_early_access_features_opt_ins_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_early_access_features_opt_ins_info.py index 46fa222bd..794ee8bfe 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_early_access_features_opt_ins_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_early_access_features_opt_ins_info.py @@ -106,10 +106,17 @@ RETURN = r""" meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always - type: list - elements: dict + type: dict sample: > - [ - {} - ] + { + "createdAt": "string", + "id": "string", + "limitScopeToNetworks": [ + { + "id": "string", + "name": "string" + } + ], + "shortName": "string" + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_firmware_upgrades_by_device_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_firmware_upgrades_by_device_info.py index 72755428d..0cafbcdbd 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_firmware_upgrades_by_device_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_firmware_upgrades_by_device_info.py @@ -10,7 +10,7 @@ module: organizations_firmware_upgrades_by_device_info short_description: Information module for organizations _firmware _upgrades _bydevice description: - Get all organizations _firmware _upgrades _bydevice. -- Get firmware upgrade status for the filtered devices. +- Get firmware upgrade status for the filtered devices. This endpoint currently only supports Meraki switches. version_added: '2.16.0' extends_documentation_fragment: - cisco.meraki.module_info @@ -26,7 +26,7 @@ options: type: str perPage: description: - - PerPage query parameter. The number of entries per page returned. Acceptable range is 3 - 50. Default is 50. + - PerPage query parameter. The number of entries per page returned. Acceptable range is 3 - 1000. Default is 50. type: int startingAfter: description: @@ -61,14 +61,14 @@ options: devices returned belong to MAC addresses that are an exact match. elements: str type: list - firmwareUpgradeIds: + firmwareUpgradeBatchIds: description: - - FirmwareUpgradeIds query parameter. Optional parameter to filter by firmware upgrade ids. + - FirmwareUpgradeBatchIds query parameter. Optional parameter to filter by firmware upgrade batch ids. elements: str type: list - firmwareUpgradeBatchIds: + upgradeStatuses: description: - - FirmwareUpgradeBatchIds query parameter. Optional parameter to filter by firmware upgrade batch ids. + - UpgradeStatuses query parameter. Optional parameter to filter by firmware upgrade statuses. elements: str type: list requirements: @@ -115,8 +115,8 @@ EXAMPLES = r""" networkIds: [] serials: [] macs: [] - firmwareUpgradeIds: [] firmwareUpgradeBatchIds: [] + upgradeStatuses: [] organizationId: string total_pages: -1 direction: next @@ -132,31 +132,31 @@ meraki_response: sample: > [ { - "serial": "string", - "name": "string", "deviceStatus": "string", + "name": "string", + "serial": "string", "upgrade": { - "time": "string", "fromVersion": { "id": "string", - "shortName": "string", + "releaseDate": "string", "releaseType": "string", - "releaseDate": "string" + "shortName": "string" }, - "toVersion": { - "id": "string", - "shortName": "string", - "releaseType": "string", - "releaseDate": "string" - }, - "status": "string", "id": "string", - "upgradeBatchId": "string", "staged": { "group": { "id": "string" } - } + }, + "status": "string", + "time": "string", + "toVersion": { + "id": "string", + "releaseDate": "string", + "releaseType": "string", + "shortName": "string" + }, + "upgradeBatchId": "string" } } ] diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_firmware_upgrades_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_firmware_upgrades_info.py index 0179aaf68..a907f20ed 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_firmware_upgrades_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_firmware_upgrades_info.py @@ -14,6 +14,7 @@ description: version_added: '2.16.0' extends_documentation_fragment: - cisco.meraki.module_info + - cisco.meraki.module_info_pagination author: Francisco Munoz (@fmunoz) options: headers: @@ -23,14 +24,32 @@ options: description: - OrganizationId path parameter. Organization ID. type: str + perPage: + description: + - PerPage query parameter. The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. + type: int + startingAfter: + description: + - > + StartingAfter query parameter. A token used by the server to indicate the start of the page. Often this is a + timestamp or an ID but it is not limited to those. This parameter should not be defined by client + applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + type: str + endingBefore: + description: + - > + EndingBefore query parameter. A token used by the server to indicate the end of the page. Often this is a + timestamp or an ID but it is not limited to those. This parameter should not be defined by client + applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + type: str status: description: - - Status query parameter. The status of an upgrade. + - Status query parameter. Optional parameter to filter the upgrade by status. elements: str type: list - productType: + productTypes: description: - - ProductType query parameter. The product type in a given upgrade ID. + - ProductTypes query parameter. Optional parameter to filter the upgrade by product type. elements: str type: list requirements: @@ -71,9 +90,14 @@ EXAMPLES = r""" meraki_be_geo_id: "{{meraki_be_geo_id}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" + perPage: 0 + startingAfter: string + endingBefore: string status: [] - productType: [] + productTypes: [] organizationId: string + total_pages: -1 + direction: next register: result """ @@ -86,28 +110,30 @@ meraki_response: sample: > [ { - "upgradeId": "string", - "upgradeBatchId": "string", + "completedAt": "string", + "fromVersion": { + "firmware": "string", + "id": "string", + "releaseDate": "string", + "releaseType": "string", + "shortName": "string" + }, "network": { "id": "string", "name": "string" }, + "productTypes": "string", "status": "string", "time": "string", - "completedAt": "string", - "productType": "string", "toVersion": { + "firmware": "string", "id": "string", - "shortName": "string", + "releaseDate": "string", "releaseType": "string", - "releaseDate": "string" + "shortName": "string" }, - "fromVersion": { - "id": "string", - "shortName": "string", - "releaseType": "string", - "releaseDate": "string" - } + "upgradeBatchId": "string", + "upgradeId": "string" } ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_info.py index d42e2bc0a..78abad577 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_info.py @@ -16,11 +16,30 @@ description: version_added: '2.16.0' extends_documentation_fragment: - cisco.meraki.module_info + - cisco.meraki.module_info_pagination author: Francisco Munoz (@fmunoz) options: headers: description: Additional headers. type: dict + perPage: + description: + - PerPage query parameter. The number of entries per page returned. Acceptable range is 3 - 9000. Default is 9000. + type: int + startingAfter: + description: + - > + StartingAfter query parameter. A token used by the server to indicate the start of the page. Often this is a + timestamp or an ID but it is not limited to those. This parameter should not be defined by client + applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + type: str + endingBefore: + description: + - > + EndingBefore query parameter. A token used by the server to indicate the end of the page. Often this is a + timestamp or an ID but it is not limited to those. This parameter should not be defined by client + applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + type: str organizationId: description: - OrganizationId path parameter. Organization ID. @@ -68,6 +87,11 @@ EXAMPLES = r""" meraki_be_geo_id: "{{meraki_be_geo_id}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" + perPage: 0 + startingAfter: string + endingBefore: string + total_pages: -1 + direction: next register: result - name: Get organizations by id @@ -103,20 +127,18 @@ meraki_response: type: dict sample: > { - "id": "string", - "name": "string", - "url": "string", "api": { "enabled": true }, - "licensing": { - "model": "string" - }, "cloud": { "region": { "name": "string" } }, + "id": "string", + "licensing": { + "model": "string" + }, "management": { "details": [ { @@ -124,6 +146,8 @@ meraki_response: "value": "string" } ] - } + }, + "name": "string", + "url": "string" } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_insight_applications_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_insight_applications_info.py index e3afc1e48..cd103e37c 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_insight_applications_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_insight_applications_info.py @@ -77,14 +77,14 @@ meraki_response: "applicationId": "string", "name": "string", "thresholds": { - "type": "string", "byNetwork": [ { - "networkId": "string", "goodput": 0, + "networkId": "string", "responseDuration": 0 } - ] + ], + "type": "string" } } ] diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_insight_monitored_media_servers.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_insight_monitored_media_servers.py index afc622fdf..e51ec7eae 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_insight_monitored_media_servers.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_insight_monitored_media_servers.py @@ -88,7 +88,7 @@ EXAMPLES = r""" name: Sample VoIP Provider organizationId: string -- name: Update by id +- name: Delete by id cisco.meraki.organizations_insight_monitored_media_servers: meraki_api_key: "{{meraki_api_key}}" meraki_base_url: "{{meraki_base_url}}" @@ -110,14 +110,11 @@ EXAMPLES = r""" meraki_be_geo_id: "{{meraki_be_geo_id}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: present - address: 123.123.123.1 - bestEffortMonitoringEnabled: true + state: absent monitoredMediaServerId: string - name: Sample VoIP Provider organizationId: string -- name: Delete by id +- name: Update by id cisco.meraki.organizations_insight_monitored_media_servers: meraki_api_key: "{{meraki_api_key}}" meraki_base_url: "{{meraki_base_url}}" @@ -139,8 +136,11 @@ EXAMPLES = r""" meraki_be_geo_id: "{{meraki_be_geo_id}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: absent + state: present + address: 123.123.123.1 + bestEffortMonitoringEnabled: true monitoredMediaServerId: string + name: Sample VoIP Provider organizationId: string """ @@ -150,5 +150,10 @@ meraki_response: returned: always type: dict sample: > - {} + { + "address": "string", + "bestEffortMonitoringEnabled": true, + "id": "string", + "name": "string" + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_insight_monitored_media_servers_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_insight_monitored_media_servers_info.py index bc6bc218f..1ac62c255 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_insight_monitored_media_servers_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_insight_monitored_media_servers_info.py @@ -106,15 +106,12 @@ RETURN = r""" meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always - type: list - elements: dict + type: dict sample: > - [ - { - "id": "string", - "name": "string", - "address": "string", - "bestEffortMonitoringEnabled": true - } - ] + { + "address": "string", + "bestEffortMonitoringEnabled": true, + "id": "string", + "name": "string" + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_inventory_claim.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_inventory_claim.py index 93e5c7ee1..fb963470b 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_inventory_claim.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_inventory_claim.py @@ -13,8 +13,8 @@ description: - > Claim a list of devices, licenses, and/or orders into an organization inventory. When claiming by order, all devices and licenses in the order will be claimed; licenses will be added to the organization and devices will be - placed in the organization's inventory. Use /organizations/{organizationId}/inventory/release to release devices - from an organization. + placed in the organization's inventory. This operation can be used up to ten times within a single five minute + window. version_added: '2.16.0' extends_documentation_fragment: - cisco.meraki.module @@ -100,5 +100,18 @@ meraki_response: returned: always type: dict sample: > - {} + { + "licenses": [ + { + "key": "string", + "mode": "string" + } + ], + "orders": [ + "string" + ], + "serials": [ + "string" + ] + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_inventory_devices_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_inventory_devices_info.py index 9a589ab56..aab15ba41 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_inventory_devices_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_inventory_devices_info.py @@ -59,7 +59,9 @@ options: type: list networkIds: description: - - NetworkIds query parameter. Search for devices in inventory based on network ids. + - > + NetworkIds query parameter. Search for devices in inventory based on network ids. Use explicit 'null' value + to get available devices only. elements: str type: list serials: @@ -196,17 +198,24 @@ meraki_response: type: dict sample: > { + "claimedAt": "string", + "countryCode": "string", + "details": [ + { + "name": "string", + "value": "string" + } + ], + "licenseExpirationDate": "string", "mac": "string", - "serial": "string", - "name": "string", "model": "string", + "name": "string", "networkId": "string", "orderNumber": "string", - "claimedAt": "string", - "licenseExpirationDate": "string", + "productType": "string", + "serial": "string", "tags": [ "string" - ], - "productType": "string" + ] } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_inventory_onboarding_cloud_monitoring_imports.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_inventory_onboarding_cloud_monitoring_imports.py index 21f5c9770..17d490ebd 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_inventory_onboarding_cloud_monitoring_imports.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_inventory_onboarding_cloud_monitoring_imports.py @@ -87,9 +87,9 @@ meraki_response: sample: > [ { - "status": "string", "importId": "string", - "message": "string" + "message": "string", + "status": "string" } ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_inventory_onboarding_cloud_monitoring_imports_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_inventory_onboarding_cloud_monitoring_imports_info.py index c6e3cbbd7..685c1b9ab 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_inventory_onboarding_cloud_monitoring_imports_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_inventory_onboarding_cloud_monitoring_imports_info.py @@ -80,12 +80,12 @@ meraki_response: sample: > [ { - "importId": "string", "device": { - "url": "string", "created": true, - "status": "string" - } + "status": "string", + "url": "string" + }, + "importId": "string" } ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_inventory_onboarding_cloud_monitoring_networks_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_inventory_onboarding_cloud_monitoring_networks_info.py index daf4a9029..726ce2e2f 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_inventory_onboarding_cloud_monitoring_networks_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_inventory_onboarding_cloud_monitoring_networks_info.py @@ -28,6 +28,10 @@ options: description: - DeviceType query parameter. Device Type switch or wireless controller. type: str + search: + description: + - Search query parameter. Optional parameter to search on network name. + type: str perPage: description: - PerPage query parameter. The number of entries per page returned. Acceptable range is 3 - 100000. Default is 1000. @@ -85,6 +89,7 @@ EXAMPLES = r""" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" deviceType: string + search: string perPage: 0 startingAfter: string endingBefore: string @@ -103,20 +108,20 @@ meraki_response: sample: > [ { + "enrollmentString": "string", "id": "string", - "organizationId": "string", + "isBoundToConfigTemplate": true, "name": "string", + "notes": "string", + "organizationId": "string", "productTypes": [ "string" ], - "timeZone": "string", "tags": [ "string" ], - "enrollmentString": "string", - "url": "string", - "notes": "string", - "isBoundToConfigTemplate": true + "timeZone": "string", + "url": "string" } ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_inventory_onboarding_cloud_monitoring_prepare.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_inventory_onboarding_cloud_monitoring_prepare.py index d49e9788a..276fe93c3 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_inventory_onboarding_cloud_monitoring_prepare.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_inventory_onboarding_cloud_monitoring_prepare.py @@ -195,30 +195,30 @@ meraki_response: sample: > [ { - "message": "string", - "udi": "string", - "deviceId": "string", - "status": "string", "configParams": { + "cloudStaticIp": "string", "tunnel": { - "mode": "string", - "port": "string", "host": "string", + "mode": "string", "name": "string", + "port": "string", "rootCertificate": { "content": "string", "name": "string" } }, - "cloudStaticIp": "string", "user": { "publicKey": "string", - "username": "string", "secret": { "hash": "string" - } + }, + "username": "string" } - } + }, + "deviceId": "string", + "message": "string", + "status": "string", + "udi": "string" } ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_inventory_release.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_inventory_release.py index d0442ec75..0035ab519 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_inventory_release.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_inventory_release.py @@ -72,5 +72,9 @@ meraki_response: returned: always type: dict sample: > - {} + { + "serials": [ + "string" + ] + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_licenses.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_licenses.py index 89a0bd1db..425b58291 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_licenses.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_licenses.py @@ -78,28 +78,28 @@ meraki_response: type: dict sample: > { + "activationDate": "string", + "claimDate": "string", + "deviceSerial": "string", + "durationInDays": 0, + "expirationDate": "string", + "headLicenseId": "string", "id": "string", - "licenseType": "string", "licenseKey": "string", - "orderNumber": "string", - "deviceSerial": "string", + "licenseType": "string", "networkId": "string", - "state": "string", - "seatCount": 0, - "totalDurationInDays": 0, - "durationInDays": 0, + "orderNumber": "string", "permanentlyQueuedLicenses": [ { + "durationInDays": 0, "id": "string", - "licenseType": "string", "licenseKey": "string", - "orderNumber": "string", - "durationInDays": 0 + "licenseType": "string", + "orderNumber": "string" } ], - "claimDate": "string", - "activationDate": "string", - "expirationDate": "string", - "headLicenseId": "string" + "seatCount": 0, + "state": "string", + "totalDurationInDays": 0 } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_licenses_assign_seats.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_licenses_assign_seats.py index 2306e020a..2b9b8a6b5 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_licenses_assign_seats.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_licenses_assign_seats.py @@ -82,29 +82,29 @@ meraki_response: { "resultingLicenses": [ { + "activationDate": "string", + "claimDate": "string", + "deviceSerial": "string", + "durationInDays": 0, + "expirationDate": "string", + "headLicenseId": "string", "id": "string", - "licenseType": "string", "licenseKey": "string", - "orderNumber": "string", - "deviceSerial": "string", + "licenseType": "string", "networkId": "string", - "state": "string", - "seatCount": 0, - "totalDurationInDays": 0, - "durationInDays": 0, + "orderNumber": "string", "permanentlyQueuedLicenses": [ { + "durationInDays": 0, "id": "string", - "licenseType": "string", "licenseKey": "string", - "orderNumber": "string", - "durationInDays": 0 + "licenseType": "string", + "orderNumber": "string" } ], - "claimDate": "string", - "activationDate": "string", - "expirationDate": "string", - "headLicenseId": "string" + "seatCount": 0, + "state": "string", + "totalDurationInDays": 0 } ] } diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_licenses_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_licenses_info.py index 767d34d5a..9fc09b597 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_licenses_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_licenses_info.py @@ -77,28 +77,28 @@ meraki_response: type: dict sample: > { + "activationDate": "string", + "claimDate": "string", + "deviceSerial": "string", + "durationInDays": 0, + "expirationDate": "string", + "headLicenseId": "string", "id": "string", - "licenseType": "string", "licenseKey": "string", - "orderNumber": "string", - "deviceSerial": "string", + "licenseType": "string", "networkId": "string", - "state": "string", - "seatCount": 0, - "totalDurationInDays": 0, - "durationInDays": 0, + "orderNumber": "string", "permanentlyQueuedLicenses": [ { + "durationInDays": 0, "id": "string", - "licenseType": "string", "licenseKey": "string", - "orderNumber": "string", - "durationInDays": 0 + "licenseType": "string", + "orderNumber": "string" } ], - "claimDate": "string", - "activationDate": "string", - "expirationDate": "string", - "headLicenseId": "string" + "seatCount": 0, + "state": "string", + "totalDurationInDays": 0 } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_licenses_overview_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_licenses_overview_info.py index f10a0a179..fc934e71f 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_licenses_overview_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_licenses_overview_info.py @@ -70,6 +70,63 @@ meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always type: dict - sample: - - {} + sample: > + { + "expirationDate": "string", + "licenseCount": 0, + "licenseTypes": [ + { + "counts": { + "unassigned": 0 + }, + "licenseType": "string" + } + ], + "licensedDeviceCounts": {}, + "states": { + "active": { + "count": 0 + }, + "expired": { + "count": 0 + }, + "expiring": { + "count": 0, + "critical": { + "expiringCount": 0, + "thresholdInDays": 0 + }, + "warning": { + "expiringCount": 0, + "thresholdInDays": 0 + } + }, + "recentlyQueued": { + "count": 0 + }, + "unused": { + "count": 0, + "soonestActivation": { + "activationDate": "string", + "toActivateCount": 0 + } + }, + "unusedActive": { + "count": 0, + "oldestActivation": { + "activationDate": "string", + "activeCount": 0 + } + } + }, + "status": "string", + "systemsManager": { + "counts": { + "activeSeats": 0, + "orgwideEnrolledDevices": 0, + "totalSeats": 0, + "unassignedSeats": 0 + } + } + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_licenses_renew_seats.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_licenses_renew_seats.py index 7cc5c95a5..34ebda60b 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_licenses_renew_seats.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_licenses_renew_seats.py @@ -81,29 +81,29 @@ meraki_response: { "resultingLicenses": [ { + "activationDate": "string", + "claimDate": "string", + "deviceSerial": "string", + "durationInDays": 0, + "expirationDate": "string", + "headLicenseId": "string", "id": "string", - "licenseType": "string", "licenseKey": "string", - "orderNumber": "string", - "deviceSerial": "string", + "licenseType": "string", "networkId": "string", - "state": "string", - "seatCount": 0, - "totalDurationInDays": 0, - "durationInDays": 0, + "orderNumber": "string", "permanentlyQueuedLicenses": [ { + "durationInDays": 0, "id": "string", - "licenseType": "string", "licenseKey": "string", - "orderNumber": "string", - "durationInDays": 0 + "licenseType": "string", + "orderNumber": "string" } ], - "claimDate": "string", - "activationDate": "string", - "expirationDate": "string", - "headLicenseId": "string" + "seatCount": 0, + "state": "string", + "totalDurationInDays": 0 } ] } diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_licensing_coterm_licenses_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_licensing_coterm_licenses_info.py index 30ace84a7..c55da1b53 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_licensing_coterm_licenses_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_licensing_coterm_licenses_info.py @@ -108,27 +108,27 @@ meraki_response: sample: > [ { - "key": "string", - "organizationId": "string", - "duration": 0, - "mode": "string", - "startedAt": "string", "claimedAt": "string", - "invalidated": true, - "invalidatedAt": "string", - "expired": true, + "counts": [ + { + "count": 0, + "model": "string" + } + ], + "duration": 0, "editions": [ { "edition": "string", "productType": "string" } ], - "counts": [ - { - "model": "string", - "count": 0 - } - ] + "expired": true, + "invalidated": true, + "invalidatedAt": "string", + "key": "string", + "mode": "string", + "organizationId": "string", + "startedAt": "string" } ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_licensing_coterm_licenses_move.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_licensing_coterm_licenses_move.py index 4351b761a..224f8bd82 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_licensing_coterm_licenses_move.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_licensing_coterm_licenses_move.py @@ -104,54 +104,54 @@ meraki_response: type: dict sample: > { - "remainderLicenses": [ + "movedLicenses": [ { - "key": "string", - "organizationId": "string", - "duration": 0, - "mode": "string", - "startedAt": "string", "claimedAt": "string", - "invalidated": true, - "invalidatedAt": "string", - "expired": true, + "counts": [ + { + "count": 0, + "model": "string" + } + ], + "duration": 0, "editions": [ { "edition": "string", "productType": "string" } ], - "counts": [ - { - "model": "string", - "count": 0 - } - ] + "expired": true, + "invalidated": true, + "invalidatedAt": "string", + "key": "string", + "mode": "string", + "organizationId": "string", + "startedAt": "string" } ], - "movedLicenses": [ + "remainderLicenses": [ { - "key": "string", - "organizationId": "string", - "duration": 0, - "mode": "string", - "startedAt": "string", "claimedAt": "string", - "invalidated": true, - "invalidatedAt": "string", - "expired": true, + "counts": [ + { + "count": 0, + "model": "string" + } + ], + "duration": 0, "editions": [ { "edition": "string", "productType": "string" } ], - "counts": [ - { - "model": "string", - "count": 0 - } - ] + "expired": true, + "invalidated": true, + "invalidatedAt": "string", + "key": "string", + "mode": "string", + "organizationId": "string", + "startedAt": "string" } ] } diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_login_security.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_login_security.py index 1e4d85137..d240d49f0 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_login_security.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_login_security.py @@ -157,20 +157,7 @@ meraki_response: type: dict sample: > { - "enforcePasswordExpiration": true, - "passwordExpirationDays": 0, - "enforceDifferentPasswords": true, - "numDifferentPasswords": 0, - "enforceStrongPasswords": true, - "enforceAccountLockout": true, "accountLockoutAttempts": 0, - "enforceIdleTimeout": true, - "idleTimeoutMinutes": 0, - "enforceTwoFactorAuth": true, - "enforceLoginIpRanges": true, - "loginIpRanges": [ - "string" - ], "apiAuthentication": { "ipRestrictionsForKeys": { "enabled": true, @@ -178,6 +165,19 @@ meraki_response: "string" ] } - } + }, + "enforceAccountLockout": true, + "enforceDifferentPasswords": true, + "enforceIdleTimeout": true, + "enforceLoginIpRanges": true, + "enforcePasswordExpiration": true, + "enforceStrongPasswords": true, + "enforceTwoFactorAuth": true, + "idleTimeoutMinutes": 0, + "loginIpRanges": [ + "string" + ], + "numDifferentPasswords": 0, + "passwordExpirationDays": 0 } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_login_security_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_login_security_info.py index c9845c74e..63b7f4f3e 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_login_security_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_login_security_info.py @@ -72,20 +72,7 @@ meraki_response: type: dict sample: > { - "enforcePasswordExpiration": true, - "passwordExpirationDays": 0, - "enforceDifferentPasswords": true, - "numDifferentPasswords": 0, - "enforceStrongPasswords": true, - "enforceAccountLockout": true, "accountLockoutAttempts": 0, - "enforceIdleTimeout": true, - "idleTimeoutMinutes": 0, - "enforceTwoFactorAuth": true, - "enforceLoginIpRanges": true, - "loginIpRanges": [ - "string" - ], "apiAuthentication": { "ipRestrictionsForKeys": { "enabled": true, @@ -93,6 +80,19 @@ meraki_response: "string" ] } - } + }, + "enforceAccountLockout": true, + "enforceDifferentPasswords": true, + "enforceIdleTimeout": true, + "enforceLoginIpRanges": true, + "enforcePasswordExpiration": true, + "enforceStrongPasswords": true, + "enforceTwoFactorAuth": true, + "idleTimeoutMinutes": 0, + "loginIpRanges": [ + "string" + ], + "numDifferentPasswords": 0, + "passwordExpirationDays": 0 } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_networks_combine.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_networks_combine.py index 06360f5f5..050a177ed 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_networks_combine.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_networks_combine.py @@ -89,20 +89,20 @@ meraki_response: sample: > { "resultingNetwork": { + "enrollmentString": "string", "id": "string", - "organizationId": "string", + "isBoundToConfigTemplate": true, "name": "string", + "notes": "string", + "organizationId": "string", "productTypes": [ "string" ], - "timeZone": "string", "tags": [ "string" ], - "enrollmentString": "string", - "url": "string", - "notes": "string", - "isBoundToConfigTemplate": true + "timeZone": "string", + "url": "string" } } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_openapi_spec_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_openapi_spec_info.py index 6747690be..7c26f73fe 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_openapi_spec_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_openapi_spec_info.py @@ -10,7 +10,7 @@ module: organizations_openapi_spec_info short_description: Information module for organizations _openapispec description: - Get all organizations _openapispec. -- Return the OpenAPI 2.0 Specification of the organization's API documentation in JSON. +- Return the OpenAPI Specification of the organization's API documentation in JSON. version_added: '2.16.0' extends_documentation_fragment: - cisco.meraki.module_info @@ -23,6 +23,10 @@ options: description: - OrganizationId path parameter. Organization ID. type: str + version: + description: + - Version query parameter. OpenAPI Specification version to return. Default is 2. + type: int requirements: - meraki >= 2.4.9 - python >= 3.5 @@ -61,6 +65,7 @@ EXAMPLES = r""" meraki_be_geo_id: "{{meraki_be_geo_id}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" + version: 0 organizationId: string register: result @@ -70,6 +75,34 @@ meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always type: dict - sample: - - {} + sample: > + { + "info": { + "description": "string", + "title": "string", + "version": "string" + }, + "openapi": "string", + "paths": { + "/organizations": { + "get": { + "description": "string", + "operationId": "string", + "responses": { + "200": { + "description": "string", + "examples": { + "application/json": [ + { + "id": "string", + "name": "string" + } + ] + } + } + } + } + } + } + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_policy_objects.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_policy_objects.py index eeaccf112..05291e269 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_policy_objects.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_policy_objects.py @@ -29,7 +29,7 @@ options: type: str groupIds: description: The IDs of policy object groups the policy object belongs to. - elements: int + elements: str type: list ip: description: IP Address of a policy object (e.g. "1.2.3.4"). @@ -101,12 +101,17 @@ EXAMPLES = r""" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" state: present category: network - groupIds: [] + cidr: 10.0.0.0/24 + fqdn: example.com + groupIds: + - '8' + ip: 1.2.3.4 + mask: 255.255.0.0 name: Web Servers - Datacenter 10 organizationId: string type: cidr -- name: Update by id +- name: Delete by id cisco.meraki.organizations_policy_objects: meraki_api_key: "{{meraki_api_key}}" meraki_base_url: "{{meraki_base_url}}" @@ -128,14 +133,11 @@ EXAMPLES = r""" meraki_be_geo_id: "{{meraki_be_geo_id}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: present - groupIds: [] - name: Web Servers - Datacenter 10 + state: absent organizationId: string policyObjectId: string - type: cidr -- name: Delete by id +- name: Update by id cisco.meraki.organizations_policy_objects: meraki_api_key: "{{meraki_api_key}}" meraki_base_url: "{{meraki_base_url}}" @@ -157,7 +159,14 @@ EXAMPLES = r""" meraki_be_geo_id: "{{meraki_be_geo_id}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: absent + state: present + cidr: 10.0.0.0/24 + fqdn: example.com + groupIds: + - '8' + ip: 1.2.3.4 + mask: 255.255.0.0 + name: Web Servers - Datacenter 10 organizationId: string policyObjectId: string @@ -168,5 +177,19 @@ meraki_response: returned: always type: dict sample: > - {} + { + "category": "string", + "cidr": "string", + "createdAt": "string", + "groupIds": [ + "string" + ], + "id": "string", + "name": "string", + "networkIds": [ + "string" + ], + "type": "string", + "updatedAt": "string" + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_policy_objects_groups.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_policy_objects_groups.py index 34bcc5920..d321d39c3 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_policy_objects_groups.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_policy_objects_groups.py @@ -86,11 +86,13 @@ EXAMPLES = r""" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" state: present + category: NetworkObjectGroup name: Web Servers - Datacenter 10 - objectIds: [] + objectIds: + - 100 organizationId: string -- name: Update by id +- name: Delete by id cisco.meraki.organizations_policy_objects_groups: meraki_api_key: "{{meraki_api_key}}" meraki_base_url: "{{meraki_base_url}}" @@ -112,13 +114,11 @@ EXAMPLES = r""" meraki_be_geo_id: "{{meraki_be_geo_id}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: present - name: Web Servers - Datacenter 10 - objectIds: [] + state: absent organizationId: string policyObjectGroupId: string -- name: Delete by id +- name: Update by id cisco.meraki.organizations_policy_objects_groups: meraki_api_key: "{{meraki_api_key}}" meraki_base_url: "{{meraki_base_url}}" @@ -140,7 +140,10 @@ EXAMPLES = r""" meraki_be_geo_id: "{{meraki_be_geo_id}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: absent + state: present + name: Web Servers - Datacenter 10 + objectIds: + - 100 organizationId: string policyObjectGroupId: string @@ -151,5 +154,17 @@ meraki_response: returned: always type: dict sample: > - {} + { + "category": "string", + "createdAt": "string", + "id": "string", + "name": "string", + "networkIds": [ + "string" + ], + "objectIds": [ + 0 + ], + "updatedAt": "string" + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_policy_objects_groups_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_policy_objects_groups_info.py index e4db45f02..fb29fb628 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_policy_objects_groups_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_policy_objects_groups_info.py @@ -130,10 +130,19 @@ RETURN = r""" meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always - type: list - elements: dict + type: dict sample: > - [ - {} - ] + { + "category": "string", + "createdAt": "string", + "id": "string", + "name": "string", + "networkIds": [ + "string" + ], + "objectIds": [ + 0 + ], + "updatedAt": "string" + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_policy_objects_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_policy_objects_info.py index 0ceccfc31..21aca544a 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_policy_objects_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_policy_objects_info.py @@ -130,10 +130,21 @@ RETURN = r""" meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always - type: list - elements: dict + type: dict sample: > - [ - {} - ] + { + "category": "string", + "cidr": "string", + "createdAt": "string", + "groupIds": [ + "string" + ], + "id": "string", + "name": "string", + "networkIds": [ + "string" + ], + "type": "string", + "updatedAt": "string" + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_saml_idps.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_saml_idps.py index 89152862f..f141154af 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_saml_idps.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_saml_idps.py @@ -84,7 +84,7 @@ EXAMPLES = r""" sloLogoutUrl: https://somewhere.com x509certSha1Fingerprint: 00:11:22:33:44:55:66:77:88:99:00:11:22:33:44:55:66:77:88:99 -- name: Update by id +- name: Delete by id cisco.meraki.organizations_saml_idps: meraki_api_key: "{{meraki_api_key}}" meraki_base_url: "{{meraki_base_url}}" @@ -106,13 +106,11 @@ EXAMPLES = r""" meraki_be_geo_id: "{{meraki_be_geo_id}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: present + state: absent idpId: string organizationId: string - sloLogoutUrl: https://somewhere.com - x509certSha1Fingerprint: 00:11:22:33:44:55:66:77:88:99:00:11:22:33:44:55:66:77:88:99 -- name: Delete by id +- name: Update by id cisco.meraki.organizations_saml_idps: meraki_api_key: "{{meraki_api_key}}" meraki_base_url: "{{meraki_base_url}}" @@ -134,9 +132,11 @@ EXAMPLES = r""" meraki_be_geo_id: "{{meraki_be_geo_id}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: absent + state: present idpId: string organizationId: string + sloLogoutUrl: https://somewhere.com + x509certSha1Fingerprint: 00:11:22:33:44:55:66:77:88:99:00:11:22:33:44:55:66:77:88:99 """ RETURN = r""" @@ -147,10 +147,10 @@ meraki_response: sample: > [ { - "idpId": "string", "consumerUrl": "string", - "x509certSha1Fingerprint": "string", - "sloLogoutUrl": "string" + "idpId": "string", + "sloLogoutUrl": "string", + "x509certSha1Fingerprint": "string" } ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_saml_idps_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_saml_idps_info.py index 4f3ce2af1..8845b0156 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_saml_idps_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_saml_idps_info.py @@ -109,9 +109,9 @@ meraki_response: type: dict sample: > { - "idpId": "string", "consumerUrl": "string", - "x509certSha1Fingerprint": "string", - "sloLogoutUrl": "string" + "idpId": "string", + "sloLogoutUrl": "string", + "x509certSha1Fingerprint": "string" } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_saml_roles.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_saml_roles.py index 77ada3876..c3052a06f 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_saml_roles.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_saml_roles.py @@ -44,7 +44,7 @@ options: description: SamlRoleId path parameter. Saml role ID. type: str tags: - description: The list of tags that the SAML administrator has privleges on. + description: The list of tags that the SAML administrator has privileges on. elements: dict suboptions: access: @@ -114,7 +114,7 @@ EXAMPLES = r""" - access: read-only tag: west -- name: Update by id +- name: Delete by id cisco.meraki.organizations_saml_roles: meraki_api_key: "{{meraki_api_key}}" meraki_base_url: "{{meraki_base_url}}" @@ -136,19 +136,11 @@ EXAMPLES = r""" meraki_be_geo_id: "{{meraki_be_geo_id}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: present - networks: - - access: full - id: N_24329156 - orgAccess: none + state: absent organizationId: string - role: myrole samlRoleId: string - tags: - - access: read-only - tag: west -- name: Delete by id +- name: Update by id cisco.meraki.organizations_saml_roles: meraki_api_key: "{{meraki_api_key}}" meraki_base_url: "{{meraki_base_url}}" @@ -170,9 +162,17 @@ EXAMPLES = r""" meraki_be_geo_id: "{{meraki_be_geo_id}}" meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" - state: absent + state: present + networks: + - access: full + id: N_24329156 + orgAccess: none organizationId: string + role: myrole samlRoleId: string + tags: + - access: read-only + tag: west """ RETURN = r""" @@ -182,19 +182,25 @@ meraki_response: type: dict sample: > { + "camera": [ + { + "access": "string", + "orgWide": true + } + ], "id": "string", - "role": "string", - "orgAccess": "string", "networks": [ { - "id": "string", - "access": "string" + "access": "string", + "id": "string" } ], + "orgAccess": "string", + "role": "string", "tags": [ { - "tag": "string", - "access": "string" + "access": "string", + "tag": "string" } ] } diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_saml_roles_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_saml_roles_info.py index 35bcd5bc2..b7748bee7 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_saml_roles_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_saml_roles_info.py @@ -106,10 +106,29 @@ RETURN = r""" meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always - type: list - elements: dict + type: dict sample: > - [ - {} - ] + { + "camera": [ + { + "access": "string", + "orgWide": true + } + ], + "id": "string", + "networks": [ + { + "access": "string", + "id": "string" + } + ], + "orgAccess": "string", + "role": "string", + "tags": [ + { + "access": "string", + "tag": "string" + } + ] + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_sensor_readings_history_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_sensor_readings_history_info.py index c27a764e1..1f0853dde 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_sensor_readings_history_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_sensor_readings_history_info.py @@ -73,8 +73,9 @@ options: description: - > Metrics query parameter. Types of sensor readings to retrieve. If no metrics are supplied, all available - types of readings will be retrieved. Allowed values are battery, button, door, humidity, indoorAirQuality, - noise, pm25, temperature, tvoc, and water. + types of readings will be retrieved. Allowed values are apparentPower, battery, button, co2, current, door, + downstreamPower, frequency, humidity, indoorAirQuality, noise, pm25, powerFactor, realPower, + remoteLockoutSwitch, temperature, tvoc, voltage, and water. elements: str type: list requirements: @@ -139,28 +140,41 @@ meraki_response: sample: > [ { - "serial": "string", - "network": { - "id": "string", - "name": "string" + "apparentPower": { + "draw": 0 }, - "ts": "string", - "metric": "string", "battery": { "percentage": 0 }, "button": { "pressType": "string" }, + "co2": { + "concentration": 0 + }, + "current": { + "draw": 0 + }, "door": { "open": true }, + "downstreamPower": { + "enabled": true + }, + "frequency": { + "level": 0 + }, "humidity": { "relativePercentage": 0 }, "indoorAirQuality": { "score": 0 }, + "metric": "string", + "network": { + "id": "string", + "name": "string" + }, "noise": { "ambient": { "level": 0 @@ -169,13 +183,27 @@ meraki_response: "pm25": { "concentration": 0 }, + "powerFactor": { + "percentage": 0 + }, + "realPower": { + "draw": 0 + }, + "remoteLockoutSwitch": { + "locked": true + }, + "serial": "string", "temperature": { - "fahrenheit": 0, - "celsius": 0 + "celsius": 0, + "fahrenheit": 0 }, + "ts": "string", "tvoc": { "concentration": 0 }, + "voltage": { + "level": 0 + }, "water": { "present": true } diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_sensor_readings_latest_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_sensor_readings_latest_info.py index 615c3827e..26dfe95f5 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_sensor_readings_latest_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_sensor_readings_latest_info.py @@ -26,7 +26,7 @@ options: type: str perPage: description: - - PerPage query parameter. The number of entries per page returned. Acceptable range is 3 - 100. Default is 100. + - PerPage query parameter. The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. type: int startingAfter: description: @@ -56,8 +56,9 @@ options: description: - > Metrics query parameter. Types of sensor readings to retrieve. If no metrics are supplied, all available - types of readings will be retrieved. Allowed values are battery, button, door, humidity, indoorAirQuality, - noise, pm25, temperature, tvoc, and water. + types of readings will be retrieved. Allowed values are apparentPower, battery, button, co2, current, door, + downstreamPower, frequency, humidity, indoorAirQuality, noise, pm25, powerFactor, realPower, + remoteLockoutSwitch, temperature, tvoc, voltage, and water. elements: str type: list requirements: @@ -119,30 +120,43 @@ meraki_response: sample: > [ { - "serial": "string", "network": { "id": "string", "name": "string" }, "readings": [ { - "ts": "string", - "metric": "string", + "apparentPower": { + "draw": 0 + }, "battery": { "percentage": 0 }, "button": { "pressType": "string" }, + "co2": { + "concentration": 0 + }, + "current": { + "draw": 0 + }, "door": { "open": true }, + "downstreamPower": { + "enabled": true + }, + "frequency": { + "level": 0 + }, "humidity": { "relativePercentage": 0 }, "indoorAirQuality": { "score": 0 }, + "metric": "string", "noise": { "ambient": { "level": 0 @@ -151,18 +165,32 @@ meraki_response: "pm25": { "concentration": 0 }, + "powerFactor": { + "percentage": 0 + }, + "realPower": { + "draw": 0 + }, + "remoteLockoutSwitch": { + "locked": true + }, "temperature": { - "fahrenheit": 0, - "celsius": 0 + "celsius": 0, + "fahrenheit": 0 }, + "ts": "string", "tvoc": { "concentration": 0 }, + "voltage": { + "level": 0 + }, "water": { "present": true } } - ] + ], + "serial": "string" } ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_sm_admins_roles.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_sm_admins_roles.py new file mode 100644 index 000000000..16ce9cd27 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_sm_admins_roles.py @@ -0,0 +1,92 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: organizations_sm_admins_roles +short_description: Resource module for organizations _sm _admins _roles +description: +- Manage operations create, update and delete of the resource organizations _sm _admins _roles. +- Create a Limited Access Role. +version_added: '2.18.0' +extends_documentation_fragment: + - cisco.meraki.module +author: Francisco Munoz (@fmunoz) +options: + name: + description: The name of the Limited Access Role. + type: str + organizationId: + description: OrganizationId path parameter. Organization ID. + type: str + scope: + description: The scope of the Limited Access Role. + type: str + tags: + description: The tags of the Limited Access Role. + elements: str + type: list +requirements: +- meraki >= 2.4.9 +- python >= 3.5 +seealso: +- name: Cisco Meraki documentation for sm createOrganizationSmAdminsRole + description: Complete reference of the createOrganizationSmAdminsRole API. + link: https://developer.cisco.com/meraki/api-v1/#!create-organization-sm-admins-role +notes: + - SDK Method used are + sm.Sm.create_organization_sm_admins_role, + + - Paths used are + post /organizations/{organizationId}/sm/admins/roles, +""" + +EXAMPLES = r""" +- name: Create + cisco.meraki.organizations_sm_admins_roles: + meraki_api_key: "{{meraki_api_key}}" + meraki_base_url: "{{meraki_base_url}}" + meraki_single_request_timeout: "{{meraki_single_request_timeout}}" + meraki_certificate_path: "{{meraki_certificate_path}}" + meraki_requests_proxy: "{{meraki_requests_proxy}}" + meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" + meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" + meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" + meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" + meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" + meraki_maximum_retries: "{{meraki_maximum_retries}}" + meraki_output_log: "{{meraki_output_log}}" + meraki_log_file_prefix: "{{meraki_log_file_prefix}}" + meraki_log_path: "{{meraki_log_path}}" + meraki_print_console: "{{meraki_print_console}}" + meraki_suppress_logging: "{{meraki_suppress_logging}}" + meraki_simulate: "{{meraki_simulate}}" + meraki_be_geo_id: "{{meraki_be_geo_id}}" + meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" + meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" + state: present + name: sample name + organizationId: string + scope: all_tags + tags: + - tag + +""" +RETURN = r""" +meraki_response: + description: A dictionary or list with the response returned by the Cisco Meraki Python SDK + returned: always + type: dict + sample: > + { + "name": "string", + "roleId": "string", + "scope": "string", + "tags": [ + "string" + ] + } +""" diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_sm_admins_roles_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_sm_admins_roles_info.py new file mode 100644 index 000000000..ae7dd20d3 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_sm_admins_roles_info.py @@ -0,0 +1,118 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: organizations_sm_admins_roles_info +short_description: Information module for organizations _sm _admins _roles +description: +- Get all organizations _sm _admins _roles. +- List the Limited Access Roles for an organization. +version_added: '2.18.0' +extends_documentation_fragment: + - cisco.meraki.module_info + - cisco.meraki.module_info_pagination +author: Francisco Munoz (@fmunoz) +options: + headers: + description: Additional headers. + type: dict + organizationId: + description: + - OrganizationId path parameter. Organization ID. + type: str + perPage: + description: + - PerPage query parameter. The number of entries per page returned. Acceptable range is 3 - 1000. Default is 50. + type: int + startingAfter: + description: + - > + StartingAfter query parameter. A token used by the server to indicate the start of the page. Often this is a + timestamp or an ID but it is not limited to those. This parameter should not be defined by client + applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + type: str + endingBefore: + description: + - > + EndingBefore query parameter. A token used by the server to indicate the end of the page. Often this is a + timestamp or an ID but it is not limited to those. This parameter should not be defined by client + applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + type: str +requirements: +- meraki >= 2.4.9 +- python >= 3.5 +seealso: +- name: Cisco Meraki documentation for sm getOrganizationSmAdminsRoles + description: Complete reference of the getOrganizationSmAdminsRoles API. + link: https://developer.cisco.com/meraki/api-v1/#!get-organization-sm-admins-roles +notes: + - SDK Method used are + sm.Sm.get_organization_sm_admins_roles, + + - Paths used are + get /organizations/{organizationId}/sm/admins/roles, +""" + +EXAMPLES = r""" +- name: Get all organizations _sm _admins _roles + cisco.meraki.organizations_sm_admins_roles_info: + meraki_api_key: "{{meraki_api_key}}" + meraki_base_url: "{{meraki_base_url}}" + meraki_single_request_timeout: "{{meraki_single_request_timeout}}" + meraki_certificate_path: "{{meraki_certificate_path}}" + meraki_requests_proxy: "{{meraki_requests_proxy}}" + meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" + meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" + meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" + meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" + meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" + meraki_maximum_retries: "{{meraki_maximum_retries}}" + meraki_output_log: "{{meraki_output_log}}" + meraki_log_file_prefix: "{{meraki_log_file_prefix}}" + meraki_log_path: "{{meraki_log_path}}" + meraki_print_console: "{{meraki_print_console}}" + meraki_suppress_logging: "{{meraki_suppress_logging}}" + meraki_simulate: "{{meraki_simulate}}" + meraki_be_geo_id: "{{meraki_be_geo_id}}" + meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" + meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" + perPage: 0 + startingAfter: string + endingBefore: string + organizationId: string + total_pages: -1 + direction: next + register: result + +""" +RETURN = r""" +meraki_response: + description: A dictionary or list with the response returned by the Cisco Meraki Python SDK + returned: always + type: dict + sample: > + { + "items": [ + { + "name": "string", + "roleId": "string", + "scope": "string", + "tags": [ + "string" + ] + } + ], + "meta": { + "counts": { + "items": { + "remaining": 0, + "total": 0 + } + } + } + } +""" diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_sm_sentry_policies_assignments.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_sm_sentry_policies_assignments.py new file mode 100644 index 000000000..4e7701145 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_sm_sentry_policies_assignments.py @@ -0,0 +1,134 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: organizations_sm_sentry_policies_assignments +short_description: Resource module for organizations _sm _sentry _policies _assignments +description: +- Manage operation update of the resource organizations _sm _sentry _policies _assignments. +- > + Update an Organizations Sentry Policies using the provided list. Sentry Policies are ordered in descending order + of priority i.e. Highest priority at the bottom, this is opposite the Dashboard UI. Policies not present in the + request will be deleted. +version_added: '2.18.0' +extends_documentation_fragment: + - cisco.meraki.module +author: Francisco Munoz (@fmunoz) +options: + items: + description: Sentry Group Policies for the Organization keyed by Network Id. + elements: dict + suboptions: + networkId: + description: The Id of the Network. + type: str + policies: + description: Array of Sentry Group Policies for the Network. + elements: dict + suboptions: + groupPolicyId: + description: The Group Policy Id. + type: str + policyId: + description: The Sentry Policy Id, if updating an existing Sentry Policy. + type: str + scope: + description: The scope of the Sentry Policy. + type: str + smNetworkId: + description: The Id of the Systems Manager Network. + type: str + tags: + description: The tags for the Sentry Policy. + elements: str + type: list + type: list + type: list + organizationId: + description: OrganizationId path parameter. Organization ID. + type: str +requirements: +- meraki >= 2.4.9 +- python >= 3.5 +seealso: +- name: Cisco Meraki documentation for sm updateOrganizationSmSentryPoliciesAssignments + description: Complete reference of the updateOrganizationSmSentryPoliciesAssignments API. + link: https://developer.cisco.com/meraki/api-v1/#!update-organization-sm-sentry-policies-assignments +notes: + - SDK Method used are + sm.Sm.update_organization_sm_sentry_policies_assignments, + + - Paths used are + put /organizations/{organizationId}/sm/sentry/policies/assignments, +""" + +EXAMPLES = r""" +- name: Update all + cisco.meraki.organizations_sm_sentry_policies_assignments: + meraki_api_key: "{{meraki_api_key}}" + meraki_base_url: "{{meraki_base_url}}" + meraki_single_request_timeout: "{{meraki_single_request_timeout}}" + meraki_certificate_path: "{{meraki_certificate_path}}" + meraki_requests_proxy: "{{meraki_requests_proxy}}" + meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" + meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" + meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" + meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" + meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" + meraki_maximum_retries: "{{meraki_maximum_retries}}" + meraki_output_log: "{{meraki_output_log}}" + meraki_log_file_prefix: "{{meraki_log_file_prefix}}" + meraki_log_path: "{{meraki_log_path}}" + meraki_print_console: "{{meraki_print_console}}" + meraki_suppress_logging: "{{meraki_suppress_logging}}" + meraki_simulate: "{{meraki_simulate}}" + meraki_be_geo_id: "{{meraki_be_geo_id}}" + meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" + meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" + items: + - networkId: N_24329156 + policies: + - groupPolicyId: '1284392014819' + policyId: '1284392014819' + scope: withAny + smNetworkId: N_24329156 + tags: + - tag1 + - tag2 + organizationId: string + +""" +RETURN = r""" +meraki_response: + description: A dictionary or list with the response returned by the Cisco Meraki Python SDK + returned: always + type: dict + sample: > + { + "items": [ + { + "networkId": "string", + "policies": [ + { + "createdAt": "string", + "groupNumber": "string", + "groupPolicyId": "string", + "lastUpdatedAt": "string", + "networkId": "string", + "policyId": "string", + "priority": "string", + "scope": "string", + "smNetworkId": "string", + "tags": [ + "string" + ] + } + ] + } + ] + } +""" diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_sm_sentry_policies_assignments_by_network_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_sm_sentry_policies_assignments_by_network_info.py new file mode 100644 index 000000000..410810331 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_sm_sentry_policies_assignments_by_network_info.py @@ -0,0 +1,138 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: organizations_sm_sentry_policies_assignments_by_network_info +short_description: Information module for organizations _sm _sentry _policies _assignments _bynetwork +description: +- Get all organizations _sm _sentry _policies _assignments _bynetwork. +- List the Sentry Policies for an organization ordered in ascending order of priority. +version_added: '2.18.0' +extends_documentation_fragment: + - cisco.meraki.module_info + - cisco.meraki.module_info_pagination +author: Francisco Munoz (@fmunoz) +options: + headers: + description: Additional headers. + type: dict + organizationId: + description: + - OrganizationId path parameter. Organization ID. + type: str + perPage: + description: + - PerPage query parameter. The number of entries per page returned. Acceptable range is 3 - 1000. Default is 50. + type: int + startingAfter: + description: + - > + StartingAfter query parameter. A token used by the server to indicate the start of the page. Often this is a + timestamp or an ID but it is not limited to those. This parameter should not be defined by client + applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + type: str + endingBefore: + description: + - > + EndingBefore query parameter. A token used by the server to indicate the end of the page. Often this is a + timestamp or an ID but it is not limited to those. This parameter should not be defined by client + applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + type: str + networkIds: + description: + - NetworkIds query parameter. Optional parameter to filter Sentry Policies by Network Id. + elements: str + type: list +requirements: +- meraki >= 2.4.9 +- python >= 3.5 +seealso: +- name: Cisco Meraki documentation for sm getOrganizationSmSentryPoliciesAssignmentsByNetwork + description: Complete reference of the getOrganizationSmSentryPoliciesAssignmentsByNetwork API. + link: https://developer.cisco.com/meraki/api-v1/#!get-organization-sm-sentry-policies-assignments-by-network +notes: + - SDK Method used are + sm.Sm.get_organization_sm_sentry_policies_assignments_by_network, + + - Paths used are + get /organizations/{organizationId}/sm/sentry/policies/assignments/byNetwork, +""" + +EXAMPLES = r""" +- name: Get all organizations _sm _sentry _policies _assignments _bynetwork + cisco.meraki.organizations_sm_sentry_policies_assignments_by_network_info: + meraki_api_key: "{{meraki_api_key}}" + meraki_base_url: "{{meraki_base_url}}" + meraki_single_request_timeout: "{{meraki_single_request_timeout}}" + meraki_certificate_path: "{{meraki_certificate_path}}" + meraki_requests_proxy: "{{meraki_requests_proxy}}" + meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" + meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" + meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" + meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" + meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" + meraki_maximum_retries: "{{meraki_maximum_retries}}" + meraki_output_log: "{{meraki_output_log}}" + meraki_log_file_prefix: "{{meraki_log_file_prefix}}" + meraki_log_path: "{{meraki_log_path}}" + meraki_print_console: "{{meraki_print_console}}" + meraki_suppress_logging: "{{meraki_suppress_logging}}" + meraki_simulate: "{{meraki_simulate}}" + meraki_be_geo_id: "{{meraki_be_geo_id}}" + meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" + meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" + perPage: 0 + startingAfter: string + endingBefore: string + networkIds: [] + organizationId: string + total_pages: -1 + direction: next + register: result + +""" +RETURN = r""" +meraki_response: + description: A dictionary or list with the response returned by the Cisco Meraki Python SDK + returned: always + type: list + elements: dict + sample: > + [ + { + "items": [ + { + "networkId": "string", + "policies": [ + { + "createdAt": "string", + "groupNumber": "string", + "groupPolicyId": "string", + "lastUpdatedAt": "string", + "networkId": "string", + "policyId": "string", + "priority": "string", + "scope": "string", + "smNetworkId": "string", + "tags": [ + "string" + ] + } + ] + } + ], + "meta": { + "counts": { + "items": { + "remaining": 0, + "total": 0 + } + } + } + } + ] +""" diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_sm_vpp_accounts_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_sm_vpp_accounts_info.py index 04f2f337f..429e3c52e 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_sm_vpp_accounts_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_sm_vpp_accounts_info.py @@ -109,7 +109,26 @@ meraki_response: type: dict sample: > { + "allowedAdmins": "string", + "assignableNetworkIds": [ + "string" + ], + "assignableNetworks": "string", + "contentToken": "string", + "email": "string", "id": "string", + "lastForceSyncedAt": "string", + "lastSyncedAt": "string", + "name": "string", + "networkIdAdmins": "string", + "parsedToken": { + "expiresAt": "string", + "hashedToken": "string", + "orgName": "string" + }, + "vppAccountId": "string", + "vppLocationId": "string", + "vppLocationName": "string", "vppServiceToken": "string" } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_snmp.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_snmp.py index f64326118..2ada45f40 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_snmp.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_snmp.py @@ -87,8 +87,10 @@ EXAMPLES = r""" - 123.123.123.1 v2cEnabled: false v3AuthMode: SHA + v3AuthPass: password v3Enabled: true v3PrivMode: AES128 + v3PrivPass: password """ RETURN = r""" @@ -97,5 +99,17 @@ meraki_response: returned: always type: dict sample: > - {} + { + "hostname": "string", + "peerIps": [ + "string" + ], + "port": 0, + "v2CommunityString": "string", + "v2cEnabled": true, + "v3AuthMode": "string", + "v3Enabled": true, + "v3PrivMode": "string", + "v3User": "string" + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_snmp_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_snmp_info.py index 4f3872a0b..9447c4c70 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_snmp_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_snmp_info.py @@ -70,6 +70,18 @@ meraki_response: description: A dictionary or list with the response returned by the Cisco Meraki Python SDK returned: always type: dict - sample: - - {} + sample: > + { + "hostname": "string", + "peerIps": [ + "string" + ], + "port": 0, + "v2CommunityString": "string", + "v2cEnabled": true, + "v3AuthMode": "string", + "v3Enabled": true, + "v3PrivMode": "string", + "v3User": "string" + } """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_summary_top_appliances_by_utilization_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_summary_top_appliances_by_utilization_info.py index 94e1b796b..fef47ccfe 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_summary_top_appliances_by_utilization_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_summary_top_appliances_by_utilization_info.py @@ -35,8 +35,8 @@ options: description: - > Timespan query parameter. The timespan for which the information will be fetched. If specifying timespan, do - not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 31 days. The - default is 1 day. + not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 25 minutes + and be less than or equal to 31 days. The default is 1 day. type: float requirements: - meraki >= 2.4.9 @@ -92,14 +92,14 @@ meraki_response: sample: > [ { + "mac": "string", + "model": "string", + "name": "string", "network": { - "name": "string", - "id": "string" + "id": "string", + "name": "string" }, - "name": "string", - "mac": "string", "serial": "string", - "model": "string", "utilization": { "average": { "percentage": 0 diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_summary_top_clients_by_usage_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_summary_top_clients_by_usage_info.py index ad3ac8cfb..b45869091 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_summary_top_clients_by_usage_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_summary_top_clients_by_usage_info.py @@ -35,8 +35,8 @@ options: description: - > Timespan query parameter. The timespan for which the information will be fetched. If specifying timespan, do - not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 31 days. The - default is 1 day. + not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 8 hours and + be less than or equal to 31 days. The default is 1 day. type: float requirements: - meraki >= 2.4.9 @@ -92,18 +92,18 @@ meraki_response: sample: > [ { - "name": "string", - "mac": "string", "id": "string", + "mac": "string", + "name": "string", "network": { - "name": "string", - "id": "string" + "id": "string", + "name": "string" }, "usage": { - "total": 0, - "upstream": 0, "downstream": 0, - "percentage": 0 + "percentage": 0, + "total": 0, + "upstream": 0 } } ] diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_summary_top_clients_manufacturers_by_usage_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_summary_top_clients_manufacturers_by_usage_info.py index eefbae45c..35fc6500e 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_summary_top_clients_manufacturers_by_usage_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_summary_top_clients_manufacturers_by_usage_info.py @@ -92,16 +92,16 @@ meraki_response: sample: > [ { - "name": "string", "clients": { "counts": { "total": 0 } }, + "name": "string", "usage": { + "downstream": 0, "total": 0, - "upstream": 0, - "downstream": 0 + "upstream": 0 } } ] diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_summary_top_devices_by_usage_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_summary_top_devices_by_usage_info.py index 4268e26a3..1c470ebc3 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_summary_top_devices_by_usage_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_summary_top_devices_by_usage_info.py @@ -37,8 +37,8 @@ options: description: - > Timespan query parameter. The timespan for which the information will be fetched. If specifying timespan, do - not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 31 days. The - default is 1 day. + not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 8 hours and + be less than or equal to 31 days. The default is 1 day. type: float requirements: - meraki >= 2.4.9 @@ -94,23 +94,23 @@ meraki_response: sample: > [ { - "name": "string", - "model": "string", - "serial": "string", - "mac": "string", - "productType": "string", - "network": { - "name": "string", - "id": "string" - }, - "usage": { - "total": 0, - "percentage": 0 - }, "clients": { "counts": { "total": 0 } + }, + "mac": "string", + "model": "string", + "name": "string", + "network": { + "id": "string", + "name": "string" + }, + "productType": "string", + "serial": "string", + "usage": { + "percentage": 0, + "total": 0 } } ] diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_summary_top_devices_models_by_usage_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_summary_top_devices_models_by_usage_info.py index e5b35838a..f60cbb438 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_summary_top_devices_models_by_usage_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_summary_top_devices_models_by_usage_info.py @@ -37,8 +37,8 @@ options: description: - > Timespan query parameter. The timespan for which the information will be fetched. If specifying timespan, do - not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 31 days. The - default is 1 day. + not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 8 hours and + be less than or equal to 31 days. The default is 1 day. type: float requirements: - meraki >= 2.4.9 @@ -94,11 +94,11 @@ meraki_response: sample: > [ { - "model": "string", "count": 0, + "model": "string", "usage": { - "total": 0, - "average": 0 + "average": 0, + "total": 0 } } ] diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_summary_top_networks_by_status_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_summary_top_networks_by_status_info.py new file mode 100644 index 000000000..f5472c326 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_summary_top_networks_by_status_info.py @@ -0,0 +1,145 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: organizations_summary_top_networks_by_status_info +short_description: Information module for organizations _summary _top _networks _bystatus +description: +- Get all organizations _summary _top _networks _bystatus. +- > + List the client and status overview information for the networks in an organization. Usage is measured in + kilobytes and from the last seven days. +version_added: '2.18.0' +extends_documentation_fragment: + - cisco.meraki.module_info + - cisco.meraki.module_info_pagination +author: Francisco Munoz (@fmunoz) +options: + headers: + description: Additional headers. + type: dict + organizationId: + description: + - OrganizationId path parameter. Organization ID. + type: str + perPage: + description: + - PerPage query parameter. The number of entries per page returned. Acceptable range is 3 - 5000. + type: int + startingAfter: + description: + - > + StartingAfter query parameter. A token used by the server to indicate the start of the page. Often this is a + timestamp or an ID but it is not limited to those. This parameter should not be defined by client + applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + type: str + endingBefore: + description: + - > + EndingBefore query parameter. A token used by the server to indicate the end of the page. Often this is a + timestamp or an ID but it is not limited to those. This parameter should not be defined by client + applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + type: str +requirements: +- meraki >= 2.4.9 +- python >= 3.5 +seealso: +- name: Cisco Meraki documentation for organizations getOrganizationSummaryTopNetworksByStatus + description: Complete reference of the getOrganizationSummaryTopNetworksByStatus API. + link: https://developer.cisco.com/meraki/api-v1/#!get-organization-summary-top-networks-by-status +notes: + - SDK Method used are + organizations.Organizations.get_organization_summary_top_networks_by_status, + + - Paths used are + get /organizations/{organizationId}/summary/top/networks/byStatus, +""" + +EXAMPLES = r""" +- name: Get all organizations _summary _top _networks _bystatus + cisco.meraki.organizations_summary_top_networks_by_status_info: + meraki_api_key: "{{meraki_api_key}}" + meraki_base_url: "{{meraki_base_url}}" + meraki_single_request_timeout: "{{meraki_single_request_timeout}}" + meraki_certificate_path: "{{meraki_certificate_path}}" + meraki_requests_proxy: "{{meraki_requests_proxy}}" + meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" + meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" + meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" + meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" + meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" + meraki_maximum_retries: "{{meraki_maximum_retries}}" + meraki_output_log: "{{meraki_output_log}}" + meraki_log_file_prefix: "{{meraki_log_file_prefix}}" + meraki_log_path: "{{meraki_log_path}}" + meraki_print_console: "{{meraki_print_console}}" + meraki_suppress_logging: "{{meraki_suppress_logging}}" + meraki_simulate: "{{meraki_simulate}}" + meraki_be_geo_id: "{{meraki_be_geo_id}}" + meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" + meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" + perPage: 0 + startingAfter: string + endingBefore: string + organizationId: string + total_pages: -1 + direction: next + register: result + +""" +RETURN = r""" +meraki_response: + description: A dictionary or list with the response returned by the Cisco Meraki Python SDK + returned: always + type: list + elements: dict + sample: > + [ + { + "clients": { + "counts": { + "total": 0 + }, + "usage": { + "downstream": 0, + "upstream": 0 + } + }, + "devices": { + "byProductType": [ + { + "productType": "string", + "url": "string" + } + ] + }, + "name": "string", + "networkId": "string", + "productTypes": [ + "string" + ], + "statuses": { + "byProductType": [ + { + "counts": { + "alerting": 0, + "dormant": 0, + "offline": 0, + "online": 0 + }, + "productType": "string" + } + ], + "overall": "string" + }, + "tags": [ + "string" + ], + "url": "string" + } + ] +""" diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_summary_top_ssids_by_usage_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_summary_top_ssids_by_usage_info.py index 7f1b29d4b..195cc9630 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_summary_top_ssids_by_usage_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_summary_top_ssids_by_usage_info.py @@ -35,8 +35,8 @@ options: description: - > Timespan query parameter. The timespan for which the information will be fetched. If specifying timespan, do - not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 31 days. The - default is 1 day. + not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 8 hours and + be less than or equal to 31 days. The default is 1 day. type: float requirements: - meraki >= 2.4.9 @@ -92,17 +92,17 @@ meraki_response: sample: > [ { - "name": "string", - "usage": { - "total": 0, - "downstream": 0, - "upstream": 0, - "percentage": 0 - }, "clients": { "counts": { "total": 0 } + }, + "name": "string", + "usage": { + "downstream": 0, + "percentage": 0, + "total": 0, + "upstream": 0 } } ] diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_summary_top_switches_by_energy_usage_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_summary_top_switches_by_energy_usage_info.py index 9efaa85a5..dd3bd0fc3 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_summary_top_switches_by_energy_usage_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_summary_top_switches_by_energy_usage_info.py @@ -35,8 +35,8 @@ options: description: - > Timespan query parameter. The timespan for which the information will be fetched. If specifying timespan, do - not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 31 days. The - default is 1 day. + not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 25 minutes + and be less than or equal to 31 days. The default is 1 day. type: float requirements: - meraki >= 2.4.9 @@ -92,13 +92,13 @@ meraki_response: sample: > [ { - "network": { - "name": "string", - "id": "string" - }, - "name": "string", "mac": "string", "model": "string", + "name": "string", + "network": { + "id": "string", + "name": "string" + }, "usage": { "total": 0 } diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_switch_ports_by_switch_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_switch_ports_by_switch_info.py index 067ebd9de..c77f52f84 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_switch_ports_by_switch_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_switch_ports_by_switch_info.py @@ -154,37 +154,37 @@ meraki_response: sample: > [ { - "name": "string", - "serial": "string", "mac": "string", + "model": "string", + "name": "string", "network": { - "name": "string", - "id": "string" + "id": "string", + "name": "string" }, - "model": "string", "ports": [ { - "portId": "string", - "name": "string", - "tags": [ - "string" - ], + "accessPolicyType": "string", + "allowedVlans": "string", "enabled": true, + "linkNegotiation": "string", + "name": "string", "poeEnabled": true, - "type": "string", - "vlan": 0, - "voiceVlan": 0, - "allowedVlans": "string", + "portId": "string", "rstpEnabled": true, - "stpGuard": "string", - "linkNegotiation": "string", - "accessPolicyType": "string", "stickyMacAllowList": [ "string" ], - "stickyMacAllowListLimit": 0 + "stickyMacAllowListLimit": 0, + "stpGuard": "string", + "tags": [ + "string" + ], + "type": "string", + "vlan": 0, + "voiceVlan": 0 } - ] + ], + "serial": "string" } ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_uplinks_statuses_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_uplinks_statuses_info.py index c29419b36..76b8f10f1 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_uplinks_statuses_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_uplinks_statuses_info.py @@ -120,31 +120,35 @@ meraki_response: sample: > [ { + "highAvailability": { + "enabled": true, + "role": "string" + }, + "lastReportedAt": "string", + "model": "string", "networkId": "string", "serial": "string", - "model": "string", - "lastReportedAt": "string", "uplinks": [ { + "apn": "string", + "connectionType": "string", + "dns1": "string", + "dns2": "string", + "gateway": "string", + "iccid": "string", "interface": "string", - "status": "string", "ip": "string", - "gateway": "string", - "publicIp": "string", - "primaryDns": "string", - "secondaryDns": "string", "ipAssignedBy": "string", + "primaryDns": "string", "provider": "string", + "publicIp": "string", + "secondaryDns": "string", "signalStat": { "rsrp": "string", "rsrq": "string" }, - "connectionType": "string", - "apn": "string", - "dns1": "string", - "dns2": "string", "signalType": "string", - "iccid": "string" + "status": "string" } ] } diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_webhooks_callbacks_statuses_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_webhooks_callbacks_statuses_info.py new file mode 100644 index 000000000..77e6b7daf --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_webhooks_callbacks_statuses_info.py @@ -0,0 +1,99 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: organizations_webhooks_callbacks_statuses_info +short_description: Information module for organizations _webhooks _callbacks _statuses +description: +- Get organizations _webhooks _callbacks _statuses by id. +- Return the status of an API callback. +version_added: '2.18.0' +extends_documentation_fragment: + - cisco.meraki.module_info +author: Francisco Munoz (@fmunoz) +options: + headers: + description: Additional headers. + type: dict + organizationId: + description: + - OrganizationId path parameter. Organization ID. + type: str + callbackId: + description: + - CallbackId path parameter. Callback ID. + type: str +requirements: +- meraki >= 2.4.9 +- python >= 3.5 +seealso: +- name: Cisco Meraki documentation for organizations getOrganizationWebhooksCallbacksStatus + description: Complete reference of the getOrganizationWebhooksCallbacksStatus API. + link: https://developer.cisco.com/meraki/api-v1/#!get-organization-webhooks-callbacks-status +notes: + - SDK Method used are + organizations.Organizations.get_organization_webhooks_callbacks_status, + + - Paths used are + get /organizations/{organizationId}/webhooks/callbacks/statuses/{callbackId}, +""" + +EXAMPLES = r""" +- name: Get organizations _webhooks _callbacks _statuses by id + cisco.meraki.organizations_webhooks_callbacks_statuses_info: + meraki_api_key: "{{meraki_api_key}}" + meraki_base_url: "{{meraki_base_url}}" + meraki_single_request_timeout: "{{meraki_single_request_timeout}}" + meraki_certificate_path: "{{meraki_certificate_path}}" + meraki_requests_proxy: "{{meraki_requests_proxy}}" + meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" + meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" + meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" + meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" + meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" + meraki_maximum_retries: "{{meraki_maximum_retries}}" + meraki_output_log: "{{meraki_output_log}}" + meraki_log_file_prefix: "{{meraki_log_file_prefix}}" + meraki_log_path: "{{meraki_log_path}}" + meraki_print_console: "{{meraki_print_console}}" + meraki_suppress_logging: "{{meraki_suppress_logging}}" + meraki_simulate: "{{meraki_simulate}}" + meraki_be_geo_id: "{{meraki_be_geo_id}}" + meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" + meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" + organizationId: string + callbackId: string + register: result + +""" +RETURN = r""" +meraki_response: + description: A dictionary or list with the response returned by the Cisco Meraki Python SDK + returned: always + type: dict + sample: > + { + "callbackId": "string", + "createdBy": { + "adminId": "string" + }, + "errors": [ + "string" + ], + "status": "string", + "webhook": { + "httpServer": { + "id": "string" + }, + "payloadTemplate": { + "id": "string" + }, + "sentAt": "string", + "url": "string" + } + } +""" diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_wireless_devices_channel_utilization_by_device_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_wireless_devices_channel_utilization_by_device_info.py new file mode 100644 index 000000000..3fab27fe7 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_wireless_devices_channel_utilization_by_device_info.py @@ -0,0 +1,159 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: organizations_wireless_devices_channel_utilization_by_device_info +short_description: Information module for organizations _wireless _devices _channelutilization _bydevice +description: +- Get all organizations _wireless _devices _channelutilization _bydevice. +- Get average channel utilization for all bands in a network, split by AP. +version_added: '2.18.0' +extends_documentation_fragment: + - cisco.meraki.module_info + - cisco.meraki.module_info_pagination +author: Francisco Munoz (@fmunoz) +options: + headers: + description: Additional headers. + type: dict + organizationId: + description: + - OrganizationId path parameter. Organization ID. + type: str + networkIds: + description: + - NetworkIds query parameter. Filter results by network. + elements: str + type: list + serials: + description: + - Serials query parameter. Filter results by device. + elements: str + type: list + perPage: + description: + - PerPage query parameter. The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. + type: int + startingAfter: + description: + - > + StartingAfter query parameter. A token used by the server to indicate the start of the page. Often this is a + timestamp or an ID but it is not limited to those. This parameter should not be defined by client + applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + type: str + endingBefore: + description: + - > + EndingBefore query parameter. A token used by the server to indicate the end of the page. Often this is a + timestamp or an ID but it is not limited to those. This parameter should not be defined by client + applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + type: str + t0: + description: + - T0 query parameter. The beginning of the timespan for the data. The maximum lookback period is 90 days from today. + type: str + t1: + description: + - T1 query parameter. The end of the timespan for the data. T1 can be a maximum of 90 days after t0. + type: str + timespan: + description: + - > + Timespan query parameter. The timespan for which the information will be fetched. If specifying timespan, do + not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 90 days. The + default is 7 days. + type: float + interval: + description: + - > + Interval query parameter. The time interval in seconds for returned data. The valid intervals are 300, 600, + 3600, 7200, 14400, 21600. The default is 3600. + type: int +requirements: +- meraki >= 2.4.9 +- python >= 3.5 +seealso: +- name: Cisco Meraki documentation for wireless getOrganizationWirelessDevicesChannelUtilizationByDevice + description: Complete reference of the getOrganizationWirelessDevicesChannelUtilizationByDevice API. + link: https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-channel-utilization-by-device +notes: + - SDK Method used are + wireless.Wireless.get_organization_wireless_devices_channel_utilization_by_device, + + - Paths used are + get /organizations/{organizationId}/wireless/devices/channelUtilization/byDevice, +""" + +EXAMPLES = r""" +- name: Get all organizations _wireless _devices _channelutilization _bydevice + cisco.meraki.organizations_wireless_devices_channel_utilization_by_device_info: + meraki_api_key: "{{meraki_api_key}}" + meraki_base_url: "{{meraki_base_url}}" + meraki_single_request_timeout: "{{meraki_single_request_timeout}}" + meraki_certificate_path: "{{meraki_certificate_path}}" + meraki_requests_proxy: "{{meraki_requests_proxy}}" + meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" + meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" + meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" + meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" + meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" + meraki_maximum_retries: "{{meraki_maximum_retries}}" + meraki_output_log: "{{meraki_output_log}}" + meraki_log_file_prefix: "{{meraki_log_file_prefix}}" + meraki_log_path: "{{meraki_log_path}}" + meraki_print_console: "{{meraki_print_console}}" + meraki_suppress_logging: "{{meraki_suppress_logging}}" + meraki_simulate: "{{meraki_simulate}}" + meraki_be_geo_id: "{{meraki_be_geo_id}}" + meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" + meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" + networkIds: [] + serials: [] + perPage: 0 + startingAfter: string + endingBefore: string + t0: string + t1: string + timespan: 0 + interval: 0 + organizationId: string + total_pages: -1 + direction: next + register: result + +""" +RETURN = r""" +meraki_response: + description: A dictionary or list with the response returned by the Cisco Meraki Python SDK + returned: always + type: list + elements: dict + sample: > + [ + { + "byBand": [ + { + "band": "string", + "nonWifi": { + "percentage": 0 + }, + "total": { + "percentage": 0 + }, + "wifi": { + "percentage": 0 + } + } + ], + "mac": "string", + "network": { + "id": "string" + }, + "serial": "string" + } + ] +""" diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_wireless_devices_channel_utilization_by_network_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_wireless_devices_channel_utilization_by_network_info.py new file mode 100644 index 000000000..b1aadc091 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_wireless_devices_channel_utilization_by_network_info.py @@ -0,0 +1,157 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: organizations_wireless_devices_channel_utilization_by_network_info +short_description: Information module for organizations _wireless _devices _channelutilization _bynetwork +description: +- Get all organizations _wireless _devices _channelutilization _bynetwork. +- Get average channel utilization across all bands for all networks in the organization. +version_added: '2.18.0' +extends_documentation_fragment: + - cisco.meraki.module_info + - cisco.meraki.module_info_pagination +author: Francisco Munoz (@fmunoz) +options: + headers: + description: Additional headers. + type: dict + organizationId: + description: + - OrganizationId path parameter. Organization ID. + type: str + networkIds: + description: + - NetworkIds query parameter. Filter results by network. + elements: str + type: list + serials: + description: + - Serials query parameter. Filter results by device. + elements: str + type: list + perPage: + description: + - PerPage query parameter. The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. + type: int + startingAfter: + description: + - > + StartingAfter query parameter. A token used by the server to indicate the start of the page. Often this is a + timestamp or an ID but it is not limited to those. This parameter should not be defined by client + applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + type: str + endingBefore: + description: + - > + EndingBefore query parameter. A token used by the server to indicate the end of the page. Often this is a + timestamp or an ID but it is not limited to those. This parameter should not be defined by client + applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + type: str + t0: + description: + - T0 query parameter. The beginning of the timespan for the data. The maximum lookback period is 90 days from today. + type: str + t1: + description: + - T1 query parameter. The end of the timespan for the data. T1 can be a maximum of 90 days after t0. + type: str + timespan: + description: + - > + Timespan query parameter. The timespan for which the information will be fetched. If specifying timespan, do + not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 90 days. The + default is 7 days. + type: float + interval: + description: + - > + Interval query parameter. The time interval in seconds for returned data. The valid intervals are 300, 600, + 3600, 7200, 14400, 21600. The default is 3600. + type: int +requirements: +- meraki >= 2.4.9 +- python >= 3.5 +seealso: +- name: Cisco Meraki documentation for wireless getOrganizationWirelessDevicesChannelUtilizationByNetwork + description: Complete reference of the getOrganizationWirelessDevicesChannelUtilizationByNetwork API. + link: https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-channel-utilization-by-network +notes: + - SDK Method used are + wireless.Wireless.get_organization_wireless_devices_channel_utilization_by_network, + + - Paths used are + get /organizations/{organizationId}/wireless/devices/channelUtilization/byNetwork, +""" + +EXAMPLES = r""" +- name: Get all organizations _wireless _devices _channelutilization _bynetwork + cisco.meraki.organizations_wireless_devices_channel_utilization_by_network_info: + meraki_api_key: "{{meraki_api_key}}" + meraki_base_url: "{{meraki_base_url}}" + meraki_single_request_timeout: "{{meraki_single_request_timeout}}" + meraki_certificate_path: "{{meraki_certificate_path}}" + meraki_requests_proxy: "{{meraki_requests_proxy}}" + meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" + meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" + meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" + meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" + meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" + meraki_maximum_retries: "{{meraki_maximum_retries}}" + meraki_output_log: "{{meraki_output_log}}" + meraki_log_file_prefix: "{{meraki_log_file_prefix}}" + meraki_log_path: "{{meraki_log_path}}" + meraki_print_console: "{{meraki_print_console}}" + meraki_suppress_logging: "{{meraki_suppress_logging}}" + meraki_simulate: "{{meraki_simulate}}" + meraki_be_geo_id: "{{meraki_be_geo_id}}" + meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" + meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" + networkIds: [] + serials: [] + perPage: 0 + startingAfter: string + endingBefore: string + t0: string + t1: string + timespan: 0 + interval: 0 + organizationId: string + total_pages: -1 + direction: next + register: result + +""" +RETURN = r""" +meraki_response: + description: A dictionary or list with the response returned by the Cisco Meraki Python SDK + returned: always + type: list + elements: dict + sample: > + [ + { + "byBand": [ + { + "band": "string", + "nonWifi": { + "percentage": 0 + }, + "total": { + "percentage": 0 + }, + "wifi": { + "percentage": 0 + } + } + ], + "network": { + "id": "string" + } + } + ] +""" diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_wireless_devices_channel_utilization_history_by_device_by_interval_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_wireless_devices_channel_utilization_history_by_device_by_interval_info.py new file mode 100644 index 000000000..95a0a6017 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_wireless_devices_channel_utilization_history_by_device_by_interval_info.py @@ -0,0 +1,161 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: organizations_wireless_devices_channel_utilization_history_by_device_by_interval_info +short_description: Information module for organizations _wireless _devices _channelutilization _history _bydevice _byinterval +description: +- Get all organizations _wireless _devices _channelutilization _history _bydevice _byinterval. +- Get a time-series of average channel utilization for all bands, segmented by device. +version_added: '2.18.0' +extends_documentation_fragment: + - cisco.meraki.module_info + - cisco.meraki.module_info_pagination +author: Francisco Munoz (@fmunoz) +options: + headers: + description: Additional headers. + type: dict + organizationId: + description: + - OrganizationId path parameter. Organization ID. + type: str + networkIds: + description: + - NetworkIds query parameter. Filter results by network. + elements: str + type: list + serials: + description: + - Serials query parameter. Filter results by device. + elements: str + type: list + perPage: + description: + - PerPage query parameter. The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. + type: int + startingAfter: + description: + - > + StartingAfter query parameter. A token used by the server to indicate the start of the page. Often this is a + timestamp or an ID but it is not limited to those. This parameter should not be defined by client + applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + type: str + endingBefore: + description: + - > + EndingBefore query parameter. A token used by the server to indicate the end of the page. Often this is a + timestamp or an ID but it is not limited to those. This parameter should not be defined by client + applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + type: str + t0: + description: + - T0 query parameter. The beginning of the timespan for the data. The maximum lookback period is 31 days from today. + type: str + t1: + description: + - T1 query parameter. The end of the timespan for the data. T1 can be a maximum of 31 days after t0. + type: str + timespan: + description: + - > + Timespan query parameter. The timespan for which the information will be fetched. If specifying timespan, do + not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 31 days. The + default is 7 days. + type: float + interval: + description: + - > + Interval query parameter. The time interval in seconds for returned data. The valid intervals are 300, 600, + 3600, 7200, 14400, 21600. The default is 3600. + type: int +requirements: +- meraki >= 2.4.9 +- python >= 3.5 +seealso: +- name: Cisco Meraki documentation for wireless getOrganizationWirelessDevicesChannelUtilizationHistoryByDeviceByInterval + description: Complete reference of the getOrganizationWirelessDevicesChannelUtilizationHistoryByDeviceByInterval API. + link: https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-channel-utilization-history-by-device-by-interval +notes: + - SDK Method used are + wireless.Wireless.get_organization_wireless_devices_channel_utilization_history_by_device_by_interval, + + - Paths used are + get /organizations/{organizationId}/wireless/devices/channelUtilization/history/byDevice/byInterval, +""" + +EXAMPLES = r""" +- name: Get all organizations _wireless _devices _channelutilization _history _bydevice _byinterval + cisco.meraki.organizations_wireless_devices_channel_utilization_history_by_device_by_interval_info: + meraki_api_key: "{{meraki_api_key}}" + meraki_base_url: "{{meraki_base_url}}" + meraki_single_request_timeout: "{{meraki_single_request_timeout}}" + meraki_certificate_path: "{{meraki_certificate_path}}" + meraki_requests_proxy: "{{meraki_requests_proxy}}" + meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" + meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" + meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" + meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" + meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" + meraki_maximum_retries: "{{meraki_maximum_retries}}" + meraki_output_log: "{{meraki_output_log}}" + meraki_log_file_prefix: "{{meraki_log_file_prefix}}" + meraki_log_path: "{{meraki_log_path}}" + meraki_print_console: "{{meraki_print_console}}" + meraki_suppress_logging: "{{meraki_suppress_logging}}" + meraki_simulate: "{{meraki_simulate}}" + meraki_be_geo_id: "{{meraki_be_geo_id}}" + meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" + meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" + networkIds: [] + serials: [] + perPage: 0 + startingAfter: string + endingBefore: string + t0: string + t1: string + timespan: 0 + interval: 0 + organizationId: string + total_pages: -1 + direction: next + register: result + +""" +RETURN = r""" +meraki_response: + description: A dictionary or list with the response returned by the Cisco Meraki Python SDK + returned: always + type: list + elements: dict + sample: > + [ + { + "byBand": [ + { + "band": "string", + "nonWifi": { + "percentage": 0 + }, + "total": { + "percentage": 0 + }, + "wifi": { + "percentage": 0 + } + } + ], + "endTs": "string", + "mac": "string", + "network": { + "id": "string" + }, + "serial": "string", + "startTs": "string" + } + ] +""" diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_wireless_devices_channel_utilization_history_by_network_by_interval_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_wireless_devices_channel_utilization_history_by_network_by_interval_info.py new file mode 100644 index 000000000..df831db78 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_wireless_devices_channel_utilization_history_by_network_by_interval_info.py @@ -0,0 +1,159 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: organizations_wireless_devices_channel_utilization_history_by_network_by_interval_info +short_description: Information module for organizations _wireless _devices _channelutilization _history _bynetwork _byinterval +description: +- Get all organizations _wireless _devices _channelutilization _history _bynetwork _byinterval. +- Get a time-series of average channel utilization for all bands. +version_added: '2.18.0' +extends_documentation_fragment: + - cisco.meraki.module_info + - cisco.meraki.module_info_pagination +author: Francisco Munoz (@fmunoz) +options: + headers: + description: Additional headers. + type: dict + organizationId: + description: + - OrganizationId path parameter. Organization ID. + type: str + networkIds: + description: + - NetworkIds query parameter. Filter results by network. + elements: str + type: list + serials: + description: + - Serials query parameter. Filter results by device. + elements: str + type: list + perPage: + description: + - PerPage query parameter. The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. + type: int + startingAfter: + description: + - > + StartingAfter query parameter. A token used by the server to indicate the start of the page. Often this is a + timestamp or an ID but it is not limited to those. This parameter should not be defined by client + applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + type: str + endingBefore: + description: + - > + EndingBefore query parameter. A token used by the server to indicate the end of the page. Often this is a + timestamp or an ID but it is not limited to those. This parameter should not be defined by client + applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + type: str + t0: + description: + - T0 query parameter. The beginning of the timespan for the data. The maximum lookback period is 31 days from today. + type: str + t1: + description: + - T1 query parameter. The end of the timespan for the data. T1 can be a maximum of 31 days after t0. + type: str + timespan: + description: + - > + Timespan query parameter. The timespan for which the information will be fetched. If specifying timespan, do + not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 31 days. The + default is 7 days. + type: float + interval: + description: + - > + Interval query parameter. The time interval in seconds for returned data. The valid intervals are 300, 600, + 3600, 7200, 14400, 21600. The default is 3600. + type: int +requirements: +- meraki >= 2.4.9 +- python >= 3.5 +seealso: +- name: Cisco Meraki documentation for wireless getOrganizationWirelessDevicesChannelUtilizationHistoryByNetworkByInterval + description: Complete reference of the getOrganizationWirelessDevicesChannelUtilizationHistoryByNetworkByInterval API. + link: https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-channel-utilization-history-by-network-by-interval +notes: + - SDK Method used are + wireless.Wireless.get_organization_wireless_devices_channel_utilization_history_by_network_by_interval, + + - Paths used are + get /organizations/{organizationId}/wireless/devices/channelUtilization/history/byNetwork/byInterval, +""" + +EXAMPLES = r""" +- name: Get all organizations _wireless _devices _channelutilization _history _bynetwork _byinterval + cisco.meraki.organizations_wireless_devices_channel_utilization_history_by_network_by_interval_info: + meraki_api_key: "{{meraki_api_key}}" + meraki_base_url: "{{meraki_base_url}}" + meraki_single_request_timeout: "{{meraki_single_request_timeout}}" + meraki_certificate_path: "{{meraki_certificate_path}}" + meraki_requests_proxy: "{{meraki_requests_proxy}}" + meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" + meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" + meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" + meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" + meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" + meraki_maximum_retries: "{{meraki_maximum_retries}}" + meraki_output_log: "{{meraki_output_log}}" + meraki_log_file_prefix: "{{meraki_log_file_prefix}}" + meraki_log_path: "{{meraki_log_path}}" + meraki_print_console: "{{meraki_print_console}}" + meraki_suppress_logging: "{{meraki_suppress_logging}}" + meraki_simulate: "{{meraki_simulate}}" + meraki_be_geo_id: "{{meraki_be_geo_id}}" + meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" + meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" + networkIds: [] + serials: [] + perPage: 0 + startingAfter: string + endingBefore: string + t0: string + t1: string + timespan: 0 + interval: 0 + organizationId: string + total_pages: -1 + direction: next + register: result + +""" +RETURN = r""" +meraki_response: + description: A dictionary or list with the response returned by the Cisco Meraki Python SDK + returned: always + type: list + elements: dict + sample: > + [ + { + "byBand": [ + { + "band": "string", + "nonWifi": { + "percentage": 0 + }, + "total": { + "percentage": 0 + }, + "wifi": { + "percentage": 0 + } + } + ], + "endTs": "string", + "network": { + "id": "string" + }, + "startTs": "string" + } + ] +""" diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_wireless_devices_ethernet_statuses_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_wireless_devices_ethernet_statuses_info.py index d8a5c190c..0eaad0bcb 100644 --- a/ansible_collections/cisco/meraki/plugins/modules/organizations_wireless_devices_ethernet_statuses_info.py +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_wireless_devices_ethernet_statuses_info.py @@ -10,7 +10,9 @@ module: organizations_wireless_devices_ethernet_statuses_info short_description: Information module for organizations _wireless _devices _ethernet _statuses description: - Get all organizations _wireless _devices _ethernet _statuses. -- Endpoint to see power status for wireless devices. +- > + List the most recent Ethernet link speed, duplex, aggregation and power mode and status information for wireless + devices. version_added: '2.16.0' extends_documentation_fragment: - cisco.meraki.module_info @@ -106,36 +108,36 @@ meraki_response: sample: > [ { - "serial": "string", + "aggregation": { + "enabled": true, + "speed": 0 + }, "name": "string", "network": { "id": "string" }, - "power": { - "mode": "string", - "ac": { - "isConnected": true - }, - "poe": { - "isConnected": true - } - }, "ports": [ { - "name": "string", - "poe": { - "standard": "string" - }, "linkNegotiation": { "duplex": "string", "speed": 0 + }, + "name": "string", + "poe": { + "standard": "string" } } ], - "aggregation": { - "enabled": true, - "speed": 0 - } + "power": { + "ac": { + "isConnected": true + }, + "mode": "string", + "poe": { + "isConnected": true + } + }, + "serial": "string" } ] """ diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_wireless_devices_packet_loss_by_client_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_wireless_devices_packet_loss_by_client_info.py new file mode 100644 index 000000000..b28ea787d --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_wireless_devices_packet_loss_by_client_info.py @@ -0,0 +1,163 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: organizations_wireless_devices_packet_loss_by_client_info +short_description: Information module for organizations _wireless _devices _packetloss _byclient +description: +- Get all organizations _wireless _devices _packetloss _byclient. +- Get average packet loss for the given timespan for all clients in the organization. +version_added: '2.18.0' +extends_documentation_fragment: + - cisco.meraki.module_info + - cisco.meraki.module_info_pagination +author: Francisco Munoz (@fmunoz) +options: + headers: + description: Additional headers. + type: dict + organizationId: + description: + - OrganizationId path parameter. Organization ID. + type: str + networkIds: + description: + - NetworkIds query parameter. Filter results by network. + elements: str + type: list + ssids: + description: + - Ssids query parameter. Filter results by SSID number. + elements: int + type: list + bands: + description: + - Bands query parameter. Filter results by band. Valid bands are 2.4, 5, and 6. + elements: str + type: list + macs: + description: + - Macs query parameter. Filter results by client mac address(es). + elements: str + type: list + perPage: + description: + - PerPage query parameter. The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. + type: int + startingAfter: + description: + - > + StartingAfter query parameter. A token used by the server to indicate the start of the page. Often this is a + timestamp or an ID but it is not limited to those. This parameter should not be defined by client + applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + type: str + endingBefore: + description: + - > + EndingBefore query parameter. A token used by the server to indicate the end of the page. Often this is a + timestamp or an ID but it is not limited to those. This parameter should not be defined by client + applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + type: str + t0: + description: + - T0 query parameter. The beginning of the timespan for the data. The maximum lookback period is 90 days from today. + type: str + t1: + description: + - T1 query parameter. The end of the timespan for the data. T1 can be a maximum of 90 days after t0. + type: str + timespan: + description: + - > + Timespan query parameter. The timespan for which the information will be fetched. If specifying timespan, do + not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 5 minutes and + be less than or equal to 90 days. The default is 7 days. + type: float +requirements: +- meraki >= 2.4.9 +- python >= 3.5 +seealso: +- name: Cisco Meraki documentation for wireless getOrganizationWirelessDevicesPacketLossByClient + description: Complete reference of the getOrganizationWirelessDevicesPacketLossByClient API. + link: https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-packet-loss-by-client +notes: + - SDK Method used are + wireless.Wireless.get_organization_wireless_devices_packet_loss_by_client, + + - Paths used are + get /organizations/{organizationId}/wireless/devices/packetLoss/byClient, +""" + +EXAMPLES = r""" +- name: Get all organizations _wireless _devices _packetloss _byclient + cisco.meraki.organizations_wireless_devices_packet_loss_by_client_info: + meraki_api_key: "{{meraki_api_key}}" + meraki_base_url: "{{meraki_base_url}}" + meraki_single_request_timeout: "{{meraki_single_request_timeout}}" + meraki_certificate_path: "{{meraki_certificate_path}}" + meraki_requests_proxy: "{{meraki_requests_proxy}}" + meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" + meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" + meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" + meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" + meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" + meraki_maximum_retries: "{{meraki_maximum_retries}}" + meraki_output_log: "{{meraki_output_log}}" + meraki_log_file_prefix: "{{meraki_log_file_prefix}}" + meraki_log_path: "{{meraki_log_path}}" + meraki_print_console: "{{meraki_print_console}}" + meraki_suppress_logging: "{{meraki_suppress_logging}}" + meraki_simulate: "{{meraki_simulate}}" + meraki_be_geo_id: "{{meraki_be_geo_id}}" + meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" + meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" + networkIds: [] + ssids: [] + bands: [] + macs: [] + perPage: 0 + startingAfter: string + endingBefore: string + t0: string + t1: string + timespan: 0 + organizationId: string + total_pages: -1 + direction: next + register: result + +""" +RETURN = r""" +meraki_response: + description: A dictionary or list with the response returned by the Cisco Meraki Python SDK + returned: always + type: list + elements: dict + sample: > + [ + { + "client": { + "id": "string", + "mac": "string" + }, + "downstream": { + "lossPercentage": 0, + "lost": 0, + "total": 0 + }, + "network": { + "id": "string", + "name": "string" + }, + "upstream": { + "lossPercentage": 0, + "lost": 0, + "total": 0 + } + } + ] +""" diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_wireless_devices_packet_loss_by_device_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_wireless_devices_packet_loss_by_device_info.py new file mode 100644 index 000000000..038681e15 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_wireless_devices_packet_loss_by_device_info.py @@ -0,0 +1,166 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: organizations_wireless_devices_packet_loss_by_device_info +short_description: Information module for organizations _wireless _devices _packetloss _bydevice +description: +- Get all organizations _wireless _devices _packetloss _bydevice. +- > + Get average packet loss for the given timespan for all devices in the organization. Does not include device's own + traffic. +version_added: '2.18.0' +extends_documentation_fragment: + - cisco.meraki.module_info + - cisco.meraki.module_info_pagination +author: Francisco Munoz (@fmunoz) +options: + headers: + description: Additional headers. + type: dict + organizationId: + description: + - OrganizationId path parameter. Organization ID. + type: str + networkIds: + description: + - NetworkIds query parameter. Filter results by network. + elements: str + type: list + serials: + description: + - Serials query parameter. Filter results by device. + elements: str + type: list + ssids: + description: + - Ssids query parameter. Filter results by SSID number. + elements: int + type: list + bands: + description: + - Bands query parameter. Filter results by band. Valid bands are 2.4, 5, and 6. + elements: str + type: list + perPage: + description: + - PerPage query parameter. The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. + type: int + startingAfter: + description: + - > + StartingAfter query parameter. A token used by the server to indicate the start of the page. Often this is a + timestamp or an ID but it is not limited to those. This parameter should not be defined by client + applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + type: str + endingBefore: + description: + - > + EndingBefore query parameter. A token used by the server to indicate the end of the page. Often this is a + timestamp or an ID but it is not limited to those. This parameter should not be defined by client + applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + type: str + t0: + description: + - T0 query parameter. The beginning of the timespan for the data. The maximum lookback period is 90 days from today. + type: str + t1: + description: + - T1 query parameter. The end of the timespan for the data. T1 can be a maximum of 90 days after t0. + type: str + timespan: + description: + - > + Timespan query parameter. The timespan for which the information will be fetched. If specifying timespan, do + not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 5 minutes and + be less than or equal to 90 days. The default is 7 days. + type: float +requirements: +- meraki >= 2.4.9 +- python >= 3.5 +seealso: +- name: Cisco Meraki documentation for wireless getOrganizationWirelessDevicesPacketLossByDevice + description: Complete reference of the getOrganizationWirelessDevicesPacketLossByDevice API. + link: https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-packet-loss-by-device +notes: + - SDK Method used are + wireless.Wireless.get_organization_wireless_devices_packet_loss_by_device, + + - Paths used are + get /organizations/{organizationId}/wireless/devices/packetLoss/byDevice, +""" + +EXAMPLES = r""" +- name: Get all organizations _wireless _devices _packetloss _bydevice + cisco.meraki.organizations_wireless_devices_packet_loss_by_device_info: + meraki_api_key: "{{meraki_api_key}}" + meraki_base_url: "{{meraki_base_url}}" + meraki_single_request_timeout: "{{meraki_single_request_timeout}}" + meraki_certificate_path: "{{meraki_certificate_path}}" + meraki_requests_proxy: "{{meraki_requests_proxy}}" + meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" + meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" + meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" + meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" + meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" + meraki_maximum_retries: "{{meraki_maximum_retries}}" + meraki_output_log: "{{meraki_output_log}}" + meraki_log_file_prefix: "{{meraki_log_file_prefix}}" + meraki_log_path: "{{meraki_log_path}}" + meraki_print_console: "{{meraki_print_console}}" + meraki_suppress_logging: "{{meraki_suppress_logging}}" + meraki_simulate: "{{meraki_simulate}}" + meraki_be_geo_id: "{{meraki_be_geo_id}}" + meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" + meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" + networkIds: [] + serials: [] + ssids: [] + bands: [] + perPage: 0 + startingAfter: string + endingBefore: string + t0: string + t1: string + timespan: 0 + organizationId: string + total_pages: -1 + direction: next + register: result + +""" +RETURN = r""" +meraki_response: + description: A dictionary or list with the response returned by the Cisco Meraki Python SDK + returned: always + type: list + elements: dict + sample: > + [ + { + "device": { + "mac": "string", + "name": "string", + "serial": "string" + }, + "downstream": { + "lossPercentage": 0, + "lost": 0, + "total": 0 + }, + "network": { + "id": "string", + "name": "string" + }, + "upstream": { + "lossPercentage": 0, + "lost": 0, + "total": 0 + } + } + ] +""" diff --git a/ansible_collections/cisco/meraki/plugins/modules/organizations_wireless_devices_packet_loss_by_network_info.py b/ansible_collections/cisco/meraki/plugins/modules/organizations_wireless_devices_packet_loss_by_network_info.py new file mode 100644 index 000000000..d4c7c41b8 --- /dev/null +++ b/ansible_collections/cisco/meraki/plugins/modules/organizations_wireless_devices_packet_loss_by_network_info.py @@ -0,0 +1,159 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: organizations_wireless_devices_packet_loss_by_network_info +short_description: Information module for organizations _wireless _devices _packetloss _bynetwork +description: +- Get all organizations _wireless _devices _packetloss _bynetwork. +- Get average packet loss for the given timespan for all networks in the organization. +version_added: '2.18.0' +extends_documentation_fragment: + - cisco.meraki.module_info + - cisco.meraki.module_info_pagination +author: Francisco Munoz (@fmunoz) +options: + headers: + description: Additional headers. + type: dict + organizationId: + description: + - OrganizationId path parameter. Organization ID. + type: str + networkIds: + description: + - NetworkIds query parameter. Filter results by network. + elements: str + type: list + serials: + description: + - Serials query parameter. Filter results by device. + elements: str + type: list + ssids: + description: + - Ssids query parameter. Filter results by SSID number. + elements: int + type: list + bands: + description: + - Bands query parameter. Filter results by band. Valid bands are 2.4, 5, and 6. + elements: str + type: list + perPage: + description: + - PerPage query parameter. The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. + type: int + startingAfter: + description: + - > + StartingAfter query parameter. A token used by the server to indicate the start of the page. Often this is a + timestamp or an ID but it is not limited to those. This parameter should not be defined by client + applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + type: str + endingBefore: + description: + - > + EndingBefore query parameter. A token used by the server to indicate the end of the page. Often this is a + timestamp or an ID but it is not limited to those. This parameter should not be defined by client + applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + type: str + t0: + description: + - T0 query parameter. The beginning of the timespan for the data. The maximum lookback period is 90 days from today. + type: str + t1: + description: + - T1 query parameter. The end of the timespan for the data. T1 can be a maximum of 90 days after t0. + type: str + timespan: + description: + - > + Timespan query parameter. The timespan for which the information will be fetched. If specifying timespan, do + not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 5 minutes and + be less than or equal to 90 days. The default is 7 days. + type: float +requirements: +- meraki >= 2.4.9 +- python >= 3.5 +seealso: +- name: Cisco Meraki documentation for wireless getOrganizationWirelessDevicesPacketLossByNetwork + description: Complete reference of the getOrganizationWirelessDevicesPacketLossByNetwork API. + link: https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-packet-loss-by-network +notes: + - SDK Method used are + wireless.Wireless.get_organization_wireless_devices_packet_loss_by_network, + + - Paths used are + get /organizations/{organizationId}/wireless/devices/packetLoss/byNetwork, +""" + +EXAMPLES = r""" +- name: Get all organizations _wireless _devices _packetloss _bynetwork + cisco.meraki.organizations_wireless_devices_packet_loss_by_network_info: + meraki_api_key: "{{meraki_api_key}}" + meraki_base_url: "{{meraki_base_url}}" + meraki_single_request_timeout: "{{meraki_single_request_timeout}}" + meraki_certificate_path: "{{meraki_certificate_path}}" + meraki_requests_proxy: "{{meraki_requests_proxy}}" + meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}" + meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}" + meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}" + meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}" + meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}" + meraki_maximum_retries: "{{meraki_maximum_retries}}" + meraki_output_log: "{{meraki_output_log}}" + meraki_log_file_prefix: "{{meraki_log_file_prefix}}" + meraki_log_path: "{{meraki_log_path}}" + meraki_print_console: "{{meraki_print_console}}" + meraki_suppress_logging: "{{meraki_suppress_logging}}" + meraki_simulate: "{{meraki_simulate}}" + meraki_be_geo_id: "{{meraki_be_geo_id}}" + meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}" + meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}" + networkIds: [] + serials: [] + ssids: [] + bands: [] + perPage: 0 + startingAfter: string + endingBefore: string + t0: string + t1: string + timespan: 0 + organizationId: string + total_pages: -1 + direction: next + register: result + +""" +RETURN = r""" +meraki_response: + description: A dictionary or list with the response returned by the Cisco Meraki Python SDK + returned: always + type: list + elements: dict + sample: > + [ + { + "downstream": { + "lossPercentage": 0, + "lost": 0, + "total": 0 + }, + "network": { + "id": "string", + "name": "string" + }, + "upstream": { + "lossPercentage": 0, + "lost": 0, + "total": 0 + } + } + ] +""" |