Debian Codegraph @

ansible_collections/cisco/meraki/plugins/modules/networks_appliance_traffic_shaping_rules.py

raw
1 #!/usr/bin/python
2 # -*- coding: utf-8 -*-
3
4 # Copyright (c) 2021, Cisco Systems
5 # GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)
6
7 DOCUMENTATION = r"""
8 module: networks_appliance_traffic_shaping_rules
9 short_description: Resource module for networks _appliance _trafficshaping _rules
10 description:
11 - Manage operation update of the resource networks _appliance _trafficshaping _rules.
12 - Update the traffic shaping settings rules for an MX network.
13 version_added: '1.0.0'
14 extends_documentation_fragment:
15 - cisco.meraki.module
16 author: Francisco Munoz (@fmunoz)
17 options:
18 defaultRulesEnabled:
19 description: Whether default traffic shaping rules are enabled (true) or disabled
20 (false). There are 4 default rules, which can be seen on your network's traffic
21 shaping page. Note that default rules count against the rule limit of 8.
22 type: bool
23 networkId:
24 description: NetworkId path parameter. Network ID.
25 type: str
26 rules:
27 description: An array of traffic shaping rules. Rules are applied in the order
28 that they are specified in. An empty list (or null) means no rules. Note that
29 you are allowed a maximum of 8 rules.
30 elements: dict
31 suboptions:
32 definitions:
33 description: A list of objects describing the definitions of your traffic
34 shaping rule. At least one definition is required.
35 elements: dict
36 suboptions:
37 type:
38 description: The type of definition. Can be one of 'application', 'applicationCategory',
39 'host', 'port', 'ipRange' or 'localNet'.
40 type: str
41 value:
42 description: If "type" is 'host', 'port', 'ipRange' or 'localNet', then
43 "value" must be a string, matching either a hostname (e.g. "somesite.com"),
44 a port (e.g. 8080), or an IP range ("192.1.0.0", "192.1.0.0/16", or
45 "10.1.0.0/16 80"). 'localNet' also supports CIDR notation, excluding
46 custom ports. If "type" is 'application' or 'applicationCategory', then
47 "value" must be an object with the structure { "id" "meraki layer7/..."
48 }, where "id" is the application category or application ID (for a list
49 of IDs for your network, use the trafficShaping/applicationCategories
50 endpoint).
51 type: str
52 type: list
53 dscpTagValue:
54 description: The DSCP tag applied by your rule. Null means 'Do not change
55 DSCP tag'. For a list of possible tag values, use the trafficShaping/dscpTaggingOptions
56 endpoint.
57 type: int
58 perClientBandwidthLimits:
59 description: An object describing the bandwidth settings for your rule.
60 suboptions:
61 bandwidthLimits:
62 description: The bandwidth limits object, specifying the upload ('limitUp')
63 and download ('limitDown') speed in Kbps. These are only enforced if
64 'settings' is set to 'custom'.
65 suboptions:
66 limitDown:
67 description: The maximum download limit (integer, in Kbps).
68 type: int
69 limitUp:
70 description: The maximum upload limit (integer, in Kbps).
71 type: int
72 type: dict
73 settings:
74 description: How bandwidth limits are applied by your rule. Can be one
75 of 'network default', 'ignore' or 'custom'.
76 type: str
77 type: dict
78 priority:
79 description: A string, indicating the priority level for packets bound to
80 your rule. Can be 'low', 'normal' or 'high'.
81 type: str
82 type: list
83 requirements:
84 - meraki >= 2.4.9
85 - python >= 3.5
86 seealso:
87 - name: Cisco Meraki documentation for appliance updateNetworkApplianceTrafficShapingRules
88 description: Complete reference of the updateNetworkApplianceTrafficShapingRules
89 API.
90 link: https://developer.cisco.com/meraki/api-v1/#!update-network-appliance-traffic-shaping-rules
91 notes:
92 - SDK Method used are
93 appliance.Appliance.update_network_appliance_traffic_shaping_rules,
94 - Paths used are
95 put /networks/{networkId}/appliance/trafficShaping/rules,
96 """
97
98 EXAMPLES = r"""
99 - name: Update all
100 cisco.meraki.networks_appliance_traffic_shaping_rules:
101 meraki_api_key: "{{ meraki_api_key }}"
102 meraki_base_url: "{{ meraki_base_url }}"
103 meraki_single_request_timeout: "{{ meraki_single_request_timeout }}"
104 meraki_certificate_path: "{{ meraki_certificate_path }}"
105 meraki_requests_proxy: "{{ meraki_requests_proxy }}"
106 meraki_wait_on_rate_limit: "{{ meraki_wait_on_rate_limit }}"
107 meraki_nginx_429_retry_wait_time: "{{ meraki_nginx_429_retry_wait_time }}"
108 meraki_action_batch_retry_wait_time: "{{ meraki_action_batch_retry_wait_time }}"
109 meraki_retry_4xx_error: "{{ meraki_retry_4xx_error }}"
110 meraki_retry_4xx_error_wait_time: "{{ meraki_retry_4xx_error_wait_time }}"
111 meraki_maximum_retries: "{{ meraki_maximum_retries }}"
112 meraki_output_log: "{{ meraki_output_log }}"
113 meraki_log_file_prefix: "{{ meraki_log_file_prefix }}"
114 meraki_log_path: "{{ meraki_log_path }}"
115 meraki_print_console: "{{ meraki_print_console }}"
116 meraki_suppress_logging: "{{ meraki_suppress_logging }}"
117 meraki_simulate: "{{ meraki_simulate }}"
118 meraki_be_geo_id: "{{ meraki_be_geo_id }}"
119 meraki_caller: "{{ meraki_caller }}"
120 meraki_use_iterator_for_get_pages: "{{ meraki_use_iterator_for_get_pages }}"
121 meraki_inherit_logging_config: "{{ meraki_inherit_logging_config }}"
122 state: present
123 defaultRulesEnabled: true
124 networkId: string
125 rules:
126 - definitions:
127 - type: host
128 value: google.com
129 - type: port
130 value: '9090'
131 - type: ipRange
132 value: 192.1.0.0
133 - type: ipRange
134 value: 192.1.0.0/16
135 - type: ipRange
136 value: 10.1.0.0/16:80
137 - type: localNet
138 value: 192.168.0.0/16
139 dscpTagValue: 0
140 perClientBandwidthLimits:
141 bandwidthLimits:
142 limitDown: 1000000
143 limitUp: 1000000
144 settings: custom
145 priority: normal
146 """
147 RETURN = r"""
148 meraki_response:
149 description: A dictionary or list with the response returned by the Cisco Meraki Python SDK
150 returned: always
151 type: dict
152 sample: >
153 {}
154 """