Skip to content
This repository was archived by the owner on Sep 7, 2023. It is now read-only.

Commit

Permalink
Merge pull request #1 from networktocode-llc/update_README
Browse files Browse the repository at this point in the history
Updated README and travis
  • Loading branch information
qduk authored Jul 6, 2021
2 parents c5812b2 + e1fd31d commit 4acfe8b
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 32 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ env:
# Each version of Nautobot listed here must have a corresponding directory/configuration file
# under development/nautobot_<NAUTOBOT_VER>/configuration.py
matrix:
- "INVOKE_NAUTOBOT-CHATOPS-EXTENSION-ARISTA_NAUTOBOT_VER=1.0.0"
- "INVOKE_NAUTOBOT_CHATOPS_EXTENSION_ARISTA_NAUTOBOT_VER=1.0.1"
# Add your encrypted secret below, you can encrypt secret using "travis encrypt"
# https://docs.travis-ci.com/user/environment-variables/#defining-encrypted-variables-in-travisyml
# global:
Expand All @@ -29,8 +29,8 @@ script:
# If you want to test different versions, it may require updating the poetry definition for Nautobot
# as that is where the version is controlled
# - "poetry add nautobot=$NAUTOBOT_VER"
- "INVOKE_NAUTOBOT-CHATOPS-EXTENSION-ARISTA_PYTHON_VER=$TRAVIS_PYTHON_VERSION invoke build --no-cache"
- "INVOKE_NAUTOBOT-CHATOPS-EXTENSION-ARISTA_PYTHON_VER=$TRAVIS_PYTHON_VERSION invoke tests --failfast"
- "INVOKE_NAUTOBOT_CHATOPS_EXTENSION_ARISTA_PYTHON_VER=$TRAVIS_PYTHON_VERSION invoke build --no-cache"
- "INVOKE_NAUTOBOT_CHATOPS_EXTENSION_ARISTA_PYTHON_VER=$TRAVIS_PYTHON_VERSION invoke tests --failfast"
# --------------------------------------------------------------------------
# Deploy
# Uncomment the section below if you would like to publish a new release to pypi automatically
Expand Down
64 changes: 36 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,57 @@
# Nautobot Chatops Extension Arista

A plugin for [Nautobot](https://github.com/nautobot/nautobot).
An extension for [Nautobot](https://github.com/nautobot/nautobot) [Chatops Plugin](https://github.com/nautobot/nautobot-plugin-chatops/)

## Installation
### Build Status

The plugin is available as a Python package in pypi and can be installed with pip
| Branch | Status |
|-------------|------------|
| **main** | [![Build Status](https://travis-ci.com/networktocode-llc/nautobot-chatops-extension-cloudvision.svg?token=BknroZ7vxquiYcUvP8RC&branch=main)](https://travis-ci.com/networktocode-llc/nautobot-chatops-extension-cloudvision) |
| **develop** | [![Build Status](https://travis-ci.com/networktocode-llc/nautobot-chatops-extension-cloudvision.svg?token=BknroZ7vxquiYcUvP8RC&branch=develop)](https://travis-ci.com/networktocode-llc/nautobot-chatops-extension-cloudvision) |

The extension is available as a Python package in PyPI and can be installed with pip

```shell
pip install nautobot-chatops-extension-arista
pip install git+https://github.com/networktocode-llc/nautobot-chatops-extension-cloudvision.git
```

> The plugin is compatible with Nautobot 1.0.0 and higher
This ChatOps Extension to Nautobot ChatOps Plugin requires environment variables to be set up depending on if you are using a CVAAS (Cloudvision as a Service) or Cloudvision on-premise.

To ensure Nautobot Chatops Extension Arista is automatically re-installed during future upgrades, create a file named `local_requirements.txt` (if not already existing) in the Nautobot root directory (alongside `requirements.txt`) and list the `nautobot-chatops-extension-arista` package:
For CVAAS the following environment variables must be set.

```no-highlight
# echo nautobot-chatops-extension-arista >> local_requirements.txt
```
- `CVAAS_TOKEN`: Token generated from CVAAS service account. Documentation for that process can be found [here](https://www.arista.com/assets/data/pdf/qsg/qsg-books/QS_CloudVision_as_a_Service.pdf) in section 1.7

Once installed, the plugin needs to be enabled in your `nautobot_configuration.py`
For on premise instance of Cloudvision, these environment variables must be set.

```python
# In your configuration.py
PLUGINS = ["nautobot_chatops_extension_arista"]
- `CVP_USERNAME`: The username that will be used to authenticate to Cloudvision.
- `CVP_PASSWORD`: The password for the configured username.
- `CVP_HOST`: The IP or hostname of the on premise Cloudvision appliance.
- `CVP_INSECURE`: If this is set to `True`, the appliance cert will be downloaded and automatically trusted. Otherwise, the appliance is expected to have a valid certificate.
- `ON_PREM`: By default this is set to False, this must be changed to `True` if using an on-prem instance of Cloudvision.

# PLUGINS_CONFIG = {
# "nautobot_chatops_extension_arista": {
# ADD YOUR SETTINGS HERE
# }
# }
Once you have updated your environment file, restart both nautobot and nautobot-worker

```
$ sudo systemctl restart nautobot nautobot-worker
```

The plugin behavior can be controlled with the following list of settings
## Usage

- TODO
### Command setup

## Usage
Add a slash command to Slack called `/cloudvision`.
See the [nautobot-chatops installation guide](https://github.com/nautobot/nautobot-plugin-chatops/blob/develop/docs/chat_setup.md) for instructions on adding a slash command to your Slack channel.

### API
The following commands are available:

TODO
- `get-devices-in-container [container-name]`: Retrieves all the devices assigned to the specificied container.
- `get-configlet [configlet-name]`: Get the configuration of the specified configlet.
- `get-device-configuration [device-name]`: Get the configuration of the specified device.
- `get-task-logs [task-id]`: Get the logs of the specified task.
- `get-applied-configlets [filter-type] [filter-value]`: Get applied configlets to either a specified container or device.
- `get-active-events [filter-type] [filter-value] [start-time] [end-time]`: Get active events in a given time frame. Filter-type can be filtered by device, type or severity. Filter-value is dynamically created based on the filter-type. Start-time accepts ISO time format as well as relative time inputs. Examples of that are `-2w`, `-2d`, `-2h` which will go back two weeks, two days and two hours, respectively.
- `get-applied-image-bundles [filter-type] [image-bundle-name]`: Gets the devices and containers an image bundle is applied to. Can also specify the `all` parameter to get a list of all the image bundles on Cloudvision.
- `get-device-cve [device-name]`: Gets all the CVEs of the specified device. Can also specifiy the `all` parameter to get a count of CVE account for each device.

## Contributing

Expand Down Expand Up @@ -89,7 +101,7 @@ nautobot_chatops_extension_arista:
poetry shell
poetry install --extras nautobot
export $(cat development/dev.env | xargs)
export $(cat development/creds.env | xargs)
export $(cat development/creds.env | xargs)
invoke start && sleep 5
nautobot-server migrate
```
Expand Down Expand Up @@ -167,7 +179,3 @@ Project documentation is generated by [mkdocs](https://www.mkdocs.org/) from the

For any questions or comments, please check the [FAQ](FAQ.md) first and feel free to swing by the [Network to Code slack channel](https://networktocode.slack.com/) (channel #networktocode).
Sign up [here](http://slack.networktocode.com/)

## Screenshots

TODO
2 changes: 1 addition & 1 deletion development/dev.env
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ NAPALM_TIMEOUT=5
NAUTOBOT_ROOT=/opt/nautobot
POSTGRES_DB=nautobot
POSTGRES_HOST=postgres
POSTGRES_USER=nautbot
POSTGRES_USER=nautobot
REDIS_HOST=redis
REDIS_PORT=6379
# REDIS_SSL=True
Expand Down

0 comments on commit 4acfe8b

Please sign in to comment.