1
0
mirror of https://github.com/OpenNebula/one.git synced 2024-12-25 23:21:29 +03:00

Updated XSD (#2176)

This commit is contained in:
juanmont 2018-06-13 15:17:45 +02:00 committed by Ruben S. Montero
parent 2eed5a7251
commit 91d7ca20f9
11 changed files with 262 additions and 1097 deletions

View File

@ -47,7 +47,21 @@
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="TEMPLATE" type="xs:anyType"/>
<xs:element name="TEMPLATE">
<xs:complexType>
<xs:sequence>
<xs:element name="VCENTER_DC_NAME" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="VCENTER_DC_REF" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="VCENTER_DS_NAME" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="VCENTER_DS_REF" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="VCENTER_HOST" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="VCENTER_INSTANCE_ID" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="VCENTER_PASSWORD" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="VCENTER_USER" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:any minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>

View File

@ -6,12 +6,11 @@
<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
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)
@ -84,7 +83,23 @@
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="TEMPLATE" type="xs:anyType"/>
<xs:element name="TEMPLATE">
<xs:complexType>
<xs:sequence>
<xs:any minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
<xs:element name="VCENTER_CCR_REF" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="VCENTER_DS_REF" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="VCENTER_HOST" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="VCENTER_INSTANCE_ID" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="VCENTER_NAME" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="VCENTER_PASSWORD" type="xs:integer" minOccurs="0" maxOccurs="1"/>
<xs:element name="VCENTER_RESOURCE_POOL_INFO" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="VCENTER_USER" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="VCENTER_VERSION" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:any minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>

View File

@ -84,7 +84,15 @@
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="TEMPLATE" type="xs:anyType"/>
<xs:element name="TEMPLATE">
<xs:complexType>
<xs:sequence>
<xs:any minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
<xs:element name="VCENTER_IMPORTED" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:any minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="SNAPSHOTS">
<xs:complexType>
<xs:sequence>

File diff suppressed because it is too large Load Diff

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,20 +26,26 @@ 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/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
mkdir -p samples/zone samples/zone_pool
touch output.log
cp oned.conf /etc/one/oned.conf
## VCENTER CONFIGURATION
vcenter="vcenter.vcenter65-1"
vuser="administrator@vsphere.local"
vpass="Pantufl4."
########################
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
@ -51,37 +57,16 @@ sleep 30
onecluster addhost newcluster host03
echo "Importing defaults hosts from $vcenter" >> output.log
onevcenter hosts --vcenter $vcenter --vuser $vuser --vpass $vpass --use-defaults
sleep 10
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
@ -92,7 +77,6 @@ done
onecluster list -x > samples/cluster_pool/0.xml
# Image
echo "Creating new images..." >> output.log
oneimage list -x > samples/image_pool/1.xml
@ -116,13 +100,16 @@ echo "Adding datastores to cluster..." >> output.log
onecluster adddatastore newcluster 100
onecluster adddatastore newcluster 101
echo "Import datastore from $vcenter" >> output.log
onevcenter import_defaults -o datastores -h 5
sleep 15
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
@ -130,6 +117,7 @@ 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
@ -180,6 +168,9 @@ onetemplate create test/template.0 --user newuser --password abc
onetemplate create test/template.1 --user newuser --password abc
onetemplate create test/vr-template.0
echo "Import templates from $vcenter" >> output.log
onevcenter import_defaults -o templates 1..3 -h 5
for i in `onetemplate list | tail -n +2 | tr -s ' ' | cut -f2 -d ' '`; do
onetemplate show $i -x > samples/vmtemplate/$i.xml
done
@ -192,8 +183,15 @@ 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
sleep 10
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
for i in `onevm list | tail -n +2 | tr -s ' ' | cut -f2 -d ' '`; do
onevm deploy $i host01
@ -224,17 +222,41 @@ onevm resume 2
sleep 5
echo "Import wilds from $vcenter" >> output.log
onehost importvm 'Cluster2' 'wild00 - Cluster2' >> output.log
sleep 15
onehost importvm 'Cluster2' 'wild01 - Cluster2' >> output.log
sleep 15
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
# 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
onevrouter list -x > samples/vrouter_pool/0.xml
onevnet list -x > samples/vnet_pool/3.xml
echo "Working with markets..." >> output.log
# Marketplace
@ -254,6 +276,7 @@ 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
@ -264,6 +287,17 @@ for i in `onevmgroup list | tail -n +2 | tr -s ' ' | cut -f2 -d ' '`; do
onevmgroup show $i -x > samples/vm_group/$i.xml
done
# VMGroups
echo "Creating new servers into zone 0..." >> output.log
onezone list -x > samples/zone_pool/1.xml
onezone server-add 0 -n server-0 -r http://localhost:2633/RPC2
onevmgroup list -x > samples/vm_group_pool/2.xml
onezone show 0 -x > samples/zone/1.xml
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"

View File

@ -72,8 +72,46 @@
</xs:complexType>
-->
</xs:element>
<xs:element name="TEMPLATE" type="xs:anyType"/>
<xs:element name="USER_TEMPLATE" type="xs:anyType"/>
<xs:element name="TEMPLATE">
<xs:complexType>
<xs:sequence>
<xs:any minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
<xs:element name="DISK" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:any minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
<xs:element name="VCENTER_DS_REF" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="VCENTER_INSTANCE_ID" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:any minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:any minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
<xs:element name="NIC" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:any minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
<xs:element name="VCENTER_INSTANCE_ID" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="VCENTER_NET_REF" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="VCENTER_PORTGROUP_TYPE" type="xs:string" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:any minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="USER_TEMPLATE">
<xs:complexType>
<xs:sequence>
<xs:any minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
<xs:element name="VCENTER_CCR_REF" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="VCENTER_DS_REF" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="VCENTER_INSTANCE_ID" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:any minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="HISTORY_RECORDS">
<xs:complexType>
<xs:sequence>

View File

@ -35,7 +35,17 @@
</xs:complexType>
</xs:element>
<xs:element name="REGTIME" type="xs:integer"/>
<xs:element name="TEMPLATE" type="xs:anyType"/>
<xs:element name="TEMPLATE">
<xs:complexType>
<xs:sequence>
<xs:any minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
<xs:element name="VCENTER_CCR_REF" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="VCENTER_INSTANCE_ID" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="VCENTER_TEMPLATE_REF" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:any minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>

View File

@ -58,7 +58,19 @@
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="TEMPLATE" type="xs:anyType"/>
<xs:element name="TEMPLATE">
<xs:complexType>
<xs:sequence>
<xs:any minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
<xs:element name="VCENTER_FROM_WILD" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="VCENTER_INSTANCE_ID" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="VCENTER_NET_REF" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="VCENTER_PORTGROUP_TYPE" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="VCENTER_TEMPLATE_REF" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:any minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="AR_POOL">
<xs:complexType>
<xs:sequence minOccurs="0">

View File

@ -3,7 +3,7 @@ require 'init_functionality'
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
describe "XSD for xml documents test" do
#---------------------------------------------------------------------------
# TESTS
#---------------------------------------------------------------------------

47
share/doc/xsd/zone.xsd Normal file
View File

@ -0,0 +1,47 @@
<?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="ZONE">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:integer"/>
<xs:element name="NAME" 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="TEMPLATE"/>
<xs:complexType>
<xs:sequence>
<xs:element name="ENDPOINT" type="xs:string">
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="SERVER_POOL">
<xs:complexType>
<xs:sequence>
<xs:element name="SERVER" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="ENDPOINT" type="xs:string"/>
<xs:element name="ID" type="xs:integer"/>
<xs:element name="NAME" type="xs:string"/>
<xs:element name="STATE" type="xs:integer"/>
<xs:element name="TERM" type="xs:integer"/>
<xs:element name="VOTEDFOR" type="xs:integer"/>
<xs:element name="COMMIT" type="xs:integer"/>
<xs:element name="LOG_INDEX" type="xs:integer"/>
<xs:element name="FEDLOG_INDEX" 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,41 @@
<?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="ZONE">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:integer"/>
<xs:element name="NAME" 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="TEMPLATE"/>
<xs:complexType>
<xs:sequence>
<xs:element name="ENDPOINT" type="xs:string">
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="SERVER_POOL">
<xs:complexType>
<xs:sequence>
<xs:element name="SERVER" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="ENDPOINT" type="xs:string"/>
<xs:element name="ID" type="xs:integer"/>
<xs:element name="NAME" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>