ccc_client
This package provides a simple, modular SDK for the CCC REST API.
Features
- Automatically handles authentication and renewal
- Graceful error management
- Logically organized modules
- Easily maintained
Installation
Requirements:
- Python 3.8 or higher
- Required packages: requests>=2.26.0, jsonschema>=4.23.0
Install using pip:
pip install cccAPI
Install from source:
git clone https://github.hpe.com/hpe/cccAPI.git
cd cccAPI
pip install -e .
Quick Start
Initialize the Client
import json
from cccAPI import cccAPIClient
client = cccAPIClient("https://localhost:8000/cmu/v1", "root", "your-password")
Example Usage
Get Nodes
nodes = client.nodes.show_nodes()
print(json.dumps(nodes, indent=4))
Get specific Node
#Specific node named Node1
node = client.nodes.show_node("Node1")
print(json.dumps(node, indent=4))
Get specific Node/fields
- Allowed fields are:
query_params = {"fields": "name,id,uuid,network.name,network.ipAddress,network.macAddress"}
specific_nodes=client.nodes.show_nodes(query_params)
print(json.dumps(specific_nodes, indent=4))
See examples/test.py for other test cases as implemented
API Modules
| Module | Description | User Guide Section |
|---|---|---|
nodes |
Node Operations: Create/Delete/Update/List Nodes, Add/Remove nodes in groups, Manage node features | Section 4.5 |
image_groups |
Image Group Operations | Section 4.3 |
network_groups |
Network Group Operations | Section 4.4 |
custom_groups |
Custom Group Operations | Section 4.2 |
resource_features |
Resource Features Management | Section 4.8 |
image_capture_deployment |
Image Capture and Deployment Operations | Section 4.9 |
power_operation |
Power Operations Management | Section 4.10 |
application |
Application Entrypoints and Settings | Section 4.1 |
architecture |
Architecture Management | Section 4.11 |
management_cards |
Network Devices, Interfaces, and Routes Management | Section 4.12 |
tasks |
Tasks Operations | Section 4.7 |
conn |
Sessions Operations | Section 4.6 |
Building and Publishing
Local Development
There are several ways to install the package for local development:
- Direct pip install:
pip install .
- Using pip-tools (recommended for development):
pip install pip-tools
pip-compile pyproject.toml # Produces requirements.txt
pip install -r requirements.txt
- Using uv (faster installation):
curl -LsSf https://astral.sh/uv/install.sh | sh
uv pip install -e . --system
- Building distribution packages:
pip install build
python -m build # Creates dist/ with tar.gz and .whl
Publishing to PyPI
- Ensure you have the required tools:
pip install setuptools wheel twine
- Build the distribution:
python -m build
# Or alternatively:
# python3 setup.py sdist bdist_wheel
- Upload to PyPI (requires ~/.pypirc with PyPI token):
twine upload dist/*
You can verify the installation by downloading the published package:
pip install cccAPI=={version} # Replace {version} with desired version
License
This project is license under the MIT license.
Metadata
Release files for cccAPI 0.0.14
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| cccapi-0.0.14.tar.gz | 21.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cccapi-0.0.14-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 51.5 kB
Release files / cccapi-0.0.14.tar.gz
| Download URL | cccapi-0.0.14.tar.gz |
|---|---|
| Size | 21.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
89eacaa3abeec6a10b087806030c5134b6d73953b9fc87aae8c8a67054abd15d
|
|
BLAKE2b-256 checksum How to use checksums |
fcd9dd9a2dd313f07ec50e4c778007ef784a8ef87f541cba8baff941315c69d3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.3
|
Release files / cccapi-0.0.14-py3-none-any.whl
| Download URL | cccapi-0.0.14-py3-none-any.whl |
|---|---|
| Size | 30.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e961b919a25db3d28e117e1ae8c5c0f35d4d2d622f3a3d3b47f8af74b395fdd7
|
|
BLAKE2b-256 checksum How to use checksums |
9bbc01db041fe9f1d16ee575a7b1aaef58b06b697f0c7ad754bf8d51c69318bd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.3
|
Security for cccAPI 0.0.14
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.