Skip to main content

Python API Client for CCC

Project description

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

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

  • Install prerequisites: pip install requests jsonschema
  • Simple usage
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 BartC01n1-091
node = client.nodes.show_node("BartC01n1-091")
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 image/no-image/network group
                  - Get/Add actions/features of node 
                |   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 | ------------- | | image_capture_deployment | Image Capture Deployment | --------------- | | power_operation | Power operations | | application | application entrypoints, settings | Section 4.1 | | architecture | architecture | -------------- | | management_cards | View network devices, interfaces, routes | ------------- | | tasks | Tasks Operations | Section 4.7 | | conn | Sessions Operations | Section 4.6 |

License

This project is license under the MIT license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cccapi-0.0.3.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cccapi-0.0.3-py3-none-any.whl (14.0 kB view details)

Uploaded Python 3

File details

Details for the file cccapi-0.0.3.tar.gz.

File metadata

  • Download URL: cccapi-0.0.3.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.22

File hashes

Hashes for cccapi-0.0.3.tar.gz
Algorithm Hash digest
SHA256 511f7ef40690a5b778855e7bf4fc3a57dda5b879aedd3320a648975805c9b98d
MD5 bf3f182e50463050a1d95315b0b2f9cb
BLAKE2b-256 9dc647b9bfc001309fdc708aefde50c63d0f17e8215bef07dc959718628d84fd

See more details on using hashes here.

File details

Details for the file cccapi-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: cccapi-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 14.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.22

File hashes

Hashes for cccapi-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 111667be53dc13c6e0473d4e96dec5d0b62a90dc1b098461b7cbe3910fd049b7
MD5 c20e98b903185e12fbf0a5b7b74ff07e
BLAKE2b-256 8709d60ae1a2b6e6cd49ba51de272c6b07a26f02fe07239a8a2101b8c4f3fd54

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page