Merge branch 'master' into events-framework

This commit is contained in:
Rohit Yadav 2012-10-30 14:29:04 +05:30
commit 803f539239
783 changed files with 39247 additions and 15550 deletions

11
.gitignore vendored
View File

@ -45,13 +45,18 @@ deps/awsapi-lib/
git-remote-https.exe.stackdump
*.swp
tools/devcloud/devcloudbox/.vagrant
deps/*.jar
deps/*.war
deps/*.mar
*.jar
*.war
*.mar
*.zip
*.iso
*.tar.gz
*.tgz
awsapi/modules/*
!.gitignore
.classpath
.project
.settings.xml
.settings/
db.properties.override
awsapi/overlays/

37
CHANGES Normal file
View File

@ -0,0 +1,37 @@
Apache CloudStack (Incubating) CHANGES
======================================
Full release notes for each release are located in the project's documentation website: http://incubator.apache.org/cloudstack/docs
Version 4.0.0-incubating
------------------------
This is the first release of CloudStack from within the Apache Software Foundation.
Build Tool Changes:
* The project now uses a combination of maven3 and ant for building
* License header auditing is now implemented via the Apache RAT Maven plugin
* Some integrations have been disabled in the default build, due to the license types of our dependencies (See README.md for details on how to build with the optional capabilities)
New Features:
* Inter-VLAN Routing (VPC)
* Site-to-Site VPN
* Local Storage Support for Data Volumes
* Virtual Resource Tagging
* Secure Console Access on XenServer
* Added the ability to create a VM without immediately starting it (via API)
* Upload an Existing Volume to a Virtual Machine
* Dedicated High-Availability Hosts
* Support for Amazon Web Services API (formerly a separate package)
* AWS API Extensions to include Tagging
* Support for Nicira NVP (L2)
* Ceph RBD Support for KVM
* Support for Caringo as Secondary Storage
* KVM Hypervisor support upgraded to work with Ubuntu 12.04 and RHEL 6.3
Security Fixes:
* CVE-2012-4501: Apache CloudStack configuration vulnerability

226
INSTALL.md Normal file
View File

@ -0,0 +1,226 @@
This document describes how to develop, build, package and install Apache CloudStack
(Incubating). For more information please refer to the project's website:
http://incubator.apache.org/cloudstack
Apache CloudStack developers use various platforms for development, this guide
was tested against a CentOS 6.2 x86_64 setup.
Refer to the [wiki](http://cwiki.apache.org/confluence/display/CLOUDSTACK/Index)
for the latest information, especially:
- [Setting up development environment](https://cwiki.apache.org/confluence/display/CLOUDSTACK/Setting+up+CloudStack+Development+Environment) for Apache CloudStack.
- [Building](https://cwiki.apache.org/confluence/display/CLOUDSTACK/Building) Apache CloudStack.
## Setting up Development Environment
### Installing Tools and Dependencies
Install tools and dependencies used for development:
$ yum install git ant ant-devel java-1.6.0-openjdk java-1.6.0-openjdk-devel
mysql mysql-server tomcat6 mkisofs gcc python MySQL-python openssh-clients wget
Set up Maven (3.0.4):
$ wget http://www.us.apache.org/dist/maven/maven-3/3.0.4/binaries/apache-maven-3.0.4-bin.tar.gz
$ cd /usr/local/ # or any path
$ tar -zxvf apache-maven-3.0.4-bin.tar.gz
$ echo export M2_HOME=/usr/local/apache-maven-3.0.4 >> ~/.bashrc # or .zshrc or .profile
$ echo export PATH=${M2_HOME}/bin:${PATH} >> ~/.bashrc # or .zshrc or .profile
Note: Tomcat 6.0.35 has some known issue with Apache CloudStack, please use Tomcat
6.0.33 from http://archive.apache.org/dist/tomcat/tomcat-6/v6.0.33/bin
### Configure Environment
Set CATALINA_HOME to path where you extract/install tomcat, put them in your
.bashrc or .zshrc or .profile:
$ echo export CATALINA_HOME=/usr/share/tomcat6/ >> ~/.bashrc
Fix permissions on CATALINA_HOME:
$ chown -R <you>:<your-group> $CATALINA_HOME
Generate you ssh keys, useful for ssh-ing to your hosts and vm etc.:
$ ssh-keygen -t rsa -q
Apache CloudStack uses some ports, make sure at least those used by the management
server are available and not blocked by any local firewall. Following ports are
used by Apache CloudStack and its entities:
8787: Apache CloudStack (Tomcat) debug socket
9090, 8250: Apache CloudStack Management Server, User/Client API
8096: User/Client to CloudStack Management Server (unauthenticated)
3306: MySQL Server
3922, 8250, 80/443, 111/2049, 53: Secondary Storage VM
3922, 8250, 53: Console Proxy VM
3922, 8250, 53: Virtual Router
22, 80, 443: XenServer, XAPI
22: KVM
443: vCenter
DNS: 53
NFS: 111/2049
### Configuring MySQL Server
Start the MySQL service:
$ service mysqld start
### Getting the Source Code
You may get the source code from the repository hosted on Apache:
$ git clone https://git-wip-us.apache.org/repos/asf/incubator-cloudstack.git
Or, you may fork a repository from the official Apache CloudStack mirror by
Apache on [Github](https://github.com/apache/incubator-cloudstack)
To keep yourself updated on a branch, do:
$ git pull <origin> <branch>
For example, for master:
$ git pull origin master
## Building
Clean and build:
$ mvn clean
$ mvn install
In case you want support for VMWare, SRX and other non-Apache (referred to as nonoss)
compliant libs, you may download the following jar artifacts from respective vendors:
deps/cloud-iControl.jar
deps/cloud-manageontap.jar
deps/cloud-netscaler-sdx.jar
deps/cloud-netscaler.jar
deps/vmware-apputils.jar
deps/vmware-vim.jar
deps/vmware-vim25.jar
Install them to ~/.m2 so maven can get them as dependencies:
$ cd deps
$ ./install-non-oss.sh
And build them with the nonoss flag:
$ mvn install -Dnonoss
Clear old database (if any) and deploy the database schema:
$ mvn -P developer -pl developer -Ddeploydb
Export the following variable if you need to run and debug the management server:
$ export MAVEN_OPTS="-Xmx1024m -Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"
Start the management server:
$ mvn -pl :cloud-client-ui jetty:run
If this works, you've successfully setup a single server Apache CloudStack installation.
Open the following URL on your browser to access the Management Server UI:
http://localhost:8080/client/
Or,
http://management-server-ip-address:8080/client
The default credentials are; user: admin, password: password and the domain
field should be left blank which is defaulted to the ROOT domain.
If you want to contribute your changes, send your [git formatted patch](https://cwiki.apache.org/confluence/display/CLOUDSTACK/Git) to:
https://reviews.apache.org/groups/cloudstack or contact on the developer mailing list.
## Packaging and Installation
Before packaging, please make sure you go through the "Building" section above.
This section describes packaging and installation.
### Debian/Ubuntu
To create debs:
$ mvn -P deps # -D nonoss, for nonoss as described in the "Building" section above
$ dpkg-buildpackage
All the deb packages will be created in ../$PWD
To create an apt repo: (assuming appropriate user privileges)
$ path=/path/to/your/webserver/cloudstack
$ mv ../*.deb $path
$ dpkg-scanpackages $path /dev/null | gzip -9c > $path/Packages.gz
Configure your system to use your new apt repo:
$ echo "deb $path ./" >> /etc/apt/sources.list.d/cloudstack.list
Installation:
Install needed packages, apt-get upgrade for upgrading:
$ apt-get update
$ apt-get install cloud-client # management server
$ apt-get install mysql-server # mysql server
$ apt-get install cloud-agent cloud-system-iso # agent (kvm)
$ apt-get install cloud-awsapi # awsapi server
$ apt-get install cloud-usage # usage server
### RHEL/CentOS
To create rpms:
$ mvn -P deps # -D nonoss, for nonoss as described in the "Building" section above
$ ./waf rpm
All the rpm packages will be create in artifacts/rpmbuild/RPMS/x86_64
To create a yum repo: (assuming appropriate user privileges)
$ path=/path/to/your/webserver/cloudstack
$ cd artifacts/rpmbuild/RPMS/x86_64
$ mv *.rpm $path
$ createrepo $path
Configure your system to use your new yum repo, add the following to /etc/yum.repos.d/cloudstack.repo:
[apache-cloudstack]
name=Apache CloudStack
baseurl=http://webserver.tld/path/to/repo
enabled=1
gpgcheck=0
Installation:
Install needed packages:
$ yum update
$ yum install cloud-client # management server
$ yum install mysql-server # mysql server
$ yum install cloud-agent # agent (kvm)
$ yum install cloud-usage # usage server
## Notes
If you will be using Xen as your hypervisor, please download [vhd-util](http://download.cloud.com.s3.amazonaws.com/tools/vhd-util)
If management server is installed on RHEL/CentOS, then copy vhd-util into:
/usr/lib64/cloud/common/scripts/vm/hypervisor/xenserver/
If management server is installed on Ubuntu, then put vhd-util into:
/usr/lib/cloud/common/scripts/vm/hypervisor/xenserver/vhd-util
Once, you've successfully installed Apache CloudStack you may read the user manuals
and guides which contains technical documentation for Apache CloudStack.

View File

@ -1,70 +0,0 @@
This document describes how to set up and configure a single server CloudStack development environment. If you aren't looking for a development environment The easiest way is to deploy CloudStack from RPM package, building CloudStack from source is for developers. This guide is all about building CloudStack from the source and installing directly from there . This guide is suitable for you if you want to develop the CloudStack.
I have tested this procedure on Fedora Core 14
Step 1: Install the tools and dependencies:
For fedora the package names are ant ant-devel, openjdk, openjdk-devel
Tools:
yum install ant ant-devel openjdk openjdk-devel mysql mysql-server tomcat
Dependencies:
yum install jakarta-commons-collections jakarta-commons-dbcp.noarch apache-commons-logging.noarch jakarta-commons-pool jakarta-commons-httpclient.noarch ws-commons-util.noarch glibc-devel gcc python MySQL-python openssh-clients
Tomcat:
Download tomcat6.0.33 from http://archive.apache.org/dist/tomcat/tomcat-6/v6.0.33/bin/ instead of using distribution's default tomcat. Set CATALINA_HOME and CATALINA_BASE to path where you extract tomcat in environment variable, it would be better off setting them in .bashrc as it will take effect every time you log in.
Note: Tomcat6.0.35 has some known issue with CloudStack, please avoid it
SSHKEY:
Run:
sh-keygen -t rsa -q
to create sshkey for your account if you don't have one
Step 2: Configuration
Start the MySQL service :
# service mysqld start
Step 3: Get the source
$ git clone https://github.com/CloudStack/CloudStack.git
For subsequent pulls, do:
$ git pull
Step 4: Building, testing, and deploying CloudStack using Ant :
Ant is a Java-based build tool designed to be cross-platform, easy to use, extensible, and scalable. Ant is controlled by providing a text file that tells how to perform all the stages of building, testing, and deploying a project. These files are build files, and every project that uses Ant must have at least one named as build.xml. You can see build.xml in your CloudStack source.
Type to build CloudStack :
$ ant clean-all build-all
Type to deploy mgt server :
$ ant deploy-server
Type to deploy database :
$ ant deploydb
Type to run mgt server:
$ ant debug
If all of the above process is successful. You are done the single server CloudStack installation.Now your CloudStack Management Server is running.
Open your browser and type the bellow url in address bar:
http://localhost:8080/client/
OR
http://management-server-ip-address:8080/client
You can see CloudStack Management Console page via a web browser. It will show you management consle login page. You can use the default username and password and leave domain as blank.
The default credentials are “admin” for user and “password” for password. The domain field should be left blank. A blank
domain field is defaulted to the ROOT domain.
NOTE : This document is very basic CloudStack development installation. If you are very new to CloudStack and want to feel the power of CloudStack very quickly in RPM based distro, this document will guide very clear step to get it done. Since I am new to CloudStack, I doing this documentation by learning from community. I will keet update new information in this guide to make it more valuable resource.

288
KEYS
View File

@ -1,288 +0,0 @@
This file contains the PGP keys of various developers.
Users: pgp < KEYS
gpg --import KEYS
Developers:
pgp -kxa <your name> and append it to this file.
(pgpk -ll <your name> && pgpk -xa <your name>)
>> this file.
(gpg --list-sigs <your name>
&& gpg --armor --export <your name>) >>
this file.
Type Bits/KeyID Date User ID
pub 4096R/CC56CEA8 2012-08-06 [expires: 2016-08-06]
uid Chip Childers <chipchilders@apache.org>
sig 3 CC56CEA8 2012-08-06 Chip Childers <chipchilders@apache.org>
sub 4096R/A99A5D58 2012-08-06 [expires: 2016-08-06]
sig CC56CEA8 2012-08-06 Chip Childers <chipchilders@apache.org>
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG/MacGPG2 v2.0.18 (Darwin)
Comment: GPGTools - http://gpgtools.org
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
=eCNG
-----END PGP PUBLIC KEY BLOCK-----
Type Bits/KeyID Date User ID
pub 4096R/DB3ECA42 2012-08-07 [expires: 2017-08-06]
uid Wido den Hollander <wido@widodh.nl>
sig 3 DB3ECA42 2012-08-07 Wido den Hollander <wido@widodh.nl>
sub 4096R/50E9D98F 2012-08-07
sig DB3ECA42 2012-08-07 Wido den Hollander <wido@widodh.nl>
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.11 (GNU/Linux)
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
HpWraBFdP78=
=I9dG
-----END PGP PUBLIC KEY BLOCK-----
pub 4096R/2908DED2 2012-06-29
uid John Kinsella <jlk@stratosec.co>
sig 3 2908DED2 2012-08-07 John Kinsella <jlk@stratosec.co>
sub 4096R/26F845B7 2012-06-29
sig 2908DED2 2012-08-07 John Kinsella <jlk@stratosec.co>
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
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
=BzOC
-----END PGP PUBLIC KEY BLOCK-----
pub 4096R/6FE50F1C 2012-05-11 [expires: 2017-05-10]
uid David Nalley (Code signing key) <ke4qqq@apache.org>
sig 3 6FE50F1C 2012-05-11 David Nalley (Code signing key) <ke4qqq@apache.org>
sig F2EFD0F0 2012-05-21 Christopher David Schultz (Christopher David Schultz) <chris@christopherschultz.net>
sig A67F707E 2012-05-21 Christopher Schultz <chris@christopherschultz.net>
sig 4C75EA05 2012-05-31 Kevin A. McGrail (CODE SIGNING KEY) <kmcgrail@apache.org>
sig E70D2357 2012-08-09 David Nalley <david@gnsa.us>
sub 4096R/1E5F6D9D 2012-05-11 [expires: 2017-05-10]
sig 6FE50F1C 2012-05-11 David Nalley (Code signing key) <ke4qqq@apache.org>
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.12 (GNU/Linux)
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
R5fTvoVeebaUFoTe
=d4EI
-----END PGP PUBLIC KEY BLOCK-----

170
LICENSE
View File

@ -184,7 +184,7 @@ This distribution contains third party resources.
Within the . directory
licensed under the BSD (3-clause) http://www.opensource.org/licenses/BSD-3-Clause (as follows)
Copyright © 2005-2010 Thomas Nagy
Copyright (c) 2005-2010 Thomas Nagy
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
@ -217,7 +217,7 @@ Within the . directory
Within the awsapi directory
licensed under the BSD (3-clause) http://www.opensource.org/licenses/BSD-3-Clause (as follows)
Copyright © 2005-2010 Thomas Nagy
Copyright (c) 2005-2010 Thomas Nagy
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
@ -250,7 +250,7 @@ Within the awsapi directory
Within the console-proxy/js directory
licensed under the MIT License http://www.opensource.org/licenses/mit-license.php (as follows)
Copyright © 2009, John Resig
Copyright (c) 2009, John Resig
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
@ -312,7 +312,7 @@ Within the deps directory
Within the deps/awsapi-lib directory
licensed under the ANTLR 2 License http://www.antlr2.org/license.html (as follows)
ANTLR 2 License
We reserve no legal rights to the ANTLR--it is fully in the public domain. An
@ -328,17 +328,17 @@ Within the deps/awsapi-lib directory
remain intact in our source code. As long as these guidelines are kept, we
expect to continue enhancing this system and expect to make other tools
available as they are completed.
from ANTLR Translator Generator Project http://www.antlr2.org/
antlr-2.7.6.jar http://repo1.maven.org/maven2/antlr/antlr/2.7.6/antlr-2.7.6-sources.jar
licensed under the Apache License, Version 2 http://www.apache.org/licenses/LICENSE-2.0.txt (as above)
Copyright © 2004-2008 The Apache Software Foundation
Copyright (c) 2004-2008 The Apache Software Foundation
from The Apache Software Foundation http://www.apache.org/
XmlSchema-1.4.3.jar
licensed under the Apache License, Version 2 http://www.apache.org/licenses/LICENSE-2.0.txt (as above)
Copyright © 2004-2012 The Apache Software Foundation
Copyright (c) 2004-2012 The Apache Software Foundation
from The Apache Software Foundation http://www.apache.org/
apache-log4j-extras-1.0.jar http://logging.apache.org/log4j/companions/extras/
axiom-api-1.2.8.jar http://ws.apache.org/axiom/source-repository.html
@ -346,6 +346,7 @@ Within the deps/awsapi-lib directory
axis2-1.5.1.jar http://axis.apache.org/axis/
axis2-adb-1.5.1.jar http://axis.apache.org/axis/
axis2-ant-plugin-1.5.1.jar http://axis.apache.org/axis/
axis2-codegen-1.4.1.jar http://axis.apache.org/axis/
axis2-jaxbri-1.5.1.jar http://axis.apache.org/axis/
axis2-jaxws-1.5.1.jar http://axis.apache.org/axis/
axis2-jibx-1.5.1.jar http://axis.apache.org/axis/
@ -366,11 +367,12 @@ Within the deps/awsapi-lib directory
rampart-lib http://axis.apache.org/axis2/java/rampart/download/1.5/download.cgi
woden-api-1.0M8.jar http://svn.apache.org/viewvc/webservices/woden/tags/1.0M8_20080423/
woden-impl-dom-1.0M8.jar http://svn.apache.org/viewvc/webservices/woden/tags/1.0M8_20080423/
wss4j-1.5.8.jar http://ws.apache.org/wss4j/source-repository.html
xercesImpl.jar http://xerces.apache.org/xerces2-j/source-repository.html
xml-apis.jar http://repo1.maven.org/maven2/xml-apis/xml-apis/1.3.04/xml-apis-1.3.04-sources.jar
licensed under the Apache License, Version 2 http://www.apache.org/licenses/LICENSE-2.0.txt (as above)
Copyright © 2009 Google Inc.
Copyright (c) 2009 Google Inc.
from Google Inc. http://google.com
cloud-gson.jar http://code.google.com/p/google-gson/
@ -381,7 +383,7 @@ Within the deps/awsapi-lib directory
licensed under the BSD (3-clause) http://www.opensource.org/licenses/BSD-3-Clause (as follows)
Copyright © 2002-2011 Atsuhiko Yamanaka, JCraft,Inc.
Copyright (c) 2002-2011 Atsuhiko Yamanaka, JCraft,Inc.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
@ -412,7 +414,7 @@ Within the deps/awsapi-lib directory
licensed under the COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 http://www.opensource.org/licenses/CDDL-1.0 (as follows)
Copyright © 1997-2010 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved.
COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
@ -802,7 +804,7 @@ Within the deps/awsapi-lib directory
licensed under the COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 http://www.opensource.org/licenses/CDDL-1.0 (as follows)
Copyright © 2006 Sun Microsystems, Inc. All rights reserved.
Copyright (c) 2006 Sun Microsystems, Inc. All rights reserved.
COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
@ -1190,7 +1192,7 @@ Within the deps/awsapi-lib directory
licensed under the COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 http://www.opensource.org/licenses/CDDL-1.0 (as follows)
Copyright © 1997-2010 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved.
COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
@ -1839,13 +1841,13 @@ Within the deps/awsapi-lib directory
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
OF THE POSSIBILITY OF SUCH DAMAGE.
from DOM4J Project http://dom4j.sourceforge.net/
dom4j-1.6.1.jar http://dom4j.sourceforge.net/source-repository.html
licensed under the MIT License http://www.opensource.org/licenses/mit-license.php (as follows)
Copyright © 2004-2011 QOS.ch
Copyright (c) 2004-2011 QOS.ch
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
@ -2343,21 +2345,79 @@ Within the deps/awsapi-lib directory
use the text of this Exhibit A rather than the text found in the
Original Code Source Code for Your Modifications.]
from Shigeru Chiba http://www.csg.ci.i.u-tokyo.ac.jp/~chiba/javassist/
javassist-3.9.0.GA.jar http://sourceforge.net/projects/jboss/files/Javassist/
Within the patches/systemvm/debian/config/etc directory
placed in the public domain
by Adiscon GmbH http://www.adiscon.com/
rsyslog.conf
by Simon Kelley
dnsmasq.conf
vpcdnsmasq.conf
Within the patches/systemvm/debian/config/etc/apache2 directory
licensed under the Apache License, Version 2 http://www.apache.org/licenses/LICENSE-2.0.txt (as above)
Copyright (c) 2012 The Apache Software Foundation
from The Apache Software Foundation http://www.apache.org/
httpd.conf
ports.conf
sites-available/default
sites-available/default-ssl
vhostexample.conf
Within the patches/systemvm/debian/config/etc/ssh/ directory
licensed under the BSD (2-clause) http://www.opensource.org/licenses/BSD-2-Clause (as follows)
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer. Redistributions in binary form must
reproduce the above copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided with the
distribution.
Neither the name of the author nor the names of contributors may be used to
endorse or promote products derived from this software without specific prior
written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
from OpenSSH Project http://www.openssh.org/
sshd_config
Within the patches/systemvm/debian/config/root/redundant_router directory
placed in the public domain
by The netfilter.org project http://www.netfilter.org/
conntrackd.conf.templ
Within the scripts/storage/secondary directory
licensed under the Apache License, Version 2 http://www.apache.org/licenses/LICENSE-2.0.txt (as above)
Copyright © 2010-2011 OpenStack, LLC.
Copyright (c) 2010-2011 OpenStack, LLC.
from OpenStack, LLC http://www.openstack.org
swift
Within the scripts/vm/hypervisor/xenserver directory
licensed under the Apache License, Version 2 http://www.apache.org/licenses/LICENSE-2.0.txt (as above)
Copyright © 2010-2011 OpenStack, LLC.
Copyright (c) 2010-2011 OpenStack, LLC.
from OpenStack, LLC http://www.openstack.org
swift
@ -2369,7 +2429,7 @@ Within the target/jar directory
licensed under the Apache License, Version 1.1 http://www.apache.org/licenses/LICENSE-1.1 (as follows)
Copyright © 2012 The Apache Software Foundation
Copyright (c) 2012 The Apache Software Foundation
/* ====================================================================
* The Apache Software License, Version 1.1
@ -2429,7 +2489,7 @@ Within the target/jar directory
cloud-commons-discovery.jar http://commons.apache.org/discovery/
licensed under the Apache License, Version 2 http://www.apache.org/licenses/LICENSE-2.0.txt (as above)
Copyright © 2012 The Apache Software Foundation
Copyright (c) 2012 The Apache Software Foundation
from The Apache Software Foundation http://www.apache.org/
cloud-axis.jar http://axis.apache.org/axis/
cloud-cglib.jar http://cglib.sourceforge.net/
@ -2453,12 +2513,12 @@ Within the target/jar directory
cloud-jasypt-1.9.jar http://www.jasypt.org
licensed under the Apache License, Version 2 http://www.apache.org/licenses/LICENSE-2.0.txt (as above)
Copyright © 2003-2007 Luck Consulting Pty Ltd
Copyright (c) 2003-2007 Luck Consulting Pty Ltd
from Luck Consulting Pty Ltd http://gregluck.com/blog/about/
cloud-ehcache.jar http://ehcache.org/
licensed under the Apache License, Version 2 http://www.apache.org/licenses/LICENSE-2.0.txt (as above)
Copyright © 2009 Google Inc.
Copyright (c) 2009 Google Inc.
from Google Inc. http://google.com
cloud-google-gson-1.7.1.jar http://code.google.com/p/google-gson/
@ -2470,7 +2530,7 @@ Within the target/jar directory
licensed under the BSD (3-clause) http://www.opensource.org/licenses/BSD-3-Clause (as follows)
Copyright © 2009, Caringo, Inc.
Copyright (c) 2009, Caringo, Inc.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
@ -2501,7 +2561,7 @@ Within the target/jar directory
licensed under the BSD (3-clause) http://www.opensource.org/licenses/BSD-3-Clause (as follows)
Copyright © 2002-2011 Atsuhiko Yamanaka, JCraft,Inc.
Copyright (c) 2002-2011 Atsuhiko Yamanaka, JCraft,Inc.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
@ -2532,7 +2592,7 @@ Within the target/jar directory
licensed under the BSD (3-clause) http://www.opensource.org/licenses/BSD-3-Clause (as follows)
Copyright © 2007-2008 Trilead AG (http://www.trilead.com)
Copyright (c) 2007-2008 Trilead AG (http://www.trilead.com)
All rights reserved.
Redistribution and use in source and binary forms, with or without
@ -2593,7 +2653,7 @@ Within the target/jar directory
licensed under the COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 http://www.opensource.org/licenses/CDDL-1.0 (as follows)
Copyright © 2006 Sun Microsystems, Inc. All rights reserved.
Copyright (c) 2006 Sun Microsystems, Inc. All rights reserved.
COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
@ -2982,7 +3042,7 @@ Within the target/jar directory
licensed under the COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 http://www.opensource.org/licenses/CDDL-1.0 (as follows)
Copyright © 1997-2010 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved.
COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
@ -3370,7 +3430,7 @@ Within the target/jar directory
licensed under the Common Public License - v 1.0 http://opensource.org/licenses/cpl1.0 (as follows)
Copyright © IBM Corp 2006
Copyright (c) IBM Corp 2006
Common Public License Version 1.0 (CPL)
@ -3812,7 +3872,7 @@ Within the target/jar directory
licensed under the Eclipse Distribution License Version 1.0 http://www.eclipse.org/org/documents/edl-v10.php (as follows)
Copyright © 2012 The Eclipse Foundation.
Copyright (c) 2012 The Eclipse Foundation.
Eclipse Distribution License Version 1.0
@ -3845,6 +3905,34 @@ Within the target/jar directory
from The Eclipse Foundation http://www.eclipse.org
cloud-javax.persistence-2.0.0.jar http://wiki.eclipse.org/EclipseLink/Release/2.0.0
licensed under the MIT License http://www.opensource.org/licenses/mit-license.php (as follows)
Copyright (C) 2008 Tóth István <stoty@tvnet.hu>
2008-2012 Daniel Veillard <veillard@redhat.com>
2009-2011 Bryan Kearney <bkearney@redhat.com>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
from The libvirt project http://libvirt.org/
libvirt-java-0.4.9
licensed under the XStream BSD Style License https://fisheye.codehaus.org/browse/xstream/trunk/LICENSE.txt?hb=true (as follows)
@ -3881,21 +3969,19 @@ Within the target/jar directory
cloud-xstream-1.3.1.jar http://xstream.codehaus.org/repository.html
Within the tools/gcc directory
licensed under the Apache License, Version 2 http://www.apache.org/licenses/LICENSE-2.0.txt (as above)
Copyright © 2009 Google Inc.
from Google Inc. http://google.com
compiler.jar
Within the ui/lib directory
placed in the public domain
by Eric Meyer http://meyerweb.com/eric/
reset.css
licensed under the Apache License, Version 2 http://www.apache.org/licenses/LICENSE-2.0.txt (as above)
Copyright (c) 2006 Google Inc.
from Google Inc. http://google.com
excanvas.js http://code.google.com/p/explorercanvas/
licensed under the BSD (2-clause) http://www.opensource.org/licenses/BSD-2-Clause (as follows)
Copyright © 2008 George McGinley Smith
Copyright (c) 2008 George McGinley Smith
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
@ -3927,7 +4013,7 @@ Within the ui/lib directory
licensed under the MIT License http://www.opensource.org/licenses/mit-license.php (as follows)
Copyright © 2011, John Resig
Copyright (c) 2011, John Resig
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
@ -3953,7 +4039,7 @@ Within the ui/lib directory
licensed under the MIT License http://www.opensource.org/licenses/mit-license.php (as follows)
Copyright © 2006 - 2011 Jörn Zaefferer
Copyright (c) 2006 - 2011 Jörn Zaefferer
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
@ -3979,7 +4065,7 @@ Within the ui/lib directory
licensed under the MIT License http://www.opensource.org/licenses/mit-license.php (as follows)
Copyright © 2010, Sebastian Tschan
Copyright (c) 2010, Sebastian Tschan
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
@ -4005,7 +4091,7 @@ Within the ui/lib directory
licensed under the MIT License http://www.opensource.org/licenses/mit-license.php (as follows)
Copyright © 2006 Klaus Hartl (stilbuero.de)
Copyright (c) 2006 Klaus Hartl (stilbuero.de)
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
@ -4151,7 +4237,7 @@ Within the ui/lib/jquery-ui directory
Within the ui/lib/qunit directory
licensed under the MIT License http://www.opensource.org/licenses/mit-license.php (as follows)
Copyright © 2012 John Resig, Jörn Zaefferer
Copyright (c) 2012 John Resig, Jörn Zaefferer
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
@ -4179,7 +4265,7 @@ Within the ui/lib/qunit directory
Within the utils/src/com/cloud/utils/db directory
licensed under the Apache License, Version 2 http://www.apache.org/licenses/LICENSE-2.0.txt (as above)
Copyright © 2004 Clinton Begin
Copyright (c) 2004 Clinton Begin
from Clinton Begin http://code.google.com/p/mybatis/
ScriptRunner.java http://code.google.com/p/mybatis/

15
NOTICE
View File

@ -449,6 +449,7 @@
axis2-1.5.1.jar
axis2-adb-1.5.1.jar
axis2-ant-plugin-1.5.1.jar
axis2-codegen-1.4.1.jar
axis2-jaxbri-1.5.1.jar
axis2-jaxws-1.5.1.jar
axis2-jibx-1.5.1.jar
@ -672,3 +673,17 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
================================================================================
For
wss4j-1.5.8.jar
Apache WebServices - WSS4J
Copyright 2004-2011 The Apache Software Foundation
This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
This product includes software Copyright University of Southampton IT
Innovation Centre, 2006 (http://www.it-innovation.soton.ac.uk).

View File

@ -45,67 +45,7 @@ under the License.
# Building CloudStack
By default, CloudStack will only build with supporting packages
that are appropved by the ASF as being compatible with the Apache
Software License Version 2.
## Default build
To build the default build target, use maven3 and execute:
maven install
## Including optional third party libraries in your build
If you want to build this software against one of the optional
third party libraries, follow the instructions below:
These third parties jars are non available in Maven central, and
need to be located and downloaded by the developer themselves.
The libraries to download are listed below, by the feature that
they support.
For F5 load balancing support:
cloud-iControl.jar
For Netscaler support:
cloud-netscaler.jar
cloud-netscaler-sdx.jar
For NetApp Storage Support:
cloud-manageontap.jar
For VMware Support:
vmware-vim.jar
vmware-vim25.jar
vmware-apputils.jar
Once downloaded (and named the same as listed above), they can be
installed into your local maven repository with the following command:
cd deps&&sh ./install-non-oss.sh
To perform the build, run the following command:
mvn -Dnonoss install
## Running a developer environment
To run the webapp client:
mvn org.apache.tomcat.maven:tomcat7-maven-plugin:2.0-beta-1:run -pl :cloud-client-ui -am -Pclient
Then hit: http://localhost:8080/cloud-client-ui/
or add in your ~/.m2/settings.xml
<pluginGroups>
<pluginGroup>org.apache.tomcat.maven</pluginGroup>
</pluginGroups>
and save your fingers with mvn tomcat7:run -pl :cloud-client-ui -am -Pclient
Optionally add -Dnonoss to either of the commands above.
If you want to use ide debug: replace mvn with mvnDebug and attach your ide debugger to port 8000
See the INSTALL file.
# Notice of Cryptographic Software
@ -126,5 +66,15 @@ Unrestricted (TSU) exception (see the BIS Export Administration Regulations, Sec
The following provides more details on the included cryptographic software:
TODO
CloudStack makes use of JaSypt cryptographic libraries
CloudStack has a system requirement of MySQL, and uses native database encryption
functionality.
CloudStack makes use of the Bouncy Castle general-purpose encryption library.
CloudStack can optionally interacts with and controls OpenSwan-based VPNs.
CloudStack has a dependency on Apache WSS4J as part of the AWSAPI implementation.
CloudStack has a dependency on and makes use of JSch - a java SSH2 implementation.

260
README.tools.md Normal file
View File

@ -0,0 +1,260 @@
> Licensed to the Apache Software Foundation (ASF) under one
> or more contributor license agreements. See the NOTICE file
> distributed with this work for additional information
> regarding copyright ownership. The ASF licenses this file
> to you under the Apache License, Version 2.0 (the
> "License"); you may not use this file except in compliance
> with the License. You may obtain a copy of the License at
>
> http://www.apache.org/licenses/LICENSE-2.0
>
> Unless required by applicable law or agreed to in writing,
> software distributed under the License is distributed on an
> "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> KIND, either express or implied. See the License for the
> specific language governing permissions and limitations
> under the License.
---------------------------------------------------------------------------
This README describes the various tools available with Apache Cloudstack -
for compiling, deploying, building and testing the project
---------------------------------------------------------------------------
DevCloud
=========================================================
Under tools/devcloud
NOTE - DevCloud (tools/devcloud) is a work in progress. The project has not
determined how to best establish a nightly DevCloud build process, or how to
distribute the image.
#### Contents: ####
Under tools/devcloud are various scripts used to build the devcloud image.
devcloudsetup.sh - the origional devcloud build script (assumes an Ubuntu 12.04
VM image)
$ cd tools/devcloud
* build_vagrant_basebox.sh - a script that uses VirtualBox, VeeWee, Vagrant
(patched) and puppet to create a devcloud basebox
* veewee - configuration files used to build a basic Ubuntu 12.04 vagrant box
via VeeWee
* basebuild - The Vagrantfile and puppet module that gets applied to the basic
Ubuntu 12.04 box
* devcloudbox - The Vagrantfile and puppet module that is used with the
[hopefully] distributed devcloud base box
#### Instructions: ####
To build a "devcloud base box", run you need a system with VirtualBox and rvm
installed (use ruby 1.9.2). Run build_vagrant_basebox.sh to build the base
box.
To use the "devcloud base box" that is created in the previous step, you need
to have installed a forked version of Vagrant (until we make the changes
plugins instead of direct source patches) that can be found here:
Once installed per the Vagrant installation process, run:
$ vagrant box add devcloud [path to devcloud.box]
Then, either go into the devcloudbox folder of your checked out version of the
CloudStack code (incubator-cloudstack/tools/devcloud/devcloudbox), or copy the
contents of that folder to another location.
Assuming the patched Vagrant installation is working, you then
simply run "vagrant up" from within that directory.
#### Installation ####
Install DevCloud Base system:
1. get code from https://github.com/jedi4ever/veewee, and install
2. veewee vbox define devcloud ubuntu-12.04-server-i386
3. put these two files(definition.rb and preseed.cfg) under ./definition/devcloud/
3. veewee vbox build devcloud
Marvin
=========================================================
Under tools/marvin
Marvin is the functional testing framework for CloudStack written in python.
Writing of unittests and functional tests with Marvin makes testing with
cloudstack easier
Visit the
[wiki](https://cwiki.apache.org/confluence/display/CLOUDSTACK/Testing+with+Python)
for the most updated information
#### Dependencies ####
Marvin will require the following dependencies, these will be automatically
downloaded from the python cheeseshop when you install Marvin.
- mysql-connector-python,
- paramiko,
- nose,
- unittest-xml-reporting,
#### Installation ####
$ untar Marvin-0.1.0.tar.gz
$ cd Marvin-0.1.0
$ python setup.py install
#### Features ####
1. very handy cloudstack API python wrapper
2. support async job executing in parallel
3. remote ssh login/execute command
4. mysql query
#### Examples ####
Examples on how to develop your own configuration can be found in the marvin sandbox.
Under tools/marvin/marvin/sandbox
To generate the config for a deployment. Alter the .properties file in the sandbox. For example the
simualtordemo.properties after modification can generate the config file as
shown below
$ python simulator_setup.py -i simulatordemo.properties -o simulatordemo.cfg
To deploy the environment and run the tests
$ python -m marvin.deployAndRun -c simulatordemo.cfg -t /tmp/t.log -r /tmp/r.log -d testcase
#### Tests ####
Functional Tests written using marvin can be found under test/integration
folder. These are tests that are written to be run against a live deployed
system.
To run the tests - you should have marvin installed and correctly importable.
The tests are long running and are best monitored by external hudson jobs.
Also you will have to point marvin to the right configuration file that has
details about your cloudstack deployment. For more help on how to write the
config file and run tests check the tutorial at :
[] (https://cwiki.apache.org/confluence/display/CLOUDSTACK/Testing+with+Python)
#### Build Verification Testing (BVT) ####
These test cases are the core functionality tests that ensure the application
is stable and can be tested thoroughly. These BVT cases definitions are
located at :
[] (https://docs.google.com/a/cloud.com/spreadsheet/ccc?key=0Ak8acbfxQG8ndEppOGZSLV9mUF9idjVkTkZkajhTZkE&invite=CPij0K0L)
##### Guidelines on tests #####
BVT test cases are being developed using Python unittests2. Following are
certain guidelines being followed
1. Tests exercised for the same resource should ideally be present under a
single suite or file.
2. Time-consuming operations that create new cloud resources like server
creation, volume creation etc should not necessarily be exercised per unit
test. The resources can be shared by creating them at the class-level using
setUpClass and shared across all instances during a single run.
3. Certain tests pertaining to NAT, Firewall and Load Balancing warrant fresh
resources per test. Hence a call should be taken by the stakeholders regarding
sharing resources.
4. Ensure that the tearDown/tearDownClass functions clean up all the resources
created during the test run.
For more information about unittests: [] (http://docs.python.org/library/unittest.html)
##### BVT Tests #####
Under test/integration/smoke
The following files contain these BVT cases:
1. test_vm_life_cycle.py - VM Life Cycle tests
2. test_volumes.py - Volumes related tests
3. test_snapshots.py - Snapshots related tests
4. test_disk_offerings.py - Disk Offerings related tests
5. test_service_offerings.py - Service Offerings related tests
6. test_hosts.py - Hosts and Clusters related tests
7. test_iso.py - ISO related tests
8. test_network.py - Network related tests
9. test_primary_storage.py - Primary storage related tests
10. test_secondary_storage.py - Secondary storage related tests
11. test_ssvm.py - SSVM & CPVM related tests
12. test_templates.py - Templates related tests
13. test_routers.py - Router related tests
##### P1 Tests #####
Under test/integration/component
These test cases are the core functionality tests that ensure the application
is stable and can be tested thoroughly. These P1 cases definitions are located
at :
[] (https://docs.google.com/a/clogeny.com/spreadsheet/ccc?key=0Aq5M2ldK6eyedDJBa0EzM0RPNmdVNVZOWnFnOVJJcHc&hl=en_US)
The following files contain these P1 cases:
1. test_snapshots.py - Snapshots related tests
2. test_routers.py - Router related tests
3. test_usage.py - Usage realted tests
4. test_account.py - Account related tests
5. test_resource_limits.py - Resource limits tests
6. test_security_groups.py - Security groups related tests
7. test_templates.py - templates related tests
8. test_volumes.py - Volumes related tests
9. test_blocker_bugs.py - Blocker bugs tests
10. test_project_configs.py - Project global configuration related tests
11. test_project_limits.py - Project resource limits related tests
12. test_project_resources.py - Project resource creation related tests
13. test_project_usage.py - Project usage related tests
14. test_projects - Projects functionality tests
Marvin Sandbox
=========================================================
In: tools/marvin/marvin/sandbox
In here you should find a few common deployment models of CloudStack that you
can configure with properties files to suit your own deployment. One deployment
model for each of - advanced zone, basic zone and a simulator demo are given.
$ ls -
basic/
advanced/
simulator/
Each property file is divided into logical sections and should be familiar to
those who have deployed CloudStack before. Once you have your properties file
you will have to create a JSON configuration of your deployment using the
python script provided in the respective folder.
The demo files are from the tutorial for testing with python that can be found at
https://cwiki.apache.org/confluence/display/CLOUDSTACK/Testing+with+Python
A common deployment model of a simulator.cfg that can be used for debugging is
included. This will configure an advanced zone with simulators that can be used
for debugging purposes when you do not have hardware to debug with.
To do this:
$ cd cloudstack-oss/
$ ant run-simulator #This will start up the mgmt server with the simulator seeded
## In another shell
$ ant run-simulator
test/conf - EC2 script
=========================================================
To run submitCertEC2 and deleteCertEC2 scripts, update parameters in conf/tool.properties file:
* host - ip address of the host where cloud-bridge software is installed
* port - port cloud-bridge software is listening to
* accesspoint - access point for cloud-bridge REST request
* version - Amazon EC2 api version supported by cloud-bridge
* signaturemethod - HmacSHA1 or HmacSHA256
* expires - the date when certificate expires

View File

@ -1,89 +0,0 @@
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you under the Apache License, Version 2.0 (the
-- "License"); you may not use this file except in compliance
-- with the License. You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing,
-- software distributed under the License is distributed on an
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-- KIND, either express or implied. See the License for the
-- specific language governing permissions and limitations
-- under the License.
DROP TABLE IF EXISTS `cloud`.`mockhost`;
DROP TABLE IF EXISTS `cloud`.`mocksecstorage`;
DROP TABLE IF EXISTS `cloud`.`mockstoragepool`;
DROP TABLE IF EXISTS `cloud`.`mockvm`;
DROP TABLE IF EXISTS `cloud`.`mockvolume`;
CREATE TABLE `cloud`.`mockhost` (
`id` bigint unsigned NOT NULL auto_increment,
`name` varchar(255) NOT NULL,
`private_ip_address` char(40),
`private_mac_address` varchar(17),
`private_netmask` varchar(15),
`storage_ip_address` char(40),
`storage_netmask` varchar(15),
`storage_mac_address` varchar(17),
`public_ip_address` char(40),
`public_netmask` varchar(15),
`public_mac_address` varchar(17),
`guid` varchar(255) UNIQUE,
`version` varchar(40) NOT NULL,
`data_center_id` bigint unsigned NOT NULL,
`pod_id` bigint unsigned,
`cluster_id` bigint unsigned COMMENT 'foreign key to cluster',
`cpus` int(10) unsigned,
`speed` int(10) unsigned,
`ram` bigint unsigned,
`capabilities` varchar(255) COMMENT 'host capabilities in comma separated list',
`vm_id` bigint unsigned,
`resource` varchar(255) DEFAULT NULL COMMENT 'If it is a local resource, this is the class name',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `cloud`.`mocksecstorage` (
`id` bigint unsigned NOT NULL auto_increment,
`url` varchar(255),
`capacity` bigint unsigned,
`mount_point` varchar(255),
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `cloud`.`mockstoragepool` (
`id` bigint unsigned NOT NULL auto_increment,
`guid` varchar(255),
`mount_point` varchar(255),
`capacity` bigint,
`pool_type` varchar(40),
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `cloud`.`mockvm` (
`id` bigint unsigned NOT NULL auto_increment,
`name` varchar(255),
`host_id` bigint unsigned,
`type` varchar(40),
`state` varchar(40),
`vnc_port` bigint unsigned,
`memory` bigint unsigned,
`cpu` bigint unsigned,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `cloud`.`mockvolume` (
`id` bigint unsigned NOT NULL auto_increment,
`name` varchar(255),
`size` bigint unsigned,
`path` varchar(255),
`pool_id` bigint unsigned,
`type` varchar(40),
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

View File

@ -33,28 +33,34 @@ import com.cloud.simulator.MockHost;
import com.cloud.utils.component.Manager;
public interface MockAgentManager extends Manager {
public static final long DEFAULT_HOST_MEM_SIZE = 8 * 1024 * 1024 * 1024L; // 8G, unit of
// Mbytes
public static final int DEFAULT_HOST_CPU_CORES = 4; // 2 dual core CPUs (2 x
// 2)
public static final int DEFAULT_HOST_SPEED_MHZ = 8000; // 1 GHz CPUs
boolean configure(String name, Map<String, Object> params) throws ConfigurationException;
public static final long DEFAULT_HOST_MEM_SIZE = 8 * 1024 * 1024 * 1024L; // 8G,
// unit
// of
// Mbytes
public static final int DEFAULT_HOST_CPU_CORES = 4; // 2 dual core CPUs (2 x
// 2)
public static final int DEFAULT_HOST_SPEED_MHZ = 8000; // 1 GHz CPUs
Map<AgentResourceBase, Map<String, String>> createServerResources(Map<String, Object> params);
boolean configure(String name, Map<String, Object> params) throws ConfigurationException;
boolean handleSystemVMStart(long vmId, String privateIpAddress, String privateMacAddress, String privateNetMask, long dcId, long podId, String name, String vmType, String url);
Map<AgentResourceBase, Map<String, String>> createServerResources(Map<String, Object> params);
boolean handleSystemVMStop(long vmId);
boolean handleSystemVMStart(long vmId, String privateIpAddress, String privateMacAddress, String privateNetMask,
long dcId, long podId, String name, String vmType, String url);
GetHostStatsAnswer getHostStatistic(GetHostStatsCommand cmd);
Answer checkHealth(CheckHealthCommand cmd);
Answer pingTest(PingTestCommand cmd);
Answer prepareForMigrate(PrepareForMigrationCommand cmd);
MockHost getHost(String guid);
boolean handleSystemVMStop(long vmId);
Answer maintain(MaintainCommand cmd);
GetHostStatsAnswer getHostStatistic(GetHostStatsCommand cmd);
Answer checkHealth(CheckHealthCommand cmd);
Answer pingTest(PingTestCommand cmd);
Answer prepareForMigrate(PrepareForMigrationCommand cmd);
MockHost getHost(String guid);
Answer maintain(MaintainCommand cmd);
Answer checkNetworkCommand(CheckNetworkCommand cmd);
}

View File

@ -61,321 +61,408 @@ import com.cloud.utils.Pair;
import com.cloud.utils.component.Inject;
import com.cloud.utils.concurrency.NamedThreadFactory;
import com.cloud.utils.db.DB;
import com.cloud.utils.db.Transaction;
import com.cloud.utils.exception.CloudRuntimeException;
import com.cloud.utils.net.NetUtils;
@Local(value = { MockAgentManager.class })
public class MockAgentManagerImpl implements MockAgentManager {
private static final Logger s_logger = Logger.getLogger(MockAgentManagerImpl.class);
@Inject HostPodDao _podDao = null;
@Inject MockHostDao _mockHostDao = null;
@Inject MockVMDao _mockVmDao = null;
@Inject SimulatorManager _simulatorMgr = null;
@Inject AgentManager _agentMgr = null;
@Inject MockStorageManager _storageMgr = null;
@Inject ResourceManager _resourceMgr;
private SecureRandom random;
private Map<String, AgentResourceBase> _resources = new ConcurrentHashMap<String, AgentResourceBase>();
private ThreadPoolExecutor _executor;
private static final Logger s_logger = Logger.getLogger(MockAgentManagerImpl.class);
@Inject
HostPodDao _podDao = null;
@Inject
MockHostDao _mockHostDao = null;
@Inject
MockVMDao _mockVmDao = null;
@Inject
SimulatorManager _simulatorMgr = null;
@Inject
AgentManager _agentMgr = null;
@Inject
MockStorageManager _storageMgr = null;
@Inject
ResourceManager _resourceMgr;
private SecureRandom random;
private Map<String, AgentResourceBase> _resources = new ConcurrentHashMap<String, AgentResourceBase>();
private ThreadPoolExecutor _executor;
private Pair<String, Long> getPodCidr(long podId, long dcId) {
try {
HashMap<Long, List<Object>> podMap = _podDao
.getCurrentPodCidrSubnets(dcId, 0);
List<Object> cidrPair = podMap.get(podId);
String cidrAddress = (String) cidrPair.get(0);
Long cidrSize = (Long)cidrPair.get(1);
return new Pair<String, Long>(cidrAddress, cidrSize);
} catch (PatternSyntaxException e) {
s_logger.error("Exception while splitting pod cidr");
return null;
} catch(IndexOutOfBoundsException e) {
s_logger.error("Invalid pod cidr. Please check");
return null;
}
}
private Pair<String, Long> getPodCidr(long podId, long dcId) {
try {
private String getIpAddress(long instanceId, long dcId, long podId) {
Pair<String, Long> cidr = this.getPodCidr(podId, dcId);
return NetUtils.long2Ip(NetUtils.ip2Long(cidr.first()) + instanceId);
}
private String getMacAddress(long dcId, long podId, long clusterId, int instanceId) {
return NetUtils.long2Mac((dcId << 40 + podId << 32 + clusterId << 24 + instanceId));
}
public synchronized int getNextAgentId(long cidrSize) {
return random.nextInt((int)cidrSize);
}
@Override
@DB
public Map<AgentResourceBase, Map<String, String>> createServerResources(
Map<String, Object> params) {
Map<String, String> args = new HashMap<String, String>();
Map<AgentResourceBase, Map<String,String>> newResources = new HashMap<AgentResourceBase, Map<String,String>>();
AgentResourceBase agentResource;
long cpuCore = Long.parseLong((String)params.get("cpucore"));
long cpuSpeed = Long.parseLong((String)params.get("cpuspeed"));
long memory = Long.parseLong((String)params.get("memory"));
long localStorageSize = Long.parseLong((String)params.get("localstorage"));
synchronized (this) {
long dataCenterId = Long.parseLong((String)params.get("zone"));
long podId = Long.parseLong((String)params.get("pod"));
long clusterId = Long.parseLong((String)params.get("cluster"));
long cidrSize = getPodCidr(podId, dataCenterId).second();
HashMap<Long, List<Object>> podMap = _podDao.getCurrentPodCidrSubnets(dcId, 0);
List<Object> cidrPair = podMap.get(podId);
String cidrAddress = (String) cidrPair.get(0);
Long cidrSize = (Long) cidrPair.get(1);
return new Pair<String, Long>(cidrAddress, cidrSize);
} catch (PatternSyntaxException e) {
s_logger.error("Exception while splitting pod cidr");
return null;
} catch (IndexOutOfBoundsException e) {
s_logger.error("Invalid pod cidr. Please check");
return null;
}
}
int agentId = getNextAgentId(cidrSize);
String ipAddress = getIpAddress(agentId, dataCenterId, podId);
String macAddress = getMacAddress(dataCenterId, podId, clusterId, agentId);
MockHostVO mockHost = new MockHostVO();
mockHost.setDataCenterId(dataCenterId);
mockHost.setPodId(podId);
mockHost.setClusterId(clusterId);
mockHost.setCapabilities("hvm");
mockHost.setCpuCount(cpuCore);
mockHost.setCpuSpeed(cpuSpeed);
mockHost.setMemorySize(memory);
String guid = UUID.randomUUID().toString();
mockHost.setGuid(guid);
mockHost.setName("SimulatedAgent." + guid);
mockHost.setPrivateIpAddress(ipAddress);
mockHost.setPublicIpAddress(ipAddress);
mockHost.setStorageIpAddress(ipAddress);
mockHost.setPrivateMacAddress(macAddress);
mockHost.setPublicMacAddress(macAddress);
mockHost.setStorageMacAddress(macAddress);
mockHost.setVersion(this.getClass().getPackage().getImplementationVersion());
mockHost.setResource("com.cloud.agent.AgentRoutingResource");
mockHost = _mockHostDao.persist(mockHost);
_storageMgr.getLocalStorage(guid, localStorageSize);
private String getIpAddress(long instanceId, long dcId, long podId) {
Pair<String, Long> cidr = this.getPodCidr(podId, dcId);
return NetUtils.long2Ip(NetUtils.ip2Long(cidr.first()) + instanceId);
}
agentResource = new AgentRoutingResource();
if (agentResource != null) {
try {
params.put("guid", mockHost.getGuid());
agentResource.start();
agentResource.configure(mockHost.getName(),
params);
private String getMacAddress(long dcId, long podId, long clusterId, int instanceId) {
return NetUtils.long2Mac((dcId << 40 + podId << 32 + clusterId << 24 + instanceId));
}
newResources.put(agentResource, args);
} catch (ConfigurationException e) {
s_logger
.error("error while configuring server resource"
+ e.getMessage());
}
}
}
return newResources;
}
@Override
public boolean configure(String name, Map<String, Object> params)
throws ConfigurationException {
try {
random = SecureRandom.getInstance("SHA1PRNG");
_executor = new ThreadPoolExecutor(1, 5, 1, TimeUnit.DAYS, new LinkedBlockingQueue<Runnable>(), new NamedThreadFactory("Simulator-Agent-Mgr"));
//ComponentLocator locator = ComponentLocator.getCurrentLocator();
//_simulatorMgr = (SimulatorManager) locator.getComponent(SimulatorManager.Name);
} catch (NoSuchAlgorithmException e) {
s_logger.debug("Failed to initialize random:" + e.toString());
return false;
}
return true;
}
@Override
public boolean handleSystemVMStart(long vmId, String privateIpAddress, String privateMacAddress, String privateNetMask, long dcId, long podId, String name, String vmType, String url) {
_executor.execute(new SystemVMHandler(vmId, privateIpAddress, privateMacAddress, privateNetMask, dcId, podId, name, vmType, _simulatorMgr, url));
return true;
}
@Override
public boolean handleSystemVMStop(long vmId) {
_executor.execute(new SystemVMHandler(vmId));
return true;
}
private class SystemVMHandler implements Runnable {
private long vmId;
private String privateIpAddress;
private String privateMacAddress;
private String privateNetMask;
private long dcId;
private long podId;
private String guid;
private String name;
private String vmType;
private SimulatorManager mgr;
private String mode;
private String url;
public SystemVMHandler(long vmId, String privateIpAddress, String privateMacAddress, String privateNetMask, long dcId, long podId, String name, String vmType,
SimulatorManager mgr, String url) {
this.vmId = vmId;
this.privateIpAddress = privateIpAddress;
this.privateMacAddress = privateMacAddress;
this.privateNetMask = privateNetMask;
this.dcId = dcId;
this.guid = "SystemVM-" + UUID.randomUUID().toString();
this.name = name;
this.vmType = vmType;
this.mgr = mgr;
this.mode = "Start";
this.url = url;
this.podId = podId;
}
public SystemVMHandler(long vmId) {
this.vmId = vmId;
this.mode = "Stop";
}
@Override
@DB
public void run() {
if (this.mode.equalsIgnoreCase("Stop")) {
MockHost host = _mockHostDao.findByVmId(this.vmId);
if (host != null) {
String guid = host.getGuid();
if (guid != null) {
AgentResourceBase res = _resources.get(guid);
if (res != null) {
res.stop();
_resources.remove(guid);
}
}
}
return;
}
String resource = null;
if (vmType.equalsIgnoreCase("secstorage")) {
resource = "com.cloud.agent.AgentStorageResource";
}
MockHostVO mockHost = new MockHostVO();
mockHost.setDataCenterId(this.dcId);
mockHost.setPodId(this.podId);
mockHost.setCpuCount(DEFAULT_HOST_CPU_CORES);
mockHost.setCpuSpeed(DEFAULT_HOST_SPEED_MHZ);
mockHost.setMemorySize(DEFAULT_HOST_MEM_SIZE);
mockHost.setGuid(this.guid);
mockHost.setName(name);
mockHost.setPrivateIpAddress(this.privateIpAddress);
mockHost.setPublicIpAddress(this.privateIpAddress);
mockHost.setStorageIpAddress(this.privateIpAddress);
mockHost.setPrivateMacAddress(this.privateMacAddress);
mockHost.setPublicMacAddress(this.privateMacAddress);
mockHost.setStorageMacAddress(this.privateMacAddress);
mockHost.setVersion(this.getClass().getPackage().getImplementationVersion());
mockHost.setResource(resource);
mockHost.setVmId(vmId);
mockHost = _mockHostDao.persist(mockHost);
if (vmType.equalsIgnoreCase("secstorage")) {
AgentStorageResource storageResource = new AgentStorageResource();
try {
Map<String, Object> params = new HashMap<String, Object>();
Map<String, String> details = new HashMap<String, String>();
params.put("guid", this.guid);
details.put("guid", this.guid);
storageResource.configure("secondaryStorage", params);
storageResource.start();
//on the simulator the ssvm is as good as a direct agent
_resourceMgr.addHost(mockHost.getDataCenterId(), storageResource, Host.Type.SecondaryStorageVM, details);
_resources.put(this.guid, storageResource);
} catch (ConfigurationException e) {
s_logger.debug("Failed to load secondary storage resource: " + e.toString());
return;
}
}
}
}
public synchronized int getNextAgentId(long cidrSize) {
return random.nextInt((int) cidrSize);
}
@Override
public MockHost getHost(String guid) {
return _mockHostDao.findByGuid(guid);
}
@Override
@DB
public Map<AgentResourceBase, Map<String, String>> createServerResources(Map<String, Object> params) {
@Override
public GetHostStatsAnswer getHostStatistic(GetHostStatsCommand cmd) {
String hostGuid = cmd.getHostGuid();
MockHost host = _mockHostDao.findByGuid(hostGuid);
if (host == null) {
return null;
}
List<MockVMVO> vms = _mockVmDao.findByHostId(host.getId());
double usedMem = 0.0;
double usedCpu = 0.0;
for (MockVMVO vm : vms) {
usedMem += vm.getMemory();
usedCpu += vm.getCpu();
}
HostStatsEntry hostStats = new HostStatsEntry();
hostStats.setTotalMemoryKBs(host.getMemorySize());
hostStats.setFreeMemoryKBs(host.getMemorySize() - usedMem);
hostStats.setNetworkReadKBs(32768);
hostStats.setNetworkWriteKBs(16384);
hostStats.setCpuUtilization(usedCpu/(host.getCpuCount() * host.getCpuSpeed()));
hostStats.setEntityType("simulator-host");
hostStats.setHostId(cmd.getHostId());
return new GetHostStatsAnswer(cmd, hostStats);
}
Map<String, String> args = new HashMap<String, String>();
Map<AgentResourceBase, Map<String, String>> newResources = new HashMap<AgentResourceBase, Map<String, String>>();
AgentResourceBase agentResource;
long cpuCore = Long.parseLong((String) params.get("cpucore"));
long cpuSpeed = Long.parseLong((String) params.get("cpuspeed"));
long memory = Long.parseLong((String) params.get("memory"));
long localStorageSize = Long.parseLong((String) params.get("localstorage"));
synchronized (this) {
long dataCenterId = Long.parseLong((String) params.get("zone"));
long podId = Long.parseLong((String) params.get("pod"));
long clusterId = Long.parseLong((String) params.get("cluster"));
long cidrSize = getPodCidr(podId, dataCenterId).second();
int agentId = getNextAgentId(cidrSize);
String ipAddress = getIpAddress(agentId, dataCenterId, podId);
String macAddress = getMacAddress(dataCenterId, podId, clusterId, agentId);
MockHostVO mockHost = new MockHostVO();
mockHost.setDataCenterId(dataCenterId);
mockHost.setPodId(podId);
mockHost.setClusterId(clusterId);
mockHost.setCapabilities("hvm");
mockHost.setCpuCount(cpuCore);
mockHost.setCpuSpeed(cpuSpeed);
mockHost.setMemorySize(memory);
String guid = UUID.randomUUID().toString();
mockHost.setGuid(guid);
mockHost.setName("SimulatedAgent." + guid);
mockHost.setPrivateIpAddress(ipAddress);
mockHost.setPublicIpAddress(ipAddress);
mockHost.setStorageIpAddress(ipAddress);
mockHost.setPrivateMacAddress(macAddress);
mockHost.setPublicMacAddress(macAddress);
mockHost.setStorageMacAddress(macAddress);
mockHost.setVersion(this.getClass().getPackage().getImplementationVersion());
mockHost.setResource("com.cloud.agent.AgentRoutingResource");
@Override
public Answer checkHealth(CheckHealthCommand cmd) {
return new Answer(cmd);
}
Transaction txn = Transaction.open(Transaction.SIMULATOR_DB);
try {
txn.start();
mockHost = _mockHostDao.persist(mockHost);
txn.commit();
} catch (Exception ex) {
txn.rollback();
s_logger.error("Error while configuring mock agent " + ex.getMessage());
throw new CloudRuntimeException("Error configuring agent", ex);
} finally {
txn.close();
txn = Transaction.open(Transaction.CLOUD_DB);
txn.close();
}
_storageMgr.getLocalStorage(guid, localStorageSize);
@Override
public Answer pingTest(PingTestCommand cmd) {
return new Answer(cmd);
}
agentResource = new AgentRoutingResource();
if (agentResource != null) {
try {
params.put("guid", mockHost.getGuid());
agentResource.start();
agentResource.configure(mockHost.getName(), params);
newResources.put(agentResource, args);
} catch (ConfigurationException e) {
s_logger.error("error while configuring server resource" + e.getMessage());
}
}
}
return newResources;
}
@Override
public PrepareForMigrationAnswer prepareForMigrate(PrepareForMigrationCommand cmd) {
VirtualMachineTO vm = cmd.getVirtualMachine();
if (s_logger.isDebugEnabled()) {
s_logger.debug("Preparing host for migrating " + vm);
}
return new PrepareForMigrationAnswer(cmd);
}
@Override
public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
try {
random = SecureRandom.getInstance("SHA1PRNG");
_executor = new ThreadPoolExecutor(1, 5, 1, TimeUnit.DAYS, new LinkedBlockingQueue<Runnable>(),
new NamedThreadFactory("Simulator-Agent-Mgr"));
// ComponentLocator locator = ComponentLocator.getCurrentLocator();
// _simulatorMgr = (SimulatorManager)
// locator.getComponent(SimulatorManager.Name);
} catch (NoSuchAlgorithmException e) {
s_logger.debug("Failed to initialize random:" + e.toString());
return false;
}
return true;
}
@Override
public boolean handleSystemVMStart(long vmId, String privateIpAddress, String privateMacAddress,
String privateNetMask, long dcId, long podId, String name, String vmType, String url) {
_executor.execute(new SystemVMHandler(vmId, privateIpAddress, privateMacAddress, privateNetMask, dcId, podId,
name, vmType, _simulatorMgr, url));
return true;
}
@Override
public boolean start() {
return true;
}
@Override
public boolean handleSystemVMStop(long vmId) {
_executor.execute(new SystemVMHandler(vmId));
return true;
}
private class SystemVMHandler implements Runnable {
private long vmId;
private String privateIpAddress;
private String privateMacAddress;
private String privateNetMask;
private long dcId;
private long podId;
private String guid;
private String name;
private String vmType;
private SimulatorManager mgr;
private String mode;
private String url;
@Override
public boolean stop() {
return true;
}
public SystemVMHandler(long vmId, String privateIpAddress, String privateMacAddress, String privateNetMask,
long dcId, long podId, String name, String vmType, SimulatorManager mgr, String url) {
this.vmId = vmId;
this.privateIpAddress = privateIpAddress;
this.privateMacAddress = privateMacAddress;
this.privateNetMask = privateNetMask;
this.dcId = dcId;
this.guid = "SystemVM-" + UUID.randomUUID().toString();
this.name = name;
this.vmType = vmType;
this.mgr = mgr;
this.mode = "Start";
this.url = url;
this.podId = podId;
}
public SystemVMHandler(long vmId) {
this.vmId = vmId;
this.mode = "Stop";
}
@Override
public String getName() {
return this.getClass().getSimpleName();
}
@Override
@DB
public void run() {
Transaction txn = Transaction.open(Transaction.SIMULATOR_DB);
try {
if (this.mode.equalsIgnoreCase("Stop")) {
txn.start();
MockHost host = _mockHostDao.findByVmId(this.vmId);
if (host != null) {
String guid = host.getGuid();
if (guid != null) {
AgentResourceBase res = _resources.get(guid);
if (res != null) {
res.stop();
_resources.remove(guid);
}
}
}
txn.commit();
return;
}
} catch (Exception ex) {
txn.rollback();
throw new CloudRuntimeException("Unable to get host " + guid + " due to " + ex.getMessage(), ex);
} finally {
txn.close();
txn = Transaction.open(Transaction.CLOUD_DB);
txn.close();
}
@Override
public MaintainAnswer maintain(com.cloud.agent.api.MaintainCommand cmd) {
return new MaintainAnswer(cmd);
}
String resource = null;
if (vmType.equalsIgnoreCase("secstorage")) {
resource = "com.cloud.agent.AgentStorageResource";
}
MockHostVO mockHost = new MockHostVO();
mockHost.setDataCenterId(this.dcId);
mockHost.setPodId(this.podId);
mockHost.setCpuCount(DEFAULT_HOST_CPU_CORES);
mockHost.setCpuSpeed(DEFAULT_HOST_SPEED_MHZ);
mockHost.setMemorySize(DEFAULT_HOST_MEM_SIZE);
mockHost.setGuid(this.guid);
mockHost.setName(name);
mockHost.setPrivateIpAddress(this.privateIpAddress);
mockHost.setPublicIpAddress(this.privateIpAddress);
mockHost.setStorageIpAddress(this.privateIpAddress);
mockHost.setPrivateMacAddress(this.privateMacAddress);
mockHost.setPublicMacAddress(this.privateMacAddress);
mockHost.setStorageMacAddress(this.privateMacAddress);
mockHost.setVersion(this.getClass().getPackage().getImplementationVersion());
mockHost.setResource(resource);
mockHost.setVmId(vmId);
Transaction simtxn = Transaction.open(Transaction.SIMULATOR_DB);
try {
simtxn.start();
mockHost = _mockHostDao.persist(mockHost);
simtxn.commit();
} catch (Exception ex) {
simtxn.rollback();
throw new CloudRuntimeException("Unable to persist host " + mockHost.getGuid() + " due to "
+ ex.getMessage(), ex);
} finally {
simtxn.close();
simtxn = Transaction.open(Transaction.CLOUD_DB);
simtxn.close();
}
if (vmType.equalsIgnoreCase("secstorage")) {
AgentStorageResource storageResource = new AgentStorageResource();
try {
Map<String, Object> params = new HashMap<String, Object>();
Map<String, String> details = new HashMap<String, String>();
params.put("guid", this.guid);
details.put("guid", this.guid);
storageResource.configure("secondaryStorage", params);
storageResource.start();
// on the simulator the ssvm is as good as a direct
// agent
_resourceMgr.addHost(mockHost.getDataCenterId(), storageResource, Host.Type.SecondaryStorageVM,
details);
_resources.put(this.guid, storageResource);
} catch (ConfigurationException e) {
s_logger.debug("Failed to load secondary storage resource: " + e.toString());
return;
}
}
}
}
@Override
public MockHost getHost(String guid) {
Transaction txn = Transaction.open(Transaction.SIMULATOR_DB);
try {
txn.start();
MockHost _host = _mockHostDao.findByGuid(guid);
txn.commit();
if (_host != null) {
return _host;
} else {
s_logger.error("Host with guid " + guid + " was not found");
return null;
}
} catch (Exception ex) {
txn.rollback();
throw new CloudRuntimeException("Unable to get host " + guid + " due to " + ex.getMessage(), ex);
} finally {
txn.close();
txn = Transaction.open(Transaction.CLOUD_DB);
txn.close();
}
}
@Override
public GetHostStatsAnswer getHostStatistic(GetHostStatsCommand cmd) {
String hostGuid = cmd.getHostGuid();
MockHost host = null;
Transaction txn = Transaction.open(Transaction.SIMULATOR_DB);
try {
txn.start();
host = _mockHostDao.findByGuid(hostGuid);
txn.commit();
if (host == null) {
return null;
}
} catch (Exception ex) {
txn.rollback();
throw new CloudRuntimeException("Unable to get host " + hostGuid + " due to " + ex.getMessage(), ex);
} finally {
txn.close();
txn = Transaction.open(Transaction.CLOUD_DB);
txn.close();
}
Transaction vmtxn = Transaction.open(Transaction.SIMULATOR_DB);
try {
vmtxn.start();
List<MockVMVO> vms = _mockVmDao.findByHostId(host.getId());
vmtxn.commit();
double usedMem = 0.0;
double usedCpu = 0.0;
for (MockVMVO vm : vms) {
usedMem += vm.getMemory();
usedCpu += vm.getCpu();
}
HostStatsEntry hostStats = new HostStatsEntry();
hostStats.setTotalMemoryKBs(host.getMemorySize());
hostStats.setFreeMemoryKBs(host.getMemorySize() - usedMem);
hostStats.setNetworkReadKBs(32768);
hostStats.setNetworkWriteKBs(16384);
hostStats.setCpuUtilization(usedCpu / (host.getCpuCount() * host.getCpuSpeed()));
hostStats.setEntityType("simulator-host");
hostStats.setHostId(cmd.getHostId());
return new GetHostStatsAnswer(cmd, hostStats);
} catch (Exception ex) {
vmtxn.rollback();
throw new CloudRuntimeException("Unable to get Vms on host " + host.getGuid() + " due to "
+ ex.getMessage(), ex);
} finally {
vmtxn.close();
vmtxn = Transaction.open(Transaction.CLOUD_DB);
vmtxn.close();
}
}
@Override
public Answer checkHealth(CheckHealthCommand cmd) {
return new Answer(cmd);
}
@Override
public Answer pingTest(PingTestCommand cmd) {
return new Answer(cmd);
}
@Override
public PrepareForMigrationAnswer prepareForMigrate(PrepareForMigrationCommand cmd) {
VirtualMachineTO vm = cmd.getVirtualMachine();
if (s_logger.isDebugEnabled()) {
s_logger.debug("Preparing host for migrating " + vm);
}
return new PrepareForMigrationAnswer(cmd);
}
@Override
public boolean start() {
return true;
}
@Override
public boolean stop() {
return true;
}
@Override
public String getName() {
return this.getClass().getSimpleName();
}
@Override
public MaintainAnswer maintain(com.cloud.agent.api.MaintainCommand cmd) {
return new MaintainAnswer(cmd);
}
@Override
public Answer checkNetworkCommand(CheckNetworkCommand cmd) {
if (s_logger.isDebugEnabled()) {
s_logger.debug("Checking if network name setup is done on the resource");
}
return new CheckNetworkAnswer(cmd, true , "Network Setup check by names is done");
s_logger.debug("Checking if network name setup is done on the resource");
}
return new CheckNetworkAnswer(cmd, true, "Network Setup check by names is done");
}
}

View File

@ -19,21 +19,7 @@ package com.cloud.agent.manager;
import java.util.HashMap;
import java.util.Map;
import com.cloud.agent.api.Answer;
import com.cloud.agent.api.CheckVirtualMachineCommand;
import com.cloud.agent.api.CleanupNetworkRulesCmd;
import com.cloud.agent.api.GetDomRVersionAnswer;
import com.cloud.agent.api.GetDomRVersionCmd;
import com.cloud.agent.api.GetVmStatsCommand;
import com.cloud.agent.api.GetVncPortCommand;
import com.cloud.agent.api.MigrateAnswer;
import com.cloud.agent.api.MigrateCommand;
import com.cloud.agent.api.NetworkUsageCommand;
import com.cloud.agent.api.RebootCommand;
import com.cloud.agent.api.SecurityGroupRuleAnswer;
import com.cloud.agent.api.SecurityGroupRulesCmd;
import com.cloud.agent.api.StartCommand;
import com.cloud.agent.api.StopCommand;
import com.cloud.agent.api.*;
import com.cloud.agent.api.check.CheckSshAnswer;
import com.cloud.agent.api.check.CheckSshCommand;
import com.cloud.agent.api.proxy.CheckConsoleProxyLoadCommand;
@ -90,5 +76,8 @@ public interface MockVmManager extends Manager {
MigrateAnswer Migrate(MigrateCommand cmd, SimulatorInfo info);
GetDomRVersionAnswer getDomRVersion(GetDomRVersionCmd cmd);
Map<String, MockVMVO> getVms(String hostGuid);
CheckRouterAnswer checkRouter(CheckRouterCommand cmd);
Answer bumpPriority(BumpUpPriorityCommand cmd);
}

View File

@ -25,43 +25,15 @@ import java.util.concurrent.ConcurrentHashMap;
import javax.ejb.Local;
import javax.naming.ConfigurationException;
import com.cloud.agent.api.*;
import com.cloud.agent.api.routing.*;
import com.cloud.network.router.VirtualRouter;
import org.apache.log4j.Logger;
import com.cloud.agent.api.Answer;
import com.cloud.agent.api.CheckVirtualMachineAnswer;
import com.cloud.agent.api.CheckVirtualMachineCommand;
import com.cloud.agent.api.CleanupNetworkRulesCmd;
import com.cloud.agent.api.GetDomRVersionAnswer;
import com.cloud.agent.api.GetDomRVersionCmd;
import com.cloud.agent.api.GetVmStatsAnswer;
import com.cloud.agent.api.GetVmStatsCommand;
import com.cloud.agent.api.GetVncPortAnswer;
import com.cloud.agent.api.GetVncPortCommand;
import com.cloud.agent.api.MigrateAnswer;
import com.cloud.agent.api.MigrateCommand;
import com.cloud.agent.api.NetworkUsageAnswer;
import com.cloud.agent.api.NetworkUsageCommand;
import com.cloud.agent.api.RebootAnswer;
import com.cloud.agent.api.RebootCommand;
import com.cloud.agent.api.SecurityGroupRuleAnswer;
import com.cloud.agent.api.SecurityGroupRulesCmd;
import com.cloud.agent.api.StartAnswer;
import com.cloud.agent.api.StartCommand;
import com.cloud.agent.api.StopAnswer;
import com.cloud.agent.api.StopCommand;
import com.cloud.agent.api.VmStatsEntry;
import com.cloud.agent.api.check.CheckSshAnswer;
import com.cloud.agent.api.check.CheckSshCommand;
import com.cloud.agent.api.proxy.CheckConsoleProxyLoadCommand;
import com.cloud.agent.api.proxy.WatchConsoleProxyLoadCommand;
import com.cloud.agent.api.routing.DhcpEntryCommand;
import com.cloud.agent.api.routing.IpAssocCommand;
import com.cloud.agent.api.routing.LoadBalancerConfigCommand;
import com.cloud.agent.api.routing.SavePasswordCommand;
import com.cloud.agent.api.routing.SetFirewallRulesCommand;
import com.cloud.agent.api.routing.SetPortForwardingRulesCommand;
import com.cloud.agent.api.routing.SetStaticNatRulesCommand;
import com.cloud.agent.api.routing.VmDataCommand;
import com.cloud.agent.api.to.NicTO;
import com.cloud.agent.api.to.VirtualMachineTO;
import com.cloud.network.Networks.TrafficType;
@ -75,6 +47,8 @@ import com.cloud.simulator.dao.MockVMDao;
import com.cloud.utils.Pair;
import com.cloud.utils.Ternary;
import com.cloud.utils.component.Inject;
import com.cloud.utils.db.Transaction;
import com.cloud.utils.exception.CloudRuntimeException;
import com.cloud.vm.VirtualMachine.State;
@Local(value = { MockVmManager.class })
@ -85,7 +59,7 @@ public class MockVmManagerImpl implements MockVmManager {
@Inject MockAgentManager _mockAgentMgr = null;
@Inject MockHostDao _mockHostDao = null;
@Inject MockSecurityRulesDao _mockSecurityDao = null;
private Map<String, Map<String, Ternary<String,Long,Long>>> _securityRules = new ConcurrentHashMap<String, Map<String, Ternary<String, Long, Long>>>();
private Map<String, Map<String, Ternary<String, Long, Long>>> _securityRules = new ConcurrentHashMap<String, Map<String, Ternary<String, Long, Long>>>();
public MockVmManagerImpl() {
}
@ -101,12 +75,27 @@ public class MockVmManagerImpl implements MockVmManager {
int cpuHz, long ramSize,
String bootArgs, String hostGuid) {
MockHost host = _mockHostDao.findByGuid(hostGuid);
if (host == null) {
return "can't find host";
}
MockVm vm = _mockVmDao.findByVmName(vmName);
Transaction txn = Transaction.open(Transaction.SIMULATOR_DB);
MockHost host = null;
MockVm vm = null;
try {
txn.start();
host = _mockHostDao.findByGuid(hostGuid);
if (host == null) {
return "can't find host";
}
vm = _mockVmDao.findByVmName(vmName);
txn.commit();
} catch (Exception ex) {
txn.rollback();
throw new CloudRuntimeException("Unable to start VM " + vmName, ex);
} finally {
txn.close();
txn = Transaction.open(Transaction.CLOUD_DB);
txn.close();
}
if(vm == null) {
int vncPort = 0;
if(vncPort < 0)
@ -127,11 +116,35 @@ public class MockVmManagerImpl implements MockVmManager {
} else if (vmName.startsWith("i-")) {
vm.setType("User");
}
vm = _mockVmDao.persist((MockVMVO)vm);
txn = Transaction.open(Transaction.SIMULATOR_DB);
try {
txn.start();
vm = _mockVmDao.persist((MockVMVO) vm);
txn.commit();
} catch (Exception ex) {
txn.rollback();
throw new CloudRuntimeException("unable to save vm to db " + vm.getName(), ex);
} finally {
txn.close();
txn = Transaction.open(Transaction.CLOUD_DB);
txn.close();
}
} else {
if(vm.getState() == State.Stopped) {
vm.setState(State.Running);
_mockVmDao.update(vm.getId(), (MockVMVO)vm);
txn = Transaction.open(Transaction.SIMULATOR_DB);
try {
txn.start();
_mockVmDao.update(vm.getId(), (MockVMVO)vm);
txn.commit();
} catch (Exception ex) {
txn.rollback();
throw new CloudRuntimeException("unable to update vm " + vm.getName(), ex);
} finally {
txn.close();
txn = Transaction.open(Transaction.CLOUD_DB);
txn.close();
}
}
}
@ -179,37 +192,102 @@ public class MockVmManagerImpl implements MockVmManager {
}
public boolean rebootVM(String vmName) {
MockVm vm = _mockVmDao.findByVmName(vmName);
if(vm != null) {
vm.setState(State.Running);
_mockVmDao.update(vm.getId(), (MockVMVO)vm);
}
return true;
Transaction txn = Transaction.open(Transaction.SIMULATOR_DB);
try {
txn.start();
MockVm vm = _mockVmDao.findByVmName(vmName);
if (vm != null) {
vm.setState(State.Running);
_mockVmDao.update(vm.getId(), (MockVMVO) vm);
}
txn.commit();
} catch (Exception ex) {
txn.rollback();
throw new CloudRuntimeException("unable to reboot vm " + vmName, ex);
} finally {
txn.close();
txn = Transaction.open(Transaction.CLOUD_DB);
txn.close();
}
return true;
}
@Override
public Map<String, MockVMVO> getVms(String hostGuid) {
List<MockVMVO> vms = _mockVmDao.findByHostGuid(hostGuid);
Map<String, MockVMVO> vmMap = new HashMap<String, MockVMVO>();
for (MockVMVO vm : vms) {
vmMap.put(vm.getName(), vm);
public Map<String, MockVMVO> getVms(String hostGuid) {
Transaction txn = Transaction.open(Transaction.SIMULATOR_DB);
try {
txn.start();
List<MockVMVO> vms = _mockVmDao.findByHostGuid(hostGuid);
Map<String, MockVMVO> vmMap = new HashMap<String, MockVMVO>();
for (MockVMVO vm : vms) {
vmMap.put(vm.getName(), vm);
}
txn.commit();
return vmMap;
} catch (Exception ex) {
txn.rollback();
throw new CloudRuntimeException("unable to fetch vms from host " + hostGuid, ex);
} finally {
txn.close();
txn = Transaction.open(Transaction.CLOUD_DB);
txn.close();
}
return vmMap;
}
@Override
public Map<String, State> getVmStates(String hostGuid) {
Map<String, State> states = new HashMap<String, State>();
List<MockVMVO> vms = _mockVmDao.findByHostGuid(hostGuid);
if (vms.isEmpty()) {
return states;
}
for(MockVm vm : vms) {
states.put(vm.getName(), vm.getState());
}
@Override
public CheckRouterAnswer checkRouter(CheckRouterCommand cmd) {
String router_name = cmd.getAccessDetail(NetworkElementCommand.ROUTER_NAME);
int router_id = Integer.parseInt(router_name.split("-")[1]);
if (router_id % 2 == 0) {
s_logger.debug("Found even routerId, making it MASTER in RvR");
CheckRouterAnswer ans = new CheckRouterAnswer(cmd, "Status: MASTER & Bumped: NO", true);
ans.setState(VirtualRouter.RedundantState.MASTER);
return ans;
} else {
s_logger.debug("Found odd routerId, making it BACKUP in RvR");
CheckRouterAnswer ans = new CheckRouterAnswer(cmd, "Status: MASTER & Bumped: NO", true);
ans.setState(VirtualRouter.RedundantState.BACKUP);
return ans;
}
}
return states;
@Override
public Answer bumpPriority(BumpUpPriorityCommand cmd) {
String router_name = cmd.getAccessDetail(NetworkElementCommand.ROUTER_NAME);
int router_id = Integer.parseInt(router_name.split("-")[1]);
if (router_id % 2 == 0) {
return new Answer(cmd, true, "Status: MASTER & Bumped: YES");
} else {
return new Answer(cmd, true, "Status: BACKUP & Bumped: YES");
}
}
@Override
public Map<String, State> getVmStates(String hostGuid) {
Transaction txn = Transaction.open(Transaction.SIMULATOR_DB);
try {
txn.start();
Map<String, State> states = new HashMap<String, State>();
List<MockVMVO> vms = _mockVmDao.findByHostGuid(hostGuid);
if (vms.isEmpty()) {
txn.commit();
return states;
}
for (MockVm vm : vms) {
states.put(vm.getName(), vm.getState());
}
txn.commit();
return states;
} catch (Exception ex) {
txn.rollback();
throw new CloudRuntimeException("unable to fetch vms from host " + hostGuid, ex);
} finally {
txn.close();
txn = Transaction.open(Transaction.CLOUD_DB);
txn.close();
}
}
@Override
@ -243,14 +321,26 @@ public class MockVmManagerImpl implements MockVmManager {
}
@Override
public CheckVirtualMachineAnswer checkVmState(CheckVirtualMachineCommand cmd) {
MockVMVO vm = _mockVmDao.findByVmName(cmd.getVmName());
if (vm == null) {
return new CheckVirtualMachineAnswer(cmd, "can't find vm:" + cmd.getVmName());
}
return new CheckVirtualMachineAnswer(cmd, vm.getState(), vm.getVncPort());
}
public CheckVirtualMachineAnswer checkVmState(CheckVirtualMachineCommand cmd) {
Transaction txn = Transaction.open(Transaction.SIMULATOR_DB);
try {
txn.start();
MockVMVO vm = _mockVmDao.findByVmName(cmd.getVmName());
if (vm == null) {
return new CheckVirtualMachineAnswer(cmd, "can't find vm:" + cmd.getVmName());
}
txn.commit();
return new CheckVirtualMachineAnswer(cmd, vm.getState(), vm.getVncPort());
} catch (Exception ex) {
txn.rollback();
throw new CloudRuntimeException("unable to fetch vm state " + cmd.getVmName(), ex);
} finally {
txn.close();
txn = Transaction.open(Transaction.CLOUD_DB);
txn.close();
}
}
@Override
public Answer startVM(StartCommand cmd, SimulatorInfo info) {
@ -290,22 +380,34 @@ public class MockVmManagerImpl implements MockVmManager {
}
@Override
public MigrateAnswer Migrate(MigrateCommand cmd, SimulatorInfo info) {
String vmName = cmd.getVmName();
String destGuid = cmd.getHostGuid();
MockVMVO vm = _mockVmDao.findByVmNameAndHost(vmName, info.getHostUuid());
if (vm == null) {
return new MigrateAnswer(cmd, false, "can;t find vm:" + vmName + " on host:" + info.getHostUuid(), null);
}
MockHost destHost = _mockHostDao.findByGuid(destGuid);
if (destHost == null) {
return new MigrateAnswer(cmd, false, "can;t find host:" + info.getHostUuid(), null);
}
vm.setHostId(destHost.getId());
_mockVmDao.update(vm.getId(), vm);
return new MigrateAnswer(cmd, true,null, 0);
}
public MigrateAnswer Migrate(MigrateCommand cmd, SimulatorInfo info) {
Transaction txn = Transaction.open(Transaction.SIMULATOR_DB);
try {
txn.start();
String vmName = cmd.getVmName();
String destGuid = cmd.getHostGuid();
MockVMVO vm = _mockVmDao.findByVmNameAndHost(vmName, info.getHostUuid());
if (vm == null) {
return new MigrateAnswer(cmd, false, "can;t find vm:" + vmName + " on host:" + info.getHostUuid(), null);
}
MockHost destHost = _mockHostDao.findByGuid(destGuid);
if (destHost == null) {
return new MigrateAnswer(cmd, false, "can;t find host:" + info.getHostUuid(), null);
}
vm.setHostId(destHost.getId());
_mockVmDao.update(vm.getId(), vm);
txn.commit();
return new MigrateAnswer(cmd, true, null, 0);
} catch (Exception ex) {
txn.rollback();
throw new CloudRuntimeException("unable to migrate vm " + cmd.getVmName(), ex);
} finally {
txn.close();
txn = Transaction.open(Transaction.CLOUD_DB);
txn.close();
}
}
@Override
public Answer IpAssoc(IpAssocCommand cmd) {
@ -328,37 +430,77 @@ public class MockVmManagerImpl implements MockVmManager {
}
@Override
public Answer CleanupNetworkRules(CleanupNetworkRulesCmd cmd, SimulatorInfo info) {
List<MockSecurityRulesVO> rules = _mockSecurityDao.findByHost(info.getHostUuid());
for (MockSecurityRulesVO rule : rules) {
MockVMVO vm = _mockVmDao.findByVmNameAndHost(rule.getVmName(), info.getHostUuid());
if (vm == null) {
_mockSecurityDao.remove(rule.getId());
}
}
return new Answer(cmd);
}
public Answer CleanupNetworkRules(CleanupNetworkRulesCmd cmd, SimulatorInfo info) {
Transaction txn = Transaction.open(Transaction.SIMULATOR_DB);
try {
txn.start();
List<MockSecurityRulesVO> rules = _mockSecurityDao.findByHost(info.getHostUuid());
for (MockSecurityRulesVO rule : rules) {
MockVMVO vm = _mockVmDao.findByVmNameAndHost(rule.getVmName(), info.getHostUuid());
if (vm == null) {
_mockSecurityDao.remove(rule.getId());
}
}
txn.commit();
return new Answer(cmd);
} catch (Exception ex) {
txn.rollback();
throw new CloudRuntimeException("unable to clean up rules", ex);
} finally {
txn.close();
txn = Transaction.open(Transaction.CLOUD_DB);
txn.close();
}
}
@Override
public Answer stopVM(StopCommand cmd) {
String vmName = cmd.getVmName();
MockVm vm = _mockVmDao.findByVmName(vmName);
if(vm != null) {
vm.setState(State.Stopped);
_mockVmDao.update(vm.getId(), (MockVMVO)vm);
}
public Answer stopVM(StopCommand cmd) {
Transaction txn = Transaction.open(Transaction.SIMULATOR_DB);
try {
txn.start();
String vmName = cmd.getVmName();
MockVm vm = _mockVmDao.findByVmName(vmName);
if (vm != null) {
vm.setState(State.Stopped);
_mockVmDao.update(vm.getId(), (MockVMVO) vm);
}
if (vmName.startsWith("s-")) {
_mockAgentMgr.handleSystemVMStop(vm.getId());
}
return new StopAnswer(cmd, null, new Integer(0), true);
}
if (vmName.startsWith("s-")) {
_mockAgentMgr.handleSystemVMStop(vm.getId());
}
txn.commit();
return new StopAnswer(cmd, null, new Integer(0), true);
} catch (Exception ex) {
txn.rollback();
throw new CloudRuntimeException("unable to stop vm " + cmd.getVmName(), ex);
} finally {
txn.close();
txn = Transaction.open(Transaction.CLOUD_DB);
txn.close();
}
}
@Override
public Answer rebootVM(RebootCommand cmd) {
return new RebootAnswer(cmd, "Rebooted "+cmd.getVmName(), false);
}
public Answer rebootVM(RebootCommand cmd) {
Transaction txn = Transaction.open(Transaction.SIMULATOR_DB);
try {
txn.start();
MockVm vm = _mockVmDao.findByVmName(cmd.getVmName());
if (vm != null) {
vm.setState(State.Running);
_mockVmDao.update(vm.getId(), (MockVMVO) vm);
}
txn.commit();
return new RebootAnswer(cmd, "Rebooted " + cmd.getVmName(), true);
} catch (Exception ex) {
txn.rollback();
throw new CloudRuntimeException("unable to stop vm " + cmd.getVmName(), ex);
} finally {
txn.close();
txn = Transaction.open(Transaction.CLOUD_DB);
txn.close();
}
}
@Override
public Answer getVncPort(GetVncPortCommand cmd) {

View File

@ -24,44 +24,9 @@ import java.util.Map;
import javax.ejb.Local;
import javax.naming.ConfigurationException;
import com.cloud.agent.api.*;
import org.apache.log4j.Logger;
import com.cloud.agent.api.Answer;
import com.cloud.agent.api.AttachIsoCommand;
import com.cloud.agent.api.AttachVolumeCommand;
import com.cloud.agent.api.BackupSnapshotCommand;
import com.cloud.agent.api.CheckHealthCommand;
import com.cloud.agent.api.CheckNetworkCommand;
import com.cloud.agent.api.CheckVirtualMachineCommand;
import com.cloud.agent.api.CleanupNetworkRulesCmd;
import com.cloud.agent.api.ClusterSyncCommand;
import com.cloud.agent.api.Command;
import com.cloud.agent.api.ComputeChecksumCommand;
import com.cloud.agent.api.CreatePrivateTemplateFromSnapshotCommand;
import com.cloud.agent.api.CreatePrivateTemplateFromVolumeCommand;
import com.cloud.agent.api.CreateStoragePoolCommand;
import com.cloud.agent.api.CreateVolumeFromSnapshotCommand;
import com.cloud.agent.api.DeleteSnapshotBackupCommand;
import com.cloud.agent.api.DeleteStoragePoolCommand;
import com.cloud.agent.api.GetDomRVersionCmd;
import com.cloud.agent.api.GetHostStatsCommand;
import com.cloud.agent.api.GetStorageStatsCommand;
import com.cloud.agent.api.GetVmStatsCommand;
import com.cloud.agent.api.GetVncPortCommand;
import com.cloud.agent.api.MaintainCommand;
import com.cloud.agent.api.ManageSnapshotCommand;
import com.cloud.agent.api.MigrateCommand;
import com.cloud.agent.api.ModifyStoragePoolCommand;
import com.cloud.agent.api.NetworkUsageCommand;
import com.cloud.agent.api.PingTestCommand;
import com.cloud.agent.api.PrepareForMigrationCommand;
import com.cloud.agent.api.RebootCommand;
import com.cloud.agent.api.SecStorageSetupCommand;
import com.cloud.agent.api.SecStorageVMSetupCommand;
import com.cloud.agent.api.SecurityGroupRulesCmd;
import com.cloud.agent.api.StartCommand;
import com.cloud.agent.api.StopCommand;
import com.cloud.agent.api.StoragePoolInfo;
import com.cloud.agent.api.check.CheckSshCommand;
import com.cloud.agent.api.proxy.CheckConsoleProxyLoadCommand;
import com.cloud.agent.api.proxy.WatchConsoleProxyLoadCommand;
@ -111,11 +76,11 @@ public class SimulatorManagerImpl implements SimulatorManager {
public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
/*
try {
Connection conn = Transaction.getStandaloneConnectionWithException();
Connection conn = Transaction.getStandaloneSimulatorConnection();
conn.setAutoCommit(true);
_concierge = new ConnectionConcierge("SimulatorConnection", conn, true);
} catch (SQLException e) {
throw new CloudRuntimeException("Unable to get a db connection", e);
throw new CloudRuntimeException("Unable to get a db connection to simulator", e);
}
*/
return true;
@ -291,21 +256,28 @@ public class SimulatorManagerImpl implements SimulatorManager {
return _mockAgentMgr.maintain((MaintainCommand)cmd);
} else if (cmd instanceof GetVmStatsCommand) {
return _mockVmMgr.getVmStats((GetVmStatsCommand)cmd);
} else if (cmd instanceof CheckRouterCommand) {
return _mockVmMgr.checkRouter((CheckRouterCommand) cmd);
} else if (cmd instanceof BumpUpPriorityCommand) {
return _mockVmMgr.bumpPriority((BumpUpPriorityCommand) cmd);
} else if (cmd instanceof GetDomRVersionCmd) {
return _mockVmMgr.getDomRVersion((GetDomRVersionCmd)cmd);
return _mockVmMgr.getDomRVersion((GetDomRVersionCmd) cmd);
} else if (cmd instanceof ClusterSyncCommand) {
return new Answer(cmd);
//return new ClusterSyncAnswer(((ClusterSyncCommand) cmd).getClusterId(), this.getVmStates(hostGuid));
} else if (cmd instanceof CopyVolumeCommand) {
return _mockStorageMgr.CopyVolume((CopyVolumeCommand)cmd);
return _mockStorageMgr.CopyVolume((CopyVolumeCommand) cmd);
} else {
return Answer.createUnsupportedCommandAnswer(cmd);
}
} catch(Exception e) {
s_logger.debug("Failed execute cmd: " + e.toString());
s_logger.error("Failed execute cmd: " + e.toString());
txn.rollback();
return new Answer(cmd, false, e.toString());
} finally {
txn.transitToAutoManagedConnection(Transaction.CLOUD_DB);
txn.close();
txn = Transaction.open(Transaction.CLOUD_DB);
txn.close();
}
}
@ -315,53 +287,50 @@ public class SimulatorManagerImpl implements SimulatorManager {
}
@Override
public boolean configureSimulator(Long zoneId, Long podId, Long clusterId, Long hostId, String command, String values) {
MockConfigurationVO config = _mockConfigDao.findByCommand(zoneId, podId, clusterId, hostId, command);
if (config == null) {
config = new MockConfigurationVO();
config.setClusterId(clusterId);
config.setDataCenterId(zoneId);
config.setPodId(podId);
config.setHostId(hostId);
config.setName(command);
config.setValues(values);
_mockConfigDao.persist(config);
} else {
config.setValues(values);
_mockConfigDao.update(config.getId(), config);
}
return true;
}
@Override
@DB
public Map<String, State> getVmStates(String hostGuid) {
Transaction txn = Transaction.currentTxn();
txn.transitToUserManagedConnection(_concierge.conn());
try {
return _mockVmMgr.getVmStates(hostGuid);
} finally {
txn.transitToAutoManagedConnection(Transaction.CLOUD_DB);
}
return _mockVmMgr.getVmStates(hostGuid);
}
@Override
@DB
public Map<String, MockVMVO> getVms(String hostGuid) {
Transaction txn = Transaction.currentTxn();
txn.transitToUserManagedConnection(_concierge.conn());
try {
return _mockVmMgr.getVms(hostGuid);
} finally {
txn.transitToAutoManagedConnection(Transaction.CLOUD_DB);
}
return _mockVmMgr.getVms(hostGuid);
}
@Override
public HashMap<String, Pair<Long, Long>> syncNetworkGroups(String hostGuid) {
SimulatorInfo info = new SimulatorInfo();
info.setHostUuid(hostGuid);
return _mockVmMgr.syncNetworkGroups(info);
return _mockVmMgr.syncNetworkGroups(info);
}
@Override
public boolean configureSimulator(Long zoneId, Long podId, Long clusterId, Long hostId, String command,
String values) {
Transaction txn = Transaction.open(Transaction.SIMULATOR_DB);
try {
txn.start();
MockConfigurationVO config = _mockConfigDao.findByCommand(zoneId, podId, clusterId, hostId, command);
if (config == null) {
config = new MockConfigurationVO();
config.setClusterId(clusterId);
config.setDataCenterId(zoneId);
config.setPodId(podId);
config.setHostId(hostId);
config.setName(command);
config.setValues(values);
_mockConfigDao.persist(config);
txn.commit();
} else {
config.setValues(values);
_mockConfigDao.update(config.getId(), config);
txn.commit();
}
} catch (Exception ex) {
txn.rollback();
throw new CloudRuntimeException("Unable to configure simulator because of " + ex.getMessage(), ex);
} finally {
txn.close();
}
return true;
}
}

View File

@ -0,0 +1,41 @@
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
package com.cloud.simulator;
import com.cloud.utils.SerialVersionUID;
import com.cloud.utils.exception.RuntimeCloudException;
/**
* wrap exceptions that you know there's no point in dealing with.
*/
public class SimulatorRuntimeException extends RuntimeCloudException {
private static final long serialVersionUID = SerialVersionUID.CloudRuntimeException;
public SimulatorRuntimeException(String message) {
super(message);
}
public SimulatorRuntimeException(String message, Throwable th) {
super(message, th);
}
protected SimulatorRuntimeException() {
super();
}
}

View File

@ -16,15 +16,14 @@
specific language governing permissions and limitations
under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>cloud-agent</artifactId>
<name>Apache CloudStack Agents</name>
<parent>
<groupId>org.apache.cloudstack</groupId>
<artifactId>cloudstack</artifactId>
<version>4.0.0-SNAPSHOT</version>
<version>4.1.0-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>

View File

@ -16,15 +16,14 @@
specific language governing permissions and limitations
under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>cloud-api</artifactId>
<name>Apache CloudStack API</name>
<parent>
<groupId>org.apache.cloudstack</groupId>
<artifactId>cloudstack</artifactId>
<version>4.0.0-SNAPSHOT</version>
<version>4.1.0-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>

View File

@ -45,6 +45,10 @@ public class SetupGuestNetworkCommand extends NetworkElementCommand{
return networkDomain;
}
public boolean isAdd() {
return add;
}
@Override
public boolean executeInSequence() {
return true;

View File

@ -382,6 +382,7 @@ public class ApiConstants {
public static final String NICIRA_NVP_DEVICE_ID = "nvpdeviceid";
public static final String NICIRA_NVP_TRANSPORT_ZONE_UUID = "transportzoneuuid";
public static final String NICIRA_NVP_DEVICE_NAME = "niciradevicename";
public static final String NICIRA_NVP_GATEWAYSERVICE_UUID = "l3gatewayserviceuuid";
public enum HostDetails {

View File

@ -25,10 +25,11 @@ import com.cloud.user.UserContext;
* queryAsyncJobResult API command.
*/
public abstract class BaseAsyncCmd extends BaseCmd {
public static final String ipAddressSyncObject = "ipaddress";
public static final String networkSyncObject = "network";
public static final String vpcSyncObject = "vpc";
public static final String snapshotHostSyncObject = "snapshothost";
private AsyncJob job;

View File

@ -120,7 +120,7 @@ public class AddVpnUserCmd extends BaseAsyncCreateCmd {
public void execute(){
VpnUser vpnUser = _entityMgr.findById(VpnUser.class, getEntityId());
Account account = _entityMgr.findById(Account.class, vpnUser.getAccountId());
if (!_ravService.applyVpnUsers(vpnUser.getAccountId())) {
if (!_ravService.applyVpnUsers(vpnUser.getAccountId(), userName)) {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to add vpn user");
}

View File

@ -63,9 +63,15 @@ public class CreatePortForwardingRuleCmd extends BaseAsyncCreateCmd implements P
description = "the protocol for the port fowarding rule. Valid values are TCP or UDP.")
private String protocol;
@Parameter(name = ApiConstants.PRIVATE_END_PORT, type = CommandType.INTEGER, required = false, description = "the ending port of port forwarding rule's private port range")
private Integer privateEndPort;
@Parameter(name = ApiConstants.PUBLIC_START_PORT, type = CommandType.INTEGER, required = true,
description = "the starting port of port forwarding rule's public port range")
private Integer publicStartPort;
@Parameter(name = ApiConstants.PUBLIC_END_PORT, type = CommandType.INTEGER, required = false, description = "the ending port of port forwarding rule's private port range")
private Integer publicEndPort;
@IdentityMapper(entityTableName = "vm_instance")
@Parameter(name = ApiConstants.VIRTUAL_MACHINE_ID, type = CommandType.LONG, required = true,
@ -93,7 +99,7 @@ public class CreatePortForwardingRuleCmd extends BaseAsyncCreateCmd implements P
// ///////////////////////////////////////////////////
public String getEntityTable() {
return "firewall_rules";
return "firewall_rules";
}
public Long getIpAddressId() {
@ -117,7 +123,7 @@ public class CreatePortForwardingRuleCmd extends BaseAsyncCreateCmd implements P
}
return null;
}
public Boolean getOpenFirewall() {
boolean isVpc = getVpcId() == null ? false : true;
if (openFirewall != null) {
@ -154,6 +160,7 @@ public class CreatePortForwardingRuleCmd extends BaseAsyncCreateCmd implements P
return s_name;
}
@Override
public void execute() throws ResourceUnavailableException {
UserContext callerContext = UserContext.current();
@ -161,16 +168,16 @@ public class CreatePortForwardingRuleCmd extends BaseAsyncCreateCmd implements P
PortForwardingRule rule = null;
try {
UserContext.current().setEventDetails("Rule Id: " + getEntityId());
if (getOpenFirewall()) {
success = success && _firewallService.applyFirewallRules(ipAddressId, callerContext.getCaller());
}
success = success && _rulesService.applyPortForwardingRules(ipAddressId, callerContext.getCaller());
// State is different after the rule is applied, so get new object here
rule = _entityMgr.findById(PortForwardingRule.class, getEntityId());
FirewallRuleResponse fwResponse = new FirewallRuleResponse();
FirewallRuleResponse fwResponse = new FirewallRuleResponse();
if (rule != null) {
fwResponse = _responseGenerator.createPortForwardingRuleResponse(rule);
setResponseObject(fwResponse);
@ -178,13 +185,13 @@ public class CreatePortForwardingRuleCmd extends BaseAsyncCreateCmd implements P
fwResponse.setResponseName(getCommandName());
} finally {
if (!success || rule == null) {
if (getOpenFirewall()) {
_firewallService.revokeRelatedFirewallRule(getEntityId(), true);
}
_rulesService.revokePortForwardingRule(getEntityId(), true);
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to apply port forwarding rule");
}
}
@ -213,7 +220,7 @@ public class CreatePortForwardingRuleCmd extends BaseAsyncCreateCmd implements P
@Override
public Integer getSourcePortEnd() {
return publicStartPort.intValue();
return (publicEndPort == null)? publicStartPort.intValue() : publicEndPort.intValue();
}
@Override
@ -265,10 +272,10 @@ public class CreatePortForwardingRuleCmd extends BaseAsyncCreateCmd implements P
public Ip getDestinationIpAddress() {
return null;
}
@Override
public void setDestinationIpAddress(Ip destinationIpAddress) {
return;
return;
}
@Override
@ -278,7 +285,7 @@ public class CreatePortForwardingRuleCmd extends BaseAsyncCreateCmd implements P
@Override
public int getDestinationPortEnd() {
return privateStartPort.intValue();
return (privateEndPort == null)? privateStartPort.intValue() : privateEndPort.intValue();
}
@Override
@ -287,12 +294,12 @@ public class CreatePortForwardingRuleCmd extends BaseAsyncCreateCmd implements P
if (cidrlist != null) {
throw new InvalidParameterValueException("Parameter cidrList is deprecated; if you need to open firewall rule for the specific cidr, please refer to createFirewallRule command");
}
try {
PortForwardingRule result = _rulesService.createPortForwardingRule(this, virtualMachineId, getOpenFirewall());
setEntityId(result.getId());
} catch (NetworkRuleConflictException ex) {
s_logger.info("Network rule conflict: ", ex);
s_logger.info("Network rule conflict: " , ex);
s_logger.trace("Network Rule Conflict: ", ex);
throw new ServerApiException(BaseCmd.NETWORK_RULE_CONFLICT_ERROR, ex.getMessage());
}
@ -332,27 +339,27 @@ public class CreatePortForwardingRuleCmd extends BaseAsyncCreateCmd implements P
}
return ip;
}
@Override
public Integer getIcmpCode() {
return null;
}
@Override
public Integer getIcmpType() {
return null;
}
@Override
public Long getRelated() {
return null;
}
@Override
public FirewallRuleType getType() {
return FirewallRuleType.User;
}
@Override
public FirewallRuleType getType() {
return FirewallRuleType.User;
}
@Override
public AsyncJob.Type getInstanceType() {
return AsyncJob.Type.FirewallRule;

View File

@ -19,6 +19,7 @@ package com.cloud.api.commands;
import org.apache.log4j.Logger;
import com.cloud.api.ApiConstants;
import com.cloud.api.BaseAsyncCmd;
import com.cloud.api.BaseAsyncCreateCmd;
import com.cloud.api.BaseCmd;
import com.cloud.api.IdentityMapper;
@ -60,6 +61,8 @@ public class CreateSnapshotCmd extends BaseAsyncCreateCmd {
@IdentityMapper(entityTableName="snapshot_policy")
@Parameter(name = ApiConstants.POLICY_ID, type = CommandType.LONG, description = "policy id of the snapshot, if this is null, then use MANUAL_POLICY.")
private Long policyId;
private String syncObjectType = BaseAsyncCmd.snapshotHostSyncObject;
// ///////////////////////////////////////////////////
// ///////////////// Accessors ///////////////////////
@ -88,7 +91,16 @@ public class CreateSnapshotCmd extends BaseAsyncCreateCmd {
return Snapshot.MANUAL_POLICY_ID;
}
}
private Long getHostId() {
Volume volume = _entityMgr.findById(Volume.class, getVolumeId());
if (volume == null) {
throw new InvalidParameterValueException("Unable to find volume by id");
}
return _snapshotService.getHostIdForSnapshotOperation(volume);
}
// ///////////////////////////////////////////////////
// ///////////// API Implementation///////////////////
// ///////////////////////////////////////////////////
@ -161,4 +173,21 @@ public class CreateSnapshotCmd extends BaseAsyncCreateCmd {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create snapshot due to an internal error creating snapshot for volume " + volumeId);
}
}
@Override
public String getSyncObjType() {
if (getSyncObjId() != null) {
return syncObjectType;
}
return null;
}
@Override
public Long getSyncObjId() {
if (getHostId() != null) {
return getHostId();
}
return null;
}
}

View File

@ -28,7 +28,8 @@ import com.cloud.event.EventTypes;
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.exception.ResourceUnavailableException;
import com.cloud.network.RemoteAccessVpn;
import com.cloud.user.UserContext;
@Implementation(description="Destroys a l2tp/ipsec remote access vpn", responseObject=SuccessResponse.class)
public class DeleteRemoteAccessVpnCmd extends BaseAsyncCmd {
public static final Logger s_logger = Logger.getLogger(DeleteRemoteAccessVpnCmd.class.getName());
@ -83,7 +84,7 @@ public class DeleteRemoteAccessVpnCmd extends BaseAsyncCmd {
@Override
public void execute() throws ResourceUnavailableException {
_ravService.destroyRemoteAccessVpn(publicIpId);
_ravService.destroyRemoteAccessVpn(publicIpId, UserContext.current().getCaller());
}
@Override

View File

@ -79,7 +79,7 @@ public class DeleteVolumeCmd extends BaseCmd {
@Override
public void execute() throws ConcurrentOperationException {
UserContext.current().setEventDetails("Volume Id: "+getId());
boolean result = _storageService.deleteVolume(id);
boolean result = _storageService.deleteVolume(id, UserContext.current().getCaller());
if (result) {
SuccessResponse response = new SuccessResponse(getCommandName());
this.setResponseObject(response);

View File

@ -96,8 +96,10 @@ public class DestroyRouterCmd extends BaseAsyncCmd {
@Override
public void execute() throws ConcurrentOperationException, ResourceUnavailableException {
UserContext.current().setEventDetails("Router Id: "+getId());
VirtualRouter result = _routerService.destroyRouter(getId());
UserContext ctx = UserContext.current();
ctx.setEventDetails("Router Id: "+getId());
VirtualRouter result = _routerService.destroyRouter(getId(), ctx.getCaller(), ctx.getCallerUserId());
if (result != null) {
DomainRouterResponse response = _responseGenerator.createDomainRouterResponse(result);
response.setResponseName(getCommandName());

View File

@ -29,6 +29,7 @@ import com.cloud.api.Parameter;
import com.cloud.api.response.AccountResponse;
import com.cloud.api.response.ListResponse;
import com.cloud.user.Account;
import com.cloud.utils.Pair;
@Implementation(description="Lists accounts and provides detailed account information for listed accounts", responseObject=AccountResponse.class)
public class ListAccountsCmd extends BaseListDomainResourcesCmd {
@ -91,15 +92,15 @@ public class ListAccountsCmd extends BaseListDomainResourcesCmd {
@Override
public void execute(){
List<? extends Account> accounts = _accountService.searchForAccounts(this);
Pair<List<? extends Account>, Integer> accounts = _accountService.searchForAccounts(this);
ListResponse<AccountResponse> response = new ListResponse<AccountResponse>();
List<AccountResponse> accountResponses = new ArrayList<AccountResponse>();
for (Account account : accounts) {
for (Account account : accounts.first()) {
AccountResponse acctResponse = _responseGenerator.createAccountResponse(account);
acctResponse.setObjectName("account");
accountResponses.add(acctResponse);
}
response.setResponses(accountResponses);
response.setResponses(accountResponses, accounts.second());
response.setResponseName(getCommandName());
this.setResponseObject(response);

View File

@ -29,6 +29,7 @@ import com.cloud.api.Implementation;
import com.cloud.api.Parameter;
import com.cloud.api.response.AlertResponse;
import com.cloud.api.response.ListResponse;
import com.cloud.utils.Pair;
@Implementation(description = "Lists all alerts.", responseObject = AlertResponse.class)
public class ListAlertsCmd extends BaseListCmd {
@ -71,10 +72,10 @@ public class ListAlertsCmd extends BaseListCmd {
@Override
public void execute() {
List<? extends Alert> result = _mgr.searchForAlerts(this);
Pair<List<? extends Alert>, Integer> result = _mgr.searchForAlerts(this);
ListResponse<AlertResponse> response = new ListResponse<AlertResponse>();
List<AlertResponse> alertResponseList = new ArrayList<AlertResponse>();
for (Alert alert : result) {
for (Alert alert : result.first()) {
AlertResponse alertResponse = new AlertResponse();
alertResponse.setId(alert.getId());
alertResponse.setAlertType(alert.getType());
@ -85,7 +86,7 @@ public class ListAlertsCmd extends BaseListCmd {
alertResponseList.add(alertResponse);
}
response.setResponses(alertResponseList);
response.setResponses(alertResponseList, result.second());
response.setResponseName(getCommandName());
this.setResponseObject(response);
}

View File

@ -27,6 +27,7 @@ import com.cloud.api.Parameter;
import com.cloud.api.response.AsyncJobResponse;
import com.cloud.api.response.ListResponse;
import com.cloud.async.AsyncJob;
import com.cloud.utils.Pair;
@Implementation(description="Lists all pending asynchronous jobs for the account.", responseObject=AsyncJobResponse.class)
public class ListAsyncJobsCmd extends BaseListAccountResourcesCmd {
@ -58,14 +59,14 @@ public class ListAsyncJobsCmd extends BaseListAccountResourcesCmd {
@Override
public void execute(){
List<? extends AsyncJob> result = _mgr.searchForAsyncJobs(this);
Pair<List<? extends AsyncJob>, Integer> result = _mgr.searchForAsyncJobs(this);
ListResponse<AsyncJobResponse> response = new ListResponse<AsyncJobResponse>();
List<AsyncJobResponse> jobResponses = new ArrayList<AsyncJobResponse>();
for (AsyncJob job : result) {
for (AsyncJob job : result.first()) {
jobResponses.add(_responseGenerator.createAsyncJobResponse(job));
}
response.setResponses(jobResponses);
response.setResponses(jobResponses, result.second());
response.setResponseName(getCommandName());
this.setResponseObject(response);
}

View File

@ -28,6 +28,7 @@ import com.cloud.api.Parameter;
import com.cloud.api.response.ConfigurationResponse;
import com.cloud.api.response.ListResponse;
import com.cloud.configuration.Configuration;
import com.cloud.utils.Pair;
@Implementation(description = "Lists all configurations.", responseObject = ConfigurationResponse.class)
public class ListCfgsByCmd extends BaseListCmd {
@ -78,16 +79,16 @@ public class ListCfgsByCmd extends BaseListCmd {
@Override
public void execute() {
List<? extends Configuration> result = _mgr.searchForConfigurations(this);
Pair<List<? extends Configuration>, Integer> result = _mgr.searchForConfigurations(this);
ListResponse<ConfigurationResponse> response = new ListResponse<ConfigurationResponse>();
List<ConfigurationResponse> configResponses = new ArrayList<ConfigurationResponse>();
for (Configuration cfg : result) {
for (Configuration cfg : result.first()) {
ConfigurationResponse cfgResponse = _responseGenerator.createConfigurationResponse(cfg);
cfgResponse.setObjectName("configuration");
configResponses.add(cfgResponse);
}
response.setResponses(configResponses);
response.setResponses(configResponses, result.second());
response.setResponseName(getCommandName());
this.setResponseObject(response);
}

View File

@ -29,6 +29,7 @@ import com.cloud.api.Parameter;
import com.cloud.api.response.ClusterResponse;
import com.cloud.api.response.ListResponse;
import com.cloud.org.Cluster;
import com.cloud.utils.Pair;
@Implementation(description="Lists clusters.", responseObject=ClusterResponse.class)
public class ListClustersCmd extends BaseListCmd {
@ -127,16 +128,16 @@ public class ListClustersCmd extends BaseListCmd {
@Override
public void execute(){
List<? extends Cluster> result = _mgr.searchForClusters(this);
Pair<List<? extends Cluster>, Integer> result = _mgr.searchForClusters(this);
ListResponse<ClusterResponse> response = new ListResponse<ClusterResponse>();
List<ClusterResponse> clusterResponses = new ArrayList<ClusterResponse>();
for (Cluster cluster : result) {
for (Cluster cluster : result.first()) {
ClusterResponse clusterResponse = _responseGenerator.createClusterResponse(cluster,showCapacities);
clusterResponse.setObjectName("cluster");
clusterResponses.add(clusterResponse);
}
response.setResponses(clusterResponses);
response.setResponses(clusterResponses, result.second());
response.setResponseName(getCommandName());
this.setResponseObject(response);
}

View File

@ -29,6 +29,7 @@ import com.cloud.api.Parameter;
import com.cloud.api.response.DomainResponse;
import com.cloud.api.response.ListResponse;
import com.cloud.domain.Domain;
import com.cloud.utils.Pair;
@Implementation(description="Lists all children domains belonging to a specified domain", responseObject=DomainResponse.class)
public class ListDomainChildrenCmd extends BaseListCmd {
@ -84,16 +85,16 @@ public class ListDomainChildrenCmd extends BaseListCmd {
@Override
public void execute(){
List<? extends Domain> result = _domainService.searchForDomainChildren(this);
Pair<List<? extends Domain>, Integer> result = _domainService.searchForDomainChildren(this);
ListResponse<DomainResponse> response = new ListResponse<DomainResponse>();
List<DomainResponse> domainResponses = new ArrayList<DomainResponse>();
for (Domain domain : result) {
for (Domain domain : result.first()) {
DomainResponse domainResponse = _responseGenerator.createDomainResponse(domain);
domainResponse.setObjectName("domain");
domainResponses.add(domainResponse);
}
response.setResponses(domainResponses);
response.setResponses(domainResponses, result.second());
response.setResponseName(getCommandName());
this.setResponseObject(response);
}

View File

@ -29,6 +29,7 @@ import com.cloud.api.Parameter;
import com.cloud.api.response.DomainResponse;
import com.cloud.api.response.ListResponse;
import com.cloud.domain.Domain;
import com.cloud.utils.Pair;
@Implementation(description="Lists domains and provides detailed information for listed domains", responseObject=DomainResponse.class)
public class ListDomainsCmd extends BaseListCmd {
@ -84,16 +85,16 @@ public class ListDomainsCmd extends BaseListCmd {
@Override
public void execute(){
List<? extends Domain> result = _domainService.searchForDomains(this);
Pair<List<? extends Domain>, Integer> result = _domainService.searchForDomains(this);
ListResponse<DomainResponse> response = new ListResponse<DomainResponse>();
List<DomainResponse> domainResponses = new ArrayList<DomainResponse>();
for (Domain domain : result) {
for (Domain domain : result.first()) {
DomainResponse domainResponse = _responseGenerator.createDomainResponse(domain);
domainResponse.setObjectName("domain");
domainResponses.add(domainResponse);
}
response.setResponses(domainResponses);
response.setResponses(domainResponses, result.second());
response.setResponseName(getCommandName());
this.setResponseObject(response);
}

View File

@ -29,6 +29,7 @@ import com.cloud.api.Parameter;
import com.cloud.api.response.FirewallResponse;
import com.cloud.api.response.ListResponse;
import com.cloud.network.rules.FirewallRule;
import com.cloud.utils.Pair;
@Implementation(description="Lists all firewall rules for an IP address.", responseObject=FirewallResponse.class)
public class ListFirewallRulesCmd extends BaseListTaggedResourcesCmd {
@ -69,16 +70,16 @@ public class ListFirewallRulesCmd extends BaseListTaggedResourcesCmd {
@Override
public void execute(){
List<? extends FirewallRule> result = _firewallService.listFirewallRules(this);
Pair<List<? extends FirewallRule>, Integer> result = _firewallService.listFirewallRules(this);
ListResponse<FirewallResponse> response = new ListResponse<FirewallResponse>();
List<FirewallResponse> fwResponses = new ArrayList<FirewallResponse>();
for (FirewallRule fwRule : result) {
for (FirewallRule fwRule : result.first()) {
FirewallResponse ruleData = _responseGenerator.createFirewallResponse(fwRule);
ruleData.setObjectName("firewallrule");
fwResponses.add(ruleData);
}
response.setResponses(fwResponses);
response.setResponses(fwResponses, result.second());
response.setResponseName(getCommandName());
this.setResponseObject(response);
}

View File

@ -29,6 +29,7 @@ import com.cloud.api.Parameter;
import com.cloud.api.response.GuestOSCategoryResponse;
import com.cloud.api.response.ListResponse;
import com.cloud.storage.GuestOsCategory;
import com.cloud.utils.Pair;
@Implementation(description="Lists all supported OS categories for this cloud.", responseObject=GuestOSCategoryResponse.class)
public class ListGuestOsCategoriesCmd extends BaseListCmd {
@ -72,10 +73,10 @@ public class ListGuestOsCategoriesCmd extends BaseListCmd {
@Override
public void execute(){
List<? extends GuestOsCategory> result = _mgr.listGuestOSCategoriesByCriteria(this);
Pair<List<? extends GuestOsCategory>, Integer> result = _mgr.listGuestOSCategoriesByCriteria(this);
ListResponse<GuestOSCategoryResponse> response = new ListResponse<GuestOSCategoryResponse>();
List<GuestOSCategoryResponse> osCatResponses = new ArrayList<GuestOSCategoryResponse>();
for (GuestOsCategory osCategory : result) {
for (GuestOsCategory osCategory : result.first()) {
GuestOSCategoryResponse categoryResponse = new GuestOSCategoryResponse();
categoryResponse.setId(osCategory.getId());
categoryResponse.setName(osCategory.getName());
@ -84,7 +85,7 @@ public class ListGuestOsCategoriesCmd extends BaseListCmd {
osCatResponses.add(categoryResponse);
}
response.setResponses(osCatResponses);
response.setResponses(osCatResponses, result.second());
response.setResponseName(getCommandName());
this.setResponseObject(response);
}

View File

@ -29,6 +29,7 @@ import com.cloud.api.Parameter;
import com.cloud.api.response.GuestOSResponse;
import com.cloud.api.response.ListResponse;
import com.cloud.storage.GuestOS;
import com.cloud.utils.Pair;
@Implementation(description="Lists all supported OS types for this cloud.", responseObject=GuestOSResponse.class)
public class ListGuestOsCmd extends BaseListCmd {
@ -79,10 +80,10 @@ public class ListGuestOsCmd extends BaseListCmd {
@Override
public void execute(){
List<? extends GuestOS> result = _mgr.listGuestOSByCriteria(this);
Pair<List<? extends GuestOS>, Integer> result = _mgr.listGuestOSByCriteria(this);
ListResponse<GuestOSResponse> response = new ListResponse<GuestOSResponse>();
List<GuestOSResponse> osResponses = new ArrayList<GuestOSResponse>();
for (GuestOS guestOS : result) {
for (GuestOS guestOS : result.first()) {
GuestOSResponse guestOSResponse = new GuestOSResponse();
guestOSResponse.setDescription(guestOS.getDisplayName());
guestOSResponse.setId(guestOS.getId());
@ -92,7 +93,7 @@ public class ListGuestOsCmd extends BaseListCmd {
osResponses.add(guestOSResponse);
}
response.setResponses(osResponses);
response.setResponses(osResponses, result.second());
response.setResponseName(getCommandName());
this.setResponseObject(response);
}

View File

@ -30,6 +30,7 @@ import com.cloud.api.response.HypervisorCapabilitiesResponse;
import com.cloud.api.response.ListResponse;
import com.cloud.hypervisor.Hypervisor.HypervisorType;
import com.cloud.hypervisor.HypervisorCapabilities;
import com.cloud.utils.Pair;
@Implementation(description="Lists all hypervisor capabilities.", responseObject=HypervisorCapabilitiesResponse.class, since="3.0.0")
public class ListHypervisorCapabilitiesCmd extends BaseListCmd {
@ -76,16 +77,17 @@ public class ListHypervisorCapabilitiesCmd extends BaseListCmd {
@Override
public void execute(){
List<? extends HypervisorCapabilities> hpvCapabilities = _mgr.listHypervisorCapabilities(getId(), getHypervisor(), getKeyword(), this.getStartIndex(), this.getPageSizeVal());
Pair<List<? extends HypervisorCapabilities>, Integer> hpvCapabilities = _mgr.listHypervisorCapabilities(getId(),
getHypervisor(), getKeyword(), this.getStartIndex(), this.getPageSizeVal());
ListResponse<HypervisorCapabilitiesResponse> response = new ListResponse<HypervisorCapabilitiesResponse>();
List<HypervisorCapabilitiesResponse> hpvCapabilitiesResponses = new ArrayList<HypervisorCapabilitiesResponse>();
for (HypervisorCapabilities capability : hpvCapabilities) {
for (HypervisorCapabilities capability : hpvCapabilities.first()) {
HypervisorCapabilitiesResponse hpvCapabilityResponse = _responseGenerator.createHypervisorCapabilitiesResponse(capability);
hpvCapabilityResponse.setObjectName("hypervisorCapabilities");
hpvCapabilitiesResponses.add(hpvCapabilityResponse);
}
response.setResponses(hpvCapabilitiesResponses);
response.setResponses(hpvCapabilitiesResponses, hpvCapabilities.second());
response.setResponseName(getCommandName());
this.setResponseObject(response);
}

View File

@ -22,7 +22,6 @@ import java.util.List;
import org.apache.log4j.Logger;
import com.cloud.api.ApiConstants;
import com.cloud.api.BaseCmd.CommandType;
import com.cloud.api.BaseListProjectAndAccountResourcesCmd;
import com.cloud.api.IdentityMapper;
import com.cloud.api.Implementation;
@ -32,6 +31,7 @@ import com.cloud.api.response.IpForwardingRuleResponse;
import com.cloud.api.response.ListResponse;
import com.cloud.network.rules.FirewallRule;
import com.cloud.network.rules.StaticNatRule;
import com.cloud.utils.Pair;
@Implementation(description="List the ip forwarding rules", responseObject=FirewallRuleResponse.class)
public class ListIpForwardingRulesCmd extends BaseListProjectAndAccountResourcesCmd {
@ -82,17 +82,18 @@ public class ListIpForwardingRulesCmd extends BaseListProjectAndAccountResources
@Override
public void execute(){
List<? extends FirewallRule> result = _rulesService.searchStaticNatRules(publicIpAddressId, id, vmId, this.getStartIndex(), this.getPageSizeVal(), this.getAccountName(), this.getDomainId(), this.getProjectId(), this.isRecursive(), this.listAll());
Pair<List<? extends FirewallRule>, Integer> result = _rulesService.searchStaticNatRules(publicIpAddressId, id, vmId,
this.getStartIndex(), this.getPageSizeVal(), this.getAccountName(), this.getDomainId(), this.getProjectId(), this.isRecursive(), this.listAll());
ListResponse<IpForwardingRuleResponse> response = new ListResponse<IpForwardingRuleResponse>();
List<IpForwardingRuleResponse> ipForwardingResponses = new ArrayList<IpForwardingRuleResponse>();
for (FirewallRule rule : result) {
for (FirewallRule rule : result.first()) {
StaticNatRule staticNatRule = _rulesService.buildStaticNatRule(rule, false);
IpForwardingRuleResponse resp = _responseGenerator.createIpForwardingRuleResponse(staticNatRule);
if (resp != null) {
ipForwardingResponses.add(resp);
}
}
response.setResponses(ipForwardingResponses);
response.setResponses(ipForwardingResponses, result.second());
response.setResponseName(getCommandName());
this.setResponseObject(response);
}

View File

@ -23,7 +23,6 @@ import java.util.Set;
import org.apache.log4j.Logger;
import com.cloud.api.ApiConstants;
import com.cloud.api.BaseCmd.CommandType;
import com.cloud.api.BaseListTaggedResourcesCmd;
import com.cloud.api.IdentityMapper;
import com.cloud.api.Implementation;

View File

@ -29,6 +29,7 @@ import com.cloud.api.Parameter;
import com.cloud.api.response.ListResponse;
import com.cloud.api.response.LoadBalancerResponse;
import com.cloud.network.rules.LoadBalancer;
import com.cloud.utils.Pair;
@Implementation(description = "Lists load balancer rules.", responseObject = LoadBalancerResponse.class)
public class ListLoadBalancerRulesCmd extends BaseListTaggedResourcesCmd {
@ -94,17 +95,17 @@ public class ListLoadBalancerRulesCmd extends BaseListTaggedResourcesCmd {
@Override
public void execute() {
List<? extends LoadBalancer> loadBalancers = _lbService.searchForLoadBalancers(this);
Pair<List<? extends LoadBalancer>, Integer> loadBalancers = _lbService.searchForLoadBalancers(this);
ListResponse<LoadBalancerResponse> response = new ListResponse<LoadBalancerResponse>();
List<LoadBalancerResponse> lbResponses = new ArrayList<LoadBalancerResponse>();
if (loadBalancers != null) {
for (LoadBalancer loadBalancer : loadBalancers) {
for (LoadBalancer loadBalancer : loadBalancers.first()) {
LoadBalancerResponse lbResponse = _responseGenerator.createLoadBalancerResponse(loadBalancer);
lbResponse.setObjectName("loadbalancerrule");
lbResponses.add(lbResponse);
}
}
response.setResponses(lbResponses);
response.setResponses(lbResponses, loadBalancers.second());
response.setResponseName(getCommandName());
this.setResponseObject(response);
}

View File

@ -31,6 +31,7 @@ import com.cloud.api.Parameter;
import com.cloud.api.response.ListResponse;
import com.cloud.api.response.NetworkACLResponse;
import com.cloud.network.rules.FirewallRule;
import com.cloud.utils.Pair;
@Implementation(description="Lists all network ACLs", responseObject=NetworkACLResponse.class)
public class ListNetworkACLsCmd extends BaseListTaggedResourcesCmd {
@ -79,15 +80,15 @@ public class ListNetworkACLsCmd extends BaseListTaggedResourcesCmd {
@Override
public void execute(){
List<? extends FirewallRule> result = _networkACLService.listNetworkACLs(this);
Pair<List<? extends FirewallRule>,Integer> result = _networkACLService.listNetworkACLs(this);
ListResponse<NetworkACLResponse> response = new ListResponse<NetworkACLResponse>();
List<NetworkACLResponse> aclResponses = new ArrayList<NetworkACLResponse>();
for (FirewallRule acl : result) {
for (FirewallRule acl : result.first()) {
NetworkACLResponse ruleData = _responseGenerator.createNetworkACLResponse(acl);
aclResponses.add(ruleData);
}
response.setResponses(aclResponses);
response.setResponses(aclResponses, result.second());
response.setResponseName(getCommandName());
this.setResponseObject(response);
}

View File

@ -30,6 +30,7 @@ import com.cloud.api.response.ListResponse;
import com.cloud.api.response.ProviderResponse;
import com.cloud.network.PhysicalNetworkServiceProvider;
import com.cloud.user.Account;
import com.cloud.utils.Pair;
@Implementation(description="Lists network serviceproviders for a given physical network.", responseObject=ProviderResponse.class, since="3.0.0")
@ -86,15 +87,16 @@ public class ListNetworkServiceProvidersCmd extends BaseListCmd {
@Override
public void execute(){
List<? extends PhysicalNetworkServiceProvider> serviceProviders = _networkService.listNetworkServiceProviders(getPhysicalNetworkId(), getName(), getState(), this.getStartIndex(), this.getPageSizeVal());
Pair<List<? extends PhysicalNetworkServiceProvider>, Integer> serviceProviders = _networkService.listNetworkServiceProviders(getPhysicalNetworkId(),
getName(), getState(), this.getStartIndex(), this.getPageSizeVal());
ListResponse<ProviderResponse> response = new ListResponse<ProviderResponse>();
List<ProviderResponse> serviceProvidersResponses = new ArrayList<ProviderResponse>();
for (PhysicalNetworkServiceProvider serviceProvider : serviceProviders) {
for (PhysicalNetworkServiceProvider serviceProvider : serviceProviders.first()) {
ProviderResponse serviceProviderResponse = _responseGenerator.createNetworkServiceProviderResponse(serviceProvider);
serviceProvidersResponses.add(serviceProviderResponse);
}
response.setResponses(serviceProvidersResponses);
response.setResponses(serviceProvidersResponses, serviceProviders.second());
response.setResponseName(getCommandName());
this.setResponseObject(response);
}

View File

@ -32,6 +32,7 @@ import com.cloud.api.response.ListResponse;
import com.cloud.api.response.PhysicalNetworkResponse;
import com.cloud.network.PhysicalNetwork;
import com.cloud.user.Account;
import com.cloud.utils.Pair;
@Implementation(description="Lists physical networks", responseObject=PhysicalNetworkResponse.class, since="3.0.0")
public class ListPhysicalNetworksCmd extends BaseListCmd {
@ -86,15 +87,16 @@ public class ListPhysicalNetworksCmd extends BaseListCmd {
@Override
public void execute(){
List<? extends PhysicalNetwork> result = _networkService.searchPhysicalNetworks(getId(),getZoneId(), this.getKeyword(), this.getStartIndex(), this.getPageSizeVal(), getNetworkName());
Pair<List<? extends PhysicalNetwork>, Integer> result = _networkService.searchPhysicalNetworks(getId(),getZoneId(),
this.getKeyword(), this.getStartIndex(), this.getPageSizeVal(), getNetworkName());
if (result != null) {
ListResponse<PhysicalNetworkResponse> response = new ListResponse<PhysicalNetworkResponse>();
List<PhysicalNetworkResponse> networkResponses = new ArrayList<PhysicalNetworkResponse>();
for (PhysicalNetwork network : result) {
for (PhysicalNetwork network : result.first()) {
PhysicalNetworkResponse networkResponse = _responseGenerator.createPhysicalNetworkResponse(network);
networkResponses.add(networkResponse);
}
response.setResponses(networkResponses);
response.setResponses(networkResponses, result.second());
response.setResponseName(getCommandName());
this.setResponseObject(response);
}else {

View File

@ -26,10 +26,10 @@ import com.cloud.api.BaseListCmd;
import com.cloud.api.IdentityMapper;
import com.cloud.api.Implementation;
import com.cloud.api.Parameter;
import com.cloud.api.BaseCmd.CommandType;
import com.cloud.api.response.ListResponse;
import com.cloud.api.response.PodResponse;
import com.cloud.dc.Pod;
import com.cloud.utils.Pair;
@Implementation(description="Lists all Pods.", responseObject=PodResponse.class)
public class ListPodsByCmd extends BaseListCmd {
@ -93,16 +93,16 @@ public class ListPodsByCmd extends BaseListCmd {
@Override
public void execute(){
List<? extends Pod> result = _mgr.searchForPods(this);
Pair<List<? extends Pod>, Integer> result = _mgr.searchForPods(this);
ListResponse<PodResponse> response = new ListResponse<PodResponse>();
List<PodResponse> podResponses = new ArrayList<PodResponse>();
for (Pod pod : result) {
for (Pod pod : result.first()) {
PodResponse podResponse = _responseGenerator.createPodResponse(pod, showCapacities);
podResponse.setObjectName("pod");
podResponses.add(podResponse);
}
response.setResponses(podResponses);
response.setResponses(podResponses, result.second());
response.setResponseName(getCommandName());
this.setResponseObject(response);
}

View File

@ -29,6 +29,7 @@ import com.cloud.api.Parameter;
import com.cloud.api.response.FirewallRuleResponse;
import com.cloud.api.response.ListResponse;
import com.cloud.network.rules.PortForwardingRule;
import com.cloud.utils.Pair;
@Implementation(description="Lists all port forwarding rules for an IP address.", responseObject=FirewallRuleResponse.class)
public class ListPortForwardingRulesCmd extends BaseListTaggedResourcesCmd {
@ -71,16 +72,16 @@ public class ListPortForwardingRulesCmd extends BaseListTaggedResourcesCmd {
@Override
public void execute(){
List<? extends PortForwardingRule> result = _rulesService.listPortForwardingRules(this);
Pair<List<? extends PortForwardingRule>, Integer> result = _rulesService.listPortForwardingRules(this);
ListResponse<FirewallRuleResponse> response = new ListResponse<FirewallRuleResponse>();
List<FirewallRuleResponse> fwResponses = new ArrayList<FirewallRuleResponse>();
for (PortForwardingRule fwRule : result) {
for (PortForwardingRule fwRule : result.first()) {
FirewallRuleResponse ruleData = _responseGenerator.createPortForwardingRuleResponse(fwRule);
ruleData.setObjectName("portforwardingrule");
fwResponses.add(ruleData);
}
response.setResponses(fwResponses);
response.setResponses(fwResponses, result.second());
response.setResponseName(getCommandName());
this.setResponseObject(response);
}

View File

@ -29,6 +29,7 @@ import com.cloud.api.Parameter;
import com.cloud.api.response.ListResponse;
import com.cloud.api.response.PrivateGatewayResponse;
import com.cloud.network.vpc.PrivateGateway;
import com.cloud.utils.Pair;
@Implementation(description="List private gateways", responseObject=PrivateGatewayResponse.class)
public class ListPrivateGatewaysCmd extends BaseListProjectAndAccountResourcesCmd{
@ -91,14 +92,14 @@ public class ListPrivateGatewaysCmd extends BaseListProjectAndAccountResourcesCm
@Override
public void execute() {
List<PrivateGateway> gateways = _vpcService.listPrivateGateway(this);
Pair<List<PrivateGateway>, Integer> gateways = _vpcService.listPrivateGateway(this);
ListResponse<PrivateGatewayResponse> response = new ListResponse<PrivateGatewayResponse>();
List<PrivateGatewayResponse> projectResponses = new ArrayList<PrivateGatewayResponse>();
for (PrivateGateway gateway : gateways) {
for (PrivateGateway gateway : gateways.first()) {
PrivateGatewayResponse gatewayResponse = _responseGenerator.createPrivateGatewayResponse(gateway);
projectResponses.add(gatewayResponse);
}
response.setResponses(projectResponses);
response.setResponses(projectResponses, gateways.second());
response.setResponseName(getCommandName());
this.setResponseObject(response);

View File

@ -31,6 +31,7 @@ import com.cloud.api.response.ProjectAccountResponse;
import com.cloud.api.response.ProjectResponse;
import com.cloud.projects.ProjectAccount;
import com.cloud.user.Account;
import com.cloud.utils.Pair;
@Implementation(description="Lists project's accounts", responseObject=ProjectResponse.class, since="3.0.0")
public class ListProjectAccountsCmd extends BaseListCmd {
@ -78,14 +79,15 @@ public class ListProjectAccountsCmd extends BaseListCmd {
@Override
public void execute(){
List<? extends ProjectAccount> projectAccounts = _projectService.listProjectAccounts(projectId, accountName, role, this.getStartIndex(), this.getPageSizeVal());
Pair<List<? extends ProjectAccount>, Integer> projectAccounts = _projectService.listProjectAccounts(projectId,
accountName, role, this.getStartIndex(), this.getPageSizeVal());
ListResponse<ProjectAccountResponse> response = new ListResponse<ProjectAccountResponse>();
List<ProjectAccountResponse> projectResponses = new ArrayList<ProjectAccountResponse>();
for (ProjectAccount projectAccount : projectAccounts) {
for (ProjectAccount projectAccount : projectAccounts.first()) {
ProjectAccountResponse projectAccountResponse = _responseGenerator.createProjectAccountResponse(projectAccount);
projectResponses.add(projectAccountResponse);
}
response.setResponses(projectResponses);
response.setResponses(projectResponses, projectAccounts.second());
response.setResponseName(getCommandName());
this.setResponseObject(response);

View File

@ -29,6 +29,7 @@ import com.cloud.api.Parameter;
import com.cloud.api.response.ListResponse;
import com.cloud.api.response.ProjectInvitationResponse;
import com.cloud.projects.ProjectInvitation;
import com.cloud.utils.Pair;
@Implementation(description = "Lists projects and provides detailed information for listed projects", responseObject = ProjectInvitationResponse.class, since = "3.0.0")
public class ListProjectInvitationsCmd extends BaseListAccountResourcesCmd {
@ -82,15 +83,16 @@ public class ListProjectInvitationsCmd extends BaseListAccountResourcesCmd {
@Override
public void execute() {
List<? extends ProjectInvitation> invites = _projectService.listProjectInvitations(id, projectId, this.getAccountName(), this.getDomainId(), state, activeOnly, this.getStartIndex(), this.getPageSizeVal(),
Pair<List<? extends ProjectInvitation>, Integer> invites = _projectService.listProjectInvitations(id, projectId,
this.getAccountName(), this.getDomainId(), state, activeOnly, this.getStartIndex(), this.getPageSizeVal(),
this.isRecursive(), this.listAll());
ListResponse<ProjectInvitationResponse> response = new ListResponse<ProjectInvitationResponse>();
List<ProjectInvitationResponse> projectInvitationResponses = new ArrayList<ProjectInvitationResponse>();
for (ProjectInvitation invite : invites) {
for (ProjectInvitation invite : invites.first()) {
ProjectInvitationResponse projectResponse = _responseGenerator.createProjectInvitationResponse(invite);
projectInvitationResponses.add(projectResponse);
}
response.setResponses(projectInvitationResponses);
response.setResponses(projectInvitationResponses, invites.second());
response.setResponseName(getCommandName());
this.setResponseObject(response);

View File

@ -34,6 +34,7 @@ import com.cloud.api.response.ListResponse;
import com.cloud.api.response.ProjectResponse;
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.projects.Project;
import com.cloud.utils.Pair;
@Implementation(description="Lists projects and provides detailed information for listed projects", responseObject=ProjectResponse.class, since="3.0.0")
public class ListProjectsCmd extends BaseListAccountResourcesCmd {
@ -106,16 +107,16 @@ public class ListProjectsCmd extends BaseListAccountResourcesCmd {
@Override
public void execute(){
List<? extends Project> projects = _projectService.listProjects(id, name, displayText, state,
Pair<List<? extends Project>, Integer> projects = _projectService.listProjects(id, name, displayText, state,
this.getAccountName(), this.getDomainId(), this.getKeyword(), this.getStartIndex(), this.getPageSizeVal(),
this.listAll(), this.isRecursive(), getTags());
ListResponse<ProjectResponse> response = new ListResponse<ProjectResponse>();
List<ProjectResponse> projectResponses = new ArrayList<ProjectResponse>();
for (Project project : projects) {
for (Project project : projects.first()) {
ProjectResponse projectResponse = _responseGenerator.createProjectResponse(project);
projectResponses.add(projectResponse);
}
response.setResponses(projectResponses);
response.setResponses(projectResponses, projects.second());
response.setResponseName(getCommandName());
this.setResponseObject(response);

View File

@ -30,6 +30,7 @@ import com.cloud.api.response.IPAddressResponse;
import com.cloud.api.response.ListResponse;
import com.cloud.async.AsyncJob;
import com.cloud.network.IpAddress;
import com.cloud.utils.Pair;
@Implementation(description="Lists all public ip addresses", responseObject=IPAddressResponse.class)
@ -141,16 +142,16 @@ public class ListPublicIpAddressesCmd extends BaseListTaggedResourcesCmd {
@Override
public void execute(){
List<? extends IpAddress> result = _mgr.searchForIPAddresses(this);
Pair<List<? extends IpAddress>, Integer> result = _mgr.searchForIPAddresses(this);
ListResponse<IPAddressResponse> response = new ListResponse<IPAddressResponse>();
List<IPAddressResponse> ipAddrResponses = new ArrayList<IPAddressResponse>();
for (IpAddress ipAddress : result) {
for (IpAddress ipAddress : result.first()) {
IPAddressResponse ipResponse = _responseGenerator.createIPAddressResponse(ipAddress);
ipResponse.setObjectName("publicipaddress");
ipAddrResponses.add(ipResponse);
}
response.setResponses(ipAddrResponses);
response.setResponses(ipAddrResponses, result.second());
response.setResponseName(getCommandName());
this.setResponseObject(response);
}

View File

@ -29,6 +29,7 @@ import com.cloud.api.Parameter;
import com.cloud.api.response.ListResponse;
import com.cloud.api.response.RemoteAccessVpnResponse;
import com.cloud.network.RemoteAccessVpn;
import com.cloud.utils.Pair;
@Implementation(description="Lists remote access vpns", responseObject=RemoteAccessVpnResponse.class)
public class ListRemoteAccessVpnsCmd extends BaseListProjectAndAccountResourcesCmd {
@ -64,15 +65,15 @@ public class ListRemoteAccessVpnsCmd extends BaseListProjectAndAccountResourcesC
@Override
public void execute(){
List<? extends RemoteAccessVpn> vpns = _ravService.searchForRemoteAccessVpns(this);
Pair<List<? extends RemoteAccessVpn>, Integer> vpns = _ravService.searchForRemoteAccessVpns(this);
ListResponse<RemoteAccessVpnResponse> response = new ListResponse<RemoteAccessVpnResponse>();
List<RemoteAccessVpnResponse> vpnResponses = new ArrayList<RemoteAccessVpnResponse>();
if (vpns != null && !vpns.isEmpty()) {
for (RemoteAccessVpn vpn : vpns) {
if (vpns.first() != null && !vpns.first().isEmpty()) {
for (RemoteAccessVpn vpn : vpns.first()) {
vpnResponses.add(_responseGenerator.createRemoteAccessVpnResponse(vpn));
}
}
response.setResponses(vpnResponses);
response.setResponses(vpnResponses, vpns.second());
response.setResponseName(getCommandName());
this.setResponseObject(response);
}

View File

@ -30,6 +30,7 @@ import com.cloud.api.response.DomainRouterResponse;
import com.cloud.api.response.ListResponse;
import com.cloud.async.AsyncJob;
import com.cloud.network.router.VirtualRouter;
import com.cloud.utils.Pair;
@Implementation(description="List routers.", responseObject=DomainRouterResponse.class)
public class ListRoutersCmd extends BaseListProjectAndAccountResourcesCmd {
@ -129,16 +130,16 @@ public class ListRoutersCmd extends BaseListProjectAndAccountResourcesCmd {
@Override
public void execute(){
List<? extends VirtualRouter> result = _mgr.searchForRouters(this);
Pair<List<? extends VirtualRouter>, Integer> result = _mgr.searchForRouters(this);
ListResponse<DomainRouterResponse> response = new ListResponse<DomainRouterResponse>();
List<DomainRouterResponse> routerResponses = new ArrayList<DomainRouterResponse>();
for (VirtualRouter router : result) {
for (VirtualRouter router : result.first()) {
DomainRouterResponse routerResponse = _responseGenerator.createDomainRouterResponse(router);
routerResponse.setObjectName("router");
routerResponses.add(routerResponse);
}
response.setResponses(routerResponses);
response.setResponses(routerResponses, result.second());
response.setResponseName(getCommandName());
this.setResponseObject(response);
}

View File

@ -22,13 +22,13 @@ import java.util.List;
import org.apache.log4j.Logger;
import com.cloud.api.ApiConstants;
import com.cloud.api.BaseCmd.CommandType;
import com.cloud.api.BaseListProjectAndAccountResourcesCmd;
import com.cloud.api.Implementation;
import com.cloud.api.Parameter;
import com.cloud.api.response.ListResponse;
import com.cloud.api.response.SSHKeyPairResponse;
import com.cloud.user.SSHKeyPair;
import com.cloud.utils.Pair;
@Implementation(description="List registered keypairs", responseObject=SSHKeyPairResponse.class)
public class ListSSHKeyPairsCmd extends BaseListProjectAndAccountResourcesCmd {
@ -66,16 +66,16 @@ public class ListSSHKeyPairsCmd extends BaseListProjectAndAccountResourcesCmd {
@Override
public void execute() {
List<? extends SSHKeyPair> resultList = _mgr.listSSHKeyPairs(this);
Pair<List<? extends SSHKeyPair>, Integer> resultList = _mgr.listSSHKeyPairs(this);
List<SSHKeyPairResponse> responses = new ArrayList<SSHKeyPairResponse>();
for (SSHKeyPair result : resultList) {
for (SSHKeyPair result : resultList.first()) {
SSHKeyPairResponse r = new SSHKeyPairResponse(result.getName(), result.getFingerprint());
r.setObjectName("sshkeypair");
responses.add(r);
}
ListResponse<SSHKeyPairResponse> response = new ListResponse<SSHKeyPairResponse>();
response.setResponses(responses);
response.setResponses(responses, resultList.second());
response.setResponseName(getCommandName());
this.setResponseObject(response);
}

View File

@ -30,6 +30,7 @@ import com.cloud.api.response.ListResponse;
import com.cloud.api.response.SnapshotResponse;
import com.cloud.async.AsyncJob;
import com.cloud.storage.Snapshot;
import com.cloud.utils.Pair;
@Implementation(description="Lists all available snapshots for the account.", responseObject=SnapshotResponse.class)
@ -98,15 +99,15 @@ public class ListSnapshotsCmd extends BaseListTaggedResourcesCmd {
@Override
public void execute(){
List<? extends Snapshot> result = _snapshotService.listSnapshots(this);
Pair<List<? extends Snapshot>, Integer> result = _snapshotService.listSnapshots(this);
ListResponse<SnapshotResponse> response = new ListResponse<SnapshotResponse>();
List<SnapshotResponse> snapshotResponses = new ArrayList<SnapshotResponse>();
for (Snapshot snapshot : result) {
for (Snapshot snapshot : result.first()) {
SnapshotResponse snapshotResponse = _responseGenerator.createSnapshotResponse(snapshot);
snapshotResponse.setObjectName("snapshot");
snapshotResponses.add(snapshotResponse);
}
response.setResponses(snapshotResponses);
response.setResponses(snapshotResponses, result.second());
response.setResponseName(getCommandName());
this.setResponseObject(response);

View File

@ -26,6 +26,7 @@ import com.cloud.api.Parameter;
import com.cloud.api.response.ListResponse;
import com.cloud.api.response.StaticRouteResponse;
import com.cloud.network.vpc.StaticRoute;
import com.cloud.utils.Pair;
@Implementation(description="Lists all static routes", responseObject=StaticRouteResponse.class)
public class ListStaticRoutesCmd extends BaseListTaggedResourcesCmd {
@ -68,15 +69,15 @@ public class ListStaticRoutesCmd extends BaseListTaggedResourcesCmd {
@Override
public void execute(){
List<? extends StaticRoute> result = _vpcService.listStaticRoutes(this);
Pair<List<? extends StaticRoute>, Integer> result = _vpcService.listStaticRoutes(this);
ListResponse<StaticRouteResponse> response = new ListResponse<StaticRouteResponse>();
List<StaticRouteResponse> routeResponses = new ArrayList<StaticRouteResponse>();
for (StaticRoute route : result) {
for (StaticRoute route : result.first()) {
StaticRouteResponse ruleData = _responseGenerator.createStaticRouteResponse(route);
routeResponses.add(ruleData);
}
response.setResponses(routeResponses);
response.setResponses(routeResponses, result.second());
response.setResponseName(getCommandName());
this.setResponseObject(response);
}

View File

@ -26,11 +26,11 @@ import com.cloud.api.BaseListCmd;
import com.cloud.api.IdentityMapper;
import com.cloud.api.Implementation;
import com.cloud.api.Parameter;
import com.cloud.api.BaseCmd.CommandType;
import com.cloud.api.response.ListResponse;
import com.cloud.api.response.StoragePoolResponse;
import com.cloud.async.AsyncJob;
import com.cloud.storage.StoragePool;
import com.cloud.utils.Pair;
@Implementation(description="Lists storage pools.", responseObject=StoragePoolResponse.class)
public class ListStoragePoolsCmd extends BaseListCmd {
@ -114,16 +114,16 @@ public class ListStoragePoolsCmd extends BaseListCmd {
@Override
public void execute(){
List<? extends StoragePool> pools = _mgr.searchForStoragePools(this);
Pair<List<? extends StoragePool>, Integer> pools = _mgr.searchForStoragePools(this);
ListResponse<StoragePoolResponse> response = new ListResponse<StoragePoolResponse>();
List<StoragePoolResponse> poolResponses = new ArrayList<StoragePoolResponse>();
for (StoragePool pool : pools) {
for (StoragePool pool : pools.first()) {
StoragePoolResponse poolResponse = _responseGenerator.createStoragePoolResponse(pool);
poolResponse.setObjectName("storagepool");
poolResponses.add(poolResponse);
}
response.setResponses(poolResponses);
response.setResponses(poolResponses, pools.second());
response.setResponseName(getCommandName());
this.setResponseObject(response);
}

View File

@ -29,6 +29,7 @@ import com.cloud.api.Parameter;
import com.cloud.api.response.ListResponse;
import com.cloud.api.response.SystemVmResponse;
import com.cloud.async.AsyncJob;
import com.cloud.utils.Pair;
import com.cloud.vm.VirtualMachine;
@Implementation(description="List system virtual machines.", responseObject=SystemVmResponse.class)
@ -121,16 +122,16 @@ public class ListSystemVMsCmd extends BaseListCmd {
@Override
public void execute(){
List<? extends VirtualMachine> systemVMs = _mgr.searchForSystemVm(this);
Pair<List<? extends VirtualMachine>, Integer> systemVMs = _mgr.searchForSystemVm(this);
ListResponse<SystemVmResponse> response = new ListResponse<SystemVmResponse>();
List<SystemVmResponse> vmResponses = new ArrayList<SystemVmResponse>();
for (VirtualMachine systemVM : systemVMs) {
for (VirtualMachine systemVM : systemVMs.first()) {
SystemVmResponse vmResponse = _responseGenerator.createSystemVmResponse(systemVM);
vmResponse.setObjectName("systemvm");
vmResponses.add(vmResponse);
}
response.setResponses(vmResponses);
response.setResponses(vmResponses, systemVMs.second());
response.setResponseName(getCommandName());
this.setResponseObject(response);
}

View File

@ -27,6 +27,7 @@ import com.cloud.api.Parameter;
import com.cloud.api.response.ListResponse;
import com.cloud.api.response.ResourceTagResponse;
import com.cloud.server.ResourceTag;
import com.cloud.utils.Pair;
@Implementation(description = "List resource tag(s)", responseObject = ResourceTagResponse.class, since = "Burbank")
public class ListTagsCmd extends BaseListProjectAndAccountResourcesCmd{
@ -55,14 +56,14 @@ public class ListTagsCmd extends BaseListProjectAndAccountResourcesCmd{
@Override
public void execute() {
List<? extends ResourceTag> tags = _taggedResourceService.listTags(this);
Pair<List<? extends ResourceTag>, Integer> tags = _taggedResourceService.listTags(this);
ListResponse<ResourceTagResponse> response = new ListResponse<ResourceTagResponse>();
List<ResourceTagResponse> tagResponses = new ArrayList<ResourceTagResponse>();
for (ResourceTag tag : tags) {
for (ResourceTag tag : tags.first()) {
ResourceTagResponse tagResponse = _responseGenerator.createResourceTagResponse(tag, false);
tagResponses.add(tagResponse);
}
response.setResponses(tagResponses);
response.setResponses(tagResponses, tags.second());
response.setResponseName(getCommandName());
this.setResponseObject(response);

View File

@ -31,6 +31,7 @@ import com.cloud.api.response.ProviderResponse;
import com.cloud.api.response.TrafficTypeResponse;
import com.cloud.network.PhysicalNetworkTrafficType;
import com.cloud.user.Account;
import com.cloud.utils.Pair;
@Implementation(description="Lists traffic types of a given physical network.", responseObject=ProviderResponse.class, since="3.0.0")
@ -72,15 +73,15 @@ public class ListTrafficTypesCmd extends BaseListCmd {
@Override
public void execute(){
List<? extends PhysicalNetworkTrafficType> trafficTypes = _networkService.listTrafficTypes(getPhysicalNetworkId());
Pair<List<? extends PhysicalNetworkTrafficType>, Integer> trafficTypes = _networkService.listTrafficTypes(getPhysicalNetworkId());
ListResponse<TrafficTypeResponse> response = new ListResponse<TrafficTypeResponse>();
List<TrafficTypeResponse> trafficTypesResponses = new ArrayList<TrafficTypeResponse>();
for (PhysicalNetworkTrafficType trafficType : trafficTypes) {
for (PhysicalNetworkTrafficType trafficType : trafficTypes.first()) {
TrafficTypeResponse trafficTypeResponse = _responseGenerator.createTrafficTypeResponse(trafficType);
trafficTypesResponses.add(trafficTypeResponse);
}
response.setResponses(trafficTypesResponses);
response.setResponses(trafficTypesResponses, trafficTypes.second());
response.setResponseName(getCommandName());
this.setResponseObject(response);
}

View File

@ -29,6 +29,7 @@ import com.cloud.api.Parameter;
import com.cloud.api.response.ListResponse;
import com.cloud.api.response.UserResponse;
import com.cloud.user.UserAccount;
import com.cloud.utils.Pair;
@Implementation(description="Lists user accounts", responseObject=UserResponse.class)
public class ListUsersCmd extends BaseListAccountResourcesCmd {
@ -85,14 +86,14 @@ public class ListUsersCmd extends BaseListAccountResourcesCmd {
@Override
public void execute(){
List<? extends UserAccount> result = _accountService.searchForUsers(this);
Pair<List<? extends UserAccount>, Integer> result = _accountService.searchForUsers(this);
ListResponse<UserResponse> response = new ListResponse<UserResponse>();
List<UserResponse> userResponses = new ArrayList<UserResponse>();
for (UserAccount user : result) {
for (UserAccount user : result.first()) {
UserResponse userResponse = _responseGenerator.createUserResponse(user);
userResponses.add(userResponse);
}
response.setResponses(userResponses);
response.setResponses(userResponses, result.second());
response.setResponseName(getCommandName());
this.setResponseObject(response);
}

View File

@ -28,6 +28,7 @@ import com.cloud.api.Implementation;
import com.cloud.api.Parameter;
import com.cloud.api.response.InstanceGroupResponse;
import com.cloud.api.response.ListResponse;
import com.cloud.utils.Pair;
import com.cloud.vm.InstanceGroup;
@Implementation(description="Lists vm groups", responseObject=InstanceGroupResponse.class)
@ -70,16 +71,16 @@ public class ListVMGroupsCmd extends BaseListProjectAndAccountResourcesCmd {
@Override
public void execute(){
List<? extends InstanceGroup> groups = _mgr.searchForVmGroups(this);
Pair<List<? extends InstanceGroup>, Integer> groups = _mgr.searchForVmGroups(this);
ListResponse<InstanceGroupResponse> response = new ListResponse<InstanceGroupResponse>();
List<InstanceGroupResponse> responses = new ArrayList<InstanceGroupResponse>();
for (InstanceGroup group : groups) {
for (InstanceGroup group : groups.first()) {
InstanceGroupResponse groupResponse = _responseGenerator.createInstanceGroupResponse(group);
groupResponse.setObjectName("instancegroup");
responses.add(groupResponse);
}
response.setResponses(responses);
response.setResponses(responses, groups.second());
response.setResponseName(getCommandName());
this.setResponseObject(response);
}

View File

@ -33,6 +33,8 @@ import com.cloud.api.response.UserVmResponse;
import com.cloud.async.AsyncJob;
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.uservm.UserVm;
import com.cloud.utils.Pair;
@Implementation(description="List the virtual machines owned by the account.", responseObject=UserVmResponse.class)
public class ListVMsCmd extends BaseListTaggedResourcesCmd {
@ -197,17 +199,17 @@ public class ListVMsCmd extends BaseListTaggedResourcesCmd {
@Override
public void execute(){
List<? extends UserVm> result = _userVmService.searchForUserVMs(this);
Pair<List<? extends UserVm>, Integer> result = _userVmService.searchForUserVMs(this);
ListResponse<UserVmResponse> response = new ListResponse<UserVmResponse>();
EnumSet<VMDetails> details = getDetails();
List<UserVmResponse> vmResponses;
if (details.contains(VMDetails.all)){ // for all use optimized version
vmResponses = _responseGenerator.createUserVmResponse("virtualmachine", result.toArray(new UserVm[result.size()]));
vmResponses = _responseGenerator.createUserVmResponse("virtualmachine", result.first().toArray(new UserVm[result.first().size()]));
}
else {
vmResponses = _responseGenerator.createUserVmResponse("virtualmachine", getDetails(), result.toArray(new UserVm[result.size()]));
vmResponses = _responseGenerator.createUserVmResponse("virtualmachine", getDetails(), result.first().toArray(new UserVm[result.first().size()]));
}
response.setResponses(vmResponses);
response.setResponses(vmResponses, result.second());
response.setResponseName(getCommandName());
this.setResponseObject(response);
}

View File

@ -29,6 +29,7 @@ import com.cloud.api.Parameter;
import com.cloud.api.response.ListResponse;
import com.cloud.api.response.VlanIpRangeResponse;
import com.cloud.dc.Vlan;
import com.cloud.utils.Pair;
@Implementation(description="Lists all VLAN IP ranges.", responseObject=VlanIpRangeResponse.class)
public class ListVlanIpRangesCmd extends BaseListCmd {
@ -132,16 +133,16 @@ public class ListVlanIpRangesCmd extends BaseListCmd {
@Override
public void execute(){
List<? extends Vlan> vlans = _mgr.searchForVlans(this);
Pair<List<? extends Vlan>, Integer> vlans = _mgr.searchForVlans(this);
ListResponse<VlanIpRangeResponse> response = new ListResponse<VlanIpRangeResponse>();
List<VlanIpRangeResponse> vlanResponses = new ArrayList<VlanIpRangeResponse>();
for (Vlan vlan : vlans) {
for (Vlan vlan : vlans.first()) {
VlanIpRangeResponse vlanResponse = _responseGenerator.createVlanIpRangeResponse(vlan);
vlanResponse.setObjectName("vlaniprange");
vlanResponses.add(vlanResponse);
}
response.setResponses(vlanResponses);
response.setResponses(vlanResponses, vlans.second());
response.setResponseName(getCommandName());
this.setResponseObject(response);
}

View File

@ -30,6 +30,7 @@ import com.cloud.api.response.ListResponse;
import com.cloud.api.response.VolumeResponse;
import com.cloud.async.AsyncJob;
import com.cloud.storage.Volume;
import com.cloud.utils.Pair;
@Implementation(description="Lists all volumes.", responseObject=VolumeResponse.class)
@ -117,17 +118,17 @@ public class ListVolumesCmd extends BaseListTaggedResourcesCmd {
@Override
public void execute(){
List<? extends Volume> volumes = _storageService.searchForVolumes(this);
Pair<List<? extends Volume>, Integer> volumes = _storageService.searchForVolumes(this);
ListResponse<VolumeResponse> response = new ListResponse<VolumeResponse>();
List<VolumeResponse> volResponses = new ArrayList<VolumeResponse>();
for (Volume volume : volumes) {
for (Volume volume : volumes.first()) {
VolumeResponse volResponse = _responseGenerator.createVolumeResponse(volume);
volResponse.setObjectName("volume");
volResponses.add(volResponse);
}
response.setResponses(volResponses);
response.setResponses(volResponses, volumes.second());
response.setResponseName(getCommandName());
this.setResponseObject(response);
}

View File

@ -29,6 +29,7 @@ import com.cloud.api.Parameter;
import com.cloud.api.response.ListResponse;
import com.cloud.api.response.Site2SiteVpnConnectionResponse;
import com.cloud.network.Site2SiteVpnConnection;
import com.cloud.utils.Pair;
@Implementation(description="Lists site to site vpn connection gateways", responseObject=Site2SiteVpnConnectionResponse.class)
public class ListVpnConnectionsCmd extends BaseListProjectAndAccountResourcesCmd {
@ -72,20 +73,19 @@ public class ListVpnConnectionsCmd extends BaseListProjectAndAccountResourcesCmd
@Override
public void execute(){
List<Site2SiteVpnConnection> conns = _s2sVpnService.searchForVpnConnections(this);
Pair<List<? extends Site2SiteVpnConnection>, Integer> conns = _s2sVpnService.searchForVpnConnections(this);
ListResponse<Site2SiteVpnConnectionResponse> response = new ListResponse<Site2SiteVpnConnectionResponse>();
List<Site2SiteVpnConnectionResponse> connResponses = new ArrayList<Site2SiteVpnConnectionResponse>();
if (conns != null && !conns.isEmpty()) {
for (Site2SiteVpnConnection conn : conns) {
if (conn == null) {
continue;
}
Site2SiteVpnConnectionResponse site2SiteVpnConnectonRes = _responseGenerator.createSite2SiteVpnConnectionResponse(conn);
site2SiteVpnConnectonRes.setObjectName("vpnconnection");
connResponses.add(site2SiteVpnConnectonRes);
for (Site2SiteVpnConnection conn : conns.first()) {
if (conn == null) {
continue;
}
Site2SiteVpnConnectionResponse site2SiteVpnConnectonRes = _responseGenerator.createSite2SiteVpnConnectionResponse(conn);
site2SiteVpnConnectonRes.setObjectName("vpnconnection");
connResponses.add(site2SiteVpnConnectonRes);
}
response.setResponses(connResponses);
response.setResponses(connResponses, conns.second());
response.setResponseName(getCommandName());
this.setResponseObject(response);
}

View File

@ -29,6 +29,7 @@ import com.cloud.api.Parameter;
import com.cloud.api.response.ListResponse;
import com.cloud.api.response.Site2SiteCustomerGatewayResponse;
import com.cloud.network.Site2SiteCustomerGateway;
import com.cloud.utils.Pair;
@Implementation(description="Lists site to site vpn customer gateways", responseObject=Site2SiteCustomerGatewayResponse.class)
public class ListVpnCustomerGatewaysCmd extends BaseListProjectAndAccountResourcesCmd {
@ -64,20 +65,19 @@ public class ListVpnCustomerGatewaysCmd extends BaseListProjectAndAccountResourc
@Override
public void execute(){
List<Site2SiteCustomerGateway> gws = _s2sVpnService.searchForCustomerGateways(this);
Pair<List<? extends Site2SiteCustomerGateway>, Integer> gws = _s2sVpnService.searchForCustomerGateways(this);
ListResponse<Site2SiteCustomerGatewayResponse> response = new ListResponse<Site2SiteCustomerGatewayResponse>();
List<Site2SiteCustomerGatewayResponse> gwResponses = new ArrayList<Site2SiteCustomerGatewayResponse>();
if (gws != null && !gws.isEmpty()) {
for (Site2SiteCustomerGateway gw : gws) {
if (gw == null) {
continue;
}
Site2SiteCustomerGatewayResponse site2SiteCustomerGatewayRes = _responseGenerator.createSite2SiteCustomerGatewayResponse(gw);
site2SiteCustomerGatewayRes.setObjectName("vpncustomergateway");
gwResponses.add(site2SiteCustomerGatewayRes);
for (Site2SiteCustomerGateway gw : gws.first()) {
if (gw == null) {
continue;
}
Site2SiteCustomerGatewayResponse site2SiteCustomerGatewayRes = _responseGenerator.createSite2SiteCustomerGatewayResponse(gw);
site2SiteCustomerGatewayRes.setObjectName("vpncustomergateway");
gwResponses.add(site2SiteCustomerGatewayRes);
}
response.setResponses(gwResponses);
response.setResponses(gwResponses, gws.second());
response.setResponseName(getCommandName());
this.setResponseObject(response);
}

View File

@ -29,6 +29,7 @@ import com.cloud.api.Parameter;
import com.cloud.api.response.ListResponse;
import com.cloud.api.response.Site2SiteVpnGatewayResponse;
import com.cloud.network.Site2SiteVpnGateway;
import com.cloud.utils.Pair;
@Implementation(description="Lists site 2 site vpn gateways", responseObject=Site2SiteVpnGatewayResponse.class)
public class ListVpnGatewaysCmd extends BaseListProjectAndAccountResourcesCmd {
@ -71,20 +72,19 @@ public class ListVpnGatewaysCmd extends BaseListProjectAndAccountResourcesCmd {
@Override
public void execute(){
List<Site2SiteVpnGateway> gws = _s2sVpnService.searchForVpnGateways(this);
Pair<List<? extends Site2SiteVpnGateway>, Integer> gws = _s2sVpnService.searchForVpnGateways(this);
ListResponse<Site2SiteVpnGatewayResponse> response = new ListResponse<Site2SiteVpnGatewayResponse>();
List<Site2SiteVpnGatewayResponse> gwResponses = new ArrayList<Site2SiteVpnGatewayResponse>();
if (gws != null && !gws.isEmpty()) {
for (Site2SiteVpnGateway gw : gws) {
if (gw == null) {
continue;
}
Site2SiteVpnGatewayResponse site2SiteVpnGatewayRes = _responseGenerator.createSite2SiteVpnGatewayResponse(gw);
site2SiteVpnGatewayRes.setObjectName("vpngateway");
gwResponses.add(site2SiteVpnGatewayRes);
}
for (Site2SiteVpnGateway gw : gws.first()) {
if (gw == null) {
continue;
}
Site2SiteVpnGatewayResponse site2SiteVpnGatewayRes = _responseGenerator.createSite2SiteVpnGatewayResponse(gw);
site2SiteVpnGatewayRes.setObjectName("vpngateway");
gwResponses.add(site2SiteVpnGatewayRes);
}
response.setResponses(gwResponses);
response.setResponses(gwResponses, gws.second());
response.setResponseName(getCommandName());
this.setResponseObject(response);
}

View File

@ -29,6 +29,7 @@ import com.cloud.api.Parameter;
import com.cloud.api.response.ListResponse;
import com.cloud.api.response.VpnUsersResponse;
import com.cloud.network.VpnUser;
import com.cloud.utils.Pair;
@Implementation(description="Lists vpn users", responseObject=VpnUsersResponse.class)
public class ListVpnUsersCmd extends BaseListProjectAndAccountResourcesCmd {
@ -69,15 +70,15 @@ public class ListVpnUsersCmd extends BaseListProjectAndAccountResourcesCmd {
@Override
public void execute(){
List<? extends VpnUser> vpnUsers = _ravService.searchForVpnUsers(this);
Pair<List<? extends VpnUser>, Integer> vpnUsers = _ravService.searchForVpnUsers(this);
ListResponse<VpnUsersResponse> response = new ListResponse<VpnUsersResponse>();
List<VpnUsersResponse> vpnResponses = new ArrayList<VpnUsersResponse>();
for (VpnUser vpnUser : vpnUsers) {
for (VpnUser vpnUser : vpnUsers.first()) {
vpnResponses.add(_responseGenerator.createVpnUserResponse(vpnUser));
}
response.setResponses(vpnResponses);
response.setResponses(vpnResponses, vpnUsers.second());
response.setResponseName(getCommandName());
this.setResponseObject(response);
}

View File

@ -108,12 +108,12 @@ public class RemoveVpnUserCmd extends BaseAsyncCmd {
@Override
public void execute(){
Account owner = _accountService.getAccount(getEntityOwnerId());
boolean result = _ravService.removeVpnUser(owner.getId(), userName);
boolean result = _ravService.removeVpnUser(owner.getId(), userName, UserContext.current().getCaller());
if (!result) {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to remove vpn user");
}
if (!_ravService.applyVpnUsers(owner.getId())) {
if (!_ravService.applyVpnUsers(owner.getId(), userName)) {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to apply vpn user removal");
}
SuccessResponse response = new SuccessResponse(getCommandName());

View File

@ -22,11 +22,9 @@ import org.apache.log4j.Logger;
import com.cloud.api.ApiConstants;
import com.cloud.api.BaseAsyncCmd;
import com.cloud.api.BaseCmd;
import com.cloud.api.IdentityMapper;
import com.cloud.api.Implementation;
import com.cloud.api.Parameter;
import com.cloud.api.ServerApiException;
import com.cloud.api.response.PhysicalNetworkResponse;
import com.cloud.async.AsyncJob;
import com.cloud.event.EventTypes;
@ -99,13 +97,9 @@ public class UpdatePhysicalNetworkCmd extends BaseAsyncCmd {
@Override
public void execute(){
PhysicalNetwork result = _networkService.updatePhysicalNetwork(getId(),getNetworkSpeed(), getTags(), getVlan(), getState());
if (result != null) {
PhysicalNetworkResponse response = _responseGenerator.createPhysicalNetworkResponse(result);
response.setResponseName(getCommandName());
this.setResponseObject(response);
}else {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to update physical network");
}
PhysicalNetworkResponse response = _responseGenerator.createPhysicalNetworkResponse(result);
response.setResponseName(getCommandName());
this.setResponseObject(response);
}
@Override

View File

@ -62,7 +62,8 @@ public class IPAddressResponse extends BaseResponse implements ControlledEntityR
@SerializedName(ApiConstants.FOR_VIRTUAL_NETWORK) @Param(description="the virtual network for the IP address")
private Boolean forVirtualNetwork;
@SerializedName(ApiConstants.VLAN_ID) @Param(description="the ID of the VLAN associated with the IP address")
@SerializedName(ApiConstants.VLAN_ID) @Param(description="the ID of the VLAN associated with the IP address." +
" This parameter is visible to ROOT admins only")
private IdentityProxy vlanId = new IdentityProxy("vlan");
@SerializedName("vlanname") @Param(description="the VLAN associated with the IP address")

View File

@ -22,6 +22,7 @@ import com.cloud.api.ResponseObject;
public class ListResponse<T extends ResponseObject> extends BaseResponse {
List<T> responses;
private transient Integer count;
public List<T> getResponses() {
return responses;
@ -30,12 +31,22 @@ public class ListResponse<T extends ResponseObject> extends BaseResponse {
public void setResponses(List<T> responses) {
this.responses = responses;
}
public void setResponses(List<T> responses, Integer count) {
this.responses = responses;
this.count = count;
}
public Integer getCount() {
if (count != null) {
return count;
}
if (responses != null) {
return responses.size();
} else {
return null;
}
return null;
}
}

View File

@ -77,7 +77,7 @@ public class NetworkResponse extends BaseResponse implements ControlledEntityRes
@SerializedName("related") @Param(description="related to what other network configuration")
private IdentityProxy related = new IdentityProxy("networks");
@SerializedName("broadcasturi") @Param(description="broadcast uri of the network")
@SerializedName("broadcasturi") @Param(description="broadcast uri of the network. This parameter is visible to ROOT admins only")
private String broadcastUri;
@SerializedName(ApiConstants.DNS1) @Param(description="the first DNS for the network")
@ -89,7 +89,7 @@ public class NetworkResponse extends BaseResponse implements ControlledEntityRes
@SerializedName(ApiConstants.TYPE) @Param(description="the type of the network")
private String type;
@SerializedName(ApiConstants.VLAN) @Param(description="the vlan of the network")
@SerializedName(ApiConstants.VLAN) @Param(description="The vlan of the network. This parameter is visible to ROOT admins only")
private String vlan;
@SerializedName(ApiConstants.ACL_TYPE) @Param(description="acl type - access type to the network")

View File

@ -291,4 +291,9 @@ public class EventTypes {
public static final String EVENT_TAGS_CREATE = "CREATE_TAGS";
public static final String EVENT_TAGS_DELETE = "DELETE_TAGS";
// external network device events
public static final String EVENT_EXTERNAL_NVP_CONTROLLER_ADD = "PHYSICAL.NVPCONTROLLER.ADD";
public static final String EVENT_EXTERNAL_NVP_CONTROLLER_DELETE = "PHYSICAL.NVPCONTROLLER.DELETE";
public static final String EVENT_EXTERNAL_NVP_CONTROLLER_CONFIGURE = "PHYSICAL.NVPCONTROLLER.CONFIGURE";
}

View File

@ -82,7 +82,7 @@ public interface NetworkService {
PhysicalNetwork createPhysicalNetwork(Long zoneId, String vnetRange, String networkSpeed,
List<String> isolationMethods, String broadcastDomainRange, Long domainId, List<String> tags, String name);
List<? extends PhysicalNetwork> searchPhysicalNetworks(Long id, Long zoneId, String keyword,
Pair<List<? extends PhysicalNetwork>, Integer> searchPhysicalNetworks(Long id, Long zoneId, String keyword,
Long startIndex, Long pageSize, String name);
PhysicalNetwork updatePhysicalNetwork(Long id, String networkSpeed, List<String> tags,
@ -97,7 +97,7 @@ public interface NetworkService {
PhysicalNetworkServiceProvider addProviderToPhysicalNetwork(Long physicalNetworkId, String providerName,
Long destinationPhysicalNetworkId, List<String> enabledServices);
List<? extends PhysicalNetworkServiceProvider> listNetworkServiceProviders(Long physicalNetworkId, String name,
Pair<List<? extends PhysicalNetworkServiceProvider>, Integer> listNetworkServiceProviders(Long physicalNetworkId, String name,
String state, Long startIndex, Long pageSize);
PhysicalNetworkServiceProvider updateNetworkServiceProvider(Long id, String state, List<String> enabledServices);
@ -123,7 +123,7 @@ public interface NetworkService {
boolean deletePhysicalNetworkTrafficType(Long id);
List<? extends PhysicalNetworkTrafficType> listTrafficTypes(Long physicalNetworkId);
Pair<List<? extends PhysicalNetworkTrafficType>, Integer> listTrafficTypes(Long physicalNetworkId);
PhysicalNetwork getDefaultPhysicalNetworkByZoneAndTrafficType(long zoneId, TrafficType trafficType);

View File

@ -21,6 +21,7 @@ import com.cloud.exception.ConcurrentOperationException;
import com.cloud.exception.InsufficientCapacityException;
import com.cloud.exception.ResourceUnavailableException;
import com.cloud.network.router.VirtualRouter;
import com.cloud.user.Account;
public interface VirtualNetworkApplianceService {
/**
@ -60,6 +61,6 @@ public interface VirtualNetworkApplianceService {
VirtualRouter startRouter(long id) throws ResourceUnavailableException, InsufficientCapacityException, ConcurrentOperationException;
VirtualRouter destroyRouter(long routerId) throws ResourceUnavailableException, ConcurrentOperationException;
VirtualRouter destroyRouter(long routerId, Account caller, Long callerUserId) throws ResourceUnavailableException, ConcurrentOperationException;
}

View File

@ -104,10 +104,11 @@ public interface NetworkElement extends Adapter {
/**
* The network is being destroyed.
* @param network
* @param context TODO
* @return
* @throws ConcurrentOperationException
*/
boolean destroy(Network network) throws ConcurrentOperationException, ResourceUnavailableException;
boolean destroy(Network network, ReservationContext context) throws ConcurrentOperationException, ResourceUnavailableException;
/**
* Check if the instances of this Element are configured to be used on the physical network referred by this provider.

View File

@ -41,11 +41,12 @@ public interface VpcProvider extends NetworkElement{
/**
* @param vpc
* @param context TODO
* @return
* @throws ConcurrentOperationException
* @throws ResourceUnavailableException
*/
boolean shutdownVpc(Vpc vpc) throws ConcurrentOperationException, ResourceUnavailableException;
boolean shutdownVpc(Vpc vpc, ReservationContext context) throws ConcurrentOperationException, ResourceUnavailableException;
boolean createPrivateGateway(PrivateGateway gateway) throws ConcurrentOperationException, ResourceUnavailableException;

View File

@ -16,6 +16,7 @@
// under the License.
package com.cloud.network.firewall;
import java.util.List;
import com.cloud.api.commands.ListFirewallRulesCmd;
@ -23,11 +24,12 @@ import com.cloud.exception.NetworkRuleConflictException;
import com.cloud.exception.ResourceUnavailableException;
import com.cloud.network.rules.FirewallRule;
import com.cloud.user.Account;
import com.cloud.utils.Pair;
public interface FirewallService {
FirewallRule createFirewallRule(FirewallRule rule) throws NetworkRuleConflictException;
List<? extends FirewallRule> listFirewallRules(ListFirewallRulesCmd cmd);
Pair<List<? extends FirewallRule>, Integer> listFirewallRules(ListFirewallRulesCmd cmd);
/**
* Revokes a firewall rule

View File

@ -16,6 +16,7 @@
// under the License.
package com.cloud.network.firewall;
import java.util.List;
import com.cloud.api.commands.ListNetworkACLsCmd;
@ -23,6 +24,7 @@ import com.cloud.exception.NetworkRuleConflictException;
import com.cloud.exception.ResourceUnavailableException;
import com.cloud.network.rules.FirewallRule;
import com.cloud.user.Account;
import com.cloud.utils.Pair;
public interface NetworkACLService {
FirewallRule getNetworkACL(long ruleId);
@ -43,6 +45,6 @@ public interface NetworkACLService {
* @param listNetworkACLsCmd
* @return
*/
List<? extends FirewallRule> listNetworkACLs(ListNetworkACLsCmd cmd);
Pair<List<? extends FirewallRule>, Integer> listNetworkACLs(ListNetworkACLsCmd cmd);
}

View File

@ -30,6 +30,8 @@ import com.cloud.exception.ResourceUnavailableException;
import com.cloud.network.rules.LoadBalancer;
import com.cloud.network.rules.StickinessPolicy;
import com.cloud.uservm.UserVm;
import com.cloud.utils.Pair;
public interface LoadBalancingRulesService {
/**
@ -90,7 +92,7 @@ public interface LoadBalancingRulesService {
* by id, name, public ip, and vm instance id
* @return list of load balancers that match the criteria
*/
List<? extends LoadBalancer> searchForLoadBalancers(ListLoadBalancerRulesCmd cmd);
Pair<List<? extends LoadBalancer>, Integer> searchForLoadBalancers(ListLoadBalancerRulesCmd cmd);
/**
* List stickiness policies based on the given criteria
@ -105,4 +107,4 @@ public interface LoadBalancingRulesService {
LoadBalancer findById(long LoadBalancer);
}
}

View File

@ -23,9 +23,10 @@ import com.cloud.exception.InsufficientAddressCapacityException;
import com.cloud.exception.NetworkRuleConflictException;
import com.cloud.exception.ResourceUnavailableException;
import com.cloud.user.Account;
import com.cloud.utils.Pair;
public interface RulesService {
List<? extends FirewallRule> searchStaticNatRules(Long ipId, Long id, Long vmId, Long start, Long size, String accountName, Long domainId, Long projectId, boolean isRecursive, boolean listAll);
Pair<List<? extends FirewallRule>, Integer> searchStaticNatRules(Long ipId, Long id, Long vmId, Long start, Long size, String accountName, Long domainId, Long projectId, boolean isRecursive, boolean listAll);
/**
* Creates a port forwarding rule between two ip addresses or between
@ -60,7 +61,7 @@ public interface RulesService {
* the command object holding the criteria for listing port forwarding rules (the ipAddress)
* @return list of port forwarding rules on the given address, empty list if no rules exist
*/
public List<? extends PortForwardingRule> listPortForwardingRules(ListPortForwardingRulesCmd cmd);
public Pair<List<? extends PortForwardingRule>, Integer> listPortForwardingRules(ListPortForwardingRulesCmd cmd);
boolean applyPortForwardingRules(long ipAdddressId, Account caller) throws ResourceUnavailableException;

View File

@ -18,13 +18,13 @@ package com.cloud.network.security;
import java.util.List;
import com.cloud.api.commands.AuthorizeSecurityGroupIngressCmd;
import com.cloud.api.commands.AuthorizeSecurityGroupEgressCmd;
import com.cloud.api.commands.AuthorizeSecurityGroupIngressCmd;
import com.cloud.api.commands.CreateSecurityGroupCmd;
import com.cloud.api.commands.DeleteSecurityGroupCmd;
import com.cloud.api.commands.ListSecurityGroupsCmd;
import com.cloud.api.commands.RevokeSecurityGroupIngressCmd;
import com.cloud.api.commands.RevokeSecurityGroupEgressCmd;
import com.cloud.api.commands.RevokeSecurityGroupIngressCmd;
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.exception.PermissionDeniedException;
import com.cloud.exception.ResourceInUseException;

View File

@ -34,6 +34,7 @@ import com.cloud.network.Network.Provider;
import com.cloud.network.Network.Service;
import com.cloud.user.Account;
import com.cloud.user.User;
import com.cloud.utils.Pair;
public interface VpcService {
@ -190,7 +191,7 @@ public interface VpcService {
* @param listPrivateGatewaysCmd
* @return
*/
public List<PrivateGateway> listPrivateGateway(ListPrivateGatewaysCmd listPrivateGatewaysCmd);
public Pair<List<PrivateGateway>, Integer> listPrivateGateway(ListPrivateGatewaysCmd listPrivateGatewaysCmd);
/**
* @param routeId
@ -223,7 +224,7 @@ public interface VpcService {
* @param listStaticRoutesCmd
* @return
*/
public List<? extends StaticRoute> listStaticRoutes(ListStaticRoutesCmd cmd);
public Pair<List<? extends StaticRoute>, Integer> listStaticRoutes(ListStaticRoutesCmd cmd);
/**
* @param id

View File

@ -24,21 +24,23 @@ import com.cloud.exception.NetworkRuleConflictException;
import com.cloud.exception.ResourceUnavailableException;
import com.cloud.network.RemoteAccessVpn;
import com.cloud.network.VpnUser;
import com.cloud.user.Account;
import com.cloud.utils.Pair;
public interface RemoteAccessVpnService {
RemoteAccessVpn createRemoteAccessVpn(long vpnServerAddressId, String ipRange, boolean openFirewall, long networkId)
throws NetworkRuleConflictException;
void destroyRemoteAccessVpn(long vpnServerAddressId) throws ResourceUnavailableException;
void destroyRemoteAccessVpn(long vpnServerAddressId, Account caller) throws ResourceUnavailableException;
RemoteAccessVpn startRemoteAccessVpn(long vpnServerAddressId, boolean openFirewall) throws ResourceUnavailableException;
VpnUser addVpnUser(long vpnOwnerId, String userName, String password);
boolean removeVpnUser(long vpnOwnerId, String userName);
boolean removeVpnUser(long vpnOwnerId, String userName, Account caller);
List<? extends VpnUser> listVpnUsers(long vpnOwnerId, String userName);
boolean applyVpnUsers(long vpnOwnerId);
boolean applyVpnUsers(long vpnOwnerId, String userName);
List<? extends RemoteAccessVpn> searchForRemoteAccessVpns(ListRemoteAccessVpnsCmd cmd);
List<? extends VpnUser> searchForVpnUsers(ListVpnUsersCmd cmd);
Pair<List<? extends RemoteAccessVpn>, Integer> searchForRemoteAccessVpns(ListRemoteAccessVpnsCmd cmd);
Pair<List<? extends VpnUser>, Integer> searchForVpnUsers(ListVpnUsersCmd cmd);
List<? extends RemoteAccessVpn> listRemoteAccessVpns(long networkId);

View File

@ -31,10 +31,10 @@ import com.cloud.api.commands.ResetVpnConnectionCmd;
import com.cloud.api.commands.UpdateVpnCustomerGatewayCmd;
import com.cloud.exception.NetworkRuleConflictException;
import com.cloud.exception.ResourceUnavailableException;
import com.cloud.network.IpAddress;
import com.cloud.network.Site2SiteCustomerGateway;
import com.cloud.network.Site2SiteVpnConnection;
import com.cloud.network.Site2SiteVpnGateway;
import com.cloud.utils.Pair;
public interface Site2SiteVpnService {
Site2SiteVpnGateway createVpnGateway(CreateVpnGatewayCmd cmd);
@ -46,8 +46,8 @@ public interface Site2SiteVpnService {
boolean deleteVpnGateway(DeleteVpnGatewayCmd deleteVpnGatewayCmd);
boolean deleteVpnConnection(DeleteVpnConnectionCmd deleteVpnConnectionCmd) throws ResourceUnavailableException;
Site2SiteVpnConnection resetVpnConnection(ResetVpnConnectionCmd resetVpnConnectionCmd) throws ResourceUnavailableException;
List<Site2SiteCustomerGateway> searchForCustomerGateways(ListVpnCustomerGatewaysCmd listVpnCustomerGatewaysCmd);
List<Site2SiteVpnGateway> searchForVpnGateways(ListVpnGatewaysCmd listVpnGatewaysCmd);
List<Site2SiteVpnConnection> searchForVpnConnections(ListVpnConnectionsCmd listVpnConnectionsCmd);
Pair<List<? extends Site2SiteCustomerGateway>, Integer> searchForCustomerGateways(ListVpnCustomerGatewaysCmd listVpnCustomerGatewaysCmd);
Pair<List<? extends Site2SiteVpnGateway>, Integer> searchForVpnGateways(ListVpnGatewaysCmd listVpnGatewaysCmd);
Pair<List<? extends Site2SiteVpnConnection>, Integer> searchForVpnConnections(ListVpnConnectionsCmd listVpnConnectionsCmd);
Site2SiteCustomerGateway updateCustomerGateway(UpdateVpnCustomerGatewayCmd updateVpnCustomerGatewayCmd);
}

View File

@ -24,6 +24,7 @@ import com.cloud.exception.ResourceAllocationException;
import com.cloud.exception.ResourceUnavailableException;
import com.cloud.projects.ProjectAccount.Role;
import com.cloud.user.Account;
import com.cloud.utils.Pair;
public interface ProjectService {
/**
@ -60,7 +61,7 @@ public interface ProjectService {
*/
Project getProject(long id);
List<? extends Project> listProjects(Long id, String name, String displayText, String state, String accountName,
Pair<List<? extends Project>, Integer> listProjects(Long id, String name, String displayText, String state, String accountName,
Long domainId, String keyword, Long startIndex, Long pageSize, boolean listAll, boolean isRecursive, Map<String, String> tags);
ProjectAccount assignAccountToProject(Project project, long accountId, Role accountRole);
@ -79,9 +80,9 @@ public interface ProjectService {
boolean deleteAccountFromProject(long projectId, String accountName);
List<? extends ProjectAccount> listProjectAccounts(long projectId, String accountName, String role, Long startIndex, Long pageSizeVal);
Pair<List<? extends ProjectAccount>, Integer> listProjectAccounts(long projectId, String accountName, String role, Long startIndex, Long pageSizeVal);
List<? extends ProjectInvitation> listProjectInvitations(Long id, Long projectId, String accountName, Long domainId, String state, boolean activeOnly, Long startIndex, Long pageSizeVal, boolean isRecursive,
Pair<List<? extends ProjectInvitation>, Integer> listProjectInvitations(Long id, Long projectId, String accountName, Long domainId, String state, boolean activeOnly, Long startIndex, Long pageSizeVal, boolean isRecursive,
boolean listAll);
boolean updateInvitation(long projectId, String accountName, String token, boolean accept);
@ -93,4 +94,6 @@ public interface ProjectService {
Project enableProject(long projectId);
boolean deleteProjectInvitation(long invitationId);
Project findByProjectAccountIdIncludingRemoved(long projectAccountId);
}

View File

@ -113,6 +113,7 @@ public enum ResourceState {
s_fsm.addTransition(ResourceState.ErrorInMaintenance, Event.Disable, ResourceState.Disabled);
s_fsm.addTransition(ResourceState.ErrorInMaintenance, Event.DeleteHost, ResourceState.Disabled);
s_fsm.addTransition(ResourceState.ErrorInMaintenance, Event.InternalEnterMaintenance, ResourceState.Maintenance);
s_fsm.addTransition(ResourceState.ErrorInMaintenance, Event.AdminCancelMaintenance, ResourceState.Enabled);
s_fsm.addTransition(ResourceState.Error, Event.InternalCreated, ResourceState.Error);
}
}

View File

@ -114,7 +114,7 @@ public interface ManagementService {
*
* @return map of configuration name/values
*/
List<? extends Configuration> searchForConfigurations(ListCfgsByCmd c);
Pair<List<? extends Configuration>, Integer> searchForConfigurations(ListCfgsByCmd c);
/**
* Searches for Service Offerings by the specified search criteria Can search by: "name"
@ -130,7 +130,7 @@ public interface ManagementService {
* @param c
* @return
*/
List<? extends Cluster> searchForClusters(ListClustersCmd c);
Pair<List<? extends Cluster>, Integer> searchForClusters(ListClustersCmd c);
/**
* Searches for Clusters by the specified zone Id.
@ -145,7 +145,7 @@ public interface ManagementService {
* @param cmd
* @return List of Pods
*/
List<? extends Pod> searchForPods(ListPodsByCmd cmd);
Pair<List<? extends Pod>, Integer> searchForPods(ListPodsByCmd cmd);
/**
* Searches for servers by the specified search criteria Can search by: "name", "type", "state", "dataCenterId",
@ -184,7 +184,7 @@ public interface ManagementService {
* @param cmd
* @return List of DomainRouters.
*/
List<? extends VirtualRouter> searchForRouters(ListRoutersCmd cmd);
Pair<List<? extends VirtualRouter>, Integer> searchForRouters(ListRoutersCmd cmd);
/**
* Obtains a list of IP Addresses by the specified search criteria. Can search by: "userId", "dataCenterId",
@ -194,21 +194,21 @@ public interface ManagementService {
* the command that wraps the search criteria
* @return List of IPAddresses
*/
List<? extends IpAddress> searchForIPAddresses(ListPublicIpAddressesCmd cmd);
Pair<List<? extends IpAddress>, Integer> searchForIPAddresses(ListPublicIpAddressesCmd cmd);
/**
* Obtains a list of all guest OS.
*
* @return list of GuestOS
*/
List<? extends GuestOS> listGuestOSByCriteria(ListGuestOsCmd cmd);
Pair<List<? extends GuestOS>, Integer> listGuestOSByCriteria(ListGuestOsCmd cmd);
/**
* Obtains a list of all guest OS categories.
*
* @return list of GuestOSCategories
*/
List<? extends GuestOsCategory> listGuestOSCategoriesByCriteria(ListGuestOsCategoriesCmd cmd);
Pair<List<? extends GuestOsCategory>, Integer> listGuestOSCategoriesByCriteria(ListGuestOsCategoriesCmd cmd);
VirtualMachine stopSystemVM(StopSystemVmCmd cmd) throws ResourceUnavailableException, ConcurrentOperationException;
@ -235,7 +235,7 @@ public interface ManagementService {
* @param c
* @return List of Alerts
*/
List<? extends Alert> searchForAlerts(ListAlertsCmd cmd);
Pair<List<? extends Alert>, Integer> searchForAlerts(ListAlertsCmd cmd);
/**
* list all the capacity rows in capacity operations table
@ -283,7 +283,7 @@ public interface ManagementService {
* the command that wraps the search criteria (zone, pod, name, IP address, path, and cluster id)
* @return a list of storage pools that match the given criteria
*/
List<? extends StoragePool> searchForStoragePools(ListStoragePoolsCmd cmd);
Pair<List<? extends StoragePool>, Integer> searchForStoragePools(ListStoragePoolsCmd cmd);
/**
* List system VMs by the given search criteria
@ -292,7 +292,7 @@ public interface ManagementService {
* the command that wraps the search criteria (host, name, state, type, zone, pod, and/or id)
* @return the list of system vms that match the given criteria
*/
List<? extends VirtualMachine> searchForSystemVm(ListSystemVMsCmd cmd);
Pair<List<? extends VirtualMachine>, Integer> searchForSystemVm(ListSystemVMsCmd cmd);
/**
* Returns back a SHA1 signed response
@ -307,7 +307,7 @@ public interface ManagementService {
InstanceGroup updateVmGroup(UpdateVMGroupCmd cmd);
List<? extends InstanceGroup> searchForVmGroups(ListVMGroupsCmd cmd);
Pair<List<? extends InstanceGroup>, Integer> searchForVmGroups(ListVMGroupsCmd cmd);
Map<String, Object> listCapabilities(ListCapabilitiesCmd cmd);
@ -354,7 +354,7 @@ public interface ManagementService {
* @param cmd
* @return List of Vlans
*/
List<? extends Vlan> searchForVlans(ListVlanIpRangesCmd cmd);
Pair<List<? extends Vlan>, Integer> searchForVlans(ListVlanIpRangesCmd cmd);
/**
* Search for async jobs by account and/or startDate
@ -363,7 +363,7 @@ public interface ManagementService {
* the command specifying the account and start date parameters
* @return the list of async jobs that match the criteria
*/
List<? extends AsyncJob> searchForAsyncJobs(ListAsyncJobsCmd cmd);
Pair<List<? extends AsyncJob>, Integer> searchForAsyncJobs(ListAsyncJobsCmd cmd);
/**
* Generates a random password that will be used (initially) by newly created and started virtual machines
@ -383,7 +383,7 @@ public interface ManagementService {
* The api command class.
* @return The list of key pairs found.
*/
List<? extends SSHKeyPair> listSSHKeyPairs(ListSSHKeyPairsCmd cmd);
Pair<List<? extends SSHKeyPair>, Integer> listSSHKeyPairs(ListSSHKeyPairsCmd cmd);
/**
* Registers a key pair for a given public key.
@ -439,7 +439,7 @@ public interface ManagementService {
String[] listEventTypes();
List<? extends HypervisorCapabilities> listHypervisorCapabilities(Long id, HypervisorType hypervisorType, String keyword, Long startIndex, Long pageSizeVal);
Pair<List<? extends HypervisorCapabilities>, Integer> listHypervisorCapabilities(Long id, HypervisorType hypervisorType, String keyword, Long startIndex, Long pageSizeVal);
HypervisorCapabilities updateHypervisorCapabilities(Long id, Long maxGuestsLimit, Boolean securityGroupEnabled);

View File

@ -21,6 +21,7 @@ import java.util.Map;
import com.cloud.api.commands.ListTagsCmd;
import com.cloud.server.ResourceTag.TaggedResourceType;
import com.cloud.utils.Pair;
public interface TaggedResourceService {
@ -46,7 +47,7 @@ public interface TaggedResourceService {
* @param listTagsCmd
* @return
*/
List<? extends ResourceTag> listTags(ListTagsCmd listTagsCmd);
Pair<List<? extends ResourceTag>, Integer> listTags(ListTagsCmd listTagsCmd);
/**
* @param resourceIds

View File

@ -32,6 +32,8 @@ import com.cloud.exception.PermissionDeniedException;
import com.cloud.exception.ResourceAllocationException;
import com.cloud.exception.ResourceInUseException;
import com.cloud.exception.ResourceUnavailableException;
import com.cloud.user.Account;
import com.cloud.utils.Pair;
public interface StorageService{
/**
@ -71,7 +73,6 @@ public interface StorageService{
*/
Volume createVolume(CreateVolumeCmd cmd);
boolean deleteVolume(long volumeId) throws ConcurrentOperationException;
/**
* Delete the storage pool
@ -114,7 +115,7 @@ public interface StorageService{
Volume migrateVolume(Long volumeId, Long storagePoolId) throws ConcurrentOperationException;
List<? extends Volume> searchForVolumes(ListVolumesCmd cmd);
Pair<List<? extends Volume>, Integer> searchForVolumes(ListVolumesCmd cmd);
/**
* Uploads the volume to secondary storage
@ -125,4 +126,6 @@ public interface StorageService{
*/
Volume uploadVolume(UploadVolumeCmd cmd) throws ResourceAllocationException;
boolean deleteVolume(long volumeId, Account caller) throws ConcurrentOperationException;
}

View File

@ -26,7 +26,9 @@ import com.cloud.api.commands.ListSnapshotsCmd;
import com.cloud.exception.PermissionDeniedException;
import com.cloud.exception.ResourceAllocationException;
import com.cloud.storage.Snapshot;
import com.cloud.storage.Volume;
import com.cloud.user.Account;
import com.cloud.utils.Pair;
public interface SnapshotService {
@ -38,7 +40,7 @@ public interface SnapshotService {
* @return list of snapshots
* @throws PermissionDeniedException
*/
List<? extends Snapshot> listSnapshots(ListSnapshotsCmd cmd);
Pair<List<? extends Snapshot>, Integer> listSnapshots(ListSnapshotsCmd cmd);
/**
* Delete specified snapshot from the specified. If no other policies are assigned it calls destroy snapshot. This
@ -97,4 +99,10 @@ public interface SnapshotService {
* @return the Snapshot that was created
*/
Snapshot createSnapshot(Long volumeId, Long policyId, Long snapshotId, Account snapshotOwner);
/**
* @param vol
* @return
*/
Long getHostIdForSnapshotOperation(Volume vol);
}

View File

@ -191,9 +191,9 @@ public interface AccountService {
public String[] createApiKeyAndSecretKey(RegisterCmd cmd);
List<? extends Account> searchForAccounts(ListAccountsCmd cmd);
Pair<List<? extends Account>, Integer> searchForAccounts(ListAccountsCmd cmd);
List<? extends UserAccount> searchForUsers(ListUsersCmd cmd)
Pair<List<? extends UserAccount>, Integer> searchForUsers(ListUsersCmd cmd)
throws PermissionDeniedException;
UserAccount getUserByApiKey(String apiKey);

View File

@ -22,6 +22,7 @@ import com.cloud.api.commands.ListDomainChildrenCmd;
import com.cloud.api.commands.ListDomainsCmd;
import com.cloud.domain.Domain;
import com.cloud.exception.PermissionDeniedException;
import com.cloud.utils.Pair;
public interface DomainService {
@ -39,10 +40,10 @@ public interface DomainService {
boolean deleteDomain(long domainId, Boolean cleanup);
List<? extends Domain> searchForDomains(ListDomainsCmd cmd)
Pair<List<? extends Domain>, Integer> searchForDomains(ListDomainsCmd cmd)
throws PermissionDeniedException;
List<? extends Domain> searchForDomainChildren(ListDomainChildrenCmd cmd)
Pair<List<? extends Domain>, Integer> searchForDomainChildren(ListDomainChildrenCmd cmd)
throws PermissionDeniedException;
}

View File

@ -56,4 +56,6 @@ public interface UserAccount {
String getRegistrationToken();
boolean isRegistered();
int getLoginAttempts();
}

View File

@ -53,6 +53,7 @@ import com.cloud.storage.Volume;
import com.cloud.template.VirtualMachineTemplate;
import com.cloud.user.Account;
import com.cloud.uservm.UserVm;
import com.cloud.utils.Pair;
import com.cloud.utils.exception.ExecutionException;
public interface UserVmService {
@ -378,7 +379,7 @@ public interface UserVmService {
* the API command that wraps the search criteria
* @return List of UserVMs.
*/
List<? extends UserVm> searchForUserVMs(ListVMsCmd cmd);
Pair<List<? extends UserVm>, Integer> searchForUserVMs(ListVMsCmd cmd);
HypervisorType getHypervisorTypeOfUserVM(long vmid);

View File

@ -1,203 +0,0 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
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.

View File

@ -1,26 +0,0 @@
=========================================================================
== NOTICE file corresponding to the section 4 d of ==
== the Apache License, Version 2.0, ==
== in this case for the Apache Axis2 distribution. ==
=========================================================================
This product includes software developed by
The Apache Software Foundation (http://www.apache.org/).
Portions Copyright 2006 International Business Machines Corp.
Portions Copyright 2005-2007 WSO2, Inc.
This product also includes schemas and specification developed by:
- the W3C consortium (http://www.w3c.org)
This product also includes WS-* schemas developed by International
Business Machines Corporation, Microsoft Corporation, BEA Systems,
TIBCO Software, SAP AG, Sonic Software, and VeriSign
This product also includes a WSDL developed by salesforce.com
- Copyright 1999-2006 salesforce.com, inc.
Portions of the included xmlbeans library were originally based on the following:
- software copyright (c) 2000-2003, BEA Systems, <http://www.bea.com/>.
Please read the different LICENSE files present in the lib directory of
this distribution.

Some files were not shown because too many files have changed in this diff Show More