Arista XML API
arista_xml_server ¶
This module provides classes for managing and querying Arista XML data.
Classes: AristaXmlBase: Base class for Arista XML data management. AristaXmlQuerier: Class to query Arista XML data for Software versions. AristaXmlObject: Base class for Arista XML data management with specific software and version. EosXmlObject: Class to query Arista XML data for EOS versions.
AristaXmlBase ¶
AristaXmlBase(
token: Union[str, None] = None,
xml_path: Union[str, None] = None,
)
Base class for Arista XML data management.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
token
|
Union[str, None]
|
Authentication token. Defaults to None. |
None
|
xml_path
|
Union[str, None]
|
Path to the XML file. Defaults to None. |
None
|
Returns:
Type | Description |
---|---|
None
|
|
Source code in eos_downloader/logics/arista_xml_server.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
|
AristaXmlObject ¶
AristaXmlObject(
searched_version: str,
image_type: str,
token: Union[str, None] = None,
xml_path: Union[str, None] = None,
)
Bases: AristaXmlBase
Base class for Arista XML data management.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
searched_version
|
str
|
The version of the software to search for. |
required |
image_type
|
str
|
The type of image to download. |
required |
token
|
Union[str, None]
|
Authentication token. Defaults to None. |
None
|
xml_path
|
Union[str, None]
|
Path to the XML file. Defaults to None. |
None
|
Returns:
Type | Description |
---|---|
None
|
|
Source code in eos_downloader/logics/arista_xml_server.py
271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 |
|
filename
property
¶
filename: Union[str, None]
urls
property
¶
urls: Dict[str, Union[str, None]]
Get URLs to download files from Arista server for given software and version.
This method will return a dictionary with file type as key and URL as value. It returns URL for the following items: ‘image’, ‘md5sum’, and ‘sha512sum’.
Returns:
Type | Description |
---|---|
Dict[str, Union[str, None]]
|
Dictionary with file type as key and URL as value. |
Raises:
Type | Description |
---|---|
ValueError
|
If filename or hash file is not found. |
hash_filename ¶
hash_filename() -> Union[str, None]
Helper to build filename for checksum to search on arista.com.
Returns:
Type | Description |
---|---|
Union[str, None]
|
Filename to search for on Arista.com. |
Source code in eos_downloader/logics/arista_xml_server.py
322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 |
|
path_from_xml ¶
path_from_xml(search_file: str) -> Union[str, None]
Parse XML to find path for a given file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
search_file
|
str
|
File to search for. |
required |
Returns:
Type | Description |
---|---|
Union[str, None]
|
Path from XML if found, None otherwise. |
Source code in eos_downloader/logics/arista_xml_server.py
338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 |
|
AristaXmlQuerier ¶
AristaXmlQuerier(
token: Union[str, None] = None,
xml_path: Union[str, None] = None,
)
Bases: AristaXmlBase
Class to query Arista XML data for Software versions.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
token
|
Union[str, None]
|
Authentication token. Defaults to None. |
None
|
xml_path
|
Union[str, None]
|
Path to the XML file. Defaults to None. |
None
|
Returns:
Type | Description |
---|---|
None
|
|
Source code in eos_downloader/logics/arista_xml_server.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
|
available_public_versions ¶
available_public_versions(
branch: Union[str, None] = None,
rtype: Union[str, None] = None,
package: AristaPackage = "eos",
) -> List[AristaVersions]
Get list of available public EOS versions from Arista website.
This method parses XML data to extract available EOS or CVP versions based on specified criteria.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
branch
|
Union[str, None]
|
Branch number to filter versions (e.g. “4.29”). Defaults to None. |
None
|
rtype
|
Union[str, None]
|
Release type to filter versions. Must be one of the valid release types defined in RTYPES. Defaults to None. |
None
|
package
|
AristaPackage
|
Type of package to look for - either ‘eos’ or ‘cvp’. Defaults to ‘eos’. |
'eos'
|
Returns:
Type | Description |
---|---|
List[AristaVersions]
|
List of version objects (EosVersion or CvpVersion) matching the criteria. |
Raises:
Type | Description |
---|---|
ValueError
|
If provided rtype is not in the list of valid release types. |
Examples:
>>> server.available_public_eos_version(branch="4.29", rtype="INT", package="eos")
[EosVersion('4.29.0F-INT'), EosVersion('4.29.1F-INT'), ...]
Source code in eos_downloader/logics/arista_xml_server.py
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 |
|
branches ¶
branches(
package: eos_downloader.models.types.AristaPackage = "eos",
latest: bool = False,
) -> List[str]
Returns a list of valid EOS version branches.
The branches are determined based on the available public EOS versions. When latest=True, only the most recent branch is returned.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
package
|
AristaPackage
|
Type of package to look for - either ‘eos’ or ‘cvp’. Defaults to ‘eos’. |
'eos'
|
latest
|
bool
|
If True, returns only the latest branch version. Defaults to False. |
False
|
Returns:
Type | Description |
---|---|
List[str]
|
A list of branch version strings. Contains single latest version if latest=True, otherwise all available versions sorted descendingly. |
Source code in eos_downloader/logics/arista_xml_server.py
205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 |
|
latest ¶
latest(
package: eos_downloader.models.types.AristaPackage = "eos",
branch: Union[str, None] = None,
rtype: Union[
eos_downloader.models.types.ReleaseType, None
] = None,
) -> AristaVersions
Get latest branch from semver standpoint.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
package
|
AristaPackage
|
Type of package to look for - either ‘eos’ or ‘cvp’. Defaults to ‘eos’. |
'eos'
|
branch
|
Union[str, None]
|
Branch to search for. Defaults to None. |
None
|
rtype
|
Union[ReleaseType, None]
|
Release type to search for. Defaults to None. |
None
|
Returns:
Type | Description |
---|---|
AristaVersions
|
Latest version found. |
Raises:
Type | Description |
---|---|
ValueError
|
If no versions are found to run the max() function. |
Source code in eos_downloader/logics/arista_xml_server.py
164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 |
|
CvpXmlObject ¶
CvpXmlObject(
searched_version: str,
image_type: str,
token: Union[str, None] = None,
xml_path: Union[str, None] = None,
)
Bases: AristaXmlObject
Class to query Arista XML data for CVP versions.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
searched_version
|
str
|
The version of the software to search for. |
required |
image_type
|
str
|
The type of image to download. |
required |
token
|
Union[str, None]
|
The authentication token. Defaults to None. |
None
|
xml_path
|
Union[str, None]
|
The path to the XML file. Defaults to None. |
None
|
Returns:
Type | Description |
---|---|
None
|
|
Source code in eos_downloader/logics/arista_xml_server.py
495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 |
|
EosXmlObject ¶
EosXmlObject(
searched_version: str,
image_type: str,
token: Union[str, None] = None,
xml_path: Union[str, None] = None,
)
Bases: AristaXmlObject
Class to query Arista XML data for EOS versions.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
searched_version
|
str
|
The version of the software to search for. |
required |
image_type
|
str
|
The type of image to download. |
required |
token
|
Union[str, None]
|
The authentication token. Defaults to None. |
None
|
xml_path
|
Union[str, None]
|
The path to the XML file. Defaults to None. |
None
|
Returns:
Type | Description |
---|---|
None
|
|
Source code in eos_downloader/logics/arista_xml_server.py
441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 |
|