Debian Codegraph @

docs/getting-started.md

raw symbols SCIP
1 ---
2 title: Getting Started
3 hide:
4 - tags
5 tags:
6 - Getting Started
7 - CLI
8 - Inventory
9 - Catalog
10 ---
11
12 <!--
13 ~ Copyright (c) 2023-2026 Arista Networks, Inc.
14 ~ Use of this source code is governed by the Apache License 2.0
15 ~ that can be found in the LICENSE file.
16 -->
17
18 This section shows how to use ANTA with basic configuration. All examples are based on Arista Test Drive (ATD) topology you can access by reaching out to your preferred SE.
19
20 ## Installation
21
22 The easiest way to install ANTA package is to run Python (`>=3.10`) and its pip package to install:
23
24 ```bash
25 pip install anta[cli]
26 ```
27
28 For more details about how to install package, please see the [requirements and installation](./requirements-and-installation.md) section.
29
30 ## Configure Arista EOS devices
31
32 For ANTA to be able to connect to your target devices, you need to configure your management interface.
33
34 ```eos
35 vrf instance MGMT
36 !
37 interface Management0
38 description oob_management
39 vrf MGMT
40 ip address 192.168.0.10/24
41 !
42 ```
43
44 Then, configure access to eAPI:
45
46 ```eos
47 !
48 management api http-commands
49 protocol https port 443
50 no shutdown
51 vrf MGMT
52 no shutdown
53 !
54 !
55 ```
56
57 ## Create your inventory
58
59 ANTA uses an inventory to list the target devices for the tests. You can create a file manually with this format:
60
61 ```yaml
62 --8<-- "getting-started/inventory.yml"
63 ```
64
65 > You can read more details about how to build your inventory [here](usage-inventory-catalog.md#device-inventory)
66
67 ## Test Catalog
68
69 To test your network, ANTA relies on a test catalog to list all the tests to run against your inventory. A test catalog references Python classes in a YAML file.
70
71 The structure to follow is like:
72
73 ```yaml
74 <anta_tests_submodule>:
75 - <AntaTest subclass>:
76 <AntaTest.Input field>:
77 <AntaTest.Input field value>
78 ```
79
80 > You can read more details about how to build your catalog [here](usage-inventory-catalog.md#test-catalog)
81
82 Here is an example for basic tests:
83
84 ```yaml
85 --8<-- "getting-started/catalog.yml"
86 ```
87
88 ## Test your network
89
90 ### CLI
91
92 ANTA comes with a generic CLI entrypoint to run tests in your network. It requires an inventory file as well as a test catalog.
93
94 This entrypoint has multiple options to manage test coverage and reporting.
95
96 ```bash
97 --8<-- "anta_help.txt"
98 ```
99
100 To run the NRFU, you need to select an output format amongst [`csv`, `json`, `md-report`, `table`, `text`, `tpl-report`].
101
102 For a first usage, `table` is recommended. By default, all test results for all devices are rendered, but it can be changed to a report per test case or per host.
103
104 ```bash
105 --8<-- "anta_nrfu_help.txt"
106 ```
107
108 !!! Note
109 The following examples show how to pass all the CLI options.
110
111 See how to use environment variables instead in the [CLI overview](cli/overview.md#anta-environment-variables)
112
113 #### Default report using table
114
115 ```bash
116 --8<-- "getting-started/anta_nrfu_table.sh"
117 --8<-- "getting-started/anta_nrfu_table.output"
118 ```
119
120 #### Report in text mode
121
122 ```bash
123 --8<-- "getting-started/anta_nrfu_text.sh"
124 --8<-- "getting-started/anta_nrfu_text.output"
125 ```
126
127 #### Report in JSON format
128
129 ```bash
130 --8<-- "getting-started/anta_nrfu_json.sh"
131 --8<-- "getting-started/anta_nrfu_json.output"
132 ```
133
134 ### Basic usage in a Python script
135
136 ```python
137 --8<-- "anta_runner.py"
138 ```