wrapanapi


Namewrapanapi JSON
Version 3.6.6 PyPI version JSON
download
home_pageNone
SummaryNone
upload_time2024-12-03 10:27:54
maintainerJitendra Yejare, Mike Shriver
docs_urlNone
authorPeter Savage
requires_python>=3.9
licenseNone
keywords api cloud distutils hatch hyperscaler
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            wrapanapi
==========

Introduction
------------
wrapanapi is a simple virtualization client with support (in varying degrees) for the following

* Red Hat Enterprize Virtualization (RHEV)
* Red Hat Openstack (RHOS)
* Red Hat Openshift
* Openshift
* VMware vCenter
* Microsoft SCVMM
* Microsoft Azure
* Google Compute Engine
* Hawkular
* Amazon EC2

It can be used to control virtualization clients and offers operations such as

* list_vm (returns a list of vm_names)
* list_template (returns a list of templates/images)
* start_vm (starts a vm)
* stop_vm (stops a vm)

Though conceptually names differ between cloud and infrastructure virtualization technologies (e.g. instance/vm)
it was decided to stick to one representation in the codebase and interface to give a singlar API across
all systems.

Installation
------------

Wrapanapi can be installed via `pip` as `pip install wrapanapi`
It is always a good idea to use virtualenv to install pip packages.

For Linux Users, Depending on the distribution you are using, you may need to install following packages
(or similar for your distribution of linux):

* libcurl-devel
* openssl-devel
* libxml2-devel
* libxml2-static
* gcc

If you are in doubt if you really need these packages, you will hit errors during installation that will make it
apparent for you to figure out that you need it.
Pycurl is a one such package that requires you to install packages like ones listed above, you can read more about it at
http://pycurl.io/docs/latest/install.html

Usage
-----
Each management system is invoked usually with a hostname and some credentials

.. code-block:: python

  from wrapanapi.virtualcenter import VMWareSystem

  system = VMWareSystem(hostname='10.0.0.0', username="root", password="password")
  system.list_vm()

Adding a new Management System
------------------------------
A management system should extend the Base class, and supply "Not Implemented" raises for items which
it doesn't support. This behaviour may change in the future as more and more diverse management systems.

.. code-block:: python

  from base import WrapanapiAPIBase

  class RHEVMSystem(WrapanapiAPIBase):

    _stats_available = {
      'num_vm': lambda self: self.api.get_summary().get_vms().total,
      'num_host': lambda self: len(self.list_host()),
      'num_cluster': lambda self: len(self.list_cluster()),
      'num_template': lambda self: len(self.list_template()),
      'num_datastore': lambda self: len(self.list_datastore()),
    }

    def __init__(self, hostname, username, password, **kwargs):
      super(RHEVMSystem, self).__init__(kwargs)

The call to ``super`` is necessary to set up the logger if noe has not been passed in with the ``logger``
keyword.

The developer can then add their own methods to interact with their own management system. Commonly accessible
statistics are generally all named the same across management systems. In this way we can treat multiple management
systems the same and use an identical method to check the number of vms on a RHEV system, to a VMware system.

Exceptions currently sit in a single module, this will probably change later with each management system having it's own
package and exceptions stored there.

This module was originally developed for assisting in the ManageIQ testing team.

Contributing
------------
The guidelines to follow for this project can be found in the
cfme `dev_guide <http://cfme-tests.readthedocs.org/guides/dev_guide.html>`_.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "wrapanapi",
    "maintainer": "Jitendra Yejare, Mike Shriver",
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "api, cloud, distutils, hatch, hyperscaler",
    "author": "Peter Savage",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/65/14/966977577d7c2c82caef1e06c22908c3ad845b6ee4dce3fb0971b93595d2/wrapanapi-3.6.6.tar.gz",
    "platform": null,
    "description": "wrapanapi\n==========\n\nIntroduction\n------------\nwrapanapi is a simple virtualization client with support (in varying degrees) for the following\n\n* Red Hat Enterprize Virtualization (RHEV)\n* Red Hat Openstack (RHOS)\n* Red Hat Openshift\n* Openshift\n* VMware vCenter\n* Microsoft SCVMM\n* Microsoft Azure\n* Google Compute Engine\n* Hawkular\n* Amazon EC2\n\nIt can be used to control virtualization clients and offers operations such as\n\n* list_vm (returns a list of vm_names)\n* list_template (returns a list of templates/images)\n* start_vm (starts a vm)\n* stop_vm (stops a vm)\n\nThough conceptually names differ between cloud and infrastructure virtualization technologies (e.g. instance/vm)\nit was decided to stick to one representation in the codebase and interface to give a singlar API across\nall systems.\n\nInstallation\n------------\n\nWrapanapi can be installed via `pip` as `pip install wrapanapi`\nIt is always a good idea to use virtualenv to install pip packages.\n\nFor Linux Users, Depending on the distribution you are using, you may need to install following packages\n(or similar for your distribution of linux):\n\n* libcurl-devel\n* openssl-devel\n* libxml2-devel\n* libxml2-static\n* gcc\n\nIf you are in doubt if you really need these packages, you will hit errors during installation that will make it\napparent for you to figure out that you need it.\nPycurl is a one such package that requires you to install packages like ones listed above, you can read more about it at\nhttp://pycurl.io/docs/latest/install.html\n\nUsage\n-----\nEach management system is invoked usually with a hostname and some credentials\n\n.. code-block:: python\n\n  from wrapanapi.virtualcenter import VMWareSystem\n\n  system = VMWareSystem(hostname='10.0.0.0', username=\"root\", password=\"password\")\n  system.list_vm()\n\nAdding a new Management System\n------------------------------\nA management system should extend the Base class, and supply \"Not Implemented\" raises for items which\nit doesn't support. This behaviour may change in the future as more and more diverse management systems.\n\n.. code-block:: python\n\n  from base import WrapanapiAPIBase\n\n  class RHEVMSystem(WrapanapiAPIBase):\n\n    _stats_available = {\n      'num_vm': lambda self: self.api.get_summary().get_vms().total,\n      'num_host': lambda self: len(self.list_host()),\n      'num_cluster': lambda self: len(self.list_cluster()),\n      'num_template': lambda self: len(self.list_template()),\n      'num_datastore': lambda self: len(self.list_datastore()),\n    }\n\n    def __init__(self, hostname, username, password, **kwargs):\n      super(RHEVMSystem, self).__init__(kwargs)\n\nThe call to ``super`` is necessary to set up the logger if noe has not been passed in with the ``logger``\nkeyword.\n\nThe developer can then add their own methods to interact with their own management system. Commonly accessible\nstatistics are generally all named the same across management systems. In this way we can treat multiple management\nsystems the same and use an identical method to check the number of vms on a RHEV system, to a VMware system.\n\nExceptions currently sit in a single module, this will probably change later with each management system having it's own\npackage and exceptions stored there.\n\nThis module was originally developed for assisting in the ManageIQ testing team.\n\nContributing\n------------\nThe guidelines to follow for this project can be found in the\ncfme `dev_guide <http://cfme-tests.readthedocs.org/guides/dev_guide.html>`_.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": null,
    "version": "3.6.6",
    "project_urls": {
        "Source": "https://github.com/RedHatQE/wrapanapi"
    },
    "split_keywords": [
        "api",
        " cloud",
        " distutils",
        " hatch",
        " hyperscaler"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "97a3a72650884d137df14e583a92cd39a1390b6ca82d18c71ebd847051a6002a",
                "md5": "0df2b0a1b647d6dbd7ecca287733202d",
                "sha256": "1c767676d04d02f372fa2d69051ea1e80a785b0459aca3d33b151b3012440200"
            },
            "downloads": -1,
            "filename": "wrapanapi-3.6.6-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0df2b0a1b647d6dbd7ecca287733202d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 148165,
            "upload_time": "2024-12-03T10:27:52",
            "upload_time_iso_8601": "2024-12-03T10:27:52.582668Z",
            "url": "https://files.pythonhosted.org/packages/97/a3/a72650884d137df14e583a92cd39a1390b6ca82d18c71ebd847051a6002a/wrapanapi-3.6.6-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6514966977577d7c2c82caef1e06c22908c3ad845b6ee4dce3fb0971b93595d2",
                "md5": "eeb8b70fd51ca01752e8be071fa2d94f",
                "sha256": "4a9ed8506fc627b4c8f55bd199929595d81ed4891a29c252c720b4e2c108f4d3"
            },
            "downloads": -1,
            "filename": "wrapanapi-3.6.6.tar.gz",
            "has_sig": false,
            "md5_digest": "eeb8b70fd51ca01752e8be071fa2d94f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 129604,
            "upload_time": "2024-12-03T10:27:54",
            "upload_time_iso_8601": "2024-12-03T10:27:54.640523Z",
            "url": "https://files.pythonhosted.org/packages/65/14/966977577d7c2c82caef1e06c22908c3ad845b6ee4dce3fb0971b93595d2/wrapanapi-3.6.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-03 10:27:54",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "RedHatQE",
    "github_project": "wrapanapi",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "wrapanapi"
}
        
Elapsed time: 0.70511s