-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
71 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
############################################################################## | ||
# | ||
# Copyright (C) Zenoss, Inc. 2013, all rights reserved. | ||
# | ||
# This content is made available according to terms specified in | ||
# License.zenoss under the directory where your Zenoss product is installed. | ||
# | ||
############################################################################## | ||
|
||
''' | ||
XenServer device loaders. | ||
''' | ||
|
||
import logging | ||
LOG = logging.getLogger('zen.XenServer') | ||
|
||
from zope.interface import implements | ||
|
||
from Products.Zuul import getFacade | ||
from Products.ZenModel.interfaces import IDeviceLoader | ||
|
||
|
||
class XenServerEndpointLoader(object): | ||
''' | ||
XenServer endpoint loader. | ||
Used by including lines such as the following in a zenbatchload | ||
input file:: | ||
/Devices/XenServer loader='XenServer', loader_arg_keys=['name', 'address', 'username', 'password', 'collector'] | ||
my-xenserver-endpoint name='my-xenserver-endpoint', address='xenserver1.example.com', username='root', password='Xen4TW', collector='localhost' | ||
''' | ||
|
||
implements(IDeviceLoader) | ||
|
||
def load_device(self, dmd, name=None, address=None, username=None, password=None, collector='localhost'): | ||
if name is None: | ||
name = address | ||
|
||
if not all((address, username, password)): | ||
LOG.error( | ||
"XenServerEndpointLoader: address, username and password are " | ||
"required arguments") | ||
|
||
return getFacade('xenserver', dmd).add_xenserver( | ||
name, address, username, password, collector=collector) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters