mirror of
https://github.com/OpenNebula/one.git
synced 2024-12-22 13:33:52 +03:00
Update XSD documentation files to 3.4
This commit is contained in:
parent
3452fb450f
commit
122e0aede9
33
share/doc/xsd/cluster.xsd
Normal file
33
share/doc/xsd/cluster.xsd
Normal file
@ -0,0 +1,33 @@
|
||||
<?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:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:schema>
|
12
share/doc/xsd/cluster_pool.xsd
Normal file
12
share/doc/xsd/cluster_pool.xsd
Normal 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>
|
44
share/doc/xsd/datastore.xsd
Normal file
44
share/doc/xsd/datastore.xsd
Normal file
@ -0,0 +1,44 @@
|
||||
<?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="CLUSTER_ID" type="xs:integer"/>
|
||||
<xs:element name="CLUSTER" type="xs:string"/>
|
||||
<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>
|
12
share/doc/xsd/datastore_pool.xsd
Normal file
12
share/doc/xsd/datastore_pool.xsd
Normal 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>
|
@ -9,8 +9,9 @@
|
||||
<xs:element name="IM_MAD" type="xs:string"/>
|
||||
<xs:element name="VM_MAD" type="xs:string"/>
|
||||
<xs:element name="VN_MAD" type="xs:string"/>
|
||||
<xs:element name="TM_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>
|
||||
|
@ -33,6 +33,8 @@
|
||||
<xs:element name="SIZE" type="xs:integer"/>
|
||||
<xs:element name="STATE" type="xs:integer"/>
|
||||
<xs:element name="RUNNING_VMS" type="xs:integer"/>
|
||||
<xs:element name="DATASTORE_ID" type="xs:integer"/>
|
||||
<xs:element name="DATASTORE" type="xs:string"/>
|
||||
<xs:element name="TEMPLATE" type="xs:anyType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
|
@ -1,5 +1,153 @@
|
||||
#!/bin/bash
|
||||
|
||||
for i in group_pool group host_pool host image_pool image template_pool template user_pool user vm_pool vm vnet_pool vnet
|
||||
# -------------------------------------------------------------------------- #
|
||||
# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) #
|
||||
# #
|
||||
# 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/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
|
||||
|
||||
|
||||
|
||||
onecluster create newcluster
|
||||
onegroup create newgroup
|
||||
|
||||
|
||||
# Host
|
||||
onehost create host01 --im im_test --vm vmm_test --net dummy
|
||||
onehost create host02 --im im_test --vm vmm_test --net dummy
|
||||
|
||||
onecluster addhost newcluster host02
|
||||
|
||||
onehost show 0 -x > samples/host/0.xml
|
||||
onehost show 1 -x > samples/host/1.xml
|
||||
|
||||
onehost list -x > samples/host_pool/0.xml
|
||||
|
||||
|
||||
# VNets
|
||||
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
|
||||
|
||||
onecluster addvnet newcluster 0
|
||||
onecluster addvnet newcluster 2
|
||||
|
||||
onevnet show 0 -x > samples/vnet/0.xml
|
||||
onevnet show 1 -x > samples/vnet/1.xml
|
||||
onevnet show 2 -x > samples/vnet/2.xml
|
||||
|
||||
onevnet list -x > samples/vnet_pool/3.xml
|
||||
|
||||
|
||||
# Template
|
||||
onetemplate list -x > samples/vmtemplate_pool/1.xml
|
||||
|
||||
onetemplate create test/template.0
|
||||
onetemplate create test/template.1
|
||||
|
||||
onetemplate show 0 -x > samples/vmtemplate/0.xml
|
||||
onetemplate show 1 -x > samples/vmtemplate/1.xml
|
||||
|
||||
onetemplate list -x > samples/vmtemplate_pool/2.xml
|
||||
|
||||
|
||||
# VM
|
||||
onetemplate instantiate 0
|
||||
|
||||
onevm show 0 -x > samples/vm/0.xml
|
||||
|
||||
onevm list -x > samples/vm_pool/0.xml
|
||||
|
||||
# Cluster
|
||||
onecluster create emptycluster
|
||||
|
||||
onecluster show 100 -x > samples/cluster/0.xml
|
||||
onecluster show 101 -x > samples/cluster/1.xml
|
||||
|
||||
onecluster list -x > samples/cluster_pool/0.xml
|
||||
|
||||
|
||||
# Image
|
||||
oneimage list -x > samples/image_pool/1.xml
|
||||
|
||||
oneimage create test/image.0 -d default
|
||||
oneimage create test/image.1 -d default
|
||||
|
||||
oneimage show 0 -x > samples/image/0.xml
|
||||
oneimage show 1 -x > samples/image/1.xml
|
||||
|
||||
oneimage list -x > samples/image_pool/3.xml
|
||||
|
||||
|
||||
# Datastore
|
||||
onedatastore create test/datastore.0
|
||||
onedatastore create test/datastore.1
|
||||
|
||||
onecluster adddatastore newcluster 100
|
||||
onecluster adddatastore newcluster 101
|
||||
|
||||
onedatastore show 100 -x > samples/datastore/0.xml
|
||||
onedatastore show 101 -x > samples/datastore/1.xml
|
||||
|
||||
onedatastore list -x > samples/datastore_pool/0.xml
|
||||
|
||||
|
||||
# User
|
||||
oneuser create newuser abc
|
||||
oneuser chgrp newuser newgroup
|
||||
|
||||
oneuser show newuser -x > samples/user/0.xml
|
||||
|
||||
oneuser list -x > samples/user_pool/0.xml
|
||||
|
||||
|
||||
# Group
|
||||
onegroup create emptygroup
|
||||
|
||||
onegroup show 0 -x > samples/group/0.xml
|
||||
onegroup show 1 -x > samples/group/1.xml
|
||||
onegroup show 100 -x > samples/group/2.xml
|
||||
onegroup show 101 -x > samples/group/3.xml
|
||||
|
||||
onegroup list -x > samples/group_pool/0.xml
|
||||
|
||||
|
||||
|
||||
for i in cluster datastore group host image vmtemplate user vm vnet
|
||||
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/*
|
||||
done
|
||||
xmllint --noout --schema $POOL_NAME.xsd samples/$POOL_NAME/*
|
||||
done
|
||||
|
||||
exit 0
|
||||
|
3
share/doc/xsd/test/datastore.0
Normal file
3
share/doc/xsd/test/datastore.0
Normal file
@ -0,0 +1,3 @@
|
||||
NAME = ds0
|
||||
DS_MAD = fs
|
||||
TM_MAD = shared
|
5
share/doc/xsd/test/datastore.1
Normal file
5
share/doc/xsd/test/datastore.1
Normal file
@ -0,0 +1,5 @@
|
||||
NAME = ds1
|
||||
DS_MAD = fs
|
||||
TM_MAD = shared
|
||||
EXTRA = ABC
|
||||
EXTRA2 = 123
|
4
share/doc/xsd/test/image.0
Normal file
4
share/doc/xsd/test/image.0
Normal file
@ -0,0 +1,4 @@
|
||||
NAME = "Ubuntu"
|
||||
PATH = /etc/hosts
|
||||
TYPE = OS
|
||||
DESCRIPTION = "Ubuntu 10.04 desktop for students."
|
5
share/doc/xsd/test/image.1
Normal file
5
share/doc/xsd/test/image.1
Normal file
@ -0,0 +1,5 @@
|
||||
NAME = "Experiment results"
|
||||
TYPE = DATABLOCK
|
||||
SIZE = 10
|
||||
FSTYPE = ext3
|
||||
EXTRA = ABC
|
5
share/doc/xsd/test/template.0
Normal file
5
share/doc/xsd/test/template.0
Normal file
@ -0,0 +1,5 @@
|
||||
NAME = template0
|
||||
MEMORY = 128
|
||||
CPU = 1
|
||||
EXTRA = ABC
|
||||
EXTRA2 = 123
|
1
share/doc/xsd/test/template.1
Normal file
1
share/doc/xsd/test/template.1
Normal file
@ -0,0 +1 @@
|
||||
NAME = template1
|
15
share/doc/xsd/test/vnet.0
Normal file
15
share/doc/xsd/test/vnet.0
Normal file
@ -0,0 +1,15 @@
|
||||
NAME = "Blue LAN"
|
||||
TYPE = FIXED
|
||||
|
||||
BRIDGE = vbr1
|
||||
|
||||
LEASES = [IP=130.10.0.1]
|
||||
LEASES = [IP=130.10.0.2, MAC=50:20:20:20:20:21]
|
||||
LEASES = [IP=130.10.0.3]
|
||||
LEASES = [IP=130.10.0.4]
|
||||
|
||||
# Custom Attributes to be used in Context
|
||||
GATEWAY = 130.10.0.1
|
||||
DNS = 130.10.0.1
|
||||
|
||||
LOAD_BALANCER = 130.10.0.4
|
9
share/doc/xsd/test/vnet.1
Normal file
9
share/doc/xsd/test/vnet.1
Normal file
@ -0,0 +1,9 @@
|
||||
NAME = "R"
|
||||
TYPE = RANGED
|
||||
|
||||
BRIDGE = vbr1
|
||||
|
||||
NETWORK_ADDRESS = 10.10.10.0
|
||||
NETWORK_MASK = 255.255.255.0
|
||||
|
||||
CUSTOM = ABC
|
4
share/doc/xsd/test/vnet.2
Normal file
4
share/doc/xsd/test/vnet.2
Normal file
@ -0,0 +1,4 @@
|
||||
NAME = "Empty"
|
||||
TYPE = FIXED
|
||||
|
||||
BRIDGE = vbr1
|
@ -1,7 +1,7 @@
|
||||
<?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="template.xsd"/>
|
||||
<xs:include schemaLocation="vmtemplate.xsd"/>
|
||||
<xs:element name="VMTEMPLATE_POOL">
|
||||
<xs:complexType>
|
||||
<xs:sequence maxOccurs="1" minOccurs="1">
|
@ -25,6 +25,8 @@
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="CLUSTER_ID" type="xs:integer"/>
|
||||
<xs:element name="CLUSTER" type="xs:string"/>
|
||||
<xs:element name="TYPE" type="xs:integer"/>
|
||||
<xs:element name="BRIDGE" type="xs:string"/>
|
||||
<xs:element name="VLAN" type="xs:integer"/>
|
||||
|
Loading…
Reference in New Issue
Block a user