diff --git a/README b/README deleted file mode 100644 index 055cd550cee653fb4bf57b512cb27cd78091846d..0000000000000000000000000000000000000000 --- a/README +++ /dev/null @@ -1,25 +0,0 @@ -Contrail -======== - -Contrail is a complete Cloud platform which integrates a full Infrastructure-as-a-Service and Platform-as-a-Service facilities. It allows Cloud providers to seamlessly integrate resources from other Clouds with their own infrastructure, and breaks the current customer lock-in situation by allowing live application migration from one cloud to another. - -Documentation (and detailed installation instructions) can be found online at the -[Contrail Docs site](http://TBD). - -Installation ------------- - -TBD - -License -------- - -See LICENSE files in the directory common/licenses. - -Support -------- - -Please log tickets and issues at our [issue tracking system](http://jira.ow2.org/browse/CONTRAIL) - -The official Contrail [IRC](http://webchat.freenode.net/?channels=contrail&uio=Mj10cnVlJjQ9dHJ1ZSY5PXRydWUmMTE9ODIdf) channel is #contrail on the [Freenode](http://www.freenode.net) network. - diff --git a/conpaas/branches/conpaas-dailybuild/web-servers/agent-config.cfg b/agent-config.cfg similarity index 100% rename from conpaas/branches/conpaas-dailybuild/web-servers/agent-config.cfg rename to agent-config.cfg diff --git a/conpaas/branches/opentestbed-web-servers/bin/cpsclient.web b/bin/cpsclient.web similarity index 100% rename from conpaas/branches/opentestbed-web-servers/bin/cpsclient.web rename to bin/cpsclient.web diff --git a/common/tags/contrail-0.1/pom.xml b/common/tags/contrail-0.1/pom.xml deleted file mode 100644 index b2db0bbd93dd0da2b53273fc41c9c2559dfe3090..0000000000000000000000000000000000000000 --- a/common/tags/contrail-0.1/pom.xml +++ /dev/null @@ -1,98 +0,0 @@ - - - - 4.0.0 - - - 2.2.1 - - - - org.ow2 - ow2 - 1.3 - - - org.ow2.contrail - contrail - 0.1 - - pom - - Contrail - Supply of, and demand for computational capacity is elastic. Some companies are are falling short, others have capacity in abundance. More often than not the need or surplus in computational power or storage capacity is temporary. Wouldn't it be wonderful if the surplus of one corporation could (temporarily) alleviate the wantage of the other. A consortium of ten organisations from six European countries started on a collaborative project to enable just that. The Contrail project aims to design, implement, evaluate and promote an open source computational cloud wherein users can share resources without limit. - http://contrail-project.eu/ - 2010 - - - Contrail Consortium - http://contrail-project.eu/partners - - - - - Apache 2 - http://www.apache.org/licenses/LICENSE-2.0.txt - repo - A business-friendly OSS license - - - - - Atlassian Jira - http://jira.ow2.org/browse/CONTRAIL - - - - Atlassian Bamboo - http://bamboo.ow2.org/browse/CONTRAIL - - - - - Commits List - contrail-commits-subscribe@ow2.org - contrail-commits-unsubscribe@ow2.org - http://mail.ow2.org/wws/info/contrail-commits - http://mail-archive.ow2.org/contrail-commits/index.html - - - - - - - - - org.apache.maven.plugins - maven-release-plugin - 2.1 - - forked-path - - false - - -Pcontrail-release - - - - - - - - - contrail-release - - - - - - scm:svn:svn://svn.forge.objectweb.org/svnroot/contrail/common/tags/contrail-0.1 - scm:svn:svn+ssh://svn.forge.objectweb.org/svnroot/contrail/common/tags/contrail-0.1 - http://websvn.ow2.org/filedetails.php/tags/contrail-0.1?repname=contrail&path=%2Fcommon%2Ftrunk%2Fmaven%2Fparent%2Fpom.xml - - - - diff --git a/common/tags/contrail-common-0.1.0/contegrator/.project b/common/tags/contrail-common-0.1.0/contegrator/.project deleted file mode 100644 index 94a49c3dd92bbc86e168b8475bd1e848c89bf359..0000000000000000000000000000000000000000 --- a/common/tags/contrail-common-0.1.0/contegrator/.project +++ /dev/null @@ -1,17 +0,0 @@ - - - contegrator - - - - - - org.python.pydev.PyDevBuilder - - - - - - org.python.pydev.pythonNature - - diff --git a/common/tags/contrail-common-0.1.0/contegrator/.pydevproject b/common/tags/contrail-common-0.1.0/contegrator/.pydevproject deleted file mode 100644 index fbaa0b2d75abff9272263775c41beac07f06a3bd..0000000000000000000000000000000000000000 --- a/common/tags/contrail-common-0.1.0/contegrator/.pydevproject +++ /dev/null @@ -1,10 +0,0 @@ - - - - -Python 2.7 -python 2.7 - -/contegrator/src - - diff --git a/common/tags/contrail-common-0.1.0/contegrator/example/one-test/nodes/head/install.xml b/common/tags/contrail-common-0.1.0/contegrator/example/one-test/nodes/head/install.xml deleted file mode 100644 index e7a9f43b3a9f91ccd96651f3c79dbb8ced746fd4..0000000000000000000000000000000000000000 --- a/common/tags/contrail-common-0.1.0/contegrator/example/one-test/nodes/head/install.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - xmlns="http://contrail-project.eu/schema/2011/08/install"> - one-test-1.0-opennebula-stress-test.tar.gz - diff --git a/common/tags/contrail-common-0.1.0/contegrator/example/one-test/nodes/head/scripts/fix-scripts.sh b/common/tags/contrail-common-0.1.0/contegrator/example/one-test/nodes/head/scripts/fix-scripts.sh deleted file mode 100755 index 68f4d65229366244d7a97951c98024bc82c55ce9..0000000000000000000000000000000000000000 --- a/common/tags/contrail-common-0.1.0/contegrator/example/one-test/nodes/head/scripts/fix-scripts.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -rm /var/lib/one-nfsshare/remotes/im/kvm.d/freespace.sh diff --git a/common/tags/contrail-common-0.1.0/contegrator/example/one-test/nodes/worker/install.xml b/common/tags/contrail-common-0.1.0/contegrator/example/one-test/nodes/worker/install.xml deleted file mode 100644 index 5bf9d8197e04fccf203b17b873c30980b5b9583b..0000000000000000000000000000000000000000 --- a/common/tags/contrail-common-0.1.0/contegrator/example/one-test/nodes/worker/install.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - xmlns="http://contrail-project.eu/schema/2011/08/install"> - diff --git a/common/tags/contrail-common-0.1.0/contegrator/example/one-test/nodes/worker/scripts/fix-nfs.sh b/common/tags/contrail-common-0.1.0/contegrator/example/one-test/nodes/worker/scripts/fix-nfs.sh deleted file mode 100755 index 9a8ffa20b0d57e44564ca3308ccfe21404558634..0000000000000000000000000000000000000000 --- a/common/tags/contrail-common-0.1.0/contegrator/example/one-test/nodes/worker/scripts/fix-nfs.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -HEAD_VNFS_NAME=`echo $VNFS_NAME | sed -e 's/worker$/head/'` -cp /etc/fstab /etc/fstab.orig -sed -e "s/one-2.2-head-jaKa/$HEAD_VNFS_NAME/g" /etc/fstab diff --git a/common/tags/contrail-common-0.1.0/contegrator/example/one-test/test/stress.py b/common/tags/contrail-common-0.1.0/contegrator/example/one-test/test/stress.py deleted file mode 100644 index ccb7dc230e519401efce26c2ad6e6b3d51ecad0f..0000000000000000000000000000000000000000 --- a/common/tags/contrail-common-0.1.0/contegrator/example/one-test/test/stress.py +++ /dev/null @@ -1,18 +0,0 @@ -# the following variables that are in the context when the test cases are run -# are of special importance to us: -# - ct_node_list: mapping node names (dir names of node definitions) to host names -# - nodeman: a NodeManager instance that can be used to issue ssh commands to the nodes - -def test_stress(ct_node_list, ct_nodeman): - head = ct_node_list["head"] - worker = ct_node_list["worker"] - try: - ct_nodeman.sshrun("root", head, "sleep 30") - ct_nodeman.sshrun("root", head, "service opennebula restart") - ct_nodeman.sshrun("root", head, "sleep 30") - ct_nodeman.sshrun("root", head, "onehost create " + head + " im_kvm vmm_kvm tm_nfs") - ct_nodeman.sshrun("root", head, "onehost create " + worker + " im_kvm vmm_kvm tm_nfs") - ct_nodeman.sshrun("root", head, "onevnet publish 205") - ct_nodeman.sshrun("root", head, "/usr/bin/one-test-run.sh") - finally: - pass diff --git a/common/tags/contrail-common-0.1.0/contegrator/example/test-suite/nodes/node-1/config/config.tar.gz b/common/tags/contrail-common-0.1.0/contegrator/example/test-suite/nodes/node-1/config/config.tar.gz deleted file mode 100644 index 7e0ab3e4d916148b364d7f2c1c27013c1af93403..0000000000000000000000000000000000000000 Binary files a/common/tags/contrail-common-0.1.0/contegrator/example/test-suite/nodes/node-1/config/config.tar.gz and /dev/null differ diff --git a/common/tags/contrail-common-0.1.0/contegrator/example/test-suite/nodes/node-1/install.xml b/common/tags/contrail-common-0.1.0/contegrator/example/test-suite/nodes/node-1/install.xml deleted file mode 100644 index 035c75afb2a650a748618017073917ea332a682d..0000000000000000000000000000000000000000 --- a/common/tags/contrail-common-0.1.0/contegrator/example/test-suite/nodes/node-1/install.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - xmlns="http://contrail-project.eu/schema/2011/08/install"> - fortunes - test.tar.gz - diff --git a/common/tags/contrail-common-0.1.0/contegrator/example/test-suite/nodes/node-1/scripts/script.sh b/common/tags/contrail-common-0.1.0/contegrator/example/test-suite/nodes/node-1/scripts/script.sh deleted file mode 100755 index 9dbc6522e66ecd0ab507575f924b257a6c1ad4b9..0000000000000000000000000000000000000000 --- a/common/tags/contrail-common-0.1.0/contegrator/example/test-suite/nodes/node-1/scripts/script.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -touch /touched diff --git a/common/tags/contrail-common-0.1.0/contegrator/example/test-suite/test/testcase-1.py b/common/tags/contrail-common-0.1.0/contegrator/example/test-suite/test/testcase-1.py deleted file mode 100644 index b3da17d53444a5972b3fdec05853ad4933445797..0000000000000000000000000000000000000000 --- a/common/tags/contrail-common-0.1.0/contegrator/example/test-suite/test/testcase-1.py +++ /dev/null @@ -1,8 +0,0 @@ - - -def test_1(): - print "I will pass." - -def test_2(): - print "I will fail." - raise Exception() diff --git a/common/tags/contrail-common-0.1.0/contegrator/example/test-suite/test/testcase-2.py b/common/tags/contrail-common-0.1.0/contegrator/example/test-suite/test/testcase-2.py deleted file mode 100644 index 765983f0d3774832bcb8ea51612731eb38d28d8a..0000000000000000000000000000000000000000 --- a/common/tags/contrail-common-0.1.0/contegrator/example/test-suite/test/testcase-2.py +++ /dev/null @@ -1,6 +0,0 @@ -def test_A(): - print "I'm a failure as well." - raise ValueError() - -def not_a_test(): - print "I shouldn't be executing." diff --git a/common/tags/contrail-common-0.1.0/contegrator/src/contegrator.py b/common/tags/contrail-common-0.1.0/contegrator/src/contegrator.py deleted file mode 100644 index 85b591f57db810d28eb9f63da09cfabfdb561790..0000000000000000000000000000000000000000 --- a/common/tags/contrail-common-0.1.0/contegrator/src/contegrator.py +++ /dev/null @@ -1,124 +0,0 @@ -''' -contegrator.py - -integration test driver for Contrail -- manage VNFS capsules for test machines -- provision and boot test machines via perceus -- run test cases - -@author: jaka -''' - -import sys -import logging -import os -import types -import traceback - -from image.imager import Imager -from nodes.nodeman import NodeMan, Node, ResourceError - -from testbedconfig import testbed_node_list, ct_prestaged, ct_prestaged_nodes - -usage = "contegrator " - -ct_node_list = {} -ct_nodeman = None - -if __name__ == '__main__': - # takes two arguments: - # 1. release tag to test (should equal the tag used by bamboo to - # store binary packages) - # 2. path to test suite dir (containing path to nodes and test directories) - if len(sys.argv) != 3: - print usage - sys.exit(1) - - release_tag = sys.argv[1] - nodes_dir = os.path.join(sys.argv[2], "nodes") - test_dir = os.path.join(sys.argv[2], "test") - - logging.basicConfig(level = logging.DEBUG) - - logging.debug("contegrator starting.") - - print "Preparing images for release ", release_tag - print "from configuration directory", nodes_dir - - imager = Imager(release_tag, nodes_dir, testbed_node_list) - images = imager.prepare_nodes(ct_prestaged) - for image in images: - print "Node '", image, "' image name", images[image]["name"], "image type", images[image]["type"] - - print "Images prepared." - print "Acquiring physical nodes and booting images ..." - - nodeman = NodeMan(testbed_node_list) - ct_nodeman = nodeman - if not ct_prestaged: - try: - for image in images: - node = nodeman.add_phy_node(image, images[image]["name"]) - nodeman.reboot_phy_node(node) - ct_node_list[image] = node.get_host_name() - if nodeman.wait_for_phy_nodes(10, 30): - print "Nodes booted." - else: - print "Nodes not booted in time." - except ResourceError as ex: - logging.exception("Failed to add physical node.") - print "No more physical nodes to work with." - else: - ct_node_list = ct_prestaged_nodes - - for node in ct_node_list: - print "Node", node, "running on host", ct_node_list[node] - - print "Nodes are up and running." - - # at this point, test scripts have hostnames of nodes (named after their respective directories) - # readily available in dict ct_node_list, key is node name (aka node dir name), value is - # host name - - # NOTE: we currently only support test cases coded in python - tmp_test_cases = os.listdir(test_dir) - test_cases = [] - for tc in tmp_test_cases: - if tc.endswith(".py"): - tc = tc.replace(".py", "") - test_cases.append(tc) - sys.path.insert(0, test_dir) - for tc in test_cases: - print "Executing test module:", tc - # import test case as a module - tc_pass = 0 - tc_fail = 0 - tc_total = 0 - tc_mod = __import__(tc, globals(), locals(), ['*']) - for i in dir(tc_mod): - if i.startswith("test_"): - f = tc_mod.__dict__.get(i) - if isinstance(f, types.FunctionType): - tc_name = tc + "." + i - print "Running test case", tc_name - tc_total += 1 - try: - f(ct_node_list, ct_nodeman) - print "Test case", tc_name, "passed." - tc_pass += 1 - except: - print "Test case", tc_name, "failed." - traceback.print_exc(None, sys.stdout) - tc_fail += 1 - print "Passed / Failed / Total:", tc_pass, "/", tc_fail, "/", tc_total - - if not ct_prestaged: - # finally, shut down nodes and purge test vnfses - print "Shutting nodes down ..." - nodeman.shutdown_phy_nodes() - print "Nodes shut down." - print "Purging test VNFS capsules ..." - imager.purge_nodes(images, ct_prestaged) - print "VNFS capsules purged." - - print "Have a nice day." diff --git a/common/tags/contrail-common-0.1.0/contegrator/src/image/imagedef.py b/common/tags/contrail-common-0.1.0/contegrator/src/image/imagedef.py deleted file mode 100644 index 71b1bd0f624267de38153d4538c5acb46deb9db7..0000000000000000000000000000000000000000 --- a/common/tags/contrail-common-0.1.0/contegrator/src/image/imagedef.py +++ /dev/null @@ -1,92 +0,0 @@ -''' -Created on Aug 30, 2011 - -@author: jaka -''' - -from xml.etree import ElementTree - -import logging -import string - -class ImageDefError(Exception): - def __init__(self, msg): - self._msg = msg - - def get_error_message(self): - return self._msg - -class ImageDef(object): - ''' - Example image definition XML: - - - xmlns="http://contrail-project.eu/schema/2011/08/install"> - upstream-package-name-1 - upstream-package-name-2 - upstream-package-name-3 - contrail-package-name-1 - contrail-package-name-2 - - ''' - - TAG_NODE = "node" - TAG_UPSTREAM = "upstream" - TAG_CONTRAIL = "contrail" - - ATTR_TYPE = "type" - ATTR_BASE = "base" - ATTR_REPO = "repository" - - IMAGE_TYPE_VNFS = "vnfs" - IMAGE_TYPE_VM = "vm" - - def __init__(self): - ''' - Constructor - ''' - self.syspackages = [] - self.ctrpackages = [] - self.repo = None - self.type = None - self.base = None - - def _init_from_elem(self, root): - logging.debug("Parsing image definition") - if root.tag != ImageDef.TAG_NODE: - raise ImageDefError("Root element is not " + ImageDef.TAG_NODE) - if not ( ImageDef.ATTR_TYPE in root.attrib and - ImageDef.ATTR_BASE in root.attrib and - ImageDef.ATTR_REPO in root.attrib ): - raise ImageDefError("Node must specify type, base image and repository URL") - self.repo = root.get(ImageDef.ATTR_REPO) - self.base = root.get(ImageDef.ATTR_BASE) - self.type = root.get(ImageDef.ATTR_TYPE) - for pkg in root.getiterator(ImageDef.TAG_UPSTREAM): - self.syspackages.append(string.strip(pkg.text)) - for pkg in root.getiterator(ImageDef.TAG_CONTRAIL): - self.ctrpackages.append(string.strip(pkg.text)) - - def parse_string(self, deftext): - root = ElementTree.fromstring(deftext) - self._init_from_elem(root.getroot()) - - def parse_file(self, path): - root = ElementTree.parse(path) - self._init_from_elem(root.getroot()) - - def get_sys_packages(self): - return self.syspackages - - def get_contrail_packages(self): - return self.ctrpackages - - def get_repository(self): - return self.repo - - def get_image_type(self): - return self.type - - def get_base_image_name(self): - return self.base diff --git a/common/tags/contrail-common-0.1.0/contegrator/src/image/imager.py b/common/tags/contrail-common-0.1.0/contegrator/src/image/imager.py deleted file mode 100644 index 1060c15a29df6705f85f1be58871ea6f1245db93..0000000000000000000000000000000000000000 --- a/common/tags/contrail-common-0.1.0/contegrator/src/image/imager.py +++ /dev/null @@ -1,230 +0,0 @@ -''' -Created on Aug 31, 2011 - -@author: jaka -''' - -from image.imagedef import ImageDef, ImageDefError -from perceus.perceus import Perceus -from image.installer import Installer - -import tempfile -import logging -import os -import shutil -import urllib - -usage = """ct-imager.py """ - -class Imager(object): - - VNFS_ID_FILE = "vnfs_id.txt" - VNFS_ID_PATH = "/" + VNFS_ID_FILE - - def __init__(self, release_tag, nodes_cfg_dir, node_list = None): - self._release_tag = release_tag - self._nodes_cfg_dir = nodes_cfg_dir - self._perceus = Perceus(node_list) - self._images = [] - - def _get_test_vnfs_name(self, node_id): - return "test-vnfs-" + self._release_tag + "-" + node_id - - def _prepare_node_vnfs(self, imagedef, node_id): - node_cfg_dir = os.path.join(self._nodes_cfg_dir, node_id) - logging.debug("Preparing VNFS node: " + node_cfg_dir + "," + - self._release_tag + "," + node_id) - # clone VNFS - test_vnfs = self._get_test_vnfs_name(node_id) - if not self._perceus.clone_vnfs(imagedef.get_base_image_name(), test_vnfs): - logging.error("Failed to clone test VNFS.") - return None - logging.debug("VNFS cloned to: " + test_vnfs) - mount_path = self._perceus.mount_vnfs(test_vnfs) - if mount_path is None: - logging.error("Failed to mount test VNFS.") - return None - logging.debug("VNFS mounted to: " + mount_path) - # fix fstab in case it sports NFS mounts - orig_fstab = os.path.join(mount_path, "etc", "fstab") - bak_fstab = os.path.join(mount_path, "etc", "fstab.bak") - shutil.copyfile(orig_fstab, bak_fstab) - with open(bak_fstab, "r") as bak_f: - with open(orig_fstab, "w") as orig_f: - line = bak_f.readline() - while(len(line) > 0): - if(line.find("nfs") != -1 and line.find(imagedef.get_base_image_name())): - line = line.replace(imagedef.get_base_image_name(), test_vnfs) - orig_f.write(line) - line = bak_f.readline() - # install additional system packages - installer = Installer(mount_path) - if not installer.install(imagedef.get_sys_packages()): - logging.error("Failed to install system packages.") - return None - logging.debug("System packages installed.") - # fetch contrail packages - if len(imagedef.get_contrail_packages()) > 0: - pkg_dir = tempfile.mkdtemp(".tmp", "contrail") - logging.debug("Fetching contrail packages to " + pkg_dir + ": " + - " ".join(imagedef.get_contrail_packages()) + " ...") - local_pkg_paths = [] - for pkg in imagedef.get_contrail_packages(): - try: - pkg_url = imagedef.get_repository() + "/" + self._release_tag + "/" + pkg - local_pkg_path = pkg_dir + "/" + pkg - logging.debug("Fetching " + pkg_url + " to " + local_pkg_path) - (fname, headers) = urllib.urlretrieve(pkg_url, local_pkg_path) - local_pkg_paths.append(fname) - logging.debug("Fetched package " + pkg_url + " to " + fname) - except: - logging.exception("Failed to retrieve Contrail package: " + pkg) - return None - logging.debug("Contrail packages fetched. Unpacking ...") - # install contrail packages - if not installer.unpack(local_pkg_paths): - logging.error("Failed to unpack Contrail packages.") - return None - logging.debug("Contrail packages unpacked.") - try: - shutil.rmtree(pkg_dir) - except: - logging.exception("Failed to remove temporary package dir: " + pkg_dir) - else: - logging.debug("No contrail packages to fetch.") - # unpack config files - cfg_dir = os.path.join(node_cfg_dir, "config") - if os.path.isdir(cfg_dir): - tmp_cfg_files = os.listdir(cfg_dir) - cfg_files = [] - for f in tmp_cfg_files: - p = os.path.join(cfg_dir, f) - if not f.startswith(".") and f.endswith(".tar.gz") and os.path.isfile(p): - cfg_files.append(p) - if len(cfg_files) > 0: - logging.debug("Unpacking config files ...") - if not installer.unpack(cfg_files): - logging.error("Failed to unpack configuration tarballs.") - return None - logging.debug("Config files unpacked.") - else: - logging.debug("No config files to unpack.") - # execute scripts, chrooted - # TODO: what do we want to pass to these scripts via env var? - # some ideas: - # - original and cloned vnfs names - scripts_dir = os.path.join(node_cfg_dir, "scripts") - if os.path.isdir(scripts_dir): - tmp_script_files = os.listdir(scripts_dir) - script_files = [] - for f in tmp_script_files: - p = os.path.join(scripts_dir, f) - if not f.startswith(".") and os.path.isfile(p): - script_files.append(f) - if len(script_files) > 0: - tmp_dir = tempfile.mkdtemp(".tmp", "contrail", - os.path.join(mount_path, "tmp")) - logging.debug("Temporary scripts dir: " + tmp_dir) - (head, tail) = os.path.split(tmp_dir) - if len(tail) == 0: - (head, tail) = os.path.split(head) - chroot_tmp_dir = os.path.join("/tmp", tail) - logging.debug("Temporary scripts dir (chroot): " + chroot_tmp_dir) - for script in script_files: - try: - src_script_path = os.path.join(node_cfg_dir, "scripts", script) - dst_script_path = os.path.join(tmp_dir, script) - logging.debug("Copying script file " + src_script_path + " to " + dst_script_path) - shutil.copyfile(src_script_path, dst_script_path) - os.chmod(dst_script_path, 0755) - logging.debug("Copied script file to: " + dst_script_path) - except: - logging.exception("Failed to copy script: " + script) - return None - chroot_script_path = os.path.join(chroot_tmp_dir, script) - logging.debug("Executing script (in chroot): " + chroot_script_path) - if not installer.chroot([chroot_script_path], { 'VNFS_NAME': test_vnfs }): - logging.error("Failed to execute script: " + script) - return None - logging.debug("Executed.") - try: - shutil.rmtree(tmp_dir) - except: - logging.exception("Failed to remove temporary scripts dir: " + tmp_dir) - logging.debug("Scripts executed.") - else: - logging.debug("No scripts found.") - # create a file used to identify the node once it comes up - vnfs_id_path = os.path.join(mount_path, Imager.VNFS_ID_FILE) - with open(vnfs_id_path, "w") as vnfs_id_file: - vnfs_id_file.write(test_vnfs) - # umount VNFS - if not self._perceus.umount_vnfs(test_vnfs): - logging.error("Failed to unmount test VNFS.") - return None - logging.debug("VNFS unmounted") - return test_vnfs - - def _prepare_node(self, node_id, prestaged = False): - node_cfg_dir = os.path.join(self._nodes_cfg_dir, node_id) - logging.debug("Preparing node " + node_id + " for release " + - self._release_tag + " from config dir " + node_cfg_dir) - # 1. parse image XML - imagedef = ImageDef() - install_path = os.path.join(node_cfg_dir, "install.xml") - try: - logging.debug("Parsing install configuration file: " + install_path) - imagedef.parse_file(install_path) - except ImageDefError as error: - logging.exception("Failed to parse node install file: " + - error.get_error_message()) - return None - except Exception as ex: - logging.exception("Failed to parse node install file.") - return None - if not prestaged: - if imagedef.get_image_type() == ImageDef.IMAGE_TYPE_VNFS: - if not prestaged: - return (self._prepare_node_vnfs(imagedef, node_id), - imagedef.get_image_type()) - else: - print "Unsupported image type:", imagedef.get_image_type() - return None - else: - return ("__prestaged__", imagedef.get_image_type()) - - def _purge_vnfs(self, vnfs_name): - # we might be using this after error, thus we do not know in what state the vnfs is: - # thus unmount first (and silently fail if not mounted), then delete - self._perceus.umount_vnfs(vnfs_name) - self._perceus.delete_vnfs(vnfs_name) - - def prepare_nodes(self, prestaged = False): - nodes_list = os.listdir(self._nodes_cfg_dir) - rv = {} - for node in nodes_list: - p = os.path.join(self._nodes_cfg_dir, node) - if node.startswith(".") or not os.path.isdir(p): - continue - (image_name, image_type) = self._prepare_node(node, prestaged) - if image_name is not None: - logging.info("Created node image " + node + " (" + - image_name + " , " + image_type + ")") - rv[node] = { "name": image_name, "type": image_type } - else: - logging.error("Failed to create node image for node: " + node) - self.purge_nodes(rv, prestaged) - return None - return rv - - def purge_nodes(self, node_map, prestaged = False): - if prestaged: - return - for node in node_map: - if node_map[node]["type"] == ImageDef.IMAGE_TYPE_VNFS: - self._purge_vnfs(node_map[node]["name"]) - elif node_map[node]["type"] == ImageDef.IMAGE_TYPE_VM: - # TODO - pass - else: - logging.error("Unknown node image type: " + node["type"]) diff --git a/common/tags/contrail-common-0.1.0/contegrator/src/image/installer.py b/common/tags/contrail-common-0.1.0/contegrator/src/image/installer.py deleted file mode 100644 index 77959c58a422e947b84cb403ca90ff73944bf093..0000000000000000000000000000000000000000 --- a/common/tags/contrail-common-0.1.0/contegrator/src/image/installer.py +++ /dev/null @@ -1,77 +0,0 @@ -''' -Created on Aug 30, 2011 - -@author: jaka -''' - -import subprocess -from subprocess import CalledProcessError - -import logging -import os -import shutil - -class Installer(object): - ''' - classdocs - ''' - - def __init__(self, mount_point): - ''' - Constructor - ''' - self._mount_point = mount_point - self._tar_cmd = "tar" - self._apt_cmd = "apt-get" - self._chroot_cmd = "chroot" - - def install(self, package_list): - logging.debug("Installing system packages: " + " ".join(package_list)) - if None is package_list or len(package_list) == 0: - return True - arg_list = [self._chroot_cmd, self._mount_point, self._apt_cmd, "-q", "-y", "--force-yes", "install"] - arg_list.extend(package_list) - logging.debug("Install cmd: " + " ".join(arg_list)) - try: - new_env = os.environ.copy() - new_env['DEBIAN_FRONTEND'] = "noninteractive" - subprocess.check_call(arg_list, env = new_env) - return True - except CalledProcessError as error: - logging.exception("Failed to install packages to VNFS: " + str(error.returncode)) - return False - except OSError as error: - logging.exception("Failed to install packages to VNFS.") - return False - - def unpack(self, tarball_list): - for tarball in tarball_list: - try: - subprocess.check_call([self._tar_cmd, "xzvf", tarball, "-C", self._mount_point]) - except CalledProcessError as error: - logging.exception("Failed to install packages to VNFS: " + str(error.returncode)) - return False - return True - - def chroot(self, cmd_args, env = {}): - arg_list = [self._chroot_cmd, self._mount_point] - arg_list.extend(cmd_args) - logging.debug("Chroot cmd: " + " ".join(arg_list)) - try: - new_env = os.environ.copy() - new_env.update(env) - subprocess.check_call(arg_list, env = new_env) - return True - except CalledProcessError as error: - logging.exception("Failed to execute chrooted script: " + str(error.returncode)) - return False - - def delete(self, local_path): - abs_path = os.path.join(self._mount_point, local_path) - logging.debug("Deleting " + abs_path) - try: - shutil.rmtree(abs_path) - return True - except: - logging.exception("Failed to remove " + abs_path) - return False diff --git a/common/tags/contrail-common-0.1.0/contegrator/src/nodes/nodeman.py b/common/tags/contrail-common-0.1.0/contegrator/src/nodes/nodeman.py deleted file mode 100644 index 07980eeef81d6851827642adaec3421d3c3ffbcc..0000000000000000000000000000000000000000 --- a/common/tags/contrail-common-0.1.0/contegrator/src/nodes/nodeman.py +++ /dev/null @@ -1,175 +0,0 @@ -''' -Created on Aug 31, 2011 - -@author: jaka -''' - -from perceus.perceus import Perceus -from image.imagedef import ImageDef -from image.imager import Imager - -from testbedconfig import node_passwords, ct_perceus_util_node - -from fabric.api import env -from fabric.operations import run, _AttributeString - -import logging -import time - - -class ResourceError(Exception): - def __init__(self, msg): - self._msg = msg - - def get_message(self): - return self._msg - - -class Node(object): - def __init__(self, **nodeparams): - self._name = nodeparams['name'] - self._host = nodeparams['host'] - self._image_name = nodeparams['image_name'] - self._image_type = nodeparams['image_type'] - - def get_name(self): - return self._name - - def get_host_name(self): - return self._host - - def get_image_name(self): - return self._image_name - - def get_image_type(self): - return self._image_type - - def __str__(self, *args, **kwargs): - return "(" + self._host + "," + self._image_type + ":" + self._image_name + ")" - - -class NodeMan(object): - def __init__(self, available_nodes = None, - perceus_util_cmd = "/srv/util/perceus-util.sh"): - self._perceus_util_cmd = perceus_util_cmd - self._perceus = Perceus(available_nodes) - self._phy_nodes = [] - - def setup_fabric_env(self): - env.shell = "/bin/bash -l -i -c" - env.passwords = node_passwords - env.warn_only = True - env.disable_known_hosts = True - - def _run_via_ssh(self, node, cmd, **kwargs): - args = { "user": "root", - "timeout": 30 } - args.update(kwargs) - self.setup_fabric_env() - env.host_string = args["user"] + "@" + node - cmd_str = " ".join(cmd) - logging.debug("Running [" + cmd_str + "] on " + env.host_string) - try: - rv = run(cmd_str) - except SystemExit as e: - rv = _AttributeString("") - rv.succeeded = False - rv.failed = True - rv.return_code = -1 - logging.debug("Success: " + str(rv.succeeded)) - logging.debug("Return code: " + str(rv.return_code)) - logging.debug("Output: " + rv) - return rv - - def sshrun(self, user, host, cmd): - self.setup_fabric_env() - env.host_string = user + "@" + host - try: - rv = run(cmd) - except SystemExit as e: - rv = _AttributeString("") - rv.succeeded = False - rv.failed = True - rv.return_code = -1 - logging.debug("Success: " + str(rv.succeeded)) - logging.debug("Return code: " + str(rv.return_code)) - logging.debug("Output: " + rv) - return rv - - def _log_cmd(self, cmd_list): - logging.debug("Command: " + " ".join(cmd_list)) - - def _ucmd(self, args): - cmd = [self._perceus_util_cmd] - cmd.extend(args) - self._log_cmd(cmd) - return cmd - - def _pu_reboot_node(self, node): - try: - self.sshrun("root", ct_perceus_util_node, - " ".join(self._ucmd(["node", "power", "of", node]))) - time.sleep(3) - self.sshrun("root", ct_perceus_util_node, - " ".join(self._ucmd(["node", "power", "on", node]))) - time.sleep(3) - self.sshrun("root", ct_perceus_util_node, - " ".join(self._ucmd(["node", "power", "wol", node]))) - return True - except Exception, e: - logging.exception("Failed to reboot node.") - return False - - def _pu_shutdown_node(self, node): - try: - self.sshrun("root", ct_perceus_util_node, - " ".join(self._ucmd(["node", "power", "of", node]))) - return True - except Exception, e: - logging.exception("Failed to shutdown node.") - return False - - def add_phy_node(self, name, vnfs): - host = self._perceus.acquire_node(vnfs) - if host is None: - raise ResourceError("No more nodes left.") - node = Node(name = name, host = host, image_name = vnfs, image_type = ImageDef.IMAGE_TYPE_VNFS) - logging.debug("Added new physical node " + str(node)) - self._phy_nodes.append(node) - return node - - def get_phy_nodes(self): - return self._phy_nodes - - def reboot_phy_node(self, node): - self._pu_reboot_node(node.get_host_name()) - - def shutdown_phy_node(self, node): - self._pu_shutdown_node(node.get_host_name()) - - def shutdown_phy_nodes(self): - for node in self._phy_nodes: - self.shutdown_phy_node(node) - - def is_phy_node_booted(self, node): - output = self._run_via_ssh(node.get_host_name(), [ "cat", Imager.VNFS_ID_PATH ]) - return (output.succeeded == True and output.return_code == 0 and output == node.get_image_name()) - - def wait_for_phy_nodes(self, retries = 0, sleep_time = 60): - logging.debug("Waiting for physical nodes to boot.") - while True: - n = 0 - for node in self._phy_nodes: - if self.is_phy_node_booted(node): - logging.debug("Node " + str(node) + " booted.") - n += 1 - else: - logging.debug("Node " + str(node) + " not booted yet.") - break - if n == len(self._phy_nodes): - return True - logging.debug("Retries left: " + str(retries)) - retries -= 1 - if retries < 0: - return False - time.sleep(sleep_time) diff --git a/common/tags/contrail-common-0.1.0/contegrator/src/perceus/perceus.py b/common/tags/contrail-common-0.1.0/contegrator/src/perceus/perceus.py deleted file mode 100644 index 10dd418d301ce931008ca8be877d56a8f348d277..0000000000000000000000000000000000000000 --- a/common/tags/contrail-common-0.1.0/contegrator/src/perceus/perceus.py +++ /dev/null @@ -1,114 +0,0 @@ -''' -Created on Aug 30, 2011 - -@author: jaka -''' - -import subprocess -from subprocess import CalledProcessError - -import re -import logging -import string - -class Perceus(object): - - _debug = True - - def __init__(self, available_nodes = None, - perceus_cmd = "perceus"): - self._perceus_cmd = perceus_cmd - self._available_nodes = available_nodes - if self._available_nodes is None: - self._available_nodes = self.list_nodes() - self._allocated_nodes = [] - - def _log_cmd(self, cmd_list): - logging.debug("Command: " + " ".join(cmd_list)) - - def _pcmd(self, args): - cmd = [self._perceus_cmd, "-y"] - if not Perceus._debug: - cmd.append("-q") - cmd.extend(args) - self._log_cmd(cmd) - return cmd - - def clone_vnfs(self, src_vnfs, tgt_vnfs): - try: - subprocess.check_call(self._pcmd(["vnfs", "clone", src_vnfs, tgt_vnfs])) - return True - except CalledProcessError as error: - logging.error("Failed to clone VNFS: " + str(error.returncode)) - return False - - def mount_vnfs(self, vnfs): - try: - output = subprocess.check_output(self._pcmd(["vnfs", "mount", vnfs])) - logging.debug("--- output start ---") - logging.debug(output) - logging.debug("--- output end ---") - # The VNFS can be found at: /mnt/test-vnfs-X-node-1 - match = re.search("The VNFS can be found at: (\S+)", output) - logging.debug("Match: " + str(match)) - if match is None: - return None - return match.group(1) - except CalledProcessError as error: - logging.error("Failed to mount VNFS: " + str(error.returncode)) - return None - - def umount_vnfs(self, vnfs): - try: - subprocess.check_call(self._pcmd(["vnfs", "umount", vnfs])) - return True - except CalledProcessError as error: - logging.error("Failed to unmount VNFS: " + str(error.returncode)) - return False - - def delete_vnfs(self, vnfs): - try: - subprocess.check_call(self._pcmd(["vnfs", "delete", vnfs])) - return True - except CalledProcessError as error: - logging.error("Failed to delete VNFS: " + str(error.returncode)) - return False - - def acquire_node(self, vnfs): - try: - if len(self._available_nodes) == 0: - return None - node = self._available_nodes.pop() - subprocess.check_call(self._pcmd(["node", "set", "vnfs", vnfs, node])) - self._allocated_nodes.append(node) - return node - except CalledProcessError as error: - self._available_nodes.push(node) - logging.error("Failed to set node vnfs: " + str(error.returncode)) - return None - - def release_node(self, node): - try: - self._allocated_nodes.remove(node) - self._available_nodes.append(node) - return True - except ValueError: - return False - - def release_all_nodes(self): - for node in self._allocated_nodes: - self._available_nodes.append(node) - self._allocated_nodes = [] - - def list_nodes(self): - output = subprocess.check_output(self._pcmd(["node", "list"])) - logging.debug("--- output start ---") - logging.debug(output) - logging.debug("--- output end ---") - nodes = string.split(output) - i = 0 - for node in nodes: - i += 1 - logging.debug("Node " + str(i) + " [" + node + "]") - return nodes - diff --git a/common/tags/contrail-common-0.1.0/contegrator/src/testbedconfig.py b/common/tags/contrail-common-0.1.0/contegrator/src/testbedconfig.py deleted file mode 100644 index dfb94e3e61996e8228054225966b147a6903a5cc..0000000000000000000000000000000000000000 --- a/common/tags/contrail-common-0.1.0/contegrator/src/testbedconfig.py +++ /dev/null @@ -1,22 +0,0 @@ -testbed_node_list = [ - "n0004", - "n0005" -] - -node_passwords = { - "root@n0004": "root", - "root@n0005": "root", -} - -ct_perceus_util_node = "perceus" - -# set to true if test nodes are set-up already and all you want to do -# is run the test code. useful for debugging to avoid lengthy staging -# of test nodes on each contegrator run. -ct_prestaged = False -# if you set above to true, make sure you fix the map below, -# mapping node names (node dir names) to the corresponding hosts -ct_prestaged_nodes = { - "head": "n0005", - "worker": "n0004", -} diff --git a/common/tags/contrail-common-0.1.0/infrastructure/svnhooks/Rakefile b/common/tags/contrail-common-0.1.0/infrastructure/svnhooks/Rakefile deleted file mode 100644 index 5d6c0360da2a33583b5fdff49892f6e97e1f93cf..0000000000000000000000000000000000000000 --- a/common/tags/contrail-common-0.1.0/infrastructure/svnhooks/Rakefile +++ /dev/null @@ -1,38 +0,0 @@ -# Rakefile to check, build and test the Contrail pre-commit hook for SVN -# -# -require 'rake/testtask' - - -DIR = 'target' -SRC = 'src/pre-commit.sh' -DEST = DIR + '/pre-commit' - - -directory DIR - - -task :default => [:test] - -desc "Build the SVN pre-commit script hook" -task :build => [DIR] do - cp SRC, DEST - chmod 0755, DEST - sh %{sh -n #{DEST}} -end - -desc "Run basic tests" -task :test => [:build] -Rake::TestTask.new("test") do |t| - t.pattern = 'src/test_*.rb' - t.verbose = true - t.warning = true -end - - - -desc "Remove generated files" -task :clean do - rm_rf DIR -end - diff --git a/common/tags/contrail-common-0.1.0/infrastructure/svnhooks/src/pre-commit.sh b/common/tags/contrail-common-0.1.0/infrastructure/svnhooks/src/pre-commit.sh deleted file mode 100644 index 4644b99e9f2cd504e5854c15f9d5ff6bfb9e0aee..0000000000000000000000000000000000000000 --- a/common/tags/contrail-common-0.1.0/infrastructure/svnhooks/src/pre-commit.sh +++ /dev/null @@ -1,137 +0,0 @@ -#!/bin/sh - -# PRE-COMMIT HOOK -# -# The pre-commit hook is invoked before a Subversion txn is -# committed. Subversion runs this hook by invoking a program -# (script, executable, binary, etc.) named 'pre-commit' (for which -# this file is a template), with the following ordered arguments: -# -# [1] REPOS-PATH (the path to this repository) -# [2] TXN-NAME (the name of the txn about to be committed) -# -# [STDIN] LOCK-TOKENS ** the lock tokens are passed via STDIN. -# -# If STDIN contains the line "LOCK-TOKENS:\n" (the "\n" denotes a -# single newline), the lines following it are the lock tokens for -# this commit. The end of the list is marked by a line containing -# only a newline character. -# -# Each lock token line consists of a URI-escaped path, followed -# by the separator character '|', followed by the lock token string, -# followed by a newline. -# -# The default working directory for the invocation is undefined, so -# the program should set one explicitly if it cares. -# -# If the hook program exits with success, the txn is committed; but -# if it exits with failure (non-zero), the txn is aborted, no commit -# takes place, and STDERR is returned to the client. The hook -# program can use the 'svnlook' utility to help it examine the txn. -# -# On a Unix system, the normal procedure is to have 'pre-commit' -# invoke other programs to do the real work, though it may do the -# work itself too. -# -# *** NOTE: THE HOOK PROGRAM MUST NOT MODIFY THE TXN, EXCEPT *** -# *** FOR REVISION PROPERTIES (like svn:log or svn:author). *** -# -# This is why we recommend using the read-only 'svnlook' utility. -# In the future, Subversion may enforce the rule that pre-commit -# hooks should not modify the versioned data in txns, or else come -# up with a mechanism to make it safe to do so (by informing the -# committing client of the changes). However, right now neither -# mechanism is implemented, so hook writers just have to be careful. -# -# Note that 'pre-commit' must be executable by the user(s) who will -# invoke it (typically the user httpd runs as), and that user must -# have filesystem-level permission to access the repository. -# -# On a Windows system, you should name the hook program -# 'pre-commit.bat' or 'pre-commit.exe', -# but the basic idea is the same. -# -# The hook program typically does not inherit the environment of -# its parent process. For example, a common problem is for the -# PATH environment variable to not be set to its usual value, so -# that subprograms fail to launch unless invoked via absolute path. -# If you're having unexpected problems with a hook program, the -# culprit may be unusual (or missing) environment variables. -# -# Here is an example hook script, for a Unix /bin/sh interpreter. -# For more examples and pre-written hooks, see those in -# /usr/share/subversion/hook-scripts, and in the repository at -# http://svn.apache.org/repos/asf/subversion/trunk/tools/hook-scripts/ and -# http://svn.apache.org/repos/asf/subversion/trunk/contrib/hook-scripts/ -# - - -# Path to the SVN repository -REPOS="$1" - -# Id of the transaction -TXN="$2" - -# List of users for which rules do not apply (admins) -ADMINS="mateja sandre" - - - -# Reject the commit with error message $1 -reject () { - echo " -ERROR: ${1:-'commit transaction has been rejected'}. - -For further explanations about the Contrail project's coding policy, please refer to the public wiki at http://contrail-project.eu/development-wiki/-/wiki/Main/Coding+best+practices+in+Contrail - -If you think your commit should not have been rejected, please contact the Contrail OW2 administrators at an try again later. -" >&2 - exit 1 -} - -# Allow the commit -allow() { - echo "commit ${TXN}@${REPOS} allowed" - exit 0 -} - - -# Execute the svnlook command $1 -svnlook() { - /usr/bin/svnlook "${1?}" -t "$TXN" "$REPOS" \ - || reject "server internal error" -} - - - -############################################################################# - -# commit allowed if author is one of the admins -echo "$ADMINS" | grep -qwF "`svnlook 'author'`" \ - && allow - - -# commit rejected if log message does not contain any printable character -svnlook 'log' | grep -qE '[^[:space:]]' \ - || reject 'empty commit messages are not allowed' - - -# commit rejected if attempt to modify repo structure -#svnlook 'dirs-changed' | grep -qE '^[^/]+/$' \ -# && reject 'repository structure cannot be modified' - - -# commit rejected if trying to add or update eclipse config files -svnlook 'changed' | grep -qE '^(A|U|_U|UU)[[:space:]]+.*/\.(classpath|project|settings/)' \ - && reject 'add/update of Eclipse configuration file (.project, .classpath, .settings) - is not allowed' - - -# commit rejected if trying to add or update a data file -svnlook 'changed' | grep -qE '^(A|U|_U|UU)[[:space:]]+.*\.(log)$' \ - && reject 'add/update of data or binary files (*.zip, *.log) is not allowed' - - -# All checks passed, so allow the commit. -allow - diff --git a/common/tags/contrail-common-0.1.0/infrastructure/svnhooks/src/test_pre-commit-hook.rb b/common/tags/contrail-common-0.1.0/infrastructure/svnhooks/src/test_pre-commit-hook.rb deleted file mode 100644 index 26b9c1744696af7c8d6320b1eef20ba9d819e1d8..0000000000000000000000000000000000000000 --- a/common/tags/contrail-common-0.1.0/infrastructure/svnhooks/src/test_pre-commit-hook.rb +++ /dev/null @@ -1,182 +0,0 @@ - -require 'fileutils' -require 'pathname' -require 'test/unit' -require 'tmpdir' - - -PRE_HOOK_FILE = Pathname.new(Dir.getwd).join('target/pre-commit').to_s - - -class LocalSvnServer - attr_accessor :rootdir, :url - - def initialize(rootdir) - @rootdir = rootdir - @pidfile = nil - @url = 'svn://localhost/' - end - - def getpid - if @pidfile != nil and File.exists?(@pidfile) - File.open(@pidfile).each do |line| - begin - pid = line.to_i - Process.getpgid(pid) - return pid - rescue Errno::ESRCH - break - end - end - end - - return nil - end - - def running? - return getpid().is_a?(Integer) - end - - def start - unless running? - @pidfile = File.join(@rootdir, 'pid') - File.delete(@pidfile) if File.exists?(@pidfile) - system "svnserve --daemon --root=#{@rootdir} --pid-file=#{@pidfile}" - sleep 0.2 until running? - end - - return self - end - - def stop - if running? - Process.kill("TERM", getpid()) - sleep 0.2 while running? - File.delete(@pidfile) if File.exists?(@pidfile) - @pidfile = nil - end - - return self - end -end - - - -class SvnHookTest < Test::Unit::TestCase - - def enable_prehook - FileUtils.cp PRE_HOOK_FILE, @prehook unless File.exists? @prehook - end - - def disable_prehook - FileUtils.rm @prehook if File.exists? @prehook - end - - def setup - @svnroot = Dir.mktmpdir - @workdir = Dir.mktmpdir - @prehook = Pathname.new(@svnroot).join('hooks/pre-commit').to_s - system "svnadmin create #{@svnroot}" - File.open(Pathname.new(@svnroot).join('conf/svnserve.conf').to_s, 'r+') do |f| - buf = '' - f.each do |line| - buf << line.sub(/^(#\s*)?anon-access\W.*/, "anon-access = write") - end - f.pos = 0 - f.print(buf) - f.truncate(f.pos) - end - @server = LocalSvnServer.new(@svnroot).start() - Dir.chdir @workdir - system "svn checkout #{@server.url} ." - commit_standard_structure - enable_prehook - end - - def teardown - begin - @server.stop() - ensure - [@svnroot, @workdir].each do |d| - FileUtils.rm_r d if d - end - end - end - - def svn(*args) - system 'svn', '--non-interactive', *args - end - - def add_file(path) - open(path, 'w') do |f| - f.write Time.now.to_s - end - end - - def commit_standard_structure - disable_prehook - Dir.chdir @workdir - ['trunk', 'branches', 'tags'].each do |d| - dir = 'module/' + d + '/submodule/src' - src = dir + '/code.txt' - FileUtils.mkdir_p dir - add_file src - end - assert svn 'add', 'module' - assert svn 'commit', '-m', 'initialization' - end - - - # TODO: refactor code + check error messages with keywords - - def test_reject_commit_without_message - f = 'module/trunk/newfile' - add_file f - assert svn('add', f) - assert ! svn('commit', '-m', ' ') - end - - def test_allow_commit_with_message - f = 'module/trunk/newfile' - add_file f - assert svn('add', f) - assert svn('commit', '-m', ' - non blank message - - ') - end - -# def test_reject_structure_modification -# f = 'module/newtrunk' -# add_file f -# assert svn('add', f) -# assert ! svn('commit', '-m', 'modify repo structure') -# end - -# def test_allow_trunk_modification -# f = 'module/trunk/newfile' -# add_file f -# assert svn('add', f) -# assert svn('commit', '-m', 'modify trunk') -# end - - def test_reject_add_eclipse_file - f = 'module/trunk/.project' - add_file f - assert svn('add', f) - assert ! svn('commit', '-m', 'add eclipse .project') - d = 'module/trunk/.settings' - FileUtils.mkdir d - assert svn('add', d) - assert ! svn('commit', '-m', 'add eclipse .settings') - end - - def test_reject_add_dada_file - f = 'module/trunk/trace.log' - add_file f - assert svn('add', f) - assert ! svn('commit', '-m', 'add log file') - end - -end - diff --git a/common/tags/contrail-common-0.1.0/maven/parent/pom.xml b/common/tags/contrail-common-0.1.0/maven/parent/pom.xml deleted file mode 100644 index ab0dbb9d3cee2276fdcf75c06175d6f71e77a8f0..0000000000000000000000000000000000000000 --- a/common/tags/contrail-common-0.1.0/maven/parent/pom.xml +++ /dev/null @@ -1,98 +0,0 @@ - - - - 4.0.0 - - - 2.2.1 - - - - org.ow2 - ow2 - 1.3 - - - org.ow2.contrail - contrail - 0.2-SNAPSHOT - - pom - - Contrail - Supply of, and demand for computational capacity is elastic. Some companies are are falling short, others have capacity in abundance. More often than not the need or surplus in computational power or storage capacity is temporary. Wouldn't it be wonderful if the surplus of one corporation could (temporarily) alleviate the wantage of the other. A consortium of ten organisations from six European countries started on a collaborative project to enable just that. The Contrail project aims to design, implement, evaluate and promote an open source computational cloud wherein users can share resources without limit. - http://contrail-project.eu/ - 2010 - - - Contrail Consortium - http://contrail-project.eu/partners - - - - - Apache 2 - http://www.apache.org/licenses/LICENSE-2.0.txt - repo - A business-friendly OSS license - - - - - Atlassian Jira - http://jira.ow2.org/browse/CONTRAIL - - - - Atlassian Bamboo - http://bamboo.ow2.org/browse/CONTRAIL - - - - - Commits List - contrail-commits-subscribe@ow2.org - contrail-commits-unsubscribe@ow2.org - http://mail.ow2.org/wws/info/contrail-commits - http://mail-archive.ow2.org/contrail-commits/index.html - - - - - - - - - org.apache.maven.plugins - maven-release-plugin - 2.1 - - forked-path - - false - - -Pcontrail-release - - - - - - - - - contrail-release - - - - - - scm:svn:svn://svn.forge.objectweb.org/svnroot/contrail/common/trunk/maven/parent - scm:svn:svn+ssh://svn.forge.objectweb.org/svnroot/contrail/common/trunk/maven/parent - http://websvn.ow2.org/filedetails.php?repname=contrail&path=%2Fcommon%2Ftrunk%2Fmaven%2Fparent%2Fpom.xml - - - - diff --git a/common/tags/contrail-common-0.1.0/maven/settings/settings.xml b/common/tags/contrail-common-0.1.0/maven/settings/settings.xml deleted file mode 100644 index 5e751afe337d3fa16b3af95f9e153e252e56f96c..0000000000000000000000000000000000000000 --- a/common/tags/contrail-common-0.1.0/maven/settings/settings.xml +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - contrail - - true - - - - contrail-staging - Contrail Staging Repository - http://repository.ow2.org/nexus/content/repositories/ow2_contrail-011/ - - true - - - false - - - - - - ow2 - - true - - - - ow2-releases - OW2 Releases Repository - http://repository.ow2.org/nexus/content/repositories/releases/ - - true - - - false - - - - ow2-snapshots - OW2 Snapshots Repository - http://repository.ow2.org/nexus/content/repositories/snapshots/ - - false - - - true - - - - - - - diff --git a/common/tags/contrail-common-0.1.0/registration/register-contrail-developer.sh b/common/tags/contrail-common-0.1.0/registration/register-contrail-developer.sh deleted file mode 100644 index 01be81dd617607f6c316a2b89cebeec3a1076e66..0000000000000000000000000000000000000000 --- a/common/tags/contrail-common-0.1.0/registration/register-contrail-developer.sh +++ /dev/null @@ -1,188 +0,0 @@ -#!/bin/bash -# -# Developers Registration Assistant for the Contrail project -# -# -# Authors: -# Sebastien Andre -# -# Versions: -# 2011-09-20 registration to gforge, jira, mailing lists + email -# - -TMPDIR="$(mktemp -td)" || exit 1 -trap "rm -fr $(printf '%q' "$TMPDIR")" EXIT -export TMPDIR - - - -# print a line with message $@ -say() { - printf "%s\n" "$*" -} - -# Print a line the same length as $1 with pattern $2 -line() { - printf "%s" "$1" | sed -e 's/./=/g' | tr '=' "${2:-"-"}" - say -} - -# Print a title -title() { - line "$*" '=' - say "$*" - line "$*" '=' - say -} - - -# Ask confirmation before running a command $@ -run() { - ask "Run command \`$*\`" ANS "Y/n" - case "$ANS" in - Y*|y*) - ( "$@" ) - say "Returned $?" - ;; - *) - say "Canceled by user" - esac -} - - -# Print the step described by $1 and run $@ if provided -step() { - say - say "* $1" - line "* $1" '-' - say - - shift - - if [ $# -gt 0 ] - then - run "$@" - pause - fi -} - - -# Pause until user press enter -pause() { - read -p 'Press to continue...' -} - - -# Ask for input of information $1 to be stored in $2 with default value $3 -ask() { - local desc="${1?}" - local var="${2?}" - local default="$3" - - eval "$var=" - until [ -n "${!var}" ] - do - read -p "${desc}${default:+" [${default}]"}: " "$var" - if [ -z "${!var}" ] - then - eval "$var=$(printf '%q' "$default")" - fi - done -} - - - -############################################################################# -BROWSER="$(type -p firefox || echo "echo")" -MAILFILE="$(mktemp -t)" || exit 1 - - -title 'Contrail Project - Developers Registration Assistant' - -# read infos -step "Collecting developer's information" - -ask "Full Name" DEV_FULL_NAME "$1" -ask "Email" DEV_EMAIL "$2" -ask "OW2 GForge login" DEV_LOGIN_GFORGE "$3" -ask "OW2 Jira login" DEV_LOGIN_JIRA "$4" - - -# GForge -step "Log in OW2 GForge" \ - "$BROWSER" \ - "https://forge.ow2.org/account/login.php" - -step "Add user '${DEV_LOGIN_GFORGE}' to group 'Members' with role 'Developer'" \ - "$BROWSER" "https://forge.ow2.org/project/admin/?group_id=396" - - -# Jira -step "Log in OW2 Jira" \ - "$BROWSER" \ - "http://jira.ow2.org/secure/Dashboard.jspa" - -step "Assign user '${DEV_LOGIN_JIRA}' to project role 'Developers'" \ - "$BROWSER" \ - "http://jira.ow2.org/secure/project/UserRoleActorAction.jspa?projectRoleId=10001&projectId=10051" - - - -# Mailing lists -step "Log in OW2 mail manager" \ - "$BROWSER" \ - "http://mail.ow2.org/wws" - -for ml in contrail-dev contrail-commits -do - step "Add subscriber '${DEV_EMAIL} ${DEV_FULL_NAME}' to mailing list $ml" \ - "$BROWSER" \ - "http://mail.ow2.org/wws/add_request/$ml" -done - - - -# Welcome email -cat < "$MAILFILE" -From: contrail-admin@ow2.org -To: ${DEV_FULL_NAME} <${DEV_EMAIL}> -Bcc: contrail-admin@ow2.org -Subject: Welcome to the Contrail project developers team ! -Reply-To: contrail-admin@ow2.org - -Dear ${DEV_FULL_NAME}, - - -Thank you for registering as a developer to the Contrail project. - - -You have been granted permissions to use the Contrail code repository and -the bug tracking system hosted by the OW2 consortium. - -You've also been subscribed to the contrail-dev@ow2.org and -contrail-commits@ow2.org mailing lists. - -For informations about your SVN access, please read -http://forge.ow2.org/plugins/scmsvn/index.php?group_id=396. - - -If you have any question regarding OW2 collaboration tools for the Contrail -project, please contact contrail-admin@ow2.org. - - -Best Regards, --- -Contrail OW2 Administrators -http://www.ow2.org/view/ActivitiesDashboard/Contrail -EOF - -step "Send a welcome email" \ - mutt -n -e "set signature=" -H "$MAILFILE" - - - -# Terminate -say -say "Registration procedure terminated" -exit 0 - diff --git a/common/trunk/Makefile b/common/trunk/Makefile deleted file mode 100644 index 781ac510da5270d1efc52bad6a2b66a8c3db3e01..0000000000000000000000000000000000000000 --- a/common/trunk/Makefile +++ /dev/null @@ -1,23 +0,0 @@ -# -# Makefile -# - -SHELL = /bin/bash - - - -all: check parent-pom ow2-admin-guide - - -check: - java -version - mvn -version - pdflatex -version - -parent-pom: - cd dev/maven/parent && mvn clean install - -ow2-admin-guide: - $(MAKE) -C admin/$@ - - diff --git a/common/trunk/README b/common/trunk/README deleted file mode 100644 index 760253f27d681cb7d19a0d2c43a4713d4d48ebce..0000000000000000000000000000000000000000 --- a/common/trunk/README +++ /dev/null @@ -1,6 +0,0 @@ -Contrail / common -================= - -TBD - - diff --git a/common/trunk/admin/keys/Rakefile b/common/trunk/admin/keys/Rakefile deleted file mode 100644 index d826e7e463e11ba23a8da9819a3c5fef9c535d44..0000000000000000000000000000000000000000 --- a/common/trunk/admin/keys/Rakefile +++ /dev/null @@ -1,112 +0,0 @@ - -require 'fileutils' - - -PK_FILE = 'contrail.pub' -SK_FILE = 'contrail.sec' - -NAME = 'Contrail Project' -GPG = 'gpg --no-greeting --no-use-agent --armor ' - - - -task :default do - sh %{rake -T} -end - -def read_password(times=1) - result = nil - - begin - (1..times).each do - print 'Passphrase: ' - system "stty -echo" - s = STDIN.gets.chomp - system "stty echo" - print "\n" - result ||= s - raise Exception, "Passphrases do not match" if result != s - end - ensure - system "stty echo" - end - - return result -end - - -desc 'Generate a new key pair' -task :generate do - puts "Generating a new key pair for the Contrail project" - password = read_password(2) - begin - IO.popen(GPG + '--batch --gen-key', 'r+') do |p| - p.puts(<<-EOF) -Key-Type: DSA -Key-Length: 1024 -Subkey-Type: ELG-E -Subkey-Length: 1024 -Name-Real: #{NAME} -Name-Comment: http://contrail.ow2.org -Name-Email: contrail-admin@ow2.org -Expire-Date: 0 -Passphrase: #{password} -%pubring #{PK_FILE} -%secring #{SK_FILE} - EOF - p.close_write - end - puts "Now encrypt the private key using the same passphrase" - IO.popen(GPG + "--symmetric --cipher-algo aes256 --passphrase-fd 0 --output #{SK_FILE}.gpg #{SK_FILE}", "r+") do |p| - p.puts password - p.close_write - end - puts 'done' - ensure - # SK_FILE should be overwritten first - File.delete(SK_FILE) - end -end - - -desc 'Delete keys from the local GPG database' -task :delete do - sh %{#{GPG} --delete-secret-and-public-key '#{NAME}'} -end - - -desc 'Import keys into the local GPG database' -task :import do - puts "Importing public key" - sh %{#{GPG} --import #{PK_FILE}} - puts "Importing secret key" - sh %{#{GPG} --decrypt #{SK_FILE}.gpg | #{GPG} --import} -end - - -desc 'Print the keys in the local GPG database' -task :list do - sh %{#{GPG} --list-keys "#{NAME}"} -end - - -desc 'Check the key pair in the local GPG database is working well' -task :check do - sh %{echo "It works !!!" | #{GPG} -er "#{NAME}" --trust-model always | #{GPG} --decrypt} -end - - -desc 'Upload the public key on a public key server' -task :publish do - sh %{#{GPG} --keyserver keys.gnupg.net --send-key '#{NAME}'} -end - - -desc 'Remove generated key files' -task :clean do - begin - File.delete(PK_FILE) - ensure - File.delete(SK_FILE + '.gpg') - end -end diff --git a/common/trunk/admin/keys/contrail.pub b/common/trunk/admin/keys/contrail.pub deleted file mode 100644 index d7bdb16461c9f0a06b2a2eef4ab838631f1ad2db..0000000000000000000000000000000000000000 --- a/common/trunk/admin/keys/contrail.pub +++ /dev/null @@ -1,25 +0,0 @@ ------BEGIN PGP PUBLIC KEY BLOCK----- -Version: GnuPG v1.4.11 (GNU/Linux) - -mQGiBE6m3OQRBADOcgGeLTiFiLbV1W6sDtC/OiXtx/ouNBc/+qDJQzs9SXQqgmGs -cNEHnmhC+D9CQ0NPqL/arzJmSOMV89S2YN1vfpRWojUwTTEN7n8aO4OhBq6DuEm5 -x7K0v53wPXMW2iEoyZFzUCULb5LofHQBY98vJ4OiAwKamxHmareFFM2rowCgtdB1 -jSdG+idFxEaSrWTFVoXnXmsEAKD+Aq3Su1Wx0CC2xEuVe+M9RpoAvRMJC8Fy8n9p -Z+a4ESAX8ySIR9W5EKpg2dh09sYt0g3YmDbmwMi9WDmv9yKCWe/ira0BS9Xtt5ma -TkOJMRPmYmV0QnKDX8hXkFHGSJb2qPXCcbdWvCnlnZkUYqljqY157tVlqp4sqY9Q -XKdAA/oDCHU1EjvBfD+AnVs9h5ixdzESkq4JFXjOKwJV1ZQ4wU1LlLfQOMR1/w0m -xa4PqvizWfN2c+4du/3HRh+qvAohM8El5K+5LicvpEvUqWssYcDihYEsG5//ZZxy -65NkmNWSDYR0sU/szOOUCVeX68Gfm2qQgPUUgOQuQLQNU7X9P7RDQ29udHJhaWwg -UHJvamVjdCAoaHR0cDovL2NvbnRyYWlsLm93Mi5vcmcpIDxjb250cmFpbC1hZG1p -bkBvdzIub3JnPohiBBMRAgAiBQJOptzkAhsjBgsJCAcDAgYVCAIJCgsEFgIDAQIe -AQIXgAAKCRD3h9AE0Zr148E1AJ0QYKrJSaXw8m4COX0Ha6EQTOjXKgCeMgPDsOFM -h1SAoWBqKUG/DQ+JVh65AQ0ETqbc5BAEAIevzgRqZe5QUt+BWKw7SSfox9VGL4qD -Mfd/TUd/s8e1I+bZsVTOWb5sROd1caHFAn763UdyI+icTNh9H4PJ9Gb0510vKU3Z -5kH7J4mIBieqHA4w/PazyLYK5q9IfH+R72FOLOYH9GxE79x+0s1hdUFhhYVEoDqF -wzOpOr05ATVXAAQNA/4gQETWEwCGXq3lEgr/ZzL0fxh3UcAaxzT6OAth+MBdjTte -rYmDvVh5XBfanZglC4xDLfSYJjjEG5qS4xieQTrIabdwK6Ci0WhrxNKaCxGhm8cJ -kmaDgmldThjffZko9R8QClT3TlhnEiPCEmXW4fmcLblCw7fM9zYjoIbU6GIF/YhJ -BBgRAgAJBQJOptzkAhsMAAoJEPeH0ATRmvXj4EMAn19UmpbfhYEksw9KeNoeI/v0 -st/eAKCHqIIHSmlwdCOsofVbtJh6FrIG3Q== -=qlxa ------END PGP PUBLIC KEY BLOCK----- diff --git a/common/trunk/admin/keys/contrail.sec.gpg b/common/trunk/admin/keys/contrail.sec.gpg deleted file mode 100644 index c455bcbebc352ef6f7b7fd18faf1f4e456b0c4d5..0000000000000000000000000000000000000000 --- a/common/trunk/admin/keys/contrail.sec.gpg +++ /dev/null @@ -1,33 +0,0 @@ ------BEGIN PGP MESSAGE----- -Version: GnuPG v1.4.11 (GNU/Linux) - -jA0ECQMCDHtq0MFttsJg0uoBDkQ/ZHhvvY2gjzv6KPF54QvHRc/kOxoQmlgFyHGK -o7anzOhNlLRU8McfK2KpXY3a13oxMWsQYRZ6cP/t7MZVRGQVJ3fN5u4ujNKaASre -HrRM17DSZhxqWLMeBbDR8pbjoVUYuOFW08WFqVYRzoi/8DdBUonAlGQ05HGf766a -CO7I7KQYlZzA21Yy1ItxpGldrFSrJtertTicJUwc0HLxdpL8LySZSKTt5p+ChlqB -ahHmHqYUsU/lF5LRLNkx+exmhK1xynw7Rc6m5nPxPPdvFGr9Jrhad9TlDiYXeN0L -cCNuJsfjKiMLz26S7ogEna2A8UU2Kz/oDP7FbKJbZ6E7ftib4L4Pj54mel9xVA/y -C5jmuzAytTBPzGaqz40IePFl3n/SSMlthcq5AoC0T4SrKIy9KPjUmlXnpSPXyDbQ -yIAWB6FHdopPw5VWv872xWODUpODLmIg2jjMZq0DWNAIDiB56Lhhdz7n93RSlsrB -1jEbsLqePJ+fFg/CpMiX+6cp5q3GfXbeID2u5x0hVdLEawi+t/q/Llrcy8ry+Hto -ZLJfhJlhLDZUj1OcqMJ9kpB7TsuxUoGi2YSj1tLn9mxJilDw1HQSaXoywJE80Lv1 -cHdVdLm5XPTCV+/1Zd/MChxTEN91OkAVy9HutfN0N3ueQ6Jlf27L8LcmFHfDwJRq -SmXRfjdcZBxep6RXA4V7zYpWYkVnJd6F+WKbDE7BAnDNkjsnyWDhvr+UMampNXlA -ElJgyk8L+e89SVIVzk+9X1cNEe+vmDiTArqIVnFxH3QL8SHJtW0zbrWet85NaQLY -UYeIxrPH+pOU+U9wX7puvNPoRQ35O4EqKnTN0yYj9+TbQVZXEaIsWGV0mvopq4sO -GcG2a9piTQHmOdal6QL9u1fA8dMeIEYoe2J2f7kkU7vj4F5ve/LDNTHP0FJzAYLr -jyz6cwL0KVz9K24Z1cW1sftalkGj90zT+Htc+M4xYvmIoz3g+FZtVhXEIpQ4Kfv3 -5uB8f7XDemyMDPEqUdlQdLSWHtONUvYp8FYQtNHqhdLyIhgmkbSRYzA/laEIizTH -DMTxJINpmasXyATWUj8GHV8r4jCOPuv41cxbLOObdppC+vJJqCvy1JAuU+tojZde -jtAgixdiDe0JBbkF4XEitTIbDn6JSrLcpiii/pXK9xB4CDasWayqmrij7Z5jE4YX -pqtBJWOQ7Ea/ofnsbLfkpNWnTHoAl68znmCpI5XBCFyHYKavG8gl2yfFHxE/R4pK -zzqJyRtKEDL+yPeriR72uhYCHVhrnU+Q6MqU18LNSWghgOoft2aJ4nO6SIB0lXTi -sdesuRU5LV7B5tMdMDNKg820/xRG2xuCkpfryhIyIRwRwD7JJnYUlpHd2ycnxewV -Z/n2dRyQBhDRaa7FwqH3by24SBajLxqp33Hjo7YRrJ03PMyNJSYeaqGfasL66ZMe -37I31Mpq/jlnQvQwevBFuxQo/ZmmGm2KIGcT/FT5hgF6DSGaqNcWakGZq+iJLyaa -rTajOQ1DnpY6IKRsWE7VAi2WcBQwW+yePj+aDU5TbJE8fv4I5Rbqy34qnLGPATi3 -ma1Hw0MNG8bEQTkyVodjKvk6rS7fsnZHj2YKhr8s040pW7t+cwRyGqI/hIKu8CP6 -M7KpYWxdZ9i9X+WmSoIgH56cyxeup95WOK/5WR4A8IMsKsgmMFlbfvJA4P6+Qlle -QQ== -=oOuS ------END PGP MESSAGE----- diff --git a/common/trunk/admin/ow2-admin-guide/Makefile b/common/trunk/admin/ow2-admin-guide/Makefile deleted file mode 100644 index 2cf74399d235d84556dbf99929044034084540ea..0000000000000000000000000000000000000000 --- a/common/trunk/admin/ow2-admin-guide/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -# -# Makefile: build the pdf document -# -SHELL = /bin/bash - -pdflatex = pdflatex -no-shell-escape -halt-on-error - - -build: ow2-admin-guide.pdf - -%.pdf: tex/%.tex $(wildcard img/* tex/*) - $(pdflatex) $< - $(pdflatex) $< - -clean: - rm -f *.aux *.pdf *.log *.toc *.lof *.out - diff --git a/common/trunk/admin/ow2-admin-guide/img/contrail.png b/common/trunk/admin/ow2-admin-guide/img/contrail.png deleted file mode 100644 index 51aec770f46fea264d791c617c50b72f1dcdd816..0000000000000000000000000000000000000000 Binary files a/common/trunk/admin/ow2-admin-guide/img/contrail.png and /dev/null differ diff --git a/common/trunk/admin/ow2-admin-guide/img/push_website.png b/common/trunk/admin/ow2-admin-guide/img/push_website.png deleted file mode 100644 index f471f009e0e1aa16c729226db4eab9f44c2a3c9d..0000000000000000000000000000000000000000 Binary files a/common/trunk/admin/ow2-admin-guide/img/push_website.png and /dev/null differ diff --git a/common/trunk/admin/ow2-admin-guide/tex/ow2-admin-guide.tex b/common/trunk/admin/ow2-admin-guide/tex/ow2-admin-guide.tex deleted file mode 100644 index 342949ab6e490c90c74113702f688650668328d0..0000000000000000000000000000000000000000 --- a/common/trunk/admin/ow2-admin-guide/tex/ow2-admin-guide.tex +++ /dev/null @@ -1,37 +0,0 @@ -\documentclass[pdftex,12pt,a4paper]{article} - -\usepackage[pdftex]{graphicx} -\usepackage{hyperref} - -\hypersetup{ - bookmarks=true, - unicode=false, - pdfstartview={FitH} -} - - -\begin{document} - -% title -\input{tex/titlepage.tex} - -% abstract -\begin{abstract} -This document aims at providing the administrators of the \href{http://www.ow2.org/view/ActivitiesDashboard/Contrail}{OW2 Contrail project} with a comprehensive set of maintenance procedures. -\end{abstract} -\newpage - -% table of content -\tableofcontents -\newpage - -% list of figures -\listoffigures -\cleardoublepage - -% admin procedures -\input{tex/procedures.tex} - -\cleardoublepage -\end{document} - diff --git a/common/trunk/admin/ow2-admin-guide/tex/procedures.tex b/common/trunk/admin/ow2-admin-guide/tex/procedures.tex deleted file mode 100644 index d90eeccab85c27d6bb7c2a1e03fc7eb9dacc265c..0000000000000000000000000000000000000000 --- a/common/trunk/admin/ow2-admin-guide/tex/procedures.tex +++ /dev/null @@ -1,16 +0,0 @@ - -\section{Register a new developer} - - - -\section{Publish OW2 news} - -email to \href{mailto:contrail-admin@ow2.org} and ask to publish - - -\section{Freeze the SVN repository} - - -\section{Release Contrail} - - diff --git a/common/trunk/admin/ow2-admin-guide/tex/titlepage.tex b/common/trunk/admin/ow2-admin-guide/tex/titlepage.tex deleted file mode 100644 index 7c20f0a5e5c70b6fb2ee25cc82da32e927f0dc96..0000000000000000000000000000000000000000 --- a/common/trunk/admin/ow2-admin-guide/tex/titlepage.tex +++ /dev/null @@ -1,30 +0,0 @@ - -\begin{titlepage} - - \begin{center} - % logo - \includegraphics[width=0.75\textwidth]{img/contrail.png}\\[3cm] - %\textsc{\LARGE Contrail}\\[1.5cm] - %\textsc{\Large Final year project}\\[0.5cm] - - % Title - \rule{\linewidth}{0.5mm}\\[0.7cm] - { \huge \bfseries OW2 Administration Guide}\\[0.4cm] - \rule{\linewidth}{0.5mm}\\[3cm] - - % Authors - \begin{minipage}{0.4\textwidth} - \large \emph{Authors:}\\ - S\'ebastien \textsc{ANDR\'E} - \end{minipage} - - \vfill - - % Bottom of the page - {\large \today} - - \end{center} - -\end{titlepage} - - diff --git a/common/trunk/admin/registration/register-contrail-developer.sh b/common/trunk/admin/registration/register-contrail-developer.sh deleted file mode 100644 index 01be81dd617607f6c316a2b89cebeec3a1076e66..0000000000000000000000000000000000000000 --- a/common/trunk/admin/registration/register-contrail-developer.sh +++ /dev/null @@ -1,188 +0,0 @@ -#!/bin/bash -# -# Developers Registration Assistant for the Contrail project -# -# -# Authors: -# Sebastien Andre -# -# Versions: -# 2011-09-20 registration to gforge, jira, mailing lists + email -# - -TMPDIR="$(mktemp -td)" || exit 1 -trap "rm -fr $(printf '%q' "$TMPDIR")" EXIT -export TMPDIR - - - -# print a line with message $@ -say() { - printf "%s\n" "$*" -} - -# Print a line the same length as $1 with pattern $2 -line() { - printf "%s" "$1" | sed -e 's/./=/g' | tr '=' "${2:-"-"}" - say -} - -# Print a title -title() { - line "$*" '=' - say "$*" - line "$*" '=' - say -} - - -# Ask confirmation before running a command $@ -run() { - ask "Run command \`$*\`" ANS "Y/n" - case "$ANS" in - Y*|y*) - ( "$@" ) - say "Returned $?" - ;; - *) - say "Canceled by user" - esac -} - - -# Print the step described by $1 and run $@ if provided -step() { - say - say "* $1" - line "* $1" '-' - say - - shift - - if [ $# -gt 0 ] - then - run "$@" - pause - fi -} - - -# Pause until user press enter -pause() { - read -p 'Press to continue...' -} - - -# Ask for input of information $1 to be stored in $2 with default value $3 -ask() { - local desc="${1?}" - local var="${2?}" - local default="$3" - - eval "$var=" - until [ -n "${!var}" ] - do - read -p "${desc}${default:+" [${default}]"}: " "$var" - if [ -z "${!var}" ] - then - eval "$var=$(printf '%q' "$default")" - fi - done -} - - - -############################################################################# -BROWSER="$(type -p firefox || echo "echo")" -MAILFILE="$(mktemp -t)" || exit 1 - - -title 'Contrail Project - Developers Registration Assistant' - -# read infos -step "Collecting developer's information" - -ask "Full Name" DEV_FULL_NAME "$1" -ask "Email" DEV_EMAIL "$2" -ask "OW2 GForge login" DEV_LOGIN_GFORGE "$3" -ask "OW2 Jira login" DEV_LOGIN_JIRA "$4" - - -# GForge -step "Log in OW2 GForge" \ - "$BROWSER" \ - "https://forge.ow2.org/account/login.php" - -step "Add user '${DEV_LOGIN_GFORGE}' to group 'Members' with role 'Developer'" \ - "$BROWSER" "https://forge.ow2.org/project/admin/?group_id=396" - - -# Jira -step "Log in OW2 Jira" \ - "$BROWSER" \ - "http://jira.ow2.org/secure/Dashboard.jspa" - -step "Assign user '${DEV_LOGIN_JIRA}' to project role 'Developers'" \ - "$BROWSER" \ - "http://jira.ow2.org/secure/project/UserRoleActorAction.jspa?projectRoleId=10001&projectId=10051" - - - -# Mailing lists -step "Log in OW2 mail manager" \ - "$BROWSER" \ - "http://mail.ow2.org/wws" - -for ml in contrail-dev contrail-commits -do - step "Add subscriber '${DEV_EMAIL} ${DEV_FULL_NAME}' to mailing list $ml" \ - "$BROWSER" \ - "http://mail.ow2.org/wws/add_request/$ml" -done - - - -# Welcome email -cat < "$MAILFILE" -From: contrail-admin@ow2.org -To: ${DEV_FULL_NAME} <${DEV_EMAIL}> -Bcc: contrail-admin@ow2.org -Subject: Welcome to the Contrail project developers team ! -Reply-To: contrail-admin@ow2.org - -Dear ${DEV_FULL_NAME}, - - -Thank you for registering as a developer to the Contrail project. - - -You have been granted permissions to use the Contrail code repository and -the bug tracking system hosted by the OW2 consortium. - -You've also been subscribed to the contrail-dev@ow2.org and -contrail-commits@ow2.org mailing lists. - -For informations about your SVN access, please read -http://forge.ow2.org/plugins/scmsvn/index.php?group_id=396. - - -If you have any question regarding OW2 collaboration tools for the Contrail -project, please contact contrail-admin@ow2.org. - - -Best Regards, --- -Contrail OW2 Administrators -http://www.ow2.org/view/ActivitiesDashboard/Contrail -EOF - -step "Send a welcome email" \ - mutt -n -e "set signature=" -H "$MAILFILE" - - - -# Terminate -say -say "Registration procedure terminated" -exit 0 - diff --git a/common/trunk/admin/svnhooks/Makefile b/common/trunk/admin/svnhooks/Makefile deleted file mode 100644 index 86d015e12698e3787059b3872c220346505609b0..0000000000000000000000000000000000000000 --- a/common/trunk/admin/svnhooks/Makefile +++ /dev/null @@ -1,37 +0,0 @@ -# -# Makefile: check syntax and install Contrail subversion hook scripts -# - -SHELL = /bin/bash - -SRCDIR = $(CURDIR)/src - -SCRIPTS = pre-commit - -SVN_HOST = svn.forge.objectweb.org -SVN_REPO = /var/lib/gforge/chroot/svnroot/contrail - - -.PHONY: help clean - - -# Build all hook scripts -build: $(SCRIPTS) - -# Install hook scripts on the local machine -install: build - cp -p $(SCRIPTS) $(SVN_REPO)/hooks/ - -# Deploy hook scripts on the remote (production) server -deploy: build - scp -C -p -- $(SCRIPTS) $(SVN_HOST):$(SVN_REPO)/hooks/ - -# Remove generated files -clean: - rm -f $(SCRIPTS) - -# Build hook script -%: $(SRCDIR)/%.sh - sh -n $< - install -m 0775 $< $@ - diff --git a/common/trunk/admin/svnhooks/src/pre-commit.sh b/common/trunk/admin/svnhooks/src/pre-commit.sh deleted file mode 100644 index 843fdfd58b11a7f745ea4d340f6c4311941aafd6..0000000000000000000000000000000000000000 --- a/common/trunk/admin/svnhooks/src/pre-commit.sh +++ /dev/null @@ -1,168 +0,0 @@ -#!/bin/sh - -# PRE-COMMIT HOOK -# -# The pre-commit hook is invoked before a Subversion txn is -# committed. Subversion runs this hook by invoking a program -# (script, executable, binary, etc.) named 'pre-commit' (for which -# this file is a template), with the following ordered arguments: -# -# [1] REPOS-PATH (the path to this repository) -# [2] TXN-NAME (the name of the txn about to be committed) -# -# [STDIN] LOCK-TOKENS ** the lock tokens are passed via STDIN. -# -# If STDIN contains the line "LOCK-TOKENS:\n" (the "\n" denotes a -# single newline), the lines following it are the lock tokens for -# this commit. The end of the list is marked by a line containing -# only a newline character. -# -# Each lock token line consists of a URI-escaped path, followed -# by the separator character '|', followed by the lock token string, -# followed by a newline. -# -# The default working directory for the invocation is undefined, so -# the program should set one explicitly if it cares. -# -# If the hook program exits with success, the txn is committed; but -# if it exits with failure (non-zero), the txn is aborted, no commit -# takes place, and STDERR is returned to the client. The hook -# program can use the 'svnlook' utility to help it examine the txn. -# -# On a Unix system, the normal procedure is to have 'pre-commit' -# invoke other programs to do the real work, though it may do the -# work itself too. -# -# *** NOTE: THE HOOK PROGRAM MUST NOT MODIFY THE TXN, EXCEPT *** -# *** FOR REVISION PROPERTIES (like svn:log or svn:author). *** -# -# This is why we recommend using the read-only 'svnlook' utility. -# In the future, Subversion may enforce the rule that pre-commit -# hooks should not modify the versioned data in txns, or else come -# up with a mechanism to make it safe to do so (by informing the -# committing client of the changes). However, right now neither -# mechanism is implemented, so hook writers just have to be careful. -# -# Note that 'pre-commit' must be executable by the user(s) who will -# invoke it (typically the user httpd runs as), and that user must -# have filesystem-level permission to access the repository. -# -# On a Windows system, you should name the hook program -# 'pre-commit.bat' or 'pre-commit.exe', -# but the basic idea is the same. -# -# The hook program typically does not inherit the environment of -# its parent process. For example, a common problem is for the -# PATH environment variable to not be set to its usual value, so -# that subprograms fail to launch unless invoked via absolute path. -# If you're having unexpected problems with a hook program, the -# culprit may be unusual (or missing) environment variables. -# -# Here is an example hook script, for a Unix /bin/sh interpreter. -# For more examples and pre-written hooks, see those in -# /usr/share/subversion/hook-scripts, and in the repository at -# http://svn.apache.org/repos/asf/subversion/trunk/tools/hook-scripts/ and -# http://svn.apache.org/repos/asf/subversion/trunk/contrib/hook-scripts/ -# - - -# Path to the SVN repository -REPOS="$1" - -# Id of the transaction -TXN="$2" - -# List of users for which rules do not apply (admins) -ADMINS="mateja sandre" - -# Freeze the code if value is "yes" -FREEZE="no" - - -# Execute the svnlook command $1 -svnlook() { - /usr/bin/svnlook "${1?}" -t "$TXN" "$REPOS" \ - || reject "server internal error" -} - - -# Reject the commit with error message $1 -reject () { - mail -s "Contrail: svnhook usage: pre-commit" sandre@petalslink.com <<<" -A commit has been rejected by the Contrail SVN pre-commit hook. - -Error: - ${1:-""} - -Developer: - $(svnlook author) - -Date: - $(svnlook date) - -Changed: - $(svnlook changed) -" - - echo " -ERROR: ${1:-'your commit transaction has been rejected'}. - -For further explanations about the Contrail project's coding policy, -please refer to the public wiki at -http://contrail-project.eu/development-wiki/-/wiki/Main/Coding+best+practices+in+Contrail - -If you think your commit shouldn't have been rejected, please contact -the Contrail OW2 administrators at and try -again later." >&2 - exit 1 -} - -# Allow the commit -allow() { - echo "commit ${TXN}@${REPOS} allowed" - exit 0 -} - - - - -############################################################################# - -# commit allowed if author is one of the admins -echo "$ADMINS" \ - | grep -qwF "`svnlook 'author'`" \ - && allow - - -# commit not allowed if code frozen -[ "$FREEZE" = "yes" ] \ - && reject 'source code is currently frozen, please retry later' - - -# commit rejected if log message does not contain any printable character -svnlook 'log' \ - | grep -qE '[^[:space:]]' \ - || reject 'commit message is blank or empty' - - -# commit rejected if attempt to modify repo structure -svnlook 'dirs-changed' \ - | grep -qxF '/' \ - && reject 'trying to modify the repository structure' - - -# commit rejected if trying to add or update eclipse config files -svnlook 'changed' \ - | grep -qE '^(A|U|_U|UU)[[:space:]]+.*/\.(classpath|project|settings/)' \ - && reject 'trying to commit an IDE configuration file (e.g. .project, .classpath, .settings)' - - -# commit rejected if trying to add or update a data file -svnlook 'changed' \ - | grep -qE '^(A|U|_U|UU)[[:space:]]+.*\.(log)$' \ - && reject 'trying to commit data or binary file (e.g. *.zip, *.log)' - - -# All checks passed, so allow the commit. -allow - diff --git a/common/trunk/dev/maven/parent/pom.xml b/common/trunk/dev/maven/parent/pom.xml deleted file mode 100644 index ab0dbb9d3cee2276fdcf75c06175d6f71e77a8f0..0000000000000000000000000000000000000000 --- a/common/trunk/dev/maven/parent/pom.xml +++ /dev/null @@ -1,98 +0,0 @@ - - - - 4.0.0 - - - 2.2.1 - - - - org.ow2 - ow2 - 1.3 - - - org.ow2.contrail - contrail - 0.2-SNAPSHOT - - pom - - Contrail - Supply of, and demand for computational capacity is elastic. Some companies are are falling short, others have capacity in abundance. More often than not the need or surplus in computational power or storage capacity is temporary. Wouldn't it be wonderful if the surplus of one corporation could (temporarily) alleviate the wantage of the other. A consortium of ten organisations from six European countries started on a collaborative project to enable just that. The Contrail project aims to design, implement, evaluate and promote an open source computational cloud wherein users can share resources without limit. - http://contrail-project.eu/ - 2010 - - - Contrail Consortium - http://contrail-project.eu/partners - - - - - Apache 2 - http://www.apache.org/licenses/LICENSE-2.0.txt - repo - A business-friendly OSS license - - - - - Atlassian Jira - http://jira.ow2.org/browse/CONTRAIL - - - - Atlassian Bamboo - http://bamboo.ow2.org/browse/CONTRAIL - - - - - Commits List - contrail-commits-subscribe@ow2.org - contrail-commits-unsubscribe@ow2.org - http://mail.ow2.org/wws/info/contrail-commits - http://mail-archive.ow2.org/contrail-commits/index.html - - - - - - - - - org.apache.maven.plugins - maven-release-plugin - 2.1 - - forked-path - - false - - -Pcontrail-release - - - - - - - - - contrail-release - - - - - - scm:svn:svn://svn.forge.objectweb.org/svnroot/contrail/common/trunk/maven/parent - scm:svn:svn+ssh://svn.forge.objectweb.org/svnroot/contrail/common/trunk/maven/parent - http://websvn.ow2.org/filedetails.php?repname=contrail&path=%2Fcommon%2Ftrunk%2Fmaven%2Fparent%2Fpom.xml - - - - diff --git a/common/trunk/dev/maven/settings/settings.xml b/common/trunk/dev/maven/settings/settings.xml deleted file mode 100644 index 5e751afe337d3fa16b3af95f9e153e252e56f96c..0000000000000000000000000000000000000000 --- a/common/trunk/dev/maven/settings/settings.xml +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - contrail - - true - - - - contrail-staging - Contrail Staging Repository - http://repository.ow2.org/nexus/content/repositories/ow2_contrail-011/ - - true - - - false - - - - - - ow2 - - true - - - - ow2-releases - OW2 Releases Repository - http://repository.ow2.org/nexus/content/repositories/releases/ - - true - - - false - - - - ow2-snapshots - OW2 Snapshots Repository - http://repository.ow2.org/nexus/content/repositories/snapshots/ - - false - - - true - - - - - - - diff --git a/common/trunk/src/ovf-parser/OVFParser/data/contrail_petstore.xml b/common/trunk/src/ovf-parser/OVFParser/data/contrail_petstore.xml deleted file mode 100644 index 5b0e0b26053220ab4e077432883dfd044dc3658d..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/data/contrail_petstore.xml +++ /dev/null @@ -1,618 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - Describes the set of virtual disks - - - - - - - - - - - - - - - - - - List of logical networks used in the package - - The network used to link the web server node and the engine frontend node. - - - The network used to link the engine nodes. - - - The network used to link the engine backend node and the db frontend node. - - - The network used to link the db nodes. - - - - - - - - - The packaging of the Contrail PetStoreService multi-tier application - Contrail PetStore Service - - - Describes product information for the service - Contrail PetStore Web Portal - Some Random Organization - 4.5 - 4.5-b4523 - http://www.vmware.com/go/ovf - http://www.vmware.com/ - - Network properties - - - - - - Defines minimum reservations for CPU and memory - - - byte * 2^20 - 512 MB reservation - 0 - 512 - 4 - - - - byte * 2^20 - 384 MB reservation - 0 - 384 - 4 - - - - - MHz - 1000 MHz reservation - 1 - 500 - 3 - - - MHz - 500 MHz reservation - 1 - 500 - 3 - - - MHz - 1500 MHz reservation - 1 - 1500 - 3 - - - - - Specifies how the composite service is powered-on and off - - - - - - - - - - - The virtual machine containing the WebServer application - - Describes the product information - Apache Webserver - Apache Software Foundation - 6.5 - 6.5-b2432 - - - - - - - 256 MB, 1 CPU, 1 disk, 1 nic virtual machine - - Virtual Hardware Family - 0 - vmx-04 - - - Number of virtual CPUs - 1 virtual CPU - 1 - 3 - 1 - - - byte * 2^20 - Memory Size - 256 MB of memory - 2 - 4 - 256 - - - 0 - Harddisk 1 - ovf:/disk/web - 22001 - 1000 - 17 - - - true - VM Network - Ethernet adapter on "VM Network" - - 3 - PCNet32 - 10 - - - 1 - SCSI Controller 0 - LSI Logic - 1000 - LsiLogic - 6 - - - - - - - The virtual machines containing the subgraph for the engine of the application - - - - - - - - - Virtual Hardware Family - 0 - vmx-04 - - - Number of virtual CPUs - 1 virtual CPU - 1 - 3 - 1 - - - byte * 2^20 - Memory Size - 256 MB of memory - 2 - 4 - 256 - - - 0 - Harddisk 1 - ovf:/disk/engine_frontend - 22001 - 1000 - 17 - - - - - - - - - - - Virtual Hardware Family - 0 - vmx-04 - - - Number of virtual CPUs - 1 virtual CPU - 1 - 3 - 1 - - - byte * 2^20 - Memory Size - 256 MB of memory - 2 - 4 - 256 - - - 0 - Harddisk 1 - ovf:/disk/engine_worker - 22001 - 1000 - 17 - - - - - - - - - - - Virtual Hardware Family - 0 - vmx-04 - - - Number of virtual CPUs - 1 virtual CPU - 1 - 3 - 1 - - - byte * 2^20 - Memory Size - 256 MB of memory - 2 - 4 - 256 - - - 0 - Harddisk 1 - ovf:/disk/engine_worker - 22001 - 1000 - 17 - - - - - - - - - - - - Virtual Hardware Family - 0 - vmx-04 - - - Number of virtual CPUs - 1 virtual CPU - 1 - 3 - 1 - - - byte * 2^20 - Memory Size - 256 MB of memory - 2 - 4 - 256 - - - 0 - Harddisk 1 - ovf:/disk/engine_backend - 22001 - 1000 - 17 - - - - - - - - Describes a clustered database instance - - Product Information - Somebody Clustered SQL Server - TBD - 2.5 - 2.5-b1234 - - - - - Specifies how the composite service is powered-on and off - - - - - - - - - - - - - Virtual Hardware Family - 0 - vmx-04 - - - Number of virtual CPUs - 1 virtual CPU - 1 - 3 - 1 - - - byte * 2^20 - Memory Size - 256 MB of memory - 2 - 4 - 256 - - - 0 - Harddisk 1 - ovf:/disk/db_frontend - 22001 - 1000 - 17 - - - - - - - Describes a virtual machine with the database image installed - Database Instance I - - - - - - - 256 MB, 1 CPU, 1 disk, 1 nic virtual machine - - Virtual Hardware Family - 0 - vmx-04 - - - Number of virtual CPUs - 1 virtual CPU - 1 - 3 - 1 - - - byte * 2^20 - Memory Size - 256 MB of memory - 2 - 4 - 256 - - - 0 - Harddisk 1 - ovf:/disk/db_backend - 22001 - 1000 - 17 - - - true - VM Network - Ethernet adapter on "VM Network" - 3 - PCNet32 - 10 - - - 1 - SCSI Controller 0 - LSI Logic - 1000 - LsiLogic - 6 - - - - - - - - Describes a virtual machine with the database image installed - Database Instance II - - Specifies the OVF properties available in the OVF environment - - - - - 256 MB, 1 CPU, 1 disk, 1 nic virtual machine - - Virtual Hardware Family - 0 - vmx-04 - - - Number of virtual CPUs - 1 virtual CPU - 1 - 3 - 1 - - - byte * 2^20 - Memory Size - 256 MB of memory - 2 - 4 - 256 - - - 0 - Harddisk 1 - ovf:/disk/db_backend - 22001 - 1000 - 17 - - - true - VM Network - Ethernet adapter on "VM Network" - - 3 - PCNet32 - 10 - - - 1 - SCSI Controller 0 - LSI Logic - 1000 - LsiLogic - 6 - - - - - - - - - \ No newline at end of file diff --git a/common/trunk/src/ovf-parser/OVFParser/data/small-vm.ovf b/common/trunk/src/ovf-parser/OVFParser/data/small-vm.ovf deleted file mode 100644 index 8ac65fbeefc7847822cf4c213ffe5455c17f23f8..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/data/small-vm.ovf +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - - Virtual disk information - - - - The list of logical networks - - The VM Network network - - - - A virtual machine - Small VM - - The kind of installed guest operating system - Microsoft Windows Server 2003, Standard Edition (32-bit) - - - Virtual hardware requirements - - Virtual Hardware Family - 0 - Small VM - vmx-07 - - - hertz * 10^6 - Number of Virtual CPUs - 1 virtual CPU(s) - 1 - 3 - 1 - - - byte * 2^20 - Memory Size - 512MB of memory - 2 - 4 - 512 - - - 0 - SCSI Controller - SCSI controller 0 - 3 - lsilogic - 6 - - - 1 - IDE Controller - IDE 1 - 4 - 5 - - - 0 - IDE Controller - IDE 0 - 5 - 5 - - - 0 - false - Floppy Drive - Floppy drive 1 - 6 - 14 - - - The main CD drive - 0 - false - CD/DVD Drive 1 - 7 - 4 - 15 - - - 7 - true - VM Network - E1000 ethernet adapter on "VM Network" - Network adapter 1 - 8 - E1000 - 10 - - - The main Hard Disk - 0 - Hard disk 1 - ovf:/disk/vmdisk1 - 9 - 3 - 17 - - - - diff --git a/common/trunk/src/ovf-parser/OVFParser/lib/mascopt-1.3.2/mascoptLib-1.3.2.jar b/common/trunk/src/ovf-parser/OVFParser/lib/mascopt-1.3.2/mascoptLib-1.3.2.jar deleted file mode 100644 index ac5cd64b276bb0b9110dbe0acbb76bf9fc43bf7d..0000000000000000000000000000000000000000 Binary files a/common/trunk/src/ovf-parser/OVFParser/lib/mascopt-1.3.2/mascoptLib-1.3.2.jar and /dev/null differ diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/Test/TestOVFParser.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/Test/TestOVFParser.java deleted file mode 100644 index 00adba2b8002418f550026fcb1abb121000c0186..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/Test/TestOVFParser.java +++ /dev/null @@ -1,50 +0,0 @@ -package org.ow2.contrail.federation.Test; - -import java.io.BufferedReader; -import java.io.FileNotFoundException; -import java.io.FileReader; -import java.io.IOException; -import java.net.URISyntaxException; - -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.xpath.XPathExpressionException; - -import mascoptLib.graphs.Graph; - -import org.ow2.contrail.federation.application.ApplianceDescriptor; -import org.ow2.contrail.federation.application.ApplicationDescriptor; -import org.ow2.contrail.federation.application.ovf.Disk; -import org.ow2.contrail.federation.application.ovf.OVFParser; -import org.w3c.dom.DOMException; -import org.xml.sax.SAXException; - -public class TestOVFParser { - - public static void main(String[] args) throws NumberFormatException, FileNotFoundException, XPathExpressionException, DOMException, ParserConfigurationException, SAXException, IOException, URISyntaxException - { - FileReader fr = new FileReader("data/contrail_petstore.xml"); - - BufferedReader br = new BufferedReader(fr); - StringBuffer sb = new StringBuffer(); - while(br.ready()){ - sb.append(br.readLine()); - } - - ApplicationDescriptor app = OVFParser.ParseOVF(sb.toString()); - - for (ApplianceDescriptor a : app.getAppliancesDescriptors()) - { - for (Disk d : a.getDisks()) - { - System.out.println(d.getId()); - System.out.println(d.getFile()); - } - - System.out.println("-------"); - } - - Graph g = app.getApplicationGraph(); - System.out.println(g); - } - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ApplianceDescriptor.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ApplianceDescriptor.java deleted file mode 100644 index dfda0403399c156bc929b30ecef15c459f479208..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ApplianceDescriptor.java +++ /dev/null @@ -1,73 +0,0 @@ -package org.ow2.contrail.federation.application; - -import java.util.Collection; - -import mascoptLib.graphs.Vertex; - -import org.ow2.contrail.federation.application.ovf.Disk; -import org.ow2.contrail.federation.application.ovf.OVFVirtualNetwork; -import org.ow2.contrail.federation.application.ovf.OVFVirtualSystem; - -public interface ApplianceDescriptor -{ - /** - * Gets the URI of the appliance. - * - * @return A String. - */ - public String getApplianceURI(); - - /** - * Gets the appliance identifier. - * - * @return An identifier expressed as a String. - */ - public String getID(); - - /** - * Gets the image size. - * - * @return long - */ - public long getSize(); - - /** - * Gets the virtual systems associated with the OVF. - * - * @return A collection of OVFVirtualSystems. - */ - // TODO: in case of "simple" appliance (e.g. just 1 VS) collection is not used! - // otherwise recursively another ApplianceDescriptor is created, so this can become just a reference - // to a VirtualSystem. - public Collection getVirtualSystems(); - - /** - * Get the virtual networks associated with the appliance. - * - * @return A collection of OVFVirtualNetwork. - */ - public Collection getAssociatedVirtualNetworks(); - - /** - * Get the vertex associated with this appliance in the appliance graph. - * - * @return A Mascopt Vertex. - */ - public Vertex getVertex(); - - /** - * Gets the appliances this appliance is made of. - * - * @return A collection of ApplianceDescriptor. - */ - public Collection getAppliancesDescriptors(); - - //TODO: public Graph getApplianceGraph(); - - /** - * Gets the disk images used by this appliance. - * - * @return A collection of Disk. - */ - public Collection getDisks(); -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ApplicationDescriptor.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ApplicationDescriptor.java deleted file mode 100644 index a1ad6527d9f4612a6747b86439e93aecec916850..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ApplicationDescriptor.java +++ /dev/null @@ -1,30 +0,0 @@ -package org.ow2.contrail.federation.application; - -import java.util.Collection; - -import mascoptLib.graphs.Graph; - -import org.ow2.contrail.federation.application.constraints.ApplicationConstraints; -import org.ow2.contrail.federation.application.constraints.UserConstraints; -import org.ow2.contrail.federation.application.sla.implementation.InternalSLAProposalImpl; - -public interface ApplicationDescriptor { - - // TODO: remove! Moved inside ApplianceDescriptor - public Graph getApplicationGraph(); - - public Collection getAppliancesDescriptors(); - - /** The proposal is unique for each submission, maybe we can - * provide specific method in the InternalSLAProposalImpl Class - * to manage different degrees of granularity */ - public InternalSLAProposalImpl getSLAProposal(); - - public ApplicationConstraints getApplicationConstraints(); - - public UserConstraints getUserConstraints(); - - @Override - public String toString(); - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/constraints/ApplicationConstraints.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/constraints/ApplicationConstraints.java deleted file mode 100644 index 2f18e3b6e3364edd545aaf140238a183417e40f9..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/constraints/ApplicationConstraints.java +++ /dev/null @@ -1,13 +0,0 @@ -package org.ow2.contrail.federation.application.constraints; - -import org.ow2.contrail.federation.application.ApplianceDescriptor; - -public interface ApplicationConstraints { - - - public String getCPURequirement(ApplianceDescriptor appDescr); - - public String getRAMRequirement(ApplianceDescriptor appDescr); - - public String getStorageRequirement(ApplianceDescriptor appDescr); -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/constraints/UserConstraints.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/constraints/UserConstraints.java deleted file mode 100644 index 48d0103ed83b4f9980503f75bec56c9504158954..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/constraints/UserConstraints.java +++ /dev/null @@ -1,5 +0,0 @@ -package org.ow2.contrail.federation.application.constraints; - -public interface UserConstraints { - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/implementation/ApplianceDescriptorImpl.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/implementation/ApplianceDescriptorImpl.java deleted file mode 100644 index bf7d07364a09d3b4eb627e9e40f8a25b630eb490..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/implementation/ApplianceDescriptorImpl.java +++ /dev/null @@ -1,160 +0,0 @@ -package org.ow2.contrail.federation.application.implementation; - -import java.util.ArrayList; -import java.util.Collection; - -import mascoptLib.graphs.Vertex; - -import org.ow2.contrail.federation.application.ApplianceDescriptor; -import org.ow2.contrail.federation.application.ovf.Disk; -import org.ow2.contrail.federation.application.ovf.OVFVirtualHardware; -import org.ow2.contrail.federation.application.ovf.OVFVirtualNetwork; -import org.ow2.contrail.federation.application.ovf.OVFVirtualSystem; -import org.ow2.contrail.federation.application.ovf.virtualhardware.OVFVirtualHwDiskDrive; - -public class ApplianceDescriptorImpl extends Vertex implements ApplianceDescriptor { - - private String applianceURI; - - private String id; - private long size; - - private Collection virtualSystems; - - private Collection virtualNetworks; - - private Vertex myVertex; - - private Collection childAppliances; - - public ApplianceDescriptorImpl(String lid, String luri, long lsize) - { - id = lid; - applianceURI = luri; - size = lsize; - - virtualSystems = new ArrayList(); - virtualNetworks = new ArrayList(); - - myVertex = new Vertex(); - - childAppliances = new ArrayList(); - } - - /** - * Gets the URI of the appliance. - * - * @return A String. - */ - @Override - public String getApplianceURI() - { - return applianceURI; - } - - /** - * Gets the appliance identifier. - * - * @return An identifier expressed as a String. - */ - @Override - public String getID() - { - return id; - } - - /** - * Gets the image size. - * - * @return long - */ - @Override - public long getSize() - { - return size; - } - - /** - * Gets the virtual systems associated with the OVF. - * - * @return A collection of OVFVirtualSystems. - */ - @Override - public Collection getVirtualSystems() - { - return virtualSystems; - } - - /** - * Get the virtual networks associated with the appliance. - * - * @return A collection of OVFVirtualNetwork. - */ - @Override - public Collection getAssociatedVirtualNetworks() - { - return virtualNetworks; - } - - /** - * Get the vertex associated with this appliance in the appliance graph. - * - * @return A Mascopt Vertex. - */ - @Override - public Vertex getVertex() - { - return myVertex; - } - - /** - * Gets the appliances this appliance is made of. - * - * @return A collection of ApplianceDescriptor. - */ - @Override - public Collection getAppliancesDescriptors() - { - return childAppliances; - } - - // TODO: right now it computes the image set in a lazy way. - // avoid to recompute the set everytime. - /** - * Gets the disk images used by this appliance. - * - * @return A collection of Disk. - */ - @Override - public Collection getDisks() - { - Collection result = new ArrayList(); - - // this - for (OVFVirtualSystem vs : virtualSystems) - { - for (OVFVirtualHardware vh : vs.getRequiredHardware()) - { - if (vh.getResourceType() == 17) - { - result.add( - ((OVFVirtualHwDiskDrive)vh).getDisk()); - } - } - } - - // children - for (ApplianceDescriptor child : childAppliances) - { - result.addAll(child.getDisks()); - } - - return result; - } - - @Override - public String toString() - { - return super.toString(); - } -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/implementation/ApplicationConstraintsImpl.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/implementation/ApplicationConstraintsImpl.java deleted file mode 100644 index 5db3e3eeb1939a209ebd82f9b12b4101a7dcb8ab..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/implementation/ApplicationConstraintsImpl.java +++ /dev/null @@ -1,22 +0,0 @@ -package org.ow2.contrail.federation.application.implementation; - -import org.ow2.contrail.federation.application.ApplianceDescriptor; -import org.ow2.contrail.federation.application.constraints.ApplicationConstraints; - -public class ApplicationConstraintsImpl implements ApplicationConstraints -{ - @Override - public String getCPURequirement(ApplianceDescriptor appDescr) { - return null; - } - - @Override - public String getRAMRequirement(ApplianceDescriptor appDescr) { - return null; - } - - @Override - public String getStorageRequirement(ApplianceDescriptor appDescr) { - return null; - } -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/implementation/ApplicationDescriptorImpl.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/implementation/ApplicationDescriptorImpl.java deleted file mode 100644 index 1a8a326e2ad05ed2fb6283869f15dadd158194d7..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/implementation/ApplicationDescriptorImpl.java +++ /dev/null @@ -1,133 +0,0 @@ -package org.ow2.contrail.federation.application.implementation; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashSet; - -import mascoptLib.graphs.Edge; -import mascoptLib.graphs.EdgeSet; -import mascoptLib.graphs.Graph; -import mascoptLib.graphs.VertexSet; - -import org.ow2.contrail.federation.application.ApplianceDescriptor; -import org.ow2.contrail.federation.application.ApplicationDescriptor; -import org.ow2.contrail.federation.application.constraints.ApplicationConstraints; -import org.ow2.contrail.federation.application.constraints.UserConstraints; -import org.ow2.contrail.federation.application.ovf.OVFVirtualNetwork; -import org.ow2.contrail.federation.application.sla.implementation.InternalSLAProposalImpl; - -public class ApplicationDescriptorImpl implements ApplicationDescriptor { - - private Collection appliances; - private InternalSLAProposalImpl slaProposal; - private ApplicationConstraints appConstraints; - private UserConstraints userConstraints; - - public ApplicationDescriptorImpl() - { - appliances = new ArrayList(); - slaProposal = new InternalSLAProposalImpl(); - appConstraints = new ApplicationConstraintsImpl(); - userConstraints = new UserConstraintsImpl(); - } - - private void addLeafNodes(ApplianceDescriptor appliance, Collection allAppliances) - { - // base case: leaf node. - if (appliance.getAppliancesDescriptors().size() == 0) - { - allAppliances.add(appliance); - } - else - { - // inductive case: search inside children nodes. - for (ApplianceDescriptor app : appliance.getAppliancesDescriptors()) - { - addLeafNodes(app, allAppliances); - } - } - } - - @Override - public Graph getApplicationGraph() - { - // add leaf nodes. - Collection allAppliances = new ArrayList(); - for (ApplianceDescriptor app : appliances) - { - addLeafNodes(app, allAppliances); - } - - Graph result = new Graph(); - - // build the vertex set. - VertexSet vs = new VertexSet(); - for (ApplianceDescriptor appliance : allAppliances) - { - vs.add(appliance.getVertex()); - } - result.setVertexSet(vs); - - // build the edge set. - // FIXME: improve efficiency, right now the time complexity is O(n^2). - HashSet edges = new HashSet(); // used to avoid duplicates edges addition. - - result.setEdgeSet(new EdgeSet(vs)); - for (ApplianceDescriptor appliance : allAppliances) - { - for (ApplianceDescriptor other : allAppliances) - { - if (appliance != other) - { - for (OVFVirtualNetwork n : appliance.getAssociatedVirtualNetworks()) - { - if (other.getAssociatedVirtualNetworks().contains(n)) - { - String inverseEdge = - other.getVertex().toString() + appliance.getVertex().toString(); - - if (!edges.contains(inverseEdge.toString())) - { - String edge = - appliance.getVertex().toString() + other.getVertex().toString(); - edges.add(edge); - - result.getEdgeSet().add( - new Edge(appliance.getVertex(), other.getVertex())); - } - } - } - } - } - } - - return result; - } - - @Override - public InternalSLAProposalImpl getSLAProposal() { - return slaProposal; - } - - @Override - public Collection getAppliancesDescriptors() { - return appliances; - } - - @Override - public ApplicationConstraints getApplicationConstraints() { - return appConstraints; - } - - @Override - public UserConstraints getUserConstraints() { - return userConstraints; - } - - @Override - public String toString() - { - return super.toString(); - } - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/implementation/UserConstraintsImpl.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/implementation/UserConstraintsImpl.java deleted file mode 100644 index 212e25f6ae149e762e61fbc475c3b25566492f9e..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/implementation/UserConstraintsImpl.java +++ /dev/null @@ -1,7 +0,0 @@ -package org.ow2.contrail.federation.application.implementation; - -import org.ow2.contrail.federation.application.constraints.UserConstraints; - -public class UserConstraintsImpl implements UserConstraints { - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/Disk.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/Disk.java deleted file mode 100644 index 85f7f8d703644564de00ece96da2a0b8f0dcc9f9..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/Disk.java +++ /dev/null @@ -1,23 +0,0 @@ -package org.ow2.contrail.federation.application.ovf; - -public class Disk { - - private File file; - private String id; - - public Disk(File file, String id) - { - this.file = file; - this.id = id; - } - - public File getFile() - { - return file; - } - - public String getId() { - return id; - } - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/File.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/File.java deleted file mode 100644 index 4d44ffd98528a5e2c4ba2b7689f00d9b288c4f9c..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/File.java +++ /dev/null @@ -1,29 +0,0 @@ -package org.ow2.contrail.federation.application.ovf; - - -public class File { - - private String id; - private String uri; - private long size; - - public File(String id, String uri, long size) - { - this.id = id; - this.uri = uri; - this.size = size; - } - - public String getId() { - return id; - } - - public String getUri() { - return uri; - } - - public long getSize() { - return size; - } - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/OVFItemProcessor.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/OVFItemProcessor.java deleted file mode 100644 index 10e6f6e9f3e223d588b1a179480df633cd5817cc..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/OVFItemProcessor.java +++ /dev/null @@ -1,52 +0,0 @@ -package org.ow2.contrail.federation.application.ovf; - -import org.w3c.dom.Node; - -import org.w3c.dom.DOMException; -import org.w3c.dom.NodeList; - -public abstract class OVFItemProcessor { - - public abstract OVFVirtualHardware processItem(Node xmlNode) throws DOMException; - - protected OVFVirtualHardware processCommonValues(OVFVirtualHardware ovfVH, Node xmlNode) - { - // check if this virtual hardware requirement is mandatory. - Node required = xmlNode.getAttributes().getNamedItem("ovf:required"); - if (required != null) - { - if (required.getNodeValue().equalsIgnoreCase("true")) - ovfVH.setRequired(true); - else - ovfVH.setRequired(false); - } - else - { - ovfVH.setRequired(true); - } - - NodeList childs = xmlNode.getChildNodes(); - - for (int i=0;i files = new HashMap(); - private static HashMap disks = new HashMap(); - private static HashMap networks = new HashMap(); - private static HashMap vs = new HashMap(); - - /** - * Parses an OVF document, - * - * @param The path of the OVF document expressed as a URI. - * @return An ApplicationDescriptor - */ - public static ApplicationDescriptor ParseOVF(URI ovfURI) - throws ParserConfigurationException, FileNotFoundException, SAXException, IOException, XPathExpressionException, NumberFormatException, DOMException, URISyntaxException - { - DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance(); - - DocumentBuilder builder = domFactory.newDocumentBuilder(); - Document doc = builder.parse(new FileInputStream(ovfURI.getPath())); - - ApplicationDescriptor appDesc = internalParseOVF(doc); - - return appDesc; - } - - /** - * Parses an OVF document. - * - * @param The content of the OVF document expressed as a String. - * @return An ApplicationDescriptor - */ - public static ApplicationDescriptor ParseOVF(String ovf) throws ParserConfigurationException, FileNotFoundException, SAXException, IOException, XPathExpressionException, NumberFormatException, DOMException, URISyntaxException { - - DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance(); - - DocumentBuilder builder = domFactory.newDocumentBuilder(); - - StringReader sr = new StringReader(ovf); - InputSource is = new InputSource(sr); - - Document doc = builder.parse(is); - - - ApplicationDescriptor appDesc = internalParseOVF(doc); - - return appDesc; - } - - /** - * Parses the VirtualSystemCollection XML element. - * - * @param The Node associated with the XML element to parse. - * @return An ApplianceDescriptor representing the appliance. - */ - private static ApplianceDescriptor parseVSCollection(Node n) throws XPathExpressionException - { - XPath xpath = XPathFactory.newInstance().newXPath(); - - // id - Node id = n.getAttributes().getNamedItem("ovf:id"); - if (id == null) - { - throw new RuntimeException("id was not specified for the appliance."); - } - String vsId = id.getNodeValue(); - - ApplianceDescriptor result = new ApplianceDescriptorImpl(vsId, null, 0); - //appliance.getVirtualSystems().add(vs.get(vsId)); - - // VirtualSystem OR VirtualSystemCollection -> ApplianceDescriptor - XPathExpression expr = xpath.compile("VirtualSystem | VirtualSystemCollection"); - - NodeList nodes = (NodeList)expr.evaluate(n, XPathConstants.NODESET); - for (int i = 0; i < nodes.getLength(); i++) - { - Node current = nodes.item(i); - - ApplianceDescriptor child = null; - if (current.getNodeName().equals("VirtualSystem")) - { - child = parseVS(current); - } - else - { - child = parseVSCollection(current); - } - - result.getAppliancesDescriptors().add(child); - } - - - return result; - } - - /** - * Parses the VirtualSystem XML element. - * - * @param The Node associated with the XML element to parse. - * @return An ApplianceDescriptor representing the appliance. - */ - private static ApplianceDescriptor parseVS(Node n) throws XPathExpressionException - { - XPath xpath = XPathFactory.newInstance().newXPath(); - - // id - Node id = n.getAttributes().getNamedItem("ovf:id"); - if (id == null) - { - throw new RuntimeException("id was not specified for the appliance."); - } - String vsId = id.getNodeValue(); - - OVFVirtualSystem ovfVS = new OVFVirtualSystem(vsId); - vs.put(vsId, ovfVS); - - // FIXME: remove NULL & 0 values; - ApplianceDescriptor appliance = new ApplianceDescriptorImpl(vsId, null, 0); - appliance.getVirtualSystems().add(vs.get(vsId)); - - // Reading associated VNetworks. - XPathExpression expr = xpath.compile("ProductSection/Property"); - NodeList properties = (NodeList)expr.evaluate(n, XPathConstants.NODESET); - for (int k = 0; k < properties.getLength(); k++) - { - NamedNodeMap attributes = properties.item(k).getAttributes(); - - OVFVirtualNetwork net = null; - if (attributes.getNamedItem("ovf:key").getNodeValue().equals("externalIp")) - { - String networkName = attributes.getNamedItem("ovf:value").getNodeValue(); - net = networks.get(networkName); - } - - appliance.getAssociatedVirtualNetworks().add(net); - } - - // parsing of the Item(s) of the VirtualHardwareSection. - expr = xpath.compile("VirtualHardwareSection/Item"); - NodeList items = (NodeList)expr.evaluate(n, XPathConstants.NODESET); - - for (int k = 0; k < items.getLength(); k++) - { - Node item = items.item(k); - OVFVirtualHardware vh = null; - - // for each child element "rasd:*" do - for (int j = 0; j < item.getChildNodes().getLength(); j++) - { - Node child = item.getChildNodes().item(j); - - if (child.getNodeName().equals("rasd:ResourceType")) - { - int resourceType = Integer.parseInt(child.getTextContent()); - - OVFItemProcessor p = - OVFResourceAllocationSettingDataTranslator.getItemProcessor(resourceType); - - vh = p.processItem(item); - ovfVS.getRequiredHardware().add(vh); - - // if ResourceType == 17 => Link "Disk" from Disks hashmap - if (vh.getResourceType() == 17) - { - OVFVirtualHwDiskDrive vDisk = (OVFVirtualHwDiskDrive)vh; - String diskRef = vDisk.getHostResource(); - vDisk.setDisk(disks.get(diskRef)); - } - } - } - } - - return appliance; - } - - /** - * Internal method used to factorize common code. - */ - private static ApplicationDescriptor internalParseOVF(Document doc) throws ParserConfigurationException, FileNotFoundException, SAXException, IOException, XPathExpressionException, NumberFormatException, DOMException, URISyntaxException - { - ApplicationDescriptor appDesc = new ApplicationDescriptorImpl(); - - XPath xpath = XPathFactory.newInstance().newXPath(); - - // References - XPathExpression expr = xpath.compile("//References/File"); - NodeList nodes = (NodeList)expr.evaluate(doc, XPathConstants.NODESET); - for (int i = 0; i < nodes.getLength(); i++) - { - NamedNodeMap attributes = nodes.item(i).getAttributes(); - - File f = new File( - attributes.getNamedItem("ovf:id").getNodeValue(), - attributes.getNamedItem("ovf:href").getNodeValue(), - Long.parseLong(attributes.getNamedItem("ovf:size").getNodeValue())); - - files.put(f.getId(), f); - } - - // Disks - expr = xpath.compile("//DiskSection/Disk"); - nodes = (NodeList)expr.evaluate(doc, XPathConstants.NODESET); - for (int i = 0; i < nodes.getLength(); i++) - { - NamedNodeMap attributes = nodes.item(i).getAttributes(); - - String fileRef = attributes.getNamedItem("ovf:fileRef").getNodeValue(); - File f = files.get(fileRef); - - String diskId = attributes.getNamedItem("ovf:diskId").getNodeValue(); - disks.put("ovf:/disk/" + diskId, new Disk(f, diskId)); - } - - // Virtual Networks - expr = xpath.compile("//NetworkSection/Network"); - nodes = (NodeList)expr.evaluate(doc, XPathConstants.NODESET); - for (int i = 0; i < nodes.getLength(); i++) - { - Node current = nodes.item(i); - - // name - String name = current.getAttributes().getNamedItem("ovf:name").getNodeValue(); - - // description - String description = null; - for (int j = 0; j < current.getChildNodes().getLength(); j++) - { - Node n = current.getChildNodes().item(j); - - if (n.getNodeName().equals("Description")) - { - description = n.getTextContent(); - break; - } - } - - networks.put(name, new OVFVirtualNetwork(name, description)); - } - - // VirtualSystem OR VirtualSystemCollection -> ApplianceDescriptor - expr = xpath.compile("Envelope/VirtualSystem | Envelope/VirtualSystemCollection"); - nodes = (NodeList)expr.evaluate(doc, XPathConstants.NODESET); - - for (int i = 0; i < nodes.getLength(); i++) - { - Node current = nodes.item(i); - - ApplianceDescriptor appliance = null; - if (current.getNodeName().equals("VirtualSystem")) - { - appliance = parseVS(current); - } - else - { - appliance = parseVSCollection(current); - } - - appDesc.getAppliancesDescriptors().add(appliance); - } - - return appDesc; - } -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/OVFResourceAllocationSettingDataTranslator.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/OVFResourceAllocationSettingDataTranslator.java deleted file mode 100644 index b549cbd8e7ad0a2ea81de841f5ff6cea4866df8f..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/OVFResourceAllocationSettingDataTranslator.java +++ /dev/null @@ -1,84 +0,0 @@ -package org.ow2.contrail.federation.application.ovf; - -import java.util.HashMap; -import java.util.Map; - -import org.ow2.contrail.federation.application.ovf.item_processor.OVFCdDriveProcessor; -import org.ow2.contrail.federation.application.ovf.item_processor.OVFCpuProcessor; -import org.ow2.contrail.federation.application.ovf.item_processor.OVFDiskDriveProcessor; -import org.ow2.contrail.federation.application.ovf.item_processor.OVFEthernetAdapterProcessor; -import org.ow2.contrail.federation.application.ovf.item_processor.OVFFloppyDriveProcessor; -import org.ow2.contrail.federation.application.ovf.item_processor.OVFIdeControllerProcessor; -import org.ow2.contrail.federation.application.ovf.item_processor.OVFMemoryProcessor; -import org.ow2.contrail.federation.application.ovf.item_processor.OVFParallelSCSIProcessor; - -public class OVFResourceAllocationSettingDataTranslator { - - private static final Map resourceTypeToName = new HashMap(); - private static final Map resourceTypeToProcessor = new HashMap(); - - public static String getResourceName(int i) - { - if ((i>33) && (i<32768)) - return "DMTF reserved"; - else if (i>=32768) - return "Vendor Reserved"; - - // POST: i <= 33 - return resourceTypeToName.get(i); - } - - public static OVFItemProcessor getItemProcessor(int id) throws NoClassDefFoundError - { - return resourceTypeToProcessor.get(id); - } - - static - { - resourceTypeToName.put(1,"Other"); - resourceTypeToName.put(2,"Computer System"); - resourceTypeToName.put(3,"Processor"); - resourceTypeToName.put(4,"Memory"); - resourceTypeToName.put(5,"IDE Controller"); - resourceTypeToName.put(6,"Parallel SCSI HBA"); - resourceTypeToName.put(7,"FC HBA"); - resourceTypeToName.put(8,"iSCSI HBA"); - resourceTypeToName.put(9,"IB HCA"); - resourceTypeToName.put(10,"Ethernet Adapter"); - resourceTypeToName.put(11,"Other Network Adapter"); - resourceTypeToName.put(12,"I/O Slot"); - resourceTypeToName.put(13,"I/O Device"); - resourceTypeToName.put(14,"Floppy Drive"); - resourceTypeToName.put(15,"CD Drive"); - resourceTypeToName.put(16,"DVD drive"); - resourceTypeToName.put(17,"Disk Drive"); - resourceTypeToName.put(18,"Tape Drive"); - resourceTypeToName.put(19,"Storage Extent"); - resourceTypeToName.put(20,"Other storage device"); - resourceTypeToName.put(21,"Serial port"); - resourceTypeToName.put(22,"Parallel port"); - resourceTypeToName.put(23,"USB Controller"); - resourceTypeToName.put(24,"Graphics controller"); - resourceTypeToName.put(25,"IEEE 1394 Controller"); - resourceTypeToName.put(26,"Partitionable Unit"); - resourceTypeToName.put(27,"Base Partitionable Unit"); - resourceTypeToName.put(28,"Power"); - resourceTypeToName.put(29,"Cooling Capacity"); - resourceTypeToName.put(30,"Ethernet Switch Port"); - resourceTypeToName.put(31,"Logical Disk"); - resourceTypeToName.put(32,"Storage Volume"); - resourceTypeToName.put(33,"Ethernet Connection"); - // resourceTypeToName.put(DMTF reserved (..) - // resourceTypeToName.put(Vendor Reserved (32768-65535) - - // Initialize the hash map of the OVF processors. - resourceTypeToProcessor.put(3, new OVFCpuProcessor()); - resourceTypeToProcessor.put(4, new OVFMemoryProcessor()); - resourceTypeToProcessor.put(5, new OVFIdeControllerProcessor()); - resourceTypeToProcessor.put(6, new OVFParallelSCSIProcessor()); - resourceTypeToProcessor.put(10, new OVFEthernetAdapterProcessor()); - resourceTypeToProcessor.put(14, new OVFFloppyDriveProcessor()); - resourceTypeToProcessor.put(15, new OVFCdDriveProcessor()); - resourceTypeToProcessor.put(17, new OVFDiskDriveProcessor()); - } -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/OVFSections.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/OVFSections.java deleted file mode 100644 index 70f37a4b3cedace0041c72533309320b13b40410..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/OVFSections.java +++ /dev/null @@ -1,103 +0,0 @@ -package org.ow2.contrail.federation.application.ovf; - -import java.net.URI; -import java.net.URISyntaxException; -import java.util.ArrayList; -import java.util.Collection; -import org.ow2.contrail.federation.application.ovf.dmtf.schemas.ovf.envelope._1.ContentType; -import org.ow2.contrail.federation.application.ovf.dmtf.schemas.ovf.envelope._1.EnvelopeType; -import org.ow2.contrail.federation.application.ovf.dmtf.schemas.ovf.envelope._1.FileType; -import org.ow2.contrail.federation.application.ovf.dmtf.schemas.ovf.envelope._1.ReferencesType; -import org.ow2.contrail.federation.application.ovf.dmtf.schemas.ovf.envelope._1.VirtualSystemCollectionType; -import org.ow2.contrail.federation.application.ovf.dmtf.schemas.ovf.envelope._1.VirtualSystemType; - -/** - * - */ -public class OVFSections { - - private Collection ovfVirtualDisks; - private Collection ovfVirtualNetworks; - private Collection ovfVirtualSystems; - - /** - * Creates an instance of the OVFSections type. - * - * @param An instance of EnvelopeType, the root element of the OVF. - */ - public OVFSections(EnvelopeType env) { - createSectionDescriptors(env); - } - - /** - * Creates a section descriptors for each of the OVF sections (disk, network, compute). - */ - private void createSectionDescriptors(EnvelopeType env) { - - ovfVirtualDisks = new ArrayList(); - - // NB: assumption1 information taken from References instead from DiskSection. - ReferencesType references = env.getReferences(); - - for (FileType file : references.getFile()) - { - // NB: assumption2: no compression is used for the disks of images. - assert(file.getCompression().isEmpty() || file.getCompression().equals("identity")); - - String href = file.getHref(); - - if (href.endsWith(".vmdk") || href.endsWith(".iso")) - { - try - { - ovfVirtualDisks.add( - new OVFVirtualDisk(file.getId(), new URI(href), file.getSize().longValue())); - } - catch (URISyntaxException e) - { - e.printStackTrace(); - } - } - } - - // OVFVirtualSystems - ContentType content = env.getContent().getValue(); - - if (content instanceof VirtualSystemCollectionType) - { - ovfVirtualSystems.add(new OVFVirtualSystem(content.getId())); - } - else if (content instanceof VirtualSystemType) - { - ovfVirtualSystems.add(new OVFVirtualSystem(content.getId())); - } - } - - /** - * Gets the virtual disks associated with the OVF. - * - * @return A collection of OVFVirtualDisk. - */ - public Collection getVirtualDisks() { - return ovfVirtualDisks; - } - - /** - * Gets the virtual systems associated with the OVF. - * - * @return A collection of OVFVirtualSystems. - */ - public Collection getVirtualSystems() { - return ovfVirtualSystems; - } - - /** - * Gets the virtual networks associated with the OVF. - * - * @return A collection of OVFVirtualNetwork. - */ - public Collection getVirtualNetworks() { - return ovfVirtualNetworks; - } - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/OVFVirtualDisk.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/OVFVirtualDisk.java deleted file mode 100644 index 514f27f83acbcd9c2e0458c499e78d028a4025c2..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/OVFVirtualDisk.java +++ /dev/null @@ -1,29 +0,0 @@ -package org.ow2.contrail.federation.application.ovf; - -import java.net.URI; - -public class OVFVirtualDisk { - - private String id; - private URI uri; - private long size; - - public OVFVirtualDisk(String lid, URI luri, long lsize) - { - id = lid; - uri = luri; - size = lsize; - } - - public String getId() { - return id; - } - - public URI getUri() { - return uri; - } - - public long getSize() { - return size; - } -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/OVFVirtualHardware.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/OVFVirtualHardware.java deleted file mode 100644 index 8ddef12f3fe1572ee6ce453ae2f6b79de16cd1ce..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/OVFVirtualHardware.java +++ /dev/null @@ -1,68 +0,0 @@ -package org.ow2.contrail.federation.application.ovf; - -/** - * Defines a virtual hardware requirements. - */ -public class OVFVirtualHardware { - - private int instanceId; - private int resourceType; - - private String elementName; - private String description; - - private boolean required; - - // Getter methods - - public boolean isRequired() { - return required; - } - - public int getInstanceId() { - return instanceId; - } - - public int getResourceType() { - return resourceType; - } - - public String getElementName() { - return elementName; - } - - public String getDescription() { - return description; - } - - // Setter methods - - public void setRequired(boolean required) { - this.required = required; - } - - public void setElementName(String value) { - elementName = value; - } - - public void setDescription(String value) { - description = value; - } - - public void setInstanceId(int value) { - instanceId = value; - } - - public void setResourceType(int value) { - resourceType = value; - } - - @Override - public String toString() - { - return "instanceId = " + Integer.toString(instanceId) + "\n" + - "resourceType = " + Integer.toString(resourceType) + "\n" + - "elementName = " + elementName + "\n" + "description = " + description + "\n" + - "required = " + Boolean.toString(required) + "\n"; - } -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/OVFVirtualNetwork.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/OVFVirtualNetwork.java deleted file mode 100644 index ff883afb0fb76cbec674dc0328bdc87e21d5369c..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/OVFVirtualNetwork.java +++ /dev/null @@ -1,33 +0,0 @@ -package org.ow2.contrail.federation.application.ovf; - -public class OVFVirtualNetwork { - - private String name; - private String description; - - public String getDescription() - { - return description; - } - - public void setDescription(String value) - { - description = value; - } - - public String getName() - { - return name; - } - - public void setName(String value) - { - name = value; - } - - public OVFVirtualNetwork(String name, String description) - { - this.name = name; - this.description = description; - } -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/OVFVirtualSystem.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/OVFVirtualSystem.java deleted file mode 100644 index 27793ef92d6870cec28c5b764fd478384a0fa3f2..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/OVFVirtualSystem.java +++ /dev/null @@ -1,26 +0,0 @@ -package org.ow2.contrail.federation.application.ovf; - -import java.util.ArrayList; -import java.util.Collection; - -public class OVFVirtualSystem { - - private String id; - private Collection vh; - - public OVFVirtualSystem(String lid) - { - id = lid; - vh = new ArrayList(); - } - - public String getId() { - return id; - } - - public Collection getRequiredHardware() - { - return vh; - } - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/AnnotationSectionType.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/AnnotationSectionType.java deleted file mode 100644 index b25af0a69d692016bb883802f2c348e5a1770c5e..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/AnnotationSectionType.java +++ /dev/null @@ -1,112 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - - -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.ovf.envelope._1; - -import java.util.ArrayList; -import java.util.List; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyElement; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; -import org.w3c.dom.Element; - - -/** - * User defined annotation - * - *

Java class for AnnotationSection_Type complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="AnnotationSection_Type">
- *   <complexContent>
- *     <extension base="{http://schemas.dmtf.org/ovf/envelope/1}Section_Type">
- *       <sequence>
- *         <element name="Annotation" type="{http://schemas.dmtf.org/ovf/envelope/1}Msg_Type"/>
- *         <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
- *       </sequence>
- *       <anyAttribute processContents='lax'/>
- *     </extension>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "AnnotationSection_Type", propOrder = { - "annotation", - "any" -}) -public class AnnotationSectionType - extends SectionType -{ - - @XmlElement(name = "Annotation", required = true) - protected MsgType annotation; - @XmlAnyElement(lax = true) - protected List any; - - /** - * Gets the value of the annotation property. - * - * @return - * possible object is - * {@link MsgType } - * - */ - public MsgType getAnnotation() { - return annotation; - } - - /** - * Sets the value of the annotation property. - * - * @param value - * allowed object is - * {@link MsgType } - * - */ - public void setAnnotation(MsgType value) { - this.annotation = value; - } - - /** - * Gets the value of the any property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the any property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getAny().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link Object } - * {@link Element } - * - * - */ - public List getAny() { - if (any == null) { - any = new ArrayList(); - } - return this.any; - } - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/ContentType.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/ContentType.java deleted file mode 100644 index 885326943a0147981adb3b7846629fad0fd8e24b..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/ContentType.java +++ /dev/null @@ -1,206 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - - -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.ovf.envelope._1; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import javax.xml.bind.JAXBElement; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyAttribute; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementRef; -import javax.xml.bind.annotation.XmlSeeAlso; -import javax.xml.bind.annotation.XmlType; -import javax.xml.namespace.QName; - - -/** - * Base class for content - * - *

Java class for Content_Type complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="Content_Type">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="Info" type="{http://schemas.dmtf.org/ovf/envelope/1}Msg_Type"/>
- *         <element name="Name" type="{http://schemas.dmtf.org/ovf/envelope/1}Msg_Type" minOccurs="0"/>
- *         <element ref="{http://schemas.dmtf.org/ovf/envelope/1}Section" maxOccurs="unbounded" minOccurs="0"/>
- *       </sequence>
- *       <attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <anyAttribute processContents='lax'/>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "Content_Type", propOrder = { - "info", - "name", - "section" -}) -@XmlSeeAlso({ - VirtualSystemType.class, - VirtualSystemCollectionType.class -}) -public abstract class ContentType { - - @XmlElement(name = "Info", required = true) - protected MsgType info; - @XmlElement(name = "Name") - protected MsgType name; - @XmlElementRef(name = "Section", namespace = "http://schemas.dmtf.org/ovf/envelope/1", type = JAXBElement.class) - protected List> section; - @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/envelope/1", required = true) - protected String id; - @XmlAnyAttribute - private Map otherAttributes = new HashMap(); - - /** - * Gets the value of the info property. - * - * @return - * possible object is - * {@link MsgType } - * - */ - public MsgType getInfo() { - return info; - } - - /** - * Sets the value of the info property. - * - * @param value - * allowed object is - * {@link MsgType } - * - */ - public void setInfo(MsgType value) { - this.info = value; - } - - /** - * Gets the value of the name property. - * - * @return - * possible object is - * {@link MsgType } - * - */ - public MsgType getName() { - return name; - } - - /** - * Sets the value of the name property. - * - * @param value - * allowed object is - * {@link MsgType } - * - */ - public void setName(MsgType value) { - this.name = value; - } - - /** - * Content body is a list of Sections - * Gets the value of the section property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the section property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getSection().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link JAXBElement }{@code <}{@link ResourceAllocationSectionType }{@code >} - * {@link JAXBElement }{@code <}{@link NetworkSectionType }{@code >} - * {@link JAXBElement }{@code <}{@link InstallSectionType }{@code >} - * {@link JAXBElement }{@code <}{@link VirtualHardwareSectionType }{@code >} - * {@link JAXBElement }{@code <}{@link SectionType }{@code >} - * {@link JAXBElement }{@code <}{@link ProductSectionType }{@code >} - * {@link JAXBElement }{@code <}{@link AnnotationSectionType }{@code >} - * {@link JAXBElement }{@code <}{@link DiskSectionType }{@code >} - * {@link JAXBElement }{@code <}{@link EulaSectionType }{@code >} - * {@link JAXBElement }{@code <}{@link OperatingSystemSectionType }{@code >} - * {@link JAXBElement }{@code <}{@link DeploymentOptionSectionType }{@code >} - * {@link JAXBElement }{@code <}{@link StartupSectionType }{@code >} - * - * - */ - public List> getSection() { - if (section == null) { - section = new ArrayList>(); - } - return this.section; - } - - /** - * Gets the value of the id property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getId() { - return id; - } - - /** - * Sets the value of the id property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setId(String value) { - this.id = value; - } - - /** - * Gets a map that contains attributes that aren't bound to any typed property on this class. - * - *

- * the map is keyed by the name of the attribute and - * the value is the string value of the attribute. - * - * the map returned by this method is live, and you can add new attribute - * by updating the map directly. Because of this design, there's no setter. - * - * - * @return - * always non-null - */ - public Map getOtherAttributes() { - return otherAttributes; - } - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/DeploymentOptionSectionType.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/DeploymentOptionSectionType.java deleted file mode 100644 index 5e5b7955ab00baeccfbcfcb4860548ee8ad8cd6d..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/DeploymentOptionSectionType.java +++ /dev/null @@ -1,299 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - - -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.ovf.envelope._1; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyAttribute; -import javax.xml.bind.annotation.XmlAnyElement; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; -import javax.xml.namespace.QName; -import org.w3c.dom.Element; - - -/** - * Enumeration of discrete deployment - * options - * - *

Java class for DeploymentOptionSection_Type complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="DeploymentOptionSection_Type">
- *   <complexContent>
- *     <extension base="{http://schemas.dmtf.org/ovf/envelope/1}Section_Type">
- *       <sequence>
- *         <element name="Configuration" maxOccurs="unbounded">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <sequence>
- *                   <element name="Label" type="{http://schemas.dmtf.org/ovf/envelope/1}Msg_Type"/>
- *                   <element name="Description" type="{http://schemas.dmtf.org/ovf/envelope/1}Msg_Type"/>
- *                 </sequence>
- *                 <attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                 <attribute name="default" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
- *                 <anyAttribute processContents='lax'/>
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *         <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
- *       </sequence>
- *       <anyAttribute processContents='lax'/>
- *     </extension>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "DeploymentOptionSection_Type", propOrder = { - "configuration", - "any" -}) -public class DeploymentOptionSectionType - extends SectionType -{ - - @XmlElement(name = "Configuration", required = true) - protected List configuration; - @XmlAnyElement(lax = true) - protected List any; - - /** - * Gets the value of the configuration property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the configuration property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getConfiguration().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link DeploymentOptionSectionType.Configuration } - * - * - */ - public List getConfiguration() { - if (configuration == null) { - configuration = new ArrayList(); - } - return this.configuration; - } - - /** - * Gets the value of the any property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the any property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getAny().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link Object } - * {@link Element } - * - * - */ - public List getAny() { - if (any == null) { - any = new ArrayList(); - } - return this.any; - } - - - /** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

-     * <complexType>
-     *   <complexContent>
-     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
-     *       <sequence>
-     *         <element name="Label" type="{http://schemas.dmtf.org/ovf/envelope/1}Msg_Type"/>
-     *         <element name="Description" type="{http://schemas.dmtf.org/ovf/envelope/1}Msg_Type"/>
-     *       </sequence>
-     *       <attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *       <attribute name="default" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
-     *       <anyAttribute processContents='lax'/>
-     *     </restriction>
-     *   </complexContent>
-     * </complexType>
-     * 
- * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = { - "label", - "description" - }) - public static class Configuration { - - @XmlElement(name = "Label", required = true) - protected MsgType label; - @XmlElement(name = "Description", required = true) - protected MsgType description; - @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/envelope/1", required = true) - protected String id; - @XmlAttribute(name = "default", namespace = "http://schemas.dmtf.org/ovf/envelope/1") - protected Boolean _default; - @XmlAnyAttribute - private Map otherAttributes = new HashMap(); - - /** - * Gets the value of the label property. - * - * @return - * possible object is - * {@link MsgType } - * - */ - public MsgType getLabel() { - return label; - } - - /** - * Sets the value of the label property. - * - * @param value - * allowed object is - * {@link MsgType } - * - */ - public void setLabel(MsgType value) { - this.label = value; - } - - /** - * Gets the value of the description property. - * - * @return - * possible object is - * {@link MsgType } - * - */ - public MsgType getDescription() { - return description; - } - - /** - * Sets the value of the description property. - * - * @param value - * allowed object is - * {@link MsgType } - * - */ - public void setDescription(MsgType value) { - this.description = value; - } - - /** - * Gets the value of the id property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getId() { - return id; - } - - /** - * Sets the value of the id property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setId(String value) { - this.id = value; - } - - /** - * Gets the value of the default property. - * - * @return - * possible object is - * {@link Boolean } - * - */ - public boolean isDefault() { - if (_default == null) { - return false; - } else { - return _default; - } - } - - /** - * Sets the value of the default property. - * - * @param value - * allowed object is - * {@link Boolean } - * - */ - public void setDefault(Boolean value) { - this._default = value; - } - - /** - * Gets a map that contains attributes that aren't bound to any typed property on this class. - * - *

- * the map is keyed by the name of the attribute and - * the value is the string value of the attribute. - * - * the map returned by this method is live, and you can add new attribute - * by updating the map directly. Because of this design, there's no setter. - * - * - * @return - * always non-null - */ - public Map getOtherAttributes() { - return otherAttributes; - } - - } - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/DiskSectionType.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/DiskSectionType.java deleted file mode 100644 index f4eaf9d62a3406de8aa5776a87fad06608949e07..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/DiskSectionType.java +++ /dev/null @@ -1,118 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - - -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.ovf.envelope._1; - -import java.util.ArrayList; -import java.util.List; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyElement; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; -import org.w3c.dom.Element; - - -/** - * Descriptions of virtual disks used within the - * package - * - *

Java class for DiskSection_Type complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="DiskSection_Type">
- *   <complexContent>
- *     <extension base="{http://schemas.dmtf.org/ovf/envelope/1}Section_Type">
- *       <sequence>
- *         <element name="Disk" type="{http://schemas.dmtf.org/ovf/envelope/1}VirtualDiskDesc_Type" maxOccurs="unbounded" minOccurs="0"/>
- *         <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
- *       </sequence>
- *       <anyAttribute processContents='lax'/>
- *     </extension>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "DiskSection_Type", propOrder = { - "disk", - "any" -}) -public class DiskSectionType - extends SectionType -{ - - @XmlElement(name = "Disk") - protected List disk; - @XmlAnyElement(lax = true) - protected List any; - - /** - * Gets the value of the disk property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the disk property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getDisk().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link VirtualDiskDescType } - * - * - */ - public List getDisk() { - if (disk == null) { - disk = new ArrayList(); - } - return this.disk; - } - - /** - * Gets the value of the any property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the any property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getAny().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link Object } - * {@link Element } - * - * - */ - public List getAny() { - if (any == null) { - any = new ArrayList(); - } - return this.any; - } - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/EnvelopeType.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/EnvelopeType.java deleted file mode 100644 index dd54222b037b6e1e160a284949dddfe8701cad69..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/EnvelopeType.java +++ /dev/null @@ -1,242 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - - -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.ovf.envelope._1; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import javax.xml.bind.JAXBElement; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyAttribute; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementRef; -import javax.xml.bind.annotation.XmlType; -import javax.xml.namespace.QName; - - -/** - * Root OVF descriptor type - * - *

Java class for EnvelopeType complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="EnvelopeType">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="References" type="{http://schemas.dmtf.org/ovf/envelope/1}References_Type"/>
- *         <element ref="{http://schemas.dmtf.org/ovf/envelope/1}Section" maxOccurs="unbounded" minOccurs="0"/>
- *         <element ref="{http://schemas.dmtf.org/ovf/envelope/1}Content"/>
- *         <element name="Strings" type="{http://schemas.dmtf.org/ovf/envelope/1}Strings_Type" maxOccurs="unbounded" minOccurs="0"/>
- *       </sequence>
- *       <attribute ref="{http://www.w3.org/XML/1998/namespace}lang default="en-US""/>
- *       <anyAttribute processContents='lax'/>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "EnvelopeType", propOrder = { - "references", - "section", - "content", - "strings" -}) -public class EnvelopeType { - - @XmlElement(name = "References", required = true) - protected ReferencesType references; - @XmlElementRef(name = "Section", namespace = "http://schemas.dmtf.org/ovf/envelope/1", type = JAXBElement.class) - protected List> section; - @XmlElementRef(name = "Content", namespace = "http://schemas.dmtf.org/ovf/envelope/1", type = JAXBElement.class) - protected JAXBElement content; - @XmlElement(name = "Strings") - protected List strings; - @XmlAttribute(namespace = "http://www.w3.org/XML/1998/namespace") - protected String lang; - @XmlAnyAttribute - private Map otherAttributes = new HashMap(); - - /** - * Gets the value of the references property. - * - * @return - * possible object is - * {@link ReferencesType } - * - */ - public ReferencesType getReferences() { - return references; - } - - /** - * Sets the value of the references property. - * - * @param value - * allowed object is - * {@link ReferencesType } - * - */ - public void setReferences(ReferencesType value) { - this.references = value; - } - - /** - * Package level meta-data Gets the value of the section property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the section property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getSection().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link JAXBElement }{@code <}{@link ResourceAllocationSectionType }{@code >} - * {@link JAXBElement }{@code <}{@link NetworkSectionType }{@code >} - * {@link JAXBElement }{@code <}{@link InstallSectionType }{@code >} - * {@link JAXBElement }{@code <}{@link VirtualHardwareSectionType }{@code >} - * {@link JAXBElement }{@code <}{@link SectionType }{@code >} - * {@link JAXBElement }{@code <}{@link ProductSectionType }{@code >} - * {@link JAXBElement }{@code <}{@link AnnotationSectionType }{@code >} - * {@link JAXBElement }{@code <}{@link DiskSectionType }{@code >} - * {@link JAXBElement }{@code <}{@link EulaSectionType }{@code >} - * {@link JAXBElement }{@code <}{@link OperatingSystemSectionType }{@code >} - * {@link JAXBElement }{@code <}{@link DeploymentOptionSectionType }{@code >} - * {@link JAXBElement }{@code <}{@link StartupSectionType }{@code >} - * - * - */ - public List> getSection() { - if (section == null) { - section = new ArrayList>(); - } - return this.section; - } - - /** - * Content: A VirtualSystem or a - * VirtualSystemCollection - * - * @return - * possible object is - * {@link JAXBElement }{@code <}{@link VirtualSystemType }{@code >} - * {@link JAXBElement }{@code <}{@link ContentType }{@code >} - * {@link JAXBElement }{@code <}{@link VirtualSystemCollectionType }{@code >} - * - */ - public JAXBElement getContent() { - return content; - } - - /** - * Sets the value of the content property. - * - * @param value - * allowed object is - * {@link JAXBElement }{@code <}{@link VirtualSystemType }{@code >} - * {@link JAXBElement }{@code <}{@link ContentType }{@code >} - * {@link JAXBElement }{@code <}{@link VirtualSystemCollectionType }{@code >} - * - */ - public void setContent(JAXBElement value) { - this.content = ((JAXBElement ) value); - } - - /** - * Gets the value of the strings property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the strings property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getStrings().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link StringsType } - * - * - */ - public List getStrings() { - if (strings == null) { - strings = new ArrayList(); - } - return this.strings; - } - - /** - * Gets the value of the lang property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getLang() { - if (lang == null) { - return "en-US"; - } else { - return lang; - } - } - - /** - * Sets the value of the lang property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setLang(String value) { - this.lang = value; - } - - /** - * Gets a map that contains attributes that aren't bound to any typed property on this class. - * - *

- * the map is keyed by the name of the attribute and - * the value is the string value of the attribute. - * - * the map returned by this method is live, and you can add new attribute - * by updating the map directly. Because of this design, there's no setter. - * - * - * @return - * always non-null - */ - public Map getOtherAttributes() { - return otherAttributes; - } - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/EulaSectionType.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/EulaSectionType.java deleted file mode 100644 index 90722745ba173a756044356a16b8245dafb61015..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/EulaSectionType.java +++ /dev/null @@ -1,112 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - - -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.ovf.envelope._1; - -import java.util.ArrayList; -import java.util.List; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyElement; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; -import org.w3c.dom.Element; - - -/** - * End-User License Agreement - * - *

Java class for EulaSection_Type complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="EulaSection_Type">
- *   <complexContent>
- *     <extension base="{http://schemas.dmtf.org/ovf/envelope/1}Section_Type">
- *       <sequence>
- *         <element name="License" type="{http://schemas.dmtf.org/ovf/envelope/1}Msg_Type"/>
- *         <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
- *       </sequence>
- *       <anyAttribute processContents='lax'/>
- *     </extension>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "EulaSection_Type", propOrder = { - "license", - "any" -}) -public class EulaSectionType - extends SectionType -{ - - @XmlElement(name = "License", required = true) - protected MsgType license; - @XmlAnyElement(lax = true) - protected List any; - - /** - * Gets the value of the license property. - * - * @return - * possible object is - * {@link MsgType } - * - */ - public MsgType getLicense() { - return license; - } - - /** - * Sets the value of the license property. - * - * @param value - * allowed object is - * {@link MsgType } - * - */ - public void setLicense(MsgType value) { - this.license = value; - } - - /** - * Gets the value of the any property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the any property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getAny().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link Object } - * {@link Element } - * - * - */ - public List getAny() { - if (any == null) { - any = new ArrayList(); - } - return this.any; - } - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/FileType.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/FileType.java deleted file mode 100644 index d865e23c121836ffba12abcbd62916e0f998e511..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/FileType.java +++ /dev/null @@ -1,250 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - - -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.ovf.envelope._1; - -import java.math.BigInteger; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyAttribute; -import javax.xml.bind.annotation.XmlAnyElement; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; -import javax.xml.namespace.QName; -import org.w3c.dom.Element; - - -/** - * Type for an external reference to a - * resource - * - *

Java class for File_Type complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="File_Type">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
- *       </sequence>
- *       <attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="href" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
- *       <attribute name="size" type="{http://www.w3.org/2001/XMLSchema}unsignedLong" />
- *       <attribute name="compression" type="{http://www.w3.org/2001/XMLSchema}string" default="" />
- *       <attribute name="chunkSize" type="{http://www.w3.org/2001/XMLSchema}long" />
- *       <anyAttribute processContents='lax'/>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "File_Type", propOrder = { - "any" -}) -public class FileType { - - @XmlAnyElement(lax = true) - protected List any; - @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/envelope/1", required = true) - protected String id; - @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/envelope/1", required = true) - @XmlSchemaType(name = "anyURI") - protected String href; - @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/envelope/1") - @XmlSchemaType(name = "unsignedLong") - protected BigInteger size; - @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/envelope/1") - protected String compression; - @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/envelope/1") - protected Long chunkSize; - @XmlAnyAttribute - private Map otherAttributes = new HashMap(); - - /** - * Gets the value of the any property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the any property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getAny().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link Object } - * {@link Element } - * - * - */ - public List getAny() { - if (any == null) { - any = new ArrayList(); - } - return this.any; - } - - /** - * Gets the value of the id property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getId() { - return id; - } - - /** - * Sets the value of the id property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setId(String value) { - this.id = value; - } - - /** - * Gets the value of the href property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getHref() { - return href; - } - - /** - * Sets the value of the href property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setHref(String value) { - this.href = value; - } - - /** - * Gets the value of the size property. - * - * @return - * possible object is - * {@link BigInteger } - * - */ - public BigInteger getSize() { - return size; - } - - /** - * Sets the value of the size property. - * - * @param value - * allowed object is - * {@link BigInteger } - * - */ - public void setSize(BigInteger value) { - this.size = value; - } - - /** - * Gets the value of the compression property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getCompression() { - if (compression == null) { - return ""; - } else { - return compression; - } - } - - /** - * Sets the value of the compression property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setCompression(String value) { - this.compression = value; - } - - /** - * Gets the value of the chunkSize property. - * - * @return - * possible object is - * {@link Long } - * - */ - public Long getChunkSize() { - return chunkSize; - } - - /** - * Sets the value of the chunkSize property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setChunkSize(Long value) { - this.chunkSize = value; - } - - /** - * Gets a map that contains attributes that aren't bound to any typed property on this class. - * - *

- * the map is keyed by the name of the attribute and - * the value is the string value of the attribute. - * - * the map returned by this method is live, and you can add new attribute - * by updating the map directly. Because of this design, there's no setter. - * - * - * @return - * always non-null - */ - public Map getOtherAttributes() { - return otherAttributes; - } - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/InstallSectionType.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/InstallSectionType.java deleted file mode 100644 index 17b5dcecb8c1987bbb4c04dc1c3b650aaaa1df32..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/InstallSectionType.java +++ /dev/null @@ -1,118 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - - -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.ovf.envelope._1; - -import java.util.ArrayList; -import java.util.List; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyElement; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; -import org.w3c.dom.Element; - - -/** - * If present indicates that the virtual machine needs to be - * initially booted to install and configure the software - * - *

Java class for InstallSection_Type complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="InstallSection_Type">
- *   <complexContent>
- *     <extension base="{http://schemas.dmtf.org/ovf/envelope/1}Section_Type">
- *       <sequence>
- *         <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
- *       </sequence>
- *       <attribute name="initialBootStopDelay" type="{http://www.w3.org/2001/XMLSchema}unsignedShort" default="0" />
- *       <anyAttribute processContents='lax'/>
- *     </extension>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "InstallSection_Type", propOrder = { - "any" -}) -public class InstallSectionType - extends SectionType -{ - - @XmlAnyElement(lax = true) - protected List any; - @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/envelope/1") - @XmlSchemaType(name = "unsignedShort") - protected Integer initialBootStopDelay; - - /** - * Gets the value of the any property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the any property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getAny().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link Object } - * {@link Element } - * - * - */ - public List getAny() { - if (any == null) { - any = new ArrayList(); - } - return this.any; - } - - /** - * Gets the value of the initialBootStopDelay property. - * - * @return - * possible object is - * {@link Integer } - * - */ - public int getInitialBootStopDelay() { - if (initialBootStopDelay == null) { - return 0; - } else { - return initialBootStopDelay; - } - } - - /** - * Sets the value of the initialBootStopDelay property. - * - * @param value - * allowed object is - * {@link Integer } - * - */ - public void setInitialBootStopDelay(Integer value) { - this.initialBootStopDelay = value; - } - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/MsgType.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/MsgType.java deleted file mode 100644 index 91422069b6def31c3c41d87bb20c6fe4d6a16986..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/MsgType.java +++ /dev/null @@ -1,127 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - - -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.ovf.envelope._1; - -import java.util.HashMap; -import java.util.Map; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyAttribute; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.XmlValue; -import javax.xml.namespace.QName; - - -/** - * Type for localizable string - * - * Default string value - * - *

Java class for Msg_Type complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="Msg_Type">
- *   <simpleContent>
- *     <extension base="<http://www.w3.org/2001/XMLSchema>string">
- *       <attribute name="msgid" type="{http://www.w3.org/2001/XMLSchema}string" default="" />
- *       <anyAttribute processContents='lax'/>
- *     </extension>
- *   </simpleContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "Msg_Type", propOrder = { - "value" -}) -public class MsgType { - - @XmlValue - protected String value; - @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/envelope/1") - protected String msgid; - @XmlAnyAttribute - private Map otherAttributes = new HashMap(); - - /** - * Gets the value of the value property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getValue() { - return value; - } - - /** - * Sets the value of the value property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setValue(String value) { - this.value = value; - } - - /** - * Gets the value of the msgid property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getMsgid() { - if (msgid == null) { - return ""; - } else { - return msgid; - } - } - - /** - * Sets the value of the msgid property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setMsgid(String value) { - this.msgid = value; - } - - /** - * Gets a map that contains attributes that aren't bound to any typed property on this class. - * - *

- * the map is keyed by the name of the attribute and - * the value is the string value of the attribute. - * - * the map returned by this method is live, and you can add new attribute - * by updating the map directly. Because of this design, there's no setter. - * - * - * @return - * always non-null - */ - public Map getOtherAttributes() { - return otherAttributes; - } - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/NetworkSectionType.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/NetworkSectionType.java deleted file mode 100644 index 622e674dfc7cea166cf81658e15935a1da41bf5c..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/NetworkSectionType.java +++ /dev/null @@ -1,238 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - - -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.ovf.envelope._1; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyAttribute; -import javax.xml.bind.annotation.XmlAnyElement; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; -import javax.xml.namespace.QName; -import org.w3c.dom.Element; - - -/** - * Descriptions of logical networks used within the - * package - * - *

Java class for NetworkSection_Type complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="NetworkSection_Type">
- *   <complexContent>
- *     <extension base="{http://schemas.dmtf.org/ovf/envelope/1}Section_Type">
- *       <sequence>
- *         <element name="Network" maxOccurs="unbounded" minOccurs="0">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <sequence>
- *                   <element name="Description" type="{http://schemas.dmtf.org/ovf/envelope/1}Msg_Type" minOccurs="0"/>
- *                 </sequence>
- *                 <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                 <anyAttribute processContents='lax'/>
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *         <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
- *       </sequence>
- *       <anyAttribute processContents='lax'/>
- *     </extension>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "NetworkSection_Type", propOrder = { - "network", - "any" -}) -public class NetworkSectionType - extends SectionType -{ - - @XmlElement(name = "Network") - protected List network; - @XmlAnyElement(lax = true) - protected List any; - - /** - * Gets the value of the network property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the network property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getNetwork().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link NetworkSectionType.Network } - * - * - */ - public List getNetwork() { - if (network == null) { - network = new ArrayList(); - } - return this.network; - } - - /** - * Gets the value of the any property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the any property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getAny().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link Object } - * {@link Element } - * - * - */ - public List getAny() { - if (any == null) { - any = new ArrayList(); - } - return this.any; - } - - - /** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

-     * <complexType>
-     *   <complexContent>
-     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
-     *       <sequence>
-     *         <element name="Description" type="{http://schemas.dmtf.org/ovf/envelope/1}Msg_Type" minOccurs="0"/>
-     *       </sequence>
-     *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *       <anyAttribute processContents='lax'/>
-     *     </restriction>
-     *   </complexContent>
-     * </complexType>
-     * 
- * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = { - "description" - }) - public static class Network { - - @XmlElement(name = "Description") - protected MsgType description; - @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/envelope/1", required = true) - protected String name; - @XmlAnyAttribute - private Map otherAttributes = new HashMap(); - - /** - * Gets the value of the description property. - * - * @return - * possible object is - * {@link MsgType } - * - */ - public MsgType getDescription() { - return description; - } - - /** - * Sets the value of the description property. - * - * @param value - * allowed object is - * {@link MsgType } - * - */ - public void setDescription(MsgType value) { - this.description = value; - } - - /** - * Gets the value of the name property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getName() { - return name; - } - - /** - * Sets the value of the name property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setName(String value) { - this.name = value; - } - - /** - * Gets a map that contains attributes that aren't bound to any typed property on this class. - * - *

- * the map is keyed by the name of the attribute and - * the value is the string value of the attribute. - * - * the map returned by this method is live, and you can add new attribute - * by updating the map directly. Because of this design, there's no setter. - * - * - * @return - * always non-null - */ - public Map getOtherAttributes() { - return otherAttributes; - } - - } - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/ObjectFactory.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/ObjectFactory.java deleted file mode 100644 index 93d83cbc63406a5a49fbb03d8ee0194c3881840c..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/ObjectFactory.java +++ /dev/null @@ -1,436 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - - -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.ovf.envelope._1; - -import javax.xml.bind.JAXBElement; -import javax.xml.bind.annotation.XmlElementDecl; -import javax.xml.bind.annotation.XmlRegistry; -import javax.xml.namespace.QName; - - -/** - * This object contains factory methods for each - * Java content interface and Java element interface - * generated in the org.ow2.contrail.federation.application.ovf.dmtf.schemas.ovf.envelope._1 package. - *

An ObjectFactory allows you to programatically - * construct new instances of the Java representation - * for XML content. The Java representation of XML - * content can consist of schema derived interfaces - * and classes representing the binding of schema - * type definitions, element declarations and model - * groups. Factory methods for each of these are - * provided in this class. - * - */ -@XmlRegistry -public class ObjectFactory { - - private final static QName _ProductSection_QNAME = new QName("http://schemas.dmtf.org/ovf/envelope/1", "ProductSection"); - private final static QName _InstallSection_QNAME = new QName("http://schemas.dmtf.org/ovf/envelope/1", "InstallSection"); - private final static QName _VirtualSystemCollection_QNAME = new QName("http://schemas.dmtf.org/ovf/envelope/1", "VirtualSystemCollection"); - private final static QName _VirtualSystem_QNAME = new QName("http://schemas.dmtf.org/ovf/envelope/1", "VirtualSystem"); - private final static QName _DiskSection_QNAME = new QName("http://schemas.dmtf.org/ovf/envelope/1", "DiskSection"); - private final static QName _DeploymentOptionSection_QNAME = new QName("http://schemas.dmtf.org/ovf/envelope/1", "DeploymentOptionSection"); - private final static QName _StartupSection_QNAME = new QName("http://schemas.dmtf.org/ovf/envelope/1", "StartupSection"); - private final static QName _VirtualHardwareSection_QNAME = new QName("http://schemas.dmtf.org/ovf/envelope/1", "VirtualHardwareSection"); - private final static QName _ResourceAllocationSection_QNAME = new QName("http://schemas.dmtf.org/ovf/envelope/1", "ResourceAllocationSection"); - private final static QName _Strings_QNAME = new QName("http://schemas.dmtf.org/ovf/envelope/1", "Strings"); - private final static QName _Section_QNAME = new QName("http://schemas.dmtf.org/ovf/envelope/1", "Section"); - private final static QName _Envelope_QNAME = new QName("http://schemas.dmtf.org/ovf/envelope/1", "Envelope"); - private final static QName _OperatingSystemSection_QNAME = new QName("http://schemas.dmtf.org/ovf/envelope/1", "OperatingSystemSection"); - private final static QName _Content_QNAME = new QName("http://schemas.dmtf.org/ovf/envelope/1", "Content"); - private final static QName _AnnotationSection_QNAME = new QName("http://schemas.dmtf.org/ovf/envelope/1", "AnnotationSection"); - private final static QName _NetworkSection_QNAME = new QName("http://schemas.dmtf.org/ovf/envelope/1", "NetworkSection"); - private final static QName _EulaSection_QNAME = new QName("http://schemas.dmtf.org/ovf/envelope/1", "EulaSection"); - - /** - * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.ow2.contrail.federation.application.ovf.dmtf.schemas.ovf.envelope._1 - * - */ - public ObjectFactory() { - } - - /** - * Create an instance of {@link VirtualDiskDescType } - * - */ - public VirtualDiskDescType createVirtualDiskDescType() { - return new VirtualDiskDescType(); - } - - /** - * Create an instance of {@link AnnotationSectionType } - * - */ - public AnnotationSectionType createAnnotationSectionType() { - return new AnnotationSectionType(); - } - - /** - * Create an instance of {@link PropertyConfigurationValueType } - * - */ - public PropertyConfigurationValueType createPropertyConfigurationValueType() { - return new PropertyConfigurationValueType(); - } - - /** - * Create an instance of {@link EulaSectionType } - * - */ - public EulaSectionType createEulaSectionType() { - return new EulaSectionType(); - } - - /** - * Create an instance of {@link VirtualSystemCollectionType } - * - */ - public VirtualSystemCollectionType createVirtualSystemCollectionType() { - return new VirtualSystemCollectionType(); - } - - /** - * Create an instance of {@link VirtualHardwareSectionType } - * - */ - public VirtualHardwareSectionType createVirtualHardwareSectionType() { - return new VirtualHardwareSectionType(); - } - - /** - * Create an instance of {@link StringsType.Msg } - * - */ - public StringsType.Msg createStringsTypeMsg() { - return new StringsType.Msg(); - } - - /** - * Create an instance of {@link NetworkSectionType } - * - */ - public NetworkSectionType createNetworkSectionType() { - return new NetworkSectionType(); - } - - /** - * Create an instance of {@link ProductSectionType.Property } - * - */ - public ProductSectionType.Property createProductSectionTypeProperty() { - return new ProductSectionType.Property(); - } - - /** - * Create an instance of {@link NetworkSectionType.Network } - * - */ - public NetworkSectionType.Network createNetworkSectionTypeNetwork() { - return new NetworkSectionType.Network(); - } - - /** - * Create an instance of {@link EnvelopeType } - * - */ - public EnvelopeType createEnvelopeType() { - return new EnvelopeType(); - } - - /** - * Create an instance of {@link ProductSectionType.Icon } - * - */ - public ProductSectionType.Icon createProductSectionTypeIcon() { - return new ProductSectionType.Icon(); - } - - /** - * Create an instance of {@link MsgType } - * - */ - public MsgType createMsgType() { - return new MsgType(); - } - - /** - * Create an instance of {@link StartupSectionType } - * - */ - public StartupSectionType createStartupSectionType() { - return new StartupSectionType(); - } - - /** - * Create an instance of {@link DeploymentOptionSectionType.Configuration } - * - */ - public DeploymentOptionSectionType.Configuration createDeploymentOptionSectionTypeConfiguration() { - return new DeploymentOptionSectionType.Configuration(); - } - - /** - * Create an instance of {@link OperatingSystemSectionType } - * - */ - public OperatingSystemSectionType createOperatingSystemSectionType() { - return new OperatingSystemSectionType(); - } - - /** - * Create an instance of {@link ProductSectionType } - * - */ - public ProductSectionType createProductSectionType() { - return new ProductSectionType(); - } - - /** - * Create an instance of {@link DeploymentOptionSectionType } - * - */ - public DeploymentOptionSectionType createDeploymentOptionSectionType() { - return new DeploymentOptionSectionType(); - } - - /** - * Create an instance of {@link InstallSectionType } - * - */ - public InstallSectionType createInstallSectionType() { - return new InstallSectionType(); - } - - /** - * Create an instance of {@link DiskSectionType } - * - */ - public DiskSectionType createDiskSectionType() { - return new DiskSectionType(); - } - - /** - * Create an instance of {@link StartupSectionType.Item } - * - */ - public StartupSectionType.Item createStartupSectionTypeItem() { - return new StartupSectionType.Item(); - } - - /** - * Create an instance of {@link VirtualSystemType } - * - */ - public VirtualSystemType createVirtualSystemType() { - return new VirtualSystemType(); - } - - /** - * Create an instance of {@link FileType } - * - */ - public FileType createFileType() { - return new FileType(); - } - - /** - * Create an instance of {@link VSSDType } - * - */ - public VSSDType createVSSDType() { - return new VSSDType(); - } - - /** - * Create an instance of {@link StringsType } - * - */ - public StringsType createStringsType() { - return new StringsType(); - } - - /** - * Create an instance of {@link ReferencesType } - * - */ - public ReferencesType createReferencesType() { - return new ReferencesType(); - } - - /** - * Create an instance of {@link RASDType } - * - */ - public RASDType createRASDType() { - return new RASDType(); - } - - /** - * Create an instance of {@link ResourceAllocationSectionType } - * - */ - public ResourceAllocationSectionType createResourceAllocationSectionType() { - return new ResourceAllocationSectionType(); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link ProductSectionType }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/ovf/envelope/1", name = "ProductSection", substitutionHeadNamespace = "http://schemas.dmtf.org/ovf/envelope/1", substitutionHeadName = "Section") - public JAXBElement createProductSection(ProductSectionType value) { - return new JAXBElement(_ProductSection_QNAME, ProductSectionType.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link InstallSectionType }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/ovf/envelope/1", name = "InstallSection", substitutionHeadNamespace = "http://schemas.dmtf.org/ovf/envelope/1", substitutionHeadName = "Section") - public JAXBElement createInstallSection(InstallSectionType value) { - return new JAXBElement(_InstallSection_QNAME, InstallSectionType.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link VirtualSystemCollectionType }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/ovf/envelope/1", name = "VirtualSystemCollection", substitutionHeadNamespace = "http://schemas.dmtf.org/ovf/envelope/1", substitutionHeadName = "Content") - public JAXBElement createVirtualSystemCollection(VirtualSystemCollectionType value) { - return new JAXBElement(_VirtualSystemCollection_QNAME, VirtualSystemCollectionType.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link VirtualSystemType }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/ovf/envelope/1", name = "VirtualSystem", substitutionHeadNamespace = "http://schemas.dmtf.org/ovf/envelope/1", substitutionHeadName = "Content") - public JAXBElement createVirtualSystem(VirtualSystemType value) { - return new JAXBElement(_VirtualSystem_QNAME, VirtualSystemType.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link DiskSectionType }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/ovf/envelope/1", name = "DiskSection", substitutionHeadNamespace = "http://schemas.dmtf.org/ovf/envelope/1", substitutionHeadName = "Section") - public JAXBElement createDiskSection(DiskSectionType value) { - return new JAXBElement(_DiskSection_QNAME, DiskSectionType.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link DeploymentOptionSectionType }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/ovf/envelope/1", name = "DeploymentOptionSection", substitutionHeadNamespace = "http://schemas.dmtf.org/ovf/envelope/1", substitutionHeadName = "Section") - public JAXBElement createDeploymentOptionSection(DeploymentOptionSectionType value) { - return new JAXBElement(_DeploymentOptionSection_QNAME, DeploymentOptionSectionType.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link StartupSectionType }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/ovf/envelope/1", name = "StartupSection", substitutionHeadNamespace = "http://schemas.dmtf.org/ovf/envelope/1", substitutionHeadName = "Section") - public JAXBElement createStartupSection(StartupSectionType value) { - return new JAXBElement(_StartupSection_QNAME, StartupSectionType.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link VirtualHardwareSectionType }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/ovf/envelope/1", name = "VirtualHardwareSection", substitutionHeadNamespace = "http://schemas.dmtf.org/ovf/envelope/1", substitutionHeadName = "Section") - public JAXBElement createVirtualHardwareSection(VirtualHardwareSectionType value) { - return new JAXBElement(_VirtualHardwareSection_QNAME, VirtualHardwareSectionType.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link ResourceAllocationSectionType }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/ovf/envelope/1", name = "ResourceAllocationSection", substitutionHeadNamespace = "http://schemas.dmtf.org/ovf/envelope/1", substitutionHeadName = "Section") - public JAXBElement createResourceAllocationSection(ResourceAllocationSectionType value) { - return new JAXBElement(_ResourceAllocationSection_QNAME, ResourceAllocationSectionType.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link StringsType }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/ovf/envelope/1", name = "Strings") - public JAXBElement createStrings(StringsType value) { - return new JAXBElement(_Strings_QNAME, StringsType.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link SectionType }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/ovf/envelope/1", name = "Section") - public JAXBElement createSection(SectionType value) { - return new JAXBElement(_Section_QNAME, SectionType.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link EnvelopeType }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/ovf/envelope/1", name = "Envelope") - public JAXBElement createEnvelope(EnvelopeType value) { - return new JAXBElement(_Envelope_QNAME, EnvelopeType.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link OperatingSystemSectionType }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/ovf/envelope/1", name = "OperatingSystemSection", substitutionHeadNamespace = "http://schemas.dmtf.org/ovf/envelope/1", substitutionHeadName = "Section") - public JAXBElement createOperatingSystemSection(OperatingSystemSectionType value) { - return new JAXBElement(_OperatingSystemSection_QNAME, OperatingSystemSectionType.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link ContentType }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/ovf/envelope/1", name = "Content") - public JAXBElement createContent(ContentType value) { - return new JAXBElement(_Content_QNAME, ContentType.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link AnnotationSectionType }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/ovf/envelope/1", name = "AnnotationSection", substitutionHeadNamespace = "http://schemas.dmtf.org/ovf/envelope/1", substitutionHeadName = "Section") - public JAXBElement createAnnotationSection(AnnotationSectionType value) { - return new JAXBElement(_AnnotationSection_QNAME, AnnotationSectionType.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link NetworkSectionType }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/ovf/envelope/1", name = "NetworkSection", substitutionHeadNamespace = "http://schemas.dmtf.org/ovf/envelope/1", substitutionHeadName = "Section") - public JAXBElement createNetworkSection(NetworkSectionType value) { - return new JAXBElement(_NetworkSection_QNAME, NetworkSectionType.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link EulaSectionType }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/ovf/envelope/1", name = "EulaSection", substitutionHeadNamespace = "http://schemas.dmtf.org/ovf/envelope/1", substitutionHeadName = "Section") - public JAXBElement createEulaSection(EulaSectionType value) { - return new JAXBElement(_EulaSection_QNAME, EulaSectionType.class, null, value); - } - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/OperatingSystemSectionType.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/OperatingSystemSectionType.java deleted file mode 100644 index e4a01a06440bc7ca3beaff329f65714083a36778..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/OperatingSystemSectionType.java +++ /dev/null @@ -1,162 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - - -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.ovf.envelope._1; - -import java.util.ArrayList; -import java.util.List; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyElement; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; -import org.w3c.dom.Element; - - -/** - * Specification of the operating system installed in the - * guest - * - *

Java class for OperatingSystemSection_Type complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="OperatingSystemSection_Type">
- *   <complexContent>
- *     <extension base="{http://schemas.dmtf.org/ovf/envelope/1}Section_Type">
- *       <sequence>
- *         <element name="Description" type="{http://schemas.dmtf.org/ovf/envelope/1}Msg_Type" minOccurs="0"/>
- *         <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
- *       </sequence>
- *       <attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}unsignedShort" />
- *       <attribute name="version" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <anyAttribute processContents='lax'/>
- *     </extension>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "OperatingSystemSection_Type", propOrder = { - "description", - "any" -}) -public class OperatingSystemSectionType - extends SectionType -{ - - @XmlElement(name = "Description") - protected MsgType description; - @XmlAnyElement(lax = true) - protected List any; - @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/envelope/1", required = true) - @XmlSchemaType(name = "unsignedShort") - protected int id; - @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/envelope/1") - protected String version; - - /** - * Gets the value of the description property. - * - * @return - * possible object is - * {@link MsgType } - * - */ - public MsgType getDescription() { - return description; - } - - /** - * Sets the value of the description property. - * - * @param value - * allowed object is - * {@link MsgType } - * - */ - public void setDescription(MsgType value) { - this.description = value; - } - - /** - * Gets the value of the any property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the any property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getAny().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link Object } - * {@link Element } - * - * - */ - public List getAny() { - if (any == null) { - any = new ArrayList(); - } - return this.any; - } - - /** - * Gets the value of the id property. - * - */ - public int getId() { - return id; - } - - /** - * Sets the value of the id property. - * - */ - public void setId(int value) { - this.id = value; - } - - /** - * Gets the value of the version property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getVersion() { - return version; - } - - /** - * Sets the value of the version property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setVersion(String value) { - this.version = value; - } - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/ProductSectionType.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/ProductSectionType.java deleted file mode 100644 index 59a574c6458ff672226f3abbff6d23111fdb554b..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/ProductSectionType.java +++ /dev/null @@ -1,922 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - - -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.ovf.envelope._1; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyAttribute; -import javax.xml.bind.annotation.XmlAnyElement; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElements; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; -import javax.xml.namespace.QName; - -import org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.common.CimString; -import org.w3c.dom.Element; - - -/** - * Product information for a virtual - * appliance - * - *

Java class for ProductSection_Type complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="ProductSection_Type">
- *   <complexContent>
- *     <extension base="{http://schemas.dmtf.org/ovf/envelope/1}Section_Type">
- *       <sequence>
- *         <element name="Product" type="{http://schemas.dmtf.org/ovf/envelope/1}Msg_Type" minOccurs="0"/>
- *         <element name="Vendor" type="{http://schemas.dmtf.org/ovf/envelope/1}Msg_Type" minOccurs="0"/>
- *         <element name="Version" type="{http://schemas.dmtf.org/wbem/wscim/1/common}cimString" minOccurs="0"/>
- *         <element name="FullVersion" type="{http://schemas.dmtf.org/wbem/wscim/1/common}cimString" minOccurs="0"/>
- *         <element name="ProductUrl" type="{http://schemas.dmtf.org/wbem/wscim/1/common}cimString" minOccurs="0"/>
- *         <element name="VendorUrl" type="{http://schemas.dmtf.org/wbem/wscim/1/common}cimString" minOccurs="0"/>
- *         <element name="AppUrl" type="{http://schemas.dmtf.org/wbem/wscim/1/common}cimString" minOccurs="0"/>
- *         <element name="Icon" maxOccurs="unbounded" minOccurs="0">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <attribute name="height" type="{http://www.w3.org/2001/XMLSchema}unsignedShort" />
- *                 <attribute name="width" type="{http://www.w3.org/2001/XMLSchema}unsignedShort" />
- *                 <attribute name="mimeType" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                 <attribute name="fileRef" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                 <anyAttribute processContents='lax'/>
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *         <choice maxOccurs="unbounded" minOccurs="0">
- *           <element name="Category" type="{http://schemas.dmtf.org/ovf/envelope/1}Msg_Type"/>
- *           <element name="Property">
- *             <complexType>
- *               <complexContent>
- *                 <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                   <sequence>
- *                     <element name="Label" type="{http://schemas.dmtf.org/ovf/envelope/1}Msg_Type" minOccurs="0"/>
- *                     <element name="Description" type="{http://schemas.dmtf.org/ovf/envelope/1}Msg_Type" minOccurs="0"/>
- *                     <element name="Value" type="{http://schemas.dmtf.org/ovf/envelope/1}PropertyConfigurationValue_Type" maxOccurs="unbounded" minOccurs="0"/>
- *                   </sequence>
- *                   <attribute name="key" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                   <attribute name="type" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                   <attribute name="qualifiers" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                   <attribute name="userConfigurable" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
- *                   <attribute name="value" type="{http://www.w3.org/2001/XMLSchema}string" default="" />
- *                   <attribute name="password" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
- *                   <anyAttribute processContents='lax'/>
- *                 </restriction>
- *               </complexContent>
- *             </complexType>
- *           </element>
- *         </choice>
- *         <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
- *       </sequence>
- *       <attribute name="class" type="{http://www.w3.org/2001/XMLSchema}string" default="" />
- *       <attribute name="instance" type="{http://www.w3.org/2001/XMLSchema}string" default="" />
- *       <anyAttribute processContents='lax'/>
- *     </extension>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "ProductSection_Type", propOrder = { - "product", - "vendor", - "version", - "fullVersion", - "productUrl", - "vendorUrl", - "appUrl", - "icon", - "categoryOrProperty", - "any" -}) -public class ProductSectionType - extends SectionType -{ - - @XmlElement(name = "Product") - protected MsgType product; - @XmlElement(name = "Vendor") - protected MsgType vendor; - @XmlElement(name = "Version") - protected CimString version; - @XmlElement(name = "FullVersion") - protected CimString fullVersion; - @XmlElement(name = "ProductUrl") - protected CimString productUrl; - @XmlElement(name = "VendorUrl") - protected CimString vendorUrl; - @XmlElement(name = "AppUrl") - protected CimString appUrl; - @XmlElement(name = "Icon") - protected List icon; - @XmlElements({ - @XmlElement(name = "Property", type = ProductSectionType.Property.class), - @XmlElement(name = "Category", type = MsgType.class) - }) - protected List categoryOrProperty; - @XmlAnyElement(lax = true) - protected List any; - @XmlAttribute(name = "class", namespace = "http://schemas.dmtf.org/ovf/envelope/1") - protected String clazz; - @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/envelope/1") - protected String instance; - - /** - * Gets the value of the product property. - * - * @return - * possible object is - * {@link MsgType } - * - */ - public MsgType getProduct() { - return product; - } - - /** - * Sets the value of the product property. - * - * @param value - * allowed object is - * {@link MsgType } - * - */ - public void setProduct(MsgType value) { - this.product = value; - } - - /** - * Gets the value of the vendor property. - * - * @return - * possible object is - * {@link MsgType } - * - */ - public MsgType getVendor() { - return vendor; - } - - /** - * Sets the value of the vendor property. - * - * @param value - * allowed object is - * {@link MsgType } - * - */ - public void setVendor(MsgType value) { - this.vendor = value; - } - - /** - * Gets the value of the version property. - * - * @return - * possible object is - * {@link CimString } - * - */ - public CimString getVersion() { - return version; - } - - /** - * Sets the value of the version property. - * - * @param value - * allowed object is - * {@link CimString } - * - */ - public void setVersion(CimString value) { - this.version = value; - } - - /** - * Gets the value of the fullVersion property. - * - * @return - * possible object is - * {@link CimString } - * - */ - public CimString getFullVersion() { - return fullVersion; - } - - /** - * Sets the value of the fullVersion property. - * - * @param value - * allowed object is - * {@link CimString } - * - */ - public void setFullVersion(CimString value) { - this.fullVersion = value; - } - - /** - * Gets the value of the productUrl property. - * - * @return - * possible object is - * {@link CimString } - * - */ - public CimString getProductUrl() { - return productUrl; - } - - /** - * Sets the value of the productUrl property. - * - * @param value - * allowed object is - * {@link CimString } - * - */ - public void setProductUrl(CimString value) { - this.productUrl = value; - } - - /** - * Gets the value of the vendorUrl property. - * - * @return - * possible object is - * {@link CimString } - * - */ - public CimString getVendorUrl() { - return vendorUrl; - } - - /** - * Sets the value of the vendorUrl property. - * - * @param value - * allowed object is - * {@link CimString } - * - */ - public void setVendorUrl(CimString value) { - this.vendorUrl = value; - } - - /** - * Gets the value of the appUrl property. - * - * @return - * possible object is - * {@link CimString } - * - */ - public CimString getAppUrl() { - return appUrl; - } - - /** - * Sets the value of the appUrl property. - * - * @param value - * allowed object is - * {@link CimString } - * - */ - public void setAppUrl(CimString value) { - this.appUrl = value; - } - - /** - * Gets the value of the icon property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the icon property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getIcon().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link ProductSectionType.Icon } - * - * - */ - public List getIcon() { - if (icon == null) { - icon = new ArrayList(); - } - return this.icon; - } - - /** - * Gets the value of the categoryOrProperty property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the categoryOrProperty property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getCategoryOrProperty().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link ProductSectionType.Property } - * {@link MsgType } - * - * - */ - public List getCategoryOrProperty() { - if (categoryOrProperty == null) { - categoryOrProperty = new ArrayList(); - } - return this.categoryOrProperty; - } - - /** - * Gets the value of the any property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the any property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getAny().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link Object } - * {@link Element } - * - * - */ - public List getAny() { - if (any == null) { - any = new ArrayList(); - } - return this.any; - } - - /** - * Gets the value of the clazz property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getClazz() { - if (clazz == null) { - return ""; - } else { - return clazz; - } - } - - /** - * Sets the value of the clazz property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setClazz(String value) { - this.clazz = value; - } - - /** - * Gets the value of the instance property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getInstance() { - if (instance == null) { - return ""; - } else { - return instance; - } - } - - /** - * Sets the value of the instance property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setInstance(String value) { - this.instance = value; - } - - - /** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

-     * <complexType>
-     *   <complexContent>
-     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
-     *       <attribute name="height" type="{http://www.w3.org/2001/XMLSchema}unsignedShort" />
-     *       <attribute name="width" type="{http://www.w3.org/2001/XMLSchema}unsignedShort" />
-     *       <attribute name="mimeType" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *       <attribute name="fileRef" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *       <anyAttribute processContents='lax'/>
-     *     </restriction>
-     *   </complexContent>
-     * </complexType>
-     * 
- * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "") - public static class Icon { - - @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/envelope/1") - @XmlSchemaType(name = "unsignedShort") - protected Integer height; - @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/envelope/1") - @XmlSchemaType(name = "unsignedShort") - protected Integer width; - @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/envelope/1") - protected String mimeType; - @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/envelope/1", required = true) - protected String fileRef; - @XmlAnyAttribute - private Map otherAttributes = new HashMap(); - - /** - * Gets the value of the height property. - * - * @return - * possible object is - * {@link Integer } - * - */ - public Integer getHeight() { - return height; - } - - /** - * Sets the value of the height property. - * - * @param value - * allowed object is - * {@link Integer } - * - */ - public void setHeight(Integer value) { - this.height = value; - } - - /** - * Gets the value of the width property. - * - * @return - * possible object is - * {@link Integer } - * - */ - public Integer getWidth() { - return width; - } - - /** - * Sets the value of the width property. - * - * @param value - * allowed object is - * {@link Integer } - * - */ - public void setWidth(Integer value) { - this.width = value; - } - - /** - * Gets the value of the mimeType property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getMimeType() { - return mimeType; - } - - /** - * Sets the value of the mimeType property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setMimeType(String value) { - this.mimeType = value; - } - - /** - * Gets the value of the fileRef property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getFileRef() { - return fileRef; - } - - /** - * Sets the value of the fileRef property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setFileRef(String value) { - this.fileRef = value; - } - - /** - * Gets a map that contains attributes that aren't bound to any typed property on this class. - * - *

- * the map is keyed by the name of the attribute and - * the value is the string value of the attribute. - * - * the map returned by this method is live, and you can add new attribute - * by updating the map directly. Because of this design, there's no setter. - * - * - * @return - * always non-null - */ - public Map getOtherAttributes() { - return otherAttributes; - } - - } - - - /** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

-     * <complexType>
-     *   <complexContent>
-     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
-     *       <sequence>
-     *         <element name="Label" type="{http://schemas.dmtf.org/ovf/envelope/1}Msg_Type" minOccurs="0"/>
-     *         <element name="Description" type="{http://schemas.dmtf.org/ovf/envelope/1}Msg_Type" minOccurs="0"/>
-     *         <element name="Value" type="{http://schemas.dmtf.org/ovf/envelope/1}PropertyConfigurationValue_Type" maxOccurs="unbounded" minOccurs="0"/>
-     *       </sequence>
-     *       <attribute name="key" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *       <attribute name="type" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *       <attribute name="qualifiers" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *       <attribute name="userConfigurable" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
-     *       <attribute name="value" type="{http://www.w3.org/2001/XMLSchema}string" default="" />
-     *       <attribute name="password" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
-     *       <anyAttribute processContents='lax'/>
-     *     </restriction>
-     *   </complexContent>
-     * </complexType>
-     * 
- * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = { - "label", - "description", - "valueToFixError1" - }) - public static class Property { - - @XmlElement(name = "Label") - protected MsgType label; - @XmlElement(name = "Description") - protected MsgType description; - @XmlElement(name = "Value") - protected List valueToFixError1; - @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/envelope/1", required = true) - protected String key; - @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/envelope/1", required = true) - protected String type; - @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/envelope/1") - protected String qualifiers; - @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/envelope/1") - protected Boolean userConfigurable; - @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/envelope/1") - protected String value; - @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/envelope/1") - protected Boolean password; - @XmlAnyAttribute - private Map otherAttributes = new HashMap(); - - /** - * Gets the value of the label property. - * - * @return - * possible object is - * {@link MsgType } - * - */ - public MsgType getLabel() { - return label; - } - - /** - * Sets the value of the label property. - * - * @param value - * allowed object is - * {@link MsgType } - * - */ - public void setLabel(MsgType value) { - this.label = value; - } - - /** - * Gets the value of the description property. - * - * @return - * possible object is - * {@link MsgType } - * - */ - public MsgType getDescription() { - return description; - } - - /** - * Sets the value of the description property. - * - * @param value - * allowed object is - * {@link MsgType } - * - */ - public void setDescription(MsgType value) { - this.description = value; - } - - /** - * Gets the value of the valueToFixError1 property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the valueToFixError1 property. - * - *

- * For example, to add a new item, do as follows: - *

-         *    getValueToFixError1().add(newItem);
-         * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link PropertyConfigurationValueType } - * - * - */ - public List getValueToFixError1() { - if (valueToFixError1 == null) { - valueToFixError1 = new ArrayList(); - } - return this.valueToFixError1; - } - - /** - * Gets the value of the key property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getKey() { - return key; - } - - /** - * Sets the value of the key property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setKey(String value) { - this.key = value; - } - - /** - * Gets the value of the type property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getType() { - return type; - } - - /** - * Sets the value of the type property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setType(String value) { - this.type = value; - } - - /** - * Gets the value of the qualifiers property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getQualifiers() { - return qualifiers; - } - - /** - * Sets the value of the qualifiers property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setQualifiers(String value) { - this.qualifiers = value; - } - - /** - * Gets the value of the userConfigurable property. - * - * @return - * possible object is - * {@link Boolean } - * - */ - public boolean isUserConfigurable() { - if (userConfigurable == null) { - return false; - } else { - return userConfigurable; - } - } - - /** - * Sets the value of the userConfigurable property. - * - * @param value - * allowed object is - * {@link Boolean } - * - */ - public void setUserConfigurable(Boolean value) { - this.userConfigurable = value; - } - - /** - * Gets the value of the value property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getValue() { - if (value == null) { - return ""; - } else { - return value; - } - } - - /** - * Sets the value of the value property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setValue(String value) { - this.value = value; - } - - /** - * Gets the value of the password property. - * - * @return - * possible object is - * {@link Boolean } - * - */ - public boolean isPassword() { - if (password == null) { - return false; - } else { - return password; - } - } - - /** - * Sets the value of the password property. - * - * @param value - * allowed object is - * {@link Boolean } - * - */ - public void setPassword(Boolean value) { - this.password = value; - } - - /** - * Gets a map that contains attributes that aren't bound to any typed property on this class. - * - *

- * the map is keyed by the name of the attribute and - * the value is the string value of the attribute. - * - * the map returned by this method is live, and you can add new attribute - * by updating the map directly. Because of this design, there's no setter. - * - * - * @return - * always non-null - */ - public Map getOtherAttributes() { - return otherAttributes; - } - - } - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/PropertyConfigurationValueType.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/PropertyConfigurationValueType.java deleted file mode 100644 index 347d2307a709f0988bdd22a5ddf0e7c5899af518..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/PropertyConfigurationValueType.java +++ /dev/null @@ -1,161 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - - -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.ovf.envelope._1; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyAttribute; -import javax.xml.bind.annotation.XmlAnyElement; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlType; -import javax.xml.namespace.QName; -import org.w3c.dom.Element; - - -/** - * Type for alternative default values for properties when - * DeploymentOptionSection is used - * - *

Java class for PropertyConfigurationValue_Type complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="PropertyConfigurationValue_Type">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
- *       </sequence>
- *       <attribute name="value" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="configuration" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <anyAttribute processContents='lax'/>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "PropertyConfigurationValue_Type", propOrder = { - "any" -}) -public class PropertyConfigurationValueType { - - @XmlAnyElement(lax = true) - protected List any; - @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/envelope/1", required = true) - protected String value; - @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/envelope/1") - protected String configuration; - @XmlAnyAttribute - private Map otherAttributes = new HashMap(); - - /** - * Gets the value of the any property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the any property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getAny().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link Object } - * {@link Element } - * - * - */ - public List getAny() { - if (any == null) { - any = new ArrayList(); - } - return this.any; - } - - /** - * Gets the value of the value property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getValue() { - return value; - } - - /** - * Sets the value of the value property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setValue(String value) { - this.value = value; - } - - /** - * Gets the value of the configuration property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getConfiguration() { - return configuration; - } - - /** - * Sets the value of the configuration property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setConfiguration(String value) { - this.configuration = value; - } - - /** - * Gets a map that contains attributes that aren't bound to any typed property on this class. - * - *

- * the map is keyed by the name of the attribute and - * the value is the string value of the attribute. - * - * the map returned by this method is live, and you can add new attribute - * by updating the map directly. Because of this design, there's no setter. - * - * - * @return - * always non-null - */ - public Map getOtherAttributes() { - return otherAttributes; - } - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/RASDType.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/RASDType.java deleted file mode 100644 index 820bd92d44250fd1870dd16c8d95bdb967257c3d..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/RASDType.java +++ /dev/null @@ -1,131 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - - -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.ovf.envelope._1; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlType; - -import org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.cim_schema._2.cim_resourceallocationsettingdata.CIMResourceAllocationSettingDataType; - - -/** - * Wrapper for - * CIM_ResourceAllocationSettingData_Type - * - *

Java class for RASD_Type complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="RASD_Type">
- *   <complexContent>
- *     <extension base="{http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData}CIM_ResourceAllocationSettingData_Type">
- *       <attribute name="required" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
- *       <attribute name="configuration" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="bound" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <anyAttribute processContents='lax'/>
- *     </extension>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "RASD_Type") -public class RASDType - extends CIMResourceAllocationSettingDataType -{ - - @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/envelope/1") - protected Boolean required; - @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/envelope/1") - protected String configuration; - @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/envelope/1") - protected String bound; - - /** - * Gets the value of the required property. - * - * @return - * possible object is - * {@link Boolean } - * - */ - public boolean isRequired() { - if (required == null) { - return true; - } else { - return required; - } - } - - /** - * Sets the value of the required property. - * - * @param value - * allowed object is - * {@link Boolean } - * - */ - public void setRequired(Boolean value) { - this.required = value; - } - - /** - * Gets the value of the configuration property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getConfiguration() { - return configuration; - } - - /** - * Sets the value of the configuration property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setConfiguration(String value) { - this.configuration = value; - } - - /** - * Gets the value of the bound property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getBound() { - return bound; - } - - /** - * Sets the value of the bound property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setBound(String value) { - this.bound = value; - } - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/ReferencesType.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/ReferencesType.java deleted file mode 100644 index 87573eccde057c58f61ecac234a0569a45b106d5..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/ReferencesType.java +++ /dev/null @@ -1,139 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - - -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.ovf.envelope._1; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyAttribute; -import javax.xml.bind.annotation.XmlAnyElement; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; -import javax.xml.namespace.QName; -import org.w3c.dom.Element; - - -/** - * Type for list of external resources - * - *

Java class for References_Type complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="References_Type">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="File" type="{http://schemas.dmtf.org/ovf/envelope/1}File_Type" maxOccurs="unbounded" minOccurs="0"/>
- *         <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
- *       </sequence>
- *       <anyAttribute processContents='lax'/>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "References_Type", propOrder = { - "file", - "any" -}) -public class ReferencesType { - - @XmlElement(name = "File") - protected List file; - @XmlAnyElement(lax = true) - protected List any; - @XmlAnyAttribute - private Map otherAttributes = new HashMap(); - - /** - * Gets the value of the file property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the file property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getFile().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link FileType } - * - * - */ - public List getFile() { - if (file == null) { - file = new ArrayList(); - } - return this.file; - } - - /** - * Gets the value of the any property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the any property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getAny().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link Object } - * {@link Element } - * - * - */ - public List getAny() { - if (any == null) { - any = new ArrayList(); - } - return this.any; - } - - /** - * Gets a map that contains attributes that aren't bound to any typed property on this class. - * - *

- * the map is keyed by the name of the attribute and - * the value is the string value of the attribute. - * - * the map returned by this method is live, and you can add new attribute - * by updating the map directly. Because of this design, there's no setter. - * - * - * @return - * always non-null - */ - public Map getOtherAttributes() { - return otherAttributes; - } - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/ResourceAllocationSectionType.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/ResourceAllocationSectionType.java deleted file mode 100644 index 7bf02a0de7cc1316a70f88cd055ca29d97694f7e..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/ResourceAllocationSectionType.java +++ /dev/null @@ -1,118 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - - -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.ovf.envelope._1; - -import java.util.ArrayList; -import java.util.List; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyElement; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; -import org.w3c.dom.Element; - - -/** - * Resource constraints on a - * VirtualSystemCollection - * - *

Java class for ResourceAllocationSection_Type complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="ResourceAllocationSection_Type">
- *   <complexContent>
- *     <extension base="{http://schemas.dmtf.org/ovf/envelope/1}Section_Type">
- *       <sequence>
- *         <element name="Item" type="{http://schemas.dmtf.org/ovf/envelope/1}RASD_Type" maxOccurs="unbounded" minOccurs="0"/>
- *         <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
- *       </sequence>
- *       <anyAttribute processContents='lax'/>
- *     </extension>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "ResourceAllocationSection_Type", propOrder = { - "item", - "any" -}) -public class ResourceAllocationSectionType - extends SectionType -{ - - @XmlElement(name = "Item") - protected List item; - @XmlAnyElement(lax = true) - protected List any; - - /** - * Gets the value of the item property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the item property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getItem().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link RASDType } - * - * - */ - public List getItem() { - if (item == null) { - item = new ArrayList(); - } - return this.item; - } - - /** - * Gets the value of the any property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the any property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getAny().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link Object } - * {@link Element } - * - * - */ - public List getAny() { - if (any == null) { - any = new ArrayList(); - } - return this.any; - } - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/SectionType.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/SectionType.java deleted file mode 100644 index 2b4e2f0f6d3c5a1abefa1a2b4efae044c999640a..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/SectionType.java +++ /dev/null @@ -1,140 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - - -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.ovf.envelope._1; - -import java.util.HashMap; -import java.util.Map; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyAttribute; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlSeeAlso; -import javax.xml.bind.annotation.XmlType; -import javax.xml.namespace.QName; - - -/** - *

Java class for Section_Type complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="Section_Type">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="Info" type="{http://schemas.dmtf.org/ovf/envelope/1}Msg_Type"/>
- *       </sequence>
- *       <attribute ref="{http://schemas.dmtf.org/ovf/envelope/1}required"/>
- *       <anyAttribute processContents='lax'/>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "Section_Type", propOrder = { - "info" -}) -@XmlSeeAlso({ - DeploymentOptionSectionType.class, - StartupSectionType.class, - InstallSectionType.class, - OperatingSystemSectionType.class, - AnnotationSectionType.class, - NetworkSectionType.class, - EulaSectionType.class, - ProductSectionType.class, - VirtualHardwareSectionType.class, - ResourceAllocationSectionType.class, - DiskSectionType.class -}) -public abstract class SectionType { - - @XmlElement(name = "Info", required = true) - protected MsgType info; - @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/envelope/1") - protected Boolean required; - @XmlAnyAttribute - private Map otherAttributes = new HashMap(); - - /** - * Gets the value of the info property. - * - * @return - * possible object is - * {@link MsgType } - * - */ - public MsgType getInfo() { - return info; - } - - /** - * Sets the value of the info property. - * - * @param value - * allowed object is - * {@link MsgType } - * - */ - public void setInfo(MsgType value) { - this.info = value; - } - - /** - * Gets the value of the required property. - * - * @return - * possible object is - * {@link Boolean } - * - */ - public boolean isRequired() { - if (required == null) { - return true; - } else { - return required; - } - } - - /** - * Sets the value of the required property. - * - * @param value - * allowed object is - * {@link Boolean } - * - */ - public void setRequired(Boolean value) { - this.required = value; - } - - /** - * Gets a map that contains attributes that aren't bound to any typed property on this class. - * - *

- * the map is keyed by the name of the attribute and - * the value is the string value of the attribute. - * - * the map returned by this method is live, and you can add new attribute - * by updating the map directly. Because of this design, there's no setter. - * - * - * @return - * always non-null - */ - public Map getOtherAttributes() { - return otherAttributes; - } - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/StartupSectionType.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/StartupSectionType.java deleted file mode 100644 index bff22575db43bc208bc7cc92591fc59cec8e1491..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/StartupSectionType.java +++ /dev/null @@ -1,388 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - - -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.ovf.envelope._1; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyAttribute; -import javax.xml.bind.annotation.XmlAnyElement; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; -import javax.xml.namespace.QName; -import org.w3c.dom.Element; - - -/** - * Specifies the order in which entities in a - * VirtualSystemCollection are powered on and shut down - * - *

Java class for StartupSection_Type complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="StartupSection_Type">
- *   <complexContent>
- *     <extension base="{http://schemas.dmtf.org/ovf/envelope/1}Section_Type">
- *       <sequence>
- *         <element name="Item" maxOccurs="unbounded" minOccurs="0">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                 <attribute name="order" use="required" type="{http://www.w3.org/2001/XMLSchema}unsignedShort" />
- *                 <attribute name="startDelay" type="{http://www.w3.org/2001/XMLSchema}unsignedShort" default="0" />
- *                 <attribute name="waitingForGuest" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
- *                 <attribute name="stopDelay" type="{http://www.w3.org/2001/XMLSchema}unsignedShort" default="0" />
- *                 <attribute name="startAction" type="{http://www.w3.org/2001/XMLSchema}string" default="powerOn" />
- *                 <attribute name="stopAction" type="{http://www.w3.org/2001/XMLSchema}string" default="powerOff" />
- *                 <anyAttribute processContents='lax'/>
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *         <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
- *       </sequence>
- *       <anyAttribute processContents='lax'/>
- *     </extension>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "StartupSection_Type", propOrder = { - "item", - "any" -}) -public class StartupSectionType - extends SectionType -{ - - @XmlElement(name = "Item") - protected List item; - @XmlAnyElement(lax = true) - protected List any; - - /** - * Gets the value of the item property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the item property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getItem().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link StartupSectionType.Item } - * - * - */ - public List getItem() { - if (item == null) { - item = new ArrayList(); - } - return this.item; - } - - /** - * Gets the value of the any property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the any property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getAny().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link Object } - * {@link Element } - * - * - */ - public List getAny() { - if (any == null) { - any = new ArrayList(); - } - return this.any; - } - - - /** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

-     * <complexType>
-     *   <complexContent>
-     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
-     *       <attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *       <attribute name="order" use="required" type="{http://www.w3.org/2001/XMLSchema}unsignedShort" />
-     *       <attribute name="startDelay" type="{http://www.w3.org/2001/XMLSchema}unsignedShort" default="0" />
-     *       <attribute name="waitingForGuest" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
-     *       <attribute name="stopDelay" type="{http://www.w3.org/2001/XMLSchema}unsignedShort" default="0" />
-     *       <attribute name="startAction" type="{http://www.w3.org/2001/XMLSchema}string" default="powerOn" />
-     *       <attribute name="stopAction" type="{http://www.w3.org/2001/XMLSchema}string" default="powerOff" />
-     *       <anyAttribute processContents='lax'/>
-     *     </restriction>
-     *   </complexContent>
-     * </complexType>
-     * 
- * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "") - public static class Item { - - @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/envelope/1", required = true) - protected String id; - @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/envelope/1", required = true) - @XmlSchemaType(name = "unsignedShort") - protected int order; - @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/envelope/1") - @XmlSchemaType(name = "unsignedShort") - protected Integer startDelay; - @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/envelope/1") - protected Boolean waitingForGuest; - @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/envelope/1") - @XmlSchemaType(name = "unsignedShort") - protected Integer stopDelay; - @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/envelope/1") - protected String startAction; - @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/envelope/1") - protected String stopAction; - @XmlAnyAttribute - private Map otherAttributes = new HashMap(); - - /** - * Gets the value of the id property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getId() { - return id; - } - - /** - * Sets the value of the id property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setId(String value) { - this.id = value; - } - - /** - * Gets the value of the order property. - * - */ - public int getOrder() { - return order; - } - - /** - * Sets the value of the order property. - * - */ - public void setOrder(int value) { - this.order = value; - } - - /** - * Gets the value of the startDelay property. - * - * @return - * possible object is - * {@link Integer } - * - */ - public int getStartDelay() { - if (startDelay == null) { - return 0; - } else { - return startDelay; - } - } - - /** - * Sets the value of the startDelay property. - * - * @param value - * allowed object is - * {@link Integer } - * - */ - public void setStartDelay(Integer value) { - this.startDelay = value; - } - - /** - * Gets the value of the waitingForGuest property. - * - * @return - * possible object is - * {@link Boolean } - * - */ - public boolean isWaitingForGuest() { - if (waitingForGuest == null) { - return false; - } else { - return waitingForGuest; - } - } - - /** - * Sets the value of the waitingForGuest property. - * - * @param value - * allowed object is - * {@link Boolean } - * - */ - public void setWaitingForGuest(Boolean value) { - this.waitingForGuest = value; - } - - /** - * Gets the value of the stopDelay property. - * - * @return - * possible object is - * {@link Integer } - * - */ - public int getStopDelay() { - if (stopDelay == null) { - return 0; - } else { - return stopDelay; - } - } - - /** - * Sets the value of the stopDelay property. - * - * @param value - * allowed object is - * {@link Integer } - * - */ - public void setStopDelay(Integer value) { - this.stopDelay = value; - } - - /** - * Gets the value of the startAction property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getStartAction() { - if (startAction == null) { - return "powerOn"; - } else { - return startAction; - } - } - - /** - * Sets the value of the startAction property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setStartAction(String value) { - this.startAction = value; - } - - /** - * Gets the value of the stopAction property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getStopAction() { - if (stopAction == null) { - return "powerOff"; - } else { - return stopAction; - } - } - - /** - * Sets the value of the stopAction property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setStopAction(String value) { - this.stopAction = value; - } - - /** - * Gets a map that contains attributes that aren't bound to any typed property on this class. - * - *

- * the map is keyed by the name of the attribute and - * the value is the string value of the attribute. - * - * the map returned by this method is live, and you can add new attribute - * by updating the map directly. Because of this design, there's no setter. - * - * - * @return - * always non-null - */ - public Map getOtherAttributes() { - return otherAttributes; - } - - } - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/StringsType.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/StringsType.java deleted file mode 100644 index 8ff9d2100b99928d0ef20cb82657836cfe2bdd59..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/StringsType.java +++ /dev/null @@ -1,271 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - - -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.ovf.envelope._1; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyAttribute; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.XmlValue; -import javax.xml.namespace.QName; - - -/** - * Type for string resource bundle - * - *

Java class for Strings_Type complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="Strings_Type">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="Msg" maxOccurs="unbounded" minOccurs="0">
- *           <complexType>
- *             <simpleContent>
- *               <extension base="<http://www.w3.org/2001/XMLSchema>string">
- *                 <attribute name="msgid" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                 <anyAttribute processContents='lax'/>
- *               </extension>
- *             </simpleContent>
- *           </complexType>
- *         </element>
- *       </sequence>
- *       <attribute ref="{http://www.w3.org/XML/1998/namespace}lang"/>
- *       <attribute name="fileRef" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <anyAttribute processContents='lax'/>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "Strings_Type", propOrder = { - "msg" -}) -public class StringsType { - - @XmlElement(name = "Msg") - protected List msg; - @XmlAttribute(namespace = "http://www.w3.org/XML/1998/namespace") - protected String lang; - @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/envelope/1") - protected String fileRef; - @XmlAnyAttribute - private Map otherAttributes = new HashMap(); - - /** - * Gets the value of the msg property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the msg property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getMsg().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link StringsType.Msg } - * - * - */ - public List getMsg() { - if (msg == null) { - msg = new ArrayList(); - } - return this.msg; - } - - /** - * Locale for this string resource - * bundle - * - * @return - * possible object is - * {@link String } - * - */ - public String getLang() { - return lang; - } - - /** - * Sets the value of the lang property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setLang(String value) { - this.lang = value; - } - - /** - * Gets the value of the fileRef property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getFileRef() { - return fileRef; - } - - /** - * Sets the value of the fileRef property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setFileRef(String value) { - this.fileRef = value; - } - - /** - * Gets a map that contains attributes that aren't bound to any typed property on this class. - * - *

- * the map is keyed by the name of the attribute and - * the value is the string value of the attribute. - * - * the map returned by this method is live, and you can add new attribute - * by updating the map directly. Because of this design, there's no setter. - * - * - * @return - * always non-null - */ - public Map getOtherAttributes() { - return otherAttributes; - } - - - /** - * String element value - * - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

-     * <complexType>
-     *   <simpleContent>
-     *     <extension base="<http://www.w3.org/2001/XMLSchema>string">
-     *       <attribute name="msgid" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *       <anyAttribute processContents='lax'/>
-     *     </extension>
-     *   </simpleContent>
-     * </complexType>
-     * 
- * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = { - "value" - }) - public static class Msg { - - @XmlValue - protected String value; - @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/envelope/1", required = true) - protected String msgid; - @XmlAnyAttribute - private Map otherAttributes = new HashMap(); - - /** - * Gets the value of the value property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getValue() { - return value; - } - - /** - * Sets the value of the value property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setValue(String value) { - this.value = value; - } - - /** - * Gets the value of the msgid property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getMsgid() { - return msgid; - } - - /** - * Sets the value of the msgid property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setMsgid(String value) { - this.msgid = value; - } - - /** - * Gets a map that contains attributes that aren't bound to any typed property on this class. - * - *

- * the map is keyed by the name of the attribute and - * the value is the string value of the attribute. - * - * the map returned by this method is live, and you can add new attribute - * by updating the map directly. Because of this design, there's no setter. - * - * - * @return - * always non-null - */ - public Map getOtherAttributes() { - return otherAttributes; - } - - } - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/VSSDType.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/VSSDType.java deleted file mode 100644 index 1ca11584aedd87e6f30c65cc1b65c10c41d84e2c..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/VSSDType.java +++ /dev/null @@ -1,45 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - - -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.ovf.envelope._1; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlType; - -import org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.cim_schema._2.cim_virtualsystemsettingdata.CIMVirtualSystemSettingDataType; - - -/** - * Wrapper for - * CIM_VirtualSystemSettingData_Type - * - *

Java class for VSSD_Type complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="VSSD_Type">
- *   <complexContent>
- *     <extension base="{http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData}CIM_VirtualSystemSettingData_Type">
- *       <anyAttribute processContents='lax'/>
- *     </extension>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "VSSD_Type") -public class VSSDType - extends CIMVirtualSystemSettingDataType -{ - - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/VirtualDiskDescType.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/VirtualDiskDescType.java deleted file mode 100644 index d2a48aa69c6dcaae642ed4500424f3e8bf081295..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/VirtualDiskDescType.java +++ /dev/null @@ -1,299 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - - -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.ovf.envelope._1; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyAttribute; -import javax.xml.bind.annotation.XmlAnyElement; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlType; -import javax.xml.namespace.QName; -import org.w3c.dom.Element; - - -/** - * Type for virtual disk descriptor - * - *

Java class for VirtualDiskDesc_Type complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="VirtualDiskDesc_Type">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
- *       </sequence>
- *       <attribute name="diskId" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="fileRef" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="capacity" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="capacityAllocationUnits" type="{http://www.w3.org/2001/XMLSchema}string" default="byte" />
- *       <attribute name="format" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="populatedSize" type="{http://www.w3.org/2001/XMLSchema}long" />
- *       <attribute name="parentRef" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <anyAttribute processContents='lax'/>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "VirtualDiskDesc_Type", propOrder = { - "any" -}) -public class VirtualDiskDescType { - - @XmlAnyElement(lax = true) - protected List any; - @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/envelope/1", required = true) - protected String diskId; - @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/envelope/1") - protected String fileRef; - @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/envelope/1", required = true) - protected String capacity; - @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/envelope/1") - protected String capacityAllocationUnits; - @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/envelope/1") - protected String format; - @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/envelope/1") - protected Long populatedSize; - @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/envelope/1") - protected String parentRef; - @XmlAnyAttribute - private Map otherAttributes = new HashMap(); - - /** - * Gets the value of the any property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the any property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getAny().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link Object } - * {@link Element } - * - * - */ - public List getAny() { - if (any == null) { - any = new ArrayList(); - } - return this.any; - } - - /** - * Gets the value of the diskId property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getDiskId() { - return diskId; - } - - /** - * Sets the value of the diskId property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setDiskId(String value) { - this.diskId = value; - } - - /** - * Gets the value of the fileRef property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getFileRef() { - return fileRef; - } - - /** - * Sets the value of the fileRef property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setFileRef(String value) { - this.fileRef = value; - } - - /** - * Gets the value of the capacity property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getCapacity() { - return capacity; - } - - /** - * Sets the value of the capacity property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setCapacity(String value) { - this.capacity = value; - } - - /** - * Gets the value of the capacityAllocationUnits property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getCapacityAllocationUnits() { - if (capacityAllocationUnits == null) { - return "byte"; - } else { - return capacityAllocationUnits; - } - } - - /** - * Sets the value of the capacityAllocationUnits property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setCapacityAllocationUnits(String value) { - this.capacityAllocationUnits = value; - } - - /** - * Gets the value of the format property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getFormat() { - return format; - } - - /** - * Sets the value of the format property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setFormat(String value) { - this.format = value; - } - - /** - * Gets the value of the populatedSize property. - * - * @return - * possible object is - * {@link Long } - * - */ - public Long getPopulatedSize() { - return populatedSize; - } - - /** - * Sets the value of the populatedSize property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setPopulatedSize(Long value) { - this.populatedSize = value; - } - - /** - * Gets the value of the parentRef property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getParentRef() { - return parentRef; - } - - /** - * Sets the value of the parentRef property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setParentRef(String value) { - this.parentRef = value; - } - - /** - * Gets a map that contains attributes that aren't bound to any typed property on this class. - * - *

- * the map is keyed by the name of the attribute and - * the value is the string value of the attribute. - * - * the map returned by this method is live, and you can add new attribute - * by updating the map directly. Because of this design, there's no setter. - * - * - * @return - * always non-null - */ - public Map getOtherAttributes() { - return otherAttributes; - } - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/VirtualHardwareSectionType.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/VirtualHardwareSectionType.java deleted file mode 100644 index 764babb199b85f6cbc1bf9d91d67402774182157..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/VirtualHardwareSectionType.java +++ /dev/null @@ -1,209 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - - -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.ovf.envelope._1; - -import java.util.ArrayList; -import java.util.List; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyElement; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; -import org.w3c.dom.Element; - - -/** - * Specifies virtual hardware requirements for a virtual - * machine - * - *

Java class for VirtualHardwareSection_Type complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="VirtualHardwareSection_Type">
- *   <complexContent>
- *     <extension base="{http://schemas.dmtf.org/ovf/envelope/1}Section_Type">
- *       <sequence>
- *         <element name="System" type="{http://schemas.dmtf.org/ovf/envelope/1}VSSD_Type" minOccurs="0"/>
- *         <element name="Item" type="{http://schemas.dmtf.org/ovf/envelope/1}RASD_Type" maxOccurs="unbounded" minOccurs="0"/>
- *         <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
- *       </sequence>
- *       <attribute name="id" type="{http://www.w3.org/2001/XMLSchema}string" default="" />
- *       <attribute ref="{http://schemas.dmtf.org/ovf/envelope/1}transport"/>
- *       <anyAttribute processContents='lax'/>
- *     </extension>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "VirtualHardwareSection_Type", propOrder = { - "system", - "item", - "any" -}) -public class VirtualHardwareSectionType - extends SectionType -{ - - @XmlElement(name = "System") - protected VSSDType system; - @XmlElement(name = "Item") - protected List item; - @XmlAnyElement(lax = true) - protected List any; - @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/envelope/1") - protected String id; - @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/envelope/1") - protected String transport; - - /** - * Gets the value of the system property. - * - * @return - * possible object is - * {@link VSSDType } - * - */ - public VSSDType getSystem() { - return system; - } - - /** - * Sets the value of the system property. - * - * @param value - * allowed object is - * {@link VSSDType } - * - */ - public void setSystem(VSSDType value) { - this.system = value; - } - - /** - * Gets the value of the item property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the item property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getItem().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link RASDType } - * - * - */ - public List getItem() { - if (item == null) { - item = new ArrayList(); - } - return this.item; - } - - /** - * Gets the value of the any property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the any property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getAny().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link Object } - * {@link Element } - * - * - */ - public List getAny() { - if (any == null) { - any = new ArrayList(); - } - return this.any; - } - - /** - * Gets the value of the id property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getId() { - if (id == null) { - return ""; - } else { - return id; - } - } - - /** - * Sets the value of the id property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setId(String value) { - this.id = value; - } - - /** - * Gets the value of the transport property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getTransport() { - if (transport == null) { - return ""; - } else { - return transport; - } - } - - /** - * Sets the value of the transport property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setTransport(String value) { - this.transport = value; - } - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/VirtualSystemCollectionType.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/VirtualSystemCollectionType.java deleted file mode 100644 index fec39791b4fbdc468b6d8ef546f70124be123f25..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/VirtualSystemCollectionType.java +++ /dev/null @@ -1,84 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - - -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.ovf.envelope._1; - -import java.util.ArrayList; -import java.util.List; -import javax.xml.bind.JAXBElement; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElementRef; -import javax.xml.bind.annotation.XmlType; - - -/** - * A collection of Content. - * - *

Java class for VirtualSystemCollection_Type complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="VirtualSystemCollection_Type">
- *   <complexContent>
- *     <extension base="{http://schemas.dmtf.org/ovf/envelope/1}Content_Type">
- *       <sequence>
- *         <element ref="{http://schemas.dmtf.org/ovf/envelope/1}Content" maxOccurs="unbounded" minOccurs="0"/>
- *       </sequence>
- *       <anyAttribute processContents='lax'/>
- *     </extension>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "VirtualSystemCollection_Type", propOrder = { - "content" -}) -public class VirtualSystemCollectionType - extends ContentType -{ - - @XmlElementRef(name = "Content", namespace = "http://schemas.dmtf.org/ovf/envelope/1", type = JAXBElement.class) - protected List> content; - - /** - * Gets the value of the content property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the content property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getContent().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link JAXBElement }{@code <}{@link VirtualSystemType }{@code >} - * {@link JAXBElement }{@code <}{@link ContentType }{@code >} - * {@link JAXBElement }{@code <}{@link VirtualSystemCollectionType }{@code >} - * - * - */ - public List> getContent() { - if (content == null) { - content = new ArrayList>(); - } - return this.content; - } - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/VirtualSystemType.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/VirtualSystemType.java deleted file mode 100644 index d4c14ca68927a8bb375cd26a8f37f21322034bd1..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/VirtualSystemType.java +++ /dev/null @@ -1,42 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - - -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.ovf.envelope._1; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlType; - - -/** - * Content describing a virtual system - * - *

Java class for VirtualSystem_Type complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="VirtualSystem_Type">
- *   <complexContent>
- *     <extension base="{http://schemas.dmtf.org/ovf/envelope/1}Content_Type">
- *       <anyAttribute processContents='lax'/>
- *     </extension>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "VirtualSystem_Type") -public class VirtualSystemType - extends ContentType -{ - - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/package-info.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/package-info.java deleted file mode 100644 index 791cd4e1489f05bf98dc9e1d22e1102e14c33556..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/envelope/_1/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - -@javax.xml.bind.annotation.XmlSchema(namespace = "http://schemas.dmtf.org/ovf/envelope/1", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.ovf.envelope._1; diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/environment/_1/EntityType.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/environment/_1/EntityType.java deleted file mode 100644 index 28600f95453d53db469e3b77baa2ec91ff64dc87..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/environment/_1/EntityType.java +++ /dev/null @@ -1,171 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - - -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.ovf.environment._1; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import javax.xml.bind.JAXBElement; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyAttribute; -import javax.xml.bind.annotation.XmlAnyElement; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElementRef; -import javax.xml.bind.annotation.XmlType; -import javax.xml.namespace.QName; -import org.w3c.dom.Element; - - -/** - * Container of sections for a specific entity - * - * - *

Java class for Entity_Type complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="Entity_Type">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element ref="{http://schemas.dmtf.org/ovf/environment/1}Section" maxOccurs="unbounded" minOccurs="0"/>
- *         <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
- *       </sequence>
- *       <attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <anyAttribute processContents='lax'/>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "Entity_Type", propOrder = { - "section", - "any" -}) -public class EntityType { - - @XmlElementRef(name = "Section", namespace = "http://schemas.dmtf.org/ovf/environment/1", type = JAXBElement.class) - protected List> section; - @XmlAnyElement(lax = true) - protected List any; - @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/environment/1", required = true) - protected String id; - @XmlAnyAttribute - private Map otherAttributes = new HashMap(); - - /** - * Gets the value of the section property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the section property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getSection().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link JAXBElement }{@code <}{@link SectionType }{@code >} - * {@link JAXBElement }{@code <}{@link PropertySectionType }{@code >} - * {@link JAXBElement }{@code <}{@link PlatformSectionType }{@code >} - * - * - */ - public List> getSection() { - if (section == null) { - section = new ArrayList>(); - } - return this.section; - } - - /** - * Gets the value of the any property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the any property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getAny().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link Object } - * {@link Element } - * - * - */ - public List getAny() { - if (any == null) { - any = new ArrayList(); - } - return this.any; - } - - /** - * Gets the value of the id property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getId() { - return id; - } - - /** - * Sets the value of the id property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setId(String value) { - this.id = value; - } - - /** - * Gets a map that contains attributes that aren't bound to any typed property on this class. - * - *

- * the map is keyed by the name of the attribute and - * the value is the string value of the attribute. - * - * the map returned by this method is live, and you can add new attribute - * by updating the map directly. Because of this design, there's no setter. - * - * - * @return - * always non-null - */ - public Map getOtherAttributes() { - return otherAttributes; - } - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/environment/_1/EnvironmentType.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/environment/_1/EnvironmentType.java deleted file mode 100644 index 8263846a90207cd395a9740933441d7af1d2d6d2..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/environment/_1/EnvironmentType.java +++ /dev/null @@ -1,209 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - - -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.ovf.environment._1; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import javax.xml.bind.JAXBElement; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyAttribute; -import javax.xml.bind.annotation.XmlAnyElement; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementRef; -import javax.xml.bind.annotation.XmlType; -import javax.xml.namespace.QName; -import org.w3c.dom.Element; - - -/** - * Type for root OVF environment - * - *

Java class for Environment_Type complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="Environment_Type">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element ref="{http://schemas.dmtf.org/ovf/environment/1}Section" maxOccurs="unbounded" minOccurs="0"/>
- *         <element name="Entity" type="{http://schemas.dmtf.org/ovf/environment/1}Entity_Type" maxOccurs="unbounded" minOccurs="0"/>
- *         <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
- *       </sequence>
- *       <attribute name="id" type="{http://www.w3.org/2001/XMLSchema}string" default="" />
- *       <anyAttribute processContents='lax'/>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "Environment_Type", propOrder = { - "section", - "entity", - "any" -}) -public class EnvironmentType { - - @XmlElementRef(name = "Section", namespace = "http://schemas.dmtf.org/ovf/environment/1", type = JAXBElement.class) - protected List> section; - @XmlElement(name = "Entity") - protected List entity; - @XmlAnyElement(lax = true) - protected List any; - @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/environment/1") - protected String id; - @XmlAnyAttribute - private Map otherAttributes = new HashMap(); - - /** - * Entity independent meta-data - * sections Gets the value of the section property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the section property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getSection().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link JAXBElement }{@code <}{@link SectionType }{@code >} - * {@link JAXBElement }{@code <}{@link PropertySectionType }{@code >} - * {@link JAXBElement }{@code <}{@link PlatformSectionType }{@code >} - * - * - */ - public List> getSection() { - if (section == null) { - section = new ArrayList>(); - } - return this.section; - } - - /** - * Gets the value of the entity property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the entity property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getEntity().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link EntityType } - * - * - */ - public List getEntity() { - if (entity == null) { - entity = new ArrayList(); - } - return this.entity; - } - - /** - * Gets the value of the any property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the any property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getAny().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link Object } - * {@link Element } - * - * - */ - public List getAny() { - if (any == null) { - any = new ArrayList(); - } - return this.any; - } - - /** - * Gets the value of the id property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getId() { - if (id == null) { - return ""; - } else { - return id; - } - } - - /** - * Sets the value of the id property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setId(String value) { - this.id = value; - } - - /** - * Gets a map that contains attributes that aren't bound to any typed property on this class. - * - *

- * the map is keyed by the name of the attribute and - * the value is the string value of the attribute. - * - * the map returned by this method is live, and you can add new attribute - * by updating the map directly. Because of this design, there's no setter. - * - * - * @return - * always non-null - */ - public Map getOtherAttributes() { - return otherAttributes; - } - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/environment/_1/ObjectFactory.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/environment/_1/ObjectFactory.java deleted file mode 100644 index adfe4390389d73f1a11b36c22e7e8671539f9622..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/environment/_1/ObjectFactory.java +++ /dev/null @@ -1,122 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - - -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.ovf.environment._1; - -import javax.xml.bind.JAXBElement; -import javax.xml.bind.annotation.XmlElementDecl; -import javax.xml.bind.annotation.XmlRegistry; -import javax.xml.namespace.QName; - - -/** - * This object contains factory methods for each - * Java content interface and Java element interface - * generated in the org.ow2.contrail.federation.application.ovf.dmtf.schemas.ovf.environment._1 package. - *

An ObjectFactory allows you to programatically - * construct new instances of the Java representation - * for XML content. The Java representation of XML - * content can consist of schema derived interfaces - * and classes representing the binding of schema - * type definitions, element declarations and model - * groups. Factory methods for each of these are - * provided in this class. - * - */ -@XmlRegistry -public class ObjectFactory { - - private final static QName _PropertySection_QNAME = new QName("http://schemas.dmtf.org/ovf/environment/1", "PropertySection"); - private final static QName _PlatformSection_QNAME = new QName("http://schemas.dmtf.org/ovf/environment/1", "PlatformSection"); - private final static QName _Environment_QNAME = new QName("http://schemas.dmtf.org/ovf/environment/1", "Environment"); - private final static QName _Section_QNAME = new QName("http://schemas.dmtf.org/ovf/environment/1", "Section"); - - /** - * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.ow2.contrail.federation.application.ovf.dmtf.schemas.ovf.environment._1 - * - */ - public ObjectFactory() { - } - - /** - * Create an instance of {@link EnvironmentType } - * - */ - public EnvironmentType createEnvironmentType() { - return new EnvironmentType(); - } - - /** - * Create an instance of {@link EntityType } - * - */ - public EntityType createEntityType() { - return new EntityType(); - } - - /** - * Create an instance of {@link PropertySectionType.Property } - * - */ - public PropertySectionType.Property createPropertySectionTypeProperty() { - return new PropertySectionType.Property(); - } - - /** - * Create an instance of {@link PlatformSectionType } - * - */ - public PlatformSectionType createPlatformSectionType() { - return new PlatformSectionType(); - } - - /** - * Create an instance of {@link PropertySectionType } - * - */ - public PropertySectionType createPropertySectionType() { - return new PropertySectionType(); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link PropertySectionType }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/ovf/environment/1", name = "PropertySection", substitutionHeadNamespace = "http://schemas.dmtf.org/ovf/environment/1", substitutionHeadName = "Section") - public JAXBElement createPropertySection(PropertySectionType value) { - return new JAXBElement(_PropertySection_QNAME, PropertySectionType.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link PlatformSectionType }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/ovf/environment/1", name = "PlatformSection", substitutionHeadNamespace = "http://schemas.dmtf.org/ovf/environment/1", substitutionHeadName = "Section") - public JAXBElement createPlatformSection(PlatformSectionType value) { - return new JAXBElement(_PlatformSection_QNAME, PlatformSectionType.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link EnvironmentType }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/ovf/environment/1", name = "Environment") - public JAXBElement createEnvironment(EnvironmentType value) { - return new JAXBElement(_Environment_QNAME, EnvironmentType.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link SectionType }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/ovf/environment/1", name = "Section") - public JAXBElement createSection(SectionType value) { - return new JAXBElement(_Section_QNAME, SectionType.class, null, value); - } - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/environment/_1/PlatformSectionType.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/environment/_1/PlatformSectionType.java deleted file mode 100644 index fce2f0a2610dc8b58d7aa38debd99fdca3c5ddcd..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/environment/_1/PlatformSectionType.java +++ /dev/null @@ -1,226 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - - -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.ovf.environment._1; - -import java.util.ArrayList; -import java.util.List; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyElement; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - -import org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.common.CimString; -import org.w3c.dom.Element; - - -/** - * Information about deployment platform - * - *

Java class for PlatformSection_Type complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="PlatformSection_Type">
- *   <complexContent>
- *     <extension base="{http://schemas.dmtf.org/ovf/environment/1}Section_Type">
- *       <sequence>
- *         <element name="Kind" type="{http://schemas.dmtf.org/wbem/wscim/1/common}cimString" minOccurs="0"/>
- *         <element name="Version" type="{http://schemas.dmtf.org/wbem/wscim/1/common}cimString" minOccurs="0"/>
- *         <element name="Vendor" type="{http://schemas.dmtf.org/wbem/wscim/1/common}cimString" minOccurs="0"/>
- *         <element name="Locale" type="{http://schemas.dmtf.org/wbem/wscim/1/common}cimString" minOccurs="0"/>
- *         <element name="Timezone" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
- *         <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
- *       </sequence>
- *       <anyAttribute processContents='lax'/>
- *     </extension>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "PlatformSection_Type", propOrder = { - "kind", - "version", - "vendor", - "locale", - "timezone", - "any" -}) -public class PlatformSectionType - extends SectionType -{ - - @XmlElement(name = "Kind") - protected CimString kind; - @XmlElement(name = "Version") - protected CimString version; - @XmlElement(name = "Vendor") - protected CimString vendor; - @XmlElement(name = "Locale") - protected CimString locale; - @XmlElement(name = "Timezone") - protected Integer timezone; - @XmlAnyElement(lax = true) - protected List any; - - /** - * Gets the value of the kind property. - * - * @return - * possible object is - * {@link CimString } - * - */ - public CimString getKind() { - return kind; - } - - /** - * Sets the value of the kind property. - * - * @param value - * allowed object is - * {@link CimString } - * - */ - public void setKind(CimString value) { - this.kind = value; - } - - /** - * Gets the value of the version property. - * - * @return - * possible object is - * {@link CimString } - * - */ - public CimString getVersion() { - return version; - } - - /** - * Sets the value of the version property. - * - * @param value - * allowed object is - * {@link CimString } - * - */ - public void setVersion(CimString value) { - this.version = value; - } - - /** - * Gets the value of the vendor property. - * - * @return - * possible object is - * {@link CimString } - * - */ - public CimString getVendor() { - return vendor; - } - - /** - * Sets the value of the vendor property. - * - * @param value - * allowed object is - * {@link CimString } - * - */ - public void setVendor(CimString value) { - this.vendor = value; - } - - /** - * Gets the value of the locale property. - * - * @return - * possible object is - * {@link CimString } - * - */ - public CimString getLocale() { - return locale; - } - - /** - * Sets the value of the locale property. - * - * @param value - * allowed object is - * {@link CimString } - * - */ - public void setLocale(CimString value) { - this.locale = value; - } - - /** - * Gets the value of the timezone property. - * - * @return - * possible object is - * {@link Integer } - * - */ - public Integer getTimezone() { - return timezone; - } - - /** - * Sets the value of the timezone property. - * - * @param value - * allowed object is - * {@link Integer } - * - */ - public void setTimezone(Integer value) { - this.timezone = value; - } - - /** - * Gets the value of the any property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the any property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getAny().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link Object } - * {@link Element } - * - * - */ - public List getAny() { - if (any == null) { - any = new ArrayList(); - } - return this.any; - } - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/environment/_1/PropertySectionType.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/environment/_1/PropertySectionType.java deleted file mode 100644 index 6e8b966c4de4cdccfc3077b909f214e55a6b8e7f..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/environment/_1/PropertySectionType.java +++ /dev/null @@ -1,232 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - - -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.ovf.environment._1; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyAttribute; -import javax.xml.bind.annotation.XmlAnyElement; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; -import javax.xml.namespace.QName; -import org.w3c.dom.Element; - - -/** - * Key/value pairs of assigned properties for an - * entity - * - *

Java class for PropertySection_Type complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="PropertySection_Type">
- *   <complexContent>
- *     <extension base="{http://schemas.dmtf.org/ovf/environment/1}Section_Type">
- *       <sequence>
- *         <element name="Property" maxOccurs="unbounded" minOccurs="0">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <attribute name="key" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                 <attribute name="value" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                 <anyAttribute processContents='lax'/>
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *         <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
- *       </sequence>
- *       <anyAttribute processContents='lax'/>
- *     </extension>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "PropertySection_Type", propOrder = { - "property", - "any" -}) -public class PropertySectionType - extends SectionType -{ - - @XmlElement(name = "Property") - protected List property; - @XmlAnyElement(lax = true) - protected List any; - - /** - * Gets the value of the property property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the property property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getProperty().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link PropertySectionType.Property } - * - * - */ - public List getProperty() { - if (property == null) { - property = new ArrayList(); - } - return this.property; - } - - /** - * Gets the value of the any property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the any property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getAny().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link Object } - * {@link Element } - * - * - */ - public List getAny() { - if (any == null) { - any = new ArrayList(); - } - return this.any; - } - - - /** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

-     * <complexType>
-     *   <complexContent>
-     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
-     *       <attribute name="key" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *       <attribute name="value" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *       <anyAttribute processContents='lax'/>
-     *     </restriction>
-     *   </complexContent>
-     * </complexType>
-     * 
- * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "") - public static class Property { - - @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/environment/1", required = true) - protected String key; - @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/environment/1", required = true) - protected String value; - @XmlAnyAttribute - private Map otherAttributes = new HashMap(); - - /** - * Gets the value of the key property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getKey() { - return key; - } - - /** - * Sets the value of the key property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setKey(String value) { - this.key = value; - } - - /** - * Gets the value of the value property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getValue() { - return value; - } - - /** - * Sets the value of the value property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setValue(String value) { - this.value = value; - } - - /** - * Gets a map that contains attributes that aren't bound to any typed property on this class. - * - *

- * the map is keyed by the name of the attribute and - * the value is the string value of the attribute. - * - * the map returned by this method is live, and you can add new attribute - * by updating the map directly. Because of this design, there's no setter. - * - * - * @return - * always non-null - */ - public Map getOtherAttributes() { - return otherAttributes; - } - - } - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/environment/_1/SectionType.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/environment/_1/SectionType.java deleted file mode 100644 index 1769ea4425fdc37094d285993192eb6d9c3effc8..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/environment/_1/SectionType.java +++ /dev/null @@ -1,70 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - - -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.ovf.environment._1; - -import java.util.HashMap; -import java.util.Map; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyAttribute; -import javax.xml.bind.annotation.XmlSeeAlso; -import javax.xml.bind.annotation.XmlType; -import javax.xml.namespace.QName; - - -/** - * Abstract type for all sections in - * environment - * - *

Java class for Section_Type complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="Section_Type">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <anyAttribute processContents='lax'/>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "Section_Type") -@XmlSeeAlso({ - PlatformSectionType.class, - PropertySectionType.class -}) -public abstract class SectionType { - - @XmlAnyAttribute - private Map otherAttributes = new HashMap(); - - /** - * Gets a map that contains attributes that aren't bound to any typed property on this class. - * - *

- * the map is keyed by the name of the attribute and - * the value is the string value of the attribute. - * - * the map returned by this method is live, and you can add new attribute - * by updating the map directly. Because of this design, there's no setter. - * - * - * @return - * always non-null - */ - public Map getOtherAttributes() { - return otherAttributes; - } - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/environment/_1/package-info.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/environment/_1/package-info.java deleted file mode 100644 index faa76a1a93771528b49d33b405d8c9882d5db106..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/ovf/environment/_1/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - -@javax.xml.bind.annotation.XmlSchema(namespace = "http://schemas.dmtf.org/ovf/environment/1", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.ovf.environment._1; diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/cim_schema/_2/cim_resourceallocationsettingdata/CIMResourceAllocationSettingDataType.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/cim_schema/_2/cim_resourceallocationsettingdata/CIMResourceAllocationSettingDataType.java deleted file mode 100644 index d4378c437421d278982a0b5a9c6db2a085ee2453..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/cim_schema/_2/cim_resourceallocationsettingdata/CIMResourceAllocationSettingDataType.java +++ /dev/null @@ -1,768 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - - -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.cim_schema._2.cim_resourceallocationsettingdata; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyAttribute; -import javax.xml.bind.annotation.XmlAnyElement; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlSeeAlso; -import javax.xml.bind.annotation.XmlType; -import javax.xml.namespace.QName; - -import org.ow2.contrail.federation.application.ovf.dmtf.schemas.ovf.envelope._1.RASDType; -import org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.common.CimBoolean; -import org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.common.CimString; -import org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.common.CimUnsignedInt; -import org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.common.CimUnsignedLong; -import org.w3c.dom.Element; - - -/** - *

Java class for CIM_ResourceAllocationSettingData_Type complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="CIM_ResourceAllocationSettingData_Type">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element ref="{http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData}Address" minOccurs="0"/>
- *         <element ref="{http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData}AddressOnParent" minOccurs="0"/>
- *         <element ref="{http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData}AllocationUnits" minOccurs="0"/>
- *         <element ref="{http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData}AutomaticAllocation" minOccurs="0"/>
- *         <element ref="{http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData}AutomaticDeallocation" minOccurs="0"/>
- *         <element ref="{http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData}Caption" minOccurs="0"/>
- *         <element ref="{http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData}Connection" maxOccurs="unbounded" minOccurs="0"/>
- *         <element ref="{http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData}ConsumerVisibility" minOccurs="0"/>
- *         <element ref="{http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData}Description" minOccurs="0"/>
- *         <element ref="{http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData}ElementName"/>
- *         <element ref="{http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData}HostResource" maxOccurs="unbounded" minOccurs="0"/>
- *         <element ref="{http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData}InstanceID"/>
- *         <element ref="{http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData}Limit" minOccurs="0"/>
- *         <element ref="{http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData}MappingBehavior" minOccurs="0"/>
- *         <element ref="{http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData}OtherResourceType" minOccurs="0"/>
- *         <element ref="{http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData}Parent" minOccurs="0"/>
- *         <element ref="{http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData}PoolID" minOccurs="0"/>
- *         <element ref="{http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData}Reservation" minOccurs="0"/>
- *         <element ref="{http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData}ResourceSubType" minOccurs="0"/>
- *         <element ref="{http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData}ResourceType" minOccurs="0"/>
- *         <element ref="{http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData}VirtualQuantity" minOccurs="0"/>
- *         <element ref="{http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData}VirtualQuantityUnits" minOccurs="0"/>
- *         <element ref="{http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData}Weight" minOccurs="0"/>
- *         <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
- *       </sequence>
- *       <anyAttribute processContents='lax'/>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "CIM_ResourceAllocationSettingData_Type", propOrder = { - "address", - "addressOnParent", - "allocationUnits", - "automaticAllocation", - "automaticDeallocation", - "caption", - "connection", - "consumerVisibility", - "description", - "elementName", - "hostResource", - "instanceID", - "limit", - "mappingBehavior", - "otherResourceType", - "parent", - "poolID", - "reservation", - "resourceSubType", - "resourceType", - "virtualQuantity", - "virtualQuantityUnits", - "weight", - "any" -}) -@XmlSeeAlso({ - RASDType.class -}) -public class CIMResourceAllocationSettingDataType { - - @XmlElement(name = "Address", nillable = true) - protected CimString address; - @XmlElement(name = "AddressOnParent", nillable = true) - protected CimString addressOnParent; - @XmlElement(name = "AllocationUnits", nillable = true) - protected CimString allocationUnits; - @XmlElement(name = "AutomaticAllocation", nillable = true) - protected CimBoolean automaticAllocation; - @XmlElement(name = "AutomaticDeallocation", nillable = true) - protected CimBoolean automaticDeallocation; - @XmlElement(name = "Caption", nillable = true) - protected Caption caption; - @XmlElement(name = "Connection", nillable = true) - protected List connection; - @XmlElement(name = "ConsumerVisibility", nillable = true) - protected ConsumerVisibility consumerVisibility; - @XmlElement(name = "Description", nillable = true) - protected CimString description; - @XmlElement(name = "ElementName", required = true) - protected CimString elementName; - @XmlElement(name = "HostResource", nillable = true) - protected List hostResource; - @XmlElement(name = "InstanceID", required = true) - protected CimString instanceID; - @XmlElement(name = "Limit", nillable = true) - protected CimUnsignedLong limit; - @XmlElement(name = "MappingBehavior", nillable = true) - protected MappingBehavior mappingBehavior; - @XmlElement(name = "OtherResourceType", nillable = true) - protected CimString otherResourceType; - @XmlElement(name = "Parent", nillable = true) - protected CimString parent; - @XmlElement(name = "PoolID", nillable = true) - protected CimString poolID; - @XmlElement(name = "Reservation", nillable = true) - protected CimUnsignedLong reservation; - @XmlElement(name = "ResourceSubType", nillable = true) - protected CimString resourceSubType; - @XmlElement(name = "ResourceType", nillable = true) - protected ResourceType resourceType; - @XmlElement(name = "VirtualQuantity", nillable = true) - protected CimUnsignedLong virtualQuantity; - @XmlElement(name = "VirtualQuantityUnits", nillable = true) - protected CimString virtualQuantityUnits; - @XmlElement(name = "Weight", nillable = true) - protected CimUnsignedInt weight; - @XmlAnyElement(lax = true) - protected List any; - @XmlAnyAttribute - private Map otherAttributes = new HashMap(); - - /** - * Gets the value of the address property. - * - * @return - * possible object is - * {@link CimString } - * - */ - public CimString getAddress() { - return address; - } - - /** - * Sets the value of the address property. - * - * @param value - * allowed object is - * {@link CimString } - * - */ - public void setAddress(CimString value) { - this.address = value; - } - - /** - * Gets the value of the addressOnParent property. - * - * @return - * possible object is - * {@link CimString } - * - */ - public CimString getAddressOnParent() { - return addressOnParent; - } - - /** - * Sets the value of the addressOnParent property. - * - * @param value - * allowed object is - * {@link CimString } - * - */ - public void setAddressOnParent(CimString value) { - this.addressOnParent = value; - } - - /** - * Gets the value of the allocationUnits property. - * - * @return - * possible object is - * {@link CimString } - * - */ - public CimString getAllocationUnits() { - return allocationUnits; - } - - /** - * Sets the value of the allocationUnits property. - * - * @param value - * allowed object is - * {@link CimString } - * - */ - public void setAllocationUnits(CimString value) { - this.allocationUnits = value; - } - - /** - * Gets the value of the automaticAllocation property. - * - * @return - * possible object is - * {@link CimBoolean } - * - */ - public CimBoolean getAutomaticAllocation() { - return automaticAllocation; - } - - /** - * Sets the value of the automaticAllocation property. - * - * @param value - * allowed object is - * {@link CimBoolean } - * - */ - public void setAutomaticAllocation(CimBoolean value) { - this.automaticAllocation = value; - } - - /** - * Gets the value of the automaticDeallocation property. - * - * @return - * possible object is - * {@link CimBoolean } - * - */ - public CimBoolean getAutomaticDeallocation() { - return automaticDeallocation; - } - - /** - * Sets the value of the automaticDeallocation property. - * - * @param value - * allowed object is - * {@link CimBoolean } - * - */ - public void setAutomaticDeallocation(CimBoolean value) { - this.automaticDeallocation = value; - } - - /** - * Gets the value of the caption property. - * - * @return - * possible object is - * {@link Caption } - * - */ - public Caption getCaption() { - return caption; - } - - /** - * Sets the value of the caption property. - * - * @param value - * allowed object is - * {@link Caption } - * - */ - public void setCaption(Caption value) { - this.caption = value; - } - - /** - * Gets the value of the connection property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the connection property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getConnection().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link CimString } - * - * - */ - public List getConnection() { - if (connection == null) { - connection = new ArrayList(); - } - return this.connection; - } - - /** - * Gets the value of the consumerVisibility property. - * - * @return - * possible object is - * {@link ConsumerVisibility } - * - */ - public ConsumerVisibility getConsumerVisibility() { - return consumerVisibility; - } - - /** - * Sets the value of the consumerVisibility property. - * - * @param value - * allowed object is - * {@link ConsumerVisibility } - * - */ - public void setConsumerVisibility(ConsumerVisibility value) { - this.consumerVisibility = value; - } - - /** - * Gets the value of the description property. - * - * @return - * possible object is - * {@link CimString } - * - */ - public CimString getDescription() { - return description; - } - - /** - * Sets the value of the description property. - * - * @param value - * allowed object is - * {@link CimString } - * - */ - public void setDescription(CimString value) { - this.description = value; - } - - /** - * Gets the value of the elementName property. - * - * @return - * possible object is - * {@link CimString } - * - */ - public CimString getElementName() { - return elementName; - } - - /** - * Sets the value of the elementName property. - * - * @param value - * allowed object is - * {@link CimString } - * - */ - public void setElementName(CimString value) { - this.elementName = value; - } - - /** - * Gets the value of the hostResource property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the hostResource property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getHostResource().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link CimString } - * - * - */ - public List getHostResource() { - if (hostResource == null) { - hostResource = new ArrayList(); - } - return this.hostResource; - } - - /** - * Gets the value of the instanceID property. - * - * @return - * possible object is - * {@link CimString } - * - */ - public CimString getInstanceID() { - return instanceID; - } - - /** - * Sets the value of the instanceID property. - * - * @param value - * allowed object is - * {@link CimString } - * - */ - public void setInstanceID(CimString value) { - this.instanceID = value; - } - - /** - * Gets the value of the limit property. - * - * @return - * possible object is - * {@link CimUnsignedLong } - * - */ - public CimUnsignedLong getLimit() { - return limit; - } - - /** - * Sets the value of the limit property. - * - * @param value - * allowed object is - * {@link CimUnsignedLong } - * - */ - public void setLimit(CimUnsignedLong value) { - this.limit = value; - } - - /** - * Gets the value of the mappingBehavior property. - * - * @return - * possible object is - * {@link MappingBehavior } - * - */ - public MappingBehavior getMappingBehavior() { - return mappingBehavior; - } - - /** - * Sets the value of the mappingBehavior property. - * - * @param value - * allowed object is - * {@link MappingBehavior } - * - */ - public void setMappingBehavior(MappingBehavior value) { - this.mappingBehavior = value; - } - - /** - * Gets the value of the otherResourceType property. - * - * @return - * possible object is - * {@link CimString } - * - */ - public CimString getOtherResourceType() { - return otherResourceType; - } - - /** - * Sets the value of the otherResourceType property. - * - * @param value - * allowed object is - * {@link CimString } - * - */ - public void setOtherResourceType(CimString value) { - this.otherResourceType = value; - } - - /** - * Gets the value of the parent property. - * - * @return - * possible object is - * {@link CimString } - * - */ - public CimString getParent() { - return parent; - } - - /** - * Sets the value of the parent property. - * - * @param value - * allowed object is - * {@link CimString } - * - */ - public void setParent(CimString value) { - this.parent = value; - } - - /** - * Gets the value of the poolID property. - * - * @return - * possible object is - * {@link CimString } - * - */ - public CimString getPoolID() { - return poolID; - } - - /** - * Sets the value of the poolID property. - * - * @param value - * allowed object is - * {@link CimString } - * - */ - public void setPoolID(CimString value) { - this.poolID = value; - } - - /** - * Gets the value of the reservation property. - * - * @return - * possible object is - * {@link CimUnsignedLong } - * - */ - public CimUnsignedLong getReservation() { - return reservation; - } - - /** - * Sets the value of the reservation property. - * - * @param value - * allowed object is - * {@link CimUnsignedLong } - * - */ - public void setReservation(CimUnsignedLong value) { - this.reservation = value; - } - - /** - * Gets the value of the resourceSubType property. - * - * @return - * possible object is - * {@link CimString } - * - */ - public CimString getResourceSubType() { - return resourceSubType; - } - - /** - * Sets the value of the resourceSubType property. - * - * @param value - * allowed object is - * {@link CimString } - * - */ - public void setResourceSubType(CimString value) { - this.resourceSubType = value; - } - - /** - * Gets the value of the resourceType property. - * - * @return - * possible object is - * {@link ResourceType } - * - */ - public ResourceType getResourceType() { - return resourceType; - } - - /** - * Sets the value of the resourceType property. - * - * @param value - * allowed object is - * {@link ResourceType } - * - */ - public void setResourceType(ResourceType value) { - this.resourceType = value; - } - - /** - * Gets the value of the virtualQuantity property. - * - * @return - * possible object is - * {@link CimUnsignedLong } - * - */ - public CimUnsignedLong getVirtualQuantity() { - return virtualQuantity; - } - - /** - * Sets the value of the virtualQuantity property. - * - * @param value - * allowed object is - * {@link CimUnsignedLong } - * - */ - public void setVirtualQuantity(CimUnsignedLong value) { - this.virtualQuantity = value; - } - - /** - * Gets the value of the virtualQuantityUnits property. - * - * @return - * possible object is - * {@link CimString } - * - */ - public CimString getVirtualQuantityUnits() { - return virtualQuantityUnits; - } - - /** - * Sets the value of the virtualQuantityUnits property. - * - * @param value - * allowed object is - * {@link CimString } - * - */ - public void setVirtualQuantityUnits(CimString value) { - this.virtualQuantityUnits = value; - } - - /** - * Gets the value of the weight property. - * - * @return - * possible object is - * {@link CimUnsignedInt } - * - */ - public CimUnsignedInt getWeight() { - return weight; - } - - /** - * Sets the value of the weight property. - * - * @param value - * allowed object is - * {@link CimUnsignedInt } - * - */ - public void setWeight(CimUnsignedInt value) { - this.weight = value; - } - - /** - * Gets the value of the any property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the any property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getAny().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link Object } - * {@link Element } - * - * - */ - public List getAny() { - if (any == null) { - any = new ArrayList(); - } - return this.any; - } - - /** - * Gets a map that contains attributes that aren't bound to any typed property on this class. - * - *

- * the map is keyed by the name of the attribute and - * the value is the string value of the attribute. - * - * the map returned by this method is live, and you can add new attribute - * by updating the map directly. Because of this design, there's no setter. - * - * - * @return - * always non-null - */ - public Map getOtherAttributes() { - return otherAttributes; - } - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/cim_schema/_2/cim_resourceallocationsettingdata/Caption.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/cim_schema/_2/cim_resourceallocationsettingdata/Caption.java deleted file mode 100644 index 9acb7c756f60d884fd690daae58e1904a4c6840d..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/cim_schema/_2/cim_resourceallocationsettingdata/Caption.java +++ /dev/null @@ -1,42 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - - -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.cim_schema._2.cim_resourceallocationsettingdata; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlType; - -import org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.common.CimString; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <simpleContent>
- *     <restriction base="<http://schemas.dmtf.org/wbem/wscim/1/common>cimString">
- *       <anyAttribute processContents='lax'/>
- *     </restriction>
- *   </simpleContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "") -public class Caption - extends CimString -{ - - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/cim_schema/_2/cim_resourceallocationsettingdata/ConsumerVisibility.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/cim_schema/_2/cim_resourceallocationsettingdata/ConsumerVisibility.java deleted file mode 100644 index 03d465a87ad4a661501e157e6838066760948da5..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/cim_schema/_2/cim_resourceallocationsettingdata/ConsumerVisibility.java +++ /dev/null @@ -1,42 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - - -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.cim_schema._2.cim_resourceallocationsettingdata; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlType; - -import org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.common.CimAnySimpleType; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <simpleContent>
- *     <restriction base="<http://schemas.dmtf.org/wbem/wscim/1/common>cimAnySimpleType">
- *       <anyAttribute processContents='lax'/>
- *     </restriction>
- *   </simpleContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "") -public class ConsumerVisibility - extends CimAnySimpleType -{ - - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/cim_schema/_2/cim_resourceallocationsettingdata/MappingBehavior.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/cim_schema/_2/cim_resourceallocationsettingdata/MappingBehavior.java deleted file mode 100644 index ddd6d38a2d37fae4d416b13cb370a2dc810aafcb..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/cim_schema/_2/cim_resourceallocationsettingdata/MappingBehavior.java +++ /dev/null @@ -1,42 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - - -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.cim_schema._2.cim_resourceallocationsettingdata; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlType; - -import org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.common.CimAnySimpleType; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <simpleContent>
- *     <restriction base="<http://schemas.dmtf.org/wbem/wscim/1/common>cimAnySimpleType">
- *       <anyAttribute processContents='lax'/>
- *     </restriction>
- *   </simpleContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "") -public class MappingBehavior - extends CimAnySimpleType -{ - - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/cim_schema/_2/cim_resourceallocationsettingdata/ObjectFactory.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/cim_schema/_2/cim_resourceallocationsettingdata/ObjectFactory.java deleted file mode 100644 index 4591306f82dcd93506d91c9aaf6b2d424cd06cd6..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/cim_schema/_2/cim_resourceallocationsettingdata/ObjectFactory.java +++ /dev/null @@ -1,327 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - - -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.cim_schema._2.cim_resourceallocationsettingdata; - -import javax.xml.bind.JAXBElement; -import javax.xml.bind.annotation.XmlElementDecl; -import javax.xml.bind.annotation.XmlRegistry; -import javax.xml.namespace.QName; - -import org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.common.CimBoolean; -import org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.common.CimString; -import org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.common.CimUnsignedInt; -import org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.common.CimUnsignedLong; - - -/** - * This object contains factory methods for each - * Java content interface and Java element interface - * generated in the org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.cim_schema._2.cim_resourceallocationsettingdata package. - *

An ObjectFactory allows you to programatically - * construct new instances of the Java representation - * for XML content. The Java representation of XML - * content can consist of schema derived interfaces - * and classes representing the binding of schema - * type definitions, element declarations and model - * groups. Factory methods for each of these are - * provided in this class. - * - */ -@XmlRegistry -public class ObjectFactory { - - private final static QName _ElementName_QNAME = new QName("http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData", "ElementName"); - private final static QName _CIMResourceAllocationSettingData_QNAME = new QName("http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData", "CIM_ResourceAllocationSettingData"); - private final static QName _PoolID_QNAME = new QName("http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData", "PoolID"); - private final static QName _Weight_QNAME = new QName("http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData", "Weight"); - private final static QName _AddressOnParent_QNAME = new QName("http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData", "AddressOnParent"); - private final static QName _Parent_QNAME = new QName("http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData", "Parent"); - private final static QName _ResourceSubType_QNAME = new QName("http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData", "ResourceSubType"); - private final static QName _Limit_QNAME = new QName("http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData", "Limit"); - private final static QName _AutomaticAllocation_QNAME = new QName("http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData", "AutomaticAllocation"); - private final static QName _Reservation_QNAME = new QName("http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData", "Reservation"); - private final static QName _OtherResourceType_QNAME = new QName("http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData", "OtherResourceType"); - private final static QName _Connection_QNAME = new QName("http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData", "Connection"); - private final static QName _Caption_QNAME = new QName("http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData", "Caption"); - private final static QName _VirtualQuantityUnits_QNAME = new QName("http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData", "VirtualQuantityUnits"); - private final static QName _ResourceType_QNAME = new QName("http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData", "ResourceType"); - private final static QName _AllocationUnits_QNAME = new QName("http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData", "AllocationUnits"); - private final static QName _ConsumerVisibility_QNAME = new QName("http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData", "ConsumerVisibility"); - private final static QName _VirtualQuantity_QNAME = new QName("http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData", "VirtualQuantity"); - private final static QName _InstanceID_QNAME = new QName("http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData", "InstanceID"); - private final static QName _HostResource_QNAME = new QName("http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData", "HostResource"); - private final static QName _Description_QNAME = new QName("http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData", "Description"); - private final static QName _AutomaticDeallocation_QNAME = new QName("http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData", "AutomaticDeallocation"); - private final static QName _MappingBehavior_QNAME = new QName("http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData", "MappingBehavior"); - private final static QName _Address_QNAME = new QName("http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData", "Address"); - - /** - * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.cim_schema._2.cim_resourceallocationsettingdata - * - */ - public ObjectFactory() { - } - - /** - * Create an instance of {@link ConsumerVisibility } - * - */ - public ConsumerVisibility createConsumerVisibility() { - return new ConsumerVisibility(); - } - - /** - * Create an instance of {@link MappingBehavior } - * - */ - public MappingBehavior createMappingBehavior() { - return new MappingBehavior(); - } - - /** - * Create an instance of {@link Caption } - * - */ - public Caption createCaption() { - return new Caption(); - } - - /** - * Create an instance of {@link CIMResourceAllocationSettingDataType } - * - */ - public CIMResourceAllocationSettingDataType createCIMResourceAllocationSettingDataType() { - return new CIMResourceAllocationSettingDataType(); - } - - /** - * Create an instance of {@link ResourceType } - * - */ - public ResourceType createResourceType() { - return new ResourceType(); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link CimString }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData", name = "ElementName") - public JAXBElement createElementName(CimString value) { - return new JAXBElement(_ElementName_QNAME, CimString.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link CIMResourceAllocationSettingDataType }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData", name = "CIM_ResourceAllocationSettingData") - public JAXBElement createCIMResourceAllocationSettingData(CIMResourceAllocationSettingDataType value) { - return new JAXBElement(_CIMResourceAllocationSettingData_QNAME, CIMResourceAllocationSettingDataType.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link CimString }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData", name = "PoolID") - public JAXBElement createPoolID(CimString value) { - return new JAXBElement(_PoolID_QNAME, CimString.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link CimUnsignedInt }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData", name = "Weight") - public JAXBElement createWeight(CimUnsignedInt value) { - return new JAXBElement(_Weight_QNAME, CimUnsignedInt.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link CimString }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData", name = "AddressOnParent") - public JAXBElement createAddressOnParent(CimString value) { - return new JAXBElement(_AddressOnParent_QNAME, CimString.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link CimString }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData", name = "Parent") - public JAXBElement createParent(CimString value) { - return new JAXBElement(_Parent_QNAME, CimString.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link CimString }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData", name = "ResourceSubType") - public JAXBElement createResourceSubType(CimString value) { - return new JAXBElement(_ResourceSubType_QNAME, CimString.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link CimUnsignedLong }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData", name = "Limit") - public JAXBElement createLimit(CimUnsignedLong value) { - return new JAXBElement(_Limit_QNAME, CimUnsignedLong.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link CimBoolean }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData", name = "AutomaticAllocation") - public JAXBElement createAutomaticAllocation(CimBoolean value) { - return new JAXBElement(_AutomaticAllocation_QNAME, CimBoolean.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link CimUnsignedLong }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData", name = "Reservation") - public JAXBElement createReservation(CimUnsignedLong value) { - return new JAXBElement(_Reservation_QNAME, CimUnsignedLong.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link CimString }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData", name = "OtherResourceType") - public JAXBElement createOtherResourceType(CimString value) { - return new JAXBElement(_OtherResourceType_QNAME, CimString.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link CimString }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData", name = "Connection") - public JAXBElement createConnection(CimString value) { - return new JAXBElement(_Connection_QNAME, CimString.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link Caption }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData", name = "Caption") - public JAXBElement createCaption(Caption value) { - return new JAXBElement(_Caption_QNAME, Caption.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link CimString }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData", name = "VirtualQuantityUnits") - public JAXBElement createVirtualQuantityUnits(CimString value) { - return new JAXBElement(_VirtualQuantityUnits_QNAME, CimString.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link ResourceType }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData", name = "ResourceType") - public JAXBElement createResourceType(ResourceType value) { - return new JAXBElement(_ResourceType_QNAME, ResourceType.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link CimString }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData", name = "AllocationUnits") - public JAXBElement createAllocationUnits(CimString value) { - return new JAXBElement(_AllocationUnits_QNAME, CimString.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link ConsumerVisibility }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData", name = "ConsumerVisibility") - public JAXBElement createConsumerVisibility(ConsumerVisibility value) { - return new JAXBElement(_ConsumerVisibility_QNAME, ConsumerVisibility.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link CimUnsignedLong }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData", name = "VirtualQuantity") - public JAXBElement createVirtualQuantity(CimUnsignedLong value) { - return new JAXBElement(_VirtualQuantity_QNAME, CimUnsignedLong.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link CimString }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData", name = "InstanceID") - public JAXBElement createInstanceID(CimString value) { - return new JAXBElement(_InstanceID_QNAME, CimString.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link CimString }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData", name = "HostResource") - public JAXBElement createHostResource(CimString value) { - return new JAXBElement(_HostResource_QNAME, CimString.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link CimString }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData", name = "Description") - public JAXBElement createDescription(CimString value) { - return new JAXBElement(_Description_QNAME, CimString.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link CimBoolean }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData", name = "AutomaticDeallocation") - public JAXBElement createAutomaticDeallocation(CimBoolean value) { - return new JAXBElement(_AutomaticDeallocation_QNAME, CimBoolean.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link MappingBehavior }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData", name = "MappingBehavior") - public JAXBElement createMappingBehavior(MappingBehavior value) { - return new JAXBElement(_MappingBehavior_QNAME, MappingBehavior.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link CimString }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData", name = "Address") - public JAXBElement createAddress(CimString value) { - return new JAXBElement(_Address_QNAME, CimString.class, null, value); - } - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/cim_schema/_2/cim_resourceallocationsettingdata/ResourceType.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/cim_schema/_2/cim_resourceallocationsettingdata/ResourceType.java deleted file mode 100644 index 4ff68ab857f5ec55d739643e3162c30660714a37..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/cim_schema/_2/cim_resourceallocationsettingdata/ResourceType.java +++ /dev/null @@ -1,42 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - - -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.cim_schema._2.cim_resourceallocationsettingdata; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlType; - -import org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.common.CimAnySimpleType; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <simpleContent>
- *     <restriction base="<http://schemas.dmtf.org/wbem/wscim/1/common>cimAnySimpleType">
- *       <anyAttribute processContents='lax'/>
- *     </restriction>
- *   </simpleContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "") -public class ResourceType - extends CimAnySimpleType -{ - - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/cim_schema/_2/cim_resourceallocationsettingdata/package-info.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/cim_schema/_2/cim_resourceallocationsettingdata/package-info.java deleted file mode 100644 index 233dc5b1760743d9041febadf4a40f113cd910c1..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/cim_schema/_2/cim_resourceallocationsettingdata/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - -@javax.xml.bind.annotation.XmlSchema(namespace = "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.cim_schema._2.cim_resourceallocationsettingdata; diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/cim_schema/_2/cim_virtualsystemsettingdata/AutomaticRecoveryAction.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/cim_schema/_2/cim_virtualsystemsettingdata/AutomaticRecoveryAction.java deleted file mode 100644 index 5ed7ab2f1e5739100b2e063f4c868424e9f08c33..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/cim_schema/_2/cim_virtualsystemsettingdata/AutomaticRecoveryAction.java +++ /dev/null @@ -1,42 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - - -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.cim_schema._2.cim_virtualsystemsettingdata; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlType; - -import org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.common.CimAnySimpleType; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <simpleContent>
- *     <restriction base="<http://schemas.dmtf.org/wbem/wscim/1/common>cimAnySimpleType">
- *       <anyAttribute processContents='lax'/>
- *     </restriction>
- *   </simpleContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "") -public class AutomaticRecoveryAction - extends CimAnySimpleType -{ - - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/cim_schema/_2/cim_virtualsystemsettingdata/AutomaticShutdownAction.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/cim_schema/_2/cim_virtualsystemsettingdata/AutomaticShutdownAction.java deleted file mode 100644 index 11bf9ba11b233165568fe24dde4d46fc74f826eb..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/cim_schema/_2/cim_virtualsystemsettingdata/AutomaticShutdownAction.java +++ /dev/null @@ -1,42 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - - -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.cim_schema._2.cim_virtualsystemsettingdata; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlType; - -import org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.common.CimAnySimpleType; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <simpleContent>
- *     <restriction base="<http://schemas.dmtf.org/wbem/wscim/1/common>cimAnySimpleType">
- *       <anyAttribute processContents='lax'/>
- *     </restriction>
- *   </simpleContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "") -public class AutomaticShutdownAction - extends CimAnySimpleType -{ - - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/cim_schema/_2/cim_virtualsystemsettingdata/AutomaticStartupAction.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/cim_schema/_2/cim_virtualsystemsettingdata/AutomaticStartupAction.java deleted file mode 100644 index 8e4a21d14d0ca22414d99da79b6096094d9c5acb..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/cim_schema/_2/cim_virtualsystemsettingdata/AutomaticStartupAction.java +++ /dev/null @@ -1,42 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - - -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.cim_schema._2.cim_virtualsystemsettingdata; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlType; - -import org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.common.CimAnySimpleType; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <simpleContent>
- *     <restriction base="<http://schemas.dmtf.org/wbem/wscim/1/common>cimAnySimpleType">
- *       <anyAttribute processContents='lax'/>
- *     </restriction>
- *   </simpleContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "") -public class AutomaticStartupAction - extends CimAnySimpleType -{ - - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/cim_schema/_2/cim_virtualsystemsettingdata/CIMVirtualSystemSettingDataType.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/cim_schema/_2/cim_virtualsystemsettingdata/CIMVirtualSystemSettingDataType.java deleted file mode 100644 index cc89c1d625861268595e6d28917332664016ae71..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/cim_schema/_2/cim_virtualsystemsettingdata/CIMVirtualSystemSettingDataType.java +++ /dev/null @@ -1,706 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - - -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.cim_schema._2.cim_virtualsystemsettingdata; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyAttribute; -import javax.xml.bind.annotation.XmlAnyElement; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlSeeAlso; -import javax.xml.bind.annotation.XmlType; -import javax.xml.namespace.QName; - -import org.ow2.contrail.federation.application.ovf.dmtf.schemas.ovf.envelope._1.VSSDType; -import org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.common.CimDateTime; -import org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.common.CimString; -import org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.common.CimUnsignedShort; -import org.w3c.dom.Element; - - -/** - *

Java class for CIM_VirtualSystemSettingData_Type complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="CIM_VirtualSystemSettingData_Type">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element ref="{http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData}AutomaticRecoveryAction" minOccurs="0"/>
- *         <element ref="{http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData}AutomaticShutdownAction" minOccurs="0"/>
- *         <element ref="{http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData}AutomaticStartupAction" minOccurs="0"/>
- *         <element ref="{http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData}AutomaticStartupActionDelay" minOccurs="0"/>
- *         <element ref="{http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData}AutomaticStartupActionSequenceNumber" minOccurs="0"/>
- *         <element ref="{http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData}Caption" minOccurs="0"/>
- *         <element ref="{http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData}ConfigurationDataRoot" minOccurs="0"/>
- *         <element ref="{http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData}ConfigurationFile" minOccurs="0"/>
- *         <element ref="{http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData}ConfigurationID" minOccurs="0"/>
- *         <element ref="{http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData}CreationTime" minOccurs="0"/>
- *         <element ref="{http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData}Description" minOccurs="0"/>
- *         <element ref="{http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData}ElementName"/>
- *         <element ref="{http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData}InstanceID"/>
- *         <element ref="{http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData}LogDataRoot" minOccurs="0"/>
- *         <element ref="{http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData}Notes" maxOccurs="unbounded" minOccurs="0"/>
- *         <element ref="{http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData}RecoveryFile" minOccurs="0"/>
- *         <element ref="{http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData}SnapshotDataRoot" minOccurs="0"/>
- *         <element ref="{http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData}SuspendDataRoot" minOccurs="0"/>
- *         <element ref="{http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData}SwapFileDataRoot" minOccurs="0"/>
- *         <element ref="{http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData}VirtualSystemIdentifier" minOccurs="0"/>
- *         <element ref="{http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData}VirtualSystemType" minOccurs="0"/>
- *         <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
- *       </sequence>
- *       <anyAttribute processContents='lax'/>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "CIM_VirtualSystemSettingData_Type", propOrder = { - "automaticRecoveryAction", - "automaticShutdownAction", - "automaticStartupAction", - "automaticStartupActionDelay", - "automaticStartupActionSequenceNumber", - "caption", - "configurationDataRoot", - "configurationFile", - "configurationID", - "creationTime", - "description", - "elementName", - "instanceID", - "logDataRoot", - "notes", - "recoveryFile", - "snapshotDataRoot", - "suspendDataRoot", - "swapFileDataRoot", - "virtualSystemIdentifier", - "virtualSystemType", - "any" -}) -@XmlSeeAlso({ - VSSDType.class -}) -public class CIMVirtualSystemSettingDataType { - - @XmlElement(name = "AutomaticRecoveryAction", nillable = true) - protected AutomaticRecoveryAction automaticRecoveryAction; - @XmlElement(name = "AutomaticShutdownAction", nillable = true) - protected AutomaticShutdownAction automaticShutdownAction; - @XmlElement(name = "AutomaticStartupAction", nillable = true) - protected AutomaticStartupAction automaticStartupAction; - @XmlElement(name = "AutomaticStartupActionDelay", nillable = true) - protected CimDateTime automaticStartupActionDelay; - @XmlElement(name = "AutomaticStartupActionSequenceNumber", nillable = true) - protected CimUnsignedShort automaticStartupActionSequenceNumber; - @XmlElement(name = "Caption", nillable = true) - protected Caption caption; - @XmlElement(name = "ConfigurationDataRoot", nillable = true) - protected CimString configurationDataRoot; - @XmlElement(name = "ConfigurationFile", nillable = true) - protected CimString configurationFile; - @XmlElement(name = "ConfigurationID", nillable = true) - protected CimString configurationID; - @XmlElement(name = "CreationTime", nillable = true) - protected CimDateTime creationTime; - @XmlElement(name = "Description", nillable = true) - protected CimString description; - @XmlElement(name = "ElementName", required = true) - protected CimString elementName; - @XmlElement(name = "InstanceID", required = true) - protected CimString instanceID; - @XmlElement(name = "LogDataRoot", nillable = true) - protected CimString logDataRoot; - @XmlElement(name = "Notes", nillable = true) - protected List notes; - @XmlElement(name = "RecoveryFile", nillable = true) - protected CimString recoveryFile; - @XmlElement(name = "SnapshotDataRoot", nillable = true) - protected CimString snapshotDataRoot; - @XmlElement(name = "SuspendDataRoot", nillable = true) - protected CimString suspendDataRoot; - @XmlElement(name = "SwapFileDataRoot", nillable = true) - protected CimString swapFileDataRoot; - @XmlElement(name = "VirtualSystemIdentifier", nillable = true) - protected CimString virtualSystemIdentifier; - @XmlElement(name = "VirtualSystemType", nillable = true) - protected CimString virtualSystemType; - @XmlAnyElement(lax = true) - protected List any; - @XmlAnyAttribute - private Map otherAttributes = new HashMap(); - - /** - * Gets the value of the automaticRecoveryAction property. - * - * @return - * possible object is - * {@link AutomaticRecoveryAction } - * - */ - public AutomaticRecoveryAction getAutomaticRecoveryAction() { - return automaticRecoveryAction; - } - - /** - * Sets the value of the automaticRecoveryAction property. - * - * @param value - * allowed object is - * {@link AutomaticRecoveryAction } - * - */ - public void setAutomaticRecoveryAction(AutomaticRecoveryAction value) { - this.automaticRecoveryAction = value; - } - - /** - * Gets the value of the automaticShutdownAction property. - * - * @return - * possible object is - * {@link AutomaticShutdownAction } - * - */ - public AutomaticShutdownAction getAutomaticShutdownAction() { - return automaticShutdownAction; - } - - /** - * Sets the value of the automaticShutdownAction property. - * - * @param value - * allowed object is - * {@link AutomaticShutdownAction } - * - */ - public void setAutomaticShutdownAction(AutomaticShutdownAction value) { - this.automaticShutdownAction = value; - } - - /** - * Gets the value of the automaticStartupAction property. - * - * @return - * possible object is - * {@link AutomaticStartupAction } - * - */ - public AutomaticStartupAction getAutomaticStartupAction() { - return automaticStartupAction; - } - - /** - * Sets the value of the automaticStartupAction property. - * - * @param value - * allowed object is - * {@link AutomaticStartupAction } - * - */ - public void setAutomaticStartupAction(AutomaticStartupAction value) { - this.automaticStartupAction = value; - } - - /** - * Gets the value of the automaticStartupActionDelay property. - * - * @return - * possible object is - * {@link CimDateTime } - * - */ - public CimDateTime getAutomaticStartupActionDelay() { - return automaticStartupActionDelay; - } - - /** - * Sets the value of the automaticStartupActionDelay property. - * - * @param value - * allowed object is - * {@link CimDateTime } - * - */ - public void setAutomaticStartupActionDelay(CimDateTime value) { - this.automaticStartupActionDelay = value; - } - - /** - * Gets the value of the automaticStartupActionSequenceNumber property. - * - * @return - * possible object is - * {@link CimUnsignedShort } - * - */ - public CimUnsignedShort getAutomaticStartupActionSequenceNumber() { - return automaticStartupActionSequenceNumber; - } - - /** - * Sets the value of the automaticStartupActionSequenceNumber property. - * - * @param value - * allowed object is - * {@link CimUnsignedShort } - * - */ - public void setAutomaticStartupActionSequenceNumber(CimUnsignedShort value) { - this.automaticStartupActionSequenceNumber = value; - } - - /** - * Gets the value of the caption property. - * - * @return - * possible object is - * {@link Caption } - * - */ - public Caption getCaption() { - return caption; - } - - /** - * Sets the value of the caption property. - * - * @param value - * allowed object is - * {@link Caption } - * - */ - public void setCaption(Caption value) { - this.caption = value; - } - - /** - * Gets the value of the configurationDataRoot property. - * - * @return - * possible object is - * {@link CimString } - * - */ - public CimString getConfigurationDataRoot() { - return configurationDataRoot; - } - - /** - * Sets the value of the configurationDataRoot property. - * - * @param value - * allowed object is - * {@link CimString } - * - */ - public void setConfigurationDataRoot(CimString value) { - this.configurationDataRoot = value; - } - - /** - * Gets the value of the configurationFile property. - * - * @return - * possible object is - * {@link CimString } - * - */ - public CimString getConfigurationFile() { - return configurationFile; - } - - /** - * Sets the value of the configurationFile property. - * - * @param value - * allowed object is - * {@link CimString } - * - */ - public void setConfigurationFile(CimString value) { - this.configurationFile = value; - } - - /** - * Gets the value of the configurationID property. - * - * @return - * possible object is - * {@link CimString } - * - */ - public CimString getConfigurationID() { - return configurationID; - } - - /** - * Sets the value of the configurationID property. - * - * @param value - * allowed object is - * {@link CimString } - * - */ - public void setConfigurationID(CimString value) { - this.configurationID = value; - } - - /** - * Gets the value of the creationTime property. - * - * @return - * possible object is - * {@link CimDateTime } - * - */ - public CimDateTime getCreationTime() { - return creationTime; - } - - /** - * Sets the value of the creationTime property. - * - * @param value - * allowed object is - * {@link CimDateTime } - * - */ - public void setCreationTime(CimDateTime value) { - this.creationTime = value; - } - - /** - * Gets the value of the description property. - * - * @return - * possible object is - * {@link CimString } - * - */ - public CimString getDescription() { - return description; - } - - /** - * Sets the value of the description property. - * - * @param value - * allowed object is - * {@link CimString } - * - */ - public void setDescription(CimString value) { - this.description = value; - } - - /** - * Gets the value of the elementName property. - * - * @return - * possible object is - * {@link CimString } - * - */ - public CimString getElementName() { - return elementName; - } - - /** - * Sets the value of the elementName property. - * - * @param value - * allowed object is - * {@link CimString } - * - */ - public void setElementName(CimString value) { - this.elementName = value; - } - - /** - * Gets the value of the instanceID property. - * - * @return - * possible object is - * {@link CimString } - * - */ - public CimString getInstanceID() { - return instanceID; - } - - /** - * Sets the value of the instanceID property. - * - * @param value - * allowed object is - * {@link CimString } - * - */ - public void setInstanceID(CimString value) { - this.instanceID = value; - } - - /** - * Gets the value of the logDataRoot property. - * - * @return - * possible object is - * {@link CimString } - * - */ - public CimString getLogDataRoot() { - return logDataRoot; - } - - /** - * Sets the value of the logDataRoot property. - * - * @param value - * allowed object is - * {@link CimString } - * - */ - public void setLogDataRoot(CimString value) { - this.logDataRoot = value; - } - - /** - * Gets the value of the notes property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the notes property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getNotes().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link CimString } - * - * - */ - public List getNotes() { - if (notes == null) { - notes = new ArrayList(); - } - return this.notes; - } - - /** - * Gets the value of the recoveryFile property. - * - * @return - * possible object is - * {@link CimString } - * - */ - public CimString getRecoveryFile() { - return recoveryFile; - } - - /** - * Sets the value of the recoveryFile property. - * - * @param value - * allowed object is - * {@link CimString } - * - */ - public void setRecoveryFile(CimString value) { - this.recoveryFile = value; - } - - /** - * Gets the value of the snapshotDataRoot property. - * - * @return - * possible object is - * {@link CimString } - * - */ - public CimString getSnapshotDataRoot() { - return snapshotDataRoot; - } - - /** - * Sets the value of the snapshotDataRoot property. - * - * @param value - * allowed object is - * {@link CimString } - * - */ - public void setSnapshotDataRoot(CimString value) { - this.snapshotDataRoot = value; - } - - /** - * Gets the value of the suspendDataRoot property. - * - * @return - * possible object is - * {@link CimString } - * - */ - public CimString getSuspendDataRoot() { - return suspendDataRoot; - } - - /** - * Sets the value of the suspendDataRoot property. - * - * @param value - * allowed object is - * {@link CimString } - * - */ - public void setSuspendDataRoot(CimString value) { - this.suspendDataRoot = value; - } - - /** - * Gets the value of the swapFileDataRoot property. - * - * @return - * possible object is - * {@link CimString } - * - */ - public CimString getSwapFileDataRoot() { - return swapFileDataRoot; - } - - /** - * Sets the value of the swapFileDataRoot property. - * - * @param value - * allowed object is - * {@link CimString } - * - */ - public void setSwapFileDataRoot(CimString value) { - this.swapFileDataRoot = value; - } - - /** - * Gets the value of the virtualSystemIdentifier property. - * - * @return - * possible object is - * {@link CimString } - * - */ - public CimString getVirtualSystemIdentifier() { - return virtualSystemIdentifier; - } - - /** - * Sets the value of the virtualSystemIdentifier property. - * - * @param value - * allowed object is - * {@link CimString } - * - */ - public void setVirtualSystemIdentifier(CimString value) { - this.virtualSystemIdentifier = value; - } - - /** - * Gets the value of the virtualSystemType property. - * - * @return - * possible object is - * {@link CimString } - * - */ - public CimString getVirtualSystemType() { - return virtualSystemType; - } - - /** - * Sets the value of the virtualSystemType property. - * - * @param value - * allowed object is - * {@link CimString } - * - */ - public void setVirtualSystemType(CimString value) { - this.virtualSystemType = value; - } - - /** - * Gets the value of the any property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the any property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getAny().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link Object } - * {@link Element } - * - * - */ - public List getAny() { - if (any == null) { - any = new ArrayList(); - } - return this.any; - } - - /** - * Gets a map that contains attributes that aren't bound to any typed property on this class. - * - *

- * the map is keyed by the name of the attribute and - * the value is the string value of the attribute. - * - * the map returned by this method is live, and you can add new attribute - * by updating the map directly. Because of this design, there's no setter. - * - * - * @return - * always non-null - */ - public Map getOtherAttributes() { - return otherAttributes; - } - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/cim_schema/_2/cim_virtualsystemsettingdata/Caption.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/cim_schema/_2/cim_virtualsystemsettingdata/Caption.java deleted file mode 100644 index 58539a2f707cc6850aa6a4c71b0b7d69c11aadcb..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/cim_schema/_2/cim_virtualsystemsettingdata/Caption.java +++ /dev/null @@ -1,42 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - - -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.cim_schema._2.cim_virtualsystemsettingdata; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlType; - -import org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.common.CimString; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <simpleContent>
- *     <restriction base="<http://schemas.dmtf.org/wbem/wscim/1/common>cimString">
- *       <anyAttribute processContents='lax'/>
- *     </restriction>
- *   </simpleContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "") -public class Caption - extends CimString -{ - - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/cim_schema/_2/cim_virtualsystemsettingdata/ObjectFactory.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/cim_schema/_2/cim_virtualsystemsettingdata/ObjectFactory.java deleted file mode 100644 index 01b14ccfca2b003797773c234004e9cf071cf477..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/cim_schema/_2/cim_virtualsystemsettingdata/ObjectFactory.java +++ /dev/null @@ -1,306 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - - -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.cim_schema._2.cim_virtualsystemsettingdata; - -import javax.xml.bind.JAXBElement; -import javax.xml.bind.annotation.XmlElementDecl; -import javax.xml.bind.annotation.XmlRegistry; -import javax.xml.namespace.QName; - -import org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.common.CimDateTime; -import org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.common.CimString; -import org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.common.CimUnsignedShort; - - -/** - * This object contains factory methods for each - * Java content interface and Java element interface - * generated in the org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.cim_schema._2.cim_virtualsystemsettingdata package. - *

An ObjectFactory allows you to programatically - * construct new instances of the Java representation - * for XML content. The Java representation of XML - * content can consist of schema derived interfaces - * and classes representing the binding of schema - * type definitions, element declarations and model - * groups. Factory methods for each of these are - * provided in this class. - * - */ -@XmlRegistry -public class ObjectFactory { - - private final static QName _RecoveryFile_QNAME = new QName("http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData", "RecoveryFile"); - private final static QName _Caption_QNAME = new QName("http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData", "Caption"); - private final static QName _CIMVirtualSystemSettingData_QNAME = new QName("http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData", "CIM_VirtualSystemSettingData"); - private final static QName _ConfigurationFile_QNAME = new QName("http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData", "ConfigurationFile"); - private final static QName _SuspendDataRoot_QNAME = new QName("http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData", "SuspendDataRoot"); - private final static QName _VirtualSystemIdentifier_QNAME = new QName("http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData", "VirtualSystemIdentifier"); - private final static QName _AutomaticShutdownAction_QNAME = new QName("http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData", "AutomaticShutdownAction"); - private final static QName _Description_QNAME = new QName("http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData", "Description"); - private final static QName _SwapFileDataRoot_QNAME = new QName("http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData", "SwapFileDataRoot"); - private final static QName _InstanceID_QNAME = new QName("http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData", "InstanceID"); - private final static QName _AutomaticStartupActionSequenceNumber_QNAME = new QName("http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData", "AutomaticStartupActionSequenceNumber"); - private final static QName _AutomaticStartupActionDelay_QNAME = new QName("http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData", "AutomaticStartupActionDelay"); - private final static QName _VirtualSystemType_QNAME = new QName("http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData", "VirtualSystemType"); - private final static QName _AutomaticRecoveryAction_QNAME = new QName("http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData", "AutomaticRecoveryAction"); - private final static QName _AutomaticStartupAction_QNAME = new QName("http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData", "AutomaticStartupAction"); - private final static QName _ConfigurationID_QNAME = new QName("http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData", "ConfigurationID"); - private final static QName _ElementName_QNAME = new QName("http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData", "ElementName"); - private final static QName _Notes_QNAME = new QName("http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData", "Notes"); - private final static QName _CreationTime_QNAME = new QName("http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData", "CreationTime"); - private final static QName _SnapshotDataRoot_QNAME = new QName("http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData", "SnapshotDataRoot"); - private final static QName _ConfigurationDataRoot_QNAME = new QName("http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData", "ConfigurationDataRoot"); - private final static QName _LogDataRoot_QNAME = new QName("http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData", "LogDataRoot"); - - /** - * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.cim_schema._2.cim_virtualsystemsettingdata - * - */ - public ObjectFactory() { - } - - /** - * Create an instance of {@link Caption } - * - */ - public Caption createCaption() { - return new Caption(); - } - - /** - * Create an instance of {@link CIMVirtualSystemSettingDataType } - * - */ - public CIMVirtualSystemSettingDataType createCIMVirtualSystemSettingDataType() { - return new CIMVirtualSystemSettingDataType(); - } - - /** - * Create an instance of {@link AutomaticShutdownAction } - * - */ - public AutomaticShutdownAction createAutomaticShutdownAction() { - return new AutomaticShutdownAction(); - } - - /** - * Create an instance of {@link AutomaticStartupAction } - * - */ - public AutomaticStartupAction createAutomaticStartupAction() { - return new AutomaticStartupAction(); - } - - /** - * Create an instance of {@link AutomaticRecoveryAction } - * - */ - public AutomaticRecoveryAction createAutomaticRecoveryAction() { - return new AutomaticRecoveryAction(); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link CimString }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData", name = "RecoveryFile") - public JAXBElement createRecoveryFile(CimString value) { - return new JAXBElement(_RecoveryFile_QNAME, CimString.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link Caption }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData", name = "Caption") - public JAXBElement createCaption(Caption value) { - return new JAXBElement(_Caption_QNAME, Caption.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link CIMVirtualSystemSettingDataType }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData", name = "CIM_VirtualSystemSettingData") - public JAXBElement createCIMVirtualSystemSettingData(CIMVirtualSystemSettingDataType value) { - return new JAXBElement(_CIMVirtualSystemSettingData_QNAME, CIMVirtualSystemSettingDataType.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link CimString }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData", name = "ConfigurationFile") - public JAXBElement createConfigurationFile(CimString value) { - return new JAXBElement(_ConfigurationFile_QNAME, CimString.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link CimString }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData", name = "SuspendDataRoot") - public JAXBElement createSuspendDataRoot(CimString value) { - return new JAXBElement(_SuspendDataRoot_QNAME, CimString.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link CimString }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData", name = "VirtualSystemIdentifier") - public JAXBElement createVirtualSystemIdentifier(CimString value) { - return new JAXBElement(_VirtualSystemIdentifier_QNAME, CimString.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link AutomaticShutdownAction }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData", name = "AutomaticShutdownAction") - public JAXBElement createAutomaticShutdownAction(AutomaticShutdownAction value) { - return new JAXBElement(_AutomaticShutdownAction_QNAME, AutomaticShutdownAction.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link CimString }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData", name = "Description") - public JAXBElement createDescription(CimString value) { - return new JAXBElement(_Description_QNAME, CimString.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link CimString }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData", name = "SwapFileDataRoot") - public JAXBElement createSwapFileDataRoot(CimString value) { - return new JAXBElement(_SwapFileDataRoot_QNAME, CimString.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link CimString }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData", name = "InstanceID") - public JAXBElement createInstanceID(CimString value) { - return new JAXBElement(_InstanceID_QNAME, CimString.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link CimUnsignedShort }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData", name = "AutomaticStartupActionSequenceNumber") - public JAXBElement createAutomaticStartupActionSequenceNumber(CimUnsignedShort value) { - return new JAXBElement(_AutomaticStartupActionSequenceNumber_QNAME, CimUnsignedShort.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link CimDateTime }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData", name = "AutomaticStartupActionDelay") - public JAXBElement createAutomaticStartupActionDelay(CimDateTime value) { - return new JAXBElement(_AutomaticStartupActionDelay_QNAME, CimDateTime.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link CimString }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData", name = "VirtualSystemType") - public JAXBElement createVirtualSystemType(CimString value) { - return new JAXBElement(_VirtualSystemType_QNAME, CimString.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link AutomaticRecoveryAction }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData", name = "AutomaticRecoveryAction") - public JAXBElement createAutomaticRecoveryAction(AutomaticRecoveryAction value) { - return new JAXBElement(_AutomaticRecoveryAction_QNAME, AutomaticRecoveryAction.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link AutomaticStartupAction }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData", name = "AutomaticStartupAction") - public JAXBElement createAutomaticStartupAction(AutomaticStartupAction value) { - return new JAXBElement(_AutomaticStartupAction_QNAME, AutomaticStartupAction.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link CimString }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData", name = "ConfigurationID") - public JAXBElement createConfigurationID(CimString value) { - return new JAXBElement(_ConfigurationID_QNAME, CimString.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link CimString }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData", name = "ElementName") - public JAXBElement createElementName(CimString value) { - return new JAXBElement(_ElementName_QNAME, CimString.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link CimString }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData", name = "Notes") - public JAXBElement createNotes(CimString value) { - return new JAXBElement(_Notes_QNAME, CimString.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link CimDateTime }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData", name = "CreationTime") - public JAXBElement createCreationTime(CimDateTime value) { - return new JAXBElement(_CreationTime_QNAME, CimDateTime.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link CimString }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData", name = "SnapshotDataRoot") - public JAXBElement createSnapshotDataRoot(CimString value) { - return new JAXBElement(_SnapshotDataRoot_QNAME, CimString.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link CimString }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData", name = "ConfigurationDataRoot") - public JAXBElement createConfigurationDataRoot(CimString value) { - return new JAXBElement(_ConfigurationDataRoot_QNAME, CimString.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link CimString }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData", name = "LogDataRoot") - public JAXBElement createLogDataRoot(CimString value) { - return new JAXBElement(_LogDataRoot_QNAME, CimString.class, null, value); - } - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/cim_schema/_2/cim_virtualsystemsettingdata/package-info.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/cim_schema/_2/cim_virtualsystemsettingdata/package-info.java deleted file mode 100644 index 94baf0ba868e24a2d4aff328710168a4a97073e1..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/cim_schema/_2/cim_virtualsystemsettingdata/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - -@javax.xml.bind.annotation.XmlSchema(namespace = "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.cim_schema._2.cim_virtualsystemsettingdata; diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/CimAnySimpleType.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/CimAnySimpleType.java deleted file mode 100644 index cacdb31cc457a84c22dfeab92aa198d334f4b6fb..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/CimAnySimpleType.java +++ /dev/null @@ -1,109 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - - -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.common; - -import java.util.HashMap; -import java.util.Map; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyAttribute; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlSeeAlso; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.XmlValue; -import javax.xml.namespace.QName; - -import org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.cim_schema._2.cim_resourceallocationsettingdata.ConsumerVisibility; -import org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.cim_schema._2.cim_resourceallocationsettingdata.MappingBehavior; -import org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.cim_schema._2.cim_resourceallocationsettingdata.ResourceType; -import org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.cim_schema._2.cim_virtualsystemsettingdata.AutomaticRecoveryAction; -import org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.cim_schema._2.cim_virtualsystemsettingdata.AutomaticShutdownAction; -import org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.cim_schema._2.cim_virtualsystemsettingdata.AutomaticStartupAction; - - -/** - *

Java class for cimAnySimpleType complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="cimAnySimpleType">
- *   <simpleContent>
- *     <extension base="<http://www.w3.org/2001/XMLSchema>anySimpleType">
- *       <anyAttribute processContents='lax'/>
- *     </extension>
- *   </simpleContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "cimAnySimpleType", propOrder = { - "value" -}) -@XmlSeeAlso({ - AutomaticRecoveryAction.class, - AutomaticShutdownAction.class, - AutomaticStartupAction.class, - ConsumerVisibility.class, - ResourceType.class, - MappingBehavior.class -}) -public class CimAnySimpleType { - - @XmlValue - @XmlSchemaType(name = "anySimpleType") - protected Object value; - @XmlAnyAttribute - private Map otherAttributes = new HashMap(); - - /** - * Gets the value of the value property. - * - * @return - * possible object is - * {@link Object } - * - */ - public Object getValue() { - return value; - } - - /** - * Sets the value of the value property. - * - * @param value - * allowed object is - * {@link Object } - * - */ - public void setValue(Object value) { - this.value = value; - } - - /** - * Gets a map that contains attributes that aren't bound to any typed property on this class. - * - *

- * the map is keyed by the name of the attribute and - * the value is the string value of the attribute. - * - * the map returned by this method is live, and you can add new attribute - * by updating the map directly. Because of this design, there's no setter. - * - * - * @return - * always non-null - */ - public Map getOtherAttributes() { - return otherAttributes; - } - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/CimBase64Binary.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/CimBase64Binary.java deleted file mode 100644 index a4b6e0d477c416d93ac92fa96ac2564a2bfb84ac..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/CimBase64Binary.java +++ /dev/null @@ -1,89 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - - -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.common; - -import java.util.HashMap; -import java.util.Map; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyAttribute; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.XmlValue; -import javax.xml.namespace.QName; - - -/** - *

Java class for cimBase64Binary complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="cimBase64Binary">
- *   <simpleContent>
- *     <extension base="<http://www.w3.org/2001/XMLSchema>base64Binary">
- *       <anyAttribute processContents='lax'/>
- *     </extension>
- *   </simpleContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "cimBase64Binary", propOrder = { - "value" -}) -public class CimBase64Binary { - - @XmlValue - protected byte[] value; - @XmlAnyAttribute - private Map otherAttributes = new HashMap(); - - /** - * Gets the value of the value property. - * - * @return - * possible object is - * byte[] - */ - public byte[] getValue() { - return value; - } - - /** - * Sets the value of the value property. - * - * @param value - * allowed object is - * byte[] - */ - public void setValue(byte[] value) { - this.value = ((byte[]) value); - } - - /** - * Gets a map that contains attributes that aren't bound to any typed property on this class. - * - *

- * the map is keyed by the name of the attribute and - * the value is the string value of the attribute. - * - * the map returned by this method is live, and you can add new attribute - * by updating the map directly. Because of this design, there's no setter. - * - * - * @return - * always non-null - */ - public Map getOtherAttributes() { - return otherAttributes; - } - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/CimBoolean.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/CimBoolean.java deleted file mode 100644 index b4d1247153463e996eff5dba4910ce0fe0fd853d..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/CimBoolean.java +++ /dev/null @@ -1,87 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - - -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.common; - -import java.util.HashMap; -import java.util.Map; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyAttribute; -import javax.xml.bind.annotation.XmlSeeAlso; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.XmlValue; -import javax.xml.namespace.QName; - - -/** - *

Java class for cimBoolean complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="cimBoolean">
- *   <simpleContent>
- *     <extension base="<http://www.w3.org/2001/XMLSchema>boolean">
- *       <anyAttribute processContents='lax'/>
- *     </extension>
- *   </simpleContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "cimBoolean", propOrder = { - "value" -}) -@XmlSeeAlso({ - QualifierBoolean.class -}) -public class CimBoolean { - - @XmlValue - protected boolean value; - @XmlAnyAttribute - private Map otherAttributes = new HashMap(); - - /** - * Gets the value of the value property. - * - */ - public boolean isValue() { - return value; - } - - /** - * Sets the value of the value property. - * - */ - public void setValue(boolean value) { - this.value = value; - } - - /** - * Gets a map that contains attributes that aren't bound to any typed property on this class. - * - *

- * the map is keyed by the name of the attribute and - * the value is the string value of the attribute. - * - * the map returned by this method is live, and you can add new attribute - * by updating the map directly. Because of this design, there's no setter. - * - * - * @return - * always non-null - */ - public Map getOtherAttributes() { - return otherAttributes; - } - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/CimByte.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/CimByte.java deleted file mode 100644 index 8214a59ccccc840412bdb54cd58fac7a40f3b5be..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/CimByte.java +++ /dev/null @@ -1,83 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - - -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.common; - -import java.util.HashMap; -import java.util.Map; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyAttribute; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.XmlValue; -import javax.xml.namespace.QName; - - -/** - *

Java class for cimByte complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="cimByte">
- *   <simpleContent>
- *     <extension base="<http://www.w3.org/2001/XMLSchema>byte">
- *       <anyAttribute processContents='lax'/>
- *     </extension>
- *   </simpleContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "cimByte", propOrder = { - "value" -}) -public class CimByte { - - @XmlValue - protected byte value; - @XmlAnyAttribute - private Map otherAttributes = new HashMap(); - - /** - * Gets the value of the value property. - * - */ - public byte getValue() { - return value; - } - - /** - * Sets the value of the value property. - * - */ - public void setValue(byte value) { - this.value = value; - } - - /** - * Gets a map that contains attributes that aren't bound to any typed property on this class. - * - *

- * the map is keyed by the name of the attribute and - * the value is the string value of the attribute. - * - * the map returned by this method is live, and you can add new attribute - * by updating the map directly. Because of this design, there's no setter. - * - * - * @return - * always non-null - */ - public Map getOtherAttributes() { - return otherAttributes; - } - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/CimChar16.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/CimChar16.java deleted file mode 100644 index 3dc36e792aa297401a273789b92114928abfdb6b..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/CimChar16.java +++ /dev/null @@ -1,40 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - - -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.common; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlType; - - -/** - *

Java class for cimChar16 complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="cimChar16">
- *   <simpleContent>
- *     <restriction base="<http://schemas.dmtf.org/wbem/wscim/1/common>cimString">
- *       <anyAttribute processContents='lax'/>
- *     </restriction>
- *   </simpleContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "cimChar16") -public class CimChar16 - extends CimString -{ - - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/CimDateTime.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/CimDateTime.java deleted file mode 100644 index 6b8a4774248fe353de46bacd152abf872a3f2884..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/CimDateTime.java +++ /dev/null @@ -1,214 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - - -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.common; - -import java.util.HashMap; -import java.util.Map; -import javax.xml.bind.JAXBElement; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementRef; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; -import javax.xml.datatype.Duration; -import javax.xml.datatype.XMLGregorianCalendar; -import javax.xml.namespace.QName; - - -/** - *

Java class for cimDateTime complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="cimDateTime">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <choice>
- *         <element name="CIM_DateTime" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *         <element name="Interval" type="{http://www.w3.org/2001/XMLSchema}duration"/>
- *         <element name="Date" type="{http://www.w3.org/2001/XMLSchema}date"/>
- *         <element name="Time" type="{http://www.w3.org/2001/XMLSchema}time"/>
- *         <element name="Datetime" type="{http://www.w3.org/2001/XMLSchema}dateTime"/>
- *       </choice>
- *       <anyAttribute processContents='lax'/>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "cimDateTime", propOrder = { - "cimDateTime", - "interval", - "date", - "time", - "datetime" -}) -public class CimDateTime { - - @XmlElementRef(name = "CIM_DateTime", namespace = "http://schemas.dmtf.org/wbem/wscim/1/common", type = JAXBElement.class) - protected JAXBElement cimDateTime; - @XmlElement(name = "Interval") - protected Duration interval; - @XmlElement(name = "Date") - @XmlSchemaType(name = "date") - protected XMLGregorianCalendar date; - @XmlElement(name = "Time") - @XmlSchemaType(name = "time") - protected XMLGregorianCalendar time; - @XmlElement(name = "Datetime") - @XmlSchemaType(name = "dateTime") - protected XMLGregorianCalendar datetime; - @XmlAnyAttribute - private Map otherAttributes = new HashMap(); - - /** - * Gets the value of the cimDateTime property. - * - * @return - * possible object is - * {@link JAXBElement }{@code <}{@link String }{@code >} - * - */ - public JAXBElement getCIMDateTime() { - return cimDateTime; - } - - /** - * Sets the value of the cimDateTime property. - * - * @param value - * allowed object is - * {@link JAXBElement }{@code <}{@link String }{@code >} - * - */ - public void setCIMDateTime(JAXBElement value) { - this.cimDateTime = ((JAXBElement ) value); - } - - /** - * Gets the value of the interval property. - * - * @return - * possible object is - * {@link Duration } - * - */ - public Duration getInterval() { - return interval; - } - - /** - * Sets the value of the interval property. - * - * @param value - * allowed object is - * {@link Duration } - * - */ - public void setInterval(Duration value) { - this.interval = value; - } - - /** - * Gets the value of the date property. - * - * @return - * possible object is - * {@link XMLGregorianCalendar } - * - */ - public XMLGregorianCalendar getDate() { - return date; - } - - /** - * Sets the value of the date property. - * - * @param value - * allowed object is - * {@link XMLGregorianCalendar } - * - */ - public void setDate(XMLGregorianCalendar value) { - this.date = value; - } - - /** - * Gets the value of the time property. - * - * @return - * possible object is - * {@link XMLGregorianCalendar } - * - */ - public XMLGregorianCalendar getTime() { - return time; - } - - /** - * Sets the value of the time property. - * - * @param value - * allowed object is - * {@link XMLGregorianCalendar } - * - */ - public void setTime(XMLGregorianCalendar value) { - this.time = value; - } - - /** - * Gets the value of the datetime property. - * - * @return - * possible object is - * {@link XMLGregorianCalendar } - * - */ - public XMLGregorianCalendar getDatetime() { - return datetime; - } - - /** - * Sets the value of the datetime property. - * - * @param value - * allowed object is - * {@link XMLGregorianCalendar } - * - */ - public void setDatetime(XMLGregorianCalendar value) { - this.datetime = value; - } - - /** - * Gets a map that contains attributes that aren't bound to any typed property on this class. - * - *

- * the map is keyed by the name of the attribute and - * the value is the string value of the attribute. - * - * the map returned by this method is live, and you can add new attribute - * by updating the map directly. Because of this design, there's no setter. - * - * - * @return - * always non-null - */ - public Map getOtherAttributes() { - return otherAttributes; - } - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/CimDouble.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/CimDouble.java deleted file mode 100644 index e643e325f8969ffc7a1eedf75bb05e6d78514471..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/CimDouble.java +++ /dev/null @@ -1,83 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - - -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.common; - -import java.util.HashMap; -import java.util.Map; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyAttribute; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.XmlValue; -import javax.xml.namespace.QName; - - -/** - *

Java class for cimDouble complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="cimDouble">
- *   <simpleContent>
- *     <extension base="<http://www.w3.org/2001/XMLSchema>double">
- *       <anyAttribute processContents='lax'/>
- *     </extension>
- *   </simpleContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "cimDouble", propOrder = { - "value" -}) -public class CimDouble { - - @XmlValue - protected double value; - @XmlAnyAttribute - private Map otherAttributes = new HashMap(); - - /** - * Gets the value of the value property. - * - */ - public double getValue() { - return value; - } - - /** - * Sets the value of the value property. - * - */ - public void setValue(double value) { - this.value = value; - } - - /** - * Gets a map that contains attributes that aren't bound to any typed property on this class. - * - *

- * the map is keyed by the name of the attribute and - * the value is the string value of the attribute. - * - * the map returned by this method is live, and you can add new attribute - * by updating the map directly. Because of this design, there's no setter. - * - * - * @return - * always non-null - */ - public Map getOtherAttributes() { - return otherAttributes; - } - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/CimFloat.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/CimFloat.java deleted file mode 100644 index de2e7d669768d41a9878338ff250cbce2d9f9358..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/CimFloat.java +++ /dev/null @@ -1,83 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - - -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.common; - -import java.util.HashMap; -import java.util.Map; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyAttribute; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.XmlValue; -import javax.xml.namespace.QName; - - -/** - *

Java class for cimFloat complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="cimFloat">
- *   <simpleContent>
- *     <extension base="<http://www.w3.org/2001/XMLSchema>float">
- *       <anyAttribute processContents='lax'/>
- *     </extension>
- *   </simpleContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "cimFloat", propOrder = { - "value" -}) -public class CimFloat { - - @XmlValue - protected float value; - @XmlAnyAttribute - private Map otherAttributes = new HashMap(); - - /** - * Gets the value of the value property. - * - */ - public float getValue() { - return value; - } - - /** - * Sets the value of the value property. - * - */ - public void setValue(float value) { - this.value = value; - } - - /** - * Gets a map that contains attributes that aren't bound to any typed property on this class. - * - *

- * the map is keyed by the name of the attribute and - * the value is the string value of the attribute. - * - * the map returned by this method is live, and you can add new attribute - * by updating the map directly. Because of this design, there's no setter. - * - * - * @return - * always non-null - */ - public Map getOtherAttributes() { - return otherAttributes; - } - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/CimHexBinary.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/CimHexBinary.java deleted file mode 100644 index ac939307462eb68a88b7634cf38d2077ffcb18b5..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/CimHexBinary.java +++ /dev/null @@ -1,96 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - - -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.common; - -import java.util.HashMap; -import java.util.Map; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyAttribute; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.XmlValue; -import javax.xml.bind.annotation.adapters.HexBinaryAdapter; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; -import javax.xml.namespace.QName; - - -/** - *

Java class for cimHexBinary complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="cimHexBinary">
- *   <simpleContent>
- *     <extension base="<http://www.w3.org/2001/XMLSchema>hexBinary">
- *       <anyAttribute processContents='lax'/>
- *     </extension>
- *   </simpleContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "cimHexBinary", propOrder = { - "value" -}) -public class CimHexBinary { - - @XmlValue - @XmlJavaTypeAdapter(HexBinaryAdapter.class) - @XmlSchemaType(name = "hexBinary") - protected byte[] value; - @XmlAnyAttribute - private Map otherAttributes = new HashMap(); - - /** - * Gets the value of the value property. - * - * @return - * possible object is - * {@link String } - * - */ - public byte[] getValue() { - return value; - } - - /** - * Sets the value of the value property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setValue(byte[] value) { - this.value = ((byte[]) value); - } - - /** - * Gets a map that contains attributes that aren't bound to any typed property on this class. - * - *

- * the map is keyed by the name of the attribute and - * the value is the string value of the attribute. - * - * the map returned by this method is live, and you can add new attribute - * by updating the map directly. Because of this design, there's no setter. - * - * - * @return - * always non-null - */ - public Map getOtherAttributes() { - return otherAttributes; - } - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/CimInt.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/CimInt.java deleted file mode 100644 index dd08476eb0e18ccd57ca7964f67870b28cffcd42..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/CimInt.java +++ /dev/null @@ -1,83 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - - -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.common; - -import java.util.HashMap; -import java.util.Map; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyAttribute; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.XmlValue; -import javax.xml.namespace.QName; - - -/** - *

Java class for cimInt complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="cimInt">
- *   <simpleContent>
- *     <extension base="<http://www.w3.org/2001/XMLSchema>int">
- *       <anyAttribute processContents='lax'/>
- *     </extension>
- *   </simpleContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "cimInt", propOrder = { - "value" -}) -public class CimInt { - - @XmlValue - protected int value; - @XmlAnyAttribute - private Map otherAttributes = new HashMap(); - - /** - * Gets the value of the value property. - * - */ - public int getValue() { - return value; - } - - /** - * Sets the value of the value property. - * - */ - public void setValue(int value) { - this.value = value; - } - - /** - * Gets a map that contains attributes that aren't bound to any typed property on this class. - * - *

- * the map is keyed by the name of the attribute and - * the value is the string value of the attribute. - * - * the map returned by this method is live, and you can add new attribute - * by updating the map directly. Because of this design, there's no setter. - * - * - * @return - * always non-null - */ - public Map getOtherAttributes() { - return otherAttributes; - } - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/CimLong.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/CimLong.java deleted file mode 100644 index 67c68614ad2ed8b89876204f7dd2c9b2824b3300..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/CimLong.java +++ /dev/null @@ -1,87 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - - -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.common; - -import java.util.HashMap; -import java.util.Map; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyAttribute; -import javax.xml.bind.annotation.XmlSeeAlso; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.XmlValue; -import javax.xml.namespace.QName; - - -/** - *

Java class for cimLong complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="cimLong">
- *   <simpleContent>
- *     <extension base="<http://www.w3.org/2001/XMLSchema>long">
- *       <anyAttribute processContents='lax'/>
- *     </extension>
- *   </simpleContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "cimLong", propOrder = { - "value" -}) -@XmlSeeAlso({ - QualifierSInt64 .class -}) -public class CimLong { - - @XmlValue - protected long value; - @XmlAnyAttribute - private Map otherAttributes = new HashMap(); - - /** - * Gets the value of the value property. - * - */ - public long getValue() { - return value; - } - - /** - * Sets the value of the value property. - * - */ - public void setValue(long value) { - this.value = value; - } - - /** - * Gets a map that contains attributes that aren't bound to any typed property on this class. - * - *

- * the map is keyed by the name of the attribute and - * the value is the string value of the attribute. - * - * the map returned by this method is live, and you can add new attribute - * by updating the map directly. Because of this design, there's no setter. - * - * - * @return - * always non-null - */ - public Map getOtherAttributes() { - return otherAttributes; - } - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/CimReference.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/CimReference.java deleted file mode 100644 index d7cf41e05d655f557b20e4f64cabe049f6b4e7b0..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/CimReference.java +++ /dev/null @@ -1,103 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - - -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.common; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyAttribute; -import javax.xml.bind.annotation.XmlAnyElement; -import javax.xml.bind.annotation.XmlType; -import javax.xml.namespace.QName; -import org.w3c.dom.Element; - - -/** - *

Java class for cimReference complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="cimReference">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <any processContents='lax' namespace='##other' maxOccurs="unbounded"/>
- *       </sequence>
- *       <anyAttribute processContents='lax'/>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "cimReference", propOrder = { - "any" -}) -public class CimReference { - - @XmlAnyElement(lax = true) - protected List any; - @XmlAnyAttribute - private Map otherAttributes = new HashMap(); - - /** - * Gets the value of the any property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the any property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getAny().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link Object } - * {@link Element } - * - * - */ - public List getAny() { - if (any == null) { - any = new ArrayList(); - } - return this.any; - } - - /** - * Gets a map that contains attributes that aren't bound to any typed property on this class. - * - *

- * the map is keyed by the name of the attribute and - * the value is the string value of the attribute. - * - * the map returned by this method is live, and you can add new attribute - * by updating the map directly. Because of this design, there's no setter. - * - * - * @return - * always non-null - */ - public Map getOtherAttributes() { - return otherAttributes; - } - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/CimShort.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/CimShort.java deleted file mode 100644 index 4d57d3698d6b5c06fb83c2d35fafbbccff547cf7..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/CimShort.java +++ /dev/null @@ -1,83 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - - -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.common; - -import java.util.HashMap; -import java.util.Map; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyAttribute; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.XmlValue; -import javax.xml.namespace.QName; - - -/** - *

Java class for cimShort complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="cimShort">
- *   <simpleContent>
- *     <extension base="<http://www.w3.org/2001/XMLSchema>short">
- *       <anyAttribute processContents='lax'/>
- *     </extension>
- *   </simpleContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "cimShort", propOrder = { - "value" -}) -public class CimShort { - - @XmlValue - protected short value; - @XmlAnyAttribute - private Map otherAttributes = new HashMap(); - - /** - * Gets the value of the value property. - * - */ - public short getValue() { - return value; - } - - /** - * Sets the value of the value property. - * - */ - public void setValue(short value) { - this.value = value; - } - - /** - * Gets a map that contains attributes that aren't bound to any typed property on this class. - * - *

- * the map is keyed by the name of the attribute and - * the value is the string value of the attribute. - * - * the map returned by this method is live, and you can add new attribute - * by updating the map directly. Because of this design, there's no setter. - * - * - * @return - * always non-null - */ - public Map getOtherAttributes() { - return otherAttributes; - } - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/CimString.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/CimString.java deleted file mode 100644 index d721a07e4f00b1827daae01e1d157cacf17a2a94..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/CimString.java +++ /dev/null @@ -1,98 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - - -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.common; - -import java.util.HashMap; -import java.util.Map; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyAttribute; -import javax.xml.bind.annotation.XmlSeeAlso; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.XmlValue; -import javax.xml.namespace.QName; - - -/** - *

Java class for cimString complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="cimString">
- *   <simpleContent>
- *     <extension base="<http://www.w3.org/2001/XMLSchema>string">
- *       <anyAttribute processContents='lax'/>
- *     </extension>
- *   </simpleContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "cimString", propOrder = { - "value" -}) -@XmlSeeAlso({ - CimChar16 .class, - QualifierString.class, - org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.cim_schema._2.cim_virtualsystemsettingdata.Caption.class, - org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.cim_schema._2.cim_resourceallocationsettingdata.Caption.class -}) -public class CimString { - - @XmlValue - protected String value; - @XmlAnyAttribute - private Map otherAttributes = new HashMap(); - - /** - * Gets the value of the value property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getValue() { - return value; - } - - /** - * Sets the value of the value property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setValue(String value) { - this.value = value; - } - - /** - * Gets a map that contains attributes that aren't bound to any typed property on this class. - * - *

- * the map is keyed by the name of the attribute and - * the value is the string value of the attribute. - * - * the map returned by this method is live, and you can add new attribute - * by updating the map directly. Because of this design, there's no setter. - * - * - * @return - * always non-null - */ - public Map getOtherAttributes() { - return otherAttributes; - } - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/CimUnsignedByte.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/CimUnsignedByte.java deleted file mode 100644 index 1e55f15270a3b9bb35f71d7eb7bf85b82e0d9236..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/CimUnsignedByte.java +++ /dev/null @@ -1,85 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - - -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.common; - -import java.util.HashMap; -import java.util.Map; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyAttribute; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.XmlValue; -import javax.xml.namespace.QName; - - -/** - *

Java class for cimUnsignedByte complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="cimUnsignedByte">
- *   <simpleContent>
- *     <extension base="<http://www.w3.org/2001/XMLSchema>unsignedByte">
- *       <anyAttribute processContents='lax'/>
- *     </extension>
- *   </simpleContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "cimUnsignedByte", propOrder = { - "value" -}) -public class CimUnsignedByte { - - @XmlValue - @XmlSchemaType(name = "unsignedByte") - protected short value; - @XmlAnyAttribute - private Map otherAttributes = new HashMap(); - - /** - * Gets the value of the value property. - * - */ - public short getValue() { - return value; - } - - /** - * Sets the value of the value property. - * - */ - public void setValue(short value) { - this.value = value; - } - - /** - * Gets a map that contains attributes that aren't bound to any typed property on this class. - * - *

- * the map is keyed by the name of the attribute and - * the value is the string value of the attribute. - * - * the map returned by this method is live, and you can add new attribute - * by updating the map directly. Because of this design, there's no setter. - * - * - * @return - * always non-null - */ - public Map getOtherAttributes() { - return otherAttributes; - } - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/CimUnsignedInt.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/CimUnsignedInt.java deleted file mode 100644 index 3b2310e976501c045ae5821dd6d1568987898c47..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/CimUnsignedInt.java +++ /dev/null @@ -1,89 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - - -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.common; - -import java.util.HashMap; -import java.util.Map; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyAttribute; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlSeeAlso; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.XmlValue; -import javax.xml.namespace.QName; - - -/** - *

Java class for cimUnsignedInt complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="cimUnsignedInt">
- *   <simpleContent>
- *     <extension base="<http://www.w3.org/2001/XMLSchema>unsignedInt">
- *       <anyAttribute processContents='lax'/>
- *     </extension>
- *   </simpleContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "cimUnsignedInt", propOrder = { - "value" -}) -@XmlSeeAlso({ - QualifierUInt32 .class -}) -public class CimUnsignedInt { - - @XmlValue - @XmlSchemaType(name = "unsignedInt") - protected long value; - @XmlAnyAttribute - private Map otherAttributes = new HashMap(); - - /** - * Gets the value of the value property. - * - */ - public long getValue() { - return value; - } - - /** - * Sets the value of the value property. - * - */ - public void setValue(long value) { - this.value = value; - } - - /** - * Gets a map that contains attributes that aren't bound to any typed property on this class. - * - *

- * the map is keyed by the name of the attribute and - * the value is the string value of the attribute. - * - * the map returned by this method is live, and you can add new attribute - * by updating the map directly. Because of this design, there's no setter. - * - * - * @return - * always non-null - */ - public Map getOtherAttributes() { - return otherAttributes; - } - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/CimUnsignedLong.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/CimUnsignedLong.java deleted file mode 100644 index bcd0663e96c3ce185ad98235d44972860119c97b..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/CimUnsignedLong.java +++ /dev/null @@ -1,94 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - - -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.common; - -import java.math.BigInteger; -import java.util.HashMap; -import java.util.Map; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyAttribute; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.XmlValue; -import javax.xml.namespace.QName; - - -/** - *

Java class for cimUnsignedLong complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="cimUnsignedLong">
- *   <simpleContent>
- *     <extension base="<http://www.w3.org/2001/XMLSchema>unsignedLong">
- *       <anyAttribute processContents='lax'/>
- *     </extension>
- *   </simpleContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "cimUnsignedLong", propOrder = { - "value" -}) -public class CimUnsignedLong { - - @XmlValue - @XmlSchemaType(name = "unsignedLong") - protected BigInteger value; - @XmlAnyAttribute - private Map otherAttributes = new HashMap(); - - /** - * Gets the value of the value property. - * - * @return - * possible object is - * {@link BigInteger } - * - */ - public BigInteger getValue() { - return value; - } - - /** - * Sets the value of the value property. - * - * @param value - * allowed object is - * {@link BigInteger } - * - */ - public void setValue(BigInteger value) { - this.value = value; - } - - /** - * Gets a map that contains attributes that aren't bound to any typed property on this class. - * - *

- * the map is keyed by the name of the attribute and - * the value is the string value of the attribute. - * - * the map returned by this method is live, and you can add new attribute - * by updating the map directly. Because of this design, there's no setter. - * - * - * @return - * always non-null - */ - public Map getOtherAttributes() { - return otherAttributes; - } - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/CimUnsignedShort.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/CimUnsignedShort.java deleted file mode 100644 index 5106c475c66399fb9859433473835554b736a059..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/CimUnsignedShort.java +++ /dev/null @@ -1,85 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - - -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.common; - -import java.util.HashMap; -import java.util.Map; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyAttribute; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.XmlValue; -import javax.xml.namespace.QName; - - -/** - *

Java class for cimUnsignedShort complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="cimUnsignedShort">
- *   <simpleContent>
- *     <extension base="<http://www.w3.org/2001/XMLSchema>unsignedShort">
- *       <anyAttribute processContents='lax'/>
- *     </extension>
- *   </simpleContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "cimUnsignedShort", propOrder = { - "value" -}) -public class CimUnsignedShort { - - @XmlValue - @XmlSchemaType(name = "unsignedShort") - protected int value; - @XmlAnyAttribute - private Map otherAttributes = new HashMap(); - - /** - * Gets the value of the value property. - * - */ - public int getValue() { - return value; - } - - /** - * Sets the value of the value property. - * - */ - public void setValue(int value) { - this.value = value; - } - - /** - * Gets a map that contains attributes that aren't bound to any typed property on this class. - * - *

- * the map is keyed by the name of the attribute and - * the value is the string value of the attribute. - * - * the map returned by this method is live, and you can add new attribute - * by updating the map directly. Because of this design, there's no setter. - * - * - * @return - * always non-null - */ - public Map getOtherAttributes() { - return otherAttributes; - } - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/ObjectFactory.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/ObjectFactory.java deleted file mode 100644 index 1b05dcdf91c4ff262aa8d6094308a7c6ae00c9f7..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/ObjectFactory.java +++ /dev/null @@ -1,246 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - - -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.common; - -import javax.xml.bind.JAXBElement; -import javax.xml.bind.annotation.XmlElementDecl; -import javax.xml.bind.annotation.XmlRegistry; -import javax.xml.namespace.QName; - - -/** - * This object contains factory methods for each - * Java content interface and Java element interface - * generated in the org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.common package. - *

An ObjectFactory allows you to programatically - * construct new instances of the Java representation - * for XML content. The Java representation of XML - * content can consist of schema derived interfaces - * and classes representing the binding of schema - * type definitions, element declarations and model - * groups. Factory methods for each of these are - * provided in this class. - * - */ -@XmlRegistry -public class ObjectFactory { - - private final static QName _DefaultValue_QNAME = new QName("http://schemas.dmtf.org/wbem/wscim/1/common", "DefaultValue"); - private final static QName _CimDateTimeCIMDateTime_QNAME = new QName("http://schemas.dmtf.org/wbem/wscim/1/common", "CIM_DateTime"); - - /** - * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.common - * - */ - public ObjectFactory() { - } - - /** - * Create an instance of {@link CimFloat } - * - */ - public CimFloat createCimFloat() { - return new CimFloat(); - } - - /** - * Create an instance of {@link QualifierSArray } - * - */ - public QualifierSArray createQualifierSArray() { - return new QualifierSArray(); - } - - /** - * Create an instance of {@link CimInt } - * - */ - public CimInt createCimInt() { - return new CimInt(); - } - - /** - * Create an instance of {@link CimUnsignedInt } - * - */ - public CimUnsignedInt createCimUnsignedInt() { - return new CimUnsignedInt(); - } - - /** - * Create an instance of {@link CimByte } - * - */ - public CimByte createCimByte() { - return new CimByte(); - } - - /** - * Create an instance of {@link CimShort } - * - */ - public CimShort createCimShort() { - return new CimShort(); - } - - /** - * Create an instance of {@link CimUnsignedShort } - * - */ - public CimUnsignedShort createCimUnsignedShort() { - return new CimUnsignedShort(); - } - - /** - * Create an instance of {@link QualifierUInt32 } - * - */ - public QualifierUInt32 createQualifierUInt32() { - return new QualifierUInt32(); - } - - /** - * Create an instance of {@link CimDateTime } - * - */ - public CimDateTime createCimDateTime() { - return new CimDateTime(); - } - - /** - * Create an instance of {@link CimReference } - * - */ - public CimReference createCimReference() { - return new CimReference(); - } - - /** - * Create an instance of {@link CimBase64Binary } - * - */ - public CimBase64Binary createCimBase64Binary() { - return new CimBase64Binary(); - } - - /** - * Create an instance of {@link CimLong } - * - */ - public CimLong createCimLong() { - return new CimLong(); - } - - /** - * Create an instance of {@link QualifierSInt64 } - * - */ - public QualifierSInt64 createQualifierSInt64() { - return new QualifierSInt64(); - } - - /** - * Create an instance of {@link CimString } - * - */ - public CimString createCimString() { - return new CimString(); - } - - /** - * Create an instance of {@link CimChar16 } - * - */ - public CimChar16 createCimChar16() { - return new CimChar16(); - } - - /** - * Create an instance of {@link CimHexBinary } - * - */ - public CimHexBinary createCimHexBinary() { - return new CimHexBinary(); - } - - /** - * Create an instance of {@link CimUnsignedByte } - * - */ - public CimUnsignedByte createCimUnsignedByte() { - return new CimUnsignedByte(); - } - - /** - * Create an instance of {@link CimDouble } - * - */ - public CimDouble createCimDouble() { - return new CimDouble(); - } - - /** - * Create an instance of {@link CimUnsignedLong } - * - */ - public CimUnsignedLong createCimUnsignedLong() { - return new CimUnsignedLong(); - } - - /** - * Create an instance of {@link QualifierString } - * - */ - public QualifierString createQualifierString() { - return new QualifierString(); - } - - /** - * Create an instance of {@link CimAnySimpleType } - * - */ - public CimAnySimpleType createCimAnySimpleType() { - return new CimAnySimpleType(); - } - - /** - * Create an instance of {@link CimBoolean } - * - */ - public CimBoolean createCimBoolean() { - return new CimBoolean(); - } - - /** - * Create an instance of {@link QualifierBoolean } - * - */ - public QualifierBoolean createQualifierBoolean() { - return new QualifierBoolean(); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link Object }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/wbem/wscim/1/common", name = "DefaultValue") - public JAXBElement createDefaultValue(Object value) { - return new JAXBElement(_DefaultValue_QNAME, Object.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://schemas.dmtf.org/wbem/wscim/1/common", name = "CIM_DateTime", scope = CimDateTime.class) - public JAXBElement createCimDateTimeCIMDateTime(String value) { - return new JAXBElement(_CimDateTimeCIMDateTime_QNAME, String.class, CimDateTime.class, value); - } - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/QualifierBoolean.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/QualifierBoolean.java deleted file mode 100644 index 1d3dce6d10441e84e150f6dcd2da7928bcbf764e..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/QualifierBoolean.java +++ /dev/null @@ -1,60 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - - -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.common; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlType; - - -/** - *

Java class for qualifierBoolean complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="qualifierBoolean">
- *   <simpleContent>
- *     <extension base="<http://schemas.dmtf.org/wbem/wscim/1/common>cimBoolean">
- *       <attribute ref="{http://schemas.dmtf.org/wbem/wscim/1/common}qualifier use="required""/>
- *       <anyAttribute processContents='lax'/>
- *     </extension>
- *   </simpleContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "qualifierBoolean") -public class QualifierBoolean - extends CimBoolean -{ - - @XmlAttribute(namespace = "http://schemas.dmtf.org/wbem/wscim/1/common", required = true) - protected boolean qualifier; - - /** - * Gets the value of the qualifier property. - * - */ - public boolean isQualifier() { - return qualifier; - } - - /** - * Sets the value of the qualifier property. - * - */ - public void setQualifier(boolean value) { - this.qualifier = value; - } - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/QualifierSArray.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/QualifierSArray.java deleted file mode 100644 index c08a4fc7f1d1ad585ca925a3f38af29637424494..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/QualifierSArray.java +++ /dev/null @@ -1,40 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - - -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.common; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlType; - - -/** - *

Java class for qualifierSArray complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="qualifierSArray">
- *   <simpleContent>
- *     <extension base="<http://schemas.dmtf.org/wbem/wscim/1/common>qualifierString">
- *       <anyAttribute processContents='lax'/>
- *     </extension>
- *   </simpleContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "qualifierSArray") -public class QualifierSArray - extends QualifierString -{ - - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/QualifierSInt64.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/QualifierSInt64.java deleted file mode 100644 index e3709bc277a83528b68cede63f7f20786f28db0e..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/QualifierSInt64.java +++ /dev/null @@ -1,60 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - - -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.common; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlType; - - -/** - *

Java class for qualifierSInt64 complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="qualifierSInt64">
- *   <simpleContent>
- *     <extension base="<http://schemas.dmtf.org/wbem/wscim/1/common>cimLong">
- *       <attribute ref="{http://schemas.dmtf.org/wbem/wscim/1/common}qualifier use="required""/>
- *       <anyAttribute processContents='lax'/>
- *     </extension>
- *   </simpleContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "qualifierSInt64") -public class QualifierSInt64 - extends CimLong -{ - - @XmlAttribute(namespace = "http://schemas.dmtf.org/wbem/wscim/1/common", required = true) - protected boolean qualifier; - - /** - * Gets the value of the qualifier property. - * - */ - public boolean isQualifier() { - return qualifier; - } - - /** - * Sets the value of the qualifier property. - * - */ - public void setQualifier(boolean value) { - this.qualifier = value; - } - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/QualifierString.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/QualifierString.java deleted file mode 100644 index a2bece62206be5460fc06c9b8017420686bacde5..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/QualifierString.java +++ /dev/null @@ -1,64 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - - -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.common; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlSeeAlso; -import javax.xml.bind.annotation.XmlType; - - -/** - *

Java class for qualifierString complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="qualifierString">
- *   <simpleContent>
- *     <extension base="<http://schemas.dmtf.org/wbem/wscim/1/common>cimString">
- *       <attribute ref="{http://schemas.dmtf.org/wbem/wscim/1/common}qualifier use="required""/>
- *       <anyAttribute processContents='lax'/>
- *     </extension>
- *   </simpleContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "qualifierString") -@XmlSeeAlso({ - QualifierSArray.class -}) -public class QualifierString - extends CimString -{ - - @XmlAttribute(namespace = "http://schemas.dmtf.org/wbem/wscim/1/common", required = true) - protected boolean qualifier; - - /** - * Gets the value of the qualifier property. - * - */ - public boolean isQualifier() { - return qualifier; - } - - /** - * Sets the value of the qualifier property. - * - */ - public void setQualifier(boolean value) { - this.qualifier = value; - } - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/QualifierUInt32.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/QualifierUInt32.java deleted file mode 100644 index 7f0f33ef8185d15ad91d8512926e0b44c7184d41..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/QualifierUInt32.java +++ /dev/null @@ -1,60 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - - -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.common; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlType; - - -/** - *

Java class for qualifierUInt32 complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="qualifierUInt32">
- *   <simpleContent>
- *     <extension base="<http://schemas.dmtf.org/wbem/wscim/1/common>cimUnsignedInt">
- *       <attribute ref="{http://schemas.dmtf.org/wbem/wscim/1/common}qualifier use="required""/>
- *       <anyAttribute processContents='lax'/>
- *     </extension>
- *   </simpleContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "qualifierUInt32") -public class QualifierUInt32 - extends CimUnsignedInt -{ - - @XmlAttribute(namespace = "http://schemas.dmtf.org/wbem/wscim/1/common", required = true) - protected boolean qualifier; - - /** - * Gets the value of the qualifier property. - * - */ - public boolean isQualifier() { - return qualifier; - } - - /** - * Sets the value of the qualifier property. - * - */ - public void setQualifier(boolean value) { - this.qualifier = value; - } - -} diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/package-info.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/package-info.java deleted file mode 100644 index 83709d764509ca6fb76ba720a5cf2312f3efc0a5..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/dmtf/schemas/wbem/wscim/_1/common/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.07.20 at 12:21:44 PM CEST -// - -@javax.xml.bind.annotation.XmlSchema(namespace = "http://schemas.dmtf.org/wbem/wscim/1/common", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) -package org.ow2.contrail.federation.application.ovf.dmtf.schemas.wbem.wscim._1.common; diff --git a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/item_processor/OVFCdDriveProcessor.java b/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/item_processor/OVFCdDriveProcessor.java deleted file mode 100644 index b2f0d222f2a31241dcc65cb63c58aed6bccb3576..0000000000000000000000000000000000000000 --- a/common/trunk/src/ovf-parser/OVFParser/src/org/ow2/contrail/federation/application/ovf/item_processor/OVFCdDriveProcessor.java +++ /dev/null @@ -1,38 +0,0 @@ -package org.ow2.contrail.federation.application.ovf.item_processor; - - -import org.ow2.contrail.federation.application.ovf.OVFItemProcessor; -import org.ow2.contrail.federation.application.ovf.OVFVirtualHardware; -import org.ow2.contrail.federation.application.ovf.virtualhardware.OVFVirtualHwCdDrive; -import org.w3c.dom.DOMException; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - -public class OVFCdDriveProcessor extends OVFItemProcessor { - - @Override - public OVFVirtualHardware processItem(Node xmlNode) throws DOMException { - - OVFVirtualHwCdDrive cd = new OVFVirtualHwCdDrive(); - - NodeList childs = xmlNode.getChildNodes(); - - for (int i=0; i - - contegrator - - - - - - org.python.pydev.PyDevBuilder - - - - - - org.python.pydev.pythonNature - - diff --git a/common/trunk/test/contegrator/.pydevproject b/common/trunk/test/contegrator/.pydevproject deleted file mode 100644 index fbaa0b2d75abff9272263775c41beac07f06a3bd..0000000000000000000000000000000000000000 --- a/common/trunk/test/contegrator/.pydevproject +++ /dev/null @@ -1,10 +0,0 @@ - - - - -Python 2.7 -python 2.7 - -/contegrator/src - - diff --git a/common/trunk/test/contegrator/example/one-test/nodes/head/install.xml b/common/trunk/test/contegrator/example/one-test/nodes/head/install.xml deleted file mode 100644 index e7a9f43b3a9f91ccd96651f3c79dbb8ced746fd4..0000000000000000000000000000000000000000 --- a/common/trunk/test/contegrator/example/one-test/nodes/head/install.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - xmlns="http://contrail-project.eu/schema/2011/08/install"> - one-test-1.0-opennebula-stress-test.tar.gz - diff --git a/common/trunk/test/contegrator/example/one-test/nodes/head/scripts/fix-scripts.sh b/common/trunk/test/contegrator/example/one-test/nodes/head/scripts/fix-scripts.sh deleted file mode 100755 index 68f4d65229366244d7a97951c98024bc82c55ce9..0000000000000000000000000000000000000000 --- a/common/trunk/test/contegrator/example/one-test/nodes/head/scripts/fix-scripts.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -rm /var/lib/one-nfsshare/remotes/im/kvm.d/freespace.sh diff --git a/common/trunk/test/contegrator/example/one-test/nodes/worker/install.xml b/common/trunk/test/contegrator/example/one-test/nodes/worker/install.xml deleted file mode 100644 index 5bf9d8197e04fccf203b17b873c30980b5b9583b..0000000000000000000000000000000000000000 --- a/common/trunk/test/contegrator/example/one-test/nodes/worker/install.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - xmlns="http://contrail-project.eu/schema/2011/08/install"> - diff --git a/common/trunk/test/contegrator/example/one-test/nodes/worker/scripts/fix-nfs.sh b/common/trunk/test/contegrator/example/one-test/nodes/worker/scripts/fix-nfs.sh deleted file mode 100755 index 9a8ffa20b0d57e44564ca3308ccfe21404558634..0000000000000000000000000000000000000000 --- a/common/trunk/test/contegrator/example/one-test/nodes/worker/scripts/fix-nfs.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -HEAD_VNFS_NAME=`echo $VNFS_NAME | sed -e 's/worker$/head/'` -cp /etc/fstab /etc/fstab.orig -sed -e "s/one-2.2-head-jaKa/$HEAD_VNFS_NAME/g" /etc/fstab diff --git a/common/trunk/test/contegrator/example/one-test/test/stress.py b/common/trunk/test/contegrator/example/one-test/test/stress.py deleted file mode 100644 index ccb7dc230e519401efce26c2ad6e6b3d51ecad0f..0000000000000000000000000000000000000000 --- a/common/trunk/test/contegrator/example/one-test/test/stress.py +++ /dev/null @@ -1,18 +0,0 @@ -# the following variables that are in the context when the test cases are run -# are of special importance to us: -# - ct_node_list: mapping node names (dir names of node definitions) to host names -# - nodeman: a NodeManager instance that can be used to issue ssh commands to the nodes - -def test_stress(ct_node_list, ct_nodeman): - head = ct_node_list["head"] - worker = ct_node_list["worker"] - try: - ct_nodeman.sshrun("root", head, "sleep 30") - ct_nodeman.sshrun("root", head, "service opennebula restart") - ct_nodeman.sshrun("root", head, "sleep 30") - ct_nodeman.sshrun("root", head, "onehost create " + head + " im_kvm vmm_kvm tm_nfs") - ct_nodeman.sshrun("root", head, "onehost create " + worker + " im_kvm vmm_kvm tm_nfs") - ct_nodeman.sshrun("root", head, "onevnet publish 205") - ct_nodeman.sshrun("root", head, "/usr/bin/one-test-run.sh") - finally: - pass diff --git a/common/trunk/test/contegrator/example/test-suite/nodes/node-1/config/config.tar.gz b/common/trunk/test/contegrator/example/test-suite/nodes/node-1/config/config.tar.gz deleted file mode 100644 index 7e0ab3e4d916148b364d7f2c1c27013c1af93403..0000000000000000000000000000000000000000 Binary files a/common/trunk/test/contegrator/example/test-suite/nodes/node-1/config/config.tar.gz and /dev/null differ diff --git a/common/trunk/test/contegrator/example/test-suite/nodes/node-1/install.xml b/common/trunk/test/contegrator/example/test-suite/nodes/node-1/install.xml deleted file mode 100644 index 035c75afb2a650a748618017073917ea332a682d..0000000000000000000000000000000000000000 --- a/common/trunk/test/contegrator/example/test-suite/nodes/node-1/install.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - xmlns="http://contrail-project.eu/schema/2011/08/install"> - fortunes - test.tar.gz - diff --git a/common/trunk/test/contegrator/example/test-suite/nodes/node-1/scripts/script.sh b/common/trunk/test/contegrator/example/test-suite/nodes/node-1/scripts/script.sh deleted file mode 100755 index 9dbc6522e66ecd0ab507575f924b257a6c1ad4b9..0000000000000000000000000000000000000000 --- a/common/trunk/test/contegrator/example/test-suite/nodes/node-1/scripts/script.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -touch /touched diff --git a/common/trunk/test/contegrator/example/test-suite/test/testcase-1.py b/common/trunk/test/contegrator/example/test-suite/test/testcase-1.py deleted file mode 100644 index b3da17d53444a5972b3fdec05853ad4933445797..0000000000000000000000000000000000000000 --- a/common/trunk/test/contegrator/example/test-suite/test/testcase-1.py +++ /dev/null @@ -1,8 +0,0 @@ - - -def test_1(): - print "I will pass." - -def test_2(): - print "I will fail." - raise Exception() diff --git a/common/trunk/test/contegrator/example/test-suite/test/testcase-2.py b/common/trunk/test/contegrator/example/test-suite/test/testcase-2.py deleted file mode 100644 index 765983f0d3774832bcb8ea51612731eb38d28d8a..0000000000000000000000000000000000000000 --- a/common/trunk/test/contegrator/example/test-suite/test/testcase-2.py +++ /dev/null @@ -1,6 +0,0 @@ -def test_A(): - print "I'm a failure as well." - raise ValueError() - -def not_a_test(): - print "I shouldn't be executing." diff --git a/common/trunk/test/contegrator/src/contegrator.py b/common/trunk/test/contegrator/src/contegrator.py deleted file mode 100644 index 85b591f57db810d28eb9f63da09cfabfdb561790..0000000000000000000000000000000000000000 --- a/common/trunk/test/contegrator/src/contegrator.py +++ /dev/null @@ -1,124 +0,0 @@ -''' -contegrator.py - -integration test driver for Contrail -- manage VNFS capsules for test machines -- provision and boot test machines via perceus -- run test cases - -@author: jaka -''' - -import sys -import logging -import os -import types -import traceback - -from image.imager import Imager -from nodes.nodeman import NodeMan, Node, ResourceError - -from testbedconfig import testbed_node_list, ct_prestaged, ct_prestaged_nodes - -usage = "contegrator " - -ct_node_list = {} -ct_nodeman = None - -if __name__ == '__main__': - # takes two arguments: - # 1. release tag to test (should equal the tag used by bamboo to - # store binary packages) - # 2. path to test suite dir (containing path to nodes and test directories) - if len(sys.argv) != 3: - print usage - sys.exit(1) - - release_tag = sys.argv[1] - nodes_dir = os.path.join(sys.argv[2], "nodes") - test_dir = os.path.join(sys.argv[2], "test") - - logging.basicConfig(level = logging.DEBUG) - - logging.debug("contegrator starting.") - - print "Preparing images for release ", release_tag - print "from configuration directory", nodes_dir - - imager = Imager(release_tag, nodes_dir, testbed_node_list) - images = imager.prepare_nodes(ct_prestaged) - for image in images: - print "Node '", image, "' image name", images[image]["name"], "image type", images[image]["type"] - - print "Images prepared." - print "Acquiring physical nodes and booting images ..." - - nodeman = NodeMan(testbed_node_list) - ct_nodeman = nodeman - if not ct_prestaged: - try: - for image in images: - node = nodeman.add_phy_node(image, images[image]["name"]) - nodeman.reboot_phy_node(node) - ct_node_list[image] = node.get_host_name() - if nodeman.wait_for_phy_nodes(10, 30): - print "Nodes booted." - else: - print "Nodes not booted in time." - except ResourceError as ex: - logging.exception("Failed to add physical node.") - print "No more physical nodes to work with." - else: - ct_node_list = ct_prestaged_nodes - - for node in ct_node_list: - print "Node", node, "running on host", ct_node_list[node] - - print "Nodes are up and running." - - # at this point, test scripts have hostnames of nodes (named after their respective directories) - # readily available in dict ct_node_list, key is node name (aka node dir name), value is - # host name - - # NOTE: we currently only support test cases coded in python - tmp_test_cases = os.listdir(test_dir) - test_cases = [] - for tc in tmp_test_cases: - if tc.endswith(".py"): - tc = tc.replace(".py", "") - test_cases.append(tc) - sys.path.insert(0, test_dir) - for tc in test_cases: - print "Executing test module:", tc - # import test case as a module - tc_pass = 0 - tc_fail = 0 - tc_total = 0 - tc_mod = __import__(tc, globals(), locals(), ['*']) - for i in dir(tc_mod): - if i.startswith("test_"): - f = tc_mod.__dict__.get(i) - if isinstance(f, types.FunctionType): - tc_name = tc + "." + i - print "Running test case", tc_name - tc_total += 1 - try: - f(ct_node_list, ct_nodeman) - print "Test case", tc_name, "passed." - tc_pass += 1 - except: - print "Test case", tc_name, "failed." - traceback.print_exc(None, sys.stdout) - tc_fail += 1 - print "Passed / Failed / Total:", tc_pass, "/", tc_fail, "/", tc_total - - if not ct_prestaged: - # finally, shut down nodes and purge test vnfses - print "Shutting nodes down ..." - nodeman.shutdown_phy_nodes() - print "Nodes shut down." - print "Purging test VNFS capsules ..." - imager.purge_nodes(images, ct_prestaged) - print "VNFS capsules purged." - - print "Have a nice day." diff --git a/common/trunk/test/contegrator/src/image/imagedef.py b/common/trunk/test/contegrator/src/image/imagedef.py deleted file mode 100644 index 71b1bd0f624267de38153d4538c5acb46deb9db7..0000000000000000000000000000000000000000 --- a/common/trunk/test/contegrator/src/image/imagedef.py +++ /dev/null @@ -1,92 +0,0 @@ -''' -Created on Aug 30, 2011 - -@author: jaka -''' - -from xml.etree import ElementTree - -import logging -import string - -class ImageDefError(Exception): - def __init__(self, msg): - self._msg = msg - - def get_error_message(self): - return self._msg - -class ImageDef(object): - ''' - Example image definition XML: - - - xmlns="http://contrail-project.eu/schema/2011/08/install"> - upstream-package-name-1 - upstream-package-name-2 - upstream-package-name-3 - contrail-package-name-1 - contrail-package-name-2 - - ''' - - TAG_NODE = "node" - TAG_UPSTREAM = "upstream" - TAG_CONTRAIL = "contrail" - - ATTR_TYPE = "type" - ATTR_BASE = "base" - ATTR_REPO = "repository" - - IMAGE_TYPE_VNFS = "vnfs" - IMAGE_TYPE_VM = "vm" - - def __init__(self): - ''' - Constructor - ''' - self.syspackages = [] - self.ctrpackages = [] - self.repo = None - self.type = None - self.base = None - - def _init_from_elem(self, root): - logging.debug("Parsing image definition") - if root.tag != ImageDef.TAG_NODE: - raise ImageDefError("Root element is not " + ImageDef.TAG_NODE) - if not ( ImageDef.ATTR_TYPE in root.attrib and - ImageDef.ATTR_BASE in root.attrib and - ImageDef.ATTR_REPO in root.attrib ): - raise ImageDefError("Node must specify type, base image and repository URL") - self.repo = root.get(ImageDef.ATTR_REPO) - self.base = root.get(ImageDef.ATTR_BASE) - self.type = root.get(ImageDef.ATTR_TYPE) - for pkg in root.getiterator(ImageDef.TAG_UPSTREAM): - self.syspackages.append(string.strip(pkg.text)) - for pkg in root.getiterator(ImageDef.TAG_CONTRAIL): - self.ctrpackages.append(string.strip(pkg.text)) - - def parse_string(self, deftext): - root = ElementTree.fromstring(deftext) - self._init_from_elem(root.getroot()) - - def parse_file(self, path): - root = ElementTree.parse(path) - self._init_from_elem(root.getroot()) - - def get_sys_packages(self): - return self.syspackages - - def get_contrail_packages(self): - return self.ctrpackages - - def get_repository(self): - return self.repo - - def get_image_type(self): - return self.type - - def get_base_image_name(self): - return self.base diff --git a/common/trunk/test/contegrator/src/image/imager.py b/common/trunk/test/contegrator/src/image/imager.py deleted file mode 100644 index 1060c15a29df6705f85f1be58871ea6f1245db93..0000000000000000000000000000000000000000 --- a/common/trunk/test/contegrator/src/image/imager.py +++ /dev/null @@ -1,230 +0,0 @@ -''' -Created on Aug 31, 2011 - -@author: jaka -''' - -from image.imagedef import ImageDef, ImageDefError -from perceus.perceus import Perceus -from image.installer import Installer - -import tempfile -import logging -import os -import shutil -import urllib - -usage = """ct-imager.py """ - -class Imager(object): - - VNFS_ID_FILE = "vnfs_id.txt" - VNFS_ID_PATH = "/" + VNFS_ID_FILE - - def __init__(self, release_tag, nodes_cfg_dir, node_list = None): - self._release_tag = release_tag - self._nodes_cfg_dir = nodes_cfg_dir - self._perceus = Perceus(node_list) - self._images = [] - - def _get_test_vnfs_name(self, node_id): - return "test-vnfs-" + self._release_tag + "-" + node_id - - def _prepare_node_vnfs(self, imagedef, node_id): - node_cfg_dir = os.path.join(self._nodes_cfg_dir, node_id) - logging.debug("Preparing VNFS node: " + node_cfg_dir + "," + - self._release_tag + "," + node_id) - # clone VNFS - test_vnfs = self._get_test_vnfs_name(node_id) - if not self._perceus.clone_vnfs(imagedef.get_base_image_name(), test_vnfs): - logging.error("Failed to clone test VNFS.") - return None - logging.debug("VNFS cloned to: " + test_vnfs) - mount_path = self._perceus.mount_vnfs(test_vnfs) - if mount_path is None: - logging.error("Failed to mount test VNFS.") - return None - logging.debug("VNFS mounted to: " + mount_path) - # fix fstab in case it sports NFS mounts - orig_fstab = os.path.join(mount_path, "etc", "fstab") - bak_fstab = os.path.join(mount_path, "etc", "fstab.bak") - shutil.copyfile(orig_fstab, bak_fstab) - with open(bak_fstab, "r") as bak_f: - with open(orig_fstab, "w") as orig_f: - line = bak_f.readline() - while(len(line) > 0): - if(line.find("nfs") != -1 and line.find(imagedef.get_base_image_name())): - line = line.replace(imagedef.get_base_image_name(), test_vnfs) - orig_f.write(line) - line = bak_f.readline() - # install additional system packages - installer = Installer(mount_path) - if not installer.install(imagedef.get_sys_packages()): - logging.error("Failed to install system packages.") - return None - logging.debug("System packages installed.") - # fetch contrail packages - if len(imagedef.get_contrail_packages()) > 0: - pkg_dir = tempfile.mkdtemp(".tmp", "contrail") - logging.debug("Fetching contrail packages to " + pkg_dir + ": " + - " ".join(imagedef.get_contrail_packages()) + " ...") - local_pkg_paths = [] - for pkg in imagedef.get_contrail_packages(): - try: - pkg_url = imagedef.get_repository() + "/" + self._release_tag + "/" + pkg - local_pkg_path = pkg_dir + "/" + pkg - logging.debug("Fetching " + pkg_url + " to " + local_pkg_path) - (fname, headers) = urllib.urlretrieve(pkg_url, local_pkg_path) - local_pkg_paths.append(fname) - logging.debug("Fetched package " + pkg_url + " to " + fname) - except: - logging.exception("Failed to retrieve Contrail package: " + pkg) - return None - logging.debug("Contrail packages fetched. Unpacking ...") - # install contrail packages - if not installer.unpack(local_pkg_paths): - logging.error("Failed to unpack Contrail packages.") - return None - logging.debug("Contrail packages unpacked.") - try: - shutil.rmtree(pkg_dir) - except: - logging.exception("Failed to remove temporary package dir: " + pkg_dir) - else: - logging.debug("No contrail packages to fetch.") - # unpack config files - cfg_dir = os.path.join(node_cfg_dir, "config") - if os.path.isdir(cfg_dir): - tmp_cfg_files = os.listdir(cfg_dir) - cfg_files = [] - for f in tmp_cfg_files: - p = os.path.join(cfg_dir, f) - if not f.startswith(".") and f.endswith(".tar.gz") and os.path.isfile(p): - cfg_files.append(p) - if len(cfg_files) > 0: - logging.debug("Unpacking config files ...") - if not installer.unpack(cfg_files): - logging.error("Failed to unpack configuration tarballs.") - return None - logging.debug("Config files unpacked.") - else: - logging.debug("No config files to unpack.") - # execute scripts, chrooted - # TODO: what do we want to pass to these scripts via env var? - # some ideas: - # - original and cloned vnfs names - scripts_dir = os.path.join(node_cfg_dir, "scripts") - if os.path.isdir(scripts_dir): - tmp_script_files = os.listdir(scripts_dir) - script_files = [] - for f in tmp_script_files: - p = os.path.join(scripts_dir, f) - if not f.startswith(".") and os.path.isfile(p): - script_files.append(f) - if len(script_files) > 0: - tmp_dir = tempfile.mkdtemp(".tmp", "contrail", - os.path.join(mount_path, "tmp")) - logging.debug("Temporary scripts dir: " + tmp_dir) - (head, tail) = os.path.split(tmp_dir) - if len(tail) == 0: - (head, tail) = os.path.split(head) - chroot_tmp_dir = os.path.join("/tmp", tail) - logging.debug("Temporary scripts dir (chroot): " + chroot_tmp_dir) - for script in script_files: - try: - src_script_path = os.path.join(node_cfg_dir, "scripts", script) - dst_script_path = os.path.join(tmp_dir, script) - logging.debug("Copying script file " + src_script_path + " to " + dst_script_path) - shutil.copyfile(src_script_path, dst_script_path) - os.chmod(dst_script_path, 0755) - logging.debug("Copied script file to: " + dst_script_path) - except: - logging.exception("Failed to copy script: " + script) - return None - chroot_script_path = os.path.join(chroot_tmp_dir, script) - logging.debug("Executing script (in chroot): " + chroot_script_path) - if not installer.chroot([chroot_script_path], { 'VNFS_NAME': test_vnfs }): - logging.error("Failed to execute script: " + script) - return None - logging.debug("Executed.") - try: - shutil.rmtree(tmp_dir) - except: - logging.exception("Failed to remove temporary scripts dir: " + tmp_dir) - logging.debug("Scripts executed.") - else: - logging.debug("No scripts found.") - # create a file used to identify the node once it comes up - vnfs_id_path = os.path.join(mount_path, Imager.VNFS_ID_FILE) - with open(vnfs_id_path, "w") as vnfs_id_file: - vnfs_id_file.write(test_vnfs) - # umount VNFS - if not self._perceus.umount_vnfs(test_vnfs): - logging.error("Failed to unmount test VNFS.") - return None - logging.debug("VNFS unmounted") - return test_vnfs - - def _prepare_node(self, node_id, prestaged = False): - node_cfg_dir = os.path.join(self._nodes_cfg_dir, node_id) - logging.debug("Preparing node " + node_id + " for release " + - self._release_tag + " from config dir " + node_cfg_dir) - # 1. parse image XML - imagedef = ImageDef() - install_path = os.path.join(node_cfg_dir, "install.xml") - try: - logging.debug("Parsing install configuration file: " + install_path) - imagedef.parse_file(install_path) - except ImageDefError as error: - logging.exception("Failed to parse node install file: " + - error.get_error_message()) - return None - except Exception as ex: - logging.exception("Failed to parse node install file.") - return None - if not prestaged: - if imagedef.get_image_type() == ImageDef.IMAGE_TYPE_VNFS: - if not prestaged: - return (self._prepare_node_vnfs(imagedef, node_id), - imagedef.get_image_type()) - else: - print "Unsupported image type:", imagedef.get_image_type() - return None - else: - return ("__prestaged__", imagedef.get_image_type()) - - def _purge_vnfs(self, vnfs_name): - # we might be using this after error, thus we do not know in what state the vnfs is: - # thus unmount first (and silently fail if not mounted), then delete - self._perceus.umount_vnfs(vnfs_name) - self._perceus.delete_vnfs(vnfs_name) - - def prepare_nodes(self, prestaged = False): - nodes_list = os.listdir(self._nodes_cfg_dir) - rv = {} - for node in nodes_list: - p = os.path.join(self._nodes_cfg_dir, node) - if node.startswith(".") or not os.path.isdir(p): - continue - (image_name, image_type) = self._prepare_node(node, prestaged) - if image_name is not None: - logging.info("Created node image " + node + " (" + - image_name + " , " + image_type + ")") - rv[node] = { "name": image_name, "type": image_type } - else: - logging.error("Failed to create node image for node: " + node) - self.purge_nodes(rv, prestaged) - return None - return rv - - def purge_nodes(self, node_map, prestaged = False): - if prestaged: - return - for node in node_map: - if node_map[node]["type"] == ImageDef.IMAGE_TYPE_VNFS: - self._purge_vnfs(node_map[node]["name"]) - elif node_map[node]["type"] == ImageDef.IMAGE_TYPE_VM: - # TODO - pass - else: - logging.error("Unknown node image type: " + node["type"]) diff --git a/common/trunk/test/contegrator/src/image/installer.py b/common/trunk/test/contegrator/src/image/installer.py deleted file mode 100644 index 77959c58a422e947b84cb403ca90ff73944bf093..0000000000000000000000000000000000000000 --- a/common/trunk/test/contegrator/src/image/installer.py +++ /dev/null @@ -1,77 +0,0 @@ -''' -Created on Aug 30, 2011 - -@author: jaka -''' - -import subprocess -from subprocess import CalledProcessError - -import logging -import os -import shutil - -class Installer(object): - ''' - classdocs - ''' - - def __init__(self, mount_point): - ''' - Constructor - ''' - self._mount_point = mount_point - self._tar_cmd = "tar" - self._apt_cmd = "apt-get" - self._chroot_cmd = "chroot" - - def install(self, package_list): - logging.debug("Installing system packages: " + " ".join(package_list)) - if None is package_list or len(package_list) == 0: - return True - arg_list = [self._chroot_cmd, self._mount_point, self._apt_cmd, "-q", "-y", "--force-yes", "install"] - arg_list.extend(package_list) - logging.debug("Install cmd: " + " ".join(arg_list)) - try: - new_env = os.environ.copy() - new_env['DEBIAN_FRONTEND'] = "noninteractive" - subprocess.check_call(arg_list, env = new_env) - return True - except CalledProcessError as error: - logging.exception("Failed to install packages to VNFS: " + str(error.returncode)) - return False - except OSError as error: - logging.exception("Failed to install packages to VNFS.") - return False - - def unpack(self, tarball_list): - for tarball in tarball_list: - try: - subprocess.check_call([self._tar_cmd, "xzvf", tarball, "-C", self._mount_point]) - except CalledProcessError as error: - logging.exception("Failed to install packages to VNFS: " + str(error.returncode)) - return False - return True - - def chroot(self, cmd_args, env = {}): - arg_list = [self._chroot_cmd, self._mount_point] - arg_list.extend(cmd_args) - logging.debug("Chroot cmd: " + " ".join(arg_list)) - try: - new_env = os.environ.copy() - new_env.update(env) - subprocess.check_call(arg_list, env = new_env) - return True - except CalledProcessError as error: - logging.exception("Failed to execute chrooted script: " + str(error.returncode)) - return False - - def delete(self, local_path): - abs_path = os.path.join(self._mount_point, local_path) - logging.debug("Deleting " + abs_path) - try: - shutil.rmtree(abs_path) - return True - except: - logging.exception("Failed to remove " + abs_path) - return False diff --git a/common/trunk/test/contegrator/src/nodes/nodeman.py b/common/trunk/test/contegrator/src/nodes/nodeman.py deleted file mode 100644 index 07980eeef81d6851827642adaec3421d3c3ffbcc..0000000000000000000000000000000000000000 --- a/common/trunk/test/contegrator/src/nodes/nodeman.py +++ /dev/null @@ -1,175 +0,0 @@ -''' -Created on Aug 31, 2011 - -@author: jaka -''' - -from perceus.perceus import Perceus -from image.imagedef import ImageDef -from image.imager import Imager - -from testbedconfig import node_passwords, ct_perceus_util_node - -from fabric.api import env -from fabric.operations import run, _AttributeString - -import logging -import time - - -class ResourceError(Exception): - def __init__(self, msg): - self._msg = msg - - def get_message(self): - return self._msg - - -class Node(object): - def __init__(self, **nodeparams): - self._name = nodeparams['name'] - self._host = nodeparams['host'] - self._image_name = nodeparams['image_name'] - self._image_type = nodeparams['image_type'] - - def get_name(self): - return self._name - - def get_host_name(self): - return self._host - - def get_image_name(self): - return self._image_name - - def get_image_type(self): - return self._image_type - - def __str__(self, *args, **kwargs): - return "(" + self._host + "," + self._image_type + ":" + self._image_name + ")" - - -class NodeMan(object): - def __init__(self, available_nodes = None, - perceus_util_cmd = "/srv/util/perceus-util.sh"): - self._perceus_util_cmd = perceus_util_cmd - self._perceus = Perceus(available_nodes) - self._phy_nodes = [] - - def setup_fabric_env(self): - env.shell = "/bin/bash -l -i -c" - env.passwords = node_passwords - env.warn_only = True - env.disable_known_hosts = True - - def _run_via_ssh(self, node, cmd, **kwargs): - args = { "user": "root", - "timeout": 30 } - args.update(kwargs) - self.setup_fabric_env() - env.host_string = args["user"] + "@" + node - cmd_str = " ".join(cmd) - logging.debug("Running [" + cmd_str + "] on " + env.host_string) - try: - rv = run(cmd_str) - except SystemExit as e: - rv = _AttributeString("") - rv.succeeded = False - rv.failed = True - rv.return_code = -1 - logging.debug("Success: " + str(rv.succeeded)) - logging.debug("Return code: " + str(rv.return_code)) - logging.debug("Output: " + rv) - return rv - - def sshrun(self, user, host, cmd): - self.setup_fabric_env() - env.host_string = user + "@" + host - try: - rv = run(cmd) - except SystemExit as e: - rv = _AttributeString("") - rv.succeeded = False - rv.failed = True - rv.return_code = -1 - logging.debug("Success: " + str(rv.succeeded)) - logging.debug("Return code: " + str(rv.return_code)) - logging.debug("Output: " + rv) - return rv - - def _log_cmd(self, cmd_list): - logging.debug("Command: " + " ".join(cmd_list)) - - def _ucmd(self, args): - cmd = [self._perceus_util_cmd] - cmd.extend(args) - self._log_cmd(cmd) - return cmd - - def _pu_reboot_node(self, node): - try: - self.sshrun("root", ct_perceus_util_node, - " ".join(self._ucmd(["node", "power", "of", node]))) - time.sleep(3) - self.sshrun("root", ct_perceus_util_node, - " ".join(self._ucmd(["node", "power", "on", node]))) - time.sleep(3) - self.sshrun("root", ct_perceus_util_node, - " ".join(self._ucmd(["node", "power", "wol", node]))) - return True - except Exception, e: - logging.exception("Failed to reboot node.") - return False - - def _pu_shutdown_node(self, node): - try: - self.sshrun("root", ct_perceus_util_node, - " ".join(self._ucmd(["node", "power", "of", node]))) - return True - except Exception, e: - logging.exception("Failed to shutdown node.") - return False - - def add_phy_node(self, name, vnfs): - host = self._perceus.acquire_node(vnfs) - if host is None: - raise ResourceError("No more nodes left.") - node = Node(name = name, host = host, image_name = vnfs, image_type = ImageDef.IMAGE_TYPE_VNFS) - logging.debug("Added new physical node " + str(node)) - self._phy_nodes.append(node) - return node - - def get_phy_nodes(self): - return self._phy_nodes - - def reboot_phy_node(self, node): - self._pu_reboot_node(node.get_host_name()) - - def shutdown_phy_node(self, node): - self._pu_shutdown_node(node.get_host_name()) - - def shutdown_phy_nodes(self): - for node in self._phy_nodes: - self.shutdown_phy_node(node) - - def is_phy_node_booted(self, node): - output = self._run_via_ssh(node.get_host_name(), [ "cat", Imager.VNFS_ID_PATH ]) - return (output.succeeded == True and output.return_code == 0 and output == node.get_image_name()) - - def wait_for_phy_nodes(self, retries = 0, sleep_time = 60): - logging.debug("Waiting for physical nodes to boot.") - while True: - n = 0 - for node in self._phy_nodes: - if self.is_phy_node_booted(node): - logging.debug("Node " + str(node) + " booted.") - n += 1 - else: - logging.debug("Node " + str(node) + " not booted yet.") - break - if n == len(self._phy_nodes): - return True - logging.debug("Retries left: " + str(retries)) - retries -= 1 - if retries < 0: - return False - time.sleep(sleep_time) diff --git a/common/trunk/test/contegrator/src/perceus/perceus.py b/common/trunk/test/contegrator/src/perceus/perceus.py deleted file mode 100644 index 10dd418d301ce931008ca8be877d56a8f348d277..0000000000000000000000000000000000000000 --- a/common/trunk/test/contegrator/src/perceus/perceus.py +++ /dev/null @@ -1,114 +0,0 @@ -''' -Created on Aug 30, 2011 - -@author: jaka -''' - -import subprocess -from subprocess import CalledProcessError - -import re -import logging -import string - -class Perceus(object): - - _debug = True - - def __init__(self, available_nodes = None, - perceus_cmd = "perceus"): - self._perceus_cmd = perceus_cmd - self._available_nodes = available_nodes - if self._available_nodes is None: - self._available_nodes = self.list_nodes() - self._allocated_nodes = [] - - def _log_cmd(self, cmd_list): - logging.debug("Command: " + " ".join(cmd_list)) - - def _pcmd(self, args): - cmd = [self._perceus_cmd, "-y"] - if not Perceus._debug: - cmd.append("-q") - cmd.extend(args) - self._log_cmd(cmd) - return cmd - - def clone_vnfs(self, src_vnfs, tgt_vnfs): - try: - subprocess.check_call(self._pcmd(["vnfs", "clone", src_vnfs, tgt_vnfs])) - return True - except CalledProcessError as error: - logging.error("Failed to clone VNFS: " + str(error.returncode)) - return False - - def mount_vnfs(self, vnfs): - try: - output = subprocess.check_output(self._pcmd(["vnfs", "mount", vnfs])) - logging.debug("--- output start ---") - logging.debug(output) - logging.debug("--- output end ---") - # The VNFS can be found at: /mnt/test-vnfs-X-node-1 - match = re.search("The VNFS can be found at: (\S+)", output) - logging.debug("Match: " + str(match)) - if match is None: - return None - return match.group(1) - except CalledProcessError as error: - logging.error("Failed to mount VNFS: " + str(error.returncode)) - return None - - def umount_vnfs(self, vnfs): - try: - subprocess.check_call(self._pcmd(["vnfs", "umount", vnfs])) - return True - except CalledProcessError as error: - logging.error("Failed to unmount VNFS: " + str(error.returncode)) - return False - - def delete_vnfs(self, vnfs): - try: - subprocess.check_call(self._pcmd(["vnfs", "delete", vnfs])) - return True - except CalledProcessError as error: - logging.error("Failed to delete VNFS: " + str(error.returncode)) - return False - - def acquire_node(self, vnfs): - try: - if len(self._available_nodes) == 0: - return None - node = self._available_nodes.pop() - subprocess.check_call(self._pcmd(["node", "set", "vnfs", vnfs, node])) - self._allocated_nodes.append(node) - return node - except CalledProcessError as error: - self._available_nodes.push(node) - logging.error("Failed to set node vnfs: " + str(error.returncode)) - return None - - def release_node(self, node): - try: - self._allocated_nodes.remove(node) - self._available_nodes.append(node) - return True - except ValueError: - return False - - def release_all_nodes(self): - for node in self._allocated_nodes: - self._available_nodes.append(node) - self._allocated_nodes = [] - - def list_nodes(self): - output = subprocess.check_output(self._pcmd(["node", "list"])) - logging.debug("--- output start ---") - logging.debug(output) - logging.debug("--- output end ---") - nodes = string.split(output) - i = 0 - for node in nodes: - i += 1 - logging.debug("Node " + str(i) + " [" + node + "]") - return nodes - diff --git a/common/trunk/test/contegrator/src/testbedconfig.py b/common/trunk/test/contegrator/src/testbedconfig.py deleted file mode 100644 index dfb94e3e61996e8228054225966b147a6903a5cc..0000000000000000000000000000000000000000 --- a/common/trunk/test/contegrator/src/testbedconfig.py +++ /dev/null @@ -1,22 +0,0 @@ -testbed_node_list = [ - "n0004", - "n0005" -] - -node_passwords = { - "root@n0004": "root", - "root@n0005": "root", -} - -ct_perceus_util_node = "perceus" - -# set to true if test nodes are set-up already and all you want to do -# is run the test code. useful for debugging to avoid lengthy staging -# of test nodes on each contegrator run. -ct_prestaged = False -# if you set above to true, make sure you fix the map below, -# mapping node names (node dir names) to the corresponding hosts -ct_prestaged_nodes = { - "head": "n0005", - "worker": "n0004", -} diff --git a/conpaas/branches/Y1DEMO-conpaassql/.project b/conpaas/branches/Y1DEMO-conpaassql/.project deleted file mode 100644 index 05743ee15c63937deab608c525b073dd74bb2afc..0000000000000000000000000000000000000000 --- a/conpaas/branches/Y1DEMO-conpaassql/.project +++ /dev/null @@ -1,17 +0,0 @@ - - - ConPaaSSql - - - - - - org.python.pydev.PyDevBuilder - - - - - - org.python.pydev.pythonNature - - diff --git a/conpaas/branches/Y1DEMO-conpaassql/.pydevproject b/conpaas/branches/Y1DEMO-conpaassql/.pydevproject deleted file mode 100644 index 18c13d8d4d7d558f6449339595267bbb19bfb5a0..0000000000000000000000000000000000000000 --- a/conpaas/branches/Y1DEMO-conpaassql/.pydevproject +++ /dev/null @@ -1,11 +0,0 @@ - - - - -Default -python 2.7 - -/ConPaaSSql/src -/ConPaaSSql/contrib - - diff --git a/conpaas/branches/Y1DEMO-conpaassql/LICENSE.txt b/conpaas/branches/Y1DEMO-conpaassql/LICENSE.txt deleted file mode 100644 index 1333ed77b7e1ed056329cae96075dc558158ee69..0000000000000000000000000000000000000000 --- a/conpaas/branches/Y1DEMO-conpaassql/LICENSE.txt +++ /dev/null @@ -1 +0,0 @@ -TODO diff --git a/conpaas/branches/Y1DEMO-conpaassql/Makefile b/conpaas/branches/Y1DEMO-conpaassql/Makefile deleted file mode 100644 index c49d45626e0f56dc38d2d3814ac22389a85d7e46..0000000000000000000000000000000000000000 --- a/conpaas/branches/Y1DEMO-conpaassql/Makefile +++ /dev/null @@ -1,41 +0,0 @@ -PWD = `pwd` -PYTHONPATH = `pwd`/src -DESTDIR ?= `/usr/local` -BASENAME = conpaassql -BINNAME = $(PWD)/$(BASENAME)-bin.tar.gz -BINDIR = $(PWD)/bindist -# This is for deploying (testing). -PACKAGE_NAME = conpaassql.tar -DEST_DIR_PCKG = $(DESTDIR)/$(PACKAGE_NAME) -PYTHON_VER = 2.6 - -all: - -check: all - #PYTHONPATH=./src:./contrib python -m unittest conpaas.mysql.test.unit.agent.TestServerAgent - #PYTHONPATH=./src:./contrib python -m unittest conpaas.mysql.test.unit.manager.TestServerManager - PYTHONPATH=./src:./contrib python src/conpaas/mysql/test/unit/agent.py - PYTHONPATH=./src:./contrib python src/conpaas/mysql/test/unit/manager.py - -install: check - #PYTHONPATH=$(DESTDIR)/usr/lib/python${PYTHON_VER}/site-packages/contrib:$(DESTDIR)/usr/lib/python${PYTHON_VER}/site-packages python $(PWD)/setup.py install --prefix=$(DESTDIR)/usr - echo $(DESTDIR) - mkdir -p $(DESTDIR)/usr/lib/python2.6/site-packages/ - PYTHONPATH=$(DESTDIR)/usr/lib/python${PYTHON_VER}/site-packages/contrib:$(DESTDIR)/usr/lib/python${PYTHON_VER}/site-packages python $(PWD)/setup.py install --prefix=$(DESTDIR)/usr - -binary: check - PYTHONPATH=$(BINDIR)/usr/lib/python${PYTHON_VER}/site-packages/contrib:$(BINDIR)/usr/lib/python${PYTHON_VER}/site-packages $(PWD)/setup.py install --prefix=$(BINDIR)/usr - tar czvf $(BINNAME) -C $(BINDIR) . - -deploy: check - mkdir -p $(DESTDIR) - tar --exclude=".svn" -cvf $(DEST_DIR_PCKG) . - ## Untar there - tar xvf $(DEST_DIR_PCKG) -C $(DESTDIR) - # Remove the package - #rm $(DEST_DIR_PCKG) - # Deployment complete! -clean: - rm -rf $(PWD)/build $(BINDIR) $(BINNAME) - find src -iname "*.pyc" -exec rm {} \; - find contrib -iname "*.pyc" -exec rm {} \; diff --git a/conpaas/branches/Y1DEMO-conpaassql/README.txt b/conpaas/branches/Y1DEMO-conpaassql/README.txt deleted file mode 100644 index a00c387c32f743887a322e1a58935aa55fb05068..0000000000000000000000000000000000000000 --- a/conpaas/branches/Y1DEMO-conpaassql/README.txt +++ /dev/null @@ -1,59 +0,0 @@ -ConPaasSql - Conpaas SQL Server -------------------------------- - -Installation and Dependencies ------------------------------ - -Dependencies: - * unzip - * >=python2.6 - * python-mysqldb - * python-pycurl - * OCA bindings - * setuptools - -apt-get install -y unzip -apt-get install -y python -apt-get install -y python-mysqldb -apt-get install -y python-pycurl - -wget https://github.com/lukaszo/python-oca/zipball/0.2.3 -wget http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz#md5=7df2a529a074f613b509fb44feefe74e - -Setuptool installation - -tar xvfz setuptools-0.6c11.tar.gz -cd setuptools-0.6c11 -python setup.py build -python setup.py install - - -OCA installation - -unzip 0.2.3 -cd lukaszo-python-oca-61992c1 -python setup.py build -python setup.py install - -Configuration -------------- -./src/conpaas/mysql/server/agent/configuration.cnf - -Running agent-server --------------------- -How to run the agent-server: -sudo PYTHONPATH= python server.py - -Running unit tests ------------------- - -make check - -or directly invoking by - -PYTHONPATH=./src:./contrib python src/conpaas/mysql/test/unit/agent.py -PYTHONPATH=./src:./contrib python src/conpaas/mysql/test/unit/manager.py - -Generating documentation -======================== -../doc$ sphinx-build -a -b html source/ build/ diff --git a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/__init__.py b/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/__init__.py deleted file mode 100644 index 68c57195a76742a6cb7246dda34b8dac884759d1..0000000000000000000000000000000000000000 --- a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/__init__.py +++ /dev/null @@ -1,58 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" -libcloud provides a unified interface to the cloud computing resources. - -@var __version__: Current version of libcloud -""" - -__all__ = ["__version__", "enable_debug"] - -__version__ = "0.5.0" - -def enable_debug(fo): - """ - Enable library wide debugging to a file-like object. - - @param fo: Where to append debugging information - @type fo: File like object, only write operations are used. - """ - from libcloud.base import (ConnectionKey, - LoggingHTTPConnection, - LoggingHTTPSConnection) - LoggingHTTPSConnection.log = fo - LoggingHTTPConnection.log = fo - ConnectionKey.conn_classes = (LoggingHTTPConnection, LoggingHTTPSConnection) - -def _init_once(): - """ - Utility function that is ran once on Library import. - - This checks for the LIBCLOUD_DEBUG enviroment variable, which if it exists - is where we will log debug information about the provider transports. - - If LIBCLOUD_DEBUG is not a path, C{/tmp/libcloud_debug.log} is used by - default. - """ - import os - d = os.getenv("LIBCLOUD_DEBUG") - if d: - if d.isdigit(): - d = "/tmp/libcloud_debug.log" - fo = open(d, "a") - enable_debug(fo) - -_init_once() diff --git a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/base.py b/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/base.py deleted file mode 100644 index ef340cb884ab42e0b0411b9ceae937c5d54edd49..0000000000000000000000000000000000000000 --- a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/base.py +++ /dev/null @@ -1,41 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from libcloud.common.base import RawResponse, Response, LoggingConnection -from libcloud.common.base import LoggingHTTPSConnection, LoggingHTTPConnection -from libcloud.common.base import ConnectionKey, ConnectionUserAndKey -from libcloud.compute.base import Node, NodeSize, NodeImage -from libcloud.compute.base import NodeLocation, NodeAuthSSHKey, NodeAuthPassword -from libcloud.compute.base import NodeDriver, is_private_subnet - -__all__ = ['RawResponse', - 'Response', - 'LoggingConnection', - 'LoggingHTTPSConnection', - 'LoggingHTTPConnection', - 'ConnectionKey', - 'ConnectionUserAndKey', - 'Node', - 'NodeSize', - 'NodeImage', - 'NodeLocation', - 'NodeAuthSSHKey', - 'NodeAuthPassword', - 'NodeDriver', - 'is_private_subnet'] - -from libcloud.utils import deprecated_warning - -deprecated_warning(__name__) diff --git a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/common/__init__.py b/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/common/__init__.py deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/common/aws.py b/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/common/aws.py deleted file mode 100644 index 20b72696934c7af9bee62cace43e6db421c6b3f3..0000000000000000000000000000000000000000 --- a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/common/aws.py +++ /dev/null @@ -1,30 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from xml.etree import ElementTree as ET - -from libcloud.common.base import Response -from libcloud.common.types import MalformedResponseError - -class AWSBaseResponse(Response): - def parse_body(self): - if not self.body: - return None - - try: - body = ET.XML(self.body) - except: - raise MalformedResponseError("Failed to parse XML", body=self.body) - return body diff --git a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/common/base.py b/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/common/base.py deleted file mode 100644 index 896c87e90b6ca4eb471ddf8ca48bd66da9d03ff4..0000000000000000000000000000000000000000 --- a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/common/base.py +++ /dev/null @@ -1,451 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import httplib -import urllib -import StringIO -import ssl - -from pipes import quote as pquote - -import libcloud - -from libcloud.httplib_ssl import LibcloudHTTPSConnection -from httplib import HTTPConnection as LibcloudHTTPConnection - -class Response(object): - """ - A Base Response class to derive from. - """ - NODE_STATE_MAP = {} - - object = None - body = None - status = httplib.OK - headers = {} - error = None - connection = None - - def __init__(self, response): - self.body = response.read() - self.status = response.status - self.headers = dict(response.getheaders()) - self.error = response.reason - - if not self.success(): - raise Exception(self.parse_error()) - - self.object = self.parse_body() - - def parse_body(self): - """ - Parse response body. - - Override in a provider's subclass. - - @return: Parsed body. - """ - return self.body - - def parse_error(self): - """ - Parse the error messages. - - Override in a provider's subclass. - - @return: Parsed error. - """ - return self.body - - def success(self): - """ - Determine if our request was successful. - - The meaning of this can be arbitrary; did we receive OK status? Did - the node get created? Were we authenticated? - - @return: C{True} or C{False} - """ - return self.status == httplib.OK or self.status == httplib.CREATED - -class RawResponse(Response): - - def __init__(self, response=None): - self._status = None - self._response = None - self._headers = {} - self._error = None - self._reason = None - - @property - def response(self): - if not self._response: - response = self.connection.connection.getresponse() - self._response, self.body = response, response - if not self.success(): - self.parse_error() - return self._response - - @property - def status(self): - if not self._status: - self._status = self.response.status - return self._status - - @property - def headers(self): - if not self._headers: - self._headers = dict(self.response.getheaders()) - return self._headers - - @property - def reason(self): - if not self._reason: - self._reason = self.response.reason - return self._reason - - -#TODO: Move this to a better location/package -class LoggingConnection(): - """ - Debug class to log all HTTP(s) requests as they could be made - with the C{curl} command. - - @cvar log: file-like object that logs entries are written to. - """ - log = None - - def _log_response(self, r): - rv = "# -------- begin %d:%d response ----------\n" % (id(self), id(r)) - ht = "" - v = r.version - if r.version == 10: - v = "HTTP/1.0" - if r.version == 11: - v = "HTTP/1.1" - ht += "%s %s %s\r\n" % (v, r.status, r.reason) - body = r.read() - for h in r.getheaders(): - ht += "%s: %s\r\n" % (h[0].title(), h[1]) - ht += "\r\n" - # this is evil. laugh with me. ha arharhrhahahaha - class fakesock: - def __init__(self, s): - self.s = s - def makefile(self, mode, foo): - return StringIO.StringIO(self.s) - rr = r - if r.chunked: - ht += "%x\r\n" % (len(body)) - ht += body - ht += "\r\n0\r\n" - else: - ht += body - rr = httplib.HTTPResponse(fakesock(ht), - method=r._method, - debuglevel=r.debuglevel) - rr.begin() - rv += ht - rv += ("\n# -------- end %d:%d response ----------\n" - % (id(self), id(r))) - return (rr, rv) - - def _log_curl(self, method, url, body, headers): - cmd = ["curl", "-i"] - - cmd.extend(["-X", pquote(method)]) - - for h in headers: - cmd.extend(["-H", pquote("%s: %s" % (h, headers[h]))]) - - # TODO: in python 2.6, body can be a file-like object. - if body is not None and len(body) > 0: - cmd.extend(["--data-binary", pquote(body)]) - - cmd.extend([pquote("https://%s:%d%s" % (self.host, self.port, url))]) - return " ".join(cmd) - -class LoggingHTTPSConnection(LoggingConnection, LibcloudHTTPSConnection): - """ - Utility Class for logging HTTPS connections - """ - - def getresponse(self): - r = LibcloudHTTPSConnection.getresponse(self) - if self.log is not None: - r, rv = self._log_response(r) - self.log.write(rv + "\n") - self.log.flush() - return r - - def request(self, method, url, body=None, headers=None): - headers.update({'X-LC-Request-ID': str(id(self))}) - if self.log is not None: - pre = "# -------- begin %d request ----------\n" % id(self) - self.log.write(pre + - self._log_curl(method, url, body, headers) + "\n") - self.log.flush() - return LibcloudHTTPSConnection.request(self, method, url, body, headers) - -class LoggingHTTPConnection(LoggingConnection, LibcloudHTTPConnection): - """ - Utility Class for logging HTTP connections - """ - - def getresponse(self): - r = LibcloudHTTPConnection.getresponse(self) - if self.log is not None: - r, rv = self._log_response(r) - self.log.write(rv + "\n") - self.log.flush() - return r - - def request(self, method, url, body=None, headers=None): - headers.update({'X-LC-Request-ID': str(id(self))}) - if self.log is not None: - pre = "# -------- begin %d request ----------\n" % id(self) - self.log.write(pre + - self._log_curl(method, url, body, headers) + "\n") - self.log.flush() - return LibcloudHTTPConnection.request(self, method, url, - body, headers) - -class ConnectionKey(object): - """ - A Base Connection class to derive from. - """ - #conn_classes = (LoggingHTTPSConnection) - conn_classes = (LibcloudHTTPConnection, LibcloudHTTPSConnection) - - responseCls = Response - rawResponseCls = RawResponse - connection = None - host = '127.0.0.1' - port = (80, 443) - secure = 1 - driver = None - action = None - - def __init__(self, key, secure=True, host=None, force_port=None): - """ - Initialize `user_id` and `key`; set `secure` to an C{int} based on - passed value. - """ - self.key = key - self.secure = secure and 1 or 0 - self.ua = [] - if host: - self.host = host - - if force_port: - self.port = (force_port, force_port) - - def connect(self, host=None, port=None): - """ - Establish a connection with the API server. - - @type host: C{str} - @param host: Optional host to override our default - - @type port: C{int} - @param port: Optional port to override our default - - @returns: A connection - """ - host = host or self.host - - # port might be included in service url, so pick it if it's present - if ":" in host: - host, port = host.split(":") - else: - port = port or self.port[self.secure] - - kwargs = {'host': host, 'port': int(port)} - - connection = self.conn_classes[self.secure](**kwargs) - # You can uncoment this line, if you setup a reverse proxy server - # which proxies to your endpoint, and lets you easily capture - # connections in cleartext when you setup the proxy to do SSL - # for you - #connection = self.conn_classes[False]("127.0.0.1", 8080) - - self.connection = connection - - def _user_agent(self): - return 'libcloud/%s (%s)%s' % ( - libcloud.__version__, - self.driver.name, - "".join([" (%s)" % x for x in self.ua])) - - def user_agent_append(self, token): - """ - Append a token to a user agent string. - - Users of the library should call this to uniquely identify thier requests - to a provider. - - @type token: C{str} - @param token: Token to add to the user agent. - """ - self.ua.append(token) - - def request(self, - action, - params=None, - data='', - headers=None, - method='GET', - raw=False, - host=None): - """ - Request a given `action`. - - Basically a wrapper around the connection - object's `request` that does some helpful pre-processing. - - @type action: C{str} - @param action: A path - - @type params: C{dict} - @param params: Optional mapping of additional parameters to send. If - None, leave as an empty C{dict}. - - @type data: C{unicode} - @param data: A body of data to send with the request. - - @type headers: C{dict} - @param headers: Extra headers to add to the request - None, leave as an empty C{dict}. - - @type method: C{str} - @param method: An HTTP method such as "GET" or "POST". - - @type raw: C{bool} - @param raw: True to perform a "raw" request aka only send the headers - and use the rawResponseCls class. This is used with - storage API when uploading a file. - - @type host: C{str} - @param host: To which host to send the request. If not specified, - self.host is used. - - @return: An instance of type I{responseCls} - """ - if params is None: - params = {} - if headers is None: - headers = {} - - self.action = action - self.method = method - # Extend default parameters - params = self.add_default_params(params) - # Extend default headers - headers = self.add_default_headers(headers) - # We always send a user-agent header - headers.update({'User-Agent': self._user_agent()}) - host = host or self.host - headers.update({'Host': host}) - # Encode data if necessary - if data != '' and data != None: - data = self.encode_data(data) - - if data is not None: - headers.update({'Content-Length': str(len(data))}) - - params, headers = self.pre_connect_hook(params, headers) - - if params: - url = '?'.join((action, urllib.urlencode(params))) - else: - url = action - - # Removed terrible hack...this a less-bad hack that doesn't execute a - # request twice, but it's still a hack. - self.connect(host=host) - try: - # @TODO: Should we just pass File object as body to request method - # instead of dealing with splitting and sending the file ourselves? - if raw: - self.connection.putrequest(method, url) - - for key, value in headers.iteritems(): - self.connection.putheader(key, value) - - self.connection.endheaders() - else: - self.connection.request(method=method, url=url, body=data, - headers=headers) - except ssl.SSLError, e: - raise ssl.SSLError(str(e)) - - if raw: - response = self.rawResponseCls() - else: - response = self.responseCls(self.connection.getresponse()) - - response.connection = self - return response - - def add_default_params(self, params): - """ - Adds default parameters (such as API key, version, etc.) - to the passed `params` - - Should return a dictionary. - """ - return params - - def add_default_headers(self, headers): - """ - Adds default headers (such as Authorization, X-Foo-Bar) - to the passed `headers` - - Should return a dictionary. - """ - return headers - - def pre_connect_hook(self, params, headers): - """ - A hook which is called before connecting to the remote server. - This hook can perform a final manipulation on the params, headers and - url parameters. - - @type params: C{dict} - @param params: Request parameters. - - @type headers: C{dict} - @param headers: Request headers. - """ - return params, headers - - def encode_data(self, data): - """ - Encode body data. - - Override in a provider's subclass. - """ - return data - -class ConnectionUserAndKey(ConnectionKey): - """ - Base connection which accepts a user_id and key - """ - - user_id = None - - def __init__(self, user_id, key, secure=True, host=None, port=None): - super(ConnectionUserAndKey, self).__init__(key, secure, host, port) - self.user_id = user_id diff --git a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/common/gogrid.py b/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/common/gogrid.py deleted file mode 100644 index 3b775495a9ccf2ba52b660cd0bf0e30eddf7d60f..0000000000000000000000000000000000000000 --- a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/common/gogrid.py +++ /dev/null @@ -1,178 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import hashlib -import time - -try: - import json -except ImportError: - import simplejson as json - -from libcloud.common.types import InvalidCredsError, LibcloudError -from libcloud.common.types import MalformedResponseError -from libcloud.common.base import ConnectionUserAndKey, Response -from libcloud.compute.base import NodeLocation - -HOST = 'api.gogrid.com' -PORTS_BY_SECURITY = { True: 443, False: 80 } -API_VERSION = '1.8' - -__all__ = ["GoGridResponse", - "GoGridConnection", - "GoGridIpAddress", - "BaseGoGridDriver", -] - -class GoGridResponse(Response): - - def __init__(self, *args, **kwargs): - self.driver = BaseGoGridDriver - super(GoGridResponse, self).__init__(*args, **kwargs) - - def success(self): - if self.status == 403: - raise InvalidCredsError('Invalid credentials', self.driver) - if self.status == 401: - raise InvalidCredsError('API Key has insufficient rights', self.driver) - if not self.body: - return None - try: - return json.loads(self.body)['status'] == 'success' - except ValueError: - raise MalformedResponseError('Malformed reply', - body=self.body, driver=self.driver) - - def parse_body(self): - if not self.body: - return None - return json.loads(self.body) - - def parse_error(self): - try: - return json.loads(self.body)["list"][0]['message'] - except (ValueError, KeyError): - return None - -class GoGridConnection(ConnectionUserAndKey): - """ - Connection class for the GoGrid driver - """ - - host = HOST - responseCls = GoGridResponse - - def add_default_params(self, params): - params["api_key"] = self.user_id - params["v"] = API_VERSION - params["format"] = 'json' - params["sig"] = self.get_signature(self.user_id, self.key) - - return params - - def get_signature(self, key, secret): - """ create sig from md5 of key + secret + time """ - m = hashlib.md5(key+secret+str(int(time.time()))) - return m.hexdigest() - -class GoGridIpAddress(object): - """ - IP Address - """ - - def __init__(self, id, ip, public, state, subnet): - self.id = id - self.ip = ip - self.public = public - self.state = state - self.subnet = subnet - -class BaseGoGridDriver(object): - """GoGrid has common object model for services they - provide, like locations and IP, so keep handling of - these things in a single place.""" - - name = "GoGrid" - - def _get_ip(self, element): - return element.get('ip').get('ip') - - def _to_ip(self, element): - ip = GoGridIpAddress(id=element['id'], - ip=element['ip'], - public=element['public'], - subnet=element['subnet'], - state=element["state"]["name"]) - ip.location = self._to_location(element['datacenter']) - return ip - - def _to_ips(self, object): - return [ self._to_ip(el) - for el in object['list'] ] - - def _to_location(self, element): - location = NodeLocation(id=element['id'], - name=element['name'], - country="US", - driver=self.connection.driver) - return location - - def _to_locations(self, object): - return [self._to_location(el) - for el in object['list']] - - - def ex_list_ips(self, **kwargs): - """Return list of IP addresses assigned to - the account. - - @keyword public: set to True to list only - public IPs or False to list only - private IPs. Set to None or not specify - at all not to filter by type - @type public: C{bool} - @keyword assigned: set to True to list only addresses - assigned to servers, False to list unassigned - addresses and set to None or don't set at all - not no filter by state - @type assigned: C{bool} - @keyword location: filter IP addresses by location - @type location: L{NodeLocation} - @return: C{list} of L{GoGridIpAddress}es - """ - - params = {} - - if "public" in kwargs and kwargs["public"] is not None: - params["ip.type"] = {True: "Public", - False: "Private"}[kwargs["public"]] - if "assigned" in kwargs and kwargs["assigned"] is not None: - params["ip.state"] = {True: "Assigned", - False: "Unassigned"}[kwargs["assigned"]] - if "location" in kwargs and kwargs['location'] is not None: - params['datacenter'] = kwargs['location'].id - - ips = self._to_ips( - self.connection.request('/api/grid/ip/list', - params=params).object) - return ips - - def _get_first_ip(self, location=None): - ips = self.ex_list_ips(public=True, assigned=False, location=location) - try: - return ips[0].ip - except IndexError: - raise LibcloudError('No public unassigned IPs left', - self.driver) diff --git a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/common/rackspace.py b/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/common/rackspace.py deleted file mode 100644 index 953a96147bf9c377cd9a3fceee26125002a8965d..0000000000000000000000000000000000000000 --- a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/common/rackspace.py +++ /dev/null @@ -1,120 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" -Common utilities for Rackspace Cloud Servers and Cloud Files -""" -import httplib -from urllib2 import urlparse -from libcloud.common.base import ConnectionUserAndKey -from libcloud.compute.types import InvalidCredsError - -AUTH_HOST_US='auth.api.rackspacecloud.com' -AUTH_HOST_UK='lon.auth.api.rackspacecloud.com' -AUTH_API_VERSION = 'v1.0' - -__all__ = [ - "RackspaceBaseConnection", - "AUTH_HOST_US", - "AUTH_HOST_UK" - ] - -class RackspaceBaseConnection(ConnectionUserAndKey): - def __init__(self, user_id, key, secure): - self.cdn_management_url = None - self.storage_url = None - self.auth_token = None - self.__host = None - super(RackspaceBaseConnection, self).__init__( - user_id, key, secure=secure) - - def add_default_headers(self, headers): - headers['X-Auth-Token'] = self.auth_token - headers['Accept'] = self.accept_format - return headers - - @property - def request_path(self): - return self._get_request_path(url_key=self._url_key) - - @property - def host(self): - # Default to server_host - return self._get_host(url_key=self._url_key) - - def _get_request_path(self, url_key): - value_key = '__request_path_%s' % (url_key) - value = getattr(self, value_key, None) - - if not value: - self._populate_hosts_and_request_paths() - value = getattr(self, value_key, None) - - return value - - def _get_host(self, url_key): - value_key = '__%s' % (url_key) - value = getattr(self, value_key, None) - - if not value: - self._populate_hosts_and_request_paths() - value = getattr(self, value_key, None) - - return value - - def _populate_hosts_and_request_paths(self): - """ - Rackspace uses a separate host for API calls which is only provided - after an initial authentication request. If we haven't made that - request yet, do it here. Otherwise, just return the management host. - """ - if not self.auth_token: - # Initial connection used for authentication - conn = self.conn_classes[self.secure]( - self.auth_host, self.port[self.secure]) - conn.request( - method='GET', - url='/%s' % (AUTH_API_VERSION), - headers={ - 'X-Auth-User': self.user_id, - 'X-Auth-Key': self.key - } - ) - - resp = conn.getresponse() - - if resp.status != httplib.NO_CONTENT: - raise InvalidCredsError() - - headers = dict(resp.getheaders()) - - try: - self.server_url = headers['x-server-management-url'] - self.storage_url = headers['x-storage-url'] - self.cdn_management_url = headers['x-cdn-management-url'] - self.lb_url = self.server_url.replace("servers", "ord.loadbalancers") - self.auth_token = headers['x-auth-token'] - except KeyError: - raise InvalidCredsError() - - for key in ['server_url', 'storage_url', 'cdn_management_url', - 'lb_url']: - scheme, server, request_path, param, query, fragment = ( - urlparse.urlparse(getattr(self, key))) - # Set host to where we want to make further requests to - setattr(self, '__%s' % (key), server) - setattr(self, '__request_path_%s' % (key), request_path) - - conn.close() diff --git a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/common/types.py b/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/common/types.py deleted file mode 100644 index f2f1b5d238e40c14a392446359dad1f28f433d32..0000000000000000000000000000000000000000 --- a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/common/types.py +++ /dev/null @@ -1,65 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -__all__ = [ - "LibcloudError", - "MalformedResponseError", - "InvalidCredsError", - "InvalidCredsException" - ] - -class LibcloudError(Exception): - """The base class for other libcloud exceptions""" - - def __init__(self, value, driver=None): - self.value = value - self.driver = driver - - def __str__(self): - return ("") - -class MalformedResponseError(LibcloudError): - """Exception for the cases when a provider returns a malformed - response, e.g. you request JSON and provider returns - '

something

' due to some error on their side.""" - - def __init__(self, value, body=None, driver=None): - self.value = value - self.driver = driver - self.body = body - - def __str__(self): - return (": " - + repr(self.body)) - -class InvalidCredsError(LibcloudError): - """Exception used when invalid credentials are used on a provider.""" - - def __init__(self, value='Invalid credentials with the provider', - driver=None): - self.value = value - self.driver = driver - def __str__(self): - return repr(self.value) - -# Deprecated alias of L{InvalidCredsError} -InvalidCredsException = InvalidCredsError diff --git a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/__init__.py b/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/__init__.py deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/base.py b/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/base.py deleted file mode 100644 index 866feac8230bea0c6a4c72de0e071a08c2964512..0000000000000000000000000000000000000000 --- a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/base.py +++ /dev/null @@ -1,612 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" -Provides base classes for working with drivers -""" -import time -import hashlib -import os -import socket -import struct - -from libcloud.pricing import get_size_price -from libcloud.compute.types import NodeState, DeploymentError -from libcloud.compute.ssh import SSHClient - -# @@TR: are the imports below part of the public api for this -# module? They aren't used in here ... -from libcloud.common.base import ConnectionKey, ConnectionUserAndKey -from libcloud.httplib_ssl import LibcloudHTTPSConnection -from libcloud.common.base import LibcloudHTTPConnection - -__all__ = [ - "Node", - "NodeState", - "NodeSize", - "NodeImage", - "NodeLocation", - "NodeAuthSSHKey", - "NodeAuthPassword", - "NodeDriver", - - # @@TR: do the following need exporting? - "ConnectionKey", - "ConnectionUserAndKey", - "LibcloudHTTPSConnection", - "LibcloudHTTPConnection" - ] - -class Node(object): - """ - Provide a common interface for handling nodes of all types. - - The Node object provides the interface in libcloud through which - we can manipulate nodes in different cloud providers in the same - way. Node objects don't actually do much directly themselves, - instead the node driver handles the connection to the node. - - You don't normally create a node object yourself; instead you use - a driver and then have that create the node for you. - - >>> from libcloud.compute.drivers.dummy import DummyNodeDriver - >>> driver = DummyNodeDriver(0) - >>> node = driver.create_node() - >>> node.public_ip[0] - '127.0.0.3' - >>> node.name - 'dummy-3' - - You can also get nodes from the driver's list_node function. - - >>> node = driver.list_nodes()[0] - >>> node.name - 'dummy-1' - - the node keeps a reference to its own driver which means that we - can work on nodes from different providers without having to know - which is which. - - >>> driver = DummyNodeDriver(72) - >>> node2 = driver.create_node() - >>> node.driver.creds - 0 - >>> node2.driver.creds - 72 - - Althrough Node objects can be subclassed, this isn't normally - done. Instead, any driver specific information is stored in the - "extra" proproperty of the node. - - >>> node.extra - {'foo': 'bar'} - - """ - - def __init__(self, id, name, state, public_ip, private_ip, - driver, extra=None): - self.id = str(id) if id else None - self.name = name - self.state = state - self.public_ip = public_ip - self.private_ip = private_ip - self.driver = driver - self.uuid = self.get_uuid() - if not extra: - self.extra = {} - else: - self.extra = extra - - def get_uuid(self): - """Unique hash for this node - - @return: C{string} - - The hash is a function of an SHA1 hash of the node's ID and - its driver which means that it should be unique between all - nodes. In some subclasses (e.g. GoGrid) there is no ID - available so the public IP address is used. This means that, - unlike a properly done system UUID, the same UUID may mean a - different system install at a different time - - >>> from libcloud.compute.drivers.dummy import DummyNodeDriver - >>> driver = DummyNodeDriver(0) - >>> node = driver.create_node() - >>> node.get_uuid() - 'd3748461511d8b9b0e0bfa0d4d3383a619a2bb9f' - - Note, for example, that this example will always produce the - same UUID! - """ - return hashlib.sha1("%s:%d" % (self.id,self.driver.type)).hexdigest() - - def reboot(self): - """Reboot this node - - @return: C{bool} - - This calls the node's driver and reboots the node - - >>> from libcloud.compute.drivers.dummy import DummyNodeDriver - >>> driver = DummyNodeDriver(0) - >>> node = driver.create_node() - >>> from libcloud.compute.types import NodeState - >>> node.state == NodeState.RUNNING - True - >>> node.state == NodeState.REBOOTING - False - >>> node.reboot() - True - >>> node.state == NodeState.REBOOTING - True - """ - return self.driver.reboot_node(self) - - def destroy(self): - """Destroy this node - - @return: C{bool} - - This calls the node's driver and destroys the node - - >>> from libcloud.compute.drivers.dummy import DummyNodeDriver - >>> driver = DummyNodeDriver(0) - >>> from libcloud.compute.types import NodeState - >>> node = driver.create_node() - >>> node.state == NodeState.RUNNING - True - >>> node.destroy() - True - >>> node.state == NodeState.RUNNING - False - - """ - return self.driver.destroy_node(self) - - def __repr__(self): - return (('') - % (self.uuid, self.name, self.state, self.public_ip, - self.driver.name)) - - -class NodeSize(object): - """ - A Base NodeSize class to derive from. - - NodeSizes are objects which are typically returned a driver's - list_sizes function. They contain a number of different - parameters which define how big an image is. - - The exact parameters available depends on the provider. - - N.B. Where a parameter is "unlimited" (for example bandwidth in - Amazon) this will be given as 0. - - >>> from libcloud.compute.drivers.dummy import DummyNodeDriver - >>> driver = DummyNodeDriver(0) - >>> size = driver.list_sizes()[0] - >>> size.ram - 128 - >>> size.bandwidth - 500 - >>> size.price - 4 - """ - - def __init__(self, id, name, ram, disk, bandwidth, price, driver): - self.id = str(id) - self.name = name - self.ram = ram - self.disk = disk - self.bandwidth = bandwidth - self.price = price - self.driver = driver - - def __repr__(self): - return (('') - % (self.id, self.name, self.ram, self.disk, self.bandwidth, - self.price, self.driver.name)) - - -class NodeImage(object): - """ - An operating system image. - - NodeImage objects are typically returned by the driver for the - cloud provider in response to the list_images function - - >>> from libcloud.compute.drivers.dummy import DummyNodeDriver - >>> driver = DummyNodeDriver(0) - >>> image = driver.list_images()[0] - >>> image.name - 'Ubuntu 9.10' - - Apart from name and id, there is no further standard information; - other parameters are stored in a driver specific "extra" variable - - When creating a node, a node image should be given as an argument - to the create_node function to decide which OS image to use. - - >>> node = driver.create_node(image=image) - - """ - - def __init__(self, id, name, driver, extra=None): - self.id = str(id) - self.name = name - self.driver = driver - if not extra: - self.extra = {} - else: - self.extra = extra - def __repr__(self): - return (('') - % (self.id, self.name, self.driver.name)) - -class NodeLocation(object): - """ - A physical location where nodes can be. - - >>> from libcloud.compute.drivers.dummy import DummyNodeDriver - >>> driver = DummyNodeDriver(0) - >>> location = driver.list_locations()[0] - >>> location.country - 'US' - """ - - def __init__(self, id, name, country, driver): - self.id = str(id) - self.name = name - self.country = country - self.driver = driver - def __repr__(self): - return (('') - % (self.id, self.name, self.country, self.driver.name)) - -class NodeAuthSSHKey(object): - """ - An SSH key to be installed for authentication to a node. - - This is the actual contents of the users ssh public key which will - normally be installed as root's public key on the node. - - >>> pubkey = '...' # read from file - >>> from libcloud.compute.base import NodeAuthSSHKey - >>> k = NodeAuthSSHKey(pubkey) - >>> k - - - """ - def __init__(self, pubkey): - self.pubkey = pubkey - def __repr__(self): - return '' - -class NodeAuthPassword(object): - """ - A password to be used for authentication to a node. - """ - def __init__(self, password): - self.password = password - def __repr__(self): - return '' - -class NodeDriver(object): - """ - A base NodeDriver class to derive from - - This class is always subclassed by a specific driver. For - examples of base behavior of most functions (except deploy node) - see the dummy driver. - - """ - - connectionCls = ConnectionKey - name = None - type = None - port = None - features = {"create_node": []} - """ - List of available features for a driver. - - L{create_node} - - ssh_key: Supports L{NodeAuthSSHKey} as an authentication method - for nodes. - - password: Supports L{NodeAuthPassword} as an authentication - method for nodes. - - generates_password: Returns a password attribute on the Node - object returned from creation. - """ - - NODE_STATE_MAP = {} - - def __init__(self, key, secret=None, secure=True, host=None, port=None): - """ - @keyword key: API key or username to used - @type key: str - - @keyword secret: Secret password to be used - @type secret: str - - @keyword secure: Weither to use HTTPS or HTTP. Note: Some providers - only support HTTPS, and it is on by default. - @type secure: bool - - @keyword host: Override hostname used for connections. - @type host: str - - @keyword port: Override port used for connections. - @type port: int - """ - self.key = key - self.secret = secret - self.secure = secure - args = [self.key] - - if self.secret != None: - args.append(self.secret) - - args.append(secure) - - if host != None: - args.append(host) - - if port != None: - args.append(port) - - self.connection = self.connectionCls(*args) - - self.connection.driver = self - self.connection.connect() - - def create_node(self, **kwargs): - """Create a new node instance. - - @keyword name: String with a name for this new node (required) - @type name: str - - @keyword size: The size of resources allocated to this node. - (required) - @type size: L{NodeSize} - - @keyword image: OS Image to boot on node. (required) - @type image: L{NodeImage} - - @keyword location: Which data center to create a node in. If empty, - undefined behavoir will be selected. (optional) - @type location: L{NodeLocation} - - @keyword auth: Initial authentication information for the node - (optional) - @type auth: L{NodeAuthSSHKey} or L{NodeAuthPassword} - - @return: The newly created L{Node}. - """ - raise NotImplementedError, \ - 'create_node not implemented for this driver' - - def destroy_node(self, node): - """Destroy a node. - - Depending upon the provider, this may destroy all data associated with - the node, including backups. - - @return: C{bool} True if the destroy was successful, otherwise False - """ - raise NotImplementedError, \ - 'destroy_node not implemented for this driver' - - def reboot_node(self, node): - """ - Reboot a node. - @return: C{bool} True if the reboot was successful, otherwise False - """ - raise NotImplementedError, \ - 'reboot_node not implemented for this driver' - - def list_nodes(self): - """ - List all nodes - @return: C{list} of L{Node} objects - """ - raise NotImplementedError, \ - 'list_nodes not implemented for this driver' - - def list_images(self, location=None): - """ - List images on a provider - @return: C{list} of L{NodeImage} objects - """ - raise NotImplementedError, \ - 'list_images not implemented for this driver' - - def list_sizes(self, location=None): - """ - List sizes on a provider - @return: C{list} of L{NodeSize} objects - """ - raise NotImplementedError, \ - 'list_sizes not implemented for this driver' - - def list_locations(self): - """ - List data centers for a provider - @return: C{list} of L{NodeLocation} objects - """ - raise NotImplementedError, \ - 'list_locations not implemented for this driver' - - def deploy_node(self, **kwargs): - """ - Create a new node, and start deployment. - - Depends on a Provider Driver supporting either using a specific password - or returning a generated password. - - This function may raise a L{DeploymentException}, if a create_node - call was successful, but there is a later error (like SSH failing or - timing out). This exception includes a Node object which you may want - to destroy if incomplete deployments are not desirable. - - @keyword deploy: Deployment to run once machine is online and availble to SSH. - @type deploy: L{Deployment} - - @keyword ssh_username: Optional name of the account which is used when connecting to - SSH server (default is root) - @type ssh_username: C{str} - - @keyword ssh_port: Optional SSH server port (default is 22) - @type ssh_port: C{int} - - @keyword ssh_timeout: Optional SSH connection timeout in seconds - (default is None) - @type ssh_timeout: C{float} - - See L{NodeDriver.create_node} for more keyword args. - - >>> from libcloud.compute.drivers.dummy import DummyNodeDriver - >>> from libcloud.deployment import ScriptDeployment, MultiStepDeployment - >>> from libcloud.compute.base import NodeAuthSSHKey - >>> driver = DummyNodeDriver(0) - >>> key = NodeAuthSSHKey('...') # read from file - >>> script = ScriptDeployment("yum -y install emacs strace tcpdump") - >>> msd = MultiStepDeployment([key, script]) - >>> def d(): - ... try: - ... node = driver.deploy_node(deploy=msd) - ... except NotImplementedError: - ... print "not implemented for dummy driver" - >>> d() - not implemented for dummy driver - - Deploy node is typically not overridden in subclasses. The - existing implementation should be able to handle most such. - """ - # TODO: support ssh keys - # FIX: this method is too long and complicated - WAIT_PERIOD=3 - password = None - - if 'generates_password' not in self.features["create_node"]: - if 'password' not in self.features["create_node"]: - raise NotImplementedError, \ - 'deploy_node not implemented for this driver' - - if not kwargs.has_key('auth'): - kwargs['auth'] = NodeAuthPassword(os.urandom(16).encode('hex')) - - password = kwargs['auth'].password - node = self.create_node(**kwargs) - try: - if 'generates_password' in self.features["create_node"]: - password = node.extra.get('password') - start = time.time() - end = start + (60 * 15)# FIX: this should be soft-coded - while time.time() < end: - # need to wait until we get a public IP address. - # TODO: there must be a better way of doing this - time.sleep(WAIT_PERIOD) - nodes = self.list_nodes() - nodes = filter(lambda n: n.uuid == node.uuid, nodes) - if len(nodes) == 0: - raise DeploymentError( - node, - ("Booted node[%s] " % node - + "is missing from list_nodes.")) - if len(nodes) > 1: - raise DeploymentError( - node, - ("Booted single node[%s], " % node - + "but multiple nodes have same UUID")) - - node = nodes[0] - - if (node.public_ip is not None - and node.public_ip != "" - and node.state == NodeState.RUNNING): - break - - ssh_username = kwargs.get('ssh_username', 'root') - ssh_port = kwargs.get('ssh_port', 22) - ssh_timeout = kwargs.get('ssh_timeout', 20) - - client = SSHClient(hostname=node.public_ip[0], - port=ssh_port, username=ssh_username, - password=password, - timeout=ssh_timeout) - - while time.time() < end: - try: - client.connect() - except (IOError, socket.gaierror, socket.error), e: - # Retry if a connection is refused or timeout - # occured - client.close() - time.sleep(WAIT_PERIOD) - continue - - max_tries, tries = 3, 0 - while tries < max_tries: - try: - n = kwargs["deploy"].run(node, client) - client.close() - raise - except Exception, e: - tries += 1 - if tries >= max_tries: - raise DeploymentError(node, - 'Failed after %d tries' % (max_tries)) - - except DeploymentError: - raise - except Exception, e: - raise DeploymentError(node, e) - return n - - def _get_size_price(self, size_id): - return get_size_price(driver_type='compute', - driver_name=self.api_name, - size_id=size_id) - - -def is_private_subnet(ip): - """ - Utility function to check if an IP address is inside a private subnet. - - @type ip: C{str} - @keyword ip: IP address to check - - @return: C{bool} if the specified IP address is private. - """ - priv_subnets = [ {'subnet': '10.0.0.0', 'mask': '255.0.0.0'}, - {'subnet': '172.16.0.0', 'mask': '255.240.0.0'}, - {'subnet': '192.168.0.0', 'mask': '255.255.0.0'} ] - - ip = struct.unpack('I',socket.inet_aton(ip))[0] - - for network in priv_subnets: - subnet = struct.unpack('I',socket.inet_aton(network['subnet']))[0] - mask = struct.unpack('I',socket.inet_aton(network['mask']))[0] - - if (ip & mask) == (subnet & mask): - return True - - return False - - -if __name__ == "__main__": - import doctest - doctest.testmod() diff --git a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/drivers/__init__.py b/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/drivers/__init__.py deleted file mode 100644 index b1821adf1de4b0930df86fc901f98706796b78ff..0000000000000000000000000000000000000000 --- a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/drivers/__init__.py +++ /dev/null @@ -1,39 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" -Drivers for working with different providers -""" - -__all__ = [ - 'brightbox', - 'bluebox', - 'dummy', - 'ec2', - 'ecp', - 'elastichosts', - 'cloudsigma', - 'gogrid', - 'ibm_sbc', - 'linode', - 'opennebula', - 'rackspace', - 'rimuhosting', - 'slicehost', - 'softlayer', - 'vcloud', - 'voxel', - 'vpsnet', -] diff --git a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/drivers/bluebox.py b/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/drivers/bluebox.py deleted file mode 100644 index 3ff4f6e05deb89624da30457a7b26af48099ef37..0000000000000000000000000000000000000000 --- a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/drivers/bluebox.py +++ /dev/null @@ -1,234 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" -libcloud driver for the Blue Box Blocks API - -This driver implements all libcloud functionality for the Blue Box Blocks API. - -Blue Box home page http://bluebox.net -Blue Box API documentation https://boxpanel.bluebox.net/public/the_vault/index.php/Blocks_API -""" - -import copy -import urllib -import base64 - -try: - import json -except: - import simplejson as json - -from libcloud.common.base import Response, ConnectionUserAndKey -from libcloud.compute.providers import Provider -from libcloud.compute.types import NodeState, InvalidCredsError -from libcloud.compute.base import Node, NodeDriver -from libcloud.compute.base import NodeSize, NodeImage, NodeLocation -from libcloud.compute.base import NodeAuthPassword, NodeAuthSSHKey - -# Current end point for Blue Box API. -BLUEBOX_API_HOST = "boxpanel.bluebox.net" - -# The API doesn't currently expose all of the required values for libcloud, -# so we simply list what's available right now, along with all of the various -# attributes that are needed by libcloud. -BLUEBOX_INSTANCE_TYPES = { - '1gb': { - 'id': '94fd37a7-2606-47f7-84d5-9000deda52ae', - 'name': 'Block 1GB Virtual Server', - 'ram': 1024, - 'disk': 20, - 'cpu': 0.5 - }, - '2gb': { - 'id': 'b412f354-5056-4bf0-a42f-6ddd998aa092', - 'name': 'Block 2GB Virtual Server', - 'ram': 2048, - 'disk': 25, - 'cpu': 1 - }, - '4gb': { - 'id': '0cd183d3-0287-4b1a-8288-b3ea8302ed58', - 'name': 'Block 4GB Virtual Server', - 'ram': 4096, - 'disk': 50, - 'cpu': 2 - }, - '8gb': { - 'id': 'b9b87a5b-2885-4a2e-b434-44a163ca6251', - 'name': 'Block 8GB Virtual Server', - 'ram': 8192, - 'disk': 100, - 'cpu': 4 - } -} - -RAM_PER_CPU = 2048 - -NODE_STATE_MAP = { 'queued': NodeState.PENDING, - 'building': NodeState.PENDING, - 'running': NodeState.RUNNING, - 'error': NodeState.TERMINATED, - 'unknown': NodeState.UNKNOWN } - -class BlueboxResponse(Response): - def parse_body(self): - try: - js = json.loads(self.body) - return js - except ValueError: - return self.body - - def parse_error(self): - if int(self.status) == 401: - if not self.body: - raise InvalidCredsError(str(self.status) + ': ' + self.error) - else: - raise InvalidCredsError(self.body) - return self.body - -class BlueboxNodeSize(NodeSize): - def __init__(self, id, name, cpu, ram, disk, price, driver): - self.id = id - self.name = name - self.cpu = cpu - self.ram = ram - self.disk = disk - self.price = price - self.driver = driver - - def __repr__(self): - return (('') - % (self.id, self.name, self.cpu, self.ram, self.disk, self.price, self.driver.name)) - -class BlueboxConnection(ConnectionUserAndKey): - """ - Connection class for the Bluebox driver - """ - - host = BLUEBOX_API_HOST - secure = True - responseCls = BlueboxResponse - - def add_default_headers(self, headers): - user_b64 = base64.b64encode('%s:%s' % (self.user_id, self.key)) - headers['Authorization'] = 'Basic %s' % (user_b64) - return headers - -class BlueboxNodeDriver(NodeDriver): - """ - Bluebox Blocks node driver - """ - - connectionCls = BlueboxConnection - type = Provider.BLUEBOX - api_name = 'bluebox' - name = 'Bluebox Blocks' - - def list_nodes(self): - result = self.connection.request('/api/blocks.json') - return [self._to_node(i) for i in result.object] - - def list_sizes(self, location=None): - sizes = [] - for key, values in BLUEBOX_INSTANCE_TYPES.iteritems(): - attributes = copy.deepcopy(values) - attributes.update({ 'price': self._get_size_price(size_id=key) }) - sizes.append(BlueboxNodeSize(driver=self.connection.driver, - **attributes)) - - return sizes - - def list_images(self, location=None): - result = self.connection.request('/api/block_templates.json') - images = [] - for image in result.object: - images.extend([self._to_image(image)]) - - return images - - def create_node(self, **kwargs): - headers = { 'Content-Type': 'application/x-www-form-urlencoded' } - size = kwargs["size"] - - name = kwargs['name'] - image = kwargs['image'] - size = kwargs['size'] - - try: - auth = kwargs['auth'] - except Exception: - raise Exception("SSH public key or password required.") - - data = { - 'hostname': name, - 'product': size.id, - 'template': image.id - } - - ssh = None - password = None - - if isinstance(auth, NodeAuthSSHKey): - ssh = auth.pubkey - data.update(ssh_public_key=ssh) - elif isinstance(auth, NodeAuthPassword): - password = auth.password - data.update(password=password) - - if "ex_username" in kwargs: - data.update(username=kwargs["ex_username"]) - - if not ssh and not password: - raise Exception("SSH public key or password required.") - - params = urllib.urlencode(data) - result = self.connection.request('/api/blocks.json', headers=headers, data=params, method='POST') - node = self._to_node(result.object) - return node - - def destroy_node(self, node): - """ - Destroy node by passing in the node object - """ - url = '/api/blocks/%s.json' % (node.id) - result = self.connection.request(url, method='DELETE') - - return result.status == 200 - - def list_locations(self): - return [NodeLocation(0, "Blue Box Seattle US", 'US', self)] - - def reboot_node(self, node): - url = '/api/blocks/%s/reboot.json' % (node.id) - result = self.connection.request(url, method="PUT") - return result.status == 200 - - def _to_node(self, vm): - state = NODE_STATE_MAP[vm.get('status', NodeState.UNKNOWN)] - n = Node(id=vm['id'], - name=vm['hostname'], - state=state, - public_ip=[ ip['address'] for ip in vm['ips'] ], - private_ip=[], - extra={'storage':vm['storage'], 'cpu':vm['cpu']}, - driver=self.connection.driver) - return n - - def _to_image(self, image): - image = NodeImage(id=image['id'], - name=image['description'], - driver=self.connection.driver) - return image diff --git a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/drivers/brightbox.py b/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/drivers/brightbox.py deleted file mode 100644 index 1312bb6569504b907d4955ab6441416d92f1b682..0000000000000000000000000000000000000000 --- a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/drivers/brightbox.py +++ /dev/null @@ -1,221 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -""" -Brightbox Driver -""" -import httplib -import base64 - -from libcloud.common.base import ConnectionUserAndKey, Response -from libcloud.compute.types import Provider, NodeState, InvalidCredsError -from libcloud.compute.base import NodeDriver -from libcloud.compute.base import Node, NodeImage, NodeSize, NodeLocation - -try: - import json -except ImportError: - import simplejson as json - -API_VERSION = '1.0' - - -class BrightboxResponse(Response): - def success(self): - return self.status >= 200 and self.status < 400 - - def parse_body(self): - if self.headers['content-type'].split('; ')[0] == 'application/json' and len(self.body) > 0: - return json.loads(self.body) - else: - return self.body - - def parse_error(self): - return json.loads(self.body)['error'] - - -class BrightboxConnection(ConnectionUserAndKey): - """ - Connection class for the Brightbox driver - """ - - host = 'api.gb1.brightbox.com' - responseCls = BrightboxResponse - - def _fetch_oauth_token(self): - body = json.dumps({'client_id': self.user_id, 'grant_type': 'none'}) - - authorization = 'Basic ' + base64.encodestring('%s:%s' % (self.user_id, self.key)).rstrip() - - self.connect() - - response = self.connection.request(method='POST', url='/token', body=body, headers={ - 'Host': self.host, - 'User-Agent': self._user_agent(), - 'Authorization': authorization, - 'Content-Type': 'application/json', - 'Content-Length': str(len(body)) - }) - - response = self.connection.getresponse() - - if response.status == 200: - return json.loads(response.read())['access_token'] - else: - message = '%s (%s)' % (json.loads(response.read())['error'], response.status) - - raise InvalidCredsError, message - - def add_default_headers(self, headers): - try: - headers['Authorization'] = 'OAuth ' + self.token - except AttributeError: - self.token = self._fetch_oauth_token() - - headers['Authorization'] = 'OAuth ' + self.token - - return headers - - def encode_data(self, data): - return json.dumps(data) - - -class BrightboxNodeDriver(NodeDriver): - """ - Brightbox node driver - """ - - connectionCls = BrightboxConnection - - type = Provider.BRIGHTBOX - name = 'Brightbox' - - NODE_STATE_MAP = { 'creating': NodeState.PENDING, - 'active': NodeState.RUNNING, - 'inactive': NodeState.UNKNOWN, - 'deleting': NodeState.UNKNOWN, - 'deleted': NodeState.TERMINATED, - 'failed': NodeState.UNKNOWN } - - def _to_node(self, data): - return Node( - id = data['id'], - name = data['name'], - state = self.NODE_STATE_MAP[data['status']], - public_ip = map(lambda cloud_ip: cloud_ip['public_ip'], data['cloud_ips']), - private_ip = map(lambda interface: interface['ipv4_address'], data['interfaces']), - driver = self.connection.driver, - extra = { - 'status': data['status'], - 'interfaces': data['interfaces'] - } - ) - - def _to_image(self, data): - return NodeImage( - id = data['id'], - name = data['name'], - driver = self, - extra = { - 'description': data['description'], - 'arch': data['arch'] - } - ) - - def _to_size(self, data): - return NodeSize( - id = data['id'], - name = data['name'], - ram = data['ram'], - disk = data['disk_size'], - bandwidth = 0, - price = '', - driver = self - ) - - def _to_location(self, data): - return NodeLocation( - id = data['id'], - name = data['handle'], - country = 'GB', - driver = self - ) - - def _post(self, path, data={}): - headers = {'Content-Type': 'application/json'} - - return self.connection.request(path, data=data, headers=headers, method='POST') - - def create_node(self, **kwargs): - data = { - 'name': kwargs['name'], - 'server_type': kwargs['size'].id, - 'image': kwargs['image'].id, - 'user_data': '' - } - - if kwargs.has_key('location'): - data['zone'] = kwargs['location'].id - else: - data['zone'] = '' - - data = self._post('/%s/servers' % API_VERSION, data).object - - return self._to_node(data) - - def destroy_node(self, node): - response = self.connection.request('/%s/servers/%s' % (API_VERSION, node.id), method='DELETE') - - return response.status == httplib.ACCEPTED - - def list_nodes(self): - data = self.connection.request('/%s/servers' % API_VERSION).object - - return map(self._to_node, data) - - def list_images(self): - data = self.connection.request('/%s/images' % API_VERSION).object - - return map(self._to_image, data) - - def list_sizes(self): - data = self.connection.request('/%s/server_types' % API_VERSION).object - - return map(self._to_size, data) - - def list_locations(self): - data = self.connection.request('/%s/zones' % API_VERSION).object - - return map(self._to_location, data) - - def ex_list_cloud_ips(self): - return self.connection.request('/%s/cloud_ips' % API_VERSION).object - - def ex_create_cloud_ip(self): - return self._post('/%s/cloud_ips' % API_VERSION).object - - def ex_map_cloud_ip(self, cloud_ip_id, interface_id): - response = self._post('/%s/cloud_ips/%s/map' % (API_VERSION, cloud_ip_id), {'interface': interface_id}) - - return response.status == httplib.ACCEPTED - - def ex_unmap_cloud_ip(self, cloud_ip_id): - response = self._post('/%s/cloud_ips/%s/unmap' % (API_VERSION, cloud_ip_id)) - - return response.status == httplib.ACCEPTED - - def ex_destroy_cloud_ip(self, cloud_ip_id): - response = self.connection.request('/%s/cloud_ips/%s' % (API_VERSION, cloud_ip_id), method='DELETE') - - return response.status == httplib.OK diff --git a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/drivers/cloudsigma.py b/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/drivers/cloudsigma.py deleted file mode 100644 index ee50ebbac0118c5cfa40f2d7715dac29d8371478..0000000000000000000000000000000000000000 --- a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/drivers/cloudsigma.py +++ /dev/null @@ -1,553 +0,0 @@ -# -*- coding: utf-8 -*- -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -""" -CloudSigma Driver -""" -import re -import time -import base64 - -from libcloud.utils import str2dicts, str2list, dict2str -from libcloud.common.base import ConnectionUserAndKey, Response -from libcloud.common.types import InvalidCredsError -from libcloud.compute.types import NodeState, Provider -from libcloud.compute.base import NodeDriver, NodeSize, Node -from libcloud.compute.base import NodeImage - -# API end-points -API_ENDPOINTS = { - 'zrh': { - 'name': 'Zurich', - 'country': 'Switzerland', - 'host': 'api.cloudsigma.com' - }, -} - -# Default API end-point for the base connection clase. -DEFAULT_ENDPOINT = 'zrh' - -# CloudSigma doesn't specify special instance types. -# Basically for CPU any value between 0.5 GHz and 20.0 GHz should work, 500 MB to 32000 MB for ram -# and 1 GB to 1024 GB for hard drive size. -# Plans in this file are based on examples listed on http://www.cloudsigma.com/en/pricing/price-schedules -INSTANCE_TYPES = { - 'micro-regular': { - 'id': 'micro-regular', - 'name': 'Micro/Regular instance', - 'cpu': 1100, - 'memory': 640, - 'disk': 50, - 'bandwidth': None, - }, - 'micro-high-cpu': { - 'id': 'micro-high-cpu', - 'name': 'Micro/High CPU instance', - 'cpu': 2200, - 'memory': 640, - 'disk': 80, - 'bandwidth': None, - }, - 'standard-small': { - 'id': 'standard-small', - 'name': 'Standard/Small instance', - 'cpu': 1100, - 'memory': 1741, - 'disk': 50, - 'bandwidth': None, - }, - 'standard-large': { - 'id': 'standard-large', - 'name': 'Standard/Large instance', - 'cpu': 4400, - 'memory': 7680, - 'disk': 250, - 'bandwidth': None, - }, - 'standard-extra-large': { - 'id': 'standard-extra-large', - 'name': 'Standard/Extra Large instance', - 'cpu': 8800, - 'memory': 15360, - 'disk': 500, - 'bandwidth': None, - }, - 'high-memory-extra-large': { - 'id': 'high-memory-extra-large', - 'name': 'High Memory/Extra Large instance', - 'cpu': 7150, - 'memory': 17510, - 'disk': 250, - 'bandwidth': None, - }, - 'high-memory-double-extra-large': { - 'id': 'high-memory-double-extra-large', - 'name': 'High Memory/Double Extra Large instance', - 'cpu': 14300, - 'memory': 32768, - 'disk': 500, - 'bandwidth': None, - }, - 'high-cpu-medium': { - 'id': 'high-cpu-medium', - 'name': 'High CPU/Medium instance', - 'cpu': 5500, - 'memory': 1741, - 'disk': 150, - 'bandwidth': None, - }, - 'high-cpu-extra-large': { - 'id': 'high-cpu-extra-large', - 'name': 'High CPU/Extra Large instance', - 'cpu': 20000, - 'memory': 7168, - 'disk': 500, - 'bandwidth': None, - } -} - -NODE_STATE_MAP = { - 'active': NodeState.RUNNING, - 'stopped': NodeState.TERMINATED, - 'dead': NodeState.TERMINATED, - 'dumped': NodeState.TERMINATED, -} - -# Default timeout (in seconds) for the drive imaging process -IMAGING_TIMEOUT = 20 * 60 - -class CloudSigmaException(Exception): - def __str__(self): - return self.args[0] - - def __repr__(self): - return "" % (self.args[0]) - -class CloudSigmaInsufficientFundsException(Exception): - def __repr__(self): - return "" % (self.args[0]) - -class CloudSigmaResponse(Response): - def success(self): - if self.status == 401: - raise InvalidCredsError() - - return self.status >= 200 and self.status <= 299 - - def parse_body(self): - if not self.body: - return self.body - - return str2dicts(self.body) - - def parse_error(self): - return 'Error: %s' % (self.body.replace('errors:', '').strip()) - -class CloudSigmaNodeSize(NodeSize): - def __init__(self, id, name, cpu, ram, disk, bandwidth, price, driver): - self.id = id - self.name = name - self.cpu = cpu - self.ram = ram - self.disk = disk - self.bandwidth = bandwidth - self.price = price - self.driver = driver - - def __repr__(self): - return (('') - % (self.id, self.name, self.cpu, self.ram, self.disk, self.bandwidth, - self.price, self.driver.name)) - -class CloudSigmaBaseConnection(ConnectionUserAndKey): - host = API_ENDPOINTS[DEFAULT_ENDPOINT]['host'] - responseCls = CloudSigmaResponse - - def add_default_headers(self, headers): - headers['Accept'] = 'application/json' - headers['Content-Type'] = 'application/json' - - headers['Authorization'] = 'Basic %s' % (base64.b64encode('%s:%s' % (self.user_id, self.key))) - - return headers - -class CloudSigmaBaseNodeDriver(NodeDriver): - type = Provider.CLOUDSIGMA - name = 'CloudSigma' - connectionCls = CloudSigmaBaseConnection - - def reboot_node(self, node): - """ - Reboot a node. - - Because Cloudsigma API does not provide native reboot call, it's emulated using stop and start. - """ - node = self._get_node(node.id) - state = node.state - - if state == NodeState.RUNNING: - stopped = self.ex_stop_node(node) - else: - stopped = True - - if not stopped: - raise CloudSigmaException('Could not stop node with id %s' % (node.id)) - - success = self.ex_start_node(node) - - return success - - def destroy_node(self, node): - """ - Destroy a node (all the drives associated with it are NOT destroyed). - - If a node is still running, it's stopped before it's destroyed. - """ - node = self._get_node(node.id) - state = node.state - - # Node cannot be destroyed while running so it must be stopped first - if state == NodeState.RUNNING: - stopped = self.ex_stop_node(node) - else: - stopped = True - - if not stopped: - raise CloudSigmaException('Could not stop node with id %s' % (node.id)) - - response = self.connection.request(action = '/servers/%s/destroy' % (node.id), - method = 'POST') - return response.status == 204 - - def list_images(self, location=None): - """ - Return a list of available standard images (this call might take up to 15 seconds to return). - """ - response = self.connection.request(action = '/drives/standard/info').object - - images = [] - for value in response: - if value.get('type'): - if value['type'] == 'disk': - image = NodeImage(id = value['drive'], name = value['name'], driver = self.connection.driver, - extra = {'size': value['size']}) - images.append(image) - - return images - - def list_sizes(self, location = None): - """ - Return a list of available node sizes. - """ - sizes = [] - for key, value in INSTANCE_TYPES.iteritems(): - size = CloudSigmaNodeSize(id = value['id'], name = value['name'], - cpu = value['cpu'], ram = value['memory'], - disk = value['disk'], bandwidth = value['bandwidth'], - price = self._get_size_price(size_id=key), - driver = self.connection.driver) - sizes.append(size) - - return sizes - - def list_nodes(self): - """ - Return a list of nodes. - """ - response = self.connection.request(action = '/servers/info').object - - nodes = [] - for data in response: - node = self._to_node(data) - if node: - nodes.append(node) - return nodes - - def create_node(self, **kwargs): - """ - Creates a CloudSigma instance - - See L{NodeDriver.create_node} for more keyword args. - - @keyword name: String with a name for this new node (required) - @type name: C{string} - - @keyword smp: Number of virtual processors or None to calculate based on the cpu speed - @type smp: C{int} - - @keyword nic_model: e1000, rtl8139 or virtio (is not specified, e1000 is used) - @type nic_model: C{string} - - @keyword vnc_password: If not set, VNC access is disabled. - @type vnc_password: C{bool} - """ - size = kwargs['size'] - image = kwargs['image'] - smp = kwargs.get('smp', 'auto') - nic_model = kwargs.get('nic_model', 'e1000') - vnc_password = kwargs.get('vnc_password', None) - - if nic_model not in ['e1000', 'rtl8139', 'virtio']: - raise CloudSigmaException('Invalid NIC model specified') - - drive_data = {} - drive_data.update({'name': kwargs['name'], 'size': '%sG' % (kwargs['size'].disk)}) - - response = self.connection.request(action = '/drives/%s/clone' % image.id, data = dict2str(drive_data), - method = 'POST').object - - if not response: - raise CloudSigmaException('Drive creation failed') - - drive_uuid = response[0]['drive'] - - response = self.connection.request(action = '/drives/%s/info' % (drive_uuid)).object - imaging_start = time.time() - while response[0].has_key('imaging'): - response = self.connection.request(action = '/drives/%s/info' % (drive_uuid)).object - elapsed_time = time.time() - imaging_start - if response[0].has_key('imaging') and elapsed_time >= IMAGING_TIMEOUT: - raise CloudSigmaException('Drive imaging timed out') - time.sleep(1) - - node_data = {} - node_data.update({'name': kwargs['name'], 'cpu': size.cpu, 'mem': size.ram, 'ide:0:0': drive_uuid, - 'boot': 'ide:0:0', 'smp': smp}) - node_data.update({'nic:0:model': nic_model, 'nic:0:dhcp': 'auto'}) - - if vnc_password: - node_data.update({'vnc:ip': 'auto', 'vnc:password': vnc_password}) - - response = self.connection.request(action = '/servers/create', data = dict2str(node_data), - method = 'POST').object - - if not isinstance(response, list): - response = [ response ] - - node = self._to_node(response[0]) - if node is None: - # Insufficient funds, destroy created drive - self.ex_drive_destroy(drive_uuid) - raise CloudSigmaInsufficientFundsException('Insufficient funds, node creation failed') - - # Start the node after it has been created - started = self.ex_start_node(node) - - if started: - node.state = NodeState.RUNNING - - return node - - def ex_destroy_node_and_drives(self, node): - """ - Destroy a node and all the drives associated with it. - """ - node = self._get_node_info(node) - - drive_uuids = [] - for key, value in node.iteritems(): - if (key.startswith('ide:') or key.startswith('scsi') or key.startswith('block')) and \ - not (key.endswith(':bytes') or key.endswith(':requests') or key.endswith('media')): - drive_uuids.append(value) - - node_destroyed = self.destroy_node(self._to_node(node)) - - if not node_destroyed: - return False - - for drive_uuid in drive_uuids: - self.ex_drive_destroy(drive_uuid) - - return True - - def ex_static_ip_list(self): - """ - Return a list of available static IP addresses. - """ - response = self.connection.request(action = '/resources/ip/list', method = 'GET') - - if response.status != 200: - raise CloudSigmaException('Could not retrieve IP list') - - ips = str2list(response.body) - return ips - - def ex_drives_list(self): - """ - Return a list of all the available drives. - """ - response = self.connection.request(action = '/drives/info', method = 'GET') - - result = str2dicts(response.body) - return result - - def ex_static_ip_create(self): - """ - Create a new static IP address. - """ - response = self.connection.request(action = '/resources/ip/create', method = 'GET') - - result = str2dicts(response.body) - return result - - def ex_static_ip_destroy(self, ip_address): - """ - Destroy a static IP address. - """ - response = self.connection.request(action = '/resources/ip/%s/destroy' % (ip_address), method = 'GET') - - return response.status == 204 - - def ex_drive_destroy(self, drive_uuid): - """ - Destroy a drive with a specified uuid. - If the drive is currently mounted an exception is thrown. - """ - response = self.connection.request(action = '/drives/%s/destroy' % (drive_uuid), method = 'POST') - - return response.status == 204 - - - def ex_set_node_configuration(self, node, **kwargs): - """ - Update a node configuration. - Changing most of the parameters requires node to be stopped. - """ - valid_keys = ('^name$', '^parent$', '^cpu$', '^smp$', '^mem$', '^boot$', '^nic:0:model$', '^nic:0:dhcp', - '^nic:1:model$', '^nic:1:vlan$', '^nic:1:mac$', '^vnc:ip$', '^vnc:password$', '^vnc:tls', - '^ide:[0-1]:[0-1](:media)?$', '^scsi:0:[0-7](:media)?$', '^block:[0-7](:media)?$') - - invalid_keys = [] - for key in kwargs.keys(): - matches = False - for regex in valid_keys: - if re.match(regex, key): - matches = True - break - if not matches: - invalid_keys.append(key) - - if invalid_keys: - raise CloudSigmaException('Invalid configuration key specified: %s' % (',' .join(invalid_keys))) - - response = self.connection.request(action = '/servers/%s/set' % (node.id), data = dict2str(kwargs), - method = 'POST') - - return (response.status == 200 and response.body != '') - - def ex_start_node(self, node): - """ - Start a node. - """ - response = self.connection.request(action = '/servers/%s/start' % (node.id), - method = 'POST') - - return response.status == 200 - - def ex_stop_node(self, node): - """ - Stop (shutdown) a node. - """ - response = self.connection.request(action = '/servers/%s/stop' % (node.id), - method = 'POST') - return response.status == 204 - - def ex_shutdown_node(self, node): - """ - Stop (shutdown) a node. - """ - return self.ex_stop_node(node) - - def ex_destroy_drive(self, drive_uuid): - """ - Destroy a drive. - """ - response = self.connection.request(action = '/drives/%s/destroy' % (drive_uuid), - method = 'POST') - return response.status == 204 - - def _to_node(self, data): - if data: - try: - state = NODE_STATE_MAP[data['status']] - except KeyError: - state = NodeState.UNKNOWN - - if 'server' not in data: - # Response does not contain server UUID if the server - # creation failed because of insufficient funds. - return None - - public_ip = [] - if data.has_key('nic:0:dhcp'): - if isinstance(data['nic:0:dhcp'], list): - public_ip = data['nic:0:dhcp'] - else: - public_ip = [data['nic:0:dhcp']] - - extra = {} - extra_keys = [ ('cpu', 'int'), ('smp', 'auto'), ('mem', 'int'), ('status', 'str') ] - for key, value_type in extra_keys: - if data.has_key(key): - value = data[key] - - if value_type == 'int': - value = int(value) - elif value_type == 'auto': - try: - value = int(value) - except ValueError: - pass - - extra.update({key: value}) - - if data.has_key('vnc:ip') and data.has_key('vnc:password'): - extra.update({'vnc_ip': data['vnc:ip'], 'vnc_password': data['vnc:password']}) - - node = Node(id = data['server'], name = data['name'], state = state, - public_ip = public_ip, private_ip = None, driver = self.connection.driver, - extra = extra) - - return node - return None - - def _get_node(self, node_id): - nodes = self.list_nodes() - node = [node for node in nodes if node.id == node.id] - - if not node: - raise CloudSigmaException('Node with id %s does not exist' % (node_id)) - - return node[0] - - def _get_node_info(self, node): - response = self.connection.request(action = '/servers/%s/info' % (node.id)) - - result = str2dicts(response.body) - return result[0] - -class CloudSigmaZrhConnection(CloudSigmaBaseConnection): - """ - Connection class for the CloudSigma driver for the Zurich end-point - """ - host = API_ENDPOINTS[DEFAULT_ENDPOINT]['host'] - -class CloudSigmaZrhNodeDriver(CloudSigmaBaseNodeDriver): - """ - CloudSigma node driver for the Zurich end-point - """ - connectionCls = CloudSigmaZrhConnection - api_name = 'cloudsigma_zrh' diff --git a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/drivers/dreamhost.py b/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/drivers/dreamhost.py deleted file mode 100644 index fb857b640a9bc1e7546cc7ce1cc77ceb738979a2..0000000000000000000000000000000000000000 --- a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/drivers/dreamhost.py +++ /dev/null @@ -1,249 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -""" -DreamHost Driver -""" - -try: - import json -except: - import simplejson as json - -import copy - -from libcloud.common.base import ConnectionKey, Response -from libcloud.common.types import InvalidCredsError -from libcloud.compute.base import Node, NodeDriver, NodeSize -from libcloud.compute.base import NodeImage -from libcloud.compute.types import Provider, NodeState - -# DreamHost Private Servers can be resized on the fly, but Libcloud doesn't -# currently support extensions to its interface, so we'll put some basic sizes -# in for node creation. - -DH_PS_SIZES = { - 'minimum': { - 'id' : 'minimum', - 'name' : 'Minimum DH PS size', - 'ram' : 300, - 'disk' : None, - 'bandwidth' : None - }, - 'maximum': { - 'id' : 'maximum', - 'name' : 'Maximum DH PS size', - 'ram' : 4000, - 'disk' : None, - 'bandwidth' : None - }, - 'default': { - 'id' : 'default', - 'name' : 'Default DH PS size', - 'ram' : 2300, - 'disk' : None, - 'bandwidth' : None - }, - 'low': { - 'id' : 'low', - 'name' : 'DH PS with 1GB RAM', - 'ram' : 1000, - 'disk' : None, - 'bandwidth' : None - }, - 'high': { - 'id' : 'high', - 'name' : 'DH PS with 3GB RAM', - 'ram' : 3000, - 'disk' : None, - 'bandwidth' : None - }, -} - - -class DreamhostAPIException(Exception): - - def __str__(self): - return self.args[0] - - def __repr__(self): - return "" % (self.args[0]) - - -class DreamhostResponse(Response): - """ - Response class for DreamHost PS - """ - - def parse_body(self): - resp = json.loads(self.body) - if resp['result'] != 'success': - raise Exception(self._api_parse_error(resp)) - return resp['data'] - - def parse_error(self): - raise Exception - - def _api_parse_error(self, response): - if 'data' in response: - if response['data'] == 'invalid_api_key': - raise InvalidCredsError( - "Oops! You've entered an invalid API key") - else: - raise DreamhostAPIException(response['data']) - else: - raise DreamhostAPIException("Unknown problem: %s" % (self.body)) - -class DreamhostConnection(ConnectionKey): - """ - Connection class to connect to DreamHost's API servers - """ - - host = 'api.dreamhost.com' - responseCls = DreamhostResponse - format = 'json' - - def add_default_params(self, params): - """ - Add key and format parameters to the request. Eventually should add - unique_id to prevent re-execution of a single request. - """ - params['key'] = self.key - params['format'] = self.format - #params['unique_id'] = generate_unique_id() - return params - - -class DreamhostNodeDriver(NodeDriver): - """ - Node Driver for DreamHost PS - """ - type = Provider.DREAMHOST - api_name = 'dreamhost' - name = "Dreamhost" - connectionCls = DreamhostConnection - - _sizes = DH_PS_SIZES - - def create_node(self, **kwargs): - """Create a new Dreamhost node - - See L{NodeDriver.create_node} for more keyword args. - - @keyword ex_movedata: Copy all your existing users to this new PS - @type ex_movedata: C{str} - """ - size = kwargs['size'].ram - params = { - 'cmd' : 'dreamhost_ps-add_ps', - 'movedata' : kwargs.get('movedata', 'no'), - 'type' : kwargs['image'].name, - 'size' : size - } - data = self.connection.request('/', params).object - return Node( - id = data['added_web'], - name = data['added_web'], - state = NodeState.PENDING, - public_ip = [], - private_ip = [], - driver = self.connection.driver, - extra = { - 'type' : kwargs['image'].name - } - ) - - def destroy_node(self, node): - params = { - 'cmd' : 'dreamhost_ps-remove_ps', - 'ps' : node.id - } - try: - return self.connection.request('/', params).success() - except DreamhostAPIException: - return False - - def reboot_node(self, node): - params = { - 'cmd' : 'dreamhost_ps-reboot', - 'ps' : node.id - } - try: - return self.connection.request('/', params).success() - except DreamhostAPIException: - return False - - def list_nodes(self, **kwargs): - data = self.connection.request( - '/', {'cmd': 'dreamhost_ps-list_ps'}).object - return [self._to_node(n) for n in data] - - def list_images(self, **kwargs): - data = self.connection.request( - '/', {'cmd': 'dreamhost_ps-list_images'}).object - images = [] - for img in data: - images.append(NodeImage( - id = img['image'], - name = img['image'], - driver = self.connection.driver - )) - return images - - def list_sizes(self, **kwargs): - sizes = [] - for key, values in self._sizes.iteritems(): - attributes = copy.deepcopy(values) - attributes.update({ 'price': self._get_size_price(size_id=key) }) - sizes.append(NodeSize(driver=self.connection.driver, **attributes)) - - return sizes - - def list_locations(self, **kwargs): - raise NotImplementedError( - 'You cannot select a location for ' - 'DreamHost Private Servers at this time.') - - ############################################ - # Private Methods (helpers and extensions) # - ############################################ - def _resize_node(self, node, size): - if (size < 300 or size > 4000): - return False - - params = { - 'cmd' : 'dreamhost_ps-set_size', - 'ps' : node.id, - 'size' : size - } - try: - return self.connection.request('/', params).success() - except DreamhostAPIException: - return False - - def _to_node(self, data): - """ - Convert the data from a DreamhostResponse object into a Node - """ - return Node( - id = data['ps'], - name = data['ps'], - state = NodeState.UNKNOWN, - public_ip = [data['ip']], - private_ip = [], - driver = self.connection.driver, - extra = { - 'current_size' : data['memory_mb'], - 'account_id' : data['account_id'], - 'type' : data['type']}) diff --git a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/drivers/dummy.py b/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/drivers/dummy.py deleted file mode 100644 index 57485c4e1621436cbf45f7928deae28ff4f5c512..0000000000000000000000000000000000000000 --- a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/drivers/dummy.py +++ /dev/null @@ -1,297 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -""" -Dummy Driver - -@note: This driver is out of date -""" -import uuid -import socket -import struct - -from libcloud.base import ConnectionKey, NodeDriver, NodeSize, NodeLocation -from libcloud.compute.base import NodeImage, Node -from libcloud.compute.types import Provider,NodeState - -class DummyConnection(ConnectionKey): - """ - Dummy connection class - """ - - def connect(self, host=None, port=None): - pass - -class DummyNodeDriver(NodeDriver): - """ - Dummy node driver - - This is a fake driver which appears to always create or destroy - nodes successfully. - - >>> from libcloud.compute.drivers.dummy import DummyNodeDriver - >>> driver = DummyNodeDriver(0) - >>> node=driver.create_node() - >>> node.public_ip[0] - '127.0.0.3' - >>> node.name - 'dummy-3' - - If the credentials you give convert to an integer then the next - node to be created will be one higher. - - Each time you create a node you will get a different IP address. - - >>> driver = DummyNodeDriver(22) - >>> node=driver.create_node() - >>> node.name - 'dummy-23' - - """ - - name = "Dummy Node Provider" - type = Provider.DUMMY - - def __init__(self, creds): - self.creds = creds - try: - num = int(creds) - except ValueError: - num = None - if num: - self.nl = [] - startip = _ip_to_int('127.0.0.1') - for i in xrange(num): - ip = _int_to_ip(startip + i) - self.nl.append( - Node(id=i, - name='dummy-%d' % (i), - state=NodeState.RUNNING, - public_ip=[ip], - private_ip=[], - driver=self, - extra={'foo': 'bar'}) - ) - else: - self.nl = [ - Node(id=1, - name='dummy-1', - state=NodeState.RUNNING, - public_ip=['127.0.0.1'], - private_ip=[], - driver=self, - extra={'foo': 'bar'}), - Node(id=2, - name='dummy-2', - state=NodeState.RUNNING, - public_ip=['127.0.0.1'], - private_ip=[], - driver=self, - extra={'foo': 'bar'}), - ] - self.connection = DummyConnection(self.creds) - - def get_uuid(self, unique_field=None): - return str(uuid.uuid4()) - - def list_nodes(self): - """ - List the nodes known to a particular driver; - There are two default nodes created at the beginning - - >>> from libcloud.compute.drivers.dummy import DummyNodeDriver - >>> driver = DummyNodeDriver(0) - >>> node_list=driver.list_nodes() - >>> sorted([node.name for node in node_list ]) - ['dummy-1', 'dummy-2'] - - each item in the list returned is a node object from which you - can carry out any node actions you wish - - >>> node_list[0].reboot() - True - - As more nodes are added, list_nodes will return them - - >>> node=driver.create_node() - >>> sorted([node.name for node in driver.list_nodes()]) - ['dummy-1', 'dummy-2', 'dummy-3'] - """ - return self.nl - - def reboot_node(self, node): - """ - Sets the node state to rebooting; in this dummy driver always - returns True as if the reboot had been successful. - - >>> from libcloud.compute.drivers.dummy import DummyNodeDriver - >>> driver = DummyNodeDriver(0) - >>> node=driver.create_node() - >>> from libcloud.compute.types import NodeState - >>> node.state == NodeState.RUNNING - True - >>> node.state == NodeState.REBOOTING - False - >>> driver.reboot_node(node) - True - >>> node.state == NodeState.REBOOTING - True - - Please note, dummy nodes never recover from the reboot. - """ - - node.state = NodeState.REBOOTING - return True - - def destroy_node(self, node): - """ - Sets the node state to terminated and removes it from the node list - - >>> from libcloud.compute.drivers.dummy import DummyNodeDriver - >>> driver = DummyNodeDriver(0) - >>> from libcloud.compute.types import NodeState - >>> node = [node for node in driver.list_nodes() if node.name == 'dummy-1'][0] - >>> node.state == NodeState.RUNNING - True - >>> driver.destroy_node(node) - True - >>> node.state == NodeState.RUNNING - False - >>> [node for node in driver.list_nodes() if node.name == 'dummy-1'] - [] - """ - - node.state = NodeState.TERMINATED - self.nl.remove(node) - return True - - def list_images(self, location=None): - """ - Returns a list of images as a cloud provider might have - - >>> from libcloud.compute.drivers.dummy import DummyNodeDriver - >>> driver = DummyNodeDriver(0) - >>> sorted([image.name for image in driver.list_images()]) - ['Slackware 4', 'Ubuntu 9.04', 'Ubuntu 9.10'] - """ - return [ - NodeImage(id=1, name="Ubuntu 9.10", driver=self), - NodeImage(id=2, name="Ubuntu 9.04", driver=self), - NodeImage(id=3, name="Slackware 4", driver=self), - ] - - def list_sizes(self, location=None): - """ - Returns a list of node sizes as a cloud provider might have - - >>> from libcloud.compute.drivers.dummy import DummyNodeDriver - >>> driver = DummyNodeDriver(0) - >>> sorted([size.ram for size in driver.list_sizes()]) - [128, 512, 4096, 8192] - """ - - return [ - NodeSize(id=1, - name="Small", - ram=128, - disk=4, - bandwidth=500, - price=4, - driver=self), - NodeSize(id=2, - name="Medium", - ram=512, - disk=16, - bandwidth=1500, - price=8, - driver=self), - NodeSize(id=3, - name="Big", - ram=4096, - disk=32, - bandwidth=2500, - price=32, - driver=self), - NodeSize(id=4, - name="XXL Big", - ram=4096*2, - disk=32*4, - bandwidth=2500*3, - price=32*2, - driver=self), - ] - - def list_locations(self): - """ - Returns a list of locations of nodes - - >>> from libcloud.compute.drivers.dummy import DummyNodeDriver - >>> driver = DummyNodeDriver(0) - >>> sorted([loc.name + " in " + loc.country for loc in driver.list_locations()]) - ['Island Datacenter in FJ', 'London Loft in GB', "Paul's Room in US"] - """ - return [ - NodeLocation(id=1, - name="Paul's Room", - country='US', - driver=self), - NodeLocation(id=2, - name="London Loft", - country='GB', - driver=self), - NodeLocation(id=3, - name="Island Datacenter", - country='FJ', - driver=self), - ] - - def create_node(self, **kwargs): - """ - Creates a dummy node; the node id is equal to the number of - nodes in the node list - - >>> from libcloud.compute.drivers.dummy import DummyNodeDriver - >>> driver = DummyNodeDriver(0) - >>> sorted([node.name for node in driver.list_nodes()]) - ['dummy-1', 'dummy-2'] - >>> nodeA = driver.create_node() - >>> sorted([node.name for node in driver.list_nodes()]) - ['dummy-1', 'dummy-2', 'dummy-3'] - >>> driver.create_node().name - 'dummy-4' - >>> driver.destroy_node(nodeA) - True - >>> sorted([node.name for node in driver.list_nodes()]) - ['dummy-1', 'dummy-2', 'dummy-4'] - """ - l = len(self.nl) + 1 - n = Node(id=l, - name='dummy-%d' % l, - state=NodeState.RUNNING, - public_ip=['127.0.0.%d' % l], - private_ip=[], - driver=self, - extra={'foo': 'bar'}) - self.nl.append(n) - return n - -def _ip_to_int(ip): - return socket.htonl(struct.unpack('I', socket.inet_aton(ip))[0]) - -def _int_to_ip(ip): - return socket.inet_ntoa(struct.pack('I', socket.ntohl(ip))) - -if __name__ == "__main__": - import doctest - doctest.testmod() diff --git a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/drivers/ec2.py b/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/drivers/ec2.py deleted file mode 100644 index 7805cd0d6538e69cbb5330a1468f52b8628cd75e..0000000000000000000000000000000000000000 --- a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/drivers/ec2.py +++ /dev/null @@ -1,1015 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" -Amazon EC2 driver -""" -import base64 -import hmac -import os -import time -import urllib -import copy - -from hashlib import sha256 -from xml.etree import ElementTree as ET - -from libcloud.utils import fixxpath, findtext, findattr, findall -from libcloud.common.base import ConnectionUserAndKey -from libcloud.common.aws import AWSBaseResponse -from libcloud.common.types import InvalidCredsError, MalformedResponseError, LibcloudError -from libcloud.compute.providers import Provider -from libcloud.compute.types import NodeState -from libcloud.compute.base import Node, NodeDriver, NodeLocation, NodeSize -from libcloud.compute.base import NodeImage - -EC2_US_EAST_HOST = 'ec2.us-east-1.amazonaws.com' -EC2_US_WEST_HOST = 'ec2.us-west-1.amazonaws.com' -EC2_EU_WEST_HOST = 'ec2.eu-west-1.amazonaws.com' -EC2_AP_SOUTHEAST_HOST = 'ec2.ap-southeast-1.amazonaws.com' -EC2_AP_NORTHEAST_HOST = 'ec2.ap-northeast-1.amazonaws.com' - -API_VERSION = '2010-08-31' - -NAMESPACE = "http://ec2.amazonaws.com/doc/%s/" % (API_VERSION) - -""" -Sizes must be hardcoded, because Amazon doesn't provide an API to fetch them. -From http://aws.amazon.com/ec2/instance-types/ -""" -EC2_INSTANCE_TYPES = { - 't1.micro': { - 'id': 't1.micro', - 'name': 'Micro Instance', - 'ram': 613, - 'disk': 15, - 'bandwidth': None - }, - 'm1.small': { - 'id': 'm1.small', - 'name': 'Small Instance', - 'ram': 1740, - 'disk': 160, - 'bandwidth': None - }, - 'm1.large': { - 'id': 'm1.large', - 'name': 'Large Instance', - 'ram': 7680, - 'disk': 850, - 'bandwidth': None - }, - 'm1.xlarge': { - 'id': 'm1.xlarge', - 'name': 'Extra Large Instance', - 'ram': 15360, - 'disk': 1690, - 'bandwidth': None - }, - 'c1.medium': { - 'id': 'c1.medium', - 'name': 'High-CPU Medium Instance', - 'ram': 1740, - 'disk': 350, - 'bandwidth': None - }, - 'c1.xlarge': { - 'id': 'c1.xlarge', - 'name': 'High-CPU Extra Large Instance', - 'ram': 7680, - 'disk': 1690, - 'bandwidth': None - }, - 'm2.xlarge': { - 'id': 'm2.xlarge', - 'name': 'High-Memory Extra Large Instance', - 'ram': 17510, - 'disk': 420, - 'bandwidth': None - }, - 'm2.2xlarge': { - 'id': 'm2.2xlarge', - 'name': 'High-Memory Double Extra Large Instance', - 'ram': 35021, - 'disk': 850, - 'bandwidth': None - }, - 'm2.4xlarge': { - 'id': 'm2.4xlarge', - 'name': 'High-Memory Quadruple Extra Large Instance', - 'ram': 70042, - 'disk': 1690, - 'bandwidth': None - }, - 'cg1.4xlarge': { - 'id': 'cg1.4xlarge', - 'name': 'Cluster GPU Quadruple Extra Large Instance', - 'ram': 22528, - 'disk': 1690, - 'bandwidth': None - }, - 'cc1.4xlarge': { - 'id': 'cc1.4xlarge', - 'name': 'Cluster Compute Quadruple Extra Large Instance', - 'ram': 23552, - 'disk': 1690, - 'bandwidth': None - }, -} - -CLUSTER_INSTANCES_IDS = [ 'cg1.4xlarge', 'cc1.4xlarge' ] - -EC2_US_EAST_INSTANCE_TYPES = dict(EC2_INSTANCE_TYPES) -EC2_US_WEST_INSTANCE_TYPES = dict(EC2_INSTANCE_TYPES) -EC2_EU_WEST_INSTANCE_TYPES = dict(EC2_INSTANCE_TYPES) -EC2_AP_SOUTHEAST_INSTANCE_TYPES = dict(EC2_INSTANCE_TYPES) -EC2_AP_NORTHEAST_INSTANCE_TYPES = dict(EC2_INSTANCE_TYPES) - -class EC2NodeLocation(NodeLocation): - def __init__(self, id, name, country, driver, availability_zone): - super(EC2NodeLocation, self).__init__(id, name, country, driver) - self.availability_zone = availability_zone - - def __repr__(self): - return (('') - % (self.id, self.name, self.country, - self.availability_zone.name, self.driver.name)) - -class EC2Response(AWSBaseResponse): - """ - EC2 specific response parsing and error handling. - """ - def parse_error(self): - err_list = [] - # Okay, so for Eucalyptus, you can get a 403, with no body, - # if you are using the wrong user/password. - msg = "Failure: 403 Forbidden" - if self.status == 403 and self.body[:len(msg)] == msg: - raise InvalidCredsError(msg) - - try: - body = ET.XML(self.body) - except: - raise MalformedResponseError("Failed to parse XML", body=self.body, driver=EC2NodeDriver) - - for err in body.findall('Errors/Error'): - code, message = err.getchildren() - err_list.append("%s: %s" % (code.text, message.text)) - if code.text == "InvalidClientTokenId": - raise InvalidCredsError(err_list[-1]) - if code.text == "SignatureDoesNotMatch": - raise InvalidCredsError(err_list[-1]) - if code.text == "AuthFailure": - raise InvalidCredsError(err_list[-1]) - if code.text == "OptInRequired": - raise InvalidCredsError(err_list[-1]) - if code.text == "IdempotentParameterMismatch": - raise IdempotentParamError(err_list[-1]) - return "\n".join(err_list) - -class EC2Connection(ConnectionUserAndKey): - """ - Repersents a single connection to the EC2 Endpoint - """ - - host = EC2_US_EAST_HOST - responseCls = EC2Response - - def add_default_params(self, params): - params['SignatureVersion'] = '2' - params['SignatureMethod'] = 'HmacSHA256' - params['AWSAccessKeyId'] = self.user_id - params['Version'] = API_VERSION - params['Timestamp'] = time.strftime('%Y-%m-%dT%H:%M:%SZ', - time.gmtime()) - params['Signature'] = self._get_aws_auth_param(params, self.key, self.action) - return params - - def _get_aws_auth_param(self, params, secret_key, path='/'): - """ - Creates the signature required for AWS, per - http://bit.ly/aR7GaQ [docs.amazonwebservices.com]: - - StringToSign = HTTPVerb + "\n" + - ValueOfHostHeaderInLowercase + "\n" + - HTTPRequestURI + "\n" + - CanonicalizedQueryString - """ - keys = params.keys() - keys.sort() - pairs = [] - for key in keys: - pairs.append(urllib.quote(key, safe='') + '=' + - urllib.quote(params[key], safe='-_~')) - - qs = '&'.join(pairs) - string_to_sign = '\n'.join(('GET', self.host, path, qs)) - - b64_hmac = base64.b64encode( - hmac.new(secret_key, string_to_sign, digestmod=sha256).digest() - ) - return b64_hmac - -class ExEC2AvailabilityZone(object): - """ - Extension class which stores information about an EC2 availability zone. - - Note: This class is EC2 specific. - """ - def __init__(self, name, zone_state, region_name): - self.name = name - self.zone_state = zone_state - self.region_name = region_name - - def __repr__(self): - return (('') - % (self.name, self.zone_state, self.region_name)) - -class EC2NodeDriver(NodeDriver): - """ - Amazon EC2 node driver - """ - - connectionCls = EC2Connection - type = Provider.EC2 - api_name = 'ec2_us_east' - name = 'Amazon EC2 (us-east-1)' - friendly_name = 'Amazon US N. Virginia' - country = 'US' - region_name = 'us-east-1' - path = '/' - - _instance_types = EC2_US_EAST_INSTANCE_TYPES - - NODE_STATE_MAP = { - 'pending': NodeState.PENDING, - 'running': NodeState.RUNNING, - 'shutting-down': NodeState.TERMINATED, - 'terminated': NodeState.TERMINATED - } - - def _pathlist(self, key, arr): - """ - Converts a key and an array of values into AWS query param format. - """ - params = {} - i = 0 - for value in arr: - i += 1 - params["%s.%s" % (key, i)] = value - return params - - def _get_boolean(self, element): - tag = "{%s}%s" % (NAMESPACE, 'return') - return element.findtext(tag) == 'true' - - def _get_terminate_boolean(self, element): - status = element.findtext(".//{%s}%s" % (NAMESPACE, 'name')) - return any([ term_status == status - for term_status - in ('shutting-down', 'terminated') ]) - - def _to_nodes(self, object, xpath, groups=None): - return [ self._to_node(el, groups=groups) - for el in object.findall(fixxpath(xpath=xpath, namespace=NAMESPACE)) ] - - def _to_node(self, element, groups=None): - try: - state = self.NODE_STATE_MAP[ - findattr(element=element, xpath="instanceState/name", - namespace=NAMESPACE) - ] - except KeyError: - state = NodeState.UNKNOWN - - n = Node( - id=findtext(element=element, xpath='instanceId', - namespace=NAMESPACE), - name=findtext(element=element, xpath='instanceId', - namespace=NAMESPACE), - state=state, - public_ip=[findtext(element=element, xpath='ipAddress', - namespace=NAMESPACE)], - private_ip=[findtext(element=element, xpath='privateIpAddress', - namespace=NAMESPACE)], - driver=self.connection.driver, - extra={ - 'dns_name': findattr(element=element, xpath="dnsName", - namespace=NAMESPACE), - 'instanceId': findattr(element=element, xpath="instanceId", - namespace=NAMESPACE), - 'imageId': findattr(element=element, xpath="imageId", - namespace=NAMESPACE), - 'private_dns': findattr(element=element, xpath="privateDnsName", - namespace=NAMESPACE), - 'status': findattr(element=element, xpath="instanceState/name", - namespace=NAMESPACE), - 'keyname': findattr(element=element, xpath="keyName", - namespace=NAMESPACE), - 'launchindex': findattr(element=element, xpath="amiLaunchIndex", - namespace=NAMESPACE), - 'productcode': - [p.text for p in findall(element=element, - xpath="productCodesSet/item/productCode", - namespace=NAMESPACE - )], - 'instancetype': findattr(element=element, xpath="instanceType", - namespace=NAMESPACE), - 'launchdatetime': findattr(element=element, xpath="launchTime", - namespace=NAMESPACE), - 'availability': findattr(element, xpath="placement/availabilityZone", - namespace=NAMESPACE), - 'kernelid': findattr(element=element, xpath="kernelId", - namespace=NAMESPACE), - 'ramdiskid': findattr(element=element, xpath="ramdiskId", - namespace=NAMESPACE), - 'clienttoken' : findattr(element=element, xpath="clientToken", - namespace=NAMESPACE), - 'groups': groups - } - ) - return n - - def _to_images(self, object): - return [ self._to_image(el) - for el in object.findall( - fixxpath(xpath='imagesSet/item', namespace=NAMESPACE) - ) ] - - def _to_image(self, element): - n = NodeImage(id=findtext(element=element, xpath='imageId', - namespace=NAMESPACE), - name=findtext(element=element, xpath='imageLocation', - namespace=NAMESPACE), - driver=self.connection.driver) - return n - - def list_nodes(self): - params = {'Action': 'DescribeInstances' } - elem=self.connection.request(self.path, params=params).object - nodes=[] - for rs in findall(element=elem, xpath='reservationSet/item', - namespace=NAMESPACE): - groups=[g.findtext('') - for g in findall(element=rs, xpath='groupSet/item/groupId', - namespace=NAMESPACE)] - nodes += self._to_nodes(rs, 'instancesSet/item', groups) - - nodes_elastic_ips_mappings = self.ex_describe_addresses(nodes) - for node in nodes: - node.public_ip.extend(nodes_elastic_ips_mappings[node.id]) - return nodes - - def list_sizes(self, location=None): - # Cluster instances are currently only available in the US - N. Virginia Region - include_cluser_instances = self.region_name == 'us-east-1' - sizes = self._get_sizes(include_cluser_instances = - include_cluser_instances) - - return sizes - - def _get_sizes(self, include_cluser_instances=False): - sizes = [] - for key, values in self._instance_types.iteritems(): - if not include_cluser_instances and \ - key in CLUSTER_INSTANCES_IDS: - continue - attributes = copy.deepcopy(values) - attributes.update({'price': self._get_size_price(size_id=key)}) - sizes.append(NodeSize(driver=self, **attributes)) - return sizes - - def list_images(self, location=None): - params = {'Action': 'DescribeImages'} - images = self._to_images( - self.connection.request(self.path, params=params).object - ) - return images - - def list_locations(self): - locations = [] - for index, availability_zone in enumerate(self.ex_list_availability_zones()): - locations.append(EC2NodeLocation(index, - self.friendly_name, - self.country, - self, - availability_zone)) - return locations - - def ex_create_keypair(self, name): - """Creates a new keypair - - @note: This is a non-standard extension API, and - only works for EC2. - - @type name: C{str} - @param name: The name of the keypair to Create. This must be - unique, otherwise an InvalidKeyPair.Duplicate - exception is raised. - """ - params = { - 'Action': 'CreateKeyPair', - 'KeyName': name, - } - response = self.connection.request(self.path, params=params).object - key_material = findtext(element=response, xpath='keyMaterial', - namespace=NAMESPACE) - key_fingerprint = findtext(element=response, xpath='keyFingerprint', - namespace=NAMESPACE) - return { - 'keyMaterial': key_material, - 'keyFingerprint': key_fingerprint, - } - - def ex_import_keypair(self, name, keyfile): - """imports a new public key - - @note: This is a non-standard extension API, and only works for EC2. - - @type name: C{str} - @param name: The name of the public key to import. This must be unique, - otherwise an InvalidKeyPair.Duplicate exception is raised. - - @type keyfile: C{str} - @param keyfile: The filename with path of the public key to import. - - """ - - base64key = base64.b64encode(open(os.path.expanduser(keyfile)).read()) - - params = {'Action': 'ImportKeyPair', - 'KeyName': name, - 'PublicKeyMaterial': base64key - } - - response = self.connection.request(self.path, params=params).object - key_name = findtext(element=response, xpath='keyName', namespace=NAMESPACE) - key_fingerprint = findtext(element=response, xpath='keyFingerprint', - namespace=NAMESPACE) - return { - 'keyName': key_name, - 'keyFingerprint': key_fingerprint, - } - - def ex_describe_keypairs(self, name): - """Describes a keypiar by name - - @note: This is a non-standard extension API, and only works for EC2. - - @type name: C{str} - @param name: The name of the keypair to describe. - - """ - - params = {'Action': 'DescribeKeyPairs', - 'KeyName.1': name - } - - response = self.connection.request(self.path, params=params).object - key_name = findattr(element=response, xpath='keySet/item/keyName', - namespace=NAMESPACE) - return { - 'keyName': key_name - } - - def ex_create_security_group(self, name, description): - """Creates a new Security Group - - @note: This is a non-standard extension API, and only works for EC2. - - @type name: C{str} - @param name: The name of the security group to Create. This must be unique. - - @type description: C{str} - @param description: Human readable description of a Security Group. - """ - params = {'Action': 'CreateSecurityGroup', - 'GroupName': name, - 'GroupDescription': description} - return self.connection.request(self.path, params=params).object - - def ex_authorize_security_group_permissive(self, name): - """Edit a Security Group to allow all traffic. - - @note: This is a non-standard extension API, and only works for EC2. - - @type name: C{str} - @param name: The name of the security group to edit - """ - - results = [] - params = {'Action': 'AuthorizeSecurityGroupIngress', - 'GroupName': name, - 'IpProtocol': 'tcp', - 'FromPort': '0', - 'ToPort': '65535', - 'CidrIp': '0.0.0.0/0'} - try: - results.append( - self.connection.request(self.path, params=params.copy()).object - ) - except Exception, e: - if e.args[0].find("InvalidPermission.Duplicate") == -1: - raise e - params['IpProtocol'] = 'udp' - - try: - results.append( - self.connection.request(self.path, params=params.copy()).object - ) - except Exception, e: - if e.args[0].find("InvalidPermission.Duplicate") == -1: - raise e - - params.update({'IpProtocol': 'icmp', 'FromPort': '-1', 'ToPort': '-1'}) - - try: - results.append( - self.connection.request(self.path, params=params.copy()).object - ) - except Exception, e: - if e.args[0].find("InvalidPermission.Duplicate") == -1: - raise e - return results - - def ex_list_availability_zones(self, only_available=True): - """ - Return a list of L{ExEC2AvailabilityZone} objects for the - current region. - - Note: This is an extension method and is only available for EC2 - driver. - - @keyword only_available: If true, return only availability zones - with state 'available' - @type only_available: C{string} - """ - params = {'Action': 'DescribeAvailabilityZones'} - - if only_available: - params.update({'Filter.0.Name': 'state'}) - params.update({'Filter.0.Value.0': 'available'}) - - params.update({'Filter.1.Name': 'region-name'}) - params.update({'Filter.1.Value.0': self.region_name}) - - result = self.connection.request(self.path, - params=params.copy()).object - - availability_zones = [] - for element in findall(element=result, xpath='availabilityZoneInfo/item', - namespace=NAMESPACE): - name = findtext(element=element, xpath='zoneName', - namespace=NAMESPACE) - zone_state = findtext(element=element, xpath='zoneState', - namespace=NAMESPACE) - region_name = findtext(element=element, xpath='regionName', - namespace=NAMESPACE) - - availability_zone = ExEC2AvailabilityZone( - name=name, - zone_state=zone_state, - region_name=region_name - ) - availability_zones.append(availability_zone) - - return availability_zones - - def ex_describe_tags(self, node): - """ - Return a dictionary of tags for this instance. - - @type node: C{Node} - @param node: Node instance - - @return dict Node tags - """ - params = { 'Action': 'DescribeTags', - 'Filter.0.Name': 'resource-id', - 'Filter.0.Value.0': node.id, - 'Filter.1.Name': 'resource-type', - 'Filter.1.Value.0': 'instance', - } - - result = self.connection.request(self.path, - params=params.copy()).object - - tags = {} - for element in findall(element=result, xpath='tagSet/item', - namespace=NAMESPACE): - key = findtext(element=element, xpath='key', namespace=NAMESPACE) - value = findtext(element=element, xpath='value', namespace=NAMESPACE) - - tags[key] = value - return tags - - def ex_create_tags(self, node, tags): - """ - Create tags for an instance. - - @type node: C{Node} - @param node: Node instance - @param tags: A dictionary or other mapping of strings to strings, - associating tag names with tag values. - """ - if not tags: - return - - params = { 'Action': 'CreateTags', - 'ResourceId.0': node.id } - for i, key in enumerate(tags): - params['Tag.%d.Key' % i] = key - params['Tag.%d.Value' % i] = tags[key] - - self.connection.request(self.path, - params=params.copy()).object - - def ex_delete_tags(self, node, tags): - """ - Delete tags from an instance. - - @type node: C{Node} - @param node: Node instance - @param tags: A dictionary or other mapping of strings to strings, - specifying the tag names and tag values to be deleted. - """ - if not tags: - return - - params = { 'Action': 'DeleteTags', - 'ResourceId.0': node.id } - for i, key in enumerate(tags): - params['Tag.%d.Key' % i] = key - params['Tag.%d.Value' % i] = tags[key] - - self.connection.request(self.path, - params=params.copy()).object - - def ex_describe_addresses(self, nodes): - """ - Return Elastic IP addresses for all the nodes in the provided list. - - @type nodes: C{list} - @param nodes: List of C{Node} instances - - @return dict Dictionary where a key is a node ID and the value is a - list with the Elastic IP addresses associated with this node. - """ - if not nodes: - return {} - - params = { 'Action': 'DescribeAddresses' } - - if len(nodes) == 1: - params.update({ - 'Filter.0.Name': 'instance-id', - 'Filter.0.Value.0': nodes[0].id - }) - - result = self.connection.request(self.path, - params=params.copy()).object - - node_instance_ids = [ node.id for node in nodes ] - nodes_elastic_ip_mappings = {} - - for node_id in node_instance_ids: - nodes_elastic_ip_mappings.setdefault(node_id, []) - for element in findall(element=result, xpath='addressesSet/item', - namespace=NAMESPACE): - instance_id = findtext(element=element, xpath='instanceId', - namespace=NAMESPACE) - ip_address = findtext(element=element, xpath='publicIp', - namespace=NAMESPACE) - - if instance_id not in node_instance_ids: - continue - - nodes_elastic_ip_mappings[instance_id].append(ip_address) - return nodes_elastic_ip_mappings - - def ex_describe_addresses_for_node(self, node): - """ - Return a list of Elastic IP addresses associated with this node. - - @type node: C{Node} - @param node: Node instance - - @return list Elastic IP addresses attached to this node. - """ - node_elastic_ips = self.ex_describe_addresses([node]) - return node_elastic_ips[node.id] - - def ex_modify_instance_attribute(self, node, attributes): - """ - Modify node attributes. - A list of valid attributes can be found at http://goo.gl/gxcj8 - - @type node: C{Node} - @param node: Node instance - - @type attributes: C{dict} - @param attributes: Dictionary with node attributes - - @return bool True on success, False otherwise. - """ - attributes = attributes or {} - attributes.update({'InstanceId': node.id}) - - params = { 'Action': 'ModifyInstanceAttribute' } - params.update(attributes) - - result = self.connection.request(self.path, - params=params.copy()).object - element = findtext(element=result, xpath='return', - namespace=NAMESPACE) - return element == 'true' - - def ex_change_node_size(self, node, new_size): - """ - Change the node size. - Note: Node must be turned of before changing the size. - - @type node: C{Node} - @param node: Node instance - - @type new_size: C{NodeSize} - @param new_size: NodeSize intance - - @return bool True on success, False otherwise. - """ - if 'instancetype' in node.extra: - current_instance_type = node.extra['instancetype'] - - if current_instance_type == new_size.id: - raise ValueError('New instance size is the same as the current one') - - attributes = { 'InstanceType.Value': new_size.id } - return self.ex_modify_instance_attribute(node, attributes) - - def create_node(self, **kwargs): - """Create a new EC2 node - - See L{NodeDriver.create_node} for more keyword args. - Reference: http://bit.ly/8ZyPSy [docs.amazonwebservices.com] - - @keyword ex_mincount: Minimum number of instances to launch - @type ex_mincount: C{int} - - @keyword ex_maxcount: Maximum number of instances to launch - @type ex_maxcount: C{int} - - @keyword ex_securitygroup: Name of security group - @type ex_securitygroup: C{str} - - @keyword ex_keyname: The name of the key pair - @type ex_keyname: C{str} - - @keyword ex_userdata: User data - @type ex_userdata: C{str} - - @keyword ex_clienttoken: Unique identifier to ensure idempotency - @type ex_clienttoken: C{str} - """ - image = kwargs["image"] - size = kwargs["size"] - params = { - 'Action': 'RunInstances', - 'ImageId': image.id, - 'MinCount': kwargs.get('ex_mincount','1'), - 'MaxCount': kwargs.get('ex_maxcount','1'), - 'InstanceType': size.id - } - - if 'ex_securitygroup' in kwargs: - if not isinstance(kwargs['ex_securitygroup'], list): - kwargs['ex_securitygroup'] = [kwargs['ex_securitygroup']] - for sig in range(len(kwargs['ex_securitygroup'])): - params['SecurityGroup.%d' % (sig+1,)] = kwargs['ex_securitygroup'][sig] - - if 'location' in kwargs: - availability_zone = getattr(kwargs['location'], 'availability_zone', - None) - if availability_zone: - if availability_zone.region_name != self.region_name: - raise AttributeError('Invalid availability zone: %s' - % (availability_zone.name)) - params['Placement.AvailabilityZone'] = availability_zone.name - - if 'ex_keyname' in kwargs: - params['KeyName'] = kwargs['ex_keyname'] - - if 'ex_userdata' in kwargs: - params['UserData'] = base64.b64encode(kwargs['ex_userdata']) - - if 'ex_clienttoken' in kwargs: - params['ClientToken'] = kwargs['ex_clienttoken'] - - object = self.connection.request(self.path, params=params).object - nodes = self._to_nodes(object, 'instancesSet/item') - - for node in nodes: - self.ex_create_tags(node=node, tags={'Name': kwargs['name']}) - - if len(nodes) == 1: - return nodes[0] - else: - return nodes - - def reboot_node(self, node): - """ - Reboot the node by passing in the node object - """ - params = {'Action': 'RebootInstances'} - params.update(self._pathlist('InstanceId', [node.id])) - res = self.connection.request(self.path, params=params).object - return self._get_boolean(res) - - def destroy_node(self, node): - """ - Destroy node by passing in the node object - """ - params = {'Action': 'TerminateInstances'} - params.update(self._pathlist('InstanceId', [node.id])) - res = self.connection.request(self.path, params=params).object - return self._get_terminate_boolean(res) - -class IdempotentParamError(LibcloudError): - """ - Request used the same client token as a previous, but non-identical request. - """ - def __str__(self): - return repr(self.value) - -class EC2EUConnection(EC2Connection): - """ - Connection class for EC2 in the Western Europe Region - """ - host = EC2_EU_WEST_HOST - -class EC2EUNodeDriver(EC2NodeDriver): - """ - Driver class for EC2 in the Western Europe Region - """ - - api_name = 'ec2_eu_west' - name = 'Amazon EC2 (eu-west-1)' - friendly_name = 'Amazon Europe Ireland' - country = 'IE' - region_name = 'eu-west-1' - connectionCls = EC2EUConnection - _instance_types = EC2_EU_WEST_INSTANCE_TYPES - -class EC2USWestConnection(EC2Connection): - """ - Connection class for EC2 in the Western US Region - """ - - host = EC2_US_WEST_HOST - -class EC2USWestNodeDriver(EC2NodeDriver): - """ - Driver class for EC2 in the Western US Region - """ - - api_name = 'ec2_us_west' - name = 'Amazon EC2 (us-west-1)' - friendly_name = 'Amazon US N. California' - country = 'US' - region_name = 'us-west-1' - connectionCls = EC2USWestConnection - _instance_types = EC2_US_WEST_INSTANCE_TYPES - -class EC2APSEConnection(EC2Connection): - """ - Connection class for EC2 in the Southeast Asia Pacific Region - """ - - host = EC2_AP_SOUTHEAST_HOST - -class EC2APNEConnection(EC2Connection): - """ - Connection class for EC2 in the Northeast Asia Pacific Region - """ - - host = EC2_AP_NORTHEAST_HOST - -class EC2APSENodeDriver(EC2NodeDriver): - """ - Driver class for EC2 in the Southeast Asia Pacific Region - """ - - api_name = 'ec2_ap_southeast' - name = 'Amazon EC2 (ap-southeast-1)' - friendly_name = 'Amazon Asia-Pacific Singapore' - country = 'SG' - region_name = 'ap-southeast-1' - connectionCls = EC2APSEConnection - _instance_types = EC2_AP_SOUTHEAST_INSTANCE_TYPES - -class EC2APNENodeDriver(EC2NodeDriver): - """ - Driver class for EC2 in the Northeast Asia Pacific Region - """ - - api_name = 'ec2_ap_northeast' - name = 'Amazon EC2 (ap-northeast-1)' - friendly_name = 'Amazon Asia-Pacific Tokyo' - country = 'JP' - region_name = 'ap-northeast-1' - connectionCls = EC2APNEConnection - _instance_types = EC2_AP_NORTHEAST_INSTANCE_TYPES - -class EucConnection(EC2Connection): - """ - Connection class for Eucalyptus - """ - - host = None - -class EucNodeDriver(EC2NodeDriver): - """ - Driver class for Eucalyptus - """ - - name = 'Eucalyptus' - connectionCls = EucConnection - _instance_types = EC2_US_WEST_INSTANCE_TYPES - - def __init__(self, key, secret=None, secure=True, host=None, path=None, port=None): - super(EucNodeDriver, self).__init__(key, secret, secure, host, port) - if path is None: - path = "/services/Eucalyptus" - self.path = path - - def list_locations(self): - raise NotImplementedError, \ - 'list_locations not implemented for this driver' - -# Nimbus clouds have 3 EC2-style instance types but their particular RAM -# allocations are configured by the admin -NIMBUS_INSTANCE_TYPES = { - 'm1.small': { - 'id' : 'm1.small', - 'name': 'Small Instance', - 'ram': None, - 'disk': None, - 'bandwidth': None, - }, - 'm1.large': { - 'id' : 'm1.large', - 'name': 'Large Instance', - 'ram': None, - 'disk': None, - 'bandwidth': None, - }, - 'm1.xlarge': { - 'id' : 'm1.xlarge', - 'name': 'Extra Large Instance', - 'ram': None, - 'disk': None, - 'bandwidth': None, - }, -} - -class NimbusConnection(EC2Connection): - """ - Connection class for Nimbus - """ - - host = None - -class NimbusNodeDriver(EC2NodeDriver): - """ - Driver class for Nimbus - """ - - type = Provider.NIMBUS - name = 'Nimbus' - api_name = 'nimbus' - region_name = 'nimbus' - friendly_name = 'Nimbus Private Cloud' - connectionCls = NimbusConnection - _instance_types = NIMBUS_INSTANCE_TYPES - - def ex_describe_addresses(self, nodes): - """Nimbus doesn't support elastic IPs, so this is a passthrough - """ - nodes_elastic_ip_mappings = {} - for node in nodes: - # empty list per node - nodes_elastic_ip_mappings[node.id] = [] - return nodes_elastic_ip_mappings diff --git a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/drivers/ecp.py b/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/drivers/ecp.py deleted file mode 100644 index 3c11316d4c5cd39417941a7cf1aa049f14415389..0000000000000000000000000000000000000000 --- a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/drivers/ecp.py +++ /dev/null @@ -1,360 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" -Enomaly ECP driver -""" -import time -import base64 -import httplib -import socket -import os - -# JSON is included in the standard library starting with Python 2.6. For 2.5 -# and 2.4, there's a simplejson egg at: http://pypi.python.org/pypi/simplejson -try: - import json -except: - import simplejson as json - -from libcloud.common.base import Response, ConnectionUserAndKey -from libcloud.compute.base import NodeDriver, NodeSize, NodeLocation -from libcloud.compute.base import NodeImage, Node -from libcloud.compute.types import Provider, NodeState, InvalidCredsError -from libcloud.compute.base import is_private_subnet - -#Defaults -API_HOST = '' -API_PORT = (80,443) - -class ECPResponse(Response): - - def success(self): - if self.status == httplib.OK or self.status == httplib.CREATED: - try: - j_body = json.loads(self.body) - except ValueError: - self.error = "JSON response cannot be decoded." - return False - if j_body['errno'] == 0: - return True - else: - self.error = "ECP error: %s" % j_body['message'] - return False - elif self.status == httplib.UNAUTHORIZED: - raise InvalidCredsError() - else: - self.error = "HTTP Error Code: %s" % self.status - return False - - def parse_error(self): - return self.error - - #Interpret the json responses - no error checking required - def parse_body(self): - return json.loads(self.body) - - def getheaders(self): - return self.headers - -class ECPConnection(ConnectionUserAndKey): - """ - Connection class for the Enomaly ECP driver - """ - - responseCls = ECPResponse - host = API_HOST - port = API_PORT - - def add_default_headers(self, headers): - #Authentication - username = self.user_id - password = self.key - base64string = base64.encodestring( - '%s:%s' % (username, password))[:-1] - authheader = "Basic %s" % base64string - headers['Authorization']= authheader - - return headers - - def _encode_multipart_formdata(self, fields): - """ - Based on Wade Leftwich's function: - http://code.activestate.com/recipes/146306/ - """ - #use a random boundary that does not appear in the fields - boundary = '' - while boundary in ''.join(fields): - boundary = os.urandom(16).encode('hex') - L = [] - for i in fields: - L.append('--' + boundary) - L.append('Content-Disposition: form-data; name="%s"' % i) - L.append('') - L.append(fields[i]) - L.append('--' + boundary + '--') - L.append('') - body = '\r\n'.join(L) - content_type = 'multipart/form-data; boundary=%s' % boundary - header = {'Content-Type':content_type} - return header, body - - -class ECPNodeDriver(NodeDriver): - """ - Enomaly ECP node driver - """ - - name = "Enomaly Elastic Computing Platform" - type = Provider.ECP - connectionCls = ECPConnection - - def list_nodes(self): - """ - Returns a list of all running Nodes - """ - - #Make the call - res = self.connection.request('/rest/hosting/vm/list').parse_body() - - #Put together a list of node objects - nodes=[] - for vm in res['vms']: - node = self._to_node(vm) - if not node == None: - nodes.append(node) - - #And return it - return nodes - - - def _to_node(self, vm): - """ - Turns a (json) dictionary into a Node object. - This returns only running VMs. - """ - - #Check state - if not vm['state'] == "running": - return None - - #IPs - iplist = [interface['ip'] for interface in vm['interfaces'] if interface['ip'] != '127.0.0.1'] - - public_ips = [] - private_ips = [] - for ip in iplist: - try: - socket.inet_aton(ip) - except socket.error: - # not a valid ip - continue - if is_private_subnet(ip): - private_ips.append(ip) - else: - public_ips.append(ip) - - #Create the node object - n = Node( - id=vm['uuid'], - name=vm['name'], - state=NodeState.RUNNING, - public_ip=public_ips, - private_ip=private_ips, - driver=self, - ) - - return n - - def reboot_node(self, node): - """ - Shuts down a VM and then starts it again. - """ - - #Turn the VM off - #Black magic to make the POST requests work - d = self.connection._encode_multipart_formdata({'action':'stop'}) - self.connection.request( - '/rest/hosting/vm/%s' % node.id, - method='POST', - headers=d[0], - data=d[1] - ).parse_body() - - node.state = NodeState.REBOOTING - #Wait for it to turn off and then continue (to turn it on again) - while node.state == NodeState.REBOOTING: - #Check if it's off. - response = self.connection.request( - '/rest/hosting/vm/%s' % node.id - ).parse_body() - if response['vm']['state'] == 'off': - node.state = NodeState.TERMINATED - else: - time.sleep(5) - - - #Turn the VM back on. - #Black magic to make the POST requests work - d = self.connection._encode_multipart_formdata({'action':'start'}) - self.connection.request( - '/rest/hosting/vm/%s' % node.id, - method='POST', - headers=d[0], - data=d[1] - ).parse_body() - - node.state = NodeState.RUNNING - return True - - def destroy_node(self, node): - """ - Shuts down and deletes a VM. - """ - - #Shut down first - #Black magic to make the POST requests work - d = self.connection._encode_multipart_formdata({'action':'stop'}) - self.connection.request( - '/rest/hosting/vm/%s' % node.id, - method = 'POST', - headers=d[0], - data=d[1] - ).parse_body() - - #Ensure there was no applicationl level error - node.state = NodeState.PENDING - #Wait for the VM to turn off before continuing - while node.state == NodeState.PENDING: - #Check if it's off. - response = self.connection.request( - '/rest/hosting/vm/%s' % node.id - ).parse_body() - if response['vm']['state'] == 'off': - node.state = NodeState.TERMINATED - else: - time.sleep(5) - - #Delete the VM - #Black magic to make the POST requests work - d = self.connection._encode_multipart_formdata({'action':'delete'}) - self.connection.request( - '/rest/hosting/vm/%s' % (node.id), - method='POST', - headers=d[0], - data=d[1] - ).parse_body() - - return True - - def list_images(self, location=None): - """ - Returns a list of all package templates aka appiances aka images - """ - - #Make the call - response = self.connection.request( - '/rest/hosting/ptemplate/list').parse_body() - - #Turn the response into an array of NodeImage objects - images = [] - for ptemplate in response['packages']: - images.append(NodeImage( - id = ptemplate['uuid'], - name= '%s: %s' % (ptemplate['name'], ptemplate['description']), - driver = self, - )) - - return images - - - def list_sizes(self, location=None): - """ - Returns a list of all hardware templates - """ - - #Make the call - response = self.connection.request( - '/rest/hosting/htemplate/list').parse_body() - - #Turn the response into an array of NodeSize objects - sizes = [] - for htemplate in response['templates']: - sizes.append(NodeSize( - id = htemplate['uuid'], - name = htemplate['name'], - ram = htemplate['memory'], - disk = 0, #Disk is independent of hardware template - bandwidth = 0, #There is no way to keep track of bandwidth - price = 0, #The billing system is external - driver = self, - )) - - return sizes - - def list_locations(self): - """ - This feature does not exist in ECP. Returns hard coded dummy location. - """ - return [ - NodeLocation(id=1, - name="Cloud", - country='', - driver=self), - ] - - def create_node(self, **kwargs): - """ - Creates a virtual machine. - - Parameters: name (string), image (NodeImage), size (NodeSize) - """ - - #Find out what network to put the VM on. - res = self.connection.request('/rest/hosting/network/list').parse_body() - - #Use the first / default network because there is no way to specific - #which one - network = res['networks'][0]['uuid'] - - #Prepare to make the VM - data = { - 'name' : str(kwargs['name']), - 'package' : str(kwargs['image'].id), - 'hardware' : str(kwargs['size'].id), - 'network_uuid' : str(network), - 'disk' : '' - } - - #Black magic to make the POST requests work - d = self.connection._encode_multipart_formdata(data) - response = self.connection.request( - '/rest/hosting/vm/', - method='PUT', - headers = d[0], - data=d[1] - ).parse_body() - - #Create a node object and return it. - n = Node( - id=response['machine_id'], - name=data['name'], - state=NodeState.PENDING, - public_ip=[], - private_ip=[], - driver=self, - ) - - return n diff --git a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/drivers/elastichosts.py b/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/drivers/elastichosts.py deleted file mode 100644 index e083c7c9661015224e29301c51ff1823fe698671..0000000000000000000000000000000000000000 --- a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/drivers/elastichosts.py +++ /dev/null @@ -1,579 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -""" -ElasticHosts Driver -""" -import re -import time -import base64 -import httplib - -try: - import json -except: - import simplejson as json - -from libcloud.common.base import ConnectionUserAndKey, Response -from libcloud.common.types import InvalidCredsError, MalformedResponseError -from libcloud.compute.types import Provider, NodeState -from libcloud.compute.base import NodeDriver, NodeSize, Node -from libcloud.compute.base import NodeImage -from libcloud.compute.deployment import ScriptDeployment, SSHKeyDeployment, MultiStepDeployment - -# API end-points -API_ENDPOINTS = { - 'uk-1': { - 'name': 'London Peer 1', - 'country': 'United Kingdom', - 'host': 'api.lon-p.elastichosts.com' - }, - 'uk-2': { - 'name': 'London BlueSquare', - 'country': 'United Kingdom', - 'host': 'api.lon-b.elastichosts.com' - }, - 'us-1': { - 'name': 'San Antonio Peer 1', - 'country': 'United States', - 'host': 'api.sat-p.elastichosts.com' - }, -} - -# Default API end-point for the base connection clase. -DEFAULT_ENDPOINT = 'us-1' - -# ElasticHosts doesn't specify special instance types, so I just specified -# some plans based on the pricing page -# (http://www.elastichosts.com/cloud-hosting/pricing) -# and other provides. -# -# Basically for CPU any value between 500Mhz and 20000Mhz should work, -# 256MB to 8192MB for ram and 1GB to 2TB for disk. -INSTANCE_TYPES = { - 'small': { - 'id': 'small', - 'name': 'Small instance', - 'cpu': 2000, - 'memory': 1700, - 'disk': 160, - 'bandwidth': None, - }, - 'medium': { - 'id': 'medium', - 'name': 'Medium instance', - 'cpu': 3000, - 'memory': 4096, - 'disk': 500, - 'bandwidth': None, - }, - 'large': { - 'id': 'large', - 'name': 'Large instance', - 'cpu': 4000, - 'memory': 7680, - 'disk': 850, - 'bandwidth': None, - }, - 'extra-large': { - 'id': 'extra-large', - 'name': 'Extra Large instance', - 'cpu': 8000, - 'memory': 8192, - 'disk': 1690, - 'bandwidth': None, - }, - 'high-cpu-medium': { - 'id': 'high-cpu-medium', - 'name': 'High-CPU Medium instance', - 'cpu': 5000, - 'memory': 1700, - 'disk': 350, - 'bandwidth': None, - }, - 'high-cpu-extra-large': { - 'id': 'high-cpu-extra-large', - 'name': 'High-CPU Extra Large instance', - 'cpu': 20000, - 'memory': 7168, - 'disk': 1690, - 'bandwidth': None, - }, -} - -# Retrieved from http://www.elastichosts.com/cloud-hosting/api -STANDARD_DRIVES = { - '38df0986-4d85-4b76-b502-3878ffc80161': { - 'uuid': '38df0986-4d85-4b76-b502-3878ffc80161', - 'description': 'CentOS Linux 5.5', - 'size_gunzipped': '3GB', - 'supports_deployment': True, - }, - '980cf63c-f21e-4382-997b-6541d5809629': { - 'uuid': '980cf63c-f21e-4382-997b-6541d5809629', - 'description': 'Debian Linux 5.0', - 'size_gunzipped': '1GB', - 'supports_deployment': True, - }, - 'aee5589a-88c3-43ef-bb0a-9cab6e64192d': { - 'uuid': 'aee5589a-88c3-43ef-bb0a-9cab6e64192d', - 'description': 'Ubuntu Linux 10.04', - 'size_gunzipped': '1GB', - 'supports_deployment': True, - }, - 'b9d0eb72-d273-43f1-98e3-0d4b87d372c0': { - 'uuid': 'b9d0eb72-d273-43f1-98e3-0d4b87d372c0', - 'description': 'Windows Web Server 2008', - 'size_gunzipped': '13GB', - 'supports_deployment': False, - }, - '30824e97-05a4-410c-946e-2ba5a92b07cb': { - 'uuid': '30824e97-05a4-410c-946e-2ba5a92b07cb', - 'description': 'Windows Web Server 2008 R2', - 'size_gunzipped': '13GB', - 'supports_deployment': False, - }, - '9ecf810e-6ad1-40ef-b360-d606f0444671': { - 'uuid': '9ecf810e-6ad1-40ef-b360-d606f0444671', - 'description': 'Windows Web Server 2008 R2 + SQL Server', - 'size_gunzipped': '13GB', - 'supports_deployment': False, - }, - '10a88d1c-6575-46e3-8d2c-7744065ea530': { - 'uuid': '10a88d1c-6575-46e3-8d2c-7744065ea530', - 'description': 'Windows Server 2008 Standard R2', - 'size_gunzipped': '13GB', - 'supports_deployment': False, - }, - '2567f25c-8fb8-45c7-95fc-bfe3c3d84c47': { - 'uuid': '2567f25c-8fb8-45c7-95fc-bfe3c3d84c47', - 'description': 'Windows Server 2008 Standard R2 + SQL Server', - 'size_gunzipped': '13GB', - 'supports_deployment': False, - }, -} - -NODE_STATE_MAP = { - 'active': NodeState.RUNNING, - 'dead': NodeState.TERMINATED, - 'dumped': NodeState.TERMINATED, -} - -# Default timeout (in seconds) for the drive imaging process -IMAGING_TIMEOUT = 10 * 60 - -class ElasticHostsException(Exception): - """ - Exception class for ElasticHosts driver - """ - - def __str__(self): - return self.args[0] - - def __repr__(self): - return "" % (self.args[0]) - -class ElasticHostsResponse(Response): - def success(self): - if self.status == 401: - raise InvalidCredsError() - - return self.status >= 200 and self.status <= 299 - - def parse_body(self): - if not self.body: - return self.body - - try: - data = json.loads(self.body) - except: - raise MalformedResponseError("Failed to parse JSON", - body=self.body, - driver=ElasticHostsBaseNodeDriver) - - return data - - def parse_error(self): - error_header = self.headers.get('x-elastic-error', '') - return 'X-Elastic-Error: %s (%s)' % (error_header, self.body.strip()) - -class ElasticHostsNodeSize(NodeSize): - def __init__(self, id, name, cpu, ram, disk, bandwidth, price, driver): - self.id = id - self.name = name - self.cpu = cpu - self.ram = ram - self.disk = disk - self.bandwidth = bandwidth - self.price = price - self.driver = driver - - def __repr__(self): - return (('') - % (self.id, self.name, self.cpu, self.ram, - self.disk, self.bandwidth, self.price, self.driver.name)) - -class ElasticHostsBaseConnection(ConnectionUserAndKey): - """ - Base connection class for the ElasticHosts driver - """ - - host = API_ENDPOINTS[DEFAULT_ENDPOINT]['host'] - responseCls = ElasticHostsResponse - - def add_default_headers(self, headers): - headers['Accept'] = 'application/json' - headers['Content-Type'] = 'application/json' - headers['Authorization'] = ('Basic %s' - % (base64.b64encode('%s:%s' - % (self.user_id, - self.key)))) - return headers - -class ElasticHostsBaseNodeDriver(NodeDriver): - """ - Base ElasticHosts node driver - """ - - type = Provider.ELASTICHOSTS - api_name = 'elastichosts' - name = 'ElasticHosts' - connectionCls = ElasticHostsBaseConnection - features = {"create_node": ["generates_password"]} - - def reboot_node(self, node): - # Reboots the node - response = self.connection.request( - action='/servers/%s/reset' % (node.id), - method='POST' - ) - return response.status == 204 - - def destroy_node(self, node): - # Kills the server immediately - response = self.connection.request( - action='/servers/%s/destroy' % (node.id), - method='POST' - ) - return response.status == 204 - - def list_images(self, location=None): - # Returns a list of available pre-installed system drive images - images = [] - for key, value in STANDARD_DRIVES.iteritems(): - image = NodeImage( - id=value['uuid'], - name=value['description'], - driver=self.connection.driver, - extra={ - 'size_gunzipped': value['size_gunzipped'] - } - ) - images.append(image) - - return images - - def list_sizes(self, location=None): - sizes = [] - for key, value in INSTANCE_TYPES.iteritems(): - size = ElasticHostsNodeSize( - id=value['id'], - name=value['name'], cpu=value['cpu'], ram=value['memory'], - disk=value['disk'], bandwidth=value['bandwidth'], - price=self._get_size_price(size_id=value['id']), - driver=self.connection.driver - ) - sizes.append(size) - - return sizes - - def list_nodes(self): - # Returns a list of active (running) nodes - response = self.connection.request(action='/servers/info').object - - nodes = [] - for data in response: - node = self._to_node(data) - nodes.append(node) - - return nodes - - def create_node(self, **kwargs): - """Creates a ElasticHosts instance - - See L{NodeDriver.create_node} for more keyword args. - - @keyword name: String with a name for this new node (required) - @type name: C{string} - - @keyword smp: Number of virtual processors or None to calculate - based on the cpu speed - @type smp: C{int} - - @keyword nic_model: e1000, rtl8139 or virtio - (if not specified, e1000 is used) - @type nic_model: C{string} - - @keyword vnc_password: If set, the same password is also used for - SSH access with user toor, - otherwise VNC access is disabled and - no SSH login is possible. - @type vnc_password: C{string} - """ - size = kwargs['size'] - image = kwargs['image'] - smp = kwargs.get('smp', 'auto') - nic_model = kwargs.get('nic_model', 'e1000') - vnc_password = ssh_password = kwargs.get('vnc_password', None) - - if nic_model not in ('e1000', 'rtl8139', 'virtio'): - raise ElasticHostsException('Invalid NIC model specified') - - # check that drive size is not smaller then pre installed image size - - # First we create a drive with the specified size - drive_data = {} - drive_data.update({'name': kwargs['name'], - 'size': '%sG' % (kwargs['size'].disk)}) - - response = self.connection.request(action='/drives/create', - data=json.dumps(drive_data), - method='POST').object - - if not response: - raise ElasticHostsException('Drive creation failed') - - drive_uuid = response['drive'] - - # Then we image the selected pre-installed system drive onto it - response = self.connection.request( - action='/drives/%s/image/%s/gunzip' % (drive_uuid, image.id), - method='POST' - ) - - if response.status != 204: - raise ElasticHostsException('Drive imaging failed') - - # We wait until the drive is imaged and then boot up the node - # (in most cases, the imaging process shouldn't take longer - # than a few minutes) - response = self.connection.request( - action='/drives/%s/info' % (drive_uuid) - ).object - imaging_start = time.time() - while response.has_key('imaging'): - response = self.connection.request( - action='/drives/%s/info' % (drive_uuid) - ).object - elapsed_time = time.time() - imaging_start - if (response.has_key('imaging') - and elapsed_time >= IMAGING_TIMEOUT): - raise ElasticHostsException('Drive imaging timed out') - time.sleep(1) - - node_data = {} - node_data.update({'name': kwargs['name'], - 'cpu': size.cpu, - 'mem': size.ram, - 'ide:0:0': drive_uuid, - 'boot': 'ide:0:0', - 'smp': smp}) - node_data.update({'nic:0:model': nic_model, 'nic:0:dhcp': 'auto'}) - - if vnc_password: - node_data.update({'vnc:ip': 'auto', 'vnc:password': vnc_password}) - - response = self.connection.request( - action='/servers/create', data=json.dumps(node_data), - method='POST' - ).object - - if isinstance(response, list): - nodes = [self._to_node(node, ssh_password) for node in response] - else: - nodes = self._to_node(response, ssh_password) - - return nodes - - # Extension methods - def ex_set_node_configuration(self, node, **kwargs): - # Changes the configuration of the running server - valid_keys = ('^name$', '^parent$', '^cpu$', '^smp$', '^mem$', - '^boot$', '^nic:0:model$', '^nic:0:dhcp', - '^nic:1:model$', '^nic:1:vlan$', '^nic:1:mac$', - '^vnc:ip$', '^vnc:password$', '^vnc:tls', - '^ide:[0-1]:[0-1](:media)?$', - '^scsi:0:[0-7](:media)?$', '^block:[0-7](:media)?$') - - invalid_keys = [] - for key in kwargs.keys(): - matches = False - for regex in valid_keys: - if re.match(regex, key): - matches = True - break - if not matches: - invalid_keys.append(key) - - if invalid_keys: - raise ElasticHostsException( - 'Invalid configuration key specified: %s' - % (',' .join(invalid_keys)) - ) - - response = self.connection.request( - action='/servers/%s/set' % (node.id), data=json.dumps(kwargs), - method='POST' - ) - - return (response.status == httplib.OK and response.body != '') - - def deploy_node(self, **kwargs): - """ - Create a new node, and start deployment. - - @keyword enable_root: If true, root password will be set to - vnc_password (this will enable SSH access) - and default 'toor' account will be deleted. - @type enable_root: C{bool} - - For detailed description and keywords args, see - L{NodeDriver.deploy_node}. - """ - image = kwargs['image'] - vnc_password = kwargs.get('vnc_password', None) - enable_root = kwargs.get('enable_root', False) - - if not vnc_password: - raise ValueError('You need to provide vnc_password argument ' - 'if you want to use deployment') - - if (image in STANDARD_DRIVES - and STANDARD_DRIVES[image]['supports_deployment']): - raise ValueError('Image %s does not support deployment' - % (image.id)) - - if enable_root: - script = ("unset HISTFILE;" - "echo root:%s | chpasswd;" - "sed -i '/^toor.*$/d' /etc/passwd /etc/shadow;" - "history -c") % vnc_password - root_enable_script = ScriptDeployment(script=script, - delete=True) - deploy = kwargs.get('deploy', None) - if deploy: - if (isinstance(deploy, ScriptDeployment) - or isinstance(deploy, SSHKeyDeployment)): - deployment = MultiStepDeployment([deploy, - root_enable_script]) - elif isinstance(deploy, MultiStepDeployment): - deployment = deploy - deployment.add(root_enable_script) - else: - deployment = root_enable_script - - kwargs['deploy'] = deployment - - if not kwargs.get('ssh_username', None): - kwargs['ssh_username'] = 'toor' - - return super(ElasticHostsBaseNodeDriver, self).deploy_node(**kwargs) - - def ex_shutdown_node(self, node): - # Sends the ACPI power-down event - response = self.connection.request( - action='/servers/%s/shutdown' % (node.id), - method='POST' - ) - return response.status == 204 - - def ex_destroy_drive(self, drive_uuid): - # Deletes a drive - response = self.connection.request( - action='/drives/%s/destroy' % (drive_uuid), - method='POST' - ) - return response.status == 204 - - # Helper methods - def _to_node(self, data, ssh_password=None): - try: - state = NODE_STATE_MAP[data['status']] - except KeyError: - state = NodeState.UNKNOWN - - if isinstance(data['nic:0:dhcp'], list): - public_ip = data['nic:0:dhcp'] - else: - public_ip = [data['nic:0:dhcp']] - - extra = {'cpu': data['cpu'], - 'smp': data['smp'], - 'mem': data['mem'], - 'started': data['started']} - - if data.has_key('vnc:ip') and data.has_key('vnc:password'): - extra.update({'vnc_ip': data['vnc:ip'], - 'vnc_password': data['vnc:password']}) - - if ssh_password: - extra.update({'password': ssh_password}) - - node = Node(id=data['server'], name=data['name'], state=state, - public_ip=public_ip, private_ip=None, - driver=self.connection.driver, - extra=extra) - - return node - -class ElasticHostsUK1Connection(ElasticHostsBaseConnection): - """ - Connection class for the ElasticHosts driver for - the London Peer 1 end-point - """ - - host = API_ENDPOINTS['uk-1']['host'] - -class ElasticHostsUK1NodeDriver(ElasticHostsBaseNodeDriver): - """ - ElasticHosts node driver for the London Peer 1 end-point - """ - connectionCls = ElasticHostsUK1Connection - -class ElasticHostsUK2Connection(ElasticHostsBaseConnection): - """ - Connection class for the ElasticHosts driver for - the London Bluesquare end-point - """ - host = API_ENDPOINTS['uk-2']['host'] - -class ElasticHostsUK2NodeDriver(ElasticHostsBaseNodeDriver): - """ - ElasticHosts node driver for the London Bluesquare end-point - """ - connectionCls = ElasticHostsUK2Connection - -class ElasticHostsUS1Connection(ElasticHostsBaseConnection): - """ - Connection class for the ElasticHosts driver for - the San Antonio Peer 1 end-point - """ - host = API_ENDPOINTS['us-1']['host'] - -class ElasticHostsUS1NodeDriver(ElasticHostsBaseNodeDriver): - """ - ElasticHosts node driver for the San Antonio Peer 1 end-point - """ - connectionCls = ElasticHostsUS1Connection diff --git a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/drivers/gandi.py b/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/drivers/gandi.py deleted file mode 100644 index d4dd3751f51c53bfdca3dc676d2a57370eed0e8d..0000000000000000000000000000000000000000 --- a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/drivers/gandi.py +++ /dev/null @@ -1,367 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -""" -Gandi driver -""" - -import time -import xmlrpclib - -import libcloud -from libcloud.compute.types import Provider, NodeState -from libcloud.compute.base import NodeDriver, Node, NodeLocation, NodeSize, NodeImage - -# Global constants -API_VERSION = '2.0' -API_PREFIX = "https://rpc.gandi.net/xmlrpc/%s/" % API_VERSION - -DEFAULT_TIMEOUT = 600 # operation pooling max seconds -DEFAULT_INTERVAL = 20 # seconds between 2 operation.info - -NODE_STATE_MAP = { - 'running': NodeState.RUNNING, - 'halted': NodeState.TERMINATED, - 'paused': NodeState.TERMINATED, - 'locked' : NodeState.TERMINATED, - 'being_created' : NodeState.PENDING, - 'invalid' : NodeState.UNKNOWN, - 'legally_locked' : NodeState.PENDING, - 'deleted' : NodeState.TERMINATED -} - -NODE_PRICE_HOURLY_USD = 0.02 - -class GandiException(Exception): - """ - Exception class for Gandi driver - """ - def __str__(self): - return "(%u) %s" % (self.args[0], self.args[1]) - def __repr__(self): - return "" % (self.args[0], self.args[1]) - -class GandiSafeTransport(xmlrpclib.SafeTransport): - pass - -class GandiTransport(xmlrpclib.Transport): - pass - -class GandiProxy(xmlrpclib.ServerProxy): - transportCls = (GandiTransport, GandiSafeTransport) - - def __init__(self,user_agent, verbose=0): - cls = self.transportCls[0] - if API_PREFIX.startswith("https://"): - cls = self.transportCls[1] - t = cls(use_datetime=0) - t.user_agent = user_agent - xmlrpclib.ServerProxy.__init__( - self, - uri="%s" % (API_PREFIX), - transport=t, - verbose=verbose, - allow_none=True - ) - -class GandiConnection(object): - """ - Connection class for the Gandi driver - """ - - proxyCls = GandiProxy - driver = 'gandi' - - def __init__(self, user, password=None): - self.ua = [] - - # Connect only with an api_key generated on website - self.api_key = user - - try: - self._proxy = self.proxyCls(self._user_agent()) - except xmlrpclib.Fault, e: - raise GandiException(1000, e) - - def _user_agent(self): - return 'libcloud/%s (%s)%s' % ( - libcloud.__version__, - self.driver, - "".join([" (%s)" % x for x in self.ua])) - - def user_agent_append(self, s): - self.ua.append(s) - - def request(self,method,*args): - """ Request xmlrpc method with given args""" - try: - return getattr(self._proxy, method)(self.api_key,*args) - except xmlrpclib.Fault, e: - raise GandiException(1001, e) - - -class GandiNodeDriver(NodeDriver): - """ - Gandi node driver - - """ - connectionCls = GandiConnection - name = 'Gandi' - api_name = 'gandi' - friendly_name = 'Gandi.net' - country = 'FR' - type = Provider.GANDI - # TODO : which features to enable ? - features = { } - - def __init__(self, key, secret=None, secure=False): - self.key = key - self.secret = secret - self.connection = self.connectionCls(key, secret) - self.connection.driver = self - - # Specific methods for gandi - def _wait_operation(self, id, timeout=DEFAULT_TIMEOUT, check_interval=DEFAULT_INTERVAL): - """ Wait for an operation to succeed""" - - for i in range(0, timeout, check_interval): - try: - op = self.connection.request('operation.info', int(id)) - - if op['step'] == 'DONE': - return True - if op['step'] in ['ERROR','CANCEL']: - return False - except (KeyError, IndexError): - pass - except Exception, e: - raise GandiException(1002, e) - - time.sleep(check_interval) - return False - - def _node_info(self,id): - try: - obj = self.connection.request('vm.info',int(id)) - return obj - except Exception,e: - raise GandiException(1003, e) - return None - - # Generic methods for driver - def _to_node(self, vm): - return Node( - id=vm['id'], - name=vm['hostname'], - state=NODE_STATE_MAP.get( - vm['state'], - NodeState.UNKNOWN - ), - public_ip=vm.get('ip'), - private_ip='', - driver=self, - extra={ - 'ai_active' : vm.get('ai_active'), - 'datacenter_id' : vm.get('datacenter_id'), - 'description' : vm.get('description') - } - ) - - def _to_nodes(self, vms): - return [self._to_node(v) for v in vms] - - def list_nodes(self): - vms = self.connection.request('vm.list') - ips = self.connection.request('ip.list') - for vm in vms: - for ip in ips: - if vm['ifaces_id'][0] == ip['iface_id']: - vm['ip'] = ip.get('ip') - - nodes = self._to_nodes(vms) - return nodes - - def reboot_node(self, node): - op = self.connection.request('vm.reboot',int(node.id)) - op_res = self._wait_operation(op['id']) - vm = self.connection.request('vm.info',int(node.id)) - if vm['state'] == 'running': - return True - return False - - def destroy_node(self, node): - vm = self._node_info(node.id) - if vm['state'] == 'running': - # Send vm_stop and wait for accomplish - op_stop = self.connection.request('vm.stop',int(node.id)) - if not self._wait_operation(op_stop['id']): - raise GandiException(1010, 'vm.stop failed') - # Delete - op = self.connection.request('vm.delete',int(node.id)) - if self._wait_operation(op['id']): - return True - return False - - def deploy_node(self, **kwargs): - raise NotImplementedError, \ - 'deploy_node not implemented for gandi driver' - - def create_node(self, **kwargs): - """Create a new Gandi node - - @keyword name: String with a name for this new node (required) - @type name: str - - @keyword image: OS Image to boot on node. (required) - @type image: L{NodeImage} - - @keyword location: Which data center to create a node in. If empty, - undefined behavoir will be selected. (optional) - @type location: L{NodeLocation} - - @keyword size: The size of resources allocated to this node. - (required) - @type size: L{NodeSize} - - @keyword login: user name to create for login on this machine (required) - @type login: String - - @keyword password: password for user that'll be created (required) - @type password: String - - @keywork inet_family: version of ip to use, default 4 (optional) - @type inet_family: int - """ - - if kwargs.get('login') is None or kwargs.get('password') is None: - raise GandiException(1020, 'login and password must be defined for node creation') - - location = kwargs.get('location') - if location and isinstance(location,NodeLocation): - dc_id = int(location.id) - else: - raise GandiException(1021, 'location must be a subclass of NodeLocation') - - size = kwargs.get('size') - if not size and not isinstance(size,NodeSize): - raise GandiException(1022, 'size must be a subclass of NodeSize') - - src_disk_id = int(kwargs['image'].id) - - disk_spec = { - 'datacenter_id': dc_id, - 'name': 'disk_%s' % kwargs['name'] - } - - vm_spec = { - 'datacenter_id': dc_id, - 'hostname': kwargs['name'], - 'login': kwargs['login'], - 'password': kwargs['password'], # TODO : use NodeAuthPassword - 'memory': int(size.ram), - 'cores': int(size.id), - 'bandwidth' : int(size.bandwidth), - 'ip_version': kwargs.get('inet_family',4), - } - - # Call create_from helper api. Return 3 operations : disk_create, - # iface_create,vm_create - (op_disk,op_iface,op_vm) = self.connection.request( - 'vm.create_from', - vm_spec,disk_spec,src_disk_id - ) - - # We wait for vm_create to finish - if self._wait_operation(op_vm['id']): - # after successful operation, get ip information thru first interface - node = self._node_info(op_vm['vm_id']) - ifaces = node.get('ifaces') - if len(ifaces) > 0: - ips = ifaces[0].get('ips') - if len(ips) > 0: - node['ip'] = ips[0]['ip'] - return self._to_node(node) - - return None - - def _to_image(self, img): - return NodeImage( - id=img['disk_id'], - name=img['label'], - driver=self.connection.driver - ) - - def list_images(self, location=None): - try: - if location: - filtering = { 'datacenter_id' : int(location.id) } - else: - filtering = {} - images = self.connection.request('image.list', filtering ) - return [self._to_image(i) for i in images] - except Exception, e: - raise GandiException(1011, e) - - def _to_size(self, id, size): - return NodeSize( - id=id, - name='%s cores' % id, - ram=size['memory'], - disk=size['disk'], - bandwidth=size['bandwidth'], - price=(self._get_size_price(size_id='1') * id), - driver=self.connection.driver, - ) - - def list_sizes(self, location=None): - account = self.connection.request('account.info') - # Look for available shares, and return a list of share_definition - available_res = account['resources']['available'] - - if available_res['shares'] == 0: - return None - else: - share_def = account['share_definition'] - available_cores = available_res['cores'] - # 0.75 core given when creating a server - max_core = int(available_cores + 0.75) - shares = [] - if available_res['servers'] < 1: - # No server quota, no way - return shares - for i in range(1,max_core + 1): - share = {id:i} - share_is_available = True - for k in ['memory', 'disk', 'bandwidth']: - if share_def[k] * i > available_res[k]: - # We run out for at least one resource inside - share_is_available = False - else: - share[k] = share_def[k] * i - if share_is_available: - nb_core = i - shares.append(self._to_size(nb_core,share)) - return shares - - def _to_loc(self, loc): - return NodeLocation( - id=loc['id'], - name=loc['name'], - country=loc['country'], - driver=self - ) - - def list_locations(self): - res = self.connection.request("datacenter.list") - return [self._to_loc(l) for l in res] diff --git a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/drivers/gogrid.py b/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/drivers/gogrid.py deleted file mode 100644 index 850c0d75d925fd27a672824d3c2d03fcbc62ba6d..0000000000000000000000000000000000000000 --- a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/drivers/gogrid.py +++ /dev/null @@ -1,395 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -""" -GoGrid driver -""" -import time -import hashlib -import copy - -from libcloud.common.types import InvalidCredsError, LibcloudError -from libcloud.common.gogrid import GoGridConnection, BaseGoGridDriver -from libcloud.compute.providers import Provider -from libcloud.compute.types import NodeState -from libcloud.compute.base import Node, NodeDriver -from libcloud.compute.base import NodeSize, NodeImage, NodeLocation - -STATE = { - "Starting": NodeState.PENDING, - "On": NodeState.RUNNING, - "On/Saving": NodeState.RUNNING, - "Off": NodeState.PENDING, - "Restarting": NodeState.REBOOTING, - "Saving": NodeState.PENDING, - "Restoring": NodeState.PENDING, -} - -GOGRID_INSTANCE_TYPES = { - '512MB': {'id': '512MB', - 'name': '512MB', - 'ram': 512, - 'disk': 30, - 'bandwidth': None}, - '1GB': {'id': '1GB', - 'name': '1GB', - 'ram': 1024, - 'disk': 60, - 'bandwidth': None}, - '2GB': {'id': '2GB', - 'name': '2GB', - 'ram': 2048, - 'disk': 120, - 'bandwidth': None}, - '4GB': {'id': '4GB', - 'name': '4GB', - 'ram': 4096, - 'disk': 240, - 'bandwidth': None}, - '8GB': {'id': '8GB', - 'name': '8GB', - 'ram': 8192, - 'disk': 480, - 'bandwidth': None}, - '16GB': {'id': '16GB', - 'name': '16GB', - 'ram': 16384, - 'disk': 960, - 'bandwidth': None}, -} - - -class GoGridNode(Node): - # Generating uuid based on public ip to get around missing id on - # create_node in gogrid api - # - # Used public ip since it is not mutable and specified at create time, - # so uuid of node should not change after add is completed - def get_uuid(self): - return hashlib.sha1( - "%s:%d" % (self.public_ip,self.driver.type) - ).hexdigest() - -class GoGridNodeDriver(BaseGoGridDriver, NodeDriver): - """ - GoGrid node driver - """ - - connectionCls = GoGridConnection - type = Provider.GOGRID - api_name = 'gogrid' - name = 'GoGrid' - features = {"create_node": ["generates_password"]} - - _instance_types = GOGRID_INSTANCE_TYPES - - def _get_state(self, element): - try: - return STATE[element['state']['name']] - except: - pass - return NodeState.UNKNOWN - - def _get_ip(self, element): - return element.get('ip').get('ip') - - def _get_id(self, element): - return element.get('id') - - def _to_node(self, element, password=None): - state = self._get_state(element) - ip = self._get_ip(element) - id = self._get_id(element) - n = GoGridNode(id=id, - name=element['name'], - state=state, - public_ip=[ip], - private_ip=[], - extra={'ram': element.get('ram').get('name')}, - driver=self.connection.driver) - if password: - n.extra['password'] = password - - return n - - def _to_image(self, element): - n = NodeImage(id=element['id'], - name=element['friendlyName'], - driver=self.connection.driver) - return n - - def _to_images(self, object): - return [ self._to_image(el) - for el in object['list'] ] - - def _to_location(self, element): - location = NodeLocation(id=element['id'], - name=element['name'], - country="US", - driver=self.connection.driver) - return location - - def _to_locations(self, object): - return [self._to_location(el) - for el in object['list']] - - def list_images(self, location=None): - params = {} - if location is not None: - params["datacenter"] = location.id - images = self._to_images( - self.connection.request('/api/grid/image/list', params).object) - return images - - def list_nodes(self): - passwords_map = {} - - res = self._server_list() - try: - for password in self._password_list()['list']: - try: - passwords_map[password['server']['id']] = password['password'] - except KeyError: - pass - except InvalidCredsError: - # some gogrid API keys don't have permission to access the password list. - pass - - return [ self._to_node(el, passwords_map.get(el.get('id'))) - for el - in res['list'] ] - - def reboot_node(self, node): - id = node.id - power = 'restart' - res = self._server_power(id, power) - if not res.success(): - raise Exception(res.parse_error()) - return True - - def destroy_node(self, node): - id = node.id - res = self._server_delete(id) - if not res.success(): - raise Exception(res.parse_error()) - return True - - def _server_list(self): - return self.connection.request('/api/grid/server/list').object - - def _password_list(self): - return self.connection.request('/api/support/password/list').object - - def _server_power(self, id, power): - # power in ['start', 'stop', 'restart'] - params = {'id': id, 'power': power} - return self.connection.request("/api/grid/server/power", params, - method='POST') - - def _server_delete(self, id): - params = {'id': id} - return self.connection.request("/api/grid/server/delete", params, - method='POST') - - def _get_first_ip(self, location=None): - ips = self.ex_list_ips(public=True, assigned=False, location=location) - try: - return ips[0].ip - except IndexError: - raise LibcloudError('No public unassigned IPs left', - GoGridNodeDriver) - - def list_sizes(self, location=None): - sizes = [] - for key, values in self._instance_types.iteritems(): - attributes = copy.deepcopy(values) - attributes.update({ 'price': self._get_size_price(size_id=key) }) - sizes.append(NodeSize(driver=self.connection.driver, **attributes)) - - return sizes - - def list_locations(self): - locations = self._to_locations( - self.connection.request('/api/common/lookup/list', - params={'lookup': 'ip.datacenter'}).object) - return locations - - def ex_create_node_nowait(self, **kwargs): - """Don't block until GoGrid allocates id for a node - but return right away with id == None. - - The existance of this method is explained by the fact - that GoGrid assigns id to a node only few minutes after - creation.""" - name = kwargs['name'] - image = kwargs['image'] - size = kwargs['size'] - try: - ip = kwargs['ex_ip'] - except KeyError: - ip = self._get_first_ip(kwargs.get('location')) - - params = {'name': name, - 'image': image.id, - 'description': kwargs.get('ex_description', ''), - 'server.ram': size.id, - 'ip': ip} - - object = self.connection.request('/api/grid/server/add', - params=params, method='POST').object - node = self._to_node(object['list'][0]) - - return node - - def create_node(self, **kwargs): - """Create a new GoGird node - - See L{NodeDriver.create_node} for more keyword args. - - @keyword ex_description: Description of a Node - @type ex_description: C{string} - @keyword ex_ip: Public IP address to use for a Node. If not - specified, first available IP address will be picked - @type ex_ip: C{string} - """ - node = self.ex_create_node_nowait(**kwargs) - - timeout = 60 * 20 - waittime = 0 - interval = 2 * 60 - - while node.id is None and waittime < timeout: - nodes = self.list_nodes() - - for i in nodes: - if i.public_ip[0] == node.public_ip[0] and i.id is not None: - return i - - waittime += interval - time.sleep(interval) - - if id is None: - raise Exception("Wasn't able to wait for id allocation for the node %s" % str(node)) - - return node - - def ex_save_image(self, node, name): - """Create an image for node. - - Please refer to GoGrid documentation to get info - how prepare a node for image creation: - - http://wiki.gogrid.com/wiki/index.php/MyGSI - - @keyword node: node to use as a base for image - @type node: L{Node} - @keyword name: name for new image - @type name: C{string} - """ - params = {'server': node.id, - 'friendlyName': name} - object = self.connection.request('/api/grid/image/save', params=params, - method='POST').object - - return self._to_images(object)[0] - - def ex_edit_node(self, **kwargs): - """Change attributes of a node. - - @keyword node: node to be edited - @type node: L{Node} - @keyword size: new size of a node - @type size: L{NodeSize} - @keyword ex_description: new description of a node - @type ex_description: C{string} - """ - node = kwargs['node'] - size = kwargs['size'] - - params = {'id': node.id, - 'server.ram': size.id} - - if 'ex_description' in kwargs: - params['description'] = kwargs['ex_description'] - - object = self.connection.request('/api/grid/server/edit', - params=params).object - - return self._to_node(object['list'][0]) - - def ex_edit_image(self, **kwargs): - """Edit metadata of a server image. - - @keyword image: image to be edited - @type image: L{NodeImage} - @keyword public: should be the image public? - @type public: C{bool} - @keyword ex_description: description of the image (optional) - @type ex_description: C{string} - @keyword name: name of the image - @type name C{string} - - """ - - image = kwargs['image'] - public = kwargs['public'] - - params = {'id': image.id, - 'isPublic': str(public).lower()} - - if 'ex_description' in kwargs: - params['description'] = kwargs['ex_description'] - - if 'name' in kwargs: - params['friendlyName'] = kwargs['name'] - - object = self.connection.request('/api/grid/image/edit', - params=params).object - - return self._to_image(object['list'][0]) - - def ex_list_ips(self, **kwargs): - """Return list of IP addresses assigned to - the account. - - @keyword public: set to True to list only - public IPs or False to list only - private IPs. Set to None or not specify - at all not to filter by type - @type public: C{bool} - @keyword assigned: set to True to list only addresses - assigned to servers, False to list unassigned - addresses and set to None or don't set at all - not no filter by state - @type assigned: C{bool} - @keyword location: filter IP addresses by location - @type location: L{NodeLocation} - @return: C{list} of L{GoGridIpAddress}es - """ - - params = {} - - if "public" in kwargs and kwargs["public"] is not None: - params["ip.type"] = {True: "Public", - False: "Private"}[kwargs["public"]] - if "assigned" in kwargs and kwargs["assigned"] is not None: - params["ip.state"] = {True: "Assigned", - False: "Unassigned"}[kwargs["assigned"]] - if "location" in kwargs and kwargs['location'] is not None: - params['datacenter'] = kwargs['location'].id - - ips = self._to_ips( - self.connection.request('/api/grid/ip/list', - params=params).object) - return ips diff --git a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/drivers/ibm_sbc.py b/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/drivers/ibm_sbc.py deleted file mode 100644 index 99e309d57e12eceaa665a8d0130fa0f98ed76be5..0000000000000000000000000000000000000000 --- a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/drivers/ibm_sbc.py +++ /dev/null @@ -1,191 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -""" -Driver for the IBM Developer Cloud. -""" -import base64, urllib - -from libcloud.common.base import Response, ConnectionUserAndKey -from libcloud.common.types import InvalidCredsError -from libcloud.compute.types import NodeState, Provider -from libcloud.compute.base import NodeDriver, Node, NodeImage, NodeSize, NodeLocation, NodeAuthSSHKey - -from xml.etree import ElementTree as ET - -HOST = 'www-147.ibm.com' -REST_BASE = '/computecloud/enterprise/api/rest/20100331' - -class IBMResponse(Response): - def success(self): - return int(self.status) == 200 - - def parse_body(self): - if not self.body: - return None - return ET.XML(self.body) - - def parse_error(self): - if int(self.status) == 401: - if not self.body: - raise InvalidCredsError(str(self.status) + ': ' + self.error) - else: - raise InvalidCredsError(self.body) - return self.body - -class IBMConnection(ConnectionUserAndKey): - """ - Connection class for the IBM Developer Cloud driver - """ - - host = HOST - responseCls = IBMResponse - - def add_default_headers(self, headers): - headers['Accept'] = 'text/xml' - headers['Authorization'] = ('Basic %s' % (base64.b64encode('%s:%s' % (self.user_id, self.key)))) - if not 'Content-Type' in headers: - headers['Content-Type'] = 'text/xml' - return headers - - def encode_data(self, data): - return urllib.urlencode(data) - -class IBMNodeDriver(NodeDriver): - """ - IBM Developer Cloud node driver. - """ - connectionCls = IBMConnection - type = Provider.IBM - name = "IBM Developer Cloud" - - NODE_STATE_MAP = { 0: NodeState.PENDING, # New - 1: NodeState.PENDING, # Provisioning - 2: NodeState.TERMINATED, # Failed - 3: NodeState.TERMINATED, # Removed - 4: NodeState.TERMINATED, # Rejected - 5: NodeState.RUNNING, # Active - 6: NodeState.UNKNOWN, # Unknown - 7: NodeState.PENDING, # Deprovisioning - 8: NodeState.REBOOTING, # Restarting - 9: NodeState.PENDING, # Starting - 10: NodeState.PENDING, # Stopping - 11: NodeState.TERMINATED,# Stopped - 12: NodeState.PENDING, # Deprovision Pending - 13: NodeState.PENDING, # Restart Pending - 14: NodeState.PENDING, # Attaching - 15: NodeState.PENDING } # Detaching - - def create_node(self, **kwargs): - """ - Creates a node in the IBM Developer Cloud. - - See L{NodeDriver.create_node} for more keyword args. - - @keyword ex_configurationData: Image-specific configuration parameters. - Configuration parameters are defined in - the parameters.xml file. The URL to - this file is defined in the NodeImage - at extra[parametersURL]. - @type ex_configurationData: C{dict} - """ - - # Compose headers for message body - data = {} - data.update({'name': kwargs['name']}) - data.update({'imageID': kwargs['image'].id}) - data.update({'instanceType': kwargs['size'].id}) - if 'location' in kwargs: - data.update({'location': kwargs['location'].id}) - else: - data.update({'location': '1'}) - if 'auth' in kwargs and isinstance(kwargs['auth'], NodeAuthSSHKey): - data.update({'publicKey': kwargs['auth'].pubkey}) - if 'ex_configurationData' in kwargs: - configurationData = kwargs['ex_configurationData'] - for key in configurationData.keys(): - data.update({key: configurationData.get(key)}) - - # Send request! - resp = self.connection.request(action = REST_BASE + '/instances', - headers = {'Content-Type': 'application/x-www-form-urlencoded'}, - method = 'POST', - data = data).object - return self._to_nodes(resp)[0] - - def destroy_node(self, node): - url = REST_BASE + '/instances/%s' % (node.id) - status = int(self.connection.request(action = url, method='DELETE').status) - return status == 200 - - def reboot_node(self, node): - url = REST_BASE + '/instances/%s' % (node.id) - headers = {'Content-Type': 'application/x-www-form-urlencoded'} - data = {'state': 'restart'} - - resp = self.connection.request(action = url, - method = 'PUT', - headers = headers, - data = data) - return int(resp.status) == 200 - - def list_nodes(self): - return self._to_nodes(self.connection.request(REST_BASE + '/instances').object) - - def list_images(self, location = None): - return self._to_images(self.connection.request(REST_BASE + '/offerings/image').object) - - def list_sizes(self, location = None): - return [ NodeSize('BRZ32.1/2048/60*175', 'Bronze 32 bit', None, None, None, None, self.connection.driver), - NodeSize('BRZ64.2/4096/60*500*350', 'Bronze 64 bit', None, None, None, None, self.connection.driver), - NodeSize('COP32.1/2048/60', 'Copper 32 bit', None, None, None, None, self.connection.driver), - NodeSize('COP64.2/4096/60', 'Copper 64 bit', None, None, None, None, self.connection.driver), - NodeSize('SLV32.2/4096/60*350', 'Silver 32 bit', None, None, None, None, self.connection.driver), - NodeSize('SLV64.4/8192/60*500*500', 'Silver 64 bit', None, None, None, None, self.connection.driver), - NodeSize('GLD32.4/4096/60*350', 'Gold 32 bit', None, None, None, None, self.connection.driver), - NodeSize('GLD64.8/16384/60*500*500', 'Gold 64 bit', None, None, None, None, self.connection.driver), - NodeSize('PLT64.16/16384/60*500*500*500*500', 'Platinum 64 bit', None, None, None, None, self.connection.driver) ] - - def list_locations(self): - return self._to_locations(self.connection.request(REST_BASE + '/locations').object) - - def _to_nodes(self, object): - return [ self._to_node(instance) for instance in object.findall('Instance') ] - - def _to_node(self, instance): - return Node(id = instance.findtext('ID'), - name = instance.findtext('Name'), - state = self.NODE_STATE_MAP[int(instance.findtext('Status'))], - public_ip = instance.findtext('IP'), - private_ip = None, - driver = self.connection.driver) - - def _to_images(self, object): - return [ self._to_image(image) for image in object.findall('Image') ] - - def _to_image(self, image): - return NodeImage(id = image.findtext('ID'), - name = image.findtext('Name'), - driver = self.connection.driver, - extra = {'parametersURL': image.findtext('Manifest')}) - - def _to_locations(self, object): - return [ self._to_location(location) for location in object.findall('Location') ] - - def _to_location(self, location): - # NOTE: country currently hardcoded - return NodeLocation(id = location.findtext('ID'), - name = location.findtext('Name'), - country = 'US', - driver = self.connection.driver) diff --git a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/drivers/linode.py b/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/drivers/linode.py deleted file mode 100644 index 0a0f866b59118a22bfee6e608929d520976b16ac..0000000000000000000000000000000000000000 --- a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/drivers/linode.py +++ /dev/null @@ -1,618 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""libcloud driver for the Linode(R) API - -This driver implements all libcloud functionality for the Linode API. Since the -API is a bit more fine-grained, create_node abstracts a significant amount of -work (and may take a while to run). - -Linode home page http://www.linode.com/ -Linode API documentation http://www.linode.com/api/ -Alternate bindings for reference http://github.com/tjfontaine/linode-python - -Linode(R) is a registered trademark of Linode, LLC. - -""" -import itertools -import os - -from copy import copy - -try: - import json -except: - import simplejson as json - -from libcloud.common.base import ConnectionKey, Response -from libcloud.common.types import InvalidCredsError, MalformedResponseError -from libcloud.compute.types import Provider, NodeState -from libcloud.compute.base import NodeDriver, NodeSize, Node, NodeLocation -from libcloud.compute.base import NodeAuthPassword, NodeAuthSSHKey -from libcloud.compute.base import NodeImage - -# Where requests go - in beta situations, this information may change. -LINODE_API = "api.linode.com" -LINODE_ROOT = "/" - -# Map of TOTALRAM to PLANID, allows us to figure out what plan -# a particular node is on (updated with new plan sizes 6/28/10) -LINODE_PLAN_IDS = {512:'1', - 768:'2', - 1024:'3', - 1536:'4', - 2048:'5', - 4096:'6', - 8192:'7', - 12288:'8', - 16384:'9', - 20480:'10'} - - -class LinodeException(Exception): - """Error originating from the Linode API - - This class wraps a Linode API error, a list of which is available in the - API documentation. All Linode API errors are a numeric code and a - human-readable description. - """ - def __str__(self): - return "(%u) %s" % (self.args[0], self.args[1]) - def __repr__(self): - return "" % (self.args[0], self.args[1]) - - -class LinodeResponse(Response): - """Linode API response - - Wraps the HTTP response returned by the Linode API, which should be JSON in - this structure: - - { - "ERRORARRAY": [ ... ], - "DATA": [ ... ], - "ACTION": " ... " - } - - libcloud does not take advantage of batching, so a response will always - reflect the above format. A few weird quirks are caught here as well.""" - def __init__(self, response): - """Instantiate a LinodeResponse from the HTTP response - - @keyword response: The raw response returned by urllib - @return: parsed L{LinodeResponse}""" - self.body = response.read() - self.status = response.status - self.headers = dict(response.getheaders()) - self.error = response.reason - self.invalid = LinodeException(0xFF, - "Invalid JSON received from server") - - # Move parse_body() to here; we can't be sure of failure until we've - # parsed the body into JSON. - self.objects, self.errors = self.parse_body() - if not self.success(): - # Raise the first error, as there will usually only be one - raise self.errors[0] - - def parse_body(self): - """Parse the body of the response into JSON objects - - If the response chokes the parser, action and data will be returned as - None and errorarray will indicate an invalid JSON exception. - - @return: C{list} of objects and C{list} of errors""" - try: - js = json.loads(self.body) - except: - raise MalformedResponseError("Failed to parse JSON", body=self.body, - driver=LinodeNodeDriver) - - try: - if isinstance(js, dict): - # solitary response - promote to list - js = [js] - ret = [] - errs = [] - for obj in js: - if ("DATA" not in obj or "ERRORARRAY" not in obj - or "ACTION" not in obj): - ret.append(None) - errs.append(self.invalid) - continue - ret.append(obj["DATA"]) - errs.extend(self._make_excp(e) for e in obj["ERRORARRAY"]) - return (ret, errs) - except: - return (None, [self.invalid]) - - def success(self): - """Check the response for success - - The way we determine success is by the presence of an error in - ERRORARRAY. If one is there, we assume the whole request failed. - - @return: C{bool} indicating a successful request""" - return len(self.errors) == 0 - - def _make_excp(self, error): - """Convert an API error to a LinodeException instance - - @keyword error: JSON object containing C{ERRORCODE} and C{ERRORMESSAGE} - @type error: dict""" - if "ERRORCODE" not in error or "ERRORMESSAGE" not in error: - return None - if error["ERRORCODE"] == 4: - return InvalidCredsError(error["ERRORMESSAGE"]) - return LinodeException(error["ERRORCODE"], error["ERRORMESSAGE"]) - - -class LinodeConnection(ConnectionKey): - """A connection to the Linode API - - Wraps SSL connections to the Linode API, automagically injecting the - parameters that the API needs for each request.""" - host = LINODE_API - responseCls = LinodeResponse - - def add_default_params(self, params): - """Add parameters that are necessary for every request - - This method adds C{api_key} and C{api_responseFormat} to the request.""" - params["api_key"] = self.key - # Be explicit about this in case the default changes. - params["api_responseFormat"] = "json" - return params - - -class LinodeNodeDriver(NodeDriver): - """libcloud driver for the Linode API - - Rough mapping of which is which: - - list_nodes linode.list - reboot_node linode.reboot - destroy_node linode.delete - create_node linode.create, linode.update, - linode.disk.createfromdistribution, - linode.disk.create, linode.config.create, - linode.ip.addprivate, linode.boot - list_sizes avail.linodeplans - list_images avail.distributions - list_locations avail.datacenters - - For more information on the Linode API, be sure to read the reference: - - http://www.linode.com/api/ - """ - type = Provider.LINODE - name = "Linode" - connectionCls = LinodeConnection - _linode_plan_ids = LINODE_PLAN_IDS - - def __init__(self, key): - """Instantiate the driver with the given API key - - @keyword key: the API key to use - @type key: C{str}""" - self.datacenter = None - NodeDriver.__init__(self, key) - - # Converts Linode's state from DB to a NodeState constant. - LINODE_STATES = { - -2: NodeState.UNKNOWN, # Boot Failed - -1: NodeState.PENDING, # Being Created - 0: NodeState.PENDING, # Brand New - 1: NodeState.RUNNING, # Running - 2: NodeState.TERMINATED, # Powered Off - 3: NodeState.REBOOTING, # Shutting Down - 4: NodeState.UNKNOWN # Reserved - } - - def list_nodes(self): - """List all Linodes that the API key can access - - This call will return all Linodes that the API key in use has access to. - If a node is in this list, rebooting will work; however, creation and - destruction are a separate grant. - - @return: C{list} of L{Node} objects that the API key can access""" - params = { "api_action": "linode.list" } - data = self.connection.request(LINODE_ROOT, params=params).objects[0] - return self._to_nodes(data) - - def reboot_node(self, node): - """Reboot the given Linode - - Will issue a shutdown job followed by a boot job, using the last booted - configuration. In most cases, this will be the only configuration. - - @keyword node: the Linode to reboot - @type node: L{Node}""" - params = { "api_action": "linode.reboot", "LinodeID": node.id } - self.connection.request(LINODE_ROOT, params=params) - return True - - def destroy_node(self, node): - """Destroy the given Linode - - Will remove the Linode from the account and issue a prorated credit. A - grant for removing Linodes from the account is required, otherwise this - method will fail. - - In most cases, all disk images must be removed from a Linode before the - Linode can be removed; however, this call explicitly skips those - safeguards. There is no going back from this method. - - @keyword node: the Linode to destroy - @type node: L{Node}""" - params = { "api_action": "linode.delete", "LinodeID": node.id, - "skipChecks": True } - self.connection.request(LINODE_ROOT, params=params) - return True - - def create_node(self, **kwargs): - """Create a new Linode, deploy a Linux distribution, and boot - - This call abstracts much of the functionality of provisioning a Linode - and getting it booted. A global grant to add Linodes to the account is - required, as this call will result in a billing charge. - - Note that there is a safety valve of 5 Linodes per hour, in order to - prevent a runaway script from ruining your day. - - @keyword name: the name to assign the Linode (mandatory) - @type name: C{str} - - @keyword image: which distribution to deploy on the Linode (mandatory) - @type image: L{NodeImage} - - @keyword size: the plan size to create (mandatory) - @type size: L{NodeSize} - - @keyword auth: an SSH key or root password (mandatory) - @type auth: L{NodeAuthSSHKey} or L{NodeAuthPassword} - - @keyword location: which datacenter to create the Linode in - @type location: L{NodeLocation} - - @keyword ex_swap: size of the swap partition in MB (128) - @type ex_swap: C{int} - - @keyword ex_rsize: size of the root partition in MB (plan size - swap). - @type ex_rsize: C{int} - - @keyword ex_kernel: a kernel ID from avail.kernels (Latest 2.6 Stable). - @type ex_kernel: C{str} - - @keyword ex_payment: one of 1, 12, or 24; subscription length (1) - @type ex_payment: C{int} - - @keyword ex_comment: a small comment for the configuration (libcloud) - @type ex_comment: C{str} - - @keyword ex_private: whether or not to request a private IP (False) - @type ex_private: C{bool} - - @keyword lconfig: what to call the configuration (generated) - @type lconfig: C{str} - - @keyword lroot: what to call the root image (generated) - @type lroot: C{str} - - @keyword lswap: what to call the swap space (generated) - @type lswap: C{str} - - @return: a L{Node} representing the newly-created Linode - """ - name = kwargs["name"] - image = kwargs["image"] - size = kwargs["size"] - auth = kwargs["auth"] - - # Pick a location (resolves LIBCLOUD-41 in JIRA) - if "location" in kwargs: - chosen = kwargs["location"].id - elif self.datacenter: - chosen = self.datacenter - else: - raise LinodeException(0xFB, "Need to select a datacenter first") - - # Step 0: Parameter validation before we purchase - # We're especially careful here so we don't fail after purchase, rather - # than getting halfway through the process and having the API fail. - - # Plan ID - plans = self.list_sizes() - if size.id not in [p.id for p in plans]: - raise LinodeException(0xFB, "Invalid plan ID -- avail.plans") - - # Payment schedule - payment = "1" if "ex_payment" not in kwargs else str(kwargs["ex_payment"]) - if payment not in ["1", "12", "24"]: - raise LinodeException(0xFB, "Invalid subscription (1, 12, 24)") - - ssh = None - root = None - # SSH key and/or root password - if isinstance(auth, NodeAuthSSHKey): - ssh = auth.pubkey - elif isinstance(auth, NodeAuthPassword): - root = auth.password - - if not ssh and not root: - raise LinodeException(0xFB, "Need SSH key or root password") - if not root is None and len(root) < 6: - raise LinodeException(0xFB, "Root password is too short") - - # Swap size - try: swap = 128 if "ex_swap" not in kwargs else int(kwargs["ex_swap"]) - except: raise LinodeException(0xFB, "Need an integer swap size") - - # Root partition size - imagesize = (size.disk - swap) if "ex_rsize" not in kwargs else \ - int(kwargs["ex_rsize"]) - if (imagesize + swap) > size.disk: - raise LinodeException(0xFB, "Total disk images are too big") - - # Distribution ID - distros = self.list_images() - if image.id not in [d.id for d in distros]: - raise LinodeException(0xFB, - "Invalid distro -- avail.distributions") - - # Kernel - if "ex_kernel" in kwargs: - kernel = kwargs["ex_kernel"] - else: - if image.extra['64bit']: - kernel = 111 if image.extra['pvops'] else 107 - else: - kernel = 110 if image.extra['pvops'] else 60 - params = { "api_action": "avail.kernels" } - kernels = self.connection.request(LINODE_ROOT, params=params).objects[0] - if kernel not in [z["KERNELID"] for z in kernels]: - raise LinodeException(0xFB, "Invalid kernel -- avail.kernels") - - # Comments - comments = "Created by Apache libcloud " if \ - "ex_comment" not in kwargs else kwargs["ex_comment"] - - # Labels - label = { - "lconfig": "[%s] Configuration Profile" % name, - "lroot": "[%s] %s Disk Image" % (name, image.name), - "lswap": "[%s] Swap Space" % name - } - for what in ["lconfig", "lroot", "lswap"]: - if what in kwargs: - label[what] = kwargs[what] - - # Step 1: linode.create - params = { - "api_action": "linode.create", - "DatacenterID": chosen, - "PlanID": size.id, - "PaymentTerm": payment - } - data = self.connection.request(LINODE_ROOT, params=params).objects[0] - linode = { "id": data["LinodeID"] } - - # Step 1b. linode.update to rename the Linode - params = { - "api_action": "linode.update", - "LinodeID": linode["id"], - "Label": name - } - self.connection.request(LINODE_ROOT, params=params) - - # Step 1c. linode.ip.addprivate if it was requested - if "ex_private" in kwargs and kwargs["ex_private"]: - params = { - "api_action": "linode.ip.addprivate", - "LinodeID": linode["id"] - } - self.connection.request(LINODE_ROOT, params=params) - - # Step 2: linode.disk.createfromdistribution - if not root: - root = os.urandom(8).encode('hex') - params = { - "api_action": "linode.disk.createfromdistribution", - "LinodeID": linode["id"], - "DistributionID": image.id, - "Label": label["lroot"], - "Size": imagesize, - "rootPass": root, - } - if ssh: params["rootSSHKey"] = ssh - data = self.connection.request(LINODE_ROOT, params=params).objects[0] - linode["rootimage"] = data["DiskID"] - - # Step 3: linode.disk.create for swap - params = { - "api_action": "linode.disk.create", - "LinodeID": linode["id"], - "Label": label["lswap"], - "Type": "swap", - "Size": swap - } - data = self.connection.request(LINODE_ROOT, params=params).objects[0] - linode["swapimage"] = data["DiskID"] - - # Step 4: linode.config.create for main profile - disks = "%s,%s,,,,,,," % (linode["rootimage"], linode["swapimage"]) - params = { - "api_action": "linode.config.create", - "LinodeID": linode["id"], - "KernelID": kernel, - "Label": label["lconfig"], - "Comments": comments, - "DiskList": disks - } - data = self.connection.request(LINODE_ROOT, params=params).objects[0] - linode["config"] = data["ConfigID"] - - # Step 5: linode.boot - params = { - "api_action": "linode.boot", - "LinodeID": linode["id"], - "ConfigID": linode["config"] - } - self.connection.request(LINODE_ROOT, params=params) - - # Make a node out of it and hand it back - params = { "api_action": "linode.list", "LinodeID": linode["id"] } - data = self.connection.request(LINODE_ROOT, params=params).objects[0] - return self._to_nodes(data) - - def list_sizes(self, location=None): - """List available Linode plans - - Gets the sizes that can be used for creating a Linode. Since available - Linode plans vary per-location, this method can also be passed a - location to filter the availability. - - @keyword location: the facility to retrieve plans in - @type location: NodeLocation - - @return: a C{list} of L{NodeSize}s""" - params = { "api_action": "avail.linodeplans" } - data = self.connection.request(LINODE_ROOT, params=params).objects[0] - sizes = [] - for obj in data: - n = NodeSize(id=obj["PLANID"], name=obj["LABEL"], ram=obj["RAM"], - disk=(obj["DISK"] * 1024), bandwidth=obj["XFER"], - price=obj["PRICE"], driver=self.connection.driver) - sizes.append(n) - return sizes - - def list_images(self): - """List available Linux distributions - - Retrieve all Linux distributions that can be deployed to a Linode. - - @return: a C{list} of L{NodeImage}s""" - params = { "api_action": "avail.distributions" } - data = self.connection.request(LINODE_ROOT, params=params).objects[0] - distros = [] - for obj in data: - i = NodeImage(id=obj["DISTRIBUTIONID"], - name=obj["LABEL"], - driver=self.connection.driver, - extra={'pvops': obj['REQUIRESPVOPSKERNEL'], - '64bit': obj['IS64BIT']}) - distros.append(i) - return distros - - def list_locations(self): - """List available facilities for deployment - - Retrieve all facilities that a Linode can be deployed in. - - @return: a C{list} of L{NodeLocation}s""" - params = { "api_action": "avail.datacenters" } - data = self.connection.request(LINODE_ROOT, params=params).objects[0] - nl = [] - for dc in data: - country = None - if "USA" in dc["LOCATION"]: country = "US" - elif "UK" in dc["LOCATION"]: country = "GB" - else: country = "??" - nl.append(NodeLocation(dc["DATACENTERID"], - dc["LOCATION"], - country, - self)) - return nl - - def linode_set_datacenter(self, dc): - """Set the default datacenter for Linode creation - - Since Linodes must be created in a facility, this function sets the - default that L{create_node} will use. If a C{location} keyword is not - passed to L{create_node}, this method must have already been used. - - @keyword dc: the datacenter to create Linodes in unless specified - @type dc: L{NodeLocation}""" - did = dc.id - params = { "api_action": "avail.datacenters" } - data = self.connection.request(LINODE_ROOT, params=params).objects[0] - for datacenter in data: - if did == dc["DATACENTERID"]: - self.datacenter = did - return - - dcs = ", ".join([d["DATACENTERID"] for d in data]) - self.datacenter = None - raise LinodeException(0xFD, "Invalid datacenter (use one of %s)" % dcs) - - def _to_nodes(self, objs): - """Convert returned JSON Linodes into Node instances - - @keyword objs: C{list} of JSON dictionaries representing the Linodes - @type objs: C{list} - @return: C{list} of L{Node}s""" - - # Get the IP addresses for the Linodes - nodes = {} - batch = [] - for o in objs: - lid = o["LINODEID"] - nodes[lid] = n = Node(id=lid, name=o["LABEL"], public_ip=[], - private_ip=[], state=self.LINODE_STATES[o["STATUS"]], - driver=self.connection.driver) - n.extra = copy(o) - n.extra["PLANID"] = self._linode_plan_ids.get(o.get("TOTALRAM")) - batch.append({"api_action": "linode.ip.list", "LinodeID": lid}) - - # Avoid batch limitation - ip_answers = [] - args = [iter(batch)] * 25 - izip_longest = getattr(itertools, 'izip_longest', _izip_longest) - for twenty_five in izip_longest(*args): - twenty_five = [q for q in twenty_five if q] - params = { "api_action": "batch", - "api_requestArray": json.dumps(twenty_five) } - req = self.connection.request(LINODE_ROOT, params=params) - if not req.success() or len(req.objects) == 0: - return None - ip_answers.extend(req.objects) - - # Add the returned IPs to the nodes and return them - for ip_list in ip_answers: - for ip in ip_list: - lid = ip["LINODEID"] - which = nodes[lid].public_ip if ip["ISPUBLIC"] == 1 else \ - nodes[lid].private_ip - which.append(ip["IPADDRESS"]) - return nodes.values() - - features = {"create_node": ["ssh_key", "password"]} - -def _izip_longest(*args, **kwds): - """Taken from Python docs - - http://docs.python.org/library/itertools.html#itertools.izip - """ - fillvalue = kwds.get('fillvalue') - def sentinel(counter = ([fillvalue]*(len(args)-1)).pop): - yield counter() # yields the fillvalue, or raises IndexError - fillers = itertools.repeat(fillvalue) - iters = [itertools.chain(it, sentinel(), fillers) for it in args] - try: - for tup in itertools.izip(*iters): - yield tup - except IndexError: - pass diff --git a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/drivers/opennebula.py b/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/drivers/opennebula.py deleted file mode 100644 index f282ad3dbb33a0932a465159c61b3bef3d3ac959..0000000000000000000000000000000000000000 --- a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/drivers/opennebula.py +++ /dev/null @@ -1,219 +0,0 @@ -# Copyright 2002-2009, Distributed Systems Architecture Group, Universidad -# Complutense de Madrid (dsa-research.org) -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -""" -OpenNebula driver -""" - -from base64 import b64encode -import hashlib -from xml.etree import ElementTree as ET - -from libcloud.common.base import ConnectionUserAndKey, Response -from libcloud.common.types import InvalidCredsError -from libcloud.compute.providers import Provider -from libcloud.compute.types import NodeState -from libcloud.compute.base import NodeDriver, Node, NodeLocation -from libcloud.compute.base import NodeImage, NodeSize - -API_HOST = '' -API_PORT = (4567, 443) -API_SECURE = True - - -class OpenNebulaResponse(Response): - - def success(self): - i = int(self.status) - return i >= 200 and i <= 299 - - def parse_body(self): - if not self.body: - return None - return ET.XML(self.body) - - def parse_error(self): - if int(self.status) == 401: - raise InvalidCredsError(self.body) - return self.body - - -class OpenNebulaConnection(ConnectionUserAndKey): - """ - Connection class for the OpenNebula driver - """ - - host = API_HOST - port = API_PORT - secure = API_SECURE - responseCls = OpenNebulaResponse - - def add_default_headers(self, headers): - pass_sha1 = hashlib.sha1(self.key).hexdigest() - headers['Authorization'] = ("Basic %s" % b64encode("%s:%s" % (self.user_id, pass_sha1))) - return headers - - -class OpenNebulaNodeDriver(NodeDriver): - """ - OpenNebula node driver - """ - - connectionCls = OpenNebulaConnection - type = Provider.OPENNEBULA - name = 'OpenNebula' - - NODE_STATE_MAP = { - 'PENDING': NodeState.PENDING, - 'ACTIVE': NodeState.RUNNING, - 'DONE': NodeState.TERMINATED, - 'STOPPED': NodeState.TERMINATED - } - - def list_sizes(self, location=None): - return [ - NodeSize(id=1, - name="small", - ram=None, - disk=None, - bandwidth=None, - price=None, - driver=self), - NodeSize(id=2, - name="medium", - ram=None, - disk=None, - bandwidth=None, - price=None, - driver=self), - NodeSize(id=3, - name="large", - ram=None, - disk=None, - bandwidth=None, - price=None, - driver=self), - ] - - def list_nodes(self): - return self._to_nodes(self.connection.request('/compute').object) - - def list_images(self, location=None): - return self._to_images(self.connection.request('/storage').object) - - def list_locations(self): - return [NodeLocation(0, 'OpenNebula', 'ONE', self)] - - def reboot_node(self, node): - compute_id = str(node.id) - - url = '/compute/%s' % compute_id - resp1 = self.connection.request(url,method='PUT',data=self._xml_action(compute_id,'STOPPED')) - - if resp1.status == 400: - return False - - resp2 = self.connection.request(url,method='PUT',data=self._xml_action(compute_id,'RESUME')) - - if resp2.status == 400: - return False - - return True - - def destroy_node(self, node): - url = '/compute/%s' % (str(node.id)) - resp = self.connection.request(url,method='DELETE') - - return resp.status == 204 - - def create_node(self, **kwargs): - """Create a new OpenNebula node - - See L{NodeDriver.create_node} for more keyword args. - """ - compute = ET.Element('COMPUTE') - - name = ET.SubElement(compute, 'NAME') - name.text = kwargs['name'] - - # """ - # Other extractable (but unused) information - # """ - # instance_type = ET.SubElement(compute, 'INSTANCE_TYPE') - # instance_type.text = kwargs['size'].name - # - # storage = ET.SubElement(compute, 'STORAGE') - # disk = ET.SubElement(storage, 'DISK', {'image': str(kwargs['image'].id), - # 'dev': 'sda1'}) - - xml = ET.tostring(compute) - - node = self.connection.request('/compute',method='POST',data=xml).object - - return self._to_node(node) - - def _to_images(self, object): - images = [] - for element in object.findall("DISK"): - image_id = element.attrib["href"].partition("/storage/")[2] - image = self.connection.request(("/storage/%s" % (image_id))).object - images.append(self._to_image(image)) - - return images - - def _to_image(self, image): - return NodeImage(id=image.findtext("ID"), - name=image.findtext("NAME"), - driver=self.connection.driver) - - def _to_nodes(self, object): - computes = [] - for element in object.findall("COMPUTE"): - compute_id = element.attrib["href"].partition("/compute/")[2] - compute = self.connection.request(("/compute/%s" % (compute_id))).object - computes.append(self._to_node(compute)) - - return computes - - def _to_node(self, compute): - try: - state = self.NODE_STATE_MAP[compute.findtext("STATE")] - except KeyError: - state = NodeState.UNKNOWN - - networks = [] - for element in compute.findall("NIC"): - networks.append(element.attrib["ip"]) - - return Node(id=compute.findtext("ID"), - name=compute.findtext("NAME"), - state=state, - public_ip=networks, - private_ip=[], - driver=self.connection.driver) - - def _xml_action(self, compute_id, action): - compute = ET.Element('COMPUTE') - - compute_id = ET.SubElement(compute, 'ID') - compute_id.text = str(compute_id) - - state = ET.SubElement(compute, 'STATE') - state.text = action - - xml = ET.tostring(compute) - return xml diff --git a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/drivers/opsource.py b/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/drivers/opsource.py deleted file mode 100644 index d71f1b4efbc666147c8fe010bb57d86748d0317d..0000000000000000000000000000000000000000 --- a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/drivers/opsource.py +++ /dev/null @@ -1,501 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -""" -Opsource Driver -""" -import base64 -from xml.etree import ElementTree as ET - -from libcloud.utils import fixxpath, findtext, findall -from libcloud.common.base import ConnectionUserAndKey, Response -from libcloud.common.types import LibcloudError, InvalidCredsError, MalformedResponseError -from libcloud.compute.types import NodeState, Provider -from libcloud.compute.base import NodeDriver, Node, NodeAuthPassword -from libcloud.compute.base import NodeSize, NodeImage, NodeLocation - -# Roadmap / TODO: -# -# 0.1 - Basic functionality: create, delete, start, stop, reboot - servers -# (base OS images only, no customer images suported yet) -# x implement list_nodes() -# x implement create_node() (only support Base OS images, no customer images yet) -# x implement reboot() -# x implement destroy_node() -# x implement list_sizes() -# x implement list_images() (only support Base OS images, no customer images yet) -# x implement list_locations() -# x implement ex_* extension functions for opsource-specific features -# x ex_graceful_shutdown -# x ex_start_node -# x ex_power_off -# x ex_list_networks (needed for create_node()) -# x refactor: switch to using fixxpath() from the vcloud driver for dealing with xml namespace tags -# x refactor: move some functionality from OpsourceConnection.request() method into new .request_with_orgId() method -# x add OpsourceStatus object support to: -# x _to_node() -# x _to_network() -# x implement test cases -# -# 0.2 - Support customer images (snapshots) and server modification functions -# - support customer-created images: -# - list deployed customer images (in list_images() ?) -# - list pending customer images (in list_images() ?) -# - delete customer images -# - modify customer images -# - add "pending-servers" in list_nodes() -# - implement various ex_* extension functions for opsource-specific features -# - ex_modify_server() -# - ex_add_storage_to_server() -# - ex_snapshot_server() (create's customer image) -# -# 0.3 - support Network API -# 0.4 - Support VIP/Load-balancing API -# 0.5 - support Files Account API -# 0.6 - support Reports API -# 1.0 - Opsource 0.9 API feature complete, tested - -# setup a few variables to represent all of the opsource cloud namespaces -NAMESPACE_BASE = "http://oec.api.opsource.net/schemas" -ORGANIZATION_NS = NAMESPACE_BASE + "/organization" -SERVER_NS = NAMESPACE_BASE + "/server" -NETWORK_NS = NAMESPACE_BASE + "/network" -DIRECTORY_NS = NAMESPACE_BASE + "/directory" -RESET_NS = NAMESPACE_BASE + "/reset" -VIP_NS = NAMESPACE_BASE + "/vip" -IMAGEIMPORTEXPORT_NS = NAMESPACE_BASE + "/imageimportexport" -DATACENTER_NS = NAMESPACE_BASE + "/datacenter" -SUPPORT_NS = NAMESPACE_BASE + "/support" -GENERAL_NS = NAMESPACE_BASE + "/general" -IPPLAN_NS = NAMESPACE_BASE + "/ipplan" -WHITELABEL_NS = NAMESPACE_BASE + "/whitelabel" - - -class OpsourceResponse(Response): - - def parse_body(self): - try: - body = ET.XML(self.body) - except: - raise MalformedResponseError("Failed to parse XML", body=self.body, driver=OpsourceNodeDriver) - return body - - def parse_error(self): - if self.status == 401: - raise InvalidCredsError(self.body) - - if self.status == 403: - raise InvalidCredsError(self.body) - - try: - body = ET.XML(self.body) - except: - raise MalformedResponseError("Failed to parse XML", body=self.body, driver=OpsourceNodeDriver) - - if self.status == 400: - code = findtext(body, 'resultCode', SERVER_NS) - message = findtext(body, 'resultDetail', SERVER_NS) - raise OpsourceAPIException(code, message, driver=OpsourceNodeDriver) - - return self.body - -class OpsourceAPIException(LibcloudError): - def __init__(self, code, msg, driver): - self.code = code - self.msg = msg - self.driver = driver - - def __str__(self): - return "%s: %s" % (self.code, self.msg) - - def __repr__(self): - return "" % (self.code, self.msg) - -class OpsourceConnection(ConnectionUserAndKey): - """ - Connection class for the Opsource driver - """ - - host = 'api.opsourcecloud.net' - api_path = '/oec' - api_version = '0.9' - _orgId = None - responseCls = OpsourceResponse - - def add_default_headers(self, headers): - headers['Authorization'] = ('Basic %s' - % (base64.b64encode('%s:%s' % (self.user_id, self.key)))) - return headers - - def request(self, action, params=None, data='', headers=None, method='GET'): - action = "%s/%s/%s" % (self.api_path, self.api_version, action) - - return super(OpsourceConnection, self).request( - action=action, - params=params, data=data, - method=method, headers=headers - ) - - def request_with_orgId(self, action, params=None, data='', headers=None, method='GET'): - action = "%s/%s" % (self.get_resource_path(), action) - - return super(OpsourceConnection, self).request( - action=action, - params=params, data=data, - method=method, headers=headers - ) - - def get_resource_path(self): - """this method returns a resource path which is necessary for referencing - resources that require a full path instead of just an ID, such as - networks, and customer snapshots. - """ - return ("%s/%s/%s" % (self.api_path, self.api_version, self._get_orgId())) - - def _get_orgId(self): - """ - send the /myaccount API request to opsource cloud and parse the 'orgId' from the - XML response object. We need the orgId to use most of the other API functions - """ - if self._orgId == None: - body = self.request('myaccount').object - self._orgId = findtext(body, 'orgId', DIRECTORY_NS) - return self._orgId - -class OpsourceStatus(object): - """ - Opsource API pending operation status class - action, requestTime, username, numberOfSteps, updateTime, - step.name, step.number, step.percentComplete, failureReason, - """ - def __init__(self, action=None, requestTime=None, userName=None, - numberOfSteps=None, updateTime=None, step_name=None, - step_number=None, step_percentComplete=None, failureReason=None): - self.action = action - self.requestTime = requestTime - self.userName = userName - self.numberOfSteps = numberOfSteps - self.updateTime = updateTime - self.step_name = step_name - self.step_number = step_number - self.step_percentComplete = step_percentComplete - self.failureReason = failureReason - - def __repr__(self): - return (('') - % (self.id, self.name, self.description, self.location, - self.privateNet, self.multicast)) - - -class OpsourceNodeDriver(NodeDriver): - """ - Opsource node driver - """ - - connectionCls = OpsourceConnection - - type = Provider.OPSOURCE - name = 'Opsource' - - features = {"create_node": ["password"]} - - def list_nodes(self): - nodes = self._to_nodes(self.connection.request_with_orgId('server/deployed').object) - nodes.extend(self._to_nodes(self.connection.request_with_orgId('server/pendingDeploy').object)) - return nodes - - def list_sizes(self, location=None): - return [ NodeSize(id=1, - name="default", - ram=0, - disk=0, - bandwidth=0, - price=0, - driver=self.connection.driver) ] - - def list_images(self, location=None): - """return a list of available images - Currently only returns the default 'base OS images' provided by opsource. - Customer images (snapshots) are not yet supported. - """ - return self._to_base_images(self.connection.request('base/image').object) - - def list_locations(self): - """list locations (datacenters) available for instantiating servers and - networks. - """ - return self._to_locations(self.connection.request_with_orgId('datacenter').object) - - def create_node(self, **kwargs): - """Create a new opsource node - - Standard keyword arguments from L{NodeDriver.create_node}: - @keyword name: String with a name for this new node (required) - @type name: str - - @keyword image: OS Image to boot on node. (required) - @type image: L{NodeImage} - - @keyword auth: Initial authentication information for the node (required) - @type auth: L{NodeAuthPassword} - - Non-standard keyword arguments: - @keyword ex_description: description for this node (required) - @type ex_description: C{str} - - @keyword ex_network: Network to create the node within (required) - @type ex_network: L{OpsourceNetwork} - - @keyword ex_isStarted: Start server after creation? default true (required) - @type ex_isStarted: C{bool} - - @return: The newly created L{Node}. NOTE: Opsource does not provide a way to - determine the ID of the server that was just created, so the returned - L{Node} is not guaranteed to be the same one that was created. This - is only the case when multiple nodes with the same name exist. - """ - name = kwargs['name'] - image = kwargs['image'] - - # XXX: Node sizes can be adjusted after a node is created, but cannot be - # set at create time because size is part of the image definition. - password = None - if kwargs.has_key('auth'): - auth = kwargs.get('auth') - if isinstance(auth, NodeAuthPassword): - password = auth.password - else: - raise ValueError('auth must be of NodeAuthPassword type') - - ex_description = kwargs.get('ex_description', '') - ex_isStarted = kwargs.get('ex_isStarted', True) - - ex_network = kwargs.get('ex_network') - if not isinstance(ex_network, OpsourceNetwork): - raise ValueError('ex_network must be of OpsourceNetwork type') - vlanResourcePath = "%s/%s" % (self.connection.get_resource_path(), ex_network.id) - - imageResourcePath = None - if image.extra.has_key('resourcePath'): - imageResourcePath = image.extra['resourcePath'] - else: - imageResourcePath = "%s/%s" % (self.connection.get_resource_path(), image.id) - - server_elm = ET.Element('Server', {'xmlns': SERVER_NS}) - ET.SubElement(server_elm, "name").text = name - ET.SubElement(server_elm, "description").text = ex_description - ET.SubElement(server_elm, "vlanResourcePath").text = vlanResourcePath - ET.SubElement(server_elm, "imageResourcePath").text = imageResourcePath - ET.SubElement(server_elm, "administratorPassword").text = password - ET.SubElement(server_elm, "isStarted").text = str(ex_isStarted) - - self.connection.request_with_orgId('server', - method='POST', - data=ET.tostring(server_elm) - ).object - # XXX: return the last node in the list that has a matching name. this - # is likely but not guaranteed to be the node we just created - # because opsource allows multiple nodes to have the same name - return filter(lambda x: x.name == name, self.list_nodes())[-1] - - def reboot_node(self, node): - """reboots the node""" - body = self.connection.request_with_orgId('server/%s?restart' % node.id).object - result = findtext(body, 'result', GENERAL_NS) - return result == 'SUCCESS' - - def destroy_node(self, node): - """Destroys the node""" - body = self.connection.request_with_orgId('server/%s?delete' % node.id).object - result = findtext(body, 'result', GENERAL_NS) - return result == 'SUCCESS' - - def ex_start_node(self, node): - """Powers on an existing deployed server""" - body = self.connection.request_with_orgId('server/%s?start' % node.id).object - result = findtext(body, 'result', GENERAL_NS) - return result == 'SUCCESS' - - def ex_shutdown_graceful(self, node): - """This function will attempt to "gracefully" stop a server by initiating a - shutdown sequence within the guest operating system. A successful response - on this function means the system has successfully passed the - request into the operating system. - """ - body = self.connection.request_with_orgId('server/%s?shutdown' % node.id).object - result = findtext(body, 'result', GENERAL_NS) - return result == 'SUCCESS' - - def ex_power_off(self, node): - """This function will abruptly power-off a server. Unlike ex_shutdown_graceful, - success ensures the node will stop but some OS and application configurations may - be adversely affected by the equivalent of pulling the power plug out of the - machine. - """ - body = self.connection.request_with_orgId('server/%s?poweroff' % node.id).object - result = findtext(body, 'result', GENERAL_NS) - return result == 'SUCCESS' - - def ex_list_networks(self): - """List networks deployed across all data center locations for your - organization. The response includes the location of each network. - - Returns a list of OpsourceNetwork objects - """ - return self._to_networks(self.connection.request_with_orgId('networkWithLocation').object) - - def ex_get_location_by_id(self, id): - location = None - if id is not None: - location = filter(lambda x: x.id == id, self.list_locations())[0] - return location - - def _to_networks(self, object): - node_elements = findall(object, 'network', NETWORK_NS) - return [ self._to_network(el) for el in node_elements ] - - def _to_network(self, element): - multicast = False - if findtext(element, 'multicast', NETWORK_NS) == 'true': - multicast = True - - status = self._to_status(element.find(fixxpath('status', NETWORK_NS))) - - location_id = findtext(element, 'location', NETWORK_NS) - location = self.ex_get_location_by_id(location_id) - - return OpsourceNetwork(id=findtext(element, 'id', NETWORK_NS), - name=findtext(element, 'name', NETWORK_NS), - description=findtext(element, 'description', NETWORK_NS), - location=location, - privateNet=findtext(element, 'privateNet', NETWORK_NS), - multicast=multicast, - status=status) - - def _to_locations(self, object): - node_elements = object.findall(fixxpath('datacenter', DATACENTER_NS)) - return [ self._to_location(el) for el in node_elements ] - - def _to_location(self, element): - l = NodeLocation(id=findtext(element, 'location', DATACENTER_NS), - name=findtext(element, 'displayName', DATACENTER_NS), - country=findtext(element, 'country', DATACENTER_NS), - driver=self) - return l - - def _to_nodes(self, object): - node_elements = object.findall(fixxpath('DeployedServer', SERVER_NS)) - node_elements.extend(object.findall(fixxpath('PendingDeployServer', SERVER_NS))) - return [ self._to_node(el) for el in node_elements ] - - def _to_node(self, element): - if findtext(element, 'isStarted', SERVER_NS) == 'true': - state = NodeState.RUNNING - else: - state = NodeState.TERMINATED - - status = self._to_status(element.find(fixxpath('status', SERVER_NS))) - - extra = { - 'description': findtext(element, 'description', SERVER_NS), - 'sourceImageId': findtext(element, 'sourceImageId', SERVER_NS), - 'networkId': findtext(element, 'networkId', SERVER_NS), - 'machineName': findtext(element, 'machineName', SERVER_NS), - 'deployedTime': findtext(element, 'deployedTime', SERVER_NS), - 'cpuCount': findtext(element, 'machineSpecification/cpuCount', SERVER_NS), - 'memoryMb': findtext(element, 'machineSpecification/memoryMb', SERVER_NS), - 'osStorageGb': findtext(element, 'machineSpecification/osStorageGb', SERVER_NS), - 'additionalLocalStorageGb': findtext(element, 'machineSpecification/additionalLocalStorageGb', SERVER_NS), - 'OS_type': findtext(element, 'machineSpecification/operatingSystem/type', SERVER_NS), - 'OS_displayName': findtext(element, 'machineSpecification/operatingSystem/displayName', SERVER_NS), - 'status': status, - } - - n = Node(id=findtext(element, 'id', SERVER_NS), - name=findtext(element, 'name', SERVER_NS), - state=state, - public_ip="unknown", - private_ip=findtext(element, 'privateIpAddress', SERVER_NS), - driver=self.connection.driver, - extra=extra) - return n - - def _to_base_images(self, object): - node_elements = object.findall(fixxpath("ServerImage", SERVER_NS)) - return [ self._to_base_image(el) for el in node_elements ] - - def _to_base_image(self, element): - # Eventually we will probably need multiple _to_image() functions - # that parse differently than . - # DeployedImages are customer snapshot images, and ServerImages are - # 'base' images provided by opsource - location_id = findtext(element, 'location', SERVER_NS) - location = self.ex_get_location_by_id(location_id) - - extra = { - 'description': findtext(element, 'description', SERVER_NS), - 'OS_type': findtext(element, 'operatingSystem/type', SERVER_NS), - 'OS_displayName': findtext(element, 'operatingSystem/displayName', SERVER_NS), - 'cpuCount': findtext(element, 'cpuCount', SERVER_NS), - 'resourcePath': findtext(element, 'resourcePath', SERVER_NS), - 'memory': findtext(element, 'memory', SERVER_NS), - 'osStorage': findtext(element, 'osStorage', SERVER_NS), - 'additionalStorage': findtext(element, 'additionalStorage', SERVER_NS), - 'created': findtext(element, 'created', SERVER_NS), - 'location': location, - } - - i = NodeImage(id=str(findtext(element, 'id', SERVER_NS)), - name=str(findtext(element, 'name', SERVER_NS)), - extra=extra, - driver=self.connection.driver) - return i - - def _to_status(self, element): - if element == None: - return OpsourceStatus() - s = OpsourceStatus(action=findtext(element, 'action', SERVER_NS), - requestTime=findtext(element, 'requestTime', SERVER_NS), - userName=findtext(element, 'userName', SERVER_NS), - numberOfSteps=findtext(element, 'numberOfSteps', SERVER_NS), - step_name=findtext(element, 'step/name', SERVER_NS), - step_number=findtext(element, 'step_number', SERVER_NS), - step_percentComplete=findtext(element, 'step/percentComplete', SERVER_NS), - failureReason=findtext(element, 'failureReason', SERVER_NS)) - return s diff --git a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/drivers/rackspace.py b/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/drivers/rackspace.py deleted file mode 100644 index 4e41cad4a87ce1c87c4c9caa5801b73667f5f602..0000000000000000000000000000000000000000 --- a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/drivers/rackspace.py +++ /dev/null @@ -1,565 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -""" -Rackspace driver -""" -import os - -import base64 - -from xml.etree import ElementTree as ET -from xml.parsers.expat import ExpatError - -from libcloud.pricing import get_pricing -from libcloud.common.base import Response -from libcloud.common.types import MalformedResponseError -from libcloud.compute.types import NodeState, Provider -from libcloud.compute.base import NodeDriver, Node -from libcloud.compute.base import NodeSize, NodeImage, NodeLocation - -from libcloud.common.rackspace import ( - AUTH_HOST_US, AUTH_HOST_UK, RackspaceBaseConnection) - -NAMESPACE='http://docs.rackspacecloud.com/servers/api/v1.0' - - -class RackspaceResponse(Response): - - def success(self): - i = int(self.status) - return i >= 200 and i <= 299 - - def parse_body(self): - if not self.body: - return None - try: - body = ET.XML(self.body) - except: - raise MalformedResponseError( - "Failed to parse XML", - body=self.body, - driver=RackspaceNodeDriver) - return body - def parse_error(self): - # TODO: fixup, Rackspace only uses response codes really! - try: - body = ET.XML(self.body) - except: - raise MalformedResponseError( - "Failed to parse XML", - body=self.body, driver=RackspaceNodeDriver) - try: - text = "; ".join([ err.text or '' - for err in - body.getiterator() - if err.text]) - except ExpatError: - text = self.body - return '%s %s %s' % (self.status, self.error, text) - - -class RackspaceConnection(RackspaceBaseConnection): - """ - Connection class for the Rackspace driver - """ - - responseCls = RackspaceResponse - auth_host = AUTH_HOST_US - _url_key = "server_url" - - def __init__(self, user_id, key, secure=True): - super(RackspaceConnection, self).__init__(user_id, key, secure) - self.api_version = 'v1.0' - self.accept_format = 'application/xml' - - def request(self, action, params=None, data='', headers=None, method='GET'): - if not headers: - headers = {} - if not params: - params = {} - # Due to first-run authentication request, we may not have a path - if self.server_url: - action = self.server_url + action - if method in ("POST", "PUT"): - headers = {'Content-Type': 'application/xml; charset=UTF-8'} - if method == "GET": - params['cache-busting'] = os.urandom(8).encode('hex') - return super(RackspaceConnection, self).request( - action=action, - params=params, data=data, - method=method, headers=headers - ) - - -class RackspaceSharedIpGroup(object): - """ - Shared IP group info. - """ - - def __init__(self, id, name, servers=None): - self.id = str(id) - self.name = name - self.servers = servers - - -class RackspaceNodeIpAddresses(object): - """ - List of public and private IP addresses of a Node. - """ - - def __init__(self, public_addresses, private_addresses): - self.public_addresses = public_addresses - self.private_addresses = private_addresses - - -class RackspaceNodeDriver(NodeDriver): - """ - Rackspace node driver. - - Extra node attributes: - - password: root password, available after create. - - hostId: represents the host your cloud server runs on - - imageId: id of image - - flavorId: id of flavor - """ - connectionCls = RackspaceConnection - type = Provider.RACKSPACE - api_name = 'rackspace' - name = 'Rackspace' - - _rackspace_prices = get_pricing(driver_type='compute', - driver_name='rackspace') - - features = {"create_node": ["generates_password"]} - - NODE_STATE_MAP = { 'BUILD': NodeState.PENDING, - 'REBUILD': NodeState.PENDING, - 'ACTIVE': NodeState.RUNNING, - 'SUSPENDED': NodeState.TERMINATED, - 'QUEUE_RESIZE': NodeState.PENDING, - 'PREP_RESIZE': NodeState.PENDING, - 'VERIFY_RESIZE': NodeState.RUNNING, - 'PASSWORD': NodeState.PENDING, - 'RESCUE': NodeState.PENDING, - 'REBUILD': NodeState.PENDING, - 'REBOOT': NodeState.REBOOTING, - 'HARD_REBOOT': NodeState.REBOOTING, - 'SHARE_IP': NodeState.PENDING, - 'SHARE_IP_NO_CONFIG': NodeState.PENDING, - 'DELETE_IP': NodeState.PENDING, - 'UNKNOWN': NodeState.UNKNOWN} - - def list_nodes(self): - return self._to_nodes(self.connection.request('/servers/detail').object) - - def list_sizes(self, location=None): - return self._to_sizes(self.connection.request('/flavors/detail').object) - - def list_images(self, location=None): - return self._to_images(self.connection.request('/images/detail').object) - - def list_locations(self): - """Lists available locations - - Locations cannot be set or retrieved via the API, but currently - there are two locations, DFW and ORD. - """ - return [NodeLocation(0, "Rackspace DFW1/ORD1", 'US', self)] - - def _change_password_or_name(self, node, name=None, password=None): - uri = '/servers/%s' % (node.id) - - if not name: - name = node.name - - body = { 'xmlns': NAMESPACE, - 'name': name} - - if password != None: - body['adminPass'] = password - - server_elm = ET.Element('server', body) - - resp = self.connection.request( - uri, method='PUT', data=ET.tostring(server_elm)) - - if resp.status == 204 and password != None: - node.extra['password'] = password - - return resp.status == 204 - - def ex_set_password(self, node, password): - """ - Sets the Node's root password. - - This will reboot the instance to complete the operation. - - L{node.extra['password']} will be set to the new value if the - operation was successful. - """ - return self._change_password_or_name(node, password=password) - - def ex_set_server_name(self, node, name): - """ - Sets the Node's name. - - This will reboot the instance to complete the operation. - """ - return self._change_password_or_name(node, name=name) - - def create_node(self, **kwargs): - """Create a new rackspace node - - See L{NodeDriver.create_node} for more keyword args. - @keyword ex_metadata: Key/Value metadata to associate with a node - @type ex_metadata: C{dict} - - @keyword ex_files: File Path => File contents to create on the node - @type ex_files: C{dict} - """ - name = kwargs['name'] - image = kwargs['image'] - size = kwargs['size'] - server_elm = ET.Element( - 'server', - {'xmlns': NAMESPACE, - 'name': name, - 'imageId': str(image.id), - 'flavorId': str(size.id)} - ) - - metadata_elm = self._metadata_to_xml(kwargs.get("ex_metadata", {})) - if metadata_elm: - server_elm.append(metadata_elm) - - files_elm = self._files_to_xml(kwargs.get("ex_files", {})) - if files_elm: - server_elm.append(files_elm) - - shared_ip_elm = self._shared_ip_group_to_xml( - kwargs.get("ex_shared_ip_group", None)) - if shared_ip_elm: - server_elm.append(shared_ip_elm) - - resp = self.connection.request("/servers", - method='POST', - data=ET.tostring(server_elm)) - return self._to_node(resp.object) - - def ex_rebuild(self, node_id, image_id): - elm = ET.Element( - 'rebuild', - {'xmlns': NAMESPACE, - 'imageId': image_id, - } - ) - resp = self.connection.request("/servers/%s/action" % node_id, - method='POST', - data=ET.tostring(elm)) - return resp.status == 202 - - def ex_create_ip_group(self, group_name, node_id=None): - group_elm = ET.Element( - 'sharedIpGroup', - {'xmlns': NAMESPACE, - 'name': group_name, - } - ) - if node_id: - ET.SubElement(group_elm, - 'server', - {'id': node_id} - ) - - resp = self.connection.request('/shared_ip_groups', - method='POST', - data=ET.tostring(group_elm)) - return self._to_shared_ip_group(resp.object) - - def ex_list_ip_groups(self, details=False): - uri = '/shared_ip_groups/detail' if details else '/shared_ip_groups' - resp = self.connection.request(uri, - method='GET') - groups = self._findall(resp.object, 'sharedIpGroup') - return [self._to_shared_ip_group(el) for el in groups] - - def ex_delete_ip_group(self, group_id): - uri = '/shared_ip_groups/%s' % group_id - resp = self.connection.request(uri, method='DELETE') - return resp.status == 204 - - def ex_share_ip(self, group_id, node_id, ip, configure_node=True): - if configure_node: - str_configure = 'true' - else: - str_configure = 'false' - - elm = ET.Element( - 'shareIp', - {'xmlns': NAMESPACE, - 'sharedIpGroupId' : group_id, - 'configureServer' : str_configure} - ) - - uri = '/servers/%s/ips/public/%s' % (node_id, ip) - - resp = self.connection.request(uri, - method='PUT', - data=ET.tostring(elm)) - return resp.status == 202 - - def ex_unshare_ip(self, node_id, ip): - uri = '/servers/%s/ips/public/%s' % (node_id, ip) - - resp = self.connection.request(uri, - method='DELETE') - return resp.status == 202 - - def ex_list_ip_addresses(self, node_id): - uri = '/servers/%s/ips' % node_id - resp = self.connection.request(uri, - method='GET') - return self._to_ip_addresses(resp.object) - - def _metadata_to_xml(self, metadata): - if len(metadata) == 0: - return None - - metadata_elm = ET.Element('metadata') - for k, v in metadata.items(): - meta_elm = ET.SubElement(metadata_elm, 'meta', {'key': str(k) }) - meta_elm.text = str(v) - - return metadata_elm - - def _files_to_xml(self, files): - if len(files) == 0: - return None - - personality_elm = ET.Element('personality') - for k, v in files.items(): - file_elm = ET.SubElement(personality_elm, - 'file', - {'path': str(k)}) - file_elm.text = base64.b64encode(v) - - return personality_elm - - def _reboot_node(self, node, reboot_type='SOFT'): - resp = self._node_action(node, ['reboot', ('type', reboot_type)]) - return resp.status == 202 - - def ex_soft_reboot_node(self, node): - return self._reboot_node(node, reboot_type='SOFT') - - def ex_hard_reboot_node(self, node): - return self._reboot_node(node, reboot_type='HARD') - - def reboot_node(self, node): - return self._reboot_node(node, reboot_type='HARD') - - def destroy_node(self, node): - uri = '/servers/%s' % (node.id) - resp = self.connection.request(uri, method='DELETE') - return resp.status == 202 - - def ex_get_node_details(self, node_id): - uri = '/servers/%s' % (node_id) - resp = self.connection.request(uri, method='GET') - if resp.status == 404: - return None - return self._to_node(resp.object) - - def _node_action(self, node, body): - if isinstance(body, list): - attr = ' '.join(['%s="%s"' % (item[0], item[1]) - for item in body[1:]]) - body = '<%s xmlns="%s" %s/>' % (body[0], NAMESPACE, attr) - uri = '/servers/%s/action' % (node.id) - resp = self.connection.request(uri, method='POST', data=body) - return resp - - def _to_nodes(self, object): - node_elements = self._findall(object, 'server') - return [ self._to_node(el) for el in node_elements ] - - def _fixxpath(self, xpath): - # ElementTree wants namespaces in its xpaths, so here we add them. - return "/".join(["{%s}%s" % (NAMESPACE, e) for e in xpath.split("/")]) - - def _findall(self, element, xpath): - return element.findall(self._fixxpath(xpath)) - - def _to_node(self, el): - def get_ips(el): - return [ip.get('addr') for ip in el] - - def get_meta_dict(el): - d = {} - for meta in el: - d[meta.get('key')] = meta.text - return d - - public_ip = get_ips(self._findall(el, - 'addresses/public/ip')) - private_ip = get_ips(self._findall(el, - 'addresses/private/ip')) - metadata = get_meta_dict(self._findall(el, 'metadata/meta')) - - n = Node(id=el.get('id'), - name=el.get('name'), - state=self.NODE_STATE_MAP.get( - el.get('status'), NodeState.UNKNOWN), - public_ip=public_ip, - private_ip=private_ip, - driver=self.connection.driver, - extra={ - 'password': el.get('adminPass'), - 'hostId': el.get('hostId'), - 'imageId': el.get('imageId'), - 'flavorId': el.get('flavorId'), - 'uri': "https://%s%s/servers/%s" % ( - self.connection.host, - self.connection.request_path, el.get('id')), - 'metadata': metadata, - }) - return n - - def _to_sizes(self, object): - elements = self._findall(object, 'flavor') - return [ self._to_size(el) for el in elements ] - - def _to_size(self, el): - s = NodeSize(id=el.get('id'), - name=el.get('name'), - ram=int(el.get('ram')), - disk=int(el.get('disk')), - bandwidth=None, # XXX: needs hardcode - price=self._get_size_price(el.get('id')), # Hardcoded, - driver=self.connection.driver) - return s - - def _to_images(self, object): - elements = self._findall(object, "image") - return [ self._to_image(el) - for el in elements - if el.get('status') == 'ACTIVE' ] - - def _to_image(self, el): - i = NodeImage(id=el.get('id'), - name=el.get('name'), - driver=self.connection.driver, - extra={'serverId': el.get('serverId')}) - return i - - def ex_limits(self): - """ - Extra call to get account's limits, such as - rates (for example amount of POST requests per day) - and absolute limits like total amount of available - RAM to be used by servers. - - @return: C{dict} with keys 'rate' and 'absolute' - """ - - def _to_rate(el): - rate = {} - for item in el.items(): - rate[item[0]] = item[1] - - return rate - - def _to_absolute(el): - return {el.get('name'): el.get('value')} - - limits = self.connection.request("/limits").object - rate = [ _to_rate(el) for el in self._findall(limits, 'rate/limit') ] - absolute = {} - for item in self._findall(limits, 'absolute/limit'): - absolute.update(_to_absolute(item)) - - return {"rate": rate, "absolute": absolute} - - def ex_save_image(self, node, name): - """Create an image for node. - - @keyword node: node to use as a base for image - @param node: L{Node} - @keyword name: name for new image - @param name: C{string} - """ - - image_elm = ET.Element( - 'image', - {'xmlns': NAMESPACE, - 'name': name, - 'serverId': node.id} - ) - - return self._to_image(self.connection.request("/images", - method="POST", - data=ET.tostring(image_elm)).object) - - def _to_shared_ip_group(self, el): - servers_el = self._findall(el, 'servers') - if servers_el: - servers = [s.get('id') - for s in self._findall(servers_el[0], 'server')] - else: - servers = None - return RackspaceSharedIpGroup(id=el.get('id'), - name=el.get('name'), - servers=servers) - - def _to_ip_addresses(self, el): - return RackspaceNodeIpAddresses( - [ip.get('addr') for ip in - self._findall(self._findall(el, 'public')[0], 'ip')], - [ip.get('addr') for ip in - self._findall(self._findall(el, 'private')[0], 'ip')] - ) - - def _shared_ip_group_to_xml(self, shared_ip_group): - if not shared_ip_group: - return None - - return ET.Element('sharedIpGroupId', shared_ip_group) - -class RackspaceUKConnection(RackspaceConnection): - """ - Connection class for the Rackspace UK driver - """ - auth_host = AUTH_HOST_UK - -class RackspaceUKNodeDriver(RackspaceNodeDriver): - """Driver for Rackspace in the UK (London) - """ - - name = 'Rackspace (UK)' - connectionCls = RackspaceUKConnection - - def list_locations(self): - return [NodeLocation(0, 'Rackspace UK London', 'UK', self)] - -class OpenStackConnection(RackspaceConnection): - - def __init__(self, user_id, key, secure, host, port): - super(OpenStackConnection, self).__init__(user_id, key, secure=secure) - self.auth_host = host - self.port = (port, port) - -class OpenStackNodeDriver(RackspaceNodeDriver): - name = 'OpenStack' - connectionCls = OpenStackConnection diff --git a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/drivers/rimuhosting.py b/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/drivers/rimuhosting.py deleted file mode 100644 index d0df077ec17ab199404d59f8e624d2926997a9b7..0000000000000000000000000000000000000000 --- a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/drivers/rimuhosting.py +++ /dev/null @@ -1,313 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -""" -RimuHosting Driver -""" -try: - import json -except: - import simplejson as json - -from libcloud.common.base import ConnectionKey, Response -from libcloud.common.types import InvalidCredsError -from libcloud.compute.types import Provider, NodeState -from libcloud.compute.base import NodeDriver, NodeSize, Node, NodeLocation -from libcloud.compute.base import NodeImage, NodeAuthPassword - -API_CONTEXT = '/r' -API_HOST = 'rimuhosting.com' -API_PORT = (80,443) -API_SECURE = True - -class RimuHostingException(Exception): - """ - Exception class for RimuHosting driver - """ - - def __str__(self): - return self.args[0] - - def __repr__(self): - return "" % (self.args[0]) - -class RimuHostingResponse(Response): - def __init__(self, response): - self.body = response.read() - self.status = response.status - self.headers = dict(response.getheaders()) - self.error = response.reason - - if self.success(): - self.object = self.parse_body() - - def success(self): - if self.status == 403: - raise InvalidCredsError() - return True - def parse_body(self): - try: - js = json.loads(self.body) - if js[js.keys()[0]]['response_type'] == "ERROR": - raise RimuHostingException( - js[js.keys()[0]]['human_readable_message'] - ) - return js[js.keys()[0]] - except ValueError: - raise RimuHostingException('Could not parse body: %s' - % (self.body)) - except KeyError: - raise RimuHostingException('Could not parse body: %s' - % (self.body)) - -class RimuHostingConnection(ConnectionKey): - """ - Connection class for the RimuHosting driver - """ - - api_context = API_CONTEXT - host = API_HOST - port = API_PORT - responseCls = RimuHostingResponse - - def __init__(self, key, secure=True): - # override __init__ so that we can set secure of False for testing - ConnectionKey.__init__(self,key,secure) - - def add_default_headers(self, headers): - # We want JSON back from the server. Could be application/xml - # (but JSON is better). - headers['Accept'] = 'application/json' - # Must encode all data as json, or override this header. - headers['Content-Type'] = 'application/json' - - headers['Authorization'] = 'rimuhosting apikey=%s' % (self.key) - return headers; - - def request(self, action, params=None, data='', headers=None, method='GET'): - if not headers: - headers = {} - if not params: - params = {} - # Override this method to prepend the api_context - return ConnectionKey.request(self, self.api_context + action, - params, data, headers, method) - -class RimuHostingNodeDriver(NodeDriver): - """ - RimuHosting node driver - """ - - type = Provider.RIMUHOSTING - name = 'RimuHosting' - connectionCls = RimuHostingConnection - - def __init__(self, key, host=API_HOST, port=API_PORT, - api_context=API_CONTEXT, secure=API_SECURE): - # Pass in some extra vars so that - self.key = key - self.secure = secure - self.connection = self.connectionCls(key ,secure) - self.connection.host = host - self.connection.api_context = api_context - self.connection.port = port - self.connection.driver = self - self.connection.connect() - - def _order_uri(self, node,resource): - # Returns the order uri with its resourse appended. - return "/orders/%s/%s" % (node.id,resource) - - # TODO: Get the node state. - def _to_node(self, order): - n = Node(id=order['slug'], - name=order['domain_name'], - state=NodeState.RUNNING, - public_ip=( - [order['allocated_ips']['primary_ip']] - + order['allocated_ips']['secondary_ips'] - ), - private_ip=[], - driver=self.connection.driver, - extra={'order_oid': order['order_oid'], - 'monthly_recurring_fee': order.get('billing_info').get('monthly_recurring_fee')}) - return n - - def _to_size(self,plan): - return NodeSize( - id=plan['pricing_plan_code'], - name=plan['pricing_plan_description'], - ram=plan['minimum_memory_mb'], - disk=plan['minimum_disk_gb'], - bandwidth=plan['minimum_data_transfer_allowance_gb'], - price=plan['monthly_recurring_amt']['amt_usd'], - driver=self.connection.driver - ) - - def _to_image(self,image): - return NodeImage(id=image['distro_code'], - name=image['distro_description'], - driver=self.connection.driver) - - def list_sizes(self, location=None): - # Returns a list of sizes (aka plans) - # Get plans. Note this is really just for libcloud. - # We are happy with any size. - if location == None: - location = ''; - else: - location = ";dc_location=%s" % (location.id) - - res = self.connection.request('/pricing-plans;server-type=VPS%s' % (location)).object - return map(lambda x : self._to_size(x), res['pricing_plan_infos']) - - def list_nodes(self): - # Returns a list of Nodes - # Will only include active ones. - res = self.connection.request('/orders;include_inactive=N').object - return map(lambda x : self._to_node(x), res['about_orders']) - - def list_images(self, location=None): - # Get all base images. - # TODO: add other image sources. (Such as a backup of a VPS) - # All Images are available for use at all locations - res = self.connection.request('/distributions').object - return map(lambda x : self._to_image(x), res['distro_infos']) - - def reboot_node(self, node): - # Reboot - # PUT the state of RESTARTING to restart a VPS. - # All data is encoded as JSON - data = {'reboot_request':{'running_state':'RESTARTING'}} - uri = self._order_uri(node,'vps/running-state') - self.connection.request(uri,data=json.dumps(data),method='PUT') - # XXX check that the response was actually successful - return True - - def destroy_node(self, node): - # Shutdown a VPS. - uri = self._order_uri(node,'vps') - self.connection.request(uri,method='DELETE') - # XXX check that the response was actually successful - return True - - def create_node(self, **kwargs): - """Creates a RimuHosting instance - - See L{NodeDriver.create_node} for more keyword args. - - @keyword name: Must be a FQDN. e.g example.com. - @type name: C{string} - - @keyword ex_billing_oid: If not set, a billing method is automatically picked. - @type ex_billing_oid: C{string} - - @keyword ex_host_server_oid: The host server to set the VPS up on. - @type ex_host_server_oid: C{string} - - @keyword ex_vps_order_oid_to_clone: Clone another VPS to use as the image for the new VPS. - @type ex_vps_order_oid_to_clone: C{string} - - @keyword ex_num_ips: Number of IPs to allocate. Defaults to 1. - @type ex_num_ips: C{int} - - @keyword ex_extra_ip_reason: Reason for needing the extra IPs. - @type ex_extra_ip_reason: C{string} - - @keyword ex_memory_mb: Memory to allocate to the VPS. - @type ex_memory_mb: C{int} - - @keyword ex_disk_space_mb: Diskspace to allocate to the VPS. Defaults to 4096 (4GB). - @type ex_disk_space_mb: C{int} - - @keyword ex_disk_space_2_mb: Secondary disk size allocation. Disabled by default. - @type ex_disk_space_2_mb: C{int} - - @keyword ex_control_panel: Control panel to install on the VPS. - @type ex_control_panel: C{string} - """ - # Note we don't do much error checking in this because we - # expect the API to error out if there is a problem. - name = kwargs['name'] - image = kwargs['image'] - size = kwargs['size'] - - data = { - 'instantiation_options':{ - 'domain_name': name, 'distro': image.id - }, - 'pricing_plan_code': size.id, - } - - if kwargs.has_key('ex_control_panel'): - data['instantiation_options']['control_panel'] = kwargs['ex_control_panel'] - - if kwargs.has_key('auth'): - auth = kwargs['auth'] - if not isinstance(auth, NodeAuthPassword): - raise ValueError('auth must be of NodeAuthPassword type') - data['instantiation_options']['password'] = auth.password - - if kwargs.has_key('ex_billing_oid'): - #TODO check for valid oid. - data['billing_oid'] = kwargs['ex_billing_oid'] - - if kwargs.has_key('ex_host_server_oid'): - data['host_server_oid'] = kwargs['ex_host_server_oid'] - - if kwargs.has_key('ex_vps_order_oid_to_clone'): - data['vps_order_oid_to_clone'] = kwargs['ex_vps_order_oid_to_clone'] - - if kwargs.has_key('ex_num_ips') and int(kwargs['ex_num_ips']) > 1: - if not kwargs.has_key('ex_extra_ip_reason'): - raise RimuHostingException('Need an reason for having an extra IP') - else: - if not data.has_key('ip_request'): - data['ip_request'] = {} - data['ip_request']['num_ips'] = int(kwargs['ex_num_ips']) - data['ip_request']['extra_ip_reason'] = kwargs['ex_extra_ip_reason'] - - if kwargs.has_key('ex_memory_mb'): - if not data.has_key('vps_parameters'): - data['vps_parameters'] = {} - data['vps_parameters']['memory_mb'] = kwargs['ex_memory_mb'] - - if kwargs.has_key('ex_disk_space_mb'): - if not data.has_key('ex_vps_parameters'): - data['vps_parameters'] = {} - data['vps_parameters']['disk_space_mb'] = kwargs['ex_disk_space_mb'] - - if kwargs.has_key('ex_disk_space_2_mb'): - if not data.has_key('vps_parameters'): - data['vps_parameters'] = {} - data['vps_parameters']['disk_space_2_mb'] = kwargs['ex_disk_space_2_mb'] - - res = self.connection.request( - '/orders/new-vps', - method='POST', - data=json.dumps({"new-vps":data}) - ).object - node = self._to_node(res['about_order']) - node.extra['password'] = res['new_order_request']['instantiation_options']['password'] - return node - - def list_locations(self): - return [ - NodeLocation('DCAUCKLAND', "RimuHosting Auckland", 'NZ', self), - NodeLocation('DCDALLAS', "RimuHosting Dallas", 'US', self), - NodeLocation('DCLONDON', "RimuHosting London", 'GB', self), - NodeLocation('DCSYDNEY', "RimuHosting Sydney", 'AU', self), - ] - - features = {"create_node": ["password"]} diff --git a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/drivers/slicehost.py b/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/drivers/slicehost.py deleted file mode 100644 index 49c15ffb825953ed76b6092ac084985832fa1b72..0000000000000000000000000000000000000000 --- a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/drivers/slicehost.py +++ /dev/null @@ -1,255 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -""" -Slicehost Driver -""" -import base64 -import socket - -from xml.etree import ElementTree as ET -from xml.parsers.expat import ExpatError - -from libcloud.common.base import ConnectionKey, Response -from libcloud.compute.types import ( - NodeState, Provider, InvalidCredsError, MalformedResponseError) -from libcloud.compute.base import NodeSize, NodeDriver, NodeImage, NodeLocation -from libcloud.compute.base import Node, is_private_subnet - -class SlicehostResponse(Response): - - def parse_body(self): - # length of 1 can't be valid XML, but on destroy node, - # slicehost returns a 1 byte response with a "Content-Type: - # application/xml" header. booya. - if not self.body or len(self.body) <= 1: - return None - try: - body = ET.XML(self.body) - except: - raise MalformedResponseError( - "Failed to parse XML", - body=self.body, - driver=SlicehostNodeDriver) - return body - - def parse_error(self): - if self.status == 401: - raise InvalidCredsError(self.body) - - try: - body = ET.XML(self.body) - except: - raise MalformedResponseError( - "Failed to parse XML", - body=self.body, - driver=SlicehostNodeDriver) - try: - return "; ".join([ err.text - for err in - body.findall('error') ]) - except ExpatError: - return self.body - - -class SlicehostConnection(ConnectionKey): - """ - Connection class for the Slicehost driver - """ - - host = 'api.slicehost.com' - responseCls = SlicehostResponse - - def add_default_headers(self, headers): - headers['Authorization'] = ('Basic %s' - % (base64.b64encode('%s:' % self.key))) - return headers - - -class SlicehostNodeDriver(NodeDriver): - """ - Slicehost node driver - """ - - connectionCls = SlicehostConnection - - type = Provider.SLICEHOST - name = 'Slicehost' - - features = {"create_node": ["generates_password"]} - - NODE_STATE_MAP = { 'active': NodeState.RUNNING, - 'build': NodeState.PENDING, - 'reboot': NodeState.REBOOTING, - 'hard_reboot': NodeState.REBOOTING, - 'terminated': NodeState.TERMINATED } - - def list_nodes(self): - return self._to_nodes(self.connection.request('/slices.xml').object) - - def list_sizes(self, location=None): - return self._to_sizes(self.connection.request('/flavors.xml').object) - - def list_images(self, location=None): - return self._to_images(self.connection.request('/images.xml').object) - - def list_locations(self): - return [ - NodeLocation(0, 'Slicehost St. Louis (STL-A)', 'US', self), - NodeLocation(0, 'Slicehost St. Louis (STL-B)', 'US', self), - NodeLocation(0, 'Slicehost Dallas-Fort Worth (DFW-1)', 'US', self) - ] - - def create_node(self, **kwargs): - name = kwargs['name'] - image = kwargs['image'] - size = kwargs['size'] - uri = '/slices.xml' - - # create a slice obj - root = ET.Element('slice') - el_name = ET.SubElement(root, 'name') - el_name.text = name - flavor_id = ET.SubElement(root, 'flavor-id') - flavor_id.text = str(size.id) - image_id = ET.SubElement(root, 'image-id') - image_id.text = str(image.id) - xml = ET.tostring(root) - - node = self._to_nodes( - self.connection.request( - uri, - method='POST', - data=xml, - headers={'Content-Type': 'application/xml'} - ).object - )[0] - return node - - def reboot_node(self, node): - """Reboot the node by passing in the node object""" - - # 'hard' could bubble up as kwarg depending on how reboot_node - # turns out. Defaulting to soft reboot. - #hard = False - #reboot = self.api.hard_reboot if hard else self.api.reboot - #expected_status = 'hard_reboot' if hard else 'reboot' - - uri = '/slices/%s/reboot.xml' % (node.id) - node = self._to_nodes( - self.connection.request(uri, method='PUT').object - )[0] - return node.state == NodeState.REBOOTING - - def destroy_node(self, node): - """Destroys the node - - Requires 'Allow Slices to be deleted or rebuilt from the API' to be - ticked at https://manage.slicehost.com/api, otherwise returns:: - - You must enable slice deletes in the SliceManager - Permission denied - - """ - uri = '/slices/%s/destroy.xml' % (node.id) - self.connection.request(uri, method='PUT') - return True - - def _to_nodes(self, object): - if object.tag == 'slice': - return [ self._to_node(object) ] - node_elements = object.findall('slice') - return [ self._to_node(el) for el in node_elements ] - - def _to_node(self, element): - - attrs = [ 'name', 'image-id', 'progress', 'id', 'bw-out', 'bw-in', - 'flavor-id', 'status', 'ip-address', 'root-password' ] - - node_attrs = {} - for attr in attrs: - node_attrs[attr] = element.findtext(attr) - - # slicehost does not determine between public and private, so we - # have to figure it out - public_ip = [] - private_ip = [] - - ip_address = element.findtext('ip-address') - if is_private_subnet(ip_address): - private_ip.append(ip_address) - else: - public_ip.append(ip_address) - - for addr in element.findall('addresses/address'): - ip = addr.text - try: - socket.inet_aton(ip) - except socket.error: - # not a valid ip - continue - if is_private_subnet(ip): - private_ip.append(ip) - else: - public_ip.append(ip) - - public_ip = list(set(public_ip)) - - try: - state = self.NODE_STATE_MAP[element.findtext('status')] - except: - state = NodeState.UNKNOWN - - # for consistency with other drivers, we put this in two places. - node_attrs['password'] = node_attrs['root-password'] - extra = {} - for k in node_attrs.keys(): - ek = k.replace("-", "_") - extra[ek] = node_attrs[k] - n = Node(id=element.findtext('id'), - name=element.findtext('name'), - state=state, - public_ip=public_ip, - private_ip=private_ip, - driver=self.connection.driver, - extra=extra) - return n - - def _to_sizes(self, object): - if object.tag == 'flavor': - return [ self._to_size(object) ] - elements = object.findall('flavor') - return [ self._to_size(el) for el in elements ] - - def _to_size(self, element): - s = NodeSize(id=int(element.findtext('id')), - name=str(element.findtext('name')), - ram=int(element.findtext('ram')), - disk=None, # XXX: needs hardcode - bandwidth=None, # XXX: needs hardcode - price=float(element.findtext('price'))/(100*24*30), - driver=self.connection.driver) - return s - - def _to_images(self, object): - if object.tag == 'image': - return [ self._to_image(object) ] - elements = object.findall('image') - return [ self._to_image(el) for el in elements ] - - def _to_image(self, element): - i = NodeImage(id=int(element.findtext('id')), - name=str(element.findtext('name')), - driver=self.connection.driver) - return i diff --git a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/drivers/softlayer.py b/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/drivers/softlayer.py deleted file mode 100644 index ac22c16ef46805215c576944e9f4bc41594f3af8..0000000000000000000000000000000000000000 --- a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/drivers/softlayer.py +++ /dev/null @@ -1,442 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -""" -Softlayer driver -""" - -import time -import xmlrpclib - -import libcloud - -from libcloud.common.types import InvalidCredsError, LibcloudError -from libcloud.compute.types import Provider, NodeState -from libcloud.compute.base import NodeDriver, Node, NodeLocation, NodeSize, NodeImage - -DATACENTERS = { - 'sea01': {'country': 'US'}, - 'wdc01': {'country': 'US'}, - 'dal01': {'country': 'US'} -} - -NODE_STATE_MAP = { - 'RUNNING': NodeState.RUNNING, - 'HALTED': NodeState.TERMINATED, - 'PAUSED': NodeState.TERMINATED, -} - -DEFAULT_PACKAGE = 46 - -SL_IMAGES = [ - {'id': 1684, 'name': 'CentOS 5 - Minimal Install (32 bit)'}, - {'id': 1685, 'name': 'CentOS 5 - Minimal Install (64 bit)'}, - {'id': 1686, 'name': 'CentOS 5 - LAMP Install (32 bit)'}, - {'id': 1687, 'name': 'CentOS 5 - LAMP Install (64 bit)'}, - {'id': 1688, 'name': 'Red Hat Enterprise Linux 5 - Minimal Install (32 bit)'}, - {'id': 1689, 'name': 'Red Hat Enterprise Linux 5 - Minimal Install (64 bit)'}, - {'id': 1690, 'name': 'Red Hat Enterprise Linux 5 - LAMP Install (32 bit)'}, - {'id': 1691, 'name': 'Red Hat Enterprise Linux 5 - LAMP Install (64 bit)'}, - {'id': 1692, 'name': 'Ubuntu Linux 8 LTS Hardy Heron - Minimal Install (32 bit)'}, - {'id': 1693, 'name': 'Ubuntu Linux 8 LTS Hardy Heron - Minimal Install (64 bit)'}, - {'id': 1694, 'name': 'Ubuntu Linux 8 LTS Hardy Heron - LAMP Install (32 bit)'}, - {'id': 1695, 'name': 'Ubuntu Linux 8 LTS Hardy Heron - LAMP Install (64 bit)'}, - {'id': 1696, 'name': 'Debian GNU/Linux 5.0 Lenny/Stable - Minimal Install (32 bit)'}, - {'id': 1697, 'name': 'Debian GNU/Linux 5.0 Lenny/Stable - Minimal Install (64 bit)'}, - {'id': 1698, 'name': 'Debian GNU/Linux 5.0 Lenny/Stable - LAMP Install (32 bit)'}, - {'id': 1699, 'name': 'Debian GNU/Linux 5.0 Lenny/Stable - LAMP Install (64 bit)'}, - {'id': 1700, 'name': 'Windows Server 2003 Standard SP2 with R2 (32 bit)'}, - {'id': 1701, 'name': 'Windows Server 2003 Standard SP2 with R2 (64 bit)'}, - {'id': 1703, 'name': 'Windows Server 2003 Enterprise SP2 with R2 (64 bit)'}, - {'id': 1705, 'name': 'Windows Server 2008 Standard Edition (64bit)'}, - {'id': 1715, 'name': 'Windows Server 2003 Datacenter SP2 (64 bit)'}, - {'id': 1716, 'name': 'Windows Server 2003 Datacenter SP2 (32 bit)'}, - {'id': 1742, 'name': 'Windows Server 2008 Standard Edition SP2 (32bit)'}, - {'id': 1752, 'name': 'Windows Server 2008 Standard Edition SP2 (64bit)'}, - {'id': 1756, 'name': 'Windows Server 2008 Enterprise Edition SP2 (32bit)'}, - {'id': 1761, 'name': 'Windows Server 2008 Enterprise Edition SP2 (64bit)'}, - {'id': 1766, 'name': 'Windows Server 2008 Datacenter Edition SP2 (32bit)'}, - {'id': 1770, 'name': 'Windows Server 2008 Datacenter Edition SP2 (64bit)'}, - {'id': 1857, 'name': 'Windows Server 2008 R2 Standard Edition (64bit)'}, - {'id': 1860, 'name': 'Windows Server 2008 R2 Enterprise Edition (64bit)'}, - {'id': 1863, 'name': 'Windows Server 2008 R2 Datacenter Edition (64bit)'}, -] - -""" -The following code snippet will print out all available "prices" - mask = { 'items': '' } - res = self.connection.request( - "SoftLayer_Product_Package", - "getObject", - res, - id=46, - object_mask=mask - ) - - from pprint import pprint; pprint(res) -""" -SL_TEMPLATES = { - 'sl1': { - 'imagedata': { - 'name': '2 x 2.0 GHz, 1GB ram, 100GB', - 'ram': 1024, - 'disk': 100, - 'bandwidth': None - }, - 'prices': [ - {'id': 1644}, # 1 GB - {'id': 1639}, # 100 GB (SAN) - {'id': 1963}, # Private 2 x 2.0 GHz Cores - {'id': 21}, # 1 IP Address - {'id': 55}, # Host Ping - {'id': 58}, # Automated Notification - {'id': 1800}, # 0 GB Bandwidth - {'id': 57}, # Email and Ticket - {'id': 274}, # 1000 Mbps Public & Private Networks - {'id': 905}, # Reboot / Remote Console - {'id': 418}, # Nessus Vulnerability Assessment & Reporting - {'id': 420}, # Unlimited SSL VPN Users & 1 PPTP VPN User per account - ], - }, - 'sl2': { - 'imagedata': { - 'name': '2 x 2.0 GHz, 4GB ram, 350GB', - 'ram': 4096, - 'disk': 350, - 'bandwidth': None - }, - 'prices': [ - {'id': 1646}, # 4 GB - {'id': 1639}, # 100 GB (SAN) - This is the only available "First Disk" - {'id': 1638}, # 250 GB (SAN) - {'id': 1963}, # Private 2 x 2.0 GHz Cores - {'id': 21}, # 1 IP Address - {'id': 55}, # Host Ping - {'id': 58}, # Automated Notification - {'id': 1800}, # 0 GB Bandwidth - {'id': 57}, # Email and Ticket - {'id': 274}, # 1000 Mbps Public & Private Networks - {'id': 905}, # Reboot / Remote Console - {'id': 418}, # Nessus Vulnerability Assessment & Reporting - {'id': 420}, # Unlimited SSL VPN Users & 1 PPTP VPN User per account - ], - } -} - -class SoftLayerException(LibcloudError): - """ - Exception class for SoftLayer driver - """ - pass - -class SoftLayerSafeTransport(xmlrpclib.SafeTransport): - pass - -class SoftLayerTransport(xmlrpclib.Transport): - pass - -class SoftLayerProxy(xmlrpclib.ServerProxy): - transportCls = (SoftLayerTransport, SoftLayerSafeTransport) - API_PREFIX = "http://api.service.softlayer.com/xmlrpc/v3" - - def __init__(self, service, user_agent, verbose=0): - cls = self.transportCls[0] - if SoftLayerProxy.API_PREFIX[:8] == "https://": - cls = self.transportCls[1] - t = cls(use_datetime=0) - t.user_agent = user_agent - xmlrpclib.ServerProxy.__init__( - self, - uri="%s/%s" % (SoftLayerProxy.API_PREFIX, service), - transport=t, - verbose=verbose - ) - -class SoftLayerConnection(object): - """ - Connection class for the SoftLayer driver - """ - - proxyCls = SoftLayerProxy - driver = None - - def __init__(self, user, key): - self.user = user - self.key = key - self.ua = [] - - def request(self, service, method, *args, **kwargs): - sl = self.proxyCls(service, self._user_agent()) - - headers = {} - headers.update(self._get_auth_headers()) - headers.update(self._get_init_params(service, kwargs.get('id'))) - headers.update(self._get_object_mask(service, kwargs.get('object_mask'))) - params = [{'headers': headers}] + list(args) - - try: - return getattr(sl, method)(*params) - except xmlrpclib.Fault, e: - if e.faultCode == "SoftLayer_Account": - raise InvalidCredsError(e.faultString) - raise SoftLayerException(e) - - def _user_agent(self): - return 'libcloud/%s (%s)%s' % ( - libcloud.__version__, - self.driver.name, - "".join([" (%s)" % x for x in self.ua])) - - def user_agent_append(self, s): - self.ua.append(s) - - def _get_auth_headers(self): - return { - 'authenticate': { - 'username': self.user, - 'apiKey': self.key - } - } - - def _get_init_params(self, service, id): - if id is not None: - return { - '%sInitParameters' % service: {'id': id} - } - else: - return {} - - def _get_object_mask(self, service, mask): - if mask is not None: - return { - '%sObjectMask' % service: {'mask': mask} - } - else: - return {} - -class SoftLayerNodeDriver(NodeDriver): - """ - SoftLayer node driver - - Extra node attributes: - - password: root password - - hourlyRecurringFee: hourly price (if applicable) - - recurringFee : flat rate (if applicable) - - recurringMonths : The number of months in which the recurringFee will be incurred. - """ - connectionCls = SoftLayerConnection - name = 'SoftLayer' - type = Provider.SOFTLAYER - - features = {"create_node": ["generates_password"]} - - def __init__(self, key, secret=None, secure=False): - self.key = key - self.secret = secret - self.connection = self.connectionCls(key, secret) - self.connection.driver = self - - def _to_node(self, host): - try: - password = host['softwareComponents'][0]['passwords'][0]['password'] - except (IndexError, KeyError): - password = None - - hourlyRecurringFee = host.get('billingItem', {}).get('hourlyRecurringFee', 0) - recurringFee = host.get('billingItem', {}).get('recurringFee', 0) - recurringMonths = host.get('billingItem', {}).get('recurringMonths', 0) - - return Node( - id=host['id'], - name=host['hostname'], - state=NODE_STATE_MAP.get( - host['powerState']['keyName'], - NodeState.UNKNOWN - ), - public_ip=[host['primaryIpAddress']], - private_ip=[host['primaryBackendIpAddress']], - driver=self, - extra={ - 'password': password, - 'hourlyRecurringFee': hourlyRecurringFee, - 'recurringFee': recurringFee, - 'recurringMonths': recurringMonths, - } - ) - - def _to_nodes(self, hosts): - return [self._to_node(h) for h in hosts] - - def destroy_node(self, node): - billing_item = self.connection.request( - "SoftLayer_Virtual_Guest", - "getBillingItem", - id=node.id - ) - - if billing_item: - res = self.connection.request( - "SoftLayer_Billing_Item", - "cancelService", - id=billing_item['id'] - ) - return res - else: - return False - - def _get_order_information(self, order_id, timeout=1200, check_interval=5): - mask = { - 'orderTopLevelItems': { - 'billingItem': { - 'resource': { - 'softwareComponents': { - 'passwords': '' - }, - 'powerState': '', - } - }, - } - } - - for i in range(0, timeout, check_interval): - try: - res = self.connection.request( - "SoftLayer_Billing_Order", - "getObject", - id=order_id, - object_mask=mask - ) - item = res['orderTopLevelItems'][0]['billingItem']['resource'] - if item['softwareComponents'][0]['passwords']: - return item - - except (KeyError, IndexError): - pass - - time.sleep(check_interval) - - return None - - def create_node(self, **kwargs): - """Create a new SoftLayer node - - See L{NodeDriver.create_node} for more keyword args. - @keyword ex_domain: e.g. libcloud.org - @type ex_domain: C{string} - """ - name = kwargs['name'] - image = kwargs['image'] - size = kwargs['size'] - domain = kwargs.get('ex_domain') - location = kwargs['location'] - if domain == None: - if name.find(".") != -1: - domain = name[name.find('.')+1:] - - if domain == None: - # TODO: domain is a required argument for the Sofylayer API, but it - # it shouldn't be. - domain = "exmaple.com" - - res = {'prices': SL_TEMPLATES[size.id]['prices']} - res['packageId'] = DEFAULT_PACKAGE - res['prices'].append({'id': image.id}) # Add OS to order - res['location'] = location.id - res['complexType'] = 'SoftLayer_Container_Product_Order_Virtual_Guest' - res['quantity'] = 1 - res['useHourlyPricing'] = True - res['virtualGuests'] = [ - { - 'hostname': name, - 'domain': domain - } - ] - - res = self.connection.request( - "SoftLayer_Product_Order", - "placeOrder", - res - ) - - order_id = res['orderId'] - raw_node = self._get_order_information(order_id) - - return self._to_node(raw_node) - - def _to_image(self, img): - return NodeImage( - id=img['id'], - name=img['name'], - driver=self.connection.driver - ) - - def list_images(self, location=None): - return [self._to_image(i) for i in SL_IMAGES] - - def _to_size(self, id, size): - return NodeSize( - id=id, - name=size['name'], - ram=size['ram'], - disk=size['disk'], - bandwidth=size['bandwidth'], - price=None, - driver=self.connection.driver, - ) - - def list_sizes(self, location=None): - return [self._to_size(id, s['imagedata']) for id, s in SL_TEMPLATES.iteritems()] - - def _to_loc(self, loc): - return NodeLocation( - id=loc['id'], - name=loc['name'], - country=DATACENTERS[loc['name']]['country'], - driver=self - ) - - def list_locations(self): - res = self.connection.request( - "SoftLayer_Location_Datacenter", - "getDatacenters" - ) - - # checking "in DATACENTERS", because some of the locations returned by getDatacenters are not useable. - return [self._to_loc(l) for l in res if l['name'] in DATACENTERS] - - def list_nodes(self): - mask = { - 'virtualGuests': { - 'powerState': '', - 'softwareComponents': { - 'passwords': '' - }, - 'billingItem': '', - }, - } - res = self.connection.request( - "SoftLayer_Account", - "getVirtualGuests", - object_mask=mask - ) - nodes = self._to_nodes(res) - return nodes - - def reboot_node(self, node): - res = self.connection.request( - "SoftLayer_Virtual_Guest", - "rebootHard", - id=node.id - ) - return res diff --git a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/drivers/vcloud.py b/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/drivers/vcloud.py deleted file mode 100644 index 870a9491a7457fe810f92da1b94bbc00e878bb96..0000000000000000000000000000000000000000 --- a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/drivers/vcloud.py +++ /dev/null @@ -1,624 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -""" -VMware vCloud driver. -""" -import base64 -import httplib -import time - -from urlparse import urlparse -from xml.etree import ElementTree as ET -from xml.parsers.expat import ExpatError - -from libcloud.common.base import Response, ConnectionUserAndKey -from libcloud.common.types import InvalidCredsError -from libcloud.compute.providers import Provider -from libcloud.compute.types import NodeState -from libcloud.compute.base import Node, NodeDriver, NodeLocation -from libcloud.compute.base import NodeSize, NodeImage, NodeAuthPassword - -""" -From vcloud api "The VirtualQuantity element defines the number of MB -of memory. This should be either 512 or a multiple of 1024 (1 GB)." -""" -VIRTUAL_MEMORY_VALS = [512] + [1024 * i for i in range(1,9)] - -DEFAULT_TASK_COMPLETION_TIMEOUT = 600 - -def get_url_path(url): - return urlparse(url.strip()).path - -def fixxpath(root, xpath): - """ElementTree wants namespaces in its xpaths, so here we add them.""" - namespace, root_tag = root.tag[1:].split("}", 1) - fixed_xpath = "/".join(["{%s}%s" % (namespace, e) - for e in xpath.split("/")]) - return fixed_xpath - -class InstantiateVAppXML(object): - - def __init__(self, name, template, net_href, cpus, memory, - password=None, row=None, group=None): - self.name = name - self.template = template - self.net_href = net_href - self.cpus = cpus - self.memory = memory - self.password = password - self.row = row - self.group = group - - self._build_xmltree() - - def tostring(self): - return ET.tostring(self.root) - - def _build_xmltree(self): - self.root = self._make_instantiation_root() - - self._add_vapp_template(self.root) - instantionation_params = ET.SubElement(self.root, - "InstantiationParams") - - # product and virtual hardware - self._make_product_section(instantionation_params) - self._make_virtual_hardware(instantionation_params) - - network_config_section = ET.SubElement(instantionation_params, - "NetworkConfigSection") - - network_config = ET.SubElement(network_config_section, - "NetworkConfig") - self._add_network_association(network_config) - - def _make_instantiation_root(self): - return ET.Element( - "InstantiateVAppTemplateParams", - {'name': self.name, - 'xml:lang': 'en', - 'xmlns': "http://www.vmware.com/vcloud/v0.8", - 'xmlns:xsi': "http://www.w3.org/2001/XMLSchema-instance"} - ) - - def _add_vapp_template(self, parent): - return ET.SubElement( - parent, - "VAppTemplate", - {'href': self.template} - ) - - def _make_product_section(self, parent): - prod_section = ET.SubElement( - parent, - "ProductSection", - {'xmlns:q1': "http://www.vmware.com/vcloud/v0.8", - 'xmlns:ovf': "http://schemas.dmtf.org/ovf/envelope/1"} - ) - - if self.password: - self._add_property(prod_section, 'password', self.password) - - if self.row: - self._add_property(prod_section, 'row', self.row) - - if self.group: - self._add_property(prod_section, 'group', self.group) - - return prod_section - - def _add_property(self, parent, ovfkey, ovfvalue): - return ET.SubElement( - parent, - "Property", - {'xmlns': 'http://schemas.dmtf.org/ovf/envelope/1', - 'ovf:key': ovfkey, - 'ovf:value': ovfvalue} - ) - - def _make_virtual_hardware(self, parent): - vh = ET.SubElement( - parent, - "VirtualHardwareSection", - {'xmlns:q1': "http://www.vmware.com/vcloud/v0.8"} - ) - - self._add_cpu(vh) - self._add_memory(vh) - - return vh - - def _add_cpu(self, parent): - cpu_item = ET.SubElement( - parent, - "Item", - {'xmlns': "http://schemas.dmtf.org/ovf/envelope/1"} - ) - self._add_instance_id(cpu_item, '1') - self._add_resource_type(cpu_item, '3') - self._add_virtual_quantity(cpu_item, self.cpus) - - return cpu_item - - def _add_memory(self, parent): - mem_item = ET.SubElement( - parent, - "Item", - {'xmlns': "http://schemas.dmtf.org/ovf/envelope/1"} - ) - self._add_instance_id(mem_item, '2') - self._add_resource_type(mem_item, '4') - self._add_virtual_quantity(mem_item, self.memory) - - return mem_item - - def _add_instance_id(self, parent, id): - elm = ET.SubElement( - parent, - "InstanceID", - {'xmlns': 'http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData'} - ) - elm.text = id - return elm - - def _add_resource_type(self, parent, type): - elm = ET.SubElement( - parent, - "ResourceType", - {'xmlns': 'http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData'} - ) - elm.text = type - return elm - - def _add_virtual_quantity(self, parent, amount): - elm = ET.SubElement( - parent, - "VirtualQuantity", - {'xmlns': 'http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData'} - ) - elm.text = amount - return elm - - def _add_network_association(self, parent): - return ET.SubElement( - parent, - "NetworkAssociation", - {'href': self.net_href} - ) - -class VCloudResponse(Response): - - def parse_body(self): - if not self.body: - return None - try: - return ET.XML(self.body) - except ExpatError, e: - raise Exception("%s: %s" % (e, self.parse_error())) - - def parse_error(self): - return self.error - - def success(self): - return self.status in (httplib.OK, httplib.CREATED, - httplib.NO_CONTENT, httplib.ACCEPTED) - -class VCloudConnection(ConnectionUserAndKey): - """ - Connection class for the vCloud driver - """ - - responseCls = VCloudResponse - token = None - host = None - - def request(self, *args, **kwargs): - self._get_auth_token() - return super(VCloudConnection, self).request(*args, **kwargs) - - def check_org(self): - # the only way to get our org is by logging in. - self._get_auth_token() - - def _get_auth_headers(self): - """Some providers need different headers than others""" - return { - 'Authorization': - "Basic %s" - % base64.b64encode('%s:%s' % (self.user_id, self.key)), - 'Content-Length': 0 - } - - def _get_auth_token(self): - if not self.token: - conn = self.conn_classes[self.secure](self.host, - self.port[self.secure]) - conn.request(method='POST', url='/api/v0.8/login', - headers=self._get_auth_headers()) - - resp = conn.getresponse() - headers = dict(resp.getheaders()) - body = ET.XML(resp.read()) - - try: - self.token = headers['set-cookie'] - except KeyError: - raise InvalidCredsError() - - self.driver.org = get_url_path( - body.find(fixxpath(body, 'Org')).get('href') - ) - - def add_default_headers(self, headers): - headers['Cookie'] = self.token - return headers - -class VCloudNodeDriver(NodeDriver): - """ - vCloud node driver - """ - - type = Provider.VCLOUD - name = "vCloud" - connectionCls = VCloudConnection - org = None - _vdcs = None - - NODE_STATE_MAP = {'0': NodeState.PENDING, - '1': NodeState.PENDING, - '2': NodeState.PENDING, - '3': NodeState.PENDING, - '4': NodeState.RUNNING} - - @property - def vdcs(self): - if not self._vdcs: - self.connection.check_org() # make sure the org is set. - res = self.connection.request(self.org) - self._vdcs = [ - get_url_path(i.get('href')) - for i - in res.object.findall(fixxpath(res.object, "Link")) - if i.get('type') == 'application/vnd.vmware.vcloud.vdc+xml' - ] - - return self._vdcs - - @property - def networks(self): - networks = [] - for vdc in self.vdcs: - res = self.connection.request(vdc).object - networks.extend( - [network - for network in res.findall( - fixxpath(res, "AvailableNetworks/Network") - )] - ) - - return networks - - def _to_image(self, image): - image = NodeImage(id=image.get('href'), - name=image.get('name'), - driver=self.connection.driver) - return image - - def _to_node(self, name, elm): - state = self.NODE_STATE_MAP[elm.get('status')] - public_ips = [] - private_ips = [] - - # Following code to find private IPs works for Terremark - connections = elm.findall('{http://schemas.dmtf.org/ovf/envelope/1}NetworkConnectionSection/{http://www.vmware.com/vcloud/v0.8}NetworkConnection') - for connection in connections: - ips = [ip.text - for ip - in connection.findall(fixxpath(elm, "IpAddress"))] - if connection.get('Network') == 'Internal': - private_ips.extend(ips) - else: - public_ips.extend(ips) - - node = Node(id=elm.get('href'), - name=name, - state=state, - public_ip=public_ips, - private_ip=private_ips, - driver=self.connection.driver) - - return node - - def _get_catalog_hrefs(self): - res = self.connection.request(self.org) - catalogs = [ - get_url_path(i.get('href')) - for i in res.object.findall(fixxpath(res.object, "Link")) - if i.get('type') == 'application/vnd.vmware.vcloud.catalog+xml' - ] - - return catalogs - - def _wait_for_task_completion(self, task_href, - timeout=DEFAULT_TASK_COMPLETION_TIMEOUT): - start_time = time.time() - res = self.connection.request(task_href) - status = res.object.get('status') - while status != 'success': - if status == 'error': - raise Exception("Error status returned by task %s." - % task_href) - if status == 'canceled': - raise Exception("Canceled status returned by task %s." - % task_href) - if (time.time() - start_time >= timeout): - raise Exception("Timeout while waiting for task %s." - % task_href) - time.sleep(5) - res = self.connection.request(task_href) - status = res.object.get('status') - - def destroy_node(self, node): - node_path = get_url_path(node.id) - # blindly poweroff node, it will throw an exception if already off - try: - res = self.connection.request('%s/power/action/poweroff' - % node_path, - method='POST') - self._wait_for_task_completion(res.object.get('href')) - except Exception: - pass - - try: - res = self.connection.request('%s/action/undeploy' % node_path, - method='POST') - self._wait_for_task_completion(res.object.get('href')) - except ExpatError: - # The undeploy response is malformed XML atm. - # We can remove this whent he providers fix the problem. - pass - except Exception: - # Some vendors don't implement undeploy at all yet, - # so catch this and move on. - pass - - res = self.connection.request(node_path, method='DELETE') - return res.status == 202 - - def reboot_node(self, node): - res = self.connection.request('%s/power/action/reset' - % get_url_path(node.id), - method='POST') - return res.status == 202 or res.status == 204 - - def list_nodes(self): - nodes = [] - for vdc in self.vdcs: - res = self.connection.request(vdc) - elms = res.object.findall(fixxpath( - res.object, "ResourceEntities/ResourceEntity") - ) - vapps = [ - (i.get('name'), get_url_path(i.get('href'))) - for i in elms - if i.get('type') - == 'application/vnd.vmware.vcloud.vApp+xml' - and i.get('name') - ] - - for vapp_name, vapp_href in vapps: - res = self.connection.request( - vapp_href, - headers={ - 'Content-Type': - 'application/vnd.vmware.vcloud.vApp+xml' - } - ) - nodes.append(self._to_node(vapp_name, res.object)) - - return nodes - - def _to_size(self, ram): - ns = NodeSize( - id=None, - name="%s Ram" % ram, - ram=ram, - disk=None, - bandwidth=None, - price=None, - driver=self.connection.driver - ) - return ns - - def list_sizes(self, location=None): - sizes = [self._to_size(i) for i in VIRTUAL_MEMORY_VALS] - return sizes - - def _get_catalogitems_hrefs(self, catalog): - """Given a catalog href returns contained catalog item hrefs""" - res = self.connection.request( - catalog, - headers={ - 'Content-Type': - 'application/vnd.vmware.vcloud.catalog+xml' - } - ).object - - cat_items = res.findall(fixxpath(res, "CatalogItems/CatalogItem")) - cat_item_hrefs = [i.get('href') - for i in cat_items - if i.get('type') == - 'application/vnd.vmware.vcloud.catalogItem+xml'] - - return cat_item_hrefs - - def _get_catalogitem(self, catalog_item): - """Given a catalog item href returns elementree""" - res = self.connection.request( - catalog_item, - headers={ - 'Content-Type': - 'application/vnd.vmware.vcloud.catalogItem+xml' - } - ).object - - return res - - def list_images(self, location=None): - images = [] - for vdc in self.vdcs: - res = self.connection.request(vdc).object - res_ents = res.findall(fixxpath( - res, "ResourceEntities/ResourceEntity") - ) - images += [ - self._to_image(i) - for i in res_ents - if i.get('type') == - 'application/vnd.vmware.vcloud.vAppTemplate+xml' - ] - - for catalog in self._get_catalog_hrefs(): - for cat_item in self._get_catalogitems_hrefs(catalog): - res = self._get_catalogitem(cat_item) - res_ents = res.findall(fixxpath(res, 'Entity')) - images += [ - self._to_image(i) - for i in res_ents - if i.get('type') == - 'application/vnd.vmware.vcloud.vAppTemplate+xml' - ] - - return images - - def create_node(self, **kwargs): - """Creates and returns node. - - - See L{NodeDriver.create_node} for more keyword args. - - Non-standard optional keyword arguments: - @keyword ex_network: link to a "Network" e.g., "https://services.vcloudexpress.terremark.com/api/v0.8/network/7" - @type ex_network: C{string} - - @keyword ex_vdc: link to a "VDC" e.g., "https://services.vcloudexpress.terremark.com/api/v0.8/vdc/1" - @type ex_vdc: C{string} - - @keyword ex_cpus: number of virtual cpus (limit depends on provider) - @type ex_cpus: C{int} - - @keyword row: ???? - @type row: C{????} - - @keyword group: ???? - @type group: C{????} - """ - name = kwargs['name'] - image = kwargs['image'] - size = kwargs['size'] - - # Some providers don't require a network link - try: - network = kwargs.get('ex_network', self.networks[0].get('href')) - except IndexError: - network = '' - - password = None - if kwargs.has_key('auth'): - auth = kwargs['auth'] - if isinstance(auth, NodeAuthPassword): - password = auth.password - else: - raise ValueError('auth must be of NodeAuthPassword type') - - instantiate_xml = InstantiateVAppXML( - name=name, - template=image.id, - net_href=network, - cpus=str(kwargs.get('ex_cpus', 1)), - memory=str(size.ram), - password=password, - row=kwargs.get('ex_row', None), - group=kwargs.get('ex_group', None) - ) - - # Instantiate VM and get identifier. - res = self.connection.request( - '%s/action/instantiateVAppTemplate' - % kwargs.get('vdc', self.vdcs[0]), - data=instantiate_xml.tostring(), - method='POST', - headers={ - 'Content-Type': - 'application/vnd.vmware.vcloud.instantiateVAppTemplateParams+xml' - } - ) - vapp_name = res.object.get('name') - vapp_href = get_url_path(res.object.get('href')) - - # Deploy the VM from the identifier. - res = self.connection.request('%s/action/deploy' % vapp_href, - method='POST') - - self._wait_for_task_completion(res.object.get('href')) - - # Power on the VM. - res = self.connection.request('%s/power/action/powerOn' % vapp_href, - method='POST') - - res = self.connection.request(vapp_href) - node = self._to_node(vapp_name, res.object) - - return node - - features = {"create_node": ["password"]} - -class HostingComConnection(VCloudConnection): - """ - vCloud connection subclass for Hosting.com - """ - - host = "vcloud.safesecureweb.com" - - def _get_auth_headers(self): - """hosting.com doesn't follow the standard vCloud authentication API""" - return { - 'Authentication': - base64.b64encode('%s:%s' % (self.user_id, self.key)), - 'Content-Length': 0 - } - -class HostingComDriver(VCloudNodeDriver): - """ - vCloud node driver for Hosting.com - """ - connectionCls = HostingComConnection - -class TerremarkConnection(VCloudConnection): - """ - vCloud connection subclass for Terremark - """ - - host = "services.vcloudexpress.terremark.com" - -class TerremarkDriver(VCloudNodeDriver): - """ - vCloud node driver for Terremark - """ - - connectionCls = TerremarkConnection - - def list_locations(self): - return [NodeLocation(0, "Terremark Texas", 'US', self)] diff --git a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/drivers/voxel.py b/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/drivers/voxel.py deleted file mode 100644 index 1e6659a1fbb20a37ea73b3bfdf79cdeff47bfcd1..0000000000000000000000000000000000000000 --- a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/drivers/voxel.py +++ /dev/null @@ -1,308 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" -Voxel VoxCloud driver -""" -import datetime -import hashlib - -from xml.etree import ElementTree as ET - -from libcloud.common.base import Response, ConnectionUserAndKey -from libcloud.common.types import InvalidCredsError -from libcloud.compute.providers import Provider -from libcloud.compute.types import NodeState -from libcloud.compute.base import Node, NodeDriver -from libcloud.compute.base import NodeSize, NodeImage, NodeLocation - -VOXEL_API_HOST = "api.voxel.net" - -class VoxelResponse(Response): - - def __init__(self, response): - self.parsed = None - super(VoxelResponse, self).__init__(response) - - def parse_body(self): - if not self.body: - return None - if not self.parsed: - self.parsed = ET.XML(self.body) - return self.parsed - - def parse_error(self): - err_list = [] - if not self.body: - return None - if not self.parsed: - self.parsed = ET.XML(self.body) - for err in self.parsed.findall('err'): - code = err.get('code') - err_list.append("(%s) %s" % (code, err.get('msg'))) - # From voxel docs: - # 1: Invalid login or password - # 9: Permission denied: user lacks access rights for this method - if code == "1" or code == "9": - # sucks, but only way to detect - # bad authentication tokens so far - raise InvalidCredsError(err_list[-1]) - return "\n".join(err_list) - - def success(self): - if not self.parsed: - self.parsed = ET.XML(self.body) - stat = self.parsed.get('stat') - if stat != "ok": - return False - return True - -class VoxelConnection(ConnectionUserAndKey): - """ - Connection class for the Voxel driver - """ - - host = VOXEL_API_HOST - responseCls = VoxelResponse - - def add_default_params(self, params): - params["key"] = self.user_id - params["timestamp"] = datetime.datetime.utcnow().isoformat()+"+0000" - - for param in params.keys(): - if params[param] is None: - del params[param] - - keys = params.keys() - keys.sort() - - md5 = hashlib.md5() - md5.update(self.key) - for key in keys: - if params[key]: - if not params[key] is None: - md5.update("%s%s"% (key, params[key])) - else: - md5.update(key) - params['api_sig'] = md5.hexdigest() - return params - -VOXEL_INSTANCE_TYPES = {} -RAM_PER_CPU = 2048 - -NODE_STATE_MAP = { - 'IN_PROGRESS': NodeState.PENDING, - 'QUEUED': NodeState.PENDING, - 'SUCCEEDED': NodeState.RUNNING, - 'shutting-down': NodeState.TERMINATED, - 'terminated': NodeState.TERMINATED, - 'unknown': NodeState.UNKNOWN, -} - -class VoxelNodeDriver(NodeDriver): - """ - Voxel VoxCLOUD node driver - """ - - connectionCls = VoxelConnection - type = Provider.VOXEL - name = 'Voxel VoxCLOUD' - - def _initialize_instance_types(): - for cpus in range(1,14): - if cpus == 1: - name = "Single CPU" - else: - name = "%d CPUs" % cpus - id = "%dcpu" % cpus - ram = cpus * RAM_PER_CPU - - VOXEL_INSTANCE_TYPES[id]= { - 'id': id, - 'name': name, - 'ram': ram, - 'disk': None, - 'bandwidth': None, - 'price': None} - - features = {"create_node": [], - "list_sizes": ["variable_disk"]} - - _initialize_instance_types() - - def list_nodes(self): - params = {"method": "voxel.devices.list"} - result = self.connection.request('/', params=params).object - return self._to_nodes(result) - - def list_sizes(self, location=None): - return [ NodeSize(driver=self.connection.driver, **i) - for i in VOXEL_INSTANCE_TYPES.values() ] - - def list_images(self, location=None): - params = {"method": "voxel.images.list"} - result = self.connection.request('/', params=params).object - return self._to_images(result) - - def create_node(self, **kwargs): - """Create Voxel Node - - @keyword name: the name to assign the node (mandatory) - @type name: C{str} - - @keyword image: distribution to deploy - @type image: L{NodeImage} - - @keyword size: the plan size to create (mandatory) - Requires size.disk (GB) to be set manually - @type size: L{NodeSize} - - @keyword location: which datacenter to create the node in - @type location: L{NodeLocation} - - @keyword ex_privateip: Backend IP address to assign to node; - must be chosen from the customer's - private VLAN assignment. - @type ex_privateip: C{str} - - @keyword ex_publicip: Public-facing IP address to assign to node; - must be chosen from the customer's - public VLAN assignment. - @type ex_publicip: C{str} - - @keyword ex_rootpass: Password for root access; generated if unset. - @type ex_rootpass: C{str} - - @keyword ex_consolepass: Password for remote console; - generated if unset. - @type ex_consolepass: C{str} - - @keyword ex_sshuser: Username for SSH access - @type ex_sshuser: C{str} - - @keyword ex_sshpass: Password for SSH access; generated if unset. - @type ex_sshpass: C{str} - - @keyword ex_voxel_access: Allow access Voxel administrative access. - Defaults to False. - @type ex_voxel_access: C{bool} - """ - - # assert that disk > 0 - if not kwargs["size"].disk: - raise ValueError("size.disk must be non-zero") - - # convert voxel_access to string boolean if needed - voxel_access = kwargs.get("ex_voxel_access", None) - if voxel_access is not None: - voxel_access = "true" if voxel_access else "false" - - params = { - 'method': 'voxel.voxcloud.create', - 'hostname': kwargs["name"], - 'disk_size': int(kwargs["size"].disk), - 'facility': kwargs["location"].id, - 'image_id': kwargs["image"].id, - 'processing_cores': kwargs["size"].ram / RAM_PER_CPU, - 'backend_ip': kwargs.get("ex_privateip", None), - 'frontend_ip': kwargs.get("ex_publicip", None), - 'admin_password': kwargs.get("ex_rootpass", None), - 'console_password': kwargs.get("ex_consolepass", None), - 'ssh_username': kwargs.get("ex_sshuser", None), - 'ssh_password': kwargs.get("ex_sshpass", None), - 'voxel_access': voxel_access, - } - - object = self.connection.request('/', params=params).object - - if self._getstatus(object): - return Node( - id = object.findtext("device/id"), - name = kwargs["name"], - state = NODE_STATE_MAP[object.findtext("device/status")], - public_ip = kwargs.get("publicip", None), - private_ip = kwargs.get("privateip", None), - driver = self.connection.driver - ) - else: - return None - - def reboot_node(self, node): - """ - Reboot the node by passing in the node object - """ - params = {'method': 'voxel.devices.power', - 'device_id': node.id, - 'power_action': 'reboot'} - return self._getstatus(self.connection.request('/', params=params).object) - - def destroy_node(self, node): - """ - Destroy node by passing in the node object - """ - params = {'method': 'voxel.voxcloud.delete', - 'device_id': node.id} - return self._getstatus(self.connection.request('/', params=params).object) - - def list_locations(self): - params = {"method": "voxel.voxcloud.facilities.list"} - result = self.connection.request('/', params=params).object - nodes = self._to_locations(result) - return nodes - - def _getstatus(self, element): - status = element.attrib["stat"] - return status == "ok" - - - def _to_locations(self, object): - return [NodeLocation(element.attrib["label"], - element.findtext("description"), - element.findtext("description"), - self) - for element in object.findall('facilities/facility')] - - def _to_nodes(self, object): - nodes = [] - for element in object.findall('devices/device'): - if element.findtext("type") == "Virtual Server": - try: - state = self.NODE_STATE_MAP[element.attrib['status']] - except KeyError: - state = NodeState.UNKNOWN - - public_ip = private_ip = None - ipassignments = element.findall("ipassignments/ipassignment") - for ip in ipassignments: - if ip.attrib["type"] =="frontend": - public_ip = ip.text - elif ip.attrib["type"] == "backend": - private_ip = ip.text - - nodes.append(Node(id= element.attrib['id'], - name=element.attrib['label'], - state=state, - public_ip= public_ip, - private_ip= private_ip, - driver=self.connection.driver)) - return nodes - - def _to_images(self, object): - images = [] - for element in object.findall("images/image"): - images.append(NodeImage(id = element.attrib["id"], - name = element.attrib["summary"], - driver = self.connection.driver)) - return images diff --git a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/drivers/vpsnet.py b/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/drivers/vpsnet.py deleted file mode 100644 index 96664284a29de1dcb1a67d204d26265ed21125fc..0000000000000000000000000000000000000000 --- a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/drivers/vpsnet.py +++ /dev/null @@ -1,184 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -""" -VPS.net driver -""" -import base64 - -try: - import json -except: - import simplejson as json - -from libcloud.common.base import ConnectionUserAndKey, Response -from libcloud.common.types import InvalidCredsError -from libcloud.compute.providers import Provider -from libcloud.compute.types import NodeState -from libcloud.compute.base import Node, NodeDriver -from libcloud.compute.base import NodeSize, NodeImage, NodeLocation - -API_HOST = 'api.vps.net' -API_VERSION = 'api10json' - -RAM_PER_NODE = 256 -DISK_PER_NODE = 10 -BANDWIDTH_PER_NODE = 250 - - -class VPSNetResponse(Response): - - def parse_body(self): - try: - js = json.loads(self.body) - return js - except ValueError: - return self.body - - def success(self): - # vps.net wrongly uses 406 for invalid auth creds - if self.status == 406 or self.status == 403: - raise InvalidCredsError() - return True - - def parse_error(self): - try: - errors = json.loads(self.body)['errors'][0] - except ValueError: - return self.body - else: - return "\n".join(errors) - -class VPSNetConnection(ConnectionUserAndKey): - """ - Connection class for the VPS.net driver - """ - - host = API_HOST - responseCls = VPSNetResponse - - def add_default_headers(self, headers): - user_b64 = base64.b64encode('%s:%s' % (self.user_id, self.key)) - headers['Authorization'] = 'Basic %s' % (user_b64) - return headers - -class VPSNetNodeDriver(NodeDriver): - """ - VPS.net node driver - """ - - type = Provider.VPSNET - api_name = 'vps_net' - name = "vps.net" - connectionCls = VPSNetConnection - - def _to_node(self, vm): - if vm['running']: - state = NodeState.RUNNING - else: - state = NodeState.PENDING - - n = Node(id=vm['id'], - name=vm['label'], - state=state, - public_ip=[vm.get('primary_ip_address', None)], - private_ip=[], - extra={'slices_count':vm['slices_count']}, # Number of nodes consumed by VM - driver=self.connection.driver) - return n - - def _to_image(self, image, cloud): - image = NodeImage(id=image['id'], - name="%s: %s" % (cloud, image['label']), - driver=self.connection.driver) - - return image - - def _to_size(self, num): - size = NodeSize(id=num, - name="%d Node" % (num,), - ram=RAM_PER_NODE * num, - disk=DISK_PER_NODE, - bandwidth=BANDWIDTH_PER_NODE * num, - price=self._get_price_per_node(num) * num, - driver=self.connection.driver) - return size - - def _get_price_per_node(self, num): - single_node_price = self._get_size_price(size_id='1') - return num * single_node_price - - def create_node(self, name, image, size, **kwargs): - """Create a new VPS.net node - - See L{NodeDriver.create_node} for more keyword args. - @keyword ex_backups_enabled: Enable automatic backups - @type ex_backups_enabled: C{bool} - - @keyword ex_fqdn: Fully Qualified domain of the node - @type ex_fqdn: C{string} - """ - headers = {'Content-Type': 'application/json'} - request = {'virtual_machine': - {'label': name, - 'fqdn': kwargs.get('ex_fqdn', ''), - 'system_template_id': image.id, - 'backups_enabled': kwargs.get('ex_backups_enabled', 0), - 'slices_required': size.id}} - - res = self.connection.request('/virtual_machines.%s' % (API_VERSION,), - data=json.dumps(request), - headers=headers, - method='POST') - node = self._to_node(res.object['virtual_machine']) - return node - - def reboot_node(self, node): - res = self.connection.request('/virtual_machines/%s/%s.%s' % - (node.id, 'reboot', API_VERSION), - method="POST") - node = self._to_node(res.object['virtual_machine']) - return True - - def list_sizes(self, location=None): - res = self.connection.request('/nodes.%s' % (API_VERSION,)) - available_nodes = len([size for size in res.object - if size['slice']['virtual_machine_id']]) - sizes = [self._to_size(i) for i in range(1, available_nodes + 1)] - return sizes - - def destroy_node(self, node): - res = self.connection.request('/virtual_machines/%s.%s' - % (node.id, API_VERSION), - method='DELETE') - return res.status == 200 - - def list_nodes(self): - res = self.connection.request('/virtual_machines.%s' % (API_VERSION,)) - return [self._to_node(i['virtual_machine']) for i in res.object] - - def list_images(self, location=None): - res = self.connection.request('/available_clouds.%s' % (API_VERSION,)) - - images = [] - for cloud in res.object: - label = cloud['cloud']['label'] - templates = cloud['cloud']['system_templates'] - images.extend([self._to_image(image, label) - for image in templates]) - - return images - - def list_locations(self): - return [NodeLocation(0, "VPS.net Western US", 'US', self)] diff --git a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/providers.py b/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/providers.py deleted file mode 100644 index b5833f2f20baab35dc367eeb4eb31dd0d7b0ec40..0000000000000000000000000000000000000000 --- a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/providers.py +++ /dev/null @@ -1,91 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -""" -Provider related utilities -""" - -from libcloud.utils import get_driver as _get_provider_driver -from libcloud.compute.types import Provider - -__all__ = [ - "Provider", - "DRIVERS", - "get_driver"] - -DRIVERS = { - Provider.DUMMY: - ('libcloud.compute.drivers.dummy', 'DummyNodeDriver'), - Provider.EC2_US_EAST: - ('libcloud.compute.drivers.ec2', 'EC2NodeDriver'), - Provider.EC2_EU_WEST: - ('libcloud.compute.drivers.ec2', 'EC2EUNodeDriver'), - Provider.EC2_US_WEST: - ('libcloud.compute.drivers.ec2', 'EC2USWestNodeDriver'), - Provider.EC2_AP_SOUTHEAST: - ('libcloud.compute.drivers.ec2', 'EC2APSENodeDriver'), - Provider.EC2_AP_NORTHEAST: - ('libcloud.compute.drivers.ec2', 'EC2APNENodeDriver'), - Provider.ECP: - ('libcloud.compute.drivers.ecp', 'ECPNodeDriver'), - Provider.ELASTICHOSTS_UK1: - ('libcloud.compute.drivers.elastichosts', 'ElasticHostsUK1NodeDriver'), - Provider.ELASTICHOSTS_UK2: - ('libcloud.compute.drivers.elastichosts', 'ElasticHostsUK2NodeDriver'), - Provider.ELASTICHOSTS_US1: - ('libcloud.compute.drivers.elastichosts', 'ElasticHostsUS1NodeDriver'), - Provider.CLOUDSIGMA: - ('libcloud.compute.drivers.cloudsigma', 'CloudSigmaZrhNodeDriver'), - Provider.GOGRID: - ('libcloud.compute.drivers.gogrid', 'GoGridNodeDriver'), - Provider.RACKSPACE: - ('libcloud.compute.drivers.rackspace', 'RackspaceNodeDriver'), - Provider.RACKSPACE_UK: - ('libcloud.compute.drivers.rackspace', 'RackspaceUKNodeDriver'), - Provider.SLICEHOST: - ('libcloud.compute.drivers.slicehost', 'SlicehostNodeDriver'), - Provider.VPSNET: - ('libcloud.compute.drivers.vpsnet', 'VPSNetNodeDriver'), - Provider.LINODE: - ('libcloud.compute.drivers.linode', 'LinodeNodeDriver'), - Provider.RIMUHOSTING: - ('libcloud.compute.drivers.rimuhosting', 'RimuHostingNodeDriver'), - Provider.VOXEL: - ('libcloud.compute.drivers.voxel', 'VoxelNodeDriver'), - Provider.SOFTLAYER: - ('libcloud.compute.drivers.softlayer', 'SoftLayerNodeDriver'), - Provider.EUCALYPTUS: - ('libcloud.compute.drivers.ec2', 'EucNodeDriver'), - Provider.IBM: - ('libcloud.compute.drivers.ibm_sbc', 'IBMNodeDriver'), - Provider.OPENNEBULA: - ('libcloud.compute.drivers.opennebula', 'OpenNebulaNodeDriver'), - Provider.DREAMHOST: - ('libcloud.compute.drivers.dreamhost', 'DreamhostNodeDriver'), - Provider.BRIGHTBOX: - ('libcloud.compute.drivers.brightbox', 'BrightboxNodeDriver'), - Provider.NIMBUS: - ('libcloud.compute.drivers.ec2', 'NimbusNodeDriver'), - Provider.BLUEBOX: - ('libcloud.compute.drivers.bluebox', 'BlueboxNodeDriver'), - Provider.GANDI: - ('libcloud.compute.drivers.gandi', 'GandiNodeDriver'), - Provider.OPSOURCE: - ('libcloud.compute.drivers.opsource', 'OpsourceNodeDriver'), - Provider.OPENSTACK: - ('libcloud.compute.drivers.rackspace', 'OpenStackNodeDriver'), -} - -def get_driver(provider): - return _get_provider_driver(DRIVERS, provider) diff --git a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/ssh.py b/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/ssh.py deleted file mode 100644 index e39685b382a59e1e87632bbf5adc3161b440cfcb..0000000000000000000000000000000000000000 --- a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/ssh.py +++ /dev/null @@ -1,194 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" -Wraps multiple ways to communicate over SSH -""" -have_paramiko = False - -try: - import paramiko - have_paramiko = True -except ImportError: - pass - -# Depending on your version of Paramiko, it may cause a deprecation -# warning on Python 2.6. -# Ref: https://bugs.launchpad.net/paramiko/+bug/392973 - -from os.path import split as psplit - -class BaseSSHClient(object): - """ - Base class representing a connection over SSH/SCP to a remote node. - """ - - def __init__(self, hostname, port=22, username='root', password=None, - key=None, timeout=None): - """ - @type hostname: C{str} - @keyword hostname: Hostname or IP address to connect to. - - @type port: C{int} - @keyword port: TCP port to communicate on, defaults to 22. - - @type username: C{str} - @keyword username: Username to use, defaults to root. - - @type password: C{str} - @keyword password: Password to authenticate with. - - @type key: C{list} - @keyword key: Private SSH keys to authenticate with. - """ - self.hostname = hostname - self.port = port - self.username = username - self.password = password - self.key = key - self.timeout = timeout - - def connect(self): - """ - Connect to the remote node over SSH. - - @return: C{bool} - """ - raise NotImplementedError, \ - 'connect not implemented for this ssh client' - - def put(self, path, contents=None, chmod=None): - """ - Upload a file to the remote node. - - @type path: C{str} - @keyword path: File path on the remote node. - - @type contents: C{str} - @keyword contents: File Contents. - - @type chmod: C{int} - @keyword chmod: chmod file to this after creation. - """ - raise NotImplementedError, \ - 'put not implemented for this ssh client' - - def delete(self, path): - """ - Delete/Unlink a file on the remote node. - - @type path: C{str} - @keyword path: File path on the remote node. - """ - raise NotImplementedError, \ - 'delete not implemented for this ssh client' - - def run(self, cmd): - """ - Run a command on a remote node. - - @type cmd: C{str} - @keyword cmd: Command to run. - - @return C{list} of [stdout, stderr, exit_status] - """ - raise NotImplementedError, \ - 'run not implemented for this ssh client' - - def close(self): - """ - Shutdown connection to the remote node. - """ - raise NotImplementedError, \ - 'close not implemented for this ssh client' - -class ParamikoSSHClient(BaseSSHClient): - """ - A SSH Client powered by Paramiko. - """ - def __init__(self, hostname, port=22, username='root', password=None, - key=None, timeout=None): - super(ParamikoSSHClient, self).__init__(hostname, port, username, - password, key, timeout) - self.client = paramiko.SSHClient() - self.client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) - - def connect(self): - conninfo = {'hostname': self.hostname, - 'port': self.port, - 'username': self.username, - 'password': self.password, - 'allow_agent': False, - 'look_for_keys': False} - - if self.timeout: - conninfo['timeout'] = self.timeout - - self.client.connect(**conninfo) - return True - - def put(self, path, contents=None, chmod=None): - sftp = self.client.open_sftp() - # less than ideal, but we need to mkdir stuff otherwise file() fails - head, tail = psplit(path) - if path[0] == "/": - sftp.chdir("/") - for part in head.split("/"): - if part != "": - try: - sftp.mkdir(part) - except IOError: - # so, there doesn't seem to be a way to - # catch EEXIST consistently *sigh* - pass - sftp.chdir(part) - ak = sftp.file(tail, mode='w') - ak.write(contents) - if chmod is not None: - ak.chmod(chmod) - ak.close() - sftp.close() - - def delete(self, path): - sftp = self.client.open_sftp() - sftp.unlink(path) - sftp.close() - - def run(self, cmd): - # based on exec_command() - bufsize = -1 - t = self.client.get_transport() - chan = t.open_session() - chan.exec_command(cmd) - stdin = chan.makefile('wb', bufsize) - stdout = chan.makefile('rb', bufsize) - stderr = chan.makefile_stderr('rb', bufsize) - #stdin, stdout, stderr = self.client.exec_command(cmd) - stdin.close() - status = chan.recv_exit_status() - so = stdout.read() - se = stderr.read() - return [so, se, status] - - def close(self): - self.client.close() - -class ShellOutSSHClient(BaseSSHClient): - # TODO: write this one - pass - -SSHClient = ParamikoSSHClient -if not have_paramiko: - SSHClient = ShellOutSSHClient diff --git a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/types.py b/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/types.py deleted file mode 100644 index 573038629d4b2210fca49caee5366cbbb4eb3364..0000000000000000000000000000000000000000 --- a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/compute/types.py +++ /dev/null @@ -1,122 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -""" -Base types used by other parts of libcloud -""" - -from libcloud.common.types import LibcloudError, MalformedResponseError -from libcloud.common.types import InvalidCredsError, InvalidCredsException -__all__ = [ - "Provider", - "NodeState", - "DeploymentError", - "DeploymentException", - - # @@TR: should the unused imports below be exported? - "LibcloudError", - "MalformedResponseError", - "InvalidCredsError", - "InvalidCredsException" - ] -class Provider(object): - """ - Defines for each of the supported providers - - @cvar DUMMY: Example provider - @cvar EC2_US_EAST: Amazon AWS US N. Virgina - @cvar EC2_US_WEST: Amazon AWS US N. California - @cvar EC2_EU_WEST: Amazon AWS EU Ireland - @cvar RACKSPACE: Rackspace Cloud Servers - @cvar RACKSPACE_UK: Rackspace UK Cloud Servers - @cvar SLICEHOST: Slicehost.com - @cvar GOGRID: GoGrid - @cvar VPSNET: VPS.net - @cvar LINODE: Linode.com - @cvar VCLOUD: vmware vCloud - @cvar RIMUHOSTING: RimuHosting.com - @cvar ECP: Enomaly - @cvar IBM: IBM Developer Cloud - @cvar OPENNEBULA: OpenNebula.org - @cvar DREAMHOST: DreamHost Private Server - @cvar CLOUDSIGMA: CloudSigma - @cvar NIMBUS: Nimbus - @cvar BLUEBOX: Bluebox - @cvar OPSOURCE: Opsource Cloud - """ - DUMMY = 0 - EC2 = 1 # deprecated name - EC2_US_EAST = 1 - EC2_EU = 2 # deprecated name - EC2_EU_WEST = 2 - RACKSPACE = 3 - SLICEHOST = 4 - GOGRID = 5 - VPSNET = 6 - LINODE = 7 - VCLOUD = 8 - RIMUHOSTING = 9 - EC2_US_WEST = 10 - VOXEL = 11 - SOFTLAYER = 12 - EUCALYPTUS = 13 - ECP = 14 - IBM = 15 - OPENNEBULA = 16 - DREAMHOST = 17 - ELASTICHOSTS = 18 - ELASTICHOSTS_UK1 = 19 - ELASTICHOSTS_UK2 = 20 - ELASTICHOSTS_US1 = 21 - EC2_AP_SOUTHEAST = 22 - RACKSPACE_UK = 23 - BRIGHTBOX = 24 - CLOUDSIGMA = 25 - EC2_AP_NORTHEAST = 26 - NIMBUS = 27 - BLUEBOX = 28 - GANDI = 29 - OPSOURCE = 30 - OPENSTACK = 31 - -class NodeState(object): - """ - Standard states for a node - - @cvar RUNNING: Node is running - @cvar REBOOTING: Node is rebooting - @cvar TERMINATED: Node is terminated - @cvar PENDING: Node is pending - @cvar UNKNOWN: Node state is unknown - """ - RUNNING = 0 - REBOOTING = 1 - TERMINATED = 2 - PENDING = 3 - UNKNOWN = 4 - -class DeploymentError(LibcloudError): - """ - Exception used when a Deployment Task failed. - - @ivar node: L{Node} on which this exception happened, you might want to call L{Node.destroy} - """ - def __init__(self, node, original_exception=None): - self.node = node - self.value = original_exception - def __str__(self): - return repr(self.value) - -"""Deprecated alias of L{DeploymentException}""" -DeploymentException = DeploymentError diff --git a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/data/pricing.json b/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/data/pricing.json deleted file mode 100644 index 31554b9c1bfb3db168f445b02e6c5cc9ba41b7ed..0000000000000000000000000000000000000000 --- a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/data/pricing.json +++ /dev/null @@ -1,132 +0,0 @@ -{ - "bluebox": { - "1gb": 0.15, - "2gb": 0.25, - "4gb": 0.35, - "8gb": 0.45 - }, - - "rackspace": { - "1": 0.015, - "2": 0.030, - "3": 0.060, - "4": 0.120, - "5": 0.240, - "6": 0.480, - "7": 0.960 - }, - - "dreamhost": { - "minimum": 15, - "maximum": 200, - "default": 115, - "low": 50, - "high": 150 - }, - - "ec2_us_east": { - "t1.micro": 0.02, - "m1.small": 0.085, - "m1.large": 0.34, - "m1.xlarge": 0.68, - "c1.medium": 0.17, - "c1.xlarge": 0.68, - "m2.xlarge": 0.50, - "m2.2xlarge": 1.0, - "m2.4xlarge": 2.0, - "cg1.4xlarge": 2.1, - "cc1.4xlarge": 1.6 - }, - - "ec2_us_west": { - "t1.micro": 0.025, - "m1.small": 0.095, - "m1.large": 0.38, - "m1.xlarge": 0.76, - "c1.medium": 0.19, - "c1.xlarge": 0.76, - "m2.xlarge": 0.57, - "m2.2xlarge": 1.14, - "m2.4xlarge": 2.28 - }, - - "ec2_eu_west": { - "t1.micro": 0.025, - "m1.small": 0.095, - "m1.large": 0.38, - "m1.xlarge": 0.76, - "c1.medium": 0.19, - "c1.xlarge": 0.76, - "m2.xlarge": 0.57, - "m2.2xlarge": 1.14, - "m2.4xlarge": 2.28 - }, - - "ec2_ap_southeast": { - "t1.micro": 0.025, - "m1.small": 0.095, - "m1.large": 0.38, - "m1.xlarge": 0.76, - "c1.medium": 0.19, - "c1.xlarge": 0.76, - "m2.xlarge": 0.57, - "m2.2xlarge": 1.14, - "m2.4xlarge": 2.28 - }, - - "ec2_ap_northeast": { - "t1.micro": 0.027, - "m1.small": 0.10, - "m1.large": 0.40, - "m1.xlarge": 0.80, - "c1.medium": 0.20, - "c1.xlarge": 0.80, - "m2.xlarge": 0.60, - "m2.2xlarge": 1.20, - "m2.4xlarge": 2.39 - }, - - "nimbus" : { - "m1.small": 0.0, - "m1.large": 0.0, - "m1.xlarge": 0.0 - }, - - "cloudsigma_zrh": { - "micro-regular": 0.0548, - "micro-high-cpu": 0.381, - "standard-small": 0.0796, - "standard-large": 0.381, - "standard-extra-large": 0.762, - "high-memory-extra-large": 0.642, - "high-memory-double-extra-large": 1.383, - "high-cpu-medium": 0.211, - "high-cpu-extra-large": 0.780 - }, - - "elastichosts": { - "small": 0.100, - "medium": 0.223, - "large": 0.378, - "extra-large": 0.579, - "high-cpu-medium": 0.180, - "high-cpu-extra-large": 0.770 - }, - - "gogrid": { - "512MB": 0.095, - "1GB": 0.19, - "2GB": 0.38, - "4GB": 0.76, - "8GB": 1.52, - "16GB": 3.04 - }, - - "gandi": { - "1": 0.02 - }, - - "vps_net": { - "1": 0.416 - } -} diff --git a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/deployment.py b/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/deployment.py deleted file mode 100644 index cbf51c826714c3041b52f74f57fc3c688b05b1fc..0000000000000000000000000000000000000000 --- a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/deployment.py +++ /dev/null @@ -1,31 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from libcloud.utils import deprecated_warning -from libcloud.compute.deployment import ( # pylint: disable-msg=W0611 - Deployment, - SSHKeyDeployment, - ScriptDeployment, - MultiStepDeployment - ) - -__all__ = [ - "Deployment", - "SSHKeyDeployment", - "ScriptDeployment", - "MultiStepDeployment" - ] - -deprecated_warning(__name__) diff --git a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/drivers/__init__.py b/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/drivers/__init__.py deleted file mode 100644 index b4fc782dc8b4bdd7e7d26273d5edf327f9a87782..0000000000000000000000000000000000000000 --- a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/drivers/__init__.py +++ /dev/null @@ -1,38 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" -Drivers for working with different providers -""" - -__all__ = [ - 'brightbox', - 'dummy', - 'ec2', - 'ecp', - 'elastichosts', - 'cloudsigma', - 'gogrid', - 'ibm_sbc', - 'linode', - 'opennebula', - 'rackspace', - 'rimuhosting', - 'slicehost', - 'softlayer', - 'vcloud', - 'voxel', - 'vpsnet' -] diff --git a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/drivers/brightbox.py b/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/drivers/brightbox.py deleted file mode 100644 index ea99d035967cf61554a862a0f5657c59b9940add..0000000000000000000000000000000000000000 --- a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/drivers/brightbox.py +++ /dev/null @@ -1,19 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from libcloud.utils import deprecated_warning -from libcloud.compute.drivers.brightbox import * - -deprecated_warning(__name__) diff --git a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/drivers/cloudsigma.py b/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/drivers/cloudsigma.py deleted file mode 100644 index f4587fc32dbdf435d2e162c2cf92751885776aa3..0000000000000000000000000000000000000000 --- a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/drivers/cloudsigma.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from libcloud.utils import deprecated_warning - -from libcloud.compute.drivers.cloudsigma import * - -deprecated_warning(__name__) diff --git a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/drivers/dreamhost.py b/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/drivers/dreamhost.py deleted file mode 100644 index beeb37c67725151b8b1bf27b65c9f37b0dd9950c..0000000000000000000000000000000000000000 --- a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/drivers/dreamhost.py +++ /dev/null @@ -1,19 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from libcloud.utils import deprecated_warning -from libcloud.compute.drivers.dreamhost import * - -deprecated_warning(__name__) diff --git a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/drivers/dummy.py b/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/drivers/dummy.py deleted file mode 100644 index 2b1a645623bc090e563ba778c4a75c96f730ff45..0000000000000000000000000000000000000000 --- a/conpaas/branches/Y1DEMO-conpaassql/contrib/libcloud/drivers/dummy.py +++ /dev/null @@ -1,19 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from libcloud.utils import deprecated_warning -from libcloud.compute.drivers.dummy import * - -deprecated_w