From 42b23fb8f89145597db8b2007d004b1a9d4a848a Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 23 Aug 2013 11:09:44 -0400 Subject: [PATCH] Further advance state of project --- API.txt | 39 +++++++++++++++++++++++++++++++++++++++ confluent/attribs.py | 34 ++++++++++++++++++++-------------- confluent/main.py | 3 +++ 3 files changed, 62 insertions(+), 14 deletions(-) create mode 100644 API.txt diff --git a/API.txt b/API.txt new file mode 100644 index 00000000..3b6dbb85 --- /dev/null +++ b/API.txt @@ -0,0 +1,39 @@ +Each layer has API implications. + +For now, I'll start with plugin api. +The practice is for plugin entry points to have a **kwargs argument to allow +future optional arguments. +Arguments are always passed in keyword style + +plugins should implement: +create(nodes, element, configmanager, **kwargs) +retrieve(nodes, element, configmanager, **kwargs) +update(nodes, element, configmanager, **kwargs) +delete(nodes, element, configmanager, **kwargs) + +For the element '_console/session', the return should be an object +implementing: +open(callback, **kwargs) +read(**kwargs) +write(data, **kwargs) +close(**kwargs) + +For all other elements for now, the caller should get an iterable. +This means a plugin may elect to return a tuple, list, +class of their design implementing the iterator interface, +or elect to use 'yield' in their function for a generator + +Northbound of confluent, the interface is straightforward. +API is presented as a tree of resources. + +TLS socket resembles the SMASH CLP syntax, but does not actually implement +SMASH CLP. Notably, client should assume case sensitivity, strings can +exceed 255 characters, input can be more complex than spec allows, +and no relationship to CIM is defined. The SMASH CLP prompt -> is used and the +paradigm of navigating targets like a filesystem is used as well as the +verb names set, create, start, stop, show, etc. + + +HTTP presents a mostly RESTful interface (noderange, consoles, +and optional multi-request, comet behavior) + diff --git a/confluent/attribs.py b/confluent/attribs.py index 920580c9..07e7686f 100644 --- a/confluent/attribs.py +++ b/confluent/attribs.py @@ -151,6 +151,9 @@ node = { 'VMware'), 'appliesto': ['vm'], }, + 'hardwaremanagement.manager': { + 'description': 'The management address dedicated to this node', + }, 'hardwaremanagement.method': { 'description': 'The method used to perform operations such as power ' 'control, get sensor data, get inventory, and so on. ' @@ -183,21 +186,21 @@ IBM Flex)''', 'secret.snmpuser': { 'description': 'The user to use for SNMPv3 access to this node', }, - 'secret.snmppassword': { - 'description': 'The password to use for SNMPv3 access to this node', + 'secret.snmppassphrase': { + 'description': 'The passphrase to use for SNMPv3 access to this node', }, 'secret.snmplocalizedkey': { 'description': ("SNMPv3 key localized to this node's SNMP Engine id" - 'This can be used in lieu of snmppassword to avoid' - 'retaining the password TODO: document procedure' - 'to commit password to localized key'), + 'This can be used in lieu of snmppassphrase to avoid' + 'retaining the passphrase TODO: document procedure' + 'to commit passphrase to localized key'), }, 'secret.snmpcommunity': { 'description': ('SNMPv1 community string, it is highly recommended to' 'step up to SNMPv3'), }, - 'secret.localadminpassword': { - 'description': ('The password to apply to local root/administrator ' + 'secret.localadminpassphrase': { + 'description': ('The passphrase to apply to local root/administrator ' 'account. ' 'If the environment is 100% Linux, the value may be ' 'one-way crypted as in /etc/shadow. For Windows, if ' @@ -205,29 +208,32 @@ IBM Flex)''', 'local ' 'Administrator account will be disabled, requiring AD') }, + 'secret.ipmikg': { + 'description': 'Optional Integrity key for IPMI communication' + }, 'secret.ipmiuser': { 'description': ('The username to use to log into IPMI device related ' 'to the node. For setting username, default behavior ' 'is to randomize username, for using username if not ' 'set, USERID is assumed'), }, - 'secret.ipmipassword': { + 'secret.ipmipassphrase': { 'description': ('The key to use to authenticate to IPMI device related ' - 'to the node. For setting password, default behavior ' - 'is to randomize password and store it here. If going ' + 'to the node. For setting passphrase, default behavior ' + 'is to randomize passphrase and store it here. If going ' 'to connect over the network and value is not set, ' 'PASSW0RD is attempted') }, 'secret.managementuser': { 'description': ('Username to be set and used by protocols like SSH and ' - 'HTTP where client provides password over the network.' + 'HTTP where client provides passphrase over the network.' 'Given the distinct security models betwen this class ' 'of protocols and SNMP and IPMI, snmp and ipmi utilize ' 'dedicated values.'), }, - 'secret.managementpassword': { - 'description': ('Password to be set and used by protocols like SSH ' - 'and HTTP, where client sends password over the ' + 'secret.managementpassphrase': { + 'description': ('Passphrase to be set and used by protocols like SSH ' + 'and HTTP, where client sends passphrase over the ' 'network. Given distinct security models between ' 'this class of protocols, SNMP, and IPMI, SNMP and ' 'IPMI are given their own settings with distinct ' diff --git a/confluent/main.py b/confluent/main.py index 6528f5a8..2e699368 100644 --- a/confluent/main.py +++ b/confluent/main.py @@ -32,6 +32,9 @@ def _load_plugins(): plugins.add(plugin) for plugin in plugins: tmpmod = __import__(plugin) + if 'plugin_names' in tmpmod.__dict__: + for name in tmpmod.plugin_names: + pluginmap[name] = tmpmod def run():