Metadata-Version: 2.4
Name: ndn
Version: 0.0.0
Summary: ndn cli
Author-email: DreamHost <admin@dreamhost.com>
License: Apache Software License 2.0
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE.md
Requires-Dist: cement==3.0.10
Requires-Dist: cement[colorlog]
Requires-Dist: cement[jinja2]
Requires-Dist: cement[yaml]
Requires-Dist: colorlog
Requires-Dist: cryptography
Requires-Dist: hvac
Requires-Dist: jinja2
Requires-Dist: packaging
Requires-Dist: pytz
Requires-Dist: pyyaml
Requires-Dist: ruamel.yaml
Requires-Dist: tabulate
Requires-Dist: towerlib
Dynamic: license-file

# DH CLI for operations

## Basic Overview

This tool is meant to be a one-stop-shop for all things NDN/Dreamhost related. It provides CLI access
to interacting with the tools and infrastructure that make up Dreamhost. This includes things like the
Machine object, Cluster objects, ServiceControls, Ansible, etc.

Example:
```
$ ndn login  # logs in to the microservice APIs with your LDAP credentials and fetches a JWT token
$ ndn vault login  # logs in to vault and fetches a vault token (does not require vault CLI client)
$ ndn machine info sled12345  # displays machine info for sled12345
```

This tool uses the python-cement framework which provides help for each command/sub-command. If you are
stuck, or would like to see what options you have, simply add the `--help` flag to get some information.

```
$ ndn --help  # lists help info for all top-level modules
$ ndn service --help  # lists help info for the service module
$ ndn service param --help  # lists help info for the param submodule of the service module
```

Many of the modules in this tool leverage APIs for their information/actions. Thus, many of the services
this tool provides do not have any additional requirements.  However, a few services do have client-side
requirements, such as the `ndn db connect` feature.

## Installation

This project hsa been tested to work with python versions 3.8, 3.9, 3.10, and 3.11..

If you have this git repository checked out, you can install your local checkout with:
```
$ make setup
```

If you do not wish/need to checkout this git repo, you can install this python package with:
```
$ pip install git+https://git.dreamhost.com/dreamhost/python-ndn-cli.git#egg=ndn
```

## Development

This project includes a number of helpers in the `Makefile` to streamline common development tasks.

### Environment Setup

The following demonstrates setting up and working with a development environment:

```
### create a virtualenv for development
$ make setup
$ source env/bin/activate

### run ndn cli application
$ ndn --help

### run pytest / coverage
$ make test
```

## Deployments

### Docker

Included is a basic `Dockerfile` for building and distributing `ndn`,
and can be built with the included `make` helper:

```
$ make docker
$ touch /home/user/.vault /home/user/.ndnauth
$ docker run -v /home/user/.vault:/home/py-ndn-cli/.vault -v /home/usr/.ndnauth:/home/py-ndn-cli/.ndnauth -it ndn --help
```


## Colorizing

This gist is a pretty good reference for ANSI escape codes used for colorizing jinja templates:
https://gist.github.com/fnky/458719343aabd01cfb17a3a4f7296797
