Merge branch '2.2.y' of ssh://git.cloud.com/var/lib/git/cloudstack-oss into 2.2.y

This commit is contained in:
Chirag Jog 2012-02-18 11:41:27 -08:00
commit 885c9f64a5
34 changed files with 3553 additions and 81 deletions

View File

@ -384,8 +384,8 @@
<arg value="build-apidoc.sh" />
<arg value="${target.dir}/jar" />
<arg value="${deps.dir}" />
<arg value="${dist.dir}" />
<arg value="-f ${commands.file},${commands.ext.file},${commands.simulator.file}" />
<arg value="-d ${dist.dir}" />
</exec>
<echo message="Result locates at ${dist.dir}/commands.xml" />
@ -396,5 +396,9 @@
</chmod>
</target>
</project>
<target name="build-apidocs-zip" depends="build-apidocs">
<delete file="${dist.dir}/apidocs-2.2.y.zip" />
<zip destfile="${dist.dir}/apidocs-2.2.y.zip" basedir="${dist.dir}/xmldoc/html" />
</target>
</project>

View File

@ -323,6 +323,10 @@ JsCookedKeyboardMapper.prototype.inputFeed = function(eventType, code, modifiers
this.mappedInput.push({type : AjaxViewer.KEY_UP, code: AjaxViewer.X11_KEY_SHIFT, modifiers: modifiers});
return;
}
// ENTER/BACKSPACE key should already have been sent through KEY DOWN/KEY UP event
if(code == AjaxViewer.JS_KEY_ENTER || code == AjaxViewer.JS_KEY_BACKSPACE)
return;
this.mappedInput.push({type : AjaxViewer.KEY_DOWN, code: X11Keysym, modifiers: modifiers});
this.mappedInput.push({type : AjaxViewer.KEY_UP, code: X11Keysym, modifiers: modifiers});

View File

@ -619,12 +619,15 @@ public class VmwareStorageManagerImpl implements VmwareStorageManager {
}
// untar OVA file at template directory
command = new Script("tar", 0, s_logger);
command = new Script("tar", 0, s_logger);
command.add("--no-same-owner");
command.add("-xf", installFullName);
command.setWorkDir(installFullPath);
result = command.execute();
s_logger.info("Executing command: " + command.toString());
result = command.execute();
if(result != null) {
String msg = "unable to copy snapshot " + snapshotFullName + " to " + installFullPath;
String msg = "unable to untar snapshot " + snapshotFullName + " to "
+ installFullPath;
s_logger.error(msg);
throw new Exception(msg);
}
@ -702,8 +705,10 @@ public class VmwareStorageManagerImpl implements VmwareStorageManager {
String srcFileName = getOVFFilePath(srcOVAFileName);
if(srcFileName == null) {
Script command = new Script("tar", 0, s_logger);
command.add("--no-same-owner");
command.add("-xf", srcOVAFileName);
command.setWorkDir(secondaryMountPoint + "/" + secStorageDir);
command.setWorkDir(secondaryMountPoint + "/" + secStorageDir);
s_logger.info("Executing command: " + command.toString());
String result = command.execute();
if(result != null) {
String msg = "Unable to unpack snapshot OVA file at: " + srcOVAFileName;

View File

@ -63,7 +63,8 @@ public class VmdkProcessor implements Processor {
String templateFileFullPath = templatePath + templateName + "." + ImageFormat.OVA.getFileExtension();
File templateFile = new File(templateFileFullPath);
Script command = new Script("tar", 0, s_logger);
Script command = new Script("tar", 0, s_logger);
command.add("--no-same-owner", templateFileFullPath);
command.add("-xf", templateFileFullPath);
command.setWorkDir(templateFile.getParent());
String result = command.execute();

Binary file not shown.

View File

@ -78,9 +78,9 @@ tcp_or_udp_entry() {
--destination-port $port -j DNAT \
--to-destination $instIp:$dport &>> $OUTFILE || [ "$op" == "-D" ]) &&
(sudo iptables -t mangle $op PREROUTING --proto $proto -i $dev -d $publicIp \
--destination-port $port -j MARK --set-mark $tableNo) &&
--destination-port $port -j MARK --set-mark $tableNo &>> $OUTFILE || [ "$op" == "-D" ]) &&
(sudo iptables -t mangle $op PREROUTING --proto $proto -i $dev -d $publicIp \
--destination-port $port -m state --state NEW -j CONNMARK --save-mark) &&
--destination-port $port -m state --state NEW -j CONNMARK --save-mark &>> $OUTFILE || [ "$op" == "-D" ]) &&
(sudo iptables -t nat $op OUTPUT --proto $proto -d $publicIp \
--destination-port $port -j DNAT \
--to-destination $instIp:$dport &>> $OUTFILE || [ "$op" == "-D" ]) &&
@ -193,9 +193,9 @@ static_nat() {
# shortcircuit the process if error and it is an append operation
# continue if it is delete
(sudo iptables -t mangle $op PREROUTING -i $dev -d $publicIp \
-j MARK --set-mark $tableNo) &&
-j MARK --set-mark $tableNo &>> $OUTFILE || [ "$op" == "-D" ]) &&
(sudo iptables -t mangle $op PREROUTING -i $dev -d $publicIp \
-m state --state NEW -j CONNMARK --save-mark) &&
-m state --state NEW -j CONNMARK --save-mark &>> $OUTFILE || [ "$op" == "-D" ]) &&
(sudo iptables -t nat $op PREROUTING -i $dev -d $publicIp -j DNAT \
--to-destination $instIp &>> $OUTFILE || [ "$op" == "-D" ]) &&
(sudo iptables $op FORWARD -i $dev -o eth0 -d $instIp -m state \

View File

@ -543,7 +543,16 @@ class firewallConfigBase(serviceCfgBase):
pass
if not status:
bash("iptables -I INPUT -p tcp -m tcp --dport %s -j ACCEPT"%port)
redo = False
result = True
try:
result = bash("iptables -I INPUT -p tcp -m tcp --dport %s -j ACCEPT"%port).isSuccess()
except:
redo = True
if not result or redo:
bash("sleep 30")
bash("iptables -I INPUT -p tcp -m tcp --dport %s -j ACCEPT"%port)
def config(self):
try:

View File

@ -64,7 +64,13 @@ class cloudManagementConfig(serviceCfgBase):
#distro like sl 6.1 needs this folder, or tomcat6 failed to start
bash("mkdir /var/log/cloud-management/")
#set max process per account is unlimited
if os.path.exists("/etc/security/limits.conf"):
cfo = configFileOps("/etc/security/limits.conf")
cfo.add_lines("cloud soft nproc -1\n")
cfo.add_lines("cloud hard nproc -1\n")
cfo.save()
try:
self.syscfg.svo.disableService("tomcat6")
except:

View File

@ -397,6 +397,8 @@ def can_bridge_firewall(session, args):
try:
util.pread2(['iptables', '-N', 'BRIDGE-FIREWALL'])
util.pread2(['iptables', '-I', 'BRIDGE-FIREWALL', '-m', 'state', '--state', 'RELATED,ESTABLISHED', '-j', 'ACCEPT'])
util.pread2(['iptables', '-A', 'BRIDGE-FIREWALL', '-m', 'physdev', '--physdev-is-bridged', '-p', 'udp', '--dport', '67', '--sport', '68', '-j', 'ACCEPT'])
util.pread2(['iptables', '-A', 'BRIDGE-FIREWALL', '-m', 'physdev', '--physdev-is-bridged', '-p', 'udp', '--dport', '68', '--sport', '67', '-j', 'ACCEPT'])
util.pread2(['iptables', '-D', 'FORWARD', '-j', 'RH-Firewall-1-INPUT'])
except:
util.SMlog('Chain BRIDGE-FIREWALL already exists')

View File

@ -177,6 +177,8 @@ public class FirstFitPlanner extends PlannerBase implements DeploymentPlanner {
HostVO host = _hostDao.findById(vm.getLastHostId());
if(host == null){
s_logger.debug("The last host of this VM cannot be found");
}else if(avoid.shouldAvoid(host)){
s_logger.debug("The last host of this VM is in avoid set");
}else{
if (host.getStatus() == Status.Up && host.getHostAllocationState() == Host.HostAllocationState.Enabled) {
if(_capacityMgr.checkIfHostHasCapacity(host.getId(), cpu_requested, ram_requested, true, cpuOverprovisioningFactor)){

View File

@ -129,7 +129,6 @@ import com.cloud.user.User;
import com.cloud.user.dao.AccountDao;
import com.cloud.user.dao.UserDao;
import com.cloud.uservm.UserVm;
import com.cloud.utils.DateUtil;
import com.cloud.utils.Journal;
import com.cloud.utils.NumbersUtil;
import com.cloud.utils.Pair;
@ -645,60 +644,59 @@ public class VirtualMachineManagerImpl implements VirtualMachineManager, Listene
+ ", clusters: " + avoids.getClustersToAvoid()
+ ", hosts: " + avoids.getHostsToAvoid());
}
// edit plan if this vm's ROOT volume is in READY state already
List<VolumeVO> vols = _volsDao.findReadyRootVolumesByInstance(vm.getId());
boolean planChangedByVolume = false;
boolean rootVolumeisRecreatable = false;
DataCenterDeployment originalPlan = plan;
for (VolumeVO vol : vols) {
// make sure if the templateId is unchanged. If it is changed, let planner
// reassign pool for the volume even if it ready.
Long volTemplateId = vol.getTemplateId();
if (volTemplateId != null && volTemplateId.longValue() != template.getId()) {
if (s_logger.isDebugEnabled()) {
s_logger.debug(vol + " of " + vm + " is READY, but template ids don't match, let the planner reassign a new pool");
}
continue;
}
StoragePoolVO pool = _storagePoolDao.findById(vol.getPoolId());
if (!pool.isInMaintenance()) {
if (s_logger.isDebugEnabled()) {
s_logger.debug("Root volume is ready, need to place VM in volume's cluster");
}
long rootVolDcId = pool.getDataCenterId();
Long rootVolPodId = pool.getPodId();
Long rootVolClusterId = pool.getClusterId();
if(planToDeploy != null && planToDeploy.getDataCenterId() != 0){
Long clusterIdSpecified = planToDeploy.getClusterId();
if(clusterIdSpecified != null && rootVolClusterId != null){
if(rootVolClusterId.longValue() != clusterIdSpecified.longValue()){
//cannot satisfy the plan passed in to the planner
if (s_logger.isDebugEnabled()) {
s_logger.debug("Cannot satisfy the deployment plan passed in since the ready Root volume is in different cluster. volume's cluster: "+rootVolClusterId + ", cluster specified: "+clusterIdSpecified);
}
throw new ResourceUnavailableException("Root volume is ready in different cluster, Deployment plan provided cannot be satisfied, unable to create a deployment for " + vm, Cluster.class, clusterIdSpecified);
}
}
plan = new DataCenterDeployment(planToDeploy.getDataCenterId(), planToDeploy.getPodId(), planToDeploy.getClusterId(), planToDeploy.getHostId(), vol.getPoolId());
}else{
plan = new DataCenterDeployment(rootVolDcId, rootVolPodId, rootVolClusterId, null, vol.getPoolId());
if (s_logger.isDebugEnabled()) {
s_logger.debug(vol + " is READY, changing deployment plan to use this pool's dcId: " + rootVolDcId + " , podId: " + rootVolPodId + " , and clusterId: " + rootVolClusterId);
}
planChangedByVolume = true;
if(vol.isRecreatable()){
rootVolumeisRecreatable = true;
}
}
}
}
boolean planChangedByVolume = false;
boolean reuseVolume = true;
DataCenterDeployment originalPlan = plan;
int retry = _retry;
while (retry-- != 0) { // It's != so that it can match -1.
if(reuseVolume){
// edit plan if this vm's ROOT volume is in READY state already
List<VolumeVO> vols = _volsDao.findReadyRootVolumesByInstance(vm.getId());
for (VolumeVO vol : vols) {
// make sure if the templateId is unchanged. If it is changed, let planner
// reassign pool for the volume even if it ready.
Long volTemplateId = vol.getTemplateId();
if (volTemplateId != null && volTemplateId.longValue() != template.getId()) {
if (s_logger.isDebugEnabled()) {
s_logger.debug(vol + " of " + vm + " is READY, but template ids don't match, let the planner reassign a new pool");
}
continue;
}
StoragePoolVO pool = _storagePoolDao.findById(vol.getPoolId());
if (!pool.isInMaintenance()) {
if (s_logger.isDebugEnabled()) {
s_logger.debug("Root volume is ready, need to place VM in volume's cluster");
}
long rootVolDcId = pool.getDataCenterId();
Long rootVolPodId = pool.getPodId();
Long rootVolClusterId = pool.getClusterId();
if(planToDeploy != null && planToDeploy.getDataCenterId() != 0){
Long clusterIdSpecified = planToDeploy.getClusterId();
if(clusterIdSpecified != null && rootVolClusterId != null){
if(rootVolClusterId.longValue() != clusterIdSpecified.longValue()){
//cannot satisfy the plan passed in to the planner
if (s_logger.isDebugEnabled()) {
s_logger.debug("Cannot satisfy the deployment plan passed in since the ready Root volume is in different cluster. volume's cluster: "+rootVolClusterId + ", cluster specified: "+clusterIdSpecified);
}
throw new ResourceUnavailableException("Root volume is ready in different cluster, Deployment plan provided cannot be satisfied, unable to create a deployment for " + vm, Cluster.class, clusterIdSpecified);
}
}
plan = new DataCenterDeployment(planToDeploy.getDataCenterId(), planToDeploy.getPodId(), planToDeploy.getClusterId(), planToDeploy.getHostId(), vol.getPoolId());
}else{
plan = new DataCenterDeployment(rootVolDcId, rootVolPodId, rootVolClusterId, null, vol.getPoolId());
if (s_logger.isDebugEnabled()) {
s_logger.debug(vol + " is READY, changing deployment plan to use this pool's dcId: " + rootVolDcId + " , podId: " + rootVolPodId + " , and clusterId: " + rootVolClusterId);
}
planChangedByVolume = true;
}
}
}
}
VirtualMachineProfileImpl<T> vmProfile = new VirtualMachineProfileImpl<T>(vm, template, offering, account, params);
DeployDestination dest = null;
for (DeploymentPlanner planner : _planners) {
@ -715,12 +713,12 @@ public class VirtualMachineManagerImpl implements VirtualMachineManager, Listene
}
if (dest == null) {
if(planChangedByVolume){
if(rootVolumeisRecreatable){
plan = originalPlan;
planChangedByVolume = false;
continue;
}
if (planChangedByVolume) {
plan = originalPlan;
planChangedByVolume = false;
//do not enter volume reuse for next retry, since we want to look for resorces outside the volume's cluster
reuseVolume = false;
continue;
}
throw new InsufficientServerCapacityException("Unable to create a deployment for " + vmProfile, DataCenter.class, plan.getDataCenterId());
}
@ -744,7 +742,10 @@ public class VirtualMachineManagerImpl implements VirtualMachineManager, Listene
if (vm.getHypervisorType() != HypervisorType.BareMetal) {
_storageMgr.prepare(vmProfile, dest);
}
//since StorageMgr succeeded in volume creation, resue Volume for further tries until current cluster has capacity
if(!reuseVolume){
reuseVolume = true;
}
vmGuru.finalizeVirtualMachineProfile(vmProfile, dest, ctx);
VirtualMachineTO vmTO = hvGuru.implement(vmProfile);

View File

@ -0,0 +1,142 @@
// jdk1.4.1
import javax.xml.transform.*;
import java.io.*;
public class XmlToHtmlConverter extends XmlToHtmlConverterData {
// To turn off generation of API docs for certain roles, comment out
// the appropriate populateFor*() line(s) below.
public static void main(String[] args) {
XmlToHtmlConverter x = new XmlToHtmlConverter();
x.populateForRootAdmin();
x.populateForDomainAdmin();
x.populateForUser();
x.generateToc();
x.generateIndividualCommandPages();
}
public void generateToc() {
try {
TransformerFactory tFactory = TransformerFactory.newInstance();
// Generate the TOC for the API reference for User role
Transformer transformer =
tFactory.newTransformer
(new javax.xml.transform.stream.StreamSource
("generatetocforuser.xsl"));
// The XML to be transformed must be at the location below.
// Modify this path to match your own setup.
transformer.transform
(new javax.xml.transform.stream.StreamSource
("regular_user/regularUserSummary.xml"),
// Modify this path to your own desired output location.
new javax.xml.transform.stream.StreamResult
( new FileOutputStream("html/TOC_User.html")));
// Generate the TOC for root administrator role
Transformer transformer1 =
tFactory.newTransformer
(new javax.xml.transform.stream.StreamSource
("generatetocforadmin.xsl"));
// The XML to be transformed must be at the location below.
// Modify this path to match your own setup.
transformer1.transform
(new javax.xml.transform.stream.StreamSource
("root_admin/rootAdminSummary.xml"),
// Modify this path to your own desired output location.
new javax.xml.transform.stream.StreamResult
( new FileOutputStream("html/TOC_Root_Admin.html")));
// Generate the TOC for domain admin role
Transformer transformer2 =
tFactory.newTransformer
(new javax.xml.transform.stream.StreamSource
("generatetocfordomainadmin.xsl"));
// The XML to be transformed must be at the location below.
// Modify this path to match your own setup.
transformer2.transform
(new javax.xml.transform.stream.StreamSource
("domain_admin/domainAdminSummary.xml"),
// Modify this path to your own desired output location.
new javax.xml.transform.stream.StreamResult
( new FileOutputStream("html/TOC_Domain_Admin.html")));
}
catch (Exception e) {
e.printStackTrace( );
}
}
// Create man pages
public void generateIndividualCommandPages() {
for(String commandName : rootAdminCommandNames) {
try {
TransformerFactory tFactory = TransformerFactory.newInstance();
Transformer transformer =
tFactory.newTransformer
(new javax.xml.transform.stream.StreamSource
("generateadmincommands.xsl"));
transformer.transform
// Modify this path to the location of the input files on your system.
(new javax.xml.transform.stream.StreamSource
("root_admin/"+commandName+".xml"),
// Modify this path with the desired output location.
new javax.xml.transform.stream.StreamResult
( new FileOutputStream("html/root_admin/"+commandName+".html")));
} catch (Exception e) {
e.printStackTrace( );
}
}
for(String commandName : domainAdminCommandNames) {
try {
TransformerFactory tFactory = TransformerFactory.newInstance();
Transformer transformer =
tFactory.newTransformer
(new javax.xml.transform.stream.StreamSource
("generatedomainadmincommands.xsl"));
transformer.transform
// Modify this path with the location of the input files on your system.
(new javax.xml.transform.stream.StreamSource
("domain_admin/"+commandName+".xml"),
// Modify this path to the desired output location.
new javax.xml.transform.stream.StreamResult
( new FileOutputStream("html/domain_admin/"+commandName+".html")));
} catch (Exception e) {
e.printStackTrace( );
}
}
for(String commandName : userCommandNames) {
try {
TransformerFactory tFactory = TransformerFactory.newInstance();
Transformer transformer =
tFactory.newTransformer
(new javax.xml.transform.stream.StreamSource
("generateusercommands.xsl"));
transformer.transform
(new javax.xml.transform.stream.StreamSource
("regular_user/"+commandName+".xml"),
new javax.xml.transform.stream.StreamResult
( new FileOutputStream("html/user/"+commandName+".html")));
} catch (Exception e) {
e.printStackTrace( );
}
}
}
}

View File

@ -24,6 +24,11 @@ TARGETJARDIR="$1"
shift
DEPSDIR="$1"
shift
DISTDIR="$1"
shift
thisdir=$(readlink -f $(dirname "$0"))
PATHSEP=':'
if [[ $OSTYPE == "cygwin" ]] ; then
@ -41,9 +46,35 @@ for file in $DEPSDIR/*.jar; do
CP=${CP}$PATHSEP$file
done
java -cp $CP com.cloud.api.doc.ApiXmlDocWriter $*
java -cp $CP com.cloud.api.doc.ApiXmlDocWriter -d "$DISTDIR" $*
if [ $? -ne 0 ]
then
exit 1
fi
set -e
(cd "$DISTDIR/xmldoc"
cp "$thisdir"/*.java .
cp "$thisdir"/*.xsl .
sed -e 's,%API_HEADER%,User API,g' "$thisdir/generatetoc_header.xsl" >generatetocforuser.xsl
sed -e 's,%API_HEADER%,Root Admin API,g' "$thisdir/generatetoc_header.xsl" >generatetocforadmin.xsl
sed -e 's,%API_HEADER%,Domain Admin API,g' "$thisdir/generatetoc_header.xsl" >generatetocfordomainadmin.xsl
python "$thisdir/gen_toc.py" $(find -type f)
cat generatetocforuser_include.xsl >>generatetocforuser.xsl
cat generatetocforadmin_include.xsl >>generatetocforadmin.xsl
cat generatetocfordomainadmin_include.xsl >>generatetocfordomainadmin.xsl
cat "$thisdir/generatetoc_footer.xsl" >>generatetocforuser.xsl
cat "$thisdir/generatetoc_footer.xsl" >>generatetocforadmin.xsl
cat "$thisdir/generatetoc_footer.xsl" >>generatetocfordomainadmin.xsl
mkdir -p html/user html/domain_admin html/root_admin
cp -r "$thisdir/includes" html
cp -r "$thisdir/images" html
javac -cp . *.java
java -cp . XmlToHtmlConverter
)

246
setup/apidoc/gen_toc.py Normal file
View File

@ -0,0 +1,246 @@
#!/usr/bin/python
import os
import os.path
import sys
from xml.dom import minidom
from xml.parsers.expat import ExpatError
REGULAR_USER = 'u'
DOMAIN_ADMIN = 'd'
ROOT_ADMIN = 'r'
user_to_func = {
REGULAR_USER: 'populateForUser',
DOMAIN_ADMIN: 'populateForDomainAdmin',
ROOT_ADMIN: 'populateForRootAdmin',
}
user_to_cns = {
REGULAR_USER: 'userCommandNames',
DOMAIN_ADMIN: 'domainAdminCommandNames',
ROOT_ADMIN: 'rootAdminCommandNames',
}
dirname_to_user = {
'regular_user': REGULAR_USER,
'domain_admin': DOMAIN_ADMIN,
'root_admin': ROOT_ADMIN,
}
dirname_to_dirname = {
'regular_user': 'user',
'domain_admin': 'domain_admin',
'root_admin': 'root_admin',
}
known_categories = {
'Simulator': 'Simulator',
'SystemVm': 'System VM',
'VirtualMachine': 'Virtual Machine',
'VM': 'Virtual Machine',
'Domain': 'Domain',
'Template': 'Template',
'Iso': 'ISO',
'Volume': 'Volume',
'Vlan': 'VLAN',
'IpAddress': 'Address',
'PortForwarding': 'Firewall',
'Firewall': 'Firewall',
'StaticNat': 'NAT',
'IpForwarding': 'NAT',
'Host': 'Host',
'Cluster': 'Cluster',
'Account': 'Account',
'Snapshot': 'Snapshot',
'User': 'User',
'Os': 'Guest OS',
'ServiceOffering': 'Service Offering',
'DiskOffering': 'Disk Offering',
'LoadBalancer': 'Load Balancer',
'Router': 'Router',
'SystemVm': 'System VM',
'Configuration': 'Configuration',
'Capabilities': 'Configuration',
'Pod': 'Pod',
'Zone': 'Zone',
'NetworkOffering': 'Network Offering',
'Network': 'Network',
'Vpn': 'VPN',
'Limit': 'Limit',
'ResourceCount': 'Limit',
'CloudIdentifier': 'Cloud Identifier',
'InstanceGroup': 'VM Group',
'StorageMaintenance': 'Storage Pool',
'StoragePool': 'Storage Pool',
'SecurityGroup': 'Security Group',
'SSH': 'SSH',
'register': 'Registration',
'AsyncJob': 'Async job',
'Certificate': 'Certificate',
'Hypervisor': 'Hypervisor',
'Alert': 'Alert',
'Event': 'Event',
'login': 'Login',
'logout': 'Logout',
'Capacity': 'System Capacity',
'NetworkDevice': 'Network Device',
'ExternalLoadBalancer': 'Ext Load Balancer',
'ExternalFirewall': 'Ext Firewall',
'Usage': 'Usage',
'TrafficMonitor': 'Usage',
'TrafficType': 'Usage',
'Product': 'Product',
'LB': 'Load Balancer',
'ldap': 'LDAP',
'Swift': 'Swift',
'SecondaryStorage': 'Host',
'Project': 'Project',
'Lun': 'Storage',
'Pool': 'Pool',
}
categories = {}
def choose_category(fn):
for k, v in known_categories.iteritems():
if k in fn:
return v
raise Exception(fn)
for f in sys.argv:
dirname, fn = os.path.split(f)
if not fn.endswith('.xml'):
continue
if fn.endswith('Summary.xml'):
continue
if fn.endswith('SummarySorted.xml'):
continue
if fn == 'alert_types.xml':
continue
if dirname.startswith('./'):
dirname = dirname[2:]
try:
dom = minidom.parse(file(f))
name = dom.getElementsByTagName('name')[0].firstChild.data
isAsync = dom.getElementsByTagName('isAsync')[0].firstChild.data
category = choose_category(fn)
if category not in categories:
categories[category] = []
categories[category].append({
'name': name,
'dirname': dirname_to_dirname[dirname],
'async': isAsync == 'true',
'user': dirname_to_user[dirname],
})
except ExpatError, e:
pass
except IndexError, e:
print fn
def xml_for(command):
name = command['name']
async = command['async'] and ' (A)' or ''
dirname = command['dirname']
return '''<xsl:if test="name=\'%(name)s\'">
<li><a href="%(dirname)s/%(name)s.html"><xsl:value-of select="name"/>%(async)s</a></li>
</xsl:if>
''' % locals()
def write_xml(out, user):
with file(out, 'w') as f:
cat_strings = []
for category in categories.keys():
strings = []
for command in categories[category]:
if command['user'] == user:
strings.append(xml_for(command))
if strings:
all_strings = ''.join(strings)
cat_strings.append((len(strings), category, all_strings))
cat_strings.sort(reverse=True)
i = 0
for _1, category, all_strings in cat_strings:
if i == 0:
print >>f, '<div class="apismallsections">'
print >>f, '''<div class="apismallbullet_box">
<h5>%(category)s</h5>
<ul>
<xsl:for-each select="commands/command">
%(all_strings)s
</xsl:for-each>
</ul>
</div>
''' % locals()
if i == 3:
print >>f, '</div>'
i = 0
else:
i += 1
if i != 0:
print >>f, '</div>'
def java_for(command, user):
name = command['name']
cns = user_to_cns[user]
return '''%(cns)s.add("%(name)s");
''' % locals()
def java_for_user(user):
strings = []
for category in categories.keys():
for command in categories[category]:
if command['user'] == user:
strings.append(java_for(command, user))
func = user_to_func[user]
all_strings = ''.join(strings)
return '''
public void %(func)s() {
%(all_strings)s
}
''' % locals()
def write_java(out):
with file(out, 'w') as f:
print >>f, '''/* Generated using gen_toc.py. Do not edit. */
import java.util.HashSet;
import java.util.Set;
public class XmlToHtmlConverterData {
Set<String> rootAdminCommandNames = new HashSet<String>();
Set<String> domainAdminCommandNames = new HashSet<String>();
Set<String> userCommandNames = new HashSet<String>();
'''
print >>f, java_for_user(REGULAR_USER)
print >>f, java_for_user(ROOT_ADMIN)
print >>f, java_for_user(DOMAIN_ADMIN)
print >>f, '''
}
'''
write_xml('generatetocforuser_include.xsl', REGULAR_USER)
write_xml('generatetocforadmin_include.xsl', ROOT_ADMIN)
write_xml('generatetocfordomainadmin_include.xsl', DOMAIN_ADMIN)
write_java('XmlToHtmlConverterData.java')

View File

@ -0,0 +1,150 @@
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="html" doctype-public="-//W3C//DTD HTML 1.0 Transitional//EN"/>
<xsl:template match="/">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel= "stylesheet" href="../includes/main.css" type="text/css" />
<link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" />
<title>CloudStack API Reference</title>
</head>
<body>
<div id="insidetopbg">
<div id="inside_wrapper">
<div class="uppermenu_panel">
<div class="uppermenu_box">
</div>
</div>
<div id="main_master">
<div id="inside_header">
<div class="header_top">
<a class="cloud_logo" href="http://cloudstack.org"></a>
<div class="mainemenu_panel">
</div>
</div>
</div>
<div id="main_content">
<div class="inside_apileftpanel">
<div class="inside_contentpanel" style="width:930px;">
<div class="api_titlebox">
<div class="api_titlebox_left">
<xsl:for-each select="command/command">
<!-- Modify this line for the release version -->
<span>
CloudStack 2.2.14 Root Admin API Reference
</span>
<p></p>
<h1><xsl:value-of select="name"/></h1>
<p><xsl:value-of select="description"/></p>
</xsl:for-each>
</div>
<div class="api_titlebox_right">
<a class="api_backbutton" href="../TOC_Root_Admin.html"></a>
</div>
</div>
<div class="api_tablepanel">
<h2>Request parameters</h2>
<table class="apitable">
<tr class="hed">
<td style="width:200px;"><strong>Parameter Name</strong></td>
<td style="width:500px;">Description</td>
<td style="width:180px;">Required</td>
</tr>
<xsl:for-each select="command/command/request/arg">
<tr>
<xsl:if test="required='true'">
<td style="width:200px;"><strong><xsl:value-of select="name"/></strong></td>
<td style="width:500px;"><strong><xsl:value-of select="description"/></strong></td>
<td style="width:180px;"><strong><xsl:value-of select="required"/></strong></td>
</xsl:if>
<xsl:if test="required='false'">
<td style="width:200px;"><i><xsl:value-of select="name"/></i></td>
<td style="width:500px;"><i><xsl:value-of select="description"/></i></td>
<td style="width:180px;"><i><xsl:value-of select="required"/></i></td>
</xsl:if>
</tr>
</xsl:for-each>
</table>
</div>
<div class="api_tablepanel">
<h2>Response Tags</h2>
<table class="apitable">
<tr class="hed">
<td style="width:200px;"><strong>Response Name</strong></td>
<td style="width:500px;">Description</td>
</tr>
<xsl:for-each select="command/command/response/arg">
<tr>
<td style="width:200px;"><strong><xsl:value-of select="name"/></strong></td>
<td style="width:500px;"><xsl:value-of select="description"/></td>
<xsl:for-each select="./arguments/arg">
<tr>
<td style="width:180px; padding-left:25px;"><strong><xsl:value-of select="name"/></strong></td>
<td style="width:500px;"><xsl:value-of select="description"/></td>
</tr>
<xsl:for-each select="./arguments/arg">
<tr>
<td style="width:165px; padding-left:40px;"><xsl:value-of select="name"/></td>
<td style="width:500px;"><xsl:value-of select="description"/></td>
</tr>
</xsl:for-each>
</xsl:for-each>
</tr>
</xsl:for-each>
</table>
</div>
</div>
</div>
</div>
</div><!-- #BeginLibraryItem "/libraries/footer.lbi" -->
<div id="footer">
<div id="footer_mainmaster">
<p>Copyright 2011, 2012 Citrix Systems, Inc. All rights reserved </p>
</div>
</div>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-16163918-1");
pageTracker._setDomainName(".cloud.com");
pageTracker._trackPageview();
} catch(err) {}</script>
<script type="text/javascript" language="javascript">llactid=14481</script>
<script type="text/javascript" language="javascript" src="http://t5.trackalyzer.com/trackalyze.js"></script><div class="clear"></div>
</div>
</div>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

View File

@ -0,0 +1,186 @@
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="html" doctype-public="-//W3C//DTD HTML 1.0 Transitional//EN"/>
<xsl:template match="/">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel= "stylesheet" href="../includes/main.css" type="text/css" />
<link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" />
<title>CloudStack API Reference</title>
</head>
<body>
<div id="insidetopbg">
<div id="inside_wrapper">
<div class="uppermenu_panel">
<div class="uppermenu_box"><!-- #BeginLibraryItem "/libraries/uppermenu.lbi" -->
<div class="uppermenu">
<a href="libraries/learn_download.html">Downloads</a> | <a href="libraries/company_news.html">News</a> | <a href="#">Contact Us</a>
</div><!-- #EndLibraryItem --></div>
</div>
<div id="main_master">
<div id="inside_header">
<div class="header_top">
<a class="cloud_logo" href="index.html"></a>
<div class="mainemenu_panel">
</div>
</div>
<div class="insideheader_bot">
<div class="insideheader_botleft">
<h1></h1>
</div>
<div class="insideheader_botright">
<div class="insideheader_button">
<a class="insjoincomm_button" href="#"></a>
<a class="insdownload_button" href="#"></a>
</div>
<div class="insheader_buttonshadow"></div>
</div>
</div>
</div>
<div id="main_content">
<div class="inside_apileftpanel">
<div class="inside_contentpanel" style="width:930px;">
<div class="api_titlebox">
<div class="api_titlebox_left">
<xsl:for-each select="command/command">
<h1><xsl:value-of select="name"/></h1>
<span><xsl:value-of select="description"/></span>
</xsl:for-each>
</div>
<div class="api_titlebox_right">
<a class="api_backbutton" href="#"></a>
</div>
</div>
<div class="api_tablepanel">
<h2>Request parameters</h2>
<table class="apitable">
<tr class="hed">
<td style="width:200px;"><strong>Parameter Name</strong></td>
<td style="width:500px;">Description</td>
<td style="width:180px;">Required</td>
</tr>
<xsl:for-each select="command/command/request/arg">
<tr>
<td style="width:200px;"><strong><xsl:value-of select="name"/></strong></td>
<td style="width:500px;"><xsl:value-of select="description"/></td>
<td style="width:180px;"><xsl:value-of select="required"/></td>
</tr>
</xsl:for-each>
</table>
</div>
<div class="api_tablepanel">
<h2>Response Tags</h2>
<table class="apitable">
<tr class="hed">
<td style="width:200px;"><strong>Response Name</strong></td>
<td style="width:500px;">Description</td>
</tr>
<xsl:for-each select="command/command/response/arg">
<tr>
<td style="width:200px;"><strong><xsl:value-of select="name"/></strong></td>
<td style="width:500px;"><xsl:value-of select="description"/></td>
<xsl:for-each select="./arguments/arg">
<tr>
<td style="width:200px;"><strong><xsl:value-of select="name"/></strong></td>
<td style="width:500px;"><xsl:value-of select="description"/></td>
</tr>
<xsl:for-each select="./arguments/arg">
<tr>
<td style="width:200px;"><strong><xsl:value-of select="name"/></strong></td>
<td style="width:500px;"><xsl:value-of select="description"/></td>
</tr>
</xsl:for-each>
</xsl:for-each>
</tr>
</xsl:for-each>
</table>
</div>
</div>
</div>
</div>
</div><!-- #BeginLibraryItem "/libraries/footer.lbi" -->
<div id="footer">
<div id="footer_mainmaster">
<ul class="footer_linksbox">
<li><strong> Main </strong></li>
<li> <a href="index.html"> Home</a> </li>
<li> <a href="learn_whatcloud.html"> Learn</a> </li>
<li> <a href="products_cloudplatform.html"> Products</a> </li>
<li> <a href="#"> Community</a> </li>
<li> <a href="service_overview.html"> Services</a> </li>
<li> <a href="Partners_Main.html"> Partners</a> </li>
<li> <a href="company_about.html"> Company</a> </li>
</ul>
<ul class="footer_linksbox">
<li><strong> Sub </strong> </li>
<li> <a href="learn_videos.html"> Tour</a> </li>
<li> <a href="learn_download.html"> Downloads</a> </li>
<li> <a href="learn_FAQ.html"> FAQs</a> </li>
<li> <a href="#"> Blog</a> </li>
<li> <a href="#"> Contacts</a> </li>
</ul>
<ul class="footer_linksbox">
<li><strong> Site Info </strong> </li>
<li> <a href="#"> Privacy Policy</a> </li>
<li> <a href="#"> Term of Use</a> </li>
<li> <a href="#"> Contacts</a> </li>
</ul>
<p>Copyright 2010 Cloud.com, Inc. All rights reserved </p>
</div>
</div>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-16163918-1");
pageTracker._setDomainName(".cloud.com");
pageTracker._trackPageview();
} catch(err) {}</script>
<script type="text/javascript" language="javascript">llactid=14481</script>
<script type="text/javascript" language="javascript" src="http://t5.trackalyzer.com/trackalyze.js"></script><!-- #EndLibraryItem --><div class="clear"></div>
</div>
</div>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

View File

@ -0,0 +1,47 @@
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:template match="/">
<html>
<head><title>Cloudstack API</title></head>
<body>
<table border="1">
<tr>
<th>Name</th>
<th>Description</th>
<th>Request Parameters</th>
<th>Response Parameters</th>
</tr>
<xsl:for-each select="command/command">
<tr>
<td><xsl:value-of select="name"/></td>
<td><xsl:value-of select="description"/></td>
<td>
<xsl:for-each select="./request/arg">
<br><b>Name:</b><xsl:value-of select="name"/></br>
<b>Description:</b><xsl:value-of select="description"/>
<br><b>Required:</b><xsl:value-of select="required"/></br>
</xsl:for-each>
</td>
<td>
<xsl:for-each select="./response/arg">
<br><b>Name:</b><xsl:value-of select="name"/></br>
<b>Description:</b><xsl:value-of select="description"/>
<xsl:for-each select="./arguments/arg">
<br><b>Name:</b><xsl:value-of select="name"/></br>
<b>Description:</b><xsl:value-of select="description"/>
<xsl:for-each select="./arguments/arg">
<br><b>Name:</b><xsl:value-of select="name"/></br>
<b>Description:</b><xsl:value-of select="description"/>
</xsl:for-each>
</xsl:for-each>
<br></br>
</xsl:for-each>
</td>
</tr>
</xsl:for-each>
</table>
</body></html>
</xsl:template>
</xsl:stylesheet>

View File

@ -0,0 +1,152 @@
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="html" doctype-public="-//W3C//DTD HTML 1.0 Transitional//EN"/>
<xsl:template match="/">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel= "stylesheet" href="../includes/main.css" type="text/css" />
<link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" />
<title>CloudStack API Reference</title>
</head>
<body>
<div id="insidetopbg">
<div id="inside_wrapper">
<div class="uppermenu_panel">
<div class="uppermenu_box">
</div>
</div>
<div id="main_master">
<div id="inside_header">
<div class="header_top">
<a class="cloud_logo" href="http://cloudstack.org"></a>
<div class="mainemenu_panel">
</div>
</div>
</div>
<div id="main_content">
<div class="inside_apileftpanel">
<div class="inside_contentpanel" style="width:930px;">
<div class="api_titlebox">
<div class="api_titlebox_left">
<xsl:for-each select="command/command">
<!-- Modify this line for the release version -->
<span>
CloudStack v2.2.14 Domain Admin API Reference
</span>
<p></p>
<h1><xsl:value-of select="name"/></h1>
<p><xsl:value-of select="description"/></p>
</xsl:for-each>
</div>
<div class="api_titlebox_right">
<a class="api_backbutton" href="../TOC_Domain_Admin.html"></a>
</div>
</div>
<div class="api_tablepanel">
<h2>Request parameters</h2>
<table class="apitable">
<tr class="hed">
<td style="width:200px;"><strong>Parameter Name</strong></td>
<td style="width:500px;">Description</td>
<td style="width:180px;">Required</td>
</tr>
<xsl:for-each select="command/command/request/arg">
<tr>
<xsl:if test="required='true'">
<td style="width:200px;"><strong><xsl:value-of select="name"/></strong></td>
<td style="width:500px;"><strong><xsl:value-of select="description"/></strong></td>
<td style="width:180px;"><strong><xsl:value-of select="required"/></strong></td>
</xsl:if>
<xsl:if test="required='false'">
<td style="width:200px;"><i><xsl:value-of select="name"/></i></td>
<td style="width:500px;"><i><xsl:value-of select="description"/></i></td>
<td style="width:180px;"><i><xsl:value-of select="required"/></i></td>
</xsl:if>
</tr>
</xsl:for-each>
</table>
</div>
<div class="api_tablepanel">
<h2>Response Tags</h2>
<table class="apitable">
<tr class="hed">
<td style="width:200px;"><strong>Response Name</strong></td>
<td style="width:500px;">Description</td>
</tr>
<xsl:for-each select="command/command/response/arg">
<tr>
<td style="width:200px;"><strong><xsl:value-of select="name"/></strong></td>
<td style="width:500px;"><xsl:value-of select="description"/></td>
<xsl:for-each select="./arguments/arg">
<tr>
<td style="width:180px; padding-left:25px;"><strong><xsl:value-of select="name"/></strong></td>
<td style="width:500px;"><xsl:value-of select="description"/></td>
</tr>
<xsl:for-each select="./arguments/arg">
<tr>
<td style="width:165px; padding-left:40px;"><xsl:value-of select="name"/></td>
<td style="width:500px;"><xsl:value-of select="description"/></td>
</tr>
</xsl:for-each>
</xsl:for-each>
</tr>
</xsl:for-each>
</table>
</div>
</div>
</div>
</div>
</div>
<div id="footer">
<div id="footer_mainmaster">
<p>Copyright 2011, 2012 Citrix Systems, Inc. All rights reserved </p>
</div>
</div>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-16163918-1");
pageTracker._setDomainName(".cloud.com");
pageTracker._trackPageview();
} catch(err) {}</script>
<script type="text/javascript" language="javascript">llactid=14481</script>
<script type="text/javascript" language="javascript" src="http://t5.trackalyzer.com/trackalyze.js"></script><div class="clear"></div>
</div>
</div>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

View File

@ -0,0 +1,39 @@
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:template match="/">
<html>
<head><title>Cloudstack API</title></head>
<body>
<table border="1">
<tr>
<th>Name</th>
<th>Description</th>
<th>Request Parameters</th>
<th>Response Parameters</th>
</tr>
<xsl:for-each select="command/command">
<tr>
<td><xsl:value-of select="name"/></td>
<td><xsl:value-of select="description"/></td>
<td>
<xsl:for-each select="./request/arg">
<br><b>Name:</b><xsl:value-of select="name"/></br>
<b>Description:</b><xsl:value-of select="description"/>
<br><b>Required:</b><xsl:value-of select="required"/></br>
</xsl:for-each>
</td>
<td>
<xsl:for-each select="./response/arg">
<br><b>Name:</b><xsl:value-of select="name"/></br>
<b>Description:</b><xsl:value-of select="description"/>
<br></br>
</xsl:for-each>
</td>
</tr>
</xsl:for-each>
</table>
</body></html>
</xsl:template>
</xsl:stylesheet>

1128
setup/apidoc/generatetoc.xsl Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,32 @@
</div>
</div>
</div>
</div>
</div>
<div id="footer">
<div id="footer_mainmaster">
<p>Copyright 2011, 2012 Citrix Systems, Inc. All rights reserved </p>
</div>
</div>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-16163918-1");
pageTracker._setDomainName(".cloud.com");
pageTracker._trackPageview();
} catch(err) {}</script>
<script type="text/javascript" language="javascript">llactid=14481</script>
<script type="text/javascript" language="javascript" src="http://t5.trackalyzer.com/trackalyze.js"></script><div class="clear"></div>
</div>
</div>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

View File

@ -0,0 +1,52 @@
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="html" doctype-public="-//W3C//DTD HTML 1.0 Transitional//EN"/>
<xsl:template match="/">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel= "stylesheet" href="includes/main.css" type="text/css" />
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
<title>CloudStack API Reference</title>
</head>
<body>
<div id="insidetopbg">
<div id="inside_wrapper">
<div class="uppermenu_panel">
<div class="uppermenu_box"></div>
</div>
<div id="main_master">
<div id="inside_header">
<div class="header_top">
<a class="cloud_logo" href="http://cloudstack.org"></a>
<div class="mainemenu_panel">
</div>
</div>
</div>
<div id="main_content">
<div class="inside_apileftpanel">
<div class="inside_contentpanel" style="width:930px;">
<!-- Modify this line for the release version -->
<h1>CloudStack API Documentation (v2.2.14)</h1>
<div class="apiannouncement_box">
<div class="apiannouncement_contentarea">
<h3>Using the CloudStack API</h3>
<p>For information about how the APIs work, and tips on how to use them, see the
<a href="http://docs.cloud.com/CloudStack_Documentation/Developer's_Guide%3A_CloudStack">Developer's Guide</a>.</p>
</div>
</div>
<div class="api_leftsections">
<h3>%API_HEADER%</h3>
<span>Commands available through the developer API URL and the integration API URL.</span>
<div class="api_legends">
<p><span class="api_legends_async">(A)</span> implies that the command is asynchronous.</p>
<p>(*) implies element has a child.</p>
</div>

View File

@ -0,0 +1,150 @@
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="html" doctype-public="-//W3C//DTD HTML 1.0 Transitional//EN"/>
<xsl:template match="/">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel= "stylesheet" href="../includes/main.css" type="text/css" />
<link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" />
<title>CloudStack API Reference</title>
</head>
<body>
<div id="insidetopbg">
<div id="inside_wrapper">
<div class="uppermenu_panel">
<div class="uppermenu_box"></div>
</div>
<div id="main_master">
<div id="inside_header">
<div class="header_top">
<a class="cloud_logo" href="http://cloudstack.org"></a>
<div class="mainemenu_panel">
</div>
</div>
</div>
<div id="main_content">
<div class="inside_apileftpanel">
<div class="inside_contentpanel" style="width:930px;">
<div class="api_titlebox">
<div class="api_titlebox_left">
<xsl:for-each select="command/command">
<!-- Modify this line for the release version -->
<span>
CloudStack v2.2.14 User API Reference
</span>
<p></p>
<h1><xsl:value-of select="name"/></h1>
<p><xsl:value-of select="description"/></p>
</xsl:for-each>
</div>
<div class="api_titlebox_right">
<a class="api_backbutton" href="../TOC_User.html"></a>
</div>
</div>
<div class="api_tablepanel">
<h2>Request parameters</h2>
<table class="apitable">
<tr class="hed">
<td style="width:200px;"><strong>Parameter Name</strong></td>
<td style="width:500px;">Description</td>
<td style="width:180px;">Required</td>
</tr>
<xsl:for-each select="command/command/request/arg">
<tr>
<xsl:if test="required='true'">
<td style="width:200px;"><strong><xsl:value-of select="name"/></strong></td>
<td style="width:500px;"><strong><xsl:value-of select="description"/></strong></td>
<td style="width:180px;"><strong><xsl:value-of select="required"/></strong></td>
</xsl:if>
<xsl:if test="required='false'">
<td style="width:200px;"><i><xsl:value-of select="name"/></i></td>
<td style="width:500px;"><i><xsl:value-of select="description"/></i></td>
<td style="width:180px;"><i><xsl:value-of select="required"/></i></td>
</xsl:if>
</tr>
</xsl:for-each>
</table>
</div>
<div class="api_tablepanel">
<h2>Response Tags</h2>
<table class="apitable">
<tr class="hed">
<td style="width:200px;"><strong>Response Name</strong></td>
<td style="width:500px;">Description</td>
</tr>
<xsl:for-each select="command/command/response/arg">
<tr>
<td style="width:200px;"><strong><xsl:value-of select="name"/></strong></td>
<td style="width:500px;"><xsl:value-of select="description"/></td>
<xsl:for-each select="./arguments/arg">
<tr>
<td style="width:180px; padding-left:25px;"><strong><xsl:value-of select="name"/></strong></td>
<td style="width:500px;"><xsl:value-of select="description"/></td>
</tr>
<xsl:for-each select="./arguments/arg">
<tr>
<td style="width:165px; padding-left:40px;"><xsl:value-of select="name"/></td>
<td style="width:500px;"><xsl:value-of select="description"/></td>
</tr>
</xsl:for-each>
</xsl:for-each>
</tr>
</xsl:for-each>
</table>
</div>
</div>
</div>
</div>
</div>
<div id="footer">
<div id="footer_mainmaster">
<p>Copyright 2011, 2012 Citrix Systems, Inc. All rights reserved </p>
</div>
</div>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-16163918-1");
pageTracker._setDomainName(".cloud.com");
pageTracker._trackPageview();
} catch(err) {}</script>
<script type="text/javascript" language="javascript">llactid=14481</script>
<script type="text/javascript" language="javascript" src="http://t5.trackalyzer.com/trackalyze.js"></script><div class="clear"></div>
</div>
</div>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 870 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 868 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

File diff suppressed because it is too large Load Diff

View File

@ -1242,7 +1242,13 @@ public class VirtualMachineMO extends BaseMO {
out.close();
// tar files into OVA
if(packToOva) {
if(packToOva) {
// Important! we need to sync file system before we can safely use tar to work around a linux kernal bug(or feature)
s_logger.info("Sync file system before we package OVA...");
Script commandSync = new Script(true, "sync", 0, s_logger);
commandSync.execute();
Script command = new Script(false, "tar", 0, s_logger);
command.setWorkDir(exportDir);
command.add("-cf", exportName + ".ova");
@ -1250,11 +1256,16 @@ public class VirtualMachineMO extends BaseMO {
for(String name: fileNames) {
command.add((new File(name).getName()));
}
String result = command.execute();
if(result == null) {
success = true;
}
s_logger.info("Package OVA with commmand: " + command.toString());
command.execute();
// to be safe, physically test existence of the target OVA file
if((new File(exportDir + File.separator + exportName + ".ova")).exists()) {
success = true;
} else {
s_logger.error(exportDir + File.separator + exportName + ".ova is not created as expected");
}
}
}
} catch(Throwable e) {
@ -1268,9 +1279,8 @@ public class VirtualMachineMO extends BaseMO {
}
}
if(!success) {
new File(exportDir + File.separator + exportName + ".ova").delete();
}
if(!success)
throw new Exception("Unable to finish the whole process to package as a OVA file");
}
}
} finally {