Debian Codegraph @

ansible_collections/dellemc/enterprise_sonic/docs/dellemc.enterprise_sonic.sonic_drop_counter_module.rst

raw
1 .. _dellemc.enterprise_sonic.sonic_drop_counter_module:
2
3
4 *******************************************
5 dellemc.enterprise_sonic.sonic_drop_counter
6 *******************************************
7
8 **Manage drop counter configuration on SONiC**
9
10
11 Version added: 3.1.0
12
13 .. contents::
14 :local:
15 :depth: 1
16
17
18 Synopsis
19 --------
20 - This module provides configuration management of drop counter for devices running SONiC
21
22
23
24
25 Parameters
26 ----------
27
28 .. raw:: html
29
30 <table border=0 cellpadding=0 class="documentation-table">
31 <tr>
32 <th colspan="2">Parameter</th>
33 <th>Choices/<font color="blue">Defaults</font></th>
34 <th width="100%">Comments</th>
35 </tr>
36 <tr>
37 <td colspan="2">
38 <div class="ansibleOptionAnchor" id="parameter-"></div>
39 <b>config</b>
40 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
41 <div style="font-size: small">
42 <span style="color: purple">list</span>
43 / <span style="color: purple">elements=dictionary</span>
44 </div>
45 </td>
46 <td>
47 </td>
48 <td>
49 <div>List of drop counter configurations</div>
50 </td>
51 </tr>
52 <tr>
53 <td class="elbow-placeholder"></td>
54 <td colspan="1">
55 <div class="ansibleOptionAnchor" id="parameter-"></div>
56 <b>alias</b>
57 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
58 <div style="font-size: small">
59 <span style="color: purple">string</span>
60 </div>
61 </td>
62 <td>
63 </td>
64 <td>
65 <div>Alias of drop counter</div>
66 </td>
67 </tr>
68 <tr>
69 <td class="elbow-placeholder"></td>
70 <td colspan="1">
71 <div class="ansibleOptionAnchor" id="parameter-"></div>
72 <b>counter_description</b>
73 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
74 <div style="font-size: small">
75 <span style="color: purple">string</span>
76 </div>
77 </td>
78 <td>
79 </td>
80 <td>
81 <div>Description of drop counter</div>
82 </td>
83 </tr>
84 <tr>
85 <td class="elbow-placeholder"></td>
86 <td colspan="1">
87 <div class="ansibleOptionAnchor" id="parameter-"></div>
88 <b>counter_type</b>
89 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
90 <div style="font-size: small">
91 <span style="color: purple">string</span>
92 </div>
93 </td>
94 <td>
95 <ul style="margin: 0; padding: 0"><b>Choices:</b>
96 <li>PORT_INGRESS_DROPS</li>
97 </ul>
98 </td>
99 <td>
100 <div>Type of drop counter</div>
101 </td>
102 </tr>
103 <tr>
104 <td class="elbow-placeholder"></td>
105 <td colspan="1">
106 <div class="ansibleOptionAnchor" id="parameter-"></div>
107 <b>enable</b>
108 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
109 <div style="font-size: small">
110 <span style="color: purple">boolean</span>
111 </div>
112 </td>
113 <td>
114 <ul style="margin: 0; padding: 0"><b>Choices:</b>
115 <li>no</li>
116 <li>yes</li>
117 </ul>
118 </td>
119 <td>
120 <div>Enable drop counter</div>
121 </td>
122 </tr>
123 <tr>
124 <td class="elbow-placeholder"></td>
125 <td colspan="1">
126 <div class="ansibleOptionAnchor" id="parameter-"></div>
127 <b>group</b>
128 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
129 <div style="font-size: small">
130 <span style="color: purple">string</span>
131 </div>
132 </td>
133 <td>
134 </td>
135 <td>
136 <div>Group of drop counter</div>
137 </td>
138 </tr>
139 <tr>
140 <td class="elbow-placeholder"></td>
141 <td colspan="1">
142 <div class="ansibleOptionAnchor" id="parameter-"></div>
143 <b>mirror</b>
144 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
145 <div style="font-size: small">
146 <span style="color: purple">string</span>
147 </div>
148 </td>
149 <td>
150 </td>
151 <td>
152 <div>Mirror session to mirror the drop counter</div>
153 </td>
154 </tr>
155 <tr>
156 <td class="elbow-placeholder"></td>
157 <td colspan="1">
158 <div class="ansibleOptionAnchor" id="parameter-"></div>
159 <b>name</b>
160 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
161 <div style="font-size: small">
162 <span style="color: purple">string</span>
163 / <span style="color: red">required</span>
164 </div>
165 </td>
166 <td>
167 </td>
168 <td>
169 <div>Name of drop counter</div>
170 </td>
171 </tr>
172 <tr>
173 <td class="elbow-placeholder"></td>
174 <td colspan="1">
175 <div class="ansibleOptionAnchor" id="parameter-"></div>
176 <b>reasons</b>
177 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
178 <div style="font-size: small">
179 <span style="color: purple">list</span>
180 / <span style="color: purple">elements=string</span>
181 </div>
182 </td>
183 <td>
184 <ul style="margin: 0; padding: 0"><b>Choices:</b>
185 <li>ACL_ANY</li>
186 <li>ANY</li>
187 <li>DIP_LINK_LOCAL</li>
188 <li>EXCEEDS_L3_MTU</li>
189 <li>FDB_AND_BLACKHOLE_DISCARDS</li>
190 <li>IP_HEADER_ERROR</li>
191 <li>L3_EGRESS_LINK_DOWN</li>
192 <li>MPLS_MISS</li>
193 <li>SIP_LINK_LOCAL</li>
194 <li>SMAC_EQUALS_DMAC</li>
195 </ul>
196 </td>
197 <td>
198 <div>List of drop counter reasons</div>
199 </td>
200 </tr>
201
202 <tr>
203 <td colspan="2">
204 <div class="ansibleOptionAnchor" id="parameter-"></div>
205 <b>state</b>
206 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
207 <div style="font-size: small">
208 <span style="color: purple">string</span>
209 </div>
210 </td>
211 <td>
212 <ul style="margin: 0; padding: 0"><b>Choices:</b>
213 <li><div style="color: blue"><b>merged</b>&nbsp;&larr;</div></li>
214 <li>deleted</li>
215 <li>replaced</li>
216 <li>overridden</li>
217 </ul>
218 </td>
219 <td>
220 <div>The state of the configuration after module completion</div>
221 </td>
222 </tr>
223 </table>
224 <br/>
225
226
227 Notes
228 -----
229
230 .. note::
231 - Tested against Enterprise SONiC Distribution by Dell Technologies
232 - Supports ``check_mode``
233
234
235
236 Examples
237 --------
238
239 .. code-block:: yaml
240
241 # Using "merged" state
242 #
243 # Before state:
244 # -------------
245 #
246 # sonic# show running-configuration dropcounters
247 # (No 'dropcounters' configuration present)
248
249 - name: Merge drop counter configuration
250 dellemc.enterprise_sonic.sonic_drop_counter:
251 config:
252 - name: counter1
253 alias: c1
254 counter_description: abc
255 counter_type: PORT_INGRESS_DROPS
256 enable: true
257 group: group1
258 mirror: session1
259 reasons:
260 - ANY
261 state: merged
262
263 # After state:
264 # ------------
265 #
266 # sonic# show running-configuration dropcounters
267 # !
268 # dropcounters counter1
269 # enable
270 # type PORT_INGRESS_DROPS
271 # alias c1
272 # group group1
273 # description "abc"
274 # mirror session1
275 # add-reason ANY
276
277
278 # Using "replaced" state
279 #
280 # Before state:
281 # -------------
282 #
283 # sonic# show running-configuration dropcounters
284 # !
285 # dropcounters counter1
286 # enable
287 # type PORT_INGRESS_DROPS
288 # alias c1
289 # group group1
290 # description "abc"
291 # mirror session1
292 # add-reason ANY
293 # !
294 # dropcounters counter2
295 # no enable
296 # type PORT_INGRESS_DROPS
297 # alias drop2
298 # group group2
299 # description "xyz789"
300 # add-reason IP_HEADER_ERROR,L3_EGRESS_LINK_DOWN,SMAC_EQUALS_DMAC
301
302 - name: Replace drop counter configuration
303 dellemc.enterprise_sonic.sonic_drop_counter:
304 config:
305 - name: counter1
306 counter_description: abc123
307 state: replaced
308
309 # After state:
310 # ------------
311 #
312 # sonic# show running-configuration dropcounters
313 # !
314 # dropcounters counter1
315 # description "abc123"
316 # !
317 # dropcounters counter2
318 # no enable
319 # type PORT_INGRESS_DROPS
320 # alias drop2
321 # group group2
322 # description "xyz789"
323 # add-reason IP_HEADER_ERROR,L3_EGRESS_LINK_DOWN,SMAC_EQUALS_DMAC
324
325
326 # Using "overridden" state
327 #
328 # Before state:
329 # -------------
330 #
331 # sonic# show running-configuration dropcounters
332 # !
333 # dropcounters counter1
334 # enable
335 # type PORT_INGRESS_DROPS
336 # alias c1
337 # group group1
338 # description "abc"
339 # mirror session1
340 # add-reason ANY
341 # !
342 # dropcounters counter2
343 # no enable
344 # type PORT_INGRESS_DROPS
345 # alias drop2
346 # group group2
347 # description "xyz789"
348 # add-reason IP_HEADER_ERROR,L3_EGRESS_LINK_DOWN,SMAC_EQUALS_DMAC
349
350 - name: Override drop counter configuration
351 dellemc.enterprise_sonic.sonic_drop_counter:
352 config:
353 - name: counter3
354 alias: c3
355 counter_description: qwerty
356 counter_type: PORT_INGRESS_DROPS
357 enable: true
358 group: group3
359 mirror: session2
360 reasons:
361 - ACL_ANY
362 - FDB_AND_BLACKHOLE_DISCARDS
363 state: overridden
364
365 # After state:
366 # ------------
367 #
368 # sonic# show running-configuration dropcounters
369 # !
370 # dropcounters counter3
371 # enable
372 # type PORT_INGRESS_DROPS
373 # alias c3
374 # group group3
375 # description "qwerty"
376 # mirror session2
377 # add-reason ACL_ANY,FDB_AND_BLACKHOLE_DISCARDS
378
379
380 # Using "deleted" state
381 #
382 # Before state:
383 # -------------
384 #
385 # sonic# show running-configuration dropcounters
386 # !
387 # dropcounters counter1
388 # enable
389 # type PORT_INGRESS_DROPS
390 # alias c1
391 # group group1
392 # description "abc"
393 # mirror session1
394 # add-reason ANY
395 # !
396 # dropcounters counter2
397 # no enable
398 # type PORT_INGRESS_DROPS
399 # alias drop2
400 # group group2
401 # description "xyz789"
402 # add-reason IP_HEADER_ERROR,L3_EGRESS_LINK_DOWN,SMAC_EQUALS_DMAC
403
404 - name: Delete drop counter configuration
405 dellemc.enterprise_sonic.sonic_drop_counter:
406 config:
407 - name: counter1
408 alias: c1
409 counter_description: abc
410 - name: counter2
411 state: deleted
412
413 # After state:
414 # ------------
415 #
416 # sonic# show running-configuration dropcounters
417 # !
418 # dropcounters counter1
419 # enable
420 # type PORT_INGRESS_DROPS
421 # group group1
422 # mirror session1
423 # add-reason ANY
424
425
426 # Using "deleted" state
427 #
428 # Before state:
429 # -------------
430 #
431 # sonic# show running-configuration dropcounters
432 # !
433 # dropcounters counter1
434 # enable
435 # type PORT_INGRESS_DROPS
436 # group group1
437 # mirror session1
438 # add-reason ANY
439
440 - name: Delete all drop counter configuration
441 dellemc.enterprise_sonic.sonic_drop_counter:
442 config:
443 state: deleted
444
445 # After state:
446 # ------------
447 #
448 # (No 'dropcounters' configuration present)
449
450
451
452 Return Values
453 -------------
454 Common return values are documented `here <https://docs.ansible.com/projects/ansible/latest/reference_appendices/common_return_values.html#common-return-values>`_, the following are the fields unique to this module:
455
456 .. raw:: html
457
458 <table border=0 cellpadding=0 class="documentation-table">
459 <tr>
460 <th colspan="1">Key</th>
461 <th>Returned</th>
462 <th width="100%">Description</th>
463 </tr>
464 <tr>
465 <td colspan="1">
466 <div class="ansibleOptionAnchor" id="return-"></div>
467 <b>after</b>
468 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
469 <div style="font-size: small">
470 <span style="color: purple">list</span>
471 </div>
472 </td>
473 <td>when changed</td>
474 <td>
475 <div>The configuration resulting from module invocation.</div>
476 <br/>
477 </td>
478 </tr>
479 <tr>
480 <td colspan="1">
481 <div class="ansibleOptionAnchor" id="return-"></div>
482 <b>after_generated</b>
483 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
484 <div style="font-size: small">
485 <span style="color: purple">list</span>
486 </div>
487 </td>
488 <td>when <code>check_mode</code></td>
489 <td>
490 <div>The generated configuration from module invocation.</div>
491 <br/>
492 </td>
493 </tr>
494 <tr>
495 <td colspan="1">
496 <div class="ansibleOptionAnchor" id="return-"></div>
497 <b>before</b>
498 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
499 <div style="font-size: small">
500 <span style="color: purple">list</span>
501 </div>
502 </td>
503 <td>always</td>
504 <td>
505 <div>The configuration prior to the module invocation.</div>
506 <br/>
507 </td>
508 </tr>
509 <tr>
510 <td colspan="1">
511 <div class="ansibleOptionAnchor" id="return-"></div>
512 <b>commands</b>
513 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
514 <div style="font-size: small">
515 <span style="color: purple">list</span>
516 </div>
517 </td>
518 <td>always</td>
519 <td>
520 <div>The set of commands pushed to the remote device.</div>
521 <br/>
522 <div style="font-size: smaller"><b>Sample:</b></div>
523 <div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">[&#x27;command 1&#x27;, &#x27;command 2&#x27;, &#x27;command 3&#x27;]</div>
524 </td>
525 </tr>
526 </table>
527 <br/><br/>
528
529
530 Status
531 ------
532
533
534 Authors
535 ~~~~~~~
536
537 - S\. Talabi (@stalabi1)