Overview

Python library and Command Line Interface (CLI) for HPE Container Platform (HPECP).

This library is beta. The API of this library may be unstable and subject to change until this library reaches GA.

Library Example

Example basic usage with variables passed to client constructor:

First install the library - then from your python environment …

from hpecp import ContainerPlatformClient

client = ContainerPlatformClient(username='admin',
                              password='admin123',
                              api_host='127.0.0.1',
                              api_port=8080,
                              use_ssl=True,
                              verify_ssl='/certs/hpecp-ca-cert.pem')

client.create_session() # Login

client.k8s_cluster.list().tabulate(columns=['description', 'id'])

Example basic usage with config file:

cat > ~/.hpecp.conf <<EOF
[default]
api_host = 127.0.0.1
api_port = 8080
use_ssl = True
verify_ssl = False
warn_ssl = False
username = admin
password = admin123
EOF
from hpecp import ContainerPlatformClient

client = ContainerPlatformClient.create_from_config_file().create_session()

client.k8s_cluster.list().tabulate(columns=['description', 'id'])

CLI Example

First create a configuration file.

cat > ~/.hpecp.conf <<EOF
[default]
api_host = 127.0.0.1
api_port = 8080
use_ssl = True
verify_ssl = False
warn_ssl = False
username = admin
password = admin123
EOF

Now install the CLI. After installing, the CLI will be available as hpecp:

hpecp license platform-id

>>> aa8716be-bc74-4ffa-b838-d92e6934d224

To find out what capabilities are available, enter:

hpecp help

Contents