Skip to content

Commit

Permalink
doc: Add more content to documentation website (#111)
Browse files Browse the repository at this point in the history
  • Loading branch information
titom73 authored Dec 15, 2024
1 parent 4401029 commit c5a2e1f
Show file tree
Hide file tree
Showing 9 changed files with 151 additions and 24 deletions.
13 changes: 1 addition & 12 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,7 @@ pip install eos-downloader
ardl --token <your-token> get eos --format 64 --latest --release-type M
```

> [!NOTE]
> The main branch is not the stable branch and can be broken between releases. It is safe to consider using tags for stable versions. All versions on pypi servers are considered stable.
## FAQ

On EVE-NG, you may have to install/upgrade __pyOpenSSL__ in version `23.0.0`:

```bash
# Error when running ardl: AttributeError: module 'lib' has no attribute 'X509_V_FLAG_CB_ISSUER_CHECK'

$ pip install pyopenssl --upgrade
```
<img src='imgs/readme.webp' width="800" height="600" class="center" />

## Author

Expand Down
1 change: 1 addition & 0 deletions docs/api/defaults.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
## ::: eos_downloader.defaults
11 changes: 11 additions & 0 deletions docs/faq.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Frequently Asked Questions

## EVE-NG with OpenSSL issue.

On EVE-NG, you may have to install/upgrade __pyOpenSSL__ in version `23.0.0`:

```bash
# Error when running ardl: AttributeError: module 'lib' has no attribute 'X509_V_FLAG_CB_ISSUER_CHECK'

$ pip install pyopenssl --upgrade
```
Binary file added docs/imgs/readme.webp
Binary file not shown.
8 changes: 8 additions & 0 deletions docs/stylesheets/extra.material.css
Original file line number Diff line number Diff line change
Expand Up @@ -243,3 +243,11 @@ h5.doc-heading {
/* Avoid to capitalize h5 headers for mkdocstrings */
text-transform: none;
}


.center {
display: block;
margin-left: auto;
margin-right: auto;
/* width: 50%; */
}
35 changes: 35 additions & 0 deletions docs/usage/cvp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Download CloudVision package from arista website

This command gives you option to download EOS images localy. Some options are available based on image type like importing your cEOS container in your local registry

```bash
# Get latest version of CVP in Vvmware format
ardl get cvp --latest --format ova

# Get latest version of CVP in upgrade format
ardl get eos --branch 4.29 --format upgrade
```

## ardl get eos options

Below are all the options available to get EOS package:

```bash
$ ardl get cvp --help
Usage: ardl get cvp [OPTIONS]

Download CVP image from Arista server.

Options:
--format TEXT Image format [default: ova]
--output PATH Path to save image [default: .]
--latest Get latest version. If --branch is not use, get the latest
branch with specific release type
--version TEXT EOS version to download
--branch TEXT Branch to download
--dry-run Enable dry-run mode: only run code without system changes
--help Show this message and exit.
```

!!! info
You can get information about available version using the [`ardl info version` cli](./info.md)
77 changes: 77 additions & 0 deletions docs/usage/mapping.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Get information about software mapping

`ardl` comes with a tool to get all supoprted package format for both CVP and EOS softwares. It helps to know which format to use for a specific file extension.

## Get information about available versions

```bash
$ ardl info mapping --help
Usage: ardl info mapping [OPTIONS]

List available flavors of Arista packages (eos or CVP) packages.

Options:
--package [eos|cvp]
--format [json|text|fancy] Output format
--details Show details for each flavor
--help Show this message and exit.
```

## Usage example

With this CLI, you can specify either a branch or a release type when applicable to filter information:


```bash
# Get list of supported packages for EOS.
$ ardl info mapping --package eos
Log Level is: error

╭─────────────────────────── Flavors ───────────────╮
│ │
* Flavor: 64 │
* Flavor: INT │
* Flavor: 2GB-INT │
* Flavor: cEOS │
* Flavor: cEOS64 │
* Flavor: vEOS │
* Flavor: vEOS-lab │
* Flavor: EOS-2GB │
* Flavor: RN │
* Flavor: SOURCE │
* Flavor: default │
│ │
╰───────────────────────────────────────────────────╯

# Get list of supported packages for EOS with filename information
$ ardl info mapping --package eos
Log Level is: error

╭─────────────────────────────────────────────────── Flavors ─────────╮
│ │
* Flavor: 64 │
│ - Information: extension='.swi' prepend='EOS64'
* Flavor: INT │
│ - Information: extension='-INT.swi' prepend='EOS'
* Flavor: 2GB-INT │
│ - Information: extension='-INT.swi' prepend='EOS-2GB'
* Flavor: cEOS │
│ - Information: extension='.tar.xz' prepend='cEOS-lab'
* Flavor: cEOS64 │
│ - Information: extension='.tar.xz' prepend='cEOS64-lab'
* Flavor: vEOS │
│ - Information: extension='.vmdk' prepend='vEOS'
* Flavor: vEOS-lab │
│ - Information: extension='.vmdk' prepend='vEOS-lab'
* Flavor: EOS-2GB │
│ - Information: extension='.swi' prepend='EOS-2GB'
* Flavor: RN │
│ - Information: extension='-' prepend='RN'
* Flavor: SOURCE │
│ - Information: extension='-source.tar' prepend='EOS'
* Flavor: default │
│ - Information: extension='.swi' prepend='EOS'
│ │
╰─────────────────────────────────────────────────────────────────────╯

```
26 changes: 14 additions & 12 deletions eos_downloader/defaults.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
# coding: utf-8 -*-
"""Default values for eos_downloader.
"""
Default values for eos_downloader.
This module contains default configuration values used by the eos_downloader package.
Constants:
DEFAULT_REQUEST_HEADERS (dict): Default HTTP headers used for API requests
Contains Content-Type and User-Agent headers
DEFAULT_SOFTWARE_FOLDER_TREE (str): API endpoint URL for retrieving the EOS software folder structure
DEFAULT_DOWNLOAD_URL (str): API endpoint URL for getting download links for EOS images
DEFAULT_SERVER_SESSION (str): API endpoint URL for obtaining session codes from Arista's servers
Attributes
----------
DEFAULT_REQUEST_HEADERS : dict
Default HTTP headers used for API requests. Contains Content-Type and User-Agent headers.
DEFAULT_SOFTWARE_FOLDER_TREE : str
API endpoint URL for retrieving the EOS software folder structure.
DEFAULT_DOWNLOAD_URL : str
API endpoint URL for getting download links for EOS images.
DEFAULT_SERVER_SESSION : str
API endpoint URL for obtaining session codes from Arista's servers.
EVE_QEMU_FOLDER_PATH : str
Path to the folder where the downloaded EOS images will be stored on an EVE-NG server.
"""


DEFAULT_REQUEST_HEADERS = {
"Content-Type": "application/json",
"User-Agent": "Chrome/123.0.0.0",
Expand All @@ -27,5 +30,4 @@

DEFAULT_SERVER_SESSION = "https://www.arista.com/custom_data/api/cvp/getSessionCode/"

# Path to the folder where the downloaded EOS images will be stored on an EVE-NG server.
EVE_QEMU_FOLDER_PATH = "/opt/unetlab/addons/qemu/"
4 changes: 4 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,9 @@ nav:
- Home: README.md
- Usage:
- Get EOS package: usage/eos.md
- Get CVP package: usage/cvp.md
- Version information: usage/info.md
- Software mapping: usage/mapping.md
- Code documentation:
- Models:
- Version: api/models/version.md
Expand All @@ -174,4 +176,6 @@ nav:
- Arista XML API: api/logics/arista_xml_server.md
- Download Management: api/logics/download.md
- Helpers: api/helpers.md
- Defaults: api/defaults.md
- FAQ: faq.md

0 comments on commit c5a2e1f

Please sign in to comment.