Permalink
Browse files

Virtual Machines Report 1.0

git-svn-id: http://zenpacks.zenoss.org/svn/zenpacks@147 db08cffe-75b9-45d1-af1a-46ad9ef135f6
  • Loading branch information...
0 parents commit f5271c49a327f3d82eaa8e35c52b7ae5b4c95aba Matt Ray committed Apr 2, 2009
@@ -0,0 +1 @@
+__import__('pkg_resources').declare_namespace(__name__)
@@ -0,0 +1,8 @@
+
+import Globals
+import os.path
+
+skinsDir = os.path.join(os.path.dirname(__file__), 'skins')
+from Products.CMFCore.DirectoryView import registerDirectory
+if os.path.isdir(skinsDir):
+ registerDirectory(skinsDir, globals())
@@ -0,0 +1,2 @@
+# __init__.py
+
@@ -0,0 +1 @@
+# __init__.py
@@ -0,0 +1 @@
+# __init__.py
@@ -0,0 +1,3 @@
+<?xml version="1.0"?>
+<objects>
+</objects>
@@ -0,0 +1,69 @@
+<tal:block tal:define="
+ objectsTemp1 python:[ d.virtualmachines() for d in here.dmd.Devices.Server.ESX.getSubDevices() if d.hasObject('virtualmachines') and len(d.virtualmachines()) != 0 ];
+ objects python:[];
+ objectsTemp2 python:[ objects.extend(v) for v in objectsTemp1 ];
+ objects python: (hasattr(request, 'doExport') and list(objects)) or objects;
+ tableName string: vmList;
+ batch python:here.ZenTableManager.getBatch(tableName,objects,
+ sortedHeader='vmDisplayName');
+ exportFields python:[('vmDisplayName','Name'),('vmVMID','VMID'),('vmGuestOS','Guest OS'),('vmState','VM State'),('vmGuestState','Guest State'),('getParentDeviceName','ESX Host')]
+">
+<tal:block metal:use-macro="here/reportMacros/macros/exportableReport">
+<tal:block metal:fill-slot="report">
+ <tal:block metal:use-macro="here/templates/macros/page1">
+ <tal:block metal:fill-slot="breadCrumbPane">
+ <span metal:use-macro="here/miscmacros/macros/reportBreadCrumbsList"/>
+ </tal:block>
+ <tal:block metal:fill-slot="contentPane">
+ <form method="POST" tal:attributes="action request/URL;"
+ tal:define="tabletitle string: Virtual Machine List;
+ showfilterbox python:True;
+ tblcolspan string:3">
+ <tal:block metal:use-macro="here/zenuimacros/macros/zentable">
+ <tal:block metal:fill-slot="zentablecontents">
+<tr>
+ <th tal:replace="structure python:here.ZenTableManager.getTableHeader(
+ tableName,'vmDisplayName','Name','cmp')"/>
+ <th tal:replace="structure python:here.ZenTableManager.getTableHeader(
+ tableName,'vmVMID','VMID','cmp')"/>
+ <th tal:replace="structure python:here.ZenTableManager.getTableHeader(
+ tableName,'vmGuestOS','Guest OS','cmp')"/>
+ <th tal:replace="structure python:here.ZenTableManager.getTableHeader(
+ tableName,'vmState','VM State','cmp')"/>
+ <th tal:replace="structure python:here.ZenTableManager.getTableHeader(
+ tableName,'vmGuestState','Guest State','cmp')"/>
+ <th tal:replace="structure python:here.ZenTableManager.getTableHeader(
+ tableName,'getParentDeviceName','ESX Host','cmp')"/>
+</tr>
+ <tal:block tal:repeat="r batch">
+ <tr tal:define="odd repeat/r/odd; link r/managedDeviceLink; hostLink r/getParentDeviceUrl"
+ tal:attributes="class python:test(odd,'odd','even')">
+ <td class="tablevalues">
+ <span tal:content="structure r/urlLink"/>
+ <span tal:condition="link" tal:omit-tag>
+ (<span tal:replace="structure r/managedDeviceLink"/>)
+ </span>
+ </td>
+ <td class="tablevalues" tal:content="r/vmVMID"/>
+ <td class="tablevalues" tal:content="r/vmGuestOS"/>
+ <td class="tablevalues" tal:content="r/vmState"/>
+ <td class="tablevalues" tal:content="r/vmGuestState"/>
+ <td><a tal:attributes="href r/getParentDeviceUrl"
+ tal:content="r/getParentDeviceName"/>
+ </tr>
+ </tal:block>
+ <tr>
+ <td colspan="0" class="tableheader" align='center'>
+ <form metal:use-macro="here/zenTableNavigation/macros/navtool"/>
+ </td>
+ </tr>
+</tal:block>
+</tal:block>
+</form>
+
+</tal:block>
+
+</tal:block>
+</tal:block>
+</tal:block>
+</tal:block>
@@ -0,0 +1 @@
+__import__('pkg_resources').declare_namespace(__name__)
@@ -0,0 +1,75 @@
+################################
+# These variables are overwritten by Zenoss when the ZenPack is exported
+# or saved. Do not modify them directly here.
+# NB: PACKAGES is deprecated
+NAME = 'ZenPacks.sodonnell.VMReport'
+VERSION = '1.0'
+AUTHOR = 'Steven O\'Donnell'
+LICENSE = ''
+NAMESPACE_PACKAGES = ['ZenPacks', 'ZenPacks.sodonnell']
+PACKAGES = ['ZenPacks', 'ZenPacks.sodonnell', 'ZenPacks.sodonnell.VMReport']
+INSTALL_REQUIRES = ['ZenPacks.vmware.VirtualMachines>=1.2']
+COMPAT_ZENOSS_VERS = '>=2.2'
+PREV_ZENPACK_NAME = ''
+# STOP_REPLACEMENTS
+################################
+# Zenoss will not overwrite any changes you make below here.
+
+from setuptools import setup, find_packages
+
+setup(
+ # This ZenPack metadata should usually be edited with the Zenoss
+ # ZenPack edit page. Whenever the edit page is submitted it will
+ # overwrite the values below (the ones it knows about) with new values.
+ name = NAME,
+ version = VERSION,
+ author = AUTHOR,
+ license = LICENSE,
+
+ # This is the version spec which indicates what versions of Zenoss
+ # this ZenPack is compatible with
+ compatZenossVers = COMPAT_ZENOSS_VERS,
+
+ # previousZenPackName is a facility for telling Zenoss that the name
+ # of this ZenPack has changed. If no ZenPack with the current name is
+ # installed then a zenpack of this name if installed will be upgraded.
+ prevZenPackName = PREV_ZENPACK_NAME,
+
+ # Indicate to setuptools which namespace packages the zenpack
+ # participates in
+ namespace_packages = NAMESPACE_PACKAGES,
+
+ # Tell setuptools what packages this zenpack provides.
+ packages = find_packages(),
+
+ # Tell setuptools to figure out for itself which files to include
+ # in the binary egg when it is built.
+ include_package_data = True,
+
+ # The MANIFEST.in file is the recommended way of including additional files
+ # in your ZenPack. package_data is another.
+ package_data = {
+ '': ['*.txt'],
+ '':['../COPYRIGHT.txt','../LICENSE.txt'],
+ NAME: ['objects/*','skins/*/*','services/*', 'reports/*/*',
+ 'modeler/*/*', 'daemons/*', 'lib/*', 'libexec/*',
+ 'datasources/*', ],
+ },
+
+ # Indicate dependencies on other python modules or ZenPacks. This line
+ # is modified by zenoss when the ZenPack edit page is submitted. Zenoss
+ # tries to put add/delete the names it manages at the beginning of this
+ # list, so any manual additions should be added to the end. Things will
+ # go poorly if this line is broken into multiple lines or modified to
+ # dramatically.
+ install_requires = INSTALL_REQUIRES,
+
+ # Every ZenPack egg must define exactly one zenoss.zenpacks entry point
+ # of this form.
+ entry_points = {
+ 'zenoss.zenpacks': '%s = %s' % (NAME, NAME),
+ },
+
+ # All ZenPack eggs must be installed in unzipped form.
+ zip_safe = False,
+)

0 comments on commit f5271c4

Please sign in to comment.