/client-python

An auto-generated python SDK to interact with KubeVirt resources

Primary LanguagePython

kubevirt-py

This is KubeVirt API an add-on for Kubernetes.

This Python package is automatically generated by the Swagger Codegen project:

  • API version: 1.0.0
  • Package version: v0.8.0-74-g27961727
  • Build package: io.swagger.codegen.languages.PythonClientCodegen For more information, please visit https://github.com/kubevirt/kubevirt

Requirements.

Python 2.7 and 3.4+

Installation & Usage

pip install

If the python package is hosted on Github, you can install directly from Github

pip install git+https://github.com/kubevirt/client-python.git

(you may need to run pip with root permission: sudo pip install git+https://github.com/kubevirt/client-python.git)

Then import the package:

import kubevirt 

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

import kubevirt

Getting Started

Please follow the installation procedure and then run the following:

from __future__ import print_function
import time
import kubevirt
from kubevirt.rest import ApiException
from pprint import pprint

# Configure API key authorization: BearerToken
kubevirt.configuration.api_key['authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# kubevirt.configuration.api_key_prefix['authorization'] = 'Bearer'
# create an instance of the API class
api_instance = kubevirt.DefaultApi()

try:
    # Health endpoint
    api_instance.check_health()
except ApiException as e:
    print("Exception when calling DefaultApi->check_health: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to https://localhost

Class Method HTTP request Description
DefaultApi check_health GET /apis/kubevirt.io/v1alpha2/healthz Health endpoint
DefaultApi console GET /apis/subresources.kubevirt.io/v1alpha2/namespaces/{namespace}/virtualmachineinstances/{name}/console Open a websocket connection to a serial console on the specified VirtualMachineInstance.
DefaultApi create_namespaced_virtual_machine POST /apis/kubevirt.io/v1alpha2/namespaces/{namespace}/virtualmachines Create a VirtualMachine object.
DefaultApi create_namespaced_virtual_machine_instance POST /apis/kubevirt.io/v1alpha2/namespaces/{namespace}/virtualmachineinstances Create a VirtualMachineInstance object.
DefaultApi create_namespaced_virtual_machine_instance_preset POST /apis/kubevirt.io/v1alpha2/namespaces/{namespace}/virtualmachineinstancepresets Create a VirtualMachineInstancePreset object.
DefaultApi create_namespaced_virtual_machine_instance_replica_set POST /apis/kubevirt.io/v1alpha2/namespaces/{namespace}/virtualmachineinstancereplicasets Create a VirtualMachineInstanceReplicaSet object.
DefaultApi delete_collection_namespaced_virtual_machine DELETE /apis/kubevirt.io/v1alpha2/namespaces/{namespace}/virtualmachines Delete a collection of VirtualMachine objects.
DefaultApi delete_collection_namespaced_virtual_machine_instance DELETE /apis/kubevirt.io/v1alpha2/namespaces/{namespace}/virtualmachineinstances Delete a collection of VirtualMachineInstance objects.
DefaultApi delete_collection_namespaced_virtual_machine_instance_preset DELETE /apis/kubevirt.io/v1alpha2/namespaces/{namespace}/virtualmachineinstancepresets Delete a collection of VirtualMachineInstancePreset objects.
DefaultApi delete_collection_namespaced_virtual_machine_instance_replica_set DELETE /apis/kubevirt.io/v1alpha2/namespaces/{namespace}/virtualmachineinstancereplicasets Delete a collection of VirtualMachineInstanceReplicaSet objects.
DefaultApi delete_namespaced_virtual_machine DELETE /apis/kubevirt.io/v1alpha2/namespaces/{namespace}/virtualmachines/{name} Delete a VirtualMachine object.
DefaultApi delete_namespaced_virtual_machine_instance DELETE /apis/kubevirt.io/v1alpha2/namespaces/{namespace}/virtualmachineinstances/{name} Delete a VirtualMachineInstance object.
DefaultApi delete_namespaced_virtual_machine_instance_preset DELETE /apis/kubevirt.io/v1alpha2/namespaces/{namespace}/virtualmachineinstancepresets/{name} Delete a VirtualMachineInstancePreset object.
DefaultApi delete_namespaced_virtual_machine_instance_replica_set DELETE /apis/kubevirt.io/v1alpha2/namespaces/{namespace}/virtualmachineinstancereplicasets/{name} Delete a VirtualMachineInstanceReplicaSet object.
DefaultApi get_api_group GET /apis Get a KubeVirt API GroupList
DefaultApi get_api_group_0 GET /apis/kubevirt.io Get a KubeVirt API group
DefaultApi get_api_group_1 GET /apis/subresources.kubevirt.io Get a KubeVirt API Group
DefaultApi get_api_resources GET /apis/kubevirt.io/v1alpha2 Get KubeVirt API Resources
DefaultApi get_api_resources_0 GET /apis/subresources.kubevirt.io/v1alpha2 Get a KubeVirt API resources
DefaultApi list_namespaced_virtual_machine GET /apis/kubevirt.io/v1alpha2/namespaces/{namespace}/virtualmachines Get a list of VirtualMachine objects.
DefaultApi list_namespaced_virtual_machine_instance GET /apis/kubevirt.io/v1alpha2/namespaces/{namespace}/virtualmachineinstances Get a list of VirtualMachineInstance objects.
DefaultApi list_namespaced_virtual_machine_instance_preset GET /apis/kubevirt.io/v1alpha2/namespaces/{namespace}/virtualmachineinstancepresets Get a list of VirtualMachineInstancePreset objects.
DefaultApi list_namespaced_virtual_machine_instance_replica_set GET /apis/kubevirt.io/v1alpha2/namespaces/{namespace}/virtualmachineinstancereplicasets Get a list of VirtualMachineInstanceReplicaSet objects.
DefaultApi list_virtual_machine_for_all_namespaces GET /apis/kubevirt.io/v1alpha2/virtualmachines Get a list of all VirtualMachine objects.
DefaultApi list_virtual_machine_instance_for_all_namespaces GET /apis/kubevirt.io/v1alpha2/virtualmachineinstances Get a list of all VirtualMachineInstance objects.
DefaultApi list_virtual_machine_instance_preset_for_all_namespaces GET /apis/kubevirt.io/v1alpha2/virtualmachineinstancepresets Get a list of all VirtualMachineInstancePreset objects.
DefaultApi list_virtual_machine_instance_replica_set_for_all_namespaces GET /apis/kubevirt.io/v1alpha2/virtualmachineinstancereplicasets Get a list of all VirtualMachineInstanceReplicaSet objects.
DefaultApi patch_namespaced_virtual_machine PATCH /apis/kubevirt.io/v1alpha2/namespaces/{namespace}/virtualmachines/{name} Patch a VirtualMachine object.
DefaultApi patch_namespaced_virtual_machine_instance PATCH /apis/kubevirt.io/v1alpha2/namespaces/{namespace}/virtualmachineinstances/{name} Patch a VirtualMachineInstance object.
DefaultApi patch_namespaced_virtual_machine_instance_preset PATCH /apis/kubevirt.io/v1alpha2/namespaces/{namespace}/virtualmachineinstancepresets/{name} Patch a VirtualMachineInstancePreset object.
DefaultApi patch_namespaced_virtual_machine_instance_replica_set PATCH /apis/kubevirt.io/v1alpha2/namespaces/{namespace}/virtualmachineinstancereplicasets/{name} Patch a VirtualMachineInstanceReplicaSet object.
DefaultApi read_namespaced_virtual_machine GET /apis/kubevirt.io/v1alpha2/namespaces/{namespace}/virtualmachines/{name} Get a VirtualMachine object.
DefaultApi read_namespaced_virtual_machine_instance GET /apis/kubevirt.io/v1alpha2/namespaces/{namespace}/virtualmachineinstances/{name} Get a VirtualMachineInstance object.
DefaultApi read_namespaced_virtual_machine_instance_preset GET /apis/kubevirt.io/v1alpha2/namespaces/{namespace}/virtualmachineinstancepresets/{name} Get a VirtualMachineInstancePreset object.
DefaultApi read_namespaced_virtual_machine_instance_replica_set GET /apis/kubevirt.io/v1alpha2/namespaces/{namespace}/virtualmachineinstancereplicasets/{name} Get a VirtualMachineInstanceReplicaSet object.
DefaultApi replace_namespaced_virtual_machine PUT /apis/kubevirt.io/v1alpha2/namespaces/{namespace}/virtualmachines/{name} Update a VirtualMachine object.
DefaultApi replace_namespaced_virtual_machine_instance PUT /apis/kubevirt.io/v1alpha2/namespaces/{namespace}/virtualmachineinstances/{name} Update a VirtualMachineInstance object.
DefaultApi replace_namespaced_virtual_machine_instance_preset PUT /apis/kubevirt.io/v1alpha2/namespaces/{namespace}/virtualmachineinstancepresets/{name} Update a VirtualMachineInstancePreset object.
DefaultApi replace_namespaced_virtual_machine_instance_replica_set PUT /apis/kubevirt.io/v1alpha2/namespaces/{namespace}/virtualmachineinstancereplicasets/{name} Update a VirtualMachineInstanceReplicaSet object.
DefaultApi test GET /apis/subresources.kubevirt.io/v1alpha2/namespaces/{namespace}/virtualmachineinstances/{name}/test Test endpoint verifying apiserver connectivity.
DefaultApi version GET /apis/subresources.kubevirt.io/v1alpha2/version
DefaultApi vnc GET /apis/subresources.kubevirt.io/v1alpha2/namespaces/{namespace}/virtualmachineinstances/{name}/vnc Open a websocket connection to connect to VNC on the specified VirtualMachineInstance.
DefaultApi watch_namespaced_virtual_machine GET /apis/kubevirt.io/v1alpha2/watch/namespaces/{namespace}/virtualmachines Watch a VirtualMachine object.
DefaultApi watch_namespaced_virtual_machine_instance GET /apis/kubevirt.io/v1alpha2/watch/namespaces/{namespace}/virtualmachineinstances Watch a VirtualMachineInstance object.
DefaultApi watch_namespaced_virtual_machine_instance_preset GET /apis/kubevirt.io/v1alpha2/watch/namespaces/{namespace}/virtualmachineinstancepresets Watch a VirtualMachineInstancePreset object.
DefaultApi watch_namespaced_virtual_machine_instance_replica_set GET /apis/kubevirt.io/v1alpha2/watch/namespaces/{namespace}/virtualmachineinstancereplicasets Watch a VirtualMachineInstanceReplicaSet object.
DefaultApi watch_virtual_machine_instance_list_for_all_namespaces GET /apis/kubevirt.io/v1alpha2/watch/virtualmachineinstances Watch a VirtualMachineInstanceList object.
DefaultApi watch_virtual_machine_instance_preset_list_for_all_namespaces GET /apis/kubevirt.io/v1alpha2/watch/virtualmachineinstancepresets Watch a VirtualMachineInstancePresetList object.
DefaultApi watch_virtual_machine_instance_replica_set_list_for_all_namespaces GET /apis/kubevirt.io/v1alpha2/watch/virtualmachineinstancereplicasets Watch a VirtualMachineInstanceReplicaSetList object.
DefaultApi watch_virtual_machine_list_for_all_namespaces GET /apis/kubevirt.io/v1alpha2/watch/virtualmachines Watch a VirtualMachineList object.

Documentation For Models

Documentation For Authorization

BearerToken

  • Type: API key
  • API key parameter name: authorization
  • Location: HTTP header

Author

kubevirt-dev@googlegroups.com