Metadata-Version: 2.4
Name: python-doniclient
Version: 1.0.4
Summary: This is a plugin for the openstack commandline client, to enable support for the Doni hardware inventory project
Author-email: Chameleon Cloud <contact@chameleoncloud.org>
License-Expression: Apache-2.0
Project-URL: Repository, https://github.com/ChameleonCloud/python-doniclient
Classifier: Environment :: OpenStack
Classifier: Intended Audience :: Information Technology
Classifier: Intended Audience :: System Administrators
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: osc-lib
Requires-Dist: python-dateutil
Requires-Dist: PyYAML>=5.4.1
Requires-Dist: keystoneauth1

# ChameleonCloud Python Doniclient CLI

![ChameleonCloud Logo](https://www.chameleoncloud.org/static/images/logo.png)

Welcome to the ChameleonCloud Python Doniclient CLI repository! This command-line interface (CLI) provides a convenient way to interact with ChameleonCloud's Doni hardware inventory project, enabling you to manage and automate various hardware-related tasks.

## Table of Contents

- [Installation](#installation)
- [Authentication](#authentication)
- [Usage](#usage)
- [Testing](#testing)
- [Contributing](#contributing)

## Installation

You can install the ChameleonCloud Python Doniclient CLI using pip:

```bash
pip install python-doniclient
```

### Cython sources issue
if you encounter an error message citing cython sources, please run the following to downgrade cython to a compatible version and use PyYaml 6.0+
```pip install "cython<3.0.0"```

## Authentication
Environment variables are the primary authentication method. Please refer to the [documentation on OpenRC scripts](https://chameleoncloud.readthedocs.io/en/latest/technical/cli.html#the-openstack-rc-script)  to learn more about how to download and source your authentication credentials for the CLI;

## Usage
To use the CLI, you can run the `openstack hardware` command followed by the desired subcommand. `openstack hardware --help` shows all the subcommands available. Here's a basic usage examples:

### List all hardware in the Doni database.

```bash
openstack hardware list
```

Options:

- --all: List hardware from all owners (requires admin rights).
- --long: Include all columns in the output.
- --worker-type <worker_type>: Filter by worker type.
- --worker-state <worker_state>: Filter by worker state (choices: PENDING, IN_PROGRESS, ERROR, STEADY).

For more details on specific commands and their options use --help or -h

### Create hardware in the Doni database

```bash
openstack hardware create --name <hardware_name> --hardware-type <hardware_type> --property <property_name>=<property_value>
```

### List specific hardware item in Doni using name or uuid.

```bash
openstack hardware get <hardware_uuid>
```

```bash
openstack hardware get <hardware_name>
```

### Set properties and name of an existing hardware item.

```bash
openstack hardware set <hardware_uuid> --name <new_hardware_name> --property <property_name>=<new_property_value>
```

Sets new name and property for the item `<hardware_uuid>`

```bash
openstack hardware set <hardware_name> --property <property_name>=<new_property_value>
```

Sets property for the item `<hardware_name`

### Unset properties of an existing hardware item.

```bash
openstack hardware unset <hardware_uuid> --property <property_name>
```

Unsets property `<property_name>` for the item `<hardware_uuid`

```bash
openstack hardware update <hardware_name> --property <property_name>=<new_property_value>
```

Unsets property `<property_name>` for the item `<hardware_name>`
