Skip to main content

A base system for provider management

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

Project description

.. image:: https://landscape.io/github/ManageIQ/wrapanapi/master/landscape.svg?style=fla
:scale: 50 %
:alt: Health Status
:align: left
:target: (https://landscape.io/github/ManageIQ/wrapanapi/master
.. image:: https://coveralls.io/repos/ManageIQ/wrapanapi/badge.svg?branch=master&service=github
:scale: 50 %
:alt: Coverage Status
:align: left
:target: https://coveralls.io/github/ManageIQ/wrapanapi?branch=master
.. image:: https://travis-ci.org/ManageIQ/wrapanapi.svg
:scale: 50 %
:alt: Build Status
:align: left
:target: https://travis-ci.org/ManageIQ/wrapanapi

mgmtsystem
==========

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

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

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.

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

.. code-block:: python

from mgmtsystem.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 MgmtSystemAPIBase

class RHEVMSystem(MgmtSystemAPIBase):

_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>`_.

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

mgmtsystem-1.3.8.tar.gz (69.5 kB view details)

Uploaded Source

File details

Details for the file mgmtsystem-1.3.8.tar.gz.

File metadata

  • Download URL: mgmtsystem-1.3.8.tar.gz
  • Upload date:
  • Size: 69.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for mgmtsystem-1.3.8.tar.gz
Algorithm Hash digest
SHA256 fc0823d34edea11c292641a49cc5597dd5b41086235707ff49b66338b2775e31
MD5 41b4cd30071da6b5d25a15d4276321c6
BLAKE2b-256 8c41b270dd23df8c8b023a2ac78ded3ae3ae13b7b3848bb7ca1506688f1dff19

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