1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-01-24 02:03:52 +03:00

B #1821: Updated xml schemas (#1895)

This commit is contained in:
juanmont 2018-03-23 15:58:36 +01:00 committed by Tino Vázquez
parent ad21ba15d7
commit 4f94b8099f
61 changed files with 3850 additions and 17 deletions

View File

@ -149,6 +149,7 @@
<xs:element name="SNAPSHOTS" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="ALLOW_ORPHANS" type="xs:string"/>
<xs:element name="DISK_ID" type="xs:integer"/>
<xs:element name="SNAPSHOT" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>

View File

@ -9,6 +9,16 @@
<xs:element name="UNAME" type="xs:string"/>
<xs:element name="GNAME" type="xs:string"/>
<xs:element name="NAME" type="xs:string"/>
<xs:element name="LOCK" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="LOCKED" type="xs:integer"/>
<xs:element name="OWNER" type="xs:integer"/>
<xs:element name="TIME" type="xs:integer"/>
<xs:element name="REQ_ID" type="xs:integer"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="PERMISSIONS" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
@ -78,7 +88,7 @@
<xs:element name="SNAPSHOTS">
<xs:complexType>
<xs:sequence>
<xs:element name="ALLOW_ORPHANS" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="ALLOW_ORPHANS" type="xs:string"/>
<xs:element name="SNAPSHOT" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>

View File

@ -9,6 +9,16 @@
<xs:element name="GID" type="xs:integer"/>
<xs:element name="UNAME" type="xs:string"/>
<xs:element name="GNAME" type="xs:string"/>
<xs:element name="LOCK" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="LOCKED" type="xs:integer"/>
<xs:element name="OWNER" type="xs:integer"/>
<xs:element name="TIME" type="xs:integer"/>
<xs:element name="REQ_ID" type="xs:integer"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="REGTIME" type="xs:integer"/>
<xs:element name="NAME" type="xs:string"/>
<xs:element name="ZONE_ID" type="xs:string"/>

View File

@ -845,6 +845,7 @@ INHERIT_DATASTORE_ATTR = "POOL_NAME"
INHERIT_DATASTORE_ATTR = "ISCSI_USER"
INHERIT_DATASTORE_ATTR = "ISCSI_USAGE"
INHERIT_DATASTORE_ATTR = "ISCSI_HOST"
INHERIT_DATASTORE_ATTR = "ALLOW_ORPHANS"
INHERIT_IMAGE_ATTR = "ISCSI_USER"
INHERIT_IMAGE_ATTR = "ISCSI_USAGE"
@ -910,7 +911,7 @@ INHERIT_VNET_ATTR = "VCENTER_INSTANCE_ID"
TM_MAD_CONF = [
NAME = "dummy", LN_TARGET = "NONE", CLONE_TARGET = "SYSTEM", SHARED = "YES",
DS_MIGRATE = "YES"
DS_MIGRATE = "YES", ALLOW_ORPHANS = "no"
]
TM_MAD_CONF = [

View File

@ -1,7 +1,7 @@
#!/bin/bash
# -------------------------------------------------------------------------- #
# Copyright 2002-2018, OpenNebula Project, OpenNebula Systems #
# Copyright 2002-2017, OpenNebula Project, OpenNebula Systems #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
# not use this file except in compliance with the License. You may obtain #
@ -26,17 +26,22 @@ mkdir -p samples/vmtemplate samples/vmtemplate_pool
mkdir -p samples/user samples/user_pool
mkdir -p samples/vm samples/vm_pool
mkdir -p samples/vnet samples/vnet_pool
mkdir -p samples/vm_group samples/vm_group_pool
mkdir -p samples/acct
mkdir -p samples/vrouter samples/vrouter_pool
mkdir -p samples/marketplace samples/marketplace_pool
mkdir -p samples/marketplaceapp samples/marketplaceapp_pool
touch output.log
cp oned.conf /etc/one/oned.conf
echo "Creating new cluster..." >> output.log
onecluster create newcluster
echo "Creating new group..." >> output.log
onegroup create newgroup
# Host
echo "Creating new hosts..." >> output.log
onehost create host01 --im dummy --vm dummy
onehost create host02 --im dummy --vm dummy
onehost create host03 --im dummy --vm dummy
@ -54,6 +59,7 @@ onehost list -x > samples/host_pool/0.xml
# VNets
echo "Creating new vnets..." >> output.log
onevnet list -x > samples/vnet_pool/1.xml
onevnet create test/vnet.0
@ -63,9 +69,11 @@ onevnet list -x > samples/vnet_pool/2.xml
onevnet create test/vnet.1
onevnet create test/vnet.2
echo "Adding vnets to cluster..." >> output.log
onecluster addvnet newcluster 0
onecluster addvnet newcluster 2
echo "Reserving vnet..." >> output.log
onevnet reserve 1 --address_range 1 --size 2 --name reserve
for i in `onevnet list | tail -n +2 | tr -s ' ' | cut -f2 -d ' '`; do
@ -75,6 +83,7 @@ done
onevnet list -x > samples/vnet_pool/3.xml
# Cluster
echo "Creating new empty cluster..." >> output.log
onecluster create emptycluster
for i in `onecluster list | tail -n +2 | tr -s ' ' | cut -f2 -d ' '`; do
@ -85,6 +94,7 @@ onecluster list -x > samples/cluster_pool/0.xml
# Image
echo "Creating new images..." >> output.log
oneimage list -x > samples/image_pool/1.xml
oneimage create test/image.0 -d default
@ -98,9 +108,11 @@ oneimage list -x > samples/image_pool/3.xml
# Datastore
echo "Creating new datastores..." >> output.log
onedatastore create test/datastore.0
onedatastore create test/datastore.1
echo "Adding datastores to cluster..." >> output.log
onecluster adddatastore newcluster 100
onecluster adddatastore newcluster 101
@ -112,14 +124,16 @@ onedatastore list -x > samples/datastore_pool/0.xml
# User
echo "Creating new users..." >> output.log
oneuser defaultquota test/quota.txt
oneuser create newuser abc
oneuser chgrp newuser newgroup
oneuser token-create --user newuser --password abc --time 123
oneuser token-create --user newuser --password abc --time 456
oneuser token-create --user newuser --password abc --time 789
echo "Creating token for an user..." >> output.log
echo "no" | oneuser token-create --user newuser --password abc --time 123
echo "no" | oneuser token-create --user newuser --password abc --time 456
echo "no" | oneuser token-create --user newuser --password abc --time 789
for i in `oneuser list | tail -n +2 | tr -s ' ' | cut -f2 -d ' '`; do
oneuser show $i -x > samples/user/$i.xml
@ -129,6 +143,7 @@ oneuser list -x > samples/user_pool/0.xml
# Group
echo "Creating new empty group..." >> output.log
onegroup defaultquota test/quota.txt
onegroup create emptygroup
@ -140,11 +155,15 @@ done
onegroup list -x > samples/group_pool/0.xml
# VDC
echo "Creating new empty vdc..." >> output.log
onevdc create emptyvdc
onevdc create newvdc
echo "Adding group to vnc..." >> output.log
onevdc addgroup newvdc newgroup
echo "Adding host to vnc..." >> output.log
onevdc addhost newvdc 0 host01
echo "Adding cluster to vnc..." >> output.log
onevdc addcluster newvdc 0 newcluster
for i in `onevdc list | tail -n +2 | tr -s ' ' | cut -f2 -d ' '`; do
@ -155,6 +174,7 @@ onevdc list -x > samples/vdc_pool/0.xml
# Template
echo "Creating new template..." >> output.log
onetemplate list -x > samples/vmtemplate_pool/1.xml
onetemplate create test/template.0 --user newuser --password abc
@ -168,11 +188,12 @@ done
onetemplate list -x > samples/vmtemplate_pool/2.xml
# VM
echo "Instantiating a template..." >> output.log
onetemplate instantiate 0 -m 2 --user newuser --password abc
onetemplate instantiate 1 -m 2 --user newuser --password abc
# Virtual Routers
echo "Creating new vrouters..." >> output.log
onevrouter create test/vr.0
onevrouter instantiate 0 vr-tmpl -m 2
@ -182,13 +203,25 @@ done
sleep 5
echo "Executing action with a vm..." >> output.log
onevm migrate --live 0 host02
onevm terminate --hard 1
onevm poweroff 2
onevm poweroff 0
sleep 5
onevm suspend 0
onevm snapshot-create 0
sleep 5
onevm resume 0
sleep 5
onevm disk-attach 0 -i 1
onevm disk-snapshot-create 0 0 disk_snapshot
onevm resume 2
sleep 5
@ -205,6 +238,7 @@ done
onevrouter list -x > samples/vrouter_pool/0.xml
echo "Working with markets..." >> output.log
# Marketplace
for i in `onemarket list | tail -n +2 | tr -s ' ' | cut -f2 -d ' '`; do
@ -221,7 +255,20 @@ done
onemarketapp list -x > samples/marketplaceapp_pool/0.xml
for i in cluster datastore group vdc host image vmtemplate user vm vnet vrouter marketplace marketplaceapp
# VMGroups
echo "Creating new vmgroups..." >> output.log
onevmgroup list -x > samples/vm_group_pool/1.xml
onevmgroup create test/vm_group.0
onevmgroup list -x > samples/vm_group_pool/2.xml
for i in `onevmgroup list | tail -n +2 | tr -s ' ' | cut -f2 -d ' '`; do
onevmgroup show $i -x > samples/vm_group/$i.xml
done
echo "Executing xmllint..." >> output.log
for i in cluster datastore group vdc host image vmtemplate user vm vnet vrouter marketplace marketplaceapp vm_group
do
POOL_NAME="$i""_pool"
@ -229,16 +276,15 @@ do
sed -i "s%<${i^^}_POOL/>%<${i^^}_POOL xmlns='http://opennebula.org/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://opennebula.org/XMLSchema ../../$POOL_NAME.xsd'/>%" samples/$POOL_NAME/*.xml
sed -i "s%<${i^^}_POOL>%<${i^^}_POOL xmlns='http://opennebula.org/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://opennebula.org/XMLSchema ../../$POOL_NAME.xsd'>%" samples/$POOL_NAME/*.xml
xmllint --noout --schema $i.xsd samples/$i/*
xmllint --noout --schema $POOL_NAME.xsd samples/$POOL_NAME/*
xmllint --noout --schema $i.xsd samples/$i/* >> output.log 2>&1
xmllint --noout --schema $POOL_NAME.xsd samples/$POOL_NAME/* >> output.log 2>&1
done
# Accounting
oneacct -x > samples/acct/0.xml
sed -i "s%<HISTORY_RECORDS>%<HISTORY_RECORDS xmlns='http://opennebula.org/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://opennebula.org/XMLSchema ../../acct.xsd'>%" samples/acct/*.xml
xmllint --noout --schema acct.xsd samples/acct/*
xmllint --noout --schema acct.xsd samples/acct/* >> output.log 2>&1
exit 0

View File

@ -1,4 +1,45 @@
NAME = template1
CPU = 0.45
VCPU = 1
MEMORY = 512
MEMORY = 512
CONTEXT = [
NETWORK = "YES",
PASSWORD = "test",
SSH_PUBLIC_KEY = "$USER[SSH_PUBLIC_KEY]" ]
DISK = [
DEV_PREFIX = "vd",
DRIVER = "raw",
IMAGE_ID = "0" ]
DISK = [
DEV_PREFIX = "vd",
FORMAT = "raw",
READONLY = "yes",
SIZE = "1024",
TYPE = "fs" ]
DRIVER = "raw"
FEATURES = [
ACPI = "yes",
LOCALTIME = "yes" ]
FORMAT = "raw"
GRAPHICS = [
KEYMAP = "es",
LISTEN = "0.0.0.0",
PASSWD = "test",
TYPE = "VNC" ]
HYPERVISOR = "kvm"
IMAGE_ID = 0
INPUTS_ORDER = ""
LOGO = "images/logos/debian.png"
MEMORY_UNIT_COST = "MB"
NIC = [
NETWORK = "vnet_1",
NETWORK_UNAME = "oneadmin",
SECURITY_GROUPS = "0" ]
OS = [
ARCH = "x86_64",
BOOT = "" ]
READONLY = "yes"
SCHED_DS_REQUIREMENTS = "ID=\"0\""
SCHED_REQUIREMENTS = "ID=\"0\""
SIZE = 1
TYPE = "fs"

View File

@ -0,0 +1,3 @@
NAME = host-vm
ROLE = [ NAME="aff", HOST_AFFINED="0,4" ]
ROLE = [ NAME="anti", HOST_ANTI_AFFINED="2,3" ]

View File

@ -43,6 +43,16 @@
<xs:element name="STIME" type="xs:integer"/>
<xs:element name="ETIME" type="xs:integer"/>
<xs:element name="DEPLOY_ID" type="xs:string"/>
<xs:element name="LOCK" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="LOCKED" type="xs:integer"/>
<xs:element name="OWNER" type="xs:integer"/>
<xs:element name="TIME" type="xs:integer"/>
<xs:element name="REQ_ID" type="xs:integer"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="MONITORING">
<!--
<xs:complexType>
@ -147,6 +157,7 @@
<xs:element name="SNAPSHOTS" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="ALLOW_ORPHANS" type="xs:string"/>
<xs:element name="DISK_ID" type="xs:integer"/>
<xs:element name="SNAPSHOT" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>

View File

@ -0,0 +1,59 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
targetNamespace="http://opennebula.org/XMLSchema" xmlns="http://opennebula.org/XMLSchema">
<xs:element name="VM_GROUP">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:integer"/>
<xs:element name="UID" type="xs:integer"/>
<xs:element name="GID" type="xs:integer"/>
<xs:element name="UNAME" type="xs:string"/>
<xs:element name="GNAME" type="xs:string"/>
<xs:element name="NAME" type="xs:string"/>
<xs:element name="PERMISSIONS" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="OWNER_U" type="xs:integer"/>
<xs:element name="OWNER_M" type="xs:integer"/>
<xs:element name="OWNER_A" type="xs:integer"/>
<xs:element name="GROUP_U" type="xs:integer"/>
<xs:element name="GROUP_M" type="xs:integer"/>
<xs:element name="GROUP_A" type="xs:integer"/>
<xs:element name="OTHER_U" type="xs:integer"/>
<xs:element name="OTHER_M" type="xs:integer"/>
<xs:element name="OTHER_A" type="xs:integer"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="LOCK" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="LOCKED" type="xs:integer"/>
<xs:element name="OWNER" type="xs:integer"/>
<xs:element name="TIME" type="xs:integer"/>
<xs:element name="REQ_ID" type="xs:integer"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="ROLES" minOccurs="1" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="ROLE" maxOccurs="unbounded" minOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="HOST_AFFINED" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="HOST_ANTI_AFFINED" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="ID" type="xs:integer"/>
<xs:element name="NAME" type="xs:string"/>
<xs:element name="POLICY" type="xs:string" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="TEMPLATE" type="xs:anyType"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="unqualified"
targetNamespace="http://opennebula.org/XMLSchema" xmlns="http://opennebula.org/XMLSchema">
<xs:include schemaLocation="vm_group.xsd"/>
<xs:element name="VM_GROUP_POOL">
<xs:complexType>
<xs:sequence maxOccurs="1" minOccurs="1">
<xs:element ref="VM_GROUP" maxOccurs="unbounded" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

View File

@ -9,6 +9,16 @@
<xs:element name="UNAME" type="xs:string"/>
<xs:element name="GNAME" type="xs:string"/>
<xs:element name="NAME" type="xs:string"/>
<xs:element name="LOCK" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="LOCKED" type="xs:integer"/>
<xs:element name="OWNER" type="xs:integer"/>
<xs:element name="TIME" type="xs:integer"/>
<xs:element name="REQ_ID" type="xs:integer"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="PERMISSIONS" minOccurs="1" maxOccurs="1">
<xs:complexType>
<xs:sequence>

View File

@ -10,6 +10,16 @@
<xs:element name="UNAME" type="xs:string"/>
<xs:element name="GNAME" type="xs:string"/>
<xs:element name="NAME" type="xs:string"/>
<xs:element name="LOCK" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="LOCKED" type="xs:integer"/>
<xs:element name="OWNER" type="xs:integer"/>
<xs:element name="TIME" type="xs:integer"/>
<xs:element name="REQ_ID" type="xs:integer"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="PERMISSIONS" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
@ -36,8 +46,10 @@
<xs:element name="PARENT_NETWORK_ID" type="xs:string"/>
<xs:element name="VN_MAD" type="xs:string"/>
<xs:element name="PHYDEV" type="xs:string"/>
<xs:element name="VLAN_ID" type="xs:string"/>
<xs:element name="VLAN_ID" type="xs:string" minOccurs="0"/>
<xs:element name="OUTER_VLAN_ID" type="xs:string" minOccurs="0"/>
<xs:element name="VLAN_ID_AUTOMATIC" type="xs:string"/>
<xs:element name="OUTER_VLAN_ID_AUTOMATIC" type="xs:string"/>
<xs:element name="USED_LEASES" type="xs:integer"/>
<xs:element name="VROUTERS">
<xs:complexType>

View File

@ -40,8 +40,10 @@
<xs:element name="PARENT_NETWORK_ID" type="xs:string"/>
<xs:element name="VN_MAD" type="xs:string"/>
<xs:element name="PHYDEV" type="xs:string"/>
<xs:element name="VLAN_ID" type="xs:string"/>
<xs:element name="VLAN_ID" type="xs:string" minOccurs="0"/>
<xs:element name="OUTER_VLAN_ID" type="xs:string" minOccurs="0"/>
<xs:element name="VLAN_ID_AUTOMATIC" type="xs:string"/>
<xs:element name="OUTER_VLAN_ID_AUTOMATIC" type="xs:string"/>
<xs:element name="USED_LEASES" type="xs:integer"/>
<xs:element name="VROUTERS">
<xs:complexType>

View File

@ -25,6 +25,16 @@
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="LOCK" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="LOCKED" type="xs:integer"/>
<xs:element name="OWNER" type="xs:integer"/>
<xs:element name="TIME" type="xs:integer"/>
<xs:element name="REQ_ID" type="xs:integer"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="VMS">
<xs:complexType>
<xs:sequence>

View File

@ -0,0 +1,9 @@
These XML Schemas define the XMLs returned by OpenNebula's XML-RPC API.
The included XML samples are not actual responses from OpenNebula, as it does
not include the headers (namespace, schema location).
To learn more, please read the API reference documentation at
http://opennebula.org/documentation:documentation:api

176
share/doc/xsd/xsd/acct.xsd Normal file
View File

@ -0,0 +1,176 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
targetNamespace="http://opennebula.org/XMLSchema" xmlns="http://opennebula.org/XMLSchema">
<xs:element name="HISTORY_RECORDS">
<xs:complexType>
<xs:sequence maxOccurs="1" minOccurs="1">
<xs:element ref="HISTORY" maxOccurs="unbounded" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="HISTORY">
<xs:complexType>
<xs:sequence>
<xs:element name="OID" type="xs:integer"/>
<xs:element name="SEQ" type="xs:integer"/>
<xs:element name="HOSTNAME" type="xs:string"/>
<xs:element name="HID" type="xs:integer"/>
<xs:element name="CID" type="xs:integer"/>
<xs:element name="STIME" type="xs:integer"/>
<xs:element name="ETIME" type="xs:integer"/>
<xs:element name="VM_MAD" type="xs:string"/>
<xs:element name="TM_MAD" type="xs:string"/>
<xs:element name="DS_ID" type="xs:integer"/>
<xs:element name="PSTIME" type="xs:integer"/>
<xs:element name="PETIME" type="xs:integer"/>
<xs:element name="RSTIME" type="xs:integer"/>
<xs:element name="RETIME" type="xs:integer"/>
<xs:element name="ESTIME" type="xs:integer"/>
<xs:element name="EETIME" type="xs:integer"/>
<!-- ACTION values:
NONE_ACTION = 0
MIGRATE_ACTION = 1
LIVE_MIGRATE_ACTION = 2
SHUTDOWN_ACTION = 3
SHUTDOWN_HARD_ACTION = 4
UNDEPLOY_ACTION = 5
UNDEPLOY_HARD_ACTION = 6
HOLD_ACTION = 7
RELEASE_ACTION = 8
STOP_ACTION = 9
SUSPEND_ACTION = 10
RESUME_ACTION = 11
BOOT_ACTION = 12
DELETE_ACTION = 13
DELETE_RECREATE_ACTION = 14
REBOOT_ACTION = 15
REBOOT_HARD_ACTION = 16
RESCHED_ACTION = 17
UNRESCHED_ACTION = 18
POWEROFF_ACTION = 19
POWEROFF_HARD_ACTION = 20
DISK_ATTACH_ACTION = 21
DISK_DETACH_ACTION = 22
NIC_ATTACH_ACTION = 23
NIC_DETACH_ACTION = 24
DISK_SNAPSHOT_CREATE_ACTION = 25
DISK_SNAPSHOT_DELETE_ACTION = 26
TERMINATE_ACTION = 27
TERMINATE_HARD_ACTION = 28
DISK_RESIZE_ACTION = 29
DEPLOY_ACTION = 30
CHOWN_ACTION = 31
CHMOD_ACTION = 32
UPDATECONF_ACTION = 33
RENAME_ACTION = 34
RESIZE_ACTION = 35
UPDATE_ACTION = 36
SNAPSHOT_CREATE_ACTION = 37
SNAPSHOT_DELETE_ACTION = 38
SNAPSHOT_REVERT_ACTION = 39
DISK_SAVEAS_ACTION = 40
DISK_SNAPSHOT_REVERT_ACTION = 41
RECOVER_ACTION = 42
RETRY_ACTION = 43
MONITOR_ACTION = 44
-->
<xs:element name="ACTION" type="xs:integer"/>
<xs:element name="UID" type="xs:integer"/>
<xs:element name="GID" type="xs:integer"/>
<xs:element name="REQUEST_ID" type="xs:string"/>
<xs:element name="VM">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:integer"/>
<xs:element name="UID" type="xs:integer"/>
<xs:element name="GID" type="xs:integer"/>
<xs:element name="UNAME" type="xs:string"/>
<xs:element name="GNAME" type="xs:string"/>
<xs:element name="NAME" type="xs:string"/>
<xs:element name="PERMISSIONS" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="OWNER_U" type="xs:integer"/>
<xs:element name="OWNER_M" type="xs:integer"/>
<xs:element name="OWNER_A" type="xs:integer"/>
<xs:element name="GROUP_U" type="xs:integer"/>
<xs:element name="GROUP_M" type="xs:integer"/>
<xs:element name="GROUP_A" type="xs:integer"/>
<xs:element name="OTHER_U" type="xs:integer"/>
<xs:element name="OTHER_M" type="xs:integer"/>
<xs:element name="OTHER_A" type="xs:integer"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="LAST_POLL" type="xs:integer"/>
<!-- STATE values,
see http://docs.opennebula.org/stable/user/references/vm_states.html
-->
<xs:element name="STATE" type="xs:integer"/>
<!-- LCM_STATE values, this sub-state is relevant only when STATE is
ACTIVE (4)
see http://docs.opennebula.org/stable/user/references/vm_states.html
-->
<xs:element name="LCM_STATE" type="xs:integer"/>
<xs:element name="PREV_STATE" type="xs:integer"/>
<xs:element name="PREV_LCM_STATE" type="xs:integer"/>
<xs:element name="RESCHED" type="xs:integer"/>
<xs:element name="STIME" type="xs:integer"/>
<xs:element name="ETIME" type="xs:integer"/>
<xs:element name="DEPLOY_ID" type="xs:string"/>
<xs:element name="MONITORING">
<!--
<xs:complexType>
<xs:all>
<- Percentage of 1 CPU consumed (two fully consumed cpu is 200) ->
<xs:element name="CPU" type="xs:decimal" minOccurs="0" maxOccurs="1"/>
<- MEMORY consumption in kilobytes ->
<xs:element name="MEMORY" type="xs:integer" minOccurs="0" maxOccurs="1"/>
<- NETTX: Sent bytes to the network ->
<xs:element name="NETTX" type="xs:integer" minOccurs="0" maxOccurs="1"/>
<- NETRX: Received bytes from the network ->
<xs:element name="NETRX" type="xs:integer" minOccurs="0" maxOccurs="1"/>
</xs:all>
</xs:complexType>
-->
</xs:element>
<xs:element name="TEMPLATE" type="xs:anyType"/>
<xs:element name="USER_TEMPLATE" type="xs:anyType"/>
<xs:element name="HISTORY_RECORDS">
</xs:element>
<xs:element name="SNAPSHOTS" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="ALLOW_ORPHANS" type="xs:string"/>
<xs:element name="DISK_ID" type="xs:integer"/>
<xs:element name="SNAPSHOT" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="ACTIVE" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="CHILDREN" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="DATE" type="xs:integer"/>
<xs:element name="ID" type="xs:integer"/>
<xs:element name="NAME" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="PARENT" type="xs:integer"/>
<xs:element name="SIZE" type="xs:integer"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

View File

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
targetNamespace="http://opennebula.org/XMLSchema" xmlns="http://opennebula.org/XMLSchema">
<xs:element name="CLUSTER">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:integer"/>
<xs:element name="NAME" type="xs:string"/>
<xs:element name="HOSTS">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:integer" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="DATASTORES">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:integer" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="VNETS">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:integer" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="TEMPLATE" type="xs:anyType"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
targetNamespace="http://opennebula.org/XMLSchema" xmlns="http://opennebula.org/XMLSchema">
<xs:include schemaLocation="cluster.xsd"/>
<xs:element name="CLUSTER_POOL">
<xs:complexType>
<xs:sequence maxOccurs="1" minOccurs="1">
<xs:element ref="CLUSTER" maxOccurs="unbounded" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

View File

@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://opennebula.org/XMLSchema" elementFormDefault="qualified" targetNamespace="http://opennebula.org/XMLSchema">
<xs:element name="DATASTORE">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:integer"/>
<xs:element name="UID" type="xs:integer"/>
<xs:element name="GID" type="xs:integer"/>
<xs:element name="UNAME" type="xs:string"/>
<xs:element name="GNAME" type="xs:string"/>
<xs:element name="NAME" type="xs:string"/>
<xs:element name="PERMISSIONS" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="OWNER_U" type="xs:integer"/>
<xs:element name="OWNER_M" type="xs:integer"/>
<xs:element name="OWNER_A" type="xs:integer"/>
<xs:element name="GROUP_U" type="xs:integer"/>
<xs:element name="GROUP_M" type="xs:integer"/>
<xs:element name="GROUP_A" type="xs:integer"/>
<xs:element name="OTHER_U" type="xs:integer"/>
<xs:element name="OTHER_M" type="xs:integer"/>
<xs:element name="OTHER_A" type="xs:integer"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="DS_MAD" type="xs:string"/>
<xs:element name="TM_MAD" type="xs:string"/>
<xs:element name="BASE_PATH" type="xs:string"/>
<xs:element name="TYPE" type="xs:integer"/>
<xs:element name="DISK_TYPE" type="xs:integer"/>
<xs:element name="STATE" type="xs:integer"/>
<xs:element name="CLUSTERS">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:integer" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="TOTAL_MB" type="xs:integer"/>
<xs:element name="FREE_MB" type="xs:integer"/>
<xs:element name="USED_MB" type="xs:integer"/>
<xs:element name="IMAGES">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:integer" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="TEMPLATE" type="xs:anyType"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
targetNamespace="http://opennebula.org/XMLSchema" xmlns="http://opennebula.org/XMLSchema">
<xs:include schemaLocation="datastore.xsd"/>
<xs:element name="DATASTORE_POOL">
<xs:complexType>
<xs:sequence maxOccurs="1" minOccurs="1">
<xs:element ref="DATASTORE" maxOccurs="unbounded" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

167
share/doc/xsd/xsd/group.xsd Normal file
View File

@ -0,0 +1,167 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
targetNamespace="http://opennebula.org/XMLSchema" xmlns="http://opennebula.org/XMLSchema">
<xs:element name="GROUP">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:integer"/>
<xs:element name="NAME" type="xs:string"/>
<xs:element name="TEMPLATE" type="xs:anyType"/>
<xs:element name="USERS">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:integer" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="ADMINS">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:integer" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="DATASTORE_QUOTA" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="DATASTORE" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:string"/>
<xs:element name="IMAGES" type="xs:string"/>
<xs:element name="IMAGES_USED" type="xs:string"/>
<xs:element name="SIZE" type="xs:string"/>
<xs:element name="SIZE_USED" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="NETWORK_QUOTA" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="NETWORK" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:string"/>
<xs:element name="LEASES" type="xs:string"/>
<xs:element name="LEASES_USED" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="VM_QUOTA" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="VM" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="CPU" type="xs:string"/>
<xs:element name="CPU_USED" type="xs:string"/>
<xs:element name="MEMORY" type="xs:string"/>
<xs:element name="MEMORY_USED" type="xs:string"/>
<xs:element name="SYSTEM_DISK_SIZE" type="xs:string"/>
<xs:element name="SYSTEM_DISK_SIZE_USED" type="xs:string"/>
<xs:element name="VMS" type="xs:string"/>
<xs:element name="VMS_USED" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="IMAGE_QUOTA" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="IMAGE" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:string"/>
<xs:element name="RVMS" type="xs:string"/>
<xs:element name="RVMS_USED" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="DEFAULT_GROUP_QUOTAS">
<xs:complexType>
<xs:sequence>
<xs:element name="DATASTORE_QUOTA" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="DATASTORE" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:string"/>
<xs:element name="IMAGES" type="xs:string"/>
<xs:element name="IMAGES_USED" type="xs:string"/>
<xs:element name="SIZE" type="xs:string"/>
<xs:element name="SIZE_USED" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="NETWORK_QUOTA" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="NETWORK" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:string"/>
<xs:element name="LEASES" type="xs:string"/>
<xs:element name="LEASES_USED" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="VM_QUOTA" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="VM" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="CPU" type="xs:string"/>
<xs:element name="CPU_USED" type="xs:string"/>
<xs:element name="MEMORY" type="xs:string"/>
<xs:element name="MEMORY_USED" type="xs:string"/>
<xs:element name="SYSTEM_DISK_SIZE" type="xs:string"/>
<xs:element name="SYSTEM_DISK_SIZE_USED" type="xs:string"/>
<xs:element name="VMS" type="xs:string"/>
<xs:element name="VMS_USED" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="IMAGE_QUOTA" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="IMAGE" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:string"/>
<xs:element name="RVMS" type="xs:string"/>
<xs:element name="RVMS_USED" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

View File

@ -0,0 +1,182 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
targetNamespace="http://opennebula.org/XMLSchema" xmlns="http://opennebula.org/XMLSchema">
<xs:element name="GROUP_POOL">
<xs:complexType>
<xs:sequence maxOccurs="1" minOccurs="1">
<xs:choice maxOccurs="unbounded" minOccurs="0">
<xs:element name="GROUP" maxOccurs="unbounded" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:integer"/>
<xs:element name="NAME" type="xs:string"/>
<xs:element name="TEMPLATE" type="xs:anyType"/>
<xs:element name="USERS">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:integer" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="ADMINS">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:integer" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="QUOTAS" maxOccurs="unbounded" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:integer"/>
<xs:element name="DATASTORE_QUOTA" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="DATASTORE" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:string"/>
<xs:element name="IMAGES" type="xs:string"/>
<xs:element name="IMAGES_USED" type="xs:string"/>
<xs:element name="SIZE" type="xs:string"/>
<xs:element name="SIZE_USED" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="NETWORK_QUOTA" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="NETWORK" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:string"/>
<xs:element name="LEASES" type="xs:string"/>
<xs:element name="LEASES_USED" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="VM_QUOTA" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="VM" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="CPU" type="xs:string"/>
<xs:element name="CPU_USED" type="xs:string"/>
<xs:element name="MEMORY" type="xs:string"/>
<xs:element name="MEMORY_USED" type="xs:string"/>
<xs:element name="SYSTEM_DISK_SIZE" type="xs:string"/>
<xs:element name="SYSTEM_DISK_SIZE_USED" type="xs:string"/>
<xs:element name="VMS" type="xs:string"/>
<xs:element name="VMS_USED" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="IMAGE_QUOTA" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="IMAGE" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:string"/>
<xs:element name="RVMS" type="xs:string"/>
<xs:element name="RVMS_USED" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
<xs:element name="DEFAULT_GROUP_QUOTAS" minOccurs="1" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="DATASTORE_QUOTA" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="DATASTORE" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:string"/>
<xs:element name="IMAGES" type="xs:string"/>
<xs:element name="IMAGES_USED" type="xs:string"/>
<xs:element name="SIZE" type="xs:string"/>
<xs:element name="SIZE_USED" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="NETWORK_QUOTA" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="NETWORK" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:string"/>
<xs:element name="LEASES" type="xs:string"/>
<xs:element name="LEASES_USED" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="VM_QUOTA" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="VM" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="CPU" type="xs:string"/>
<xs:element name="CPU_USED" type="xs:string"/>
<xs:element name="MEMORY" type="xs:string"/>
<xs:element name="MEMORY_USED" type="xs:string"/>
<xs:element name="SYSTEM_DISK_SIZE" type="xs:string"/>
<xs:element name="SYSTEM_DISK_SIZE_USED" type="xs:string"/>
<xs:element name="VMS" type="xs:string"/>
<xs:element name="VMS_USED" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="IMAGE_QUOTA" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="IMAGE" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:string"/>
<xs:element name="RVMS" type="xs:string"/>
<xs:element name="RVMS_USED" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

View File

@ -0,0 +1,91 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://opennebula.org/XMLSchema" elementFormDefault="qualified" targetNamespace="http://opennebula.org/XMLSchema">
<xs:element name="HOST">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:integer"/>
<xs:element name="NAME" type="xs:string"/>
<!-- STATE values
INIT = 0 Initial state for enabled hosts
MONITORING_MONITORED = 1 Monitoring the host (from monitored)
MONITORED = 2 The host has been successfully monitored
ERROR = 3 An error ocurrer while monitoring the host
DISABLED = 4 The host is disabled
MONITORING_ERROR = 5 Monitoring the host (from error)
MONITORING_INIT = 6 Monitoring the host (from init)
MONITORING_DISABLED = 7 Monitoring the host (from disabled)
OFFLINE = 8 The host is totally offline
-->
<xs:element name="STATE" type="xs:integer"/>
<xs:element name="IM_MAD" type="xs:string"/>
<xs:element name="VM_MAD" type="xs:string"/>
<xs:element name="LAST_MON_TIME" type="xs:integer"/>
<xs:element name="CLUSTER_ID" type="xs:integer"/>
<xs:element name="CLUSTER" type="xs:string"/>
<xs:element name="HOST_SHARE">
<xs:complexType>
<xs:sequence>
<xs:element name="DISK_USAGE" type="xs:integer"/>
<xs:element name="MEM_USAGE" type="xs:integer"/>
<!-- ^^ KB, Usage of MEMORY calculated by ONE as the summatory MEMORY requested by all VMs running in the host -->
<xs:element name="CPU_USAGE" type="xs:integer"/>
<!-- ^^ Percentage, Usage of CPU calculated by ONE as the summatory CPU requested by all VMs running in the host -->
<xs:element name="TOTAL_MEM" type="xs:integer"/>
<xs:element name="TOTAL_CPU" type="xs:integer"/>
<xs:element name="MAX_DISK" type="xs:integer"/>
<xs:element name="MAX_MEM" type="xs:integer"/>
<!-- ^^ KB, Total memory in the host -->
<xs:element name="MAX_CPU" type="xs:integer"/>
<!-- ^^ Percentage, Total CPU in the host (# cores * 100) -->
<xs:element name="FREE_DISK" type="xs:integer"/>
<xs:element name="FREE_MEM" type="xs:integer"/>
<!-- ^^ KB, Free MEMORY returned by the probes -->
<xs:element name="FREE_CPU" type="xs:integer"/>
<!-- ^^ Percentage, Free CPU as returned by the probes -->
<xs:element name="USED_DISK" type="xs:integer"/>
<xs:element name="USED_MEM" type="xs:integer"/>
<!-- ^^ KB, Memory used by all host processes (including VMs) over a total of MAX_MEM -->
<xs:element name="USED_CPU" type="xs:integer"/>
<!-- ^^ Percentage of CPU used by all host processes (including VMs) over a total of # cores * 100 -->
<xs:element name="RUNNING_VMS" type="xs:integer"/>
<xs:element name="DATASTORES">
<xs:complexType>
<xs:sequence>
<xs:element name="DS" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:all>
<xs:element name="ID" type="xs:integer"/>
<xs:element name="FREE_MB" type="xs:integer"/>
<xs:element name="TOTAL_MB" type="xs:integer"/>
<xs:element name="USED_MB" type="xs:integer"/>
</xs:all>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="PCI_DEVICES">
<xs:complexType>
<xs:sequence>
<xs:element name="PCI" type="xs:anyType" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="VMS">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:integer" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="TEMPLATE" type="xs:anyType"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
targetNamespace="http://opennebula.org/XMLSchema" xmlns="http://opennebula.org/XMLSchema">
<xs:include schemaLocation="host.xsd"/>
<xs:element name="HOST_POOL">
<xs:complexType>
<xs:sequence maxOccurs="1" minOccurs="1">
<xs:element ref="HOST" maxOccurs="unbounded" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

111
share/doc/xsd/xsd/image.xsd Normal file
View File

@ -0,0 +1,111 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://opennebula.org/XMLSchema" elementFormDefault="qualified" targetNamespace="http://opennebula.org/XMLSchema">
<xs:element name="IMAGE">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:integer"/>
<xs:element name="UID" type="xs:integer"/>
<xs:element name="GID" type="xs:integer"/>
<xs:element name="UNAME" type="xs:string"/>
<xs:element name="GNAME" type="xs:string"/>
<xs:element name="NAME" type="xs:string"/>
<xs:element name="LOCK" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="LOCKED" type="xs:integer"/>
<xs:element name="OWNER" type="xs:integer"/>
<xs:element name="TIME" type="xs:integer"/>
<xs:element name="REQ_ID" type="xs:integer"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="PERMISSIONS" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="OWNER_U" type="xs:integer"/>
<xs:element name="OWNER_M" type="xs:integer"/>
<xs:element name="OWNER_A" type="xs:integer"/>
<xs:element name="GROUP_U" type="xs:integer"/>
<xs:element name="GROUP_M" type="xs:integer"/>
<xs:element name="GROUP_A" type="xs:integer"/>
<xs:element name="OTHER_U" type="xs:integer"/>
<xs:element name="OTHER_M" type="xs:integer"/>
<xs:element name="OTHER_A" type="xs:integer"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="TYPE" type="xs:integer"/>
<xs:element name="DISK_TYPE" type="xs:integer"/>
<xs:element name="PERSISTENT" type="xs:integer"/>
<xs:element name="REGTIME" type="xs:integer"/>
<xs:element name="SOURCE" type="xs:string"/>
<xs:element name="PATH" type="xs:string"/>
<xs:element name="FSTYPE" type="xs:string"/>
<xs:element name="SIZE" type="xs:integer"/>
<!-- STATE values,
INIT = 0, Initialization state
READY = 1, Image ready to use
USED = 2, Image in use
DISABLED = 3, Image can not be instantiated by a VM
LOCKED = 4, FS operation for the Image in process
ERROR = 5, Error state the operation FAILED
CLONE = 6, Image is being cloned
DELETE = 7, DS is deleting the image
USED_PERS = 8, Image is in use and persistent
LOCKED_USED = 9, FS operation in progress, VMs waiting
LOCKED_USED_PERS = 10 FS operation in progress, VMs waiting. Persistent
-->
<xs:element name="STATE" type="xs:integer"/>
<xs:element name="RUNNING_VMS" type="xs:integer"/>
<xs:element name="CLONING_OPS" type="xs:integer"/>
<xs:element name="CLONING_ID" type="xs:integer"/>
<xs:element name="TARGET_SNAPSHOT" type="xs:integer"/>
<xs:element name="DATASTORE_ID" type="xs:integer"/>
<xs:element name="DATASTORE" type="xs:string"/>
<xs:element name="VMS">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:integer" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="CLONES">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:integer" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="APP_CLONES">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:integer" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="TEMPLATE" type="xs:anyType"/>
<xs:element name="SNAPSHOTS">
<xs:complexType>
<xs:sequence>
<xs:element name="ALLOW_ORPHANS" type="xs:string"/>
<xs:element name="SNAPSHOT" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="CHILDREN" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="ACTIVE" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="DATE" type="xs:integer"/>
<xs:element name="ID" type="xs:integer"/>
<xs:element name="NAME" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="PARENT" type="xs:integer"/>
<xs:element name="SIZE" type="xs:integer"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
targetNamespace="http://opennebula.org/XMLSchema" xmlns="http://opennebula.org/XMLSchema">
<xs:include schemaLocation="image.xsd"/>
<xs:element name="IMAGE_POOL">
<xs:complexType>
<xs:sequence maxOccurs="1" minOccurs="1">
<xs:element ref="IMAGE" maxOccurs="unbounded" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

View File

@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
targetNamespace="http://opennebula.org/XMLSchema" xmlns="http://opennebula.org/XMLSchema">
<xs:element name="MARKETPLACE">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:integer"/>
<xs:element name="UID" type="xs:integer"/>
<xs:element name="GID" type="xs:integer"/>
<xs:element name="UNAME" type="xs:string"/>
<xs:element name="GNAME" type="xs:string"/>
<xs:element name="NAME" type="xs:string"/>
<xs:element name="MARKET_MAD" type="xs:string"/>
<xs:element name="ZONE_ID" type="xs:string"/>
<xs:element name="TOTAL_MB" type="xs:integer"/>
<xs:element name="FREE_MB" type="xs:integer"/>
<xs:element name="USED_MB" type="xs:integer"/>
<xs:element name="MARKETPLACEAPPS">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:integer" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="PERMISSIONS" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="OWNER_U" type="xs:integer"/>
<xs:element name="OWNER_M" type="xs:integer"/>
<xs:element name="OWNER_A" type="xs:integer"/>
<xs:element name="GROUP_U" type="xs:integer"/>
<xs:element name="GROUP_M" type="xs:integer"/>
<xs:element name="GROUP_A" type="xs:integer"/>
<xs:element name="OTHER_U" type="xs:integer"/>
<xs:element name="OTHER_M" type="xs:integer"/>
<xs:element name="OTHER_A" type="xs:integer"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="TEMPLATE" type="xs:anyType"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="unqualified"
targetNamespace="http://opennebula.org/XMLSchema" xmlns="http://opennebula.org/XMLSchema">
<xs:include schemaLocation="marketplace.xsd"/>
<xs:element name="MARKETPLACE_POOL">
<xs:complexType>
<xs:sequence maxOccurs="1" minOccurs="1">
<xs:element ref="MARKETPLACE" maxOccurs="unbounded" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

View File

@ -0,0 +1,56 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
targetNamespace="http://opennebula.org/XMLSchema" xmlns="http://opennebula.org/XMLSchema">
<xs:element name="MARKETPLACEAPP">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:integer"/>
<xs:element name="UID" type="xs:integer"/>
<xs:element name="GID" type="xs:integer"/>
<xs:element name="UNAME" type="xs:string"/>
<xs:element name="GNAME" type="xs:string"/>
<xs:element name="LOCK" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="LOCKED" type="xs:integer"/>
<xs:element name="OWNER" type="xs:integer"/>
<xs:element name="TIME" type="xs:integer"/>
<xs:element name="REQ_ID" type="xs:integer"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="REGTIME" type="xs:integer"/>
<xs:element name="NAME" type="xs:string"/>
<xs:element name="ZONE_ID" type="xs:string"/>
<xs:element name="ORIGIN_ID" type="xs:string"/>
<xs:element name="SOURCE" type="xs:string"/>
<xs:element name="MD5" type="xs:string"/>
<xs:element name="SIZE" type="xs:integer"/>
<xs:element name="DESCRIPTION" type="xs:string"/>
<xs:element name="VERSION" type="xs:string"/>
<xs:element name="FORMAT" type="xs:string"/>
<xs:element name="APPTEMPLATE64" type="xs:string"/>
<xs:element name="MARKETPLACE_ID" type="xs:integer"/>
<xs:element name="MARKETPLACE" type="xs:string"/>
<xs:element name="STATE" type="xs:integer"/>
<xs:element name="TYPE" type="xs:integer"/>
<xs:element name="PERMISSIONS" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="OWNER_U" type="xs:integer"/>
<xs:element name="OWNER_M" type="xs:integer"/>
<xs:element name="OWNER_A" type="xs:integer"/>
<xs:element name="GROUP_U" type="xs:integer"/>
<xs:element name="GROUP_M" type="xs:integer"/>
<xs:element name="GROUP_A" type="xs:integer"/>
<xs:element name="OTHER_U" type="xs:integer"/>
<xs:element name="OTHER_M" type="xs:integer"/>
<xs:element name="OTHER_A" type="xs:integer"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="TEMPLATE" type="xs:anyType"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="unqualified"
targetNamespace="http://opennebula.org/XMLSchema" xmlns="http://opennebula.org/XMLSchema">
<xs:include schemaLocation="marketplaceapp.xsd"/>
<xs:element name="MARKETPLACEAPP_POOL">
<xs:complexType>
<xs:sequence maxOccurs="1" minOccurs="1">
<xs:element ref="MARKETPLACEAPP" maxOccurs="unbounded" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

1042
share/doc/xsd/xsd/oned.conf Normal file

File diff suppressed because it is too large Load Diff

290
share/doc/xsd/xsd/test.sh Executable file
View File

@ -0,0 +1,290 @@
#!/bin/bash
# -------------------------------------------------------------------------- #
# Copyright 2002-2017, OpenNebula Project, OpenNebula Systems #
# #
# Licensed 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. #
#--------------------------------------------------------------------------- #
mkdir -p samples/cluster samples/cluster_pool
mkdir -p samples/datastore samples/datastore_pool
mkdir -p samples/group samples/group_pool
mkdir -p samples/vdc samples/vdc_pool
mkdir -p samples/host samples/host_pool
mkdir -p samples/image samples/image_pool
mkdir -p samples/vmtemplate samples/vmtemplate_pool
mkdir -p samples/user samples/user_pool
mkdir -p samples/vm samples/vm_pool
mkdir -p samples/vnet samples/vnet_pool
mkdir -p samples/vm_group samples/vm_group_pool
mkdir -p samples/acct
mkdir -p samples/vrouter samples/vrouter_pool
mkdir -p samples/marketplace samples/marketplace_pool
mkdir -p samples/marketplaceapp samples/marketplaceapp_pool
touch output.log
cp oned.conf /etc/one/oned.conf
echo "Creating new cluster..." >> output.log
onecluster create newcluster
echo "Creating new group..." >> output.log
onegroup create newgroup
# Host
echo "Creating new hosts..." >> output.log
onehost create host01 --im dummy --vm dummy
onehost create host02 --im dummy --vm dummy
onehost create host03 --im dummy --vm dummy
#Wait to monitor hosts
sleep 30
onecluster addhost newcluster host03
for i in `onehost list | tail -n +2 | tr -s ' ' | cut -f2 -d ' '`; do
onehost show $i -x > samples/host/$i.xml
done
onehost list -x > samples/host_pool/0.xml
# VNets
echo "Creating new vnets..." >> output.log
onevnet list -x > samples/vnet_pool/1.xml
onevnet create test/vnet.0
onevnet list -x > samples/vnet_pool/2.xml
onevnet create test/vnet.1
onevnet create test/vnet.2
echo "Adding vnets to cluster..." >> output.log
onecluster addvnet newcluster 0
onecluster addvnet newcluster 2
echo "Reserving vnet..." >> output.log
onevnet reserve 1 --address_range 1 --size 2 --name reserve
for i in `onevnet list | tail -n +2 | tr -s ' ' | cut -f2 -d ' '`; do
onevnet show $i -x > samples/vnet/$i.xml
done
onevnet list -x > samples/vnet_pool/3.xml
# Cluster
echo "Creating new empty cluster..." >> output.log
onecluster create emptycluster
for i in `onecluster list | tail -n +2 | tr -s ' ' | cut -f2 -d ' '`; do
onecluster show $i -x > samples/cluster/$i.xml
done
onecluster list -x > samples/cluster_pool/0.xml
# Image
echo "Creating new images..." >> output.log
oneimage list -x > samples/image_pool/1.xml
oneimage create test/image.0 -d default
oneimage create test/image.1 -d default
for i in `oneimage list | tail -n +2 | tr -s ' ' | cut -f2 -d ' '`; do
oneimage show $i -x > samples/image/$i.xml
done
oneimage list -x > samples/image_pool/3.xml
# Datastore
echo "Creating new datastores..." >> output.log
onedatastore create test/datastore.0
onedatastore create test/datastore.1
echo "Adding datastores to cluster..." >> output.log
onecluster adddatastore newcluster 100
onecluster adddatastore newcluster 101
for i in `onedatastore list | tail -n +2 | tr -s ' ' | cut -f2 -d ' '`; do
onedatastore show $i -x > samples/datastore/$i.xml
done
onedatastore list -x > samples/datastore_pool/0.xml
# User
echo "Creating new users..." >> output.log
oneuser defaultquota test/quota.txt
oneuser create newuser abc
oneuser chgrp newuser newgroup
echo "Creating token for an user..." >> output.log
echo "no" | oneuser token-create --user newuser --password abc --time 123
echo "no" | oneuser token-create --user newuser --password abc --time 456
echo "no" | oneuser token-create --user newuser --password abc --time 789
for i in `oneuser list | tail -n +2 | tr -s ' ' | cut -f2 -d ' '`; do
oneuser show $i -x > samples/user/$i.xml
done
oneuser list -x > samples/user_pool/0.xml
# Group
echo "Creating new empty group..." >> output.log
onegroup defaultquota test/quota.txt
onegroup create emptygroup
for i in `onegroup list | tail -n +2 | tr -s ' ' | cut -f2 -d ' '`; do
onegroup show $i -x > samples/group/$i.xml
done
onegroup list -x > samples/group_pool/0.xml
# VDC
echo "Creating new empty vdc..." >> output.log
onevdc create emptyvdc
onevdc create newvdc
echo "Adding group to vnc..." >> output.log
onevdc addgroup newvdc newgroup
echo "Adding host to vnc..." >> output.log
onevdc addhost newvdc 0 host01
echo "Adding cluster to vnc..." >> output.log
onevdc addcluster newvdc 0 newcluster
for i in `onevdc list | tail -n +2 | tr -s ' ' | cut -f2 -d ' '`; do
onevdc show $i -x > samples/vdc/$i.xml
done
onevdc list -x > samples/vdc_pool/0.xml
# Template
echo "Creating new template..." >> output.log
onetemplate list -x > samples/vmtemplate_pool/1.xml
onetemplate create test/template.0 --user newuser --password abc
onetemplate create test/template.1 --user newuser --password abc
onetemplate create test/vr-template.0
for i in `onetemplate list | tail -n +2 | tr -s ' ' | cut -f2 -d ' '`; do
onetemplate show $i -x > samples/vmtemplate/$i.xml
done
onetemplate list -x > samples/vmtemplate_pool/2.xml
# VM
echo "Instantiating a template..." >> output.log
onetemplate instantiate 0 -m 2 --user newuser --password abc
onetemplate instantiate 1 -m 2 --user newuser --password abc
# Virtual Routers
echo "Creating new vrouters..." >> output.log
onevrouter create test/vr.0
onevrouter instantiate 0 vr-tmpl -m 2
for i in `onevm list | tail -n +2 | tr -s ' ' | cut -f2 -d ' '`; do
onevm deploy $i host01
done
sleep 5
echo "Executing action with a vm..." >> output.log
onevm migrate --live 0 host02
onevm terminate --hard 1
onevm poweroff 2
onevm poweroff 0
sleep 5
onevm snapshot-create 0
sleep 5
onevm resume 0
sleep 5
onevm disk-attach 0 -i 1
onevm disk-snapshot-create 0 0 disk_snapshot
onevm resume 2
sleep 5
for i in `onevm list | tail -n +2 | tr -s ' ' | cut -f2 -d ' '`; do
onevm show $i -x > samples/vm/$i.xml
done
onevm list -x > samples/vm_pool/0.xml
for i in `onevrouter list | tail -n +2 | tr -s ' ' | cut -f2 -d ' '`; do
onevrouter show $i -x > samples/vrouter/$i.xml
done
onevrouter list -x > samples/vrouter_pool/0.xml
echo "Working with markets..." >> output.log
# Marketplace
for i in `onemarket list | tail -n +2 | tr -s ' ' | cut -f2 -d ' '`; do
onemarket show $i -x > samples/marketplace/$i.xml
done
onemarket list -x > samples/marketplace_pool/0.xml
# Marketplace Apps
for i in `onemarketapp list | tail -n +2 | tr -s ' ' | cut -f2 -d ' '`; do
onemarketapp show $i -x > samples/marketplaceapp/$i.xml
done
onemarketapp list -x > samples/marketplaceapp_pool/0.xml
# VMGroups
echo "Creating new vmgroups..." >> output.log
onevmgroup list -x > samples/vm_group_pool/1.xml
onevmgroup create test/vm_group.0
onevmgroup list -x > samples/vm_group_pool/2.xml
for i in `onevmgroup list | tail -n +2 | tr -s ' ' | cut -f2 -d ' '`; do
onevmgroup show $i -x > samples/vm_group/$i.xml
done
echo "Executing xmllint..." >> output.log
for i in cluster datastore group vdc host image vmtemplate user vm vnet vrouter marketplace marketplaceapp vm_group
do
POOL_NAME="$i""_pool"
sed -i "s%<${i^^}>%<${i^^} xmlns='http://opennebula.org/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://opennebula.org/XMLSchema ../../$i.xsd'>%" samples/$i/*.xml
sed -i "s%<${i^^}_POOL/>%<${i^^}_POOL xmlns='http://opennebula.org/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://opennebula.org/XMLSchema ../../$POOL_NAME.xsd'/>%" samples/$POOL_NAME/*.xml
sed -i "s%<${i^^}_POOL>%<${i^^}_POOL xmlns='http://opennebula.org/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://opennebula.org/XMLSchema ../../$POOL_NAME.xsd'>%" samples/$POOL_NAME/*.xml
xmllint --noout --schema $i.xsd samples/$i/* >> output.log 2>&1
xmllint --noout --schema $POOL_NAME.xsd samples/$POOL_NAME/* >> output.log 2>&1
done
# Accounting
oneacct -x > samples/acct/0.xml
sed -i "s%<HISTORY_RECORDS>%<HISTORY_RECORDS xmlns='http://opennebula.org/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://opennebula.org/XMLSchema ../../acct.xsd'>%" samples/acct/*.xml
xmllint --noout --schema acct.xsd samples/acct/* >> output.log 2>&1
exit 0

View File

@ -0,0 +1,3 @@
NAME = ds0
DS_MAD = fs
TM_MAD = shared

View File

@ -0,0 +1,5 @@
NAME = ds1
DS_MAD = fs
TM_MAD = shared
EXTRA = ABC
EXTRA2 = 123

View File

@ -0,0 +1,4 @@
NAME = "Ubuntu"
PATH = /etc/hosts
TYPE = OS
DESCRIPTION = "Ubuntu 10.04 desktop for students."

View File

@ -0,0 +1,5 @@
NAME = "Experiment results"
TYPE = DATABLOCK
SIZE = 10
FSTYPE = ext3
EXTRA = ABC

View File

@ -0,0 +1,6 @@
VM=[
CPU="60.50",
MEMORY="102400",
SYSTEM_DISK_SIZE="204800",
VMS="1000"
]

View File

@ -0,0 +1,34 @@
NAME = template0
MEMORY = 128
CPU = 1
EXTRA = ABC
EXTRA2 = 123
NIC = [
NETWORK = "Blue LAN",
NETWORK_UID = "0"
]
NIC = [
NETWORK = "R",
NETWORK_UID = "0",
AR_ID = 0
]
NIC = [
NETWORK = "R",
NETWORK_UID = "0",
AR_ID = 1
]
NIC = [
NETWORK = "R",
NETWORK_UID = "0",
AR_ID = 2
]
NIC = [
NETWORK = "R",
NETWORK_UID = "0",
AR_ID = 3
]

View File

@ -0,0 +1,45 @@
NAME = template1
CPU = 0.45
VCPU = 1
MEMORY = 512
CONTEXT = [
NETWORK = "YES",
PASSWORD = "test",
SSH_PUBLIC_KEY = "$USER[SSH_PUBLIC_KEY]" ]
DISK = [
DEV_PREFIX = "vd",
DRIVER = "raw",
IMAGE_ID = "0" ]
DISK = [
DEV_PREFIX = "vd",
FORMAT = "raw",
READONLY = "yes",
SIZE = "1024",
TYPE = "fs" ]
DRIVER = "raw"
FEATURES = [
ACPI = "yes",
LOCALTIME = "yes" ]
FORMAT = "raw"
GRAPHICS = [
KEYMAP = "es",
LISTEN = "0.0.0.0",
PASSWD = "test",
TYPE = "VNC" ]
HYPERVISOR = "kvm"
IMAGE_ID = 0
INPUTS_ORDER = ""
LOGO = "images/logos/debian.png"
MEMORY_UNIT_COST = "MB"
NIC = [
NETWORK = "vnet_1",
NETWORK_UNAME = "oneadmin",
SECURITY_GROUPS = "0" ]
OS = [
ARCH = "x86_64",
BOOT = "" ]
READONLY = "yes"
SCHED_DS_REQUIREMENTS = "ID=\"0\""
SCHED_REQUIREMENTS = "ID=\"0\""
SIZE = 1
TYPE = "fs"

View File

@ -0,0 +1,3 @@
NAME = host-vm
ROLE = [ NAME="aff", HOST_AFFINED="0,4" ]
ROLE = [ NAME="anti", HOST_ANTI_AFFINED="2,3" ]

View File

@ -0,0 +1,16 @@
NAME = "Blue LAN"
BRIDGE = vbr1
VN_MAD = dummy
AR = [
IP = 130.10.0.1,
TYPE = IP4,
SIZE = 40
]
# Custom Attributes to be used in Context
GATEWAY = 130.10.0.1
DNS = 130.10.0.1
LOAD_BALANCER = 130.10.0.4

View File

@ -0,0 +1,33 @@
NAME = "R"
BRIDGE = vbr1
VN_MAD = dummy
NETWORK_ADDRESS = 10.10.10.0
NETWORK_MASK = 255.255.255.0
CUSTOM = ABC
AR = [
IP = 130.10.0.10,
TYPE = IP4,
SIZE = 20
]
AR = [
IP = 10.10.10.10,
GLOBAL_PREFIX = 2004:a128::,
TYPE = IP4_6,
SIZE = 20
]
AR = [
ULA_PREFIX = fd12:33a:df34:1a::,
TYPE = IP6,
SIZE = 20
]
AR = [
TYPE = ETHER,
SIZE = 20
]

View File

@ -0,0 +1,4 @@
NAME = "Empty"
BRIDGE = vbr1
VN_MAD = dummy

View File

@ -0,0 +1,7 @@
NAME = vr-tmpl
VROUTER = YES
MEMORY = 128
CPU = 1
EXTRA = ABC
EXTRA2 = 123

View File

@ -0,0 +1,24 @@
NAME = vr0
KEEPALIVED_ID = 12345
KEEPALIVED_PASSWORD = abc123456
NIC = [
FLOATING_IP = YES,
NETWORK = "Blue LAN",
NETWORK_UID = "0"
]
NIC = [
FLOATING_IP = YES,
NETWORK = "R",
NETWORK_UID = "0",
AR_ID = 0
]
NIC = [
VROUTER_MANAGEMENT = YES,
NETWORK = "R",
NETWORK_UID = "0",
AR_ID = 1
]

174
share/doc/xsd/xsd/user.xsd Normal file
View File

@ -0,0 +1,174 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
targetNamespace="http://opennebula.org/XMLSchema" xmlns="http://opennebula.org/XMLSchema">
<xs:element name="USER">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:integer"/>
<xs:element name="GID" type="xs:integer"/>
<xs:element name="GROUPS">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:integer" minOccurs="1" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="GNAME" type="xs:string"/>
<xs:element name="NAME" type="xs:string"/>
<xs:element name="PASSWORD" type="xs:string"/>
<xs:element name="AUTH_DRIVER" type="xs:string"/>
<xs:element name="ENABLED" type="xs:integer"/>
<xs:element name="LOGIN_TOKEN" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="TOKEN" type="xs:string"/>
<xs:element name="EXPIRATION_TIME" type="xs:integer"/>
<xs:element name="EGID" type="xs:integer"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="TEMPLATE" type="xs:anyType"/>
<xs:element name="DATASTORE_QUOTA" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="DATASTORE" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:string"/>
<xs:element name="IMAGES" type="xs:string"/>
<xs:element name="IMAGES_USED" type="xs:string"/>
<xs:element name="SIZE" type="xs:string"/>
<xs:element name="SIZE_USED" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="NETWORK_QUOTA" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="NETWORK" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:string"/>
<xs:element name="LEASES" type="xs:string"/>
<xs:element name="LEASES_USED" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="VM_QUOTA" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="VM" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="CPU" type="xs:string"/>
<xs:element name="CPU_USED" type="xs:string"/>
<xs:element name="MEMORY" type="xs:string"/>
<xs:element name="MEMORY_USED" type="xs:string"/>
<xs:element name="SYSTEM_DISK_SIZE" type="xs:string"/>
<xs:element name="SYSTEM_DISK_SIZE_USED" type="xs:string"/>
<xs:element name="VMS" type="xs:string"/>
<xs:element name="VMS_USED" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="IMAGE_QUOTA" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="IMAGE" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:string"/>
<xs:element name="RVMS" type="xs:string"/>
<xs:element name="RVMS_USED" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="DEFAULT_USER_QUOTAS">
<xs:complexType>
<xs:sequence>
<xs:element name="DATASTORE_QUOTA" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="DATASTORE" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:string"/>
<xs:element name="IMAGES" type="xs:string"/>
<xs:element name="IMAGES_USED" type="xs:string"/>
<xs:element name="SIZE" type="xs:string"/>
<xs:element name="SIZE_USED" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="NETWORK_QUOTA" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="NETWORK" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:string"/>
<xs:element name="LEASES" type="xs:string"/>
<xs:element name="LEASES_USED" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="VM_QUOTA" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="VM" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="CPU" type="xs:string"/>
<xs:element name="CPU_USED" type="xs:string"/>
<xs:element name="MEMORY" type="xs:string"/>
<xs:element name="MEMORY_USED" type="xs:string"/>
<xs:element name="SYSTEM_DISK_SIZE" type="xs:string"/>
<xs:element name="SYSTEM_DISK_SIZE_USED" type="xs:string"/>
<xs:element name="VMS" type="xs:string"/>
<xs:element name="VMS_USED" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="IMAGE_QUOTA" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="IMAGE" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:string"/>
<xs:element name="RVMS" type="xs:string"/>
<xs:element name="RVMS_USED" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

View File

@ -0,0 +1,189 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
targetNamespace="http://opennebula.org/XMLSchema" xmlns="http://opennebula.org/XMLSchema">
<xs:element name="USER_POOL">
<xs:complexType>
<xs:sequence maxOccurs="1" minOccurs="1">
<xs:choice maxOccurs="unbounded" minOccurs="0">
<xs:element name="USER" maxOccurs="unbounded" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:integer"/>
<xs:element name="GID" type="xs:integer"/>
<xs:element name="GROUPS">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:integer" minOccurs="1" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="GNAME" type="xs:string"/>
<xs:element name="NAME" type="xs:string"/>
<xs:element name="PASSWORD" type="xs:string"/>
<xs:element name="AUTH_DRIVER" type="xs:string"/>
<xs:element name="ENABLED" type="xs:integer"/>
<xs:element name="LOGIN_TOKEN" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="TOKEN" type="xs:string"/>
<xs:element name="EXPIRATION_TIME" type="xs:integer"/>
<xs:element name="EGID" type="xs:integer"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="TEMPLATE" type="xs:anyType"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="QUOTAS" maxOccurs="unbounded" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:integer"/>
<xs:element name="DATASTORE_QUOTA" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="DATASTORE" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:string"/>
<xs:element name="IMAGES" type="xs:string"/>
<xs:element name="IMAGES_USED" type="xs:string"/>
<xs:element name="SIZE" type="xs:string"/>
<xs:element name="SIZE_USED" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="NETWORK_QUOTA" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="NETWORK" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:string"/>
<xs:element name="LEASES" type="xs:string"/>
<xs:element name="LEASES_USED" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="VM_QUOTA" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="VM" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="CPU" type="xs:string"/>
<xs:element name="CPU_USED" type="xs:string"/>
<xs:element name="MEMORY" type="xs:string"/>
<xs:element name="MEMORY_USED" type="xs:string"/>
<xs:element name="SYSTEM_DISK_SIZE" type="xs:string"/>
<xs:element name="SYSTEM_DISK_SIZE_USED" type="xs:string"/>
<xs:element name="VMS" type="xs:string"/>
<xs:element name="VMS_USED" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="IMAGE_QUOTA" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="IMAGE" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:string"/>
<xs:element name="RVMS" type="xs:string"/>
<xs:element name="RVMS_USED" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
<xs:element name="DEFAULT_USER_QUOTAS">
<xs:complexType>
<xs:sequence>
<xs:element name="DATASTORE_QUOTA" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="DATASTORE" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:string"/>
<xs:element name="IMAGES" type="xs:string"/>
<xs:element name="IMAGES_USED" type="xs:string"/>
<xs:element name="SIZE" type="xs:string"/>
<xs:element name="SIZE_USED" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="NETWORK_QUOTA" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="NETWORK" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:string"/>
<xs:element name="LEASES" type="xs:string"/>
<xs:element name="LEASES_USED" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="VM_QUOTA" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="VM" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="CPU" type="xs:string"/>
<xs:element name="CPU_USED" type="xs:string"/>
<xs:element name="MEMORY" type="xs:string"/>
<xs:element name="MEMORY_USED" type="xs:string"/>
<xs:element name="SYSTEM_DISK_SIZE" type="xs:string"/>
<xs:element name="SYSTEM_DISK_SIZE_USED" type="xs:string"/>
<xs:element name="VMS" type="xs:string"/>
<xs:element name="VMS_USED" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="IMAGE_QUOTA" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="IMAGE" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:string"/>
<xs:element name="RVMS" type="xs:string"/>
<xs:element name="RVMS_USED" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

76
share/doc/xsd/xsd/vdc.xsd Normal file
View File

@ -0,0 +1,76 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
targetNamespace="http://opennebula.org/XMLSchema" xmlns="http://opennebula.org/XMLSchema">
<xs:element name="VDC">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:integer"/>
<xs:element name="NAME" type="xs:string"/>
<xs:element name="GROUPS">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:integer" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="CLUSTERS">
<xs:complexType>
<xs:sequence>
<xs:element name="CLUSTER" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="ZONE_ID" type="xs:integer"/>
<xs:element name="CLUSTER_ID" type="xs:integer"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="HOSTS">
<xs:complexType>
<xs:sequence>
<xs:element name="HOST" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="ZONE_ID" type="xs:integer"/>
<xs:element name="HOST_ID" type="xs:integer"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="DATASTORES">
<xs:complexType>
<xs:sequence>
<xs:element name="DATASTORE" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="ZONE_ID" type="xs:integer"/>
<xs:element name="DATASTORE_ID" type="xs:integer"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="VNETS">
<xs:complexType>
<xs:sequence>
<xs:element name="VNET" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="ZONE_ID" type="xs:integer"/>
<xs:element name="VNET_ID" type="xs:integer"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="TEMPLATE" type="xs:anyType"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
targetNamespace="http://opennebula.org/XMLSchema" xmlns="http://opennebula.org/XMLSchema">
<xs:include schemaLocation="vdc.xsd"/>
<xs:element name="VDC_POOL">
<xs:complexType>
<xs:sequence maxOccurs="1" minOccurs="1">
<xs:element ref="VDC" maxOccurs="unbounded" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

181
share/doc/xsd/xsd/vm.xsd Normal file
View File

@ -0,0 +1,181 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
targetNamespace="http://opennebula.org/XMLSchema" xmlns="http://opennebula.org/XMLSchema">
<xs:element name="VM">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:integer"/>
<xs:element name="UID" type="xs:integer"/>
<xs:element name="GID" type="xs:integer"/>
<xs:element name="UNAME" type="xs:string"/>
<xs:element name="GNAME" type="xs:string"/>
<xs:element name="NAME" type="xs:string"/>
<xs:element name="PERMISSIONS" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="OWNER_U" type="xs:integer"/>
<xs:element name="OWNER_M" type="xs:integer"/>
<xs:element name="OWNER_A" type="xs:integer"/>
<xs:element name="GROUP_U" type="xs:integer"/>
<xs:element name="GROUP_M" type="xs:integer"/>
<xs:element name="GROUP_A" type="xs:integer"/>
<xs:element name="OTHER_U" type="xs:integer"/>
<xs:element name="OTHER_M" type="xs:integer"/>
<xs:element name="OTHER_A" type="xs:integer"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="LAST_POLL" type="xs:integer"/>
<!-- STATE values,
see http://docs.opennebula.org/stable/user/references/vm_states.html
-->
<xs:element name="STATE" type="xs:integer"/>
<!-- LCM_STATE values, this sub-state is relevant only when STATE is
ACTIVE (4)
see http://docs.opennebula.org/stable/user/references/vm_states.html
-->
<xs:element name="LCM_STATE" type="xs:integer"/>
<xs:element name="PREV_STATE" type="xs:integer"/>
<xs:element name="PREV_LCM_STATE" type="xs:integer"/>
<xs:element name="RESCHED" type="xs:integer"/>
<xs:element name="STIME" type="xs:integer"/>
<xs:element name="ETIME" type="xs:integer"/>
<xs:element name="DEPLOY_ID" type="xs:string"/>
<xs:element name="LOCK" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="LOCKED" type="xs:integer"/>
<xs:element name="OWNER" type="xs:integer"/>
<xs:element name="TIME" type="xs:integer"/>
<xs:element name="REQ_ID" type="xs:integer"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="MONITORING">
<!--
<xs:complexType>
<xs:all>
<- Percentage of 1 CPU consumed (two fully consumed cpu is 200) ->
<xs:element name="CPU" type="xs:decimal" minOccurs="0" maxOccurs="1"/>
<- MEMORY consumption in kilobytes ->
<xs:element name="MEMORY" type="xs:integer" minOccurs="0" maxOccurs="1"/>
<- NETTX: Sent bytes to the network ->
<xs:element name="NETTX" type="xs:integer" minOccurs="0" maxOccurs="1"/>
<- NETRX: Received bytes from the network ->
<xs:element name="NETRX" type="xs:integer" minOccurs="0" maxOccurs="1"/>
</xs:all>
</xs:complexType>
-->
</xs:element>
<xs:element name="TEMPLATE" type="xs:anyType"/>
<xs:element name="USER_TEMPLATE" type="xs:anyType"/>
<xs:element name="HISTORY_RECORDS">
<xs:complexType>
<xs:sequence>
<xs:element name="HISTORY" maxOccurs="unbounded" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="OID" type="xs:integer"/>
<xs:element name="SEQ" type="xs:integer"/>
<xs:element name="HOSTNAME" type="xs:string"/>
<xs:element name="HID" type="xs:integer"/>
<xs:element name="CID" type="xs:integer"/>
<xs:element name="STIME" type="xs:integer"/>
<xs:element name="ETIME" type="xs:integer"/>
<xs:element name="VM_MAD" type="xs:string"/>
<xs:element name="TM_MAD" type="xs:string"/>
<xs:element name="DS_ID" type="xs:integer"/>
<xs:element name="PSTIME" type="xs:integer"/>
<xs:element name="PETIME" type="xs:integer"/>
<xs:element name="RSTIME" type="xs:integer"/>
<xs:element name="RETIME" type="xs:integer"/>
<xs:element name="ESTIME" type="xs:integer"/>
<xs:element name="EETIME" type="xs:integer"/>
<!-- ACTION values:
NONE_ACTION = 0
MIGRATE_ACTION = 1
LIVE_MIGRATE_ACTION = 2
SHUTDOWN_ACTION = 3
SHUTDOWN_HARD_ACTION = 4
UNDEPLOY_ACTION = 5
UNDEPLOY_HARD_ACTION = 6
HOLD_ACTION = 7
RELEASE_ACTION = 8
STOP_ACTION = 9
SUSPEND_ACTION = 10
RESUME_ACTION = 11
BOOT_ACTION = 12
DELETE_ACTION = 13
DELETE_RECREATE_ACTION = 14
REBOOT_ACTION = 15
REBOOT_HARD_ACTION = 16
RESCHED_ACTION = 17
UNRESCHED_ACTION = 18
POWEROFF_ACTION = 19
POWEROFF_HARD_ACTION = 20
DISK_ATTACH_ACTION = 21
DISK_DETACH_ACTION = 22
NIC_ATTACH_ACTION = 23
NIC_DETACH_ACTION = 24
DISK_SNAPSHOT_CREATE_ACTION = 25
DISK_SNAPSHOT_DELETE_ACTION = 26
TERMINATE_ACTION = 27
TERMINATE_HARD_ACTION = 28
DISK_RESIZE_ACTION = 29
DEPLOY_ACTION = 30
CHOWN_ACTION = 31
CHMOD_ACTION = 32
UPDATECONF_ACTION = 33
RENAME_ACTION = 34
RESIZE_ACTION = 35
UPDATE_ACTION = 36
SNAPSHOT_CREATE_ACTION = 37
SNAPSHOT_DELETE_ACTION = 38
SNAPSHOT_REVERT_ACTION = 39
DISK_SAVEAS_ACTION = 40
DISK_SNAPSHOT_REVERT_ACTION = 41
RECOVER_ACTION = 42
RETRY_ACTION = 43
MONITOR_ACTION = 44
-->
<xs:element name="ACTION" type="xs:integer"/>
<xs:element name="UID" type="xs:integer"/>
<xs:element name="GID" type="xs:integer"/>
<xs:element name="REQUEST_ID" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="SNAPSHOTS" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="ALLOW_ORPHANS" type="xs:string"/>
<xs:element name="DISK_ID" type="xs:integer"/>
<xs:element name="SNAPSHOT" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="ACTIVE" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="CHILDREN" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="DATE" type="xs:integer"/>
<xs:element name="ID" type="xs:integer"/>
<xs:element name="NAME" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="PARENT" type="xs:integer"/>
<xs:element name="SIZE" type="xs:integer"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

View File

@ -0,0 +1,59 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
targetNamespace="http://opennebula.org/XMLSchema" xmlns="http://opennebula.org/XMLSchema">
<xs:element name="VM_GROUP">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:integer"/>
<xs:element name="UID" type="xs:integer"/>
<xs:element name="GID" type="xs:integer"/>
<xs:element name="UNAME" type="xs:string"/>
<xs:element name="GNAME" type="xs:string"/>
<xs:element name="NAME" type="xs:string"/>
<xs:element name="PERMISSIONS" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="OWNER_U" type="xs:integer"/>
<xs:element name="OWNER_M" type="xs:integer"/>
<xs:element name="OWNER_A" type="xs:integer"/>
<xs:element name="GROUP_U" type="xs:integer"/>
<xs:element name="GROUP_M" type="xs:integer"/>
<xs:element name="GROUP_A" type="xs:integer"/>
<xs:element name="OTHER_U" type="xs:integer"/>
<xs:element name="OTHER_M" type="xs:integer"/>
<xs:element name="OTHER_A" type="xs:integer"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="LOCK" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="LOCKED" type="xs:integer"/>
<xs:element name="OWNER" type="xs:integer"/>
<xs:element name="TIME" type="xs:integer"/>
<xs:element name="REQ_ID" type="xs:integer"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="ROLES" minOccurs="1" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="ROLE" maxOccurs="unbounded" minOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="HOST_AFFINED" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="HOST_ANTI_AFFINED" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="ID" type="xs:integer"/>
<xs:element name="NAME" type="xs:string"/>
<xs:element name="POLICY" type="xs:string" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="TEMPLATE" type="xs:anyType"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="unqualified"
targetNamespace="http://opennebula.org/XMLSchema" xmlns="http://opennebula.org/XMLSchema">
<xs:include schemaLocation="vm_group.xsd"/>
<xs:element name="VM_GROUP_POOL">
<xs:complexType>
<xs:sequence maxOccurs="1" minOccurs="1">
<xs:element ref="VM_GROUP" maxOccurs="unbounded" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="unqualified"
targetNamespace="http://opennebula.org/XMLSchema" xmlns="http://opennebula.org/XMLSchema">
<xs:include schemaLocation="vm.xsd"/>
<xs:element name="VM_POOL">
<xs:complexType>
<xs:sequence maxOccurs="1" minOccurs="1">
<xs:element ref="VM" maxOccurs="unbounded" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

View File

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://opennebula.org/XMLSchema" elementFormDefault="qualified" targetNamespace="http://opennebula.org/XMLSchema">
<xs:element name="VMTEMPLATE">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:integer"/>
<xs:element name="UID" type="xs:integer"/>
<xs:element name="GID" type="xs:integer"/>
<xs:element name="UNAME" type="xs:string"/>
<xs:element name="GNAME" type="xs:string"/>
<xs:element name="NAME" type="xs:string"/>
<xs:element name="LOCK" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="LOCKED" type="xs:integer"/>
<xs:element name="OWNER" type="xs:integer"/>
<xs:element name="TIME" type="xs:integer"/>
<xs:element name="REQ_ID" type="xs:integer"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="PERMISSIONS" minOccurs="1" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="OWNER_U" type="xs:integer"/>
<xs:element name="OWNER_M" type="xs:integer"/>
<xs:element name="OWNER_A" type="xs:integer"/>
<xs:element name="GROUP_U" type="xs:integer"/>
<xs:element name="GROUP_M" type="xs:integer"/>
<xs:element name="GROUP_A" type="xs:integer"/>
<xs:element name="OTHER_U" type="xs:integer"/>
<xs:element name="OTHER_M" type="xs:integer"/>
<xs:element name="OTHER_A" type="xs:integer"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="REGTIME" type="xs:integer"/>
<xs:element name="TEMPLATE" type="xs:anyType"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
targetNamespace="http://opennebula.org/XMLSchema" xmlns="http://opennebula.org/XMLSchema">
<xs:include schemaLocation="vmtemplate.xsd"/>
<xs:element name="VMTEMPLATE_POOL">
<xs:complexType>
<xs:sequence maxOccurs="1" minOccurs="1">
<xs:element ref="VMTEMPLATE" maxOccurs="unbounded" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

116
share/doc/xsd/xsd/vnet.xsd Normal file
View File

@ -0,0 +1,116 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
targetNamespace="http://opennebula.org/XMLSchema" xmlns="http://opennebula.org/XMLSchema">
<xs:element name="VNET">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:integer"/>
<xs:element name="UID" type="xs:integer"/>
<xs:element name="GID" type="xs:integer"/>
<xs:element name="UNAME" type="xs:string"/>
<xs:element name="GNAME" type="xs:string"/>
<xs:element name="NAME" type="xs:string"/>
<xs:element name="LOCK" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="LOCKED" type="xs:integer"/>
<xs:element name="OWNER" type="xs:integer"/>
<xs:element name="TIME" type="xs:integer"/>
<xs:element name="REQ_ID" type="xs:integer"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="PERMISSIONS" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="OWNER_U" type="xs:integer"/>
<xs:element name="OWNER_M" type="xs:integer"/>
<xs:element name="OWNER_A" type="xs:integer"/>
<xs:element name="GROUP_U" type="xs:integer"/>
<xs:element name="GROUP_M" type="xs:integer"/>
<xs:element name="GROUP_A" type="xs:integer"/>
<xs:element name="OTHER_U" type="xs:integer"/>
<xs:element name="OTHER_M" type="xs:integer"/>
<xs:element name="OTHER_A" type="xs:integer"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="CLUSTERS">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:integer" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="BRIDGE" type="xs:string"/>
<xs:element name="PARENT_NETWORK_ID" type="xs:string"/>
<xs:element name="VN_MAD" type="xs:string"/>
<xs:element name="PHYDEV" type="xs:string"/>
<xs:element name="VLAN_ID" type="xs:string" minOccurs="0"/>
<xs:element name="OUTER_VLAN_ID" type="xs:string" minOccurs="0"/>
<xs:element name="VLAN_ID_AUTOMATIC" type="xs:string"/>
<xs:element name="OUTER_VLAN_ID_AUTOMATIC" type="xs:string"/>
<xs:element name="USED_LEASES" type="xs:integer"/>
<xs:element name="VROUTERS">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:integer" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="TEMPLATE" type="xs:anyType"/>
<xs:element name="AR_POOL">
<xs:complexType>
<xs:sequence minOccurs="0">
<xs:element name="AR" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="AR_ID" type="xs:string"/>
<xs:element name="GLOBAL_PREFIX" type="xs:string" minOccurs="0"/>
<xs:element name="IP" type="xs:string" minOccurs="0"/>
<xs:element name="MAC" type="xs:string"/>
<xs:element name="PARENT_NETWORK_AR_ID" type="xs:string" minOccurs="0"/>
<xs:element name="SIZE" type="xs:integer"/>
<xs:element name="TYPE" type="xs:string"/>
<xs:element name="ULA_PREFIX" type="xs:string" minOccurs="0"/>
<xs:element name="VN_MAD" type="xs:string" minOccurs="0"/>
<xs:element name="MAC_END" type="xs:string" minOccurs="0"/>
<xs:element name="IP_END" type="xs:string" minOccurs="0"/>
<xs:element name="IP6_ULA" type="xs:string" minOccurs="0"/>
<xs:element name="IP6_ULA_END" type="xs:string" minOccurs="0"/>
<xs:element name="IP6_GLOBAL" type="xs:string" minOccurs="0"/>
<xs:element name="IP6_GLOBAL_END" type="xs:string" minOccurs="0"/>
<xs:element name="IP6" type="xs:string" minOccurs="0"/>
<xs:element name="IP6_END" type="xs:string" minOccurs="0"/>
<xs:element name="USED_LEASES" type="xs:string"/>
<xs:element name="LEASES" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="LEASE" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:all>
<xs:element name="IP" type="xs:string" minOccurs="0"/>
<xs:element name="IP6" type="xs:string" minOccurs="0"/>
<xs:element name="IP6_GLOBAL" type="xs:string" minOccurs="0"/>
<xs:element name="IP6_LINK" type="xs:string" minOccurs="0"/>
<xs:element name="IP6_ULA" type="xs:string" minOccurs="0"/>
<xs:element name="MAC" type="xs:string"/>
<xs:element name="VM" type="xs:integer" minOccurs="0"/>
<xs:element name="VNET" type="xs:integer" minOccurs="0"/>
<xs:element name="VROUTER" type="xs:integer" minOccurs="0"/>
</xs:all>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

View File

@ -0,0 +1,84 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
targetNamespace="http://opennebula.org/XMLSchema" xmlns="http://opennebula.org/XMLSchema">
<xs:include schemaLocation="vnet.xsd"/>
<xs:element name="VNET_POOL">
<xs:complexType>
<xs:sequence maxOccurs="1" minOccurs="1">
<xs:element name="VNET" maxOccurs="unbounded" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:integer"/>
<xs:element name="UID" type="xs:integer"/>
<xs:element name="GID" type="xs:integer"/>
<xs:element name="UNAME" type="xs:string"/>
<xs:element name="GNAME" type="xs:string"/>
<xs:element name="NAME" type="xs:string"/>
<xs:element name="PERMISSIONS" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="OWNER_U" type="xs:integer"/>
<xs:element name="OWNER_M" type="xs:integer"/>
<xs:element name="OWNER_A" type="xs:integer"/>
<xs:element name="GROUP_U" type="xs:integer"/>
<xs:element name="GROUP_M" type="xs:integer"/>
<xs:element name="GROUP_A" type="xs:integer"/>
<xs:element name="OTHER_U" type="xs:integer"/>
<xs:element name="OTHER_M" type="xs:integer"/>
<xs:element name="OTHER_A" type="xs:integer"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="CLUSTERS">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:integer" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="BRIDGE" type="xs:string"/>
<xs:element name="PARENT_NETWORK_ID" type="xs:string"/>
<xs:element name="VN_MAD" type="xs:string"/>
<xs:element name="PHYDEV" type="xs:string"/>
<xs:element name="VLAN_ID" type="xs:string" minOccurs="0"/>
<xs:element name="OUTER_VLAN_ID" type="xs:string" minOccurs="0"/>
<xs:element name="VLAN_ID_AUTOMATIC" type="xs:string"/>
<xs:element name="OUTER_VLAN_ID_AUTOMATIC" type="xs:string"/>
<xs:element name="USED_LEASES" type="xs:integer"/>
<xs:element name="VROUTERS">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:integer" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="TEMPLATE" type="xs:anyType"/>
<xs:element name="AR_POOL">
<xs:complexType>
<xs:sequence minOccurs="0">
<xs:element name="AR" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="ALLOCATED" type="xs:string" minOccurs="0"/>
<xs:element name="AR_ID" type="xs:string"/>
<xs:element name="GLOBAL_PREFIX" type="xs:string" minOccurs="0"/>
<xs:element name="IP" type="xs:string" minOccurs="0"/>
<xs:element name="MAC" type="xs:string"/>
<xs:element name="PARENT_NETWORK_AR_ID" type="xs:string" minOccurs="0"/>
<xs:element name="SIZE" type="xs:integer"/>
<xs:element name="TYPE" type="xs:string"/>
<xs:element name="ULA_PREFIX" type="xs:string" minOccurs="0"/>
<xs:element name="VN_MAD" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

View File

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
targetNamespace="http://opennebula.org/XMLSchema" xmlns="http://opennebula.org/XMLSchema">
<xs:element name="VROUTER">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:integer"/>
<xs:element name="UID" type="xs:integer"/>
<xs:element name="GID" type="xs:integer"/>
<xs:element name="UNAME" type="xs:string"/>
<xs:element name="GNAME" type="xs:string"/>
<xs:element name="NAME" type="xs:string"/>
<xs:element name="PERMISSIONS" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="OWNER_U" type="xs:integer"/>
<xs:element name="OWNER_M" type="xs:integer"/>
<xs:element name="OWNER_A" type="xs:integer"/>
<xs:element name="GROUP_U" type="xs:integer"/>
<xs:element name="GROUP_M" type="xs:integer"/>
<xs:element name="GROUP_A" type="xs:integer"/>
<xs:element name="OTHER_U" type="xs:integer"/>
<xs:element name="OTHER_M" type="xs:integer"/>
<xs:element name="OTHER_A" type="xs:integer"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="LOCK" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="LOCKED" type="xs:integer"/>
<xs:element name="OWNER" type="xs:integer"/>
<xs:element name="TIME" type="xs:integer"/>
<xs:element name="REQ_ID" type="xs:integer"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="VMS">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:integer" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="TEMPLATE" type="xs:anyType"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="unqualified"
targetNamespace="http://opennebula.org/XMLSchema" xmlns="http://opennebula.org/XMLSchema">
<xs:include schemaLocation="vrouter.xsd"/>
<xs:element name="VROUTER_POOL">
<xs:complexType>
<xs:sequence maxOccurs="1" minOccurs="1">
<xs:element ref="VROUTER" maxOccurs="unbounded" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

View File

@ -0,0 +1,29 @@
require 'init_functionality'
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
describe "XSD for xml documents test" do
#---------------------------------------------------------------------------
# TESTS
#---------------------------------------------------------------------------
it "Group" do
Dir.chdir("./spec/functionality/xsd") {
`./test.sh`
out = File.read("output.log")
error = ""
if out.include? "error"
out.lines.select{|e|
if e.include?('error')
error = "#{error} #{e}"
end
}
`rm output.log`
`rm -r samples`
fail error
end
`rm output.log`
`rm -r samples`
}
end
end

29
share/doc/xsd/xsd_spec.rb Normal file
View File

@ -0,0 +1,29 @@
require 'init_functionality'
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
describe "XSD for xml documents test" do
#---------------------------------------------------------------------------
# TESTS
#---------------------------------------------------------------------------
it "Group" do
Dir.chdir("./spec/functionality/xsd") {
`./test.sh`
out = File.read("output.log")
error = ""
if out.include? "error"
out.lines.select{|e|
if e.include?('error')
error = "#{error} #{e}"
end
}
`rm output.log`
`rm -r samples`
fail error
end
`rm output.log`
`rm -r samples`
}
end
end