RedHatQE / openshift-cluster-management-python-wrapper

Apache License 2.0
1 stars 7 forks source link

openshift-cluster-management-python-wrapper

Wrapper for openshift-cluster-management-python client

Release new version

requirements:

Run the following once (execute outside repository dir, for example ~/):

sudo npm install --global release-it
npm install --save-dev @release-it/bumper

usage:

Installation

From source:

git clone https://github.com/RedHatQE/openshift-cluster-management-python-client.git
cd openshift-cluster-management-python-client
python setup.py install --user

Examples

Client

from ocm_python_wrapper.ocm_client import OCMPythonClient
ocm_client = OCMPythonClient(
    token=<ocm api token>>,
    endpoint=<endpoint url>,
    api_host=<production or stage>,
    discard_unknown_keys=True,
)
return ocm_client.client

Cluster

from ocm_python_wrapper.cluster import Cluster
cluster = Cluster(client=client, name=<cluster name>)
cluster_ocp_version = cluster.instance.version.raw_id