mirror of https://github.com/apache/cloudstack.git
Merge branch 'master' into cisco-vnmc-api-integration
Conflicts: api/src/com/cloud/network/Network.java api/src/org/apache/cloudstack/api/ApiConstants.java plugins/pom.xml setup/db/create-schema.sql
This commit is contained in:
commit
ee868759a8
|
|
@ -62,7 +62,6 @@ tools/cli/build/
|
|||
awsapi/modules/*
|
||||
!.gitignore
|
||||
.classpath
|
||||
.project
|
||||
.settings.xml
|
||||
.settings/
|
||||
db.properties.override
|
||||
|
|
@ -73,4 +72,5 @@ docs/tmp
|
|||
docs/publish
|
||||
docs/runbook/tmp
|
||||
docs/runbook/publish
|
||||
.project
|
||||
Gemfile.lock
|
||||
|
|
|
|||
30
INSTALL.md
30
INSTALL.md
|
|
@ -51,18 +51,21 @@ Apache CloudStack uses some ports, make sure at least those used by the manageme
|
|||
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
|
||||
8080: API Server (authenticated), browser or CLI client to management server
|
||||
8096: API Server (unauthenticated), browser or CLI client to management server
|
||||
8787: Remote java debug debugging port, from IDE to management server
|
||||
9090: Management server to management server (cluster)
|
||||
7080: AWS API Server to which an AWS client can connect
|
||||
80/443: HTTP client to Secondary Storage VM (template download)
|
||||
111/2049: Secondary Storage to NFS server
|
||||
3922: Port used to ssh/scp into system vms (SSVM, CPVM, VR)
|
||||
8250: Agent (SSVM, CPVM, VR) to management server
|
||||
22, 80, 443: XenServer, XAPI
|
||||
22: KVM
|
||||
443: vCenter
|
||||
DNS: 53
|
||||
NFS: 111/2049
|
||||
53: DNS
|
||||
111/2049: NFS
|
||||
3306: MySQL Server to which the management server connects
|
||||
|
||||
### Configuring MySQL Server
|
||||
|
||||
|
|
@ -92,8 +95,7 @@ For example, for master:
|
|||
|
||||
Clean and build:
|
||||
|
||||
$ mvn clean
|
||||
$ mvn install
|
||||
$ mvn clean install -P systemvm,developer
|
||||
|
||||
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:
|
||||
|
|
@ -111,9 +113,9 @@ Install them to ~/.m2 so maven can get them as dependencies:
|
|||
$ cd deps
|
||||
$ ./install-non-oss.sh
|
||||
|
||||
And build them with the nonoss flag:
|
||||
To build with nonoss components, use the build command with the nonoss flag:
|
||||
|
||||
$ mvn install -Dnonoss
|
||||
$ mvn clean install -P systemvm,developer -Dnonoss
|
||||
|
||||
Clear old database (if any) and deploy the database schema:
|
||||
|
||||
|
|
@ -121,7 +123,7 @@ Clear old database (if any) and deploy the database schema:
|
|||
|
||||
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"
|
||||
$ export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=500m -Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"
|
||||
|
||||
Start the management server:
|
||||
|
||||
|
|
|
|||
663
NOTICE
663
NOTICE
|
|
@ -6,30 +6,7 @@
|
|||
|
||||
|
||||
|
||||
Source code distribution if this software contains third party resources requiring
|
||||
the following notices:
|
||||
|
||||
|
||||
For
|
||||
jquery.md5.js
|
||||
|
||||
|
||||
jQuery MD5 Plugin 1.2.1
|
||||
https://github.com/blueimp/jQuery-MD5
|
||||
|
||||
Copyright 2010, Sebastian Tschan
|
||||
https://blueimp.net
|
||||
|
||||
Licensed under the MIT license:
|
||||
http://creativecommons.org/licenses/MIT/
|
||||
|
||||
Based on
|
||||
A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
|
||||
Digest Algorithm, as defined in RFC 1321.
|
||||
Version 2.2 Copyright (C) Paul Johnston 1999 - 2009
|
||||
Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
|
||||
Distributed under the BSD License
|
||||
See http://pajhome.org.uk/crypt/md5 for more info.
|
||||
This distribution contains third party resources requiring the following notices:
|
||||
|
||||
|
||||
For
|
||||
|
|
@ -66,6 +43,28 @@
|
|||
Date: Thu May 12 15:04:36 2011 -0400
|
||||
|
||||
|
||||
For
|
||||
jquery.md5.js
|
||||
|
||||
|
||||
jQuery MD5 Plugin 1.2.1
|
||||
https://github.com/blueimp/jQuery-MD5
|
||||
|
||||
Copyright 2010, Sebastian Tschan
|
||||
https://blueimp.net
|
||||
|
||||
Licensed under the MIT license:
|
||||
http://creativecommons.org/licenses/MIT/
|
||||
|
||||
Based on
|
||||
A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
|
||||
Digest Algorithm, as defined in RFC 1321.
|
||||
Version 2.2 Copyright (C) Paul Johnston 1999 - 2009
|
||||
Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
|
||||
Distributed under the BSD License
|
||||
See http://pajhome.org.uk/crypt/md5 for more info.
|
||||
|
||||
|
||||
For
|
||||
jquery.colorhelpers.js
|
||||
|
||||
|
|
@ -77,619 +76,3 @@
|
|||
Inspiration from jQuery color animation plugin by John Resig.
|
||||
|
||||
Released under the MIT license by Ole Laursen, October 2009.
|
||||
|
||||
|
||||
********************************************************************************
|
||||
|
||||
Binary or packaged versions of this software (including versions built from source)
|
||||
contains third party resources requiring the following notices:
|
||||
|
||||
For
|
||||
cloud-ejb-api-3.0.jar
|
||||
cloud-email.jar
|
||||
cloud-jstl-1.2.jar
|
||||
jaxb-api-2.1.jar
|
||||
jaxb-impl-2.1.7.jar
|
||||
jaxb-xjc-2.1.7.jar
|
||||
jta-1.1.jar
|
||||
mail-1.4.jar
|
||||
|
||||
|
||||
NOTICE PURSUANT TO SECTION 9 OF THE COMMON DEVELOPMENT AND DISTRIBUTION LICENSE
|
||||
(CDDL)
|
||||
|
||||
The code released under the CDDL shall be governed by the laws of the State of
|
||||
California (excluding conflict-of-law provisions). Any litigation relating to
|
||||
this License shall be subject to the jurisdiction of the Federal Courts of the
|
||||
Northern District of California and the state courts of the State of California,
|
||||
with venue lying in Santa Clara County, California.
|
||||
|
||||
|
||||
For
|
||||
cloud-javax.persistence-2.0.0.jar
|
||||
|
||||
|
||||
EclipseLink 2.0.0
|
||||
|
||||
Dec 10th, 2009
|
||||
|
||||
About
|
||||
|
||||
The EclipseLink project's goal is to provide a complete persistence framework
|
||||
that is both comprehensive and universal. It will run in any Java environment
|
||||
and read and write objects to virtually any type of data source, including
|
||||
relational databases, and XML. EclipseLink will focus on providing leading edge
|
||||
support, including advanced feature extensions, for the dominant persistence
|
||||
standards for each target data source; Java Persistence API (JPA) for relational
|
||||
databases, Java API for XML Binding (JAXB) for XML, Service Data Objects (SDO),
|
||||
and Database Web services (DBWS).
|
||||
|
||||
For tips on getting started with EclipseLink, please see the following
|
||||
resources:
|
||||
|
||||
EclipseLink 2.0.0 Release Notes Documentation Examples and How To License
|
||||
|
||||
The Eclipse Foundation makes available all content in this plug-in ("Content").
|
||||
Unless otherwise indicated below, the Content is provided to you under the terms
|
||||
and conditions of the Eclipse Public License Version 1.0 ("EPL") and Eclipse
|
||||
Distribution License Version 1.0 ("EDL"). A copy of the EPL is available at
|
||||
http://www.eclipse.org/legal/epl-v10.html and a copy of the EDL is available at
|
||||
http://www.eclipse.org/org/documents/edl-v10.php. For purposes of the EPL,
|
||||
"Program" will mean the Content.
|
||||
|
||||
If you did not receive this Content directly from the Eclipse Foundation, the
|
||||
Content is being redistributed by another party ("Redistributor") and different
|
||||
terms and conditions may apply to your use of any object code in the Content.
|
||||
Check the Redistributor's license that was provided with the Content. If no such
|
||||
license exists, contact the Redistributor. Unless otherwise indicated below, the
|
||||
terms and conditions of the EPL and EDL still apply to any source code in the
|
||||
Content and such source code may be obtained at http://www.eclipse.org.
|
||||
|
||||
Third Party Content
|
||||
|
||||
The Content includes items that have been sourced from third parties as set out
|
||||
below. If you did not receive this Content directly from the Eclipse Foundation,
|
||||
the following is provided for informational purposes only, and you should look
|
||||
to the Redistributor's license for terms and conditions of use.
|
||||
|
||||
Foundation Dependencies ASM EclipseLink JPA ANTLR Java Persistence API (JPA) 1.0
|
||||
- EJB 3.0 Java Persistence API (JPA) 2.0 EARLY ACCESS EclipseLink MOXy Java
|
||||
Architecture for XML Binding (JAXB) Java Mail Java Activation Framework
|
||||
Streaming API for XML (StAX) EclipseLink SDO Service Data Objects (SDO)
|
||||
Utilities Java Connector Xerces WSDL4J 1.6.2 ASM v1.5.3
|
||||
|
||||
The EclipseLink Project includes ASM for the purpose of byte code weaving. The
|
||||
AMS library is re-packaged within the source of the project
|
||||
(org.persistence.eclipse.internal.libraries.asm.*) to avoid version collisions
|
||||
with other usage of ASM. A custom patch has been added to the ASM 1.5.3 source
|
||||
to handle an issue with other usages. This fix has also been contributed back to
|
||||
the ASM project for inclusion in later projects.
|
||||
|
||||
The source code is available within the project's subversion repository. The
|
||||
binaries are distributed within the eclipselink.jar and in the
|
||||
org.eclipse.persistence.asm_2.0.0.v*.jar bundle.
|
||||
|
||||
http://asm.objectweb.org/license.html
|
||||
|
||||
Copyright (c) 2000-2005 INRIA, France Telecom, All rights reserved.
|
||||
|
||||
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 copyright holders nor the names of its
|
||||
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, THEIMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSEARE DISCLAIMED. IN NO EVENT
|
||||
SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BELIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, ORCONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OFSUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER INCONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
OR OTHERWISE)ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
OFTHE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
ANTLR v3.0
|
||||
|
||||
The ANTLR library (license) is included within EclipseLink Project to enable
|
||||
parsing of the Java Persistence Query language (JP QL). The ANTLR library is re-
|
||||
packaged within the project in the
|
||||
org.eclipse.persistence.internal.libraries.antlr.* packages.
|
||||
|
||||
The source is available with the project's subversion repository. The binaries
|
||||
are distributed within the eclipselink.jar and in the
|
||||
org.eclipse.persistence.antlr_2.0.0.v*.jar bundle.
|
||||
|
||||
Java Architecture for XML Binding (JAXB) v2.0.5
|
||||
|
||||
The JAXB libraries distributed under CDDL v1.0 are included within the
|
||||
EclipseLink Project to enable the MOXY component's implementation of JAXB.
|
||||
|
||||
JAXB Libraries:
|
||||
|
||||
/jlib/moxy/javax.xml.bind_2.1.12.v20090708-1500.jar /jlib/moxy/jaxb-impl.jar
|
||||
/jlib/moxy/jaxb.xjc.jar Java Persistence (JPA) 1.0 - EJB 3.0
|
||||
|
||||
The Java Persistence API, included with EJB 3.0, is available for download from
|
||||
the ejb-api directory in the glassfish CVS repository.It is distributed under
|
||||
CDDLv1.0 . The jar is being shipped as an OSGi bundle and is required for
|
||||
compilation of some container based fuctionality.
|
||||
|
||||
Java Persistence (JPA) 2.0.
|
||||
|
||||
EclipseLink is the Java Persistence (JPA) 2.0 Reference Implementation (JSR
|
||||
317). The JPA 2.0 specification API is included in EclipseLink under the EPL and
|
||||
EDL licenses.
|
||||
|
||||
Java Mail v1.4
|
||||
|
||||
The Java Mail library (mail.jar) is distributed with the JAXB v2.0.5 under CDDL
|
||||
v1.0 and is included within the EclipseLink Project distribution to support Web
|
||||
Services attachment handling in the MOXy component. It is only required when
|
||||
using Java SE 5 (Java Mail is included in Java SE 6).
|
||||
|
||||
Java Activation Framework v1.1
|
||||
|
||||
The Java Activation Framework (activation.jar) is distributed with the JAXB
|
||||
v2.0.5 under CDDL v1.0 and is included within the EclipseLink Project
|
||||
distribution to support Web Services attachment handling in the MOXy component.
|
||||
It is only required when using Java SE 5 (The Java Activation Framework is
|
||||
included in Java SE 6).
|
||||
|
||||
Streaming API for XML (StAX) v1.0
|
||||
|
||||
The Streaming API for XML (StAX) library (jsr173_1.0_api.jar) is distributed
|
||||
with the JAXB v2.0.5 under CDDL v1.0 and is included within the EclipseLink
|
||||
Project distribution as an optional XML processing approach in the MOXy
|
||||
component.
|
||||
|
||||
Service Data Objects (SDO) v2.1.1
|
||||
|
||||
The Service Data Objects (SDO) API is distributed under a CDDLv1.0 and custom
|
||||
license. It provides the standard API implemented by the EclipseLink Project's
|
||||
SDO component.
|
||||
|
||||
Java Connector v1.5
|
||||
|
||||
The JCA 1.5 API is available for download from the connector-api directory in
|
||||
the glassfish CVS repository. It is distributed under CDDLv1.0 .
|
||||
|
||||
This jar is being shipped and required by the Workbench only. When using
|
||||
EclipseLink in a container where JCA integration is required that container will
|
||||
provide the necessary API libraries.
|
||||
|
||||
Xerces v2.9.0
|
||||
|
||||
Xerces 2.9.0 is available from the Xerces home page. It is distributed under
|
||||
Apache 2.0.
|
||||
|
||||
This jar is shipped for the Workbench's use only in the reading and writing of
|
||||
XML configuration files.
|
||||
|
||||
WSDL4j v1.6.2
|
||||
|
||||
WSDL4J 1.6.2 is available for download from the wsdl4j project. It distributed
|
||||
under CPLv1.0 .
|
||||
|
||||
This jar is being shipped as a OSGi bundle and is only required for the DBWS
|
||||
Builder utility.
|
||||
|
||||
|
||||
For
|
||||
cloud-commons-logging-1.1.1.jar
|
||||
commons-logging-1.1.1.jar
|
||||
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// NOTICE file corresponding to the section 4d of The Apache License,
|
||||
// Version 2.0, in this case for Commons Logging
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
Commons Logging
|
||||
Copyright 2001-2007 The Apache Software Foundation
|
||||
|
||||
This product includes/uses software(s) developed by 'an unknown organization'
|
||||
- Unnamed - avalon-framework:avalon-framework:jar:4.1.3
|
||||
- Unnamed - log4j:log4j:jar:1.2.12
|
||||
- Unnamed - logkit:logkit:jar:1.0.1
|
||||
|
||||
|
||||
For
|
||||
neethi-2.0.4.jar
|
||||
|
||||
|
||||
=========================================================================
|
||||
== NOTICE file corresponding to the section 4 d of ==
|
||||
== the Apache License, Version 2.0, ==
|
||||
== in this case for the Apache AXIOM distribution. ==
|
||||
=========================================================================
|
||||
|
||||
This product includes software developed by
|
||||
The Apache Software Foundation (http://www.apache.org/).
|
||||
Portions Copyright 2006 International Business Machines Corp.
|
||||
|
||||
Please read the different LICENSE files present in the licenses directory of
|
||||
this distribution.
|
||||
|
||||
|
||||
For
|
||||
cloud-jasypt-1.9.jar
|
||||
|
||||
|
||||
Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org)
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
|
||||
---------------------------------
|
||||
|
||||
|
||||
|
||||
This distribution includes cryptographic software. The country in
|
||||
which you currently reside may have restrictions on the import,
|
||||
possession, use, and/or re-export to another country, of
|
||||
encryption software. BEFORE using any encryption software, please
|
||||
check your country's laws, regulations and policies concerning the
|
||||
import, possession, or use, and re-export of encryption software, to
|
||||
see if this is permitted. See http://www.wassenaar.org/ for more
|
||||
information.
|
||||
|
||||
The U.S. Government Department of Commerce, Bureau of Industry and
|
||||
Security (BIS), has classified this software as Export Commodity
|
||||
Control Number (ECCN) 5D002.C.1, which includes information security
|
||||
software using or performing cryptographic functions with asymmetric
|
||||
algorithms. The form and manner of this distribution makes it
|
||||
eligible for export under the License Exception ENC Technology
|
||||
Software Unrestricted (TSU) exception (see the BIS Export
|
||||
Administration Regulations, Section 740.13) for both object code and
|
||||
source code.
|
||||
|
||||
The following provides more details on the cryptographic software
|
||||
used (note that this software is not included in the distribution):
|
||||
|
||||
* The PBE Encryption facilities require the Java Cryptography
|
||||
extensions: http://java.sun.com/javase/technologies/security/.
|
||||
|
||||
---------------------------------
|
||||
|
||||
Distributions of this software may include software developed by
|
||||
The Apache Software Foundation (http://www.apache.org/).
|
||||
|
||||
---------------------------------
|
||||
|
||||
|
||||
ICU License - ICU 1.8.1 and later
|
||||
|
||||
COPYRIGHT AND PERMISSION NOTICE
|
||||
|
||||
Copyright (c) 1995-2006 International Business Machines
|
||||
Corporation and others
|
||||
|
||||
All rights reserved.
|
||||
|
||||
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, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so,
|
||||
provided that the above copyright notice(s) and this
|
||||
permission notice appear in all copies of the Software and
|
||||
that both the above copyright notice(s) and this
|
||||
permission notice appear in supporting documentation.
|
||||
|
||||
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 OF THIRD PARTY RIGHTS. IN NO
|
||||
EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN
|
||||
THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
|
||||
INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
||||
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
|
||||
USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
Except as contained in this notice, the name of a copyright
|
||||
holder shall not be used in advertising or otherwise to
|
||||
promote the sale, use or other dealings in this Software
|
||||
without prior written authorization of the copyright holder.
|
||||
|
||||
|
||||
For
|
||||
XmlSchema-1.4.3.jar
|
||||
|
||||
|
||||
Portions Copyright 2006 International Business Machines Corp.
|
||||
|
||||
|
||||
For
|
||||
cloud-trilead-ssh2-build213.jar
|
||||
|
||||
|
||||
Trilead SSH-2 for Java includes code that was written by Dr. Christian Plattner
|
||||
during his PhD at ETH Zurich. The license states the following:
|
||||
|
||||
Copyright (c) 2005 - 2006 Swiss Federal Institute of Technology (ETH Zurich),
|
||||
Department of Computer Science (http://www.inf.ethz.ch),
|
||||
Christian Plattner. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
a.) Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
b.) 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.
|
||||
c.) Neither the name of ETH Zurich nor the names of its 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.
|
||||
|
||||
The Java implementations of the AES, Blowfish and 3DES ciphers have been
|
||||
taken (and slightly modified) from the cryptography package released by
|
||||
"The Legion Of The Bouncy Castle".
|
||||
|
||||
Their license states the following:
|
||||
|
||||
Copyright (c) 2000 - 2004 The Legion Of The Bouncy Castle
|
||||
(http://www.bouncycastle.org)
|
||||
|
||||
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.
|
||||
|
||||
|
||||
For
|
||||
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
|
||||
axis2-json-1.5.1.jar
|
||||
axis2-kernel-1.5.1.jar
|
||||
axis2-transport-http-1.5.1.jar
|
||||
axis2-transport-local-1.5.1.jar
|
||||
axis2-webapp-1.5.1.war
|
||||
cloud-axis.jar
|
||||
|
||||
|
||||
=========================================================================
|
||||
== 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.
|
||||
|
||||
|
||||
For
|
||||
xml-apis.jar
|
||||
|
||||
|
||||
=========================================================================
|
||||
== NOTICE file corresponding to section 4(d) of the Apache License, ==
|
||||
== Version 2.0, in this case for the Apache xml-commons xml-apis ==
|
||||
== distribution. ==
|
||||
=========================================================================
|
||||
|
||||
Apache XML Commons XML APIs
|
||||
Copyright 2006 The Apache Software Foundation.
|
||||
|
||||
This product includes software developed at
|
||||
The Apache Software Foundation (http://www.apache.org/).
|
||||
|
||||
Portions of this software were originally based on the following:
|
||||
- software copyright (c) 1999, IBM Corporation., http://www.ibm.com.
|
||||
- software copyright (c) 1999, Sun Microsystems., http://www.sun.com.
|
||||
- software copyright (c) 2000 World Wide Web Consortium, http://www.w3.org
|
||||
|
||||
|
||||
For
|
||||
cloud-commons-codec-1.5.jar
|
||||
commons-codec-1.4.jar
|
||||
|
||||
|
||||
Apache Commons Codec
|
||||
Copyright 2002-2011 The Apache Software Foundation
|
||||
|
||||
This product includes software developed by
|
||||
The Apache Software Foundation (http://www.apache.org/).
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
src/test/org/apache/commons/codec/language/DoubleMetaphoneTest.java contains
|
||||
test data from http://aspell.sourceforge.net/test/batch0.tab.
|
||||
|
||||
Copyright (C) 2002 Kevin Atkinson (kevina@gnu.org). Verbatim copying
|
||||
and distribution of this entire article is permitted in any medium,
|
||||
provided this notice is preserved.
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
|
||||
For
|
||||
rampart-lib
|
||||
|
||||
|
||||
Apache Rampart
|
||||
Copyright 2010 The Apache Software Foundation
|
||||
|
||||
This product includes software developed by
|
||||
The Apache Software Foundation (http://www.apache.org/).
|
||||
|
||||
Please read the different LICENSE files present in the lib directory of
|
||||
this distribution.
|
||||
|
||||
|
||||
For
|
||||
xercesImpl.jar
|
||||
|
||||
|
||||
=========================================================================
|
||||
== NOTICE file corresponding to section 4(d) of the Apache License, ==
|
||||
== Version 2.0, in this case for the Apache Xerces Java distribution. ==
|
||||
=========================================================================
|
||||
|
||||
Apache Xerces Java
|
||||
Copyright 1999-2012 The Apache Software Foundation
|
||||
|
||||
This product includes software developed at
|
||||
The Apache Software Foundation (http://www.apache.org/).
|
||||
|
||||
Portions of this software were originally based on the following:
|
||||
- software copyright (c) 1999, IBM Corporation., http://www.ibm.com.
|
||||
- software copyright (c) 1999, Sun Microsystems., http://www.sun.com.
|
||||
- voluntary contributions made by Paul Eng on behalf of the
|
||||
Apache Software Foundation that were originally developed at iClick, Inc.,
|
||||
software copyright (c) 1999.
|
||||
|
||||
|
||||
For
|
||||
woden-api-1.0M8.jar
|
||||
woden-impl-dom-1.0M8.jar
|
||||
|
||||
|
||||
=========================================================================
|
||||
== NOTICE file corresponding to the section 4 d of ==
|
||||
== the Apache License, Version 2.0, ==
|
||||
== in this case for the Apache Woden distribution. ==
|
||||
=========================================================================
|
||||
|
||||
This product includes software developed by
|
||||
The Apache Software Foundation (http://www.apache.org/).
|
||||
|
||||
This product also includes software developed by :
|
||||
|
||||
- IBM Corporation (http://www.ibm.com),
|
||||
WSDL4J was the initial code contribution for the Apache Woden
|
||||
project and some of the WSDL4J design and code has been reused.
|
||||
- The W3C Consortium (http://www.w3c.org),
|
||||
Common W3C XML Schema and DTD files are packaged with Apache Woden.
|
||||
|
||||
Please read the different LICENSE files present in the root directory of
|
||||
this distribution.
|
||||
|
||||
|
||||
For
|
||||
axiom-api-1.2.8.jar
|
||||
axiom-impl-1.2.8.jar
|
||||
|
||||
|
||||
Axiom includes software from other projects, as follows:
|
||||
|
||||
This software includes the Woodstox High-performance XML processor
|
||||
http://woodstox.codehaus.org/
|
||||
licensed under the Apache License, Version 2.0
|
||||
|
||||
This software includes the Jaxen XPath library
|
||||
http://jaxen.codehaus.org/
|
||||
licensed under the following BSD 3 Clause license:
|
||||
|
||||
================================================================================
|
||||
Copyright 2003-2006 The Werken Company. All Rights Reserved.
|
||||
|
||||
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 Jaxen Project nor the names of its
|
||||
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.
|
||||
|
||||
================================================================================
|
||||
|
||||
|
||||
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).
|
||||
|
|
|
|||
|
|
@ -69,3 +69,14 @@ domr.scripts.dir=scripts/network/domr/kvm
|
|||
# set the vm migrate speed, by default, it will try to guess the speed of the guest network
|
||||
# In MegaBytes per second
|
||||
#vm.migrate.speed=0
|
||||
|
||||
# set the type of bridge used on the hypervisor, this defines what commands the resource
|
||||
# will use to setup networking. Currently supported NATIVE, OPENVSWITCH
|
||||
#network.bridge.type=native
|
||||
|
||||
# set the driver used to plug and unplug nics from the bridges
|
||||
# a sensible default will be selected based on the network.bridge.type but can
|
||||
# be overridden here.
|
||||
# native = com.cloud.hypervisor.kvm.resource.BridgeVifDriver
|
||||
# openvswitch = com.cloud.hypervisor.kvm.resource.OvsBridgeDriver
|
||||
#libvirt.vif.driver=com.cloud.hypervisor.kvm.resource.BridgeVifDriver
|
||||
|
|
@ -23,7 +23,7 @@
|
|||
<parent>
|
||||
<groupId>org.apache.cloudstack</groupId>
|
||||
<artifactId>cloudstack</artifactId>
|
||||
<version>4.1.0-SNAPSHOT</version>
|
||||
<version>4.2.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
|
|
|
|||
|
|
@ -48,15 +48,13 @@ import com.cloud.agent.dao.StorageComponent;
|
|||
import com.cloud.agent.dao.impl.PropertiesStorage;
|
||||
import com.cloud.host.Host;
|
||||
import com.cloud.resource.ServerResource;
|
||||
import com.cloud.utils.LogUtils;
|
||||
import com.cloud.utils.NumbersUtil;
|
||||
import com.cloud.utils.ProcessUtil;
|
||||
import com.cloud.utils.PropertiesUtil;
|
||||
import com.cloud.utils.backoff.BackoffAlgorithm;
|
||||
import com.cloud.utils.backoff.impl.ConstantTimeBackoff;
|
||||
import com.cloud.utils.component.Adapters;
|
||||
import com.cloud.utils.component.ComponentLocator;
|
||||
import com.cloud.utils.exception.CloudRuntimeException;
|
||||
import com.cloud.utils.net.MacAddress;
|
||||
import com.cloud.utils.script.Script;
|
||||
|
||||
public class AgentShell implements IAgentShell {
|
||||
|
|
@ -146,6 +144,7 @@ public class AgentShell implements IAgentShell {
|
|||
return _guid;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getCmdLineProperties() {
|
||||
return _cmdLineProperties;
|
||||
}
|
||||
|
|
@ -378,8 +377,6 @@ public class AgentShell implements IAgentShell {
|
|||
|
||||
public void init(String[] args) throws ConfigurationException {
|
||||
|
||||
final ComponentLocator locator = ComponentLocator.getLocator("agent");
|
||||
|
||||
final Class<?> c = this.getClass();
|
||||
_version = c.getPackage().getImplementationVersion();
|
||||
if (_version == null) {
|
||||
|
|
@ -396,12 +393,9 @@ public class AgentShell implements IAgentShell {
|
|||
s_logger.debug("Found property: " + property);
|
||||
}
|
||||
|
||||
_storage = locator.getManager(StorageComponent.class);
|
||||
if (_storage == null) {
|
||||
s_logger.info("Defaulting to using properties file for storage");
|
||||
_storage = new PropertiesStorage();
|
||||
_storage.configure("Storage", new HashMap<String, Object>());
|
||||
}
|
||||
s_logger.info("Defaulting to using properties file for storage");
|
||||
_storage = new PropertiesStorage();
|
||||
_storage.configure("Storage", new HashMap<String, Object>());
|
||||
|
||||
// merge with properties from command line to let resource access
|
||||
// command line parameters
|
||||
|
|
@ -410,22 +404,9 @@ public class AgentShell implements IAgentShell {
|
|||
_properties.put(cmdLineProp.getKey(), cmdLineProp.getValue());
|
||||
}
|
||||
|
||||
final Adapters adapters = locator.getAdapters(BackoffAlgorithm.class);
|
||||
final Enumeration en = adapters.enumeration();
|
||||
while (en.hasMoreElements()) {
|
||||
_backoff = (BackoffAlgorithm) en.nextElement();
|
||||
break;
|
||||
}
|
||||
if (en.hasMoreElements()) {
|
||||
s_logger.info("More than one backoff algorithm specified. Using the first one ");
|
||||
}
|
||||
|
||||
if (_backoff == null) {
|
||||
s_logger.info("Defaulting to the constant time backoff algorithm");
|
||||
_backoff = new ConstantTimeBackoff();
|
||||
_backoff.configure("ConstantTimeBackoff",
|
||||
new HashMap<String, Object>());
|
||||
}
|
||||
s_logger.info("Defaulting to the constant time backoff algorithm");
|
||||
_backoff = new ConstantTimeBackoff();
|
||||
_backoff.configure("ConstantTimeBackoff", new HashMap<String, Object>());
|
||||
}
|
||||
|
||||
private void launchAgent() throws ConfigurationException {
|
||||
|
|
@ -469,6 +450,7 @@ public class AgentShell implements IAgentShell {
|
|||
openPortWithIptables(port);
|
||||
|
||||
_consoleProxyMain = new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
Class<?> consoleProxyClazz = Class.forName("com.cloud.consoleproxy.ConsoleProxy");
|
||||
|
|
@ -522,7 +504,7 @@ public class AgentShell implements IAgentShell {
|
|||
} catch (final SecurityException e) {
|
||||
throw new ConfigurationException(
|
||||
"Security excetion when loading resource: " + name
|
||||
+ " due to: " + e.toString());
|
||||
+ " due to: " + e.toString());
|
||||
} catch (final NoSuchMethodException e) {
|
||||
throw new ConfigurationException(
|
||||
"Method not found excetion when loading resource: "
|
||||
|
|
@ -534,7 +516,7 @@ public class AgentShell implements IAgentShell {
|
|||
} catch (final InstantiationException e) {
|
||||
throw new ConfigurationException(
|
||||
"Instantiation excetion when loading resource: " + name
|
||||
+ " due to: " + e.toString());
|
||||
+ " due to: " + e.toString());
|
||||
} catch (final IllegalAccessException e) {
|
||||
throw new ConfigurationException(
|
||||
"Illegal access exception when loading resource: "
|
||||
|
|
@ -630,6 +612,8 @@ public class AgentShell implements IAgentShell {
|
|||
|
||||
public static void main(String[] args) {
|
||||
try {
|
||||
LogUtils.initLog4j("log4j-cloud.xml");
|
||||
|
||||
AgentShell shell = new AgentShell();
|
||||
shell.init(args);
|
||||
shell.start();
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@ import java.io.IOException;
|
|||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Enumeration;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
|
@ -41,19 +40,15 @@ import com.cloud.agent.dao.impl.PropertiesStorage;
|
|||
import com.cloud.agent.transport.Request;
|
||||
import com.cloud.resource.ServerResource;
|
||||
import com.cloud.utils.NumbersUtil;
|
||||
import com.cloud.utils.ProcessUtil;
|
||||
import com.cloud.utils.PropertiesUtil;
|
||||
import com.cloud.utils.backoff.BackoffAlgorithm;
|
||||
import com.cloud.utils.backoff.impl.ConstantTimeBackoff;
|
||||
import com.cloud.utils.component.Adapters;
|
||||
import com.cloud.utils.component.ComponentLocator;
|
||||
import com.cloud.utils.exception.CloudRuntimeException;
|
||||
import com.cloud.utils.net.MacAddress;
|
||||
import com.cloud.utils.nio.HandlerFactory;
|
||||
import com.cloud.utils.nio.Link;
|
||||
import com.cloud.utils.nio.NioServer;
|
||||
import com.cloud.utils.nio.Task;
|
||||
import com.cloud.utils.nio.Task.Type;
|
||||
|
||||
/**
|
||||
* Implementation of agent shell to run the agents on System Center Virtual Machine manager
|
||||
|
|
@ -61,7 +56,7 @@ import com.cloud.utils.nio.Task.Type;
|
|||
|
||||
public class VmmAgentShell implements IAgentShell, HandlerFactory {
|
||||
|
||||
private static final Logger s_logger = Logger.getLogger(VmmAgentShell.class.getName());
|
||||
private static final Logger s_logger = Logger.getLogger(VmmAgentShell.class.getName());
|
||||
private final Properties _properties = new Properties();
|
||||
private final Map<String, Object> _cmdLineProperties = new HashMap<String, Object>();
|
||||
private StorageComponent _storage;
|
||||
|
|
@ -76,112 +71,112 @@ public class VmmAgentShell implements IAgentShell, HandlerFactory {
|
|||
private int _proxyPort;
|
||||
private int _workers;
|
||||
private String _guid;
|
||||
static private NioServer _connection;
|
||||
static private int _listenerPort=9000;
|
||||
static private NioServer _connection;
|
||||
static private int _listenerPort=9000;
|
||||
private int _nextAgentId = 1;
|
||||
private volatile boolean _exit = false;
|
||||
private int _pingRetries;
|
||||
private Thread _consoleProxyMain = null;
|
||||
private final Thread _consoleProxyMain = null;
|
||||
private final List<Agent> _agents = new ArrayList<Agent>();
|
||||
|
||||
public VmmAgentShell() {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Properties getProperties() {
|
||||
return _properties;
|
||||
return _properties;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public BackoffAlgorithm getBackoffAlgorithm() {
|
||||
return _backoff;
|
||||
return _backoff;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getPingRetries() {
|
||||
return _pingRetries;
|
||||
return _pingRetries;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getZone() {
|
||||
return _zone;
|
||||
return _zone;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getPod() {
|
||||
return _pod;
|
||||
return _pod;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getHost() {
|
||||
return _host;
|
||||
return _host;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getPrivateIp() {
|
||||
return _privateIp;
|
||||
return _privateIp;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getPort() {
|
||||
return _port;
|
||||
return _port;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getProxyPort() {
|
||||
return _proxyPort;
|
||||
return _proxyPort;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getWorkers() {
|
||||
return _workers;
|
||||
return _workers;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getGuid() {
|
||||
return _guid;
|
||||
return _guid;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void upgradeAgent(String url) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
@Override
|
||||
public void upgradeAgent(String url) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
@Override
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getVersion() {
|
||||
return _version;
|
||||
return _version;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getCmdLineProperties() {
|
||||
// TODO Auto-generated method stub
|
||||
return _cmdLineProperties;
|
||||
}
|
||||
|
||||
public String getProperty(String prefix, String name) {
|
||||
if(prefix != null)
|
||||
return _properties.getProperty(prefix + "." + name);
|
||||
|
||||
return _properties.getProperty(name);
|
||||
@Override
|
||||
public Map<String, Object> getCmdLineProperties() {
|
||||
// TODO Auto-generated method stub
|
||||
return _cmdLineProperties;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPersistentProperty(String prefix, String name) {
|
||||
if(prefix != null)
|
||||
return _storage.get(prefix + "." + name);
|
||||
return _storage.get(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPersistentProperty(String prefix, String name, String value) {
|
||||
if(prefix != null)
|
||||
_storage.persist(prefix + "." + name, value);
|
||||
else
|
||||
_storage.persist(name, value);
|
||||
}
|
||||
public String getProperty(String prefix, String name) {
|
||||
if(prefix != null)
|
||||
return _properties.getProperty(prefix + "." + name);
|
||||
|
||||
private void loadProperties() throws ConfigurationException {
|
||||
return _properties.getProperty(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPersistentProperty(String prefix, String name) {
|
||||
if(prefix != null)
|
||||
return _storage.get(prefix + "." + name);
|
||||
return _storage.get(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPersistentProperty(String prefix, String name, String value) {
|
||||
if(prefix != null)
|
||||
_storage.persist(prefix + "." + name, value);
|
||||
else
|
||||
_storage.persist(name, value);
|
||||
}
|
||||
|
||||
private void loadProperties() throws ConfigurationException {
|
||||
final File file = PropertiesUtil.findConfigFile("agent.properties");
|
||||
if (file == null) {
|
||||
throw new ConfigurationException("Unable to find agent.properties.");
|
||||
|
|
@ -197,7 +192,7 @@ public class VmmAgentShell implements IAgentShell, HandlerFactory {
|
|||
throw new CloudRuntimeException("IOException in reading " + file.getAbsolutePath(), ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected boolean parseCommand(final String[] args) throws ConfigurationException {
|
||||
String host = null;
|
||||
String workers = null;
|
||||
|
|
@ -211,7 +206,7 @@ public class VmmAgentShell implements IAgentShell, HandlerFactory {
|
|||
System.out.println("Invalid Parameter: " + args[i]);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
// save command line properties
|
||||
_cmdLineProperties.put(tokens[0], tokens[1]);
|
||||
|
||||
|
|
@ -222,14 +217,14 @@ public class VmmAgentShell implements IAgentShell, HandlerFactory {
|
|||
} else if (tokens[0].equalsIgnoreCase("host")) {
|
||||
host = tokens[1];
|
||||
} else if(tokens[0].equalsIgnoreCase("zone")) {
|
||||
zone = tokens[1];
|
||||
zone = tokens[1];
|
||||
} else if(tokens[0].equalsIgnoreCase("pod")) {
|
||||
pod = tokens[1];
|
||||
pod = tokens[1];
|
||||
} else if(tokens[0].equalsIgnoreCase("guid")) {
|
||||
guid = tokens[1];
|
||||
} else if(tokens[0].equalsIgnoreCase("eth1ip")) {
|
||||
_privateIp = tokens[1];
|
||||
}
|
||||
guid = tokens[1];
|
||||
} else if(tokens[0].equalsIgnoreCase("eth1ip")) {
|
||||
_privateIp = tokens[1];
|
||||
}
|
||||
}
|
||||
|
||||
if (port == null) {
|
||||
|
|
@ -237,7 +232,7 @@ public class VmmAgentShell implements IAgentShell, HandlerFactory {
|
|||
}
|
||||
|
||||
_port = NumbersUtil.parseInt(port, 8250);
|
||||
|
||||
|
||||
_proxyPort = NumbersUtil.parseInt(getProperty(null, "consoleproxy.httpListenPort"), 443);
|
||||
|
||||
if (workers == null) {
|
||||
|
|
@ -254,42 +249,42 @@ public class VmmAgentShell implements IAgentShell, HandlerFactory {
|
|||
host = "localhost";
|
||||
}
|
||||
_host = host;
|
||||
|
||||
|
||||
if(zone != null)
|
||||
_zone = zone;
|
||||
_zone = zone;
|
||||
else
|
||||
_zone = getProperty(null, "zone");
|
||||
_zone = getProperty(null, "zone");
|
||||
if (_zone == null || (_zone.startsWith("@") && _zone.endsWith("@"))) {
|
||||
_zone = "default";
|
||||
_zone = "default";
|
||||
}
|
||||
|
||||
if(pod != null)
|
||||
_pod = pod;
|
||||
_pod = pod;
|
||||
else
|
||||
_pod = getProperty(null, "pod");
|
||||
_pod = getProperty(null, "pod");
|
||||
if (_pod == null || (_pod.startsWith("@") && _pod.endsWith("@"))) {
|
||||
_pod = "default";
|
||||
_pod = "default";
|
||||
}
|
||||
|
||||
if (_host == null || (_host.startsWith("@") && _host.endsWith("@"))) {
|
||||
throw new ConfigurationException("Host is not configured correctly: " + _host);
|
||||
}
|
||||
|
||||
|
||||
final String retries = getProperty(null, "ping.retries");
|
||||
_pingRetries = NumbersUtil.parseInt(retries, 5);
|
||||
|
||||
String value = getProperty(null, "developer");
|
||||
boolean developer = Boolean.parseBoolean(value);
|
||||
|
||||
|
||||
if(guid != null)
|
||||
_guid = guid;
|
||||
_guid = guid;
|
||||
else
|
||||
_guid = getProperty(null, "guid");
|
||||
_guid = getProperty(null, "guid");
|
||||
if (_guid == null) {
|
||||
if (!developer) {
|
||||
throw new ConfigurationException("Unable to find the guid");
|
||||
}
|
||||
_guid = MacAddress.getMacAddress().toString(":");
|
||||
if (!developer) {
|
||||
throw new ConfigurationException("Unable to find the guid");
|
||||
}
|
||||
_guid = MacAddress.getMacAddress().toString(":");
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
@ -303,63 +298,46 @@ public class VmmAgentShell implements IAgentShell, HandlerFactory {
|
|||
}
|
||||
s_logger.trace("Launching agent based on type=" + typeInfo);
|
||||
}
|
||||
|
||||
|
||||
private void launchAgent() throws ConfigurationException {
|
||||
String resourceClassNames = getProperty(null, "resource");
|
||||
s_logger.trace("resource=" + resourceClassNames);
|
||||
if(resourceClassNames != null) {
|
||||
launchAgentFromClassInfo(resourceClassNames);
|
||||
return;
|
||||
launchAgentFromClassInfo(resourceClassNames);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
launchAgentFromTypeInfo();
|
||||
}
|
||||
|
||||
|
||||
private void init(String[] args) throws ConfigurationException{
|
||||
|
||||
final ComponentLocator locator = ComponentLocator.getLocator("agent");
|
||||
|
||||
|
||||
final Class<?> c = this.getClass();
|
||||
_version = c.getPackage().getImplementationVersion();
|
||||
if (_version == null) {
|
||||
throw new CloudRuntimeException("Unable to find the implementation version of this agent");
|
||||
}
|
||||
s_logger.info("Implementation Version is " + _version);
|
||||
|
||||
|
||||
parseCommand(args);
|
||||
|
||||
_storage = locator.getManager(StorageComponent.class);
|
||||
if (_storage == null) {
|
||||
s_logger.info("Defaulting to using properties file for storage");
|
||||
_storage = new PropertiesStorage();
|
||||
_storage.configure("Storage", new HashMap<String, Object>());
|
||||
}
|
||||
|
||||
s_logger.info("Defaulting to using properties file for storage");
|
||||
_storage = new PropertiesStorage();
|
||||
_storage.configure("Storage", new HashMap<String, Object>());
|
||||
|
||||
// merge with properties from command line to let resource access command line parameters
|
||||
for(Map.Entry<String, Object> cmdLineProp : getCmdLineProperties().entrySet()) {
|
||||
_properties.put(cmdLineProp.getKey(), cmdLineProp.getValue());
|
||||
}
|
||||
|
||||
final Adapters adapters = locator.getAdapters(BackoffAlgorithm.class);
|
||||
final Enumeration en = adapters.enumeration();
|
||||
while (en.hasMoreElements()) {
|
||||
_backoff = (BackoffAlgorithm)en.nextElement();
|
||||
break;
|
||||
}
|
||||
if (en.hasMoreElements()) {
|
||||
s_logger.info("More than one backoff algorithm specified. Using the first one ");
|
||||
_properties.put(cmdLineProp.getKey(), cmdLineProp.getValue());
|
||||
}
|
||||
|
||||
if (_backoff == null) {
|
||||
s_logger.info("Defaulting to the constant time backoff algorithm");
|
||||
_backoff = new ConstantTimeBackoff();
|
||||
_backoff.configure("ConstantTimeBackoff", new HashMap<String, Object>());
|
||||
}
|
||||
s_logger.info("Defaulting to the constant time backoff algorithm");
|
||||
_backoff = new ConstantTimeBackoff();
|
||||
_backoff.configure("ConstantTimeBackoff", new HashMap<String, Object>());
|
||||
}
|
||||
|
||||
private void launchAgentFromClassInfo(String resourceClassNames) throws ConfigurationException {
|
||||
String[] names = resourceClassNames.split("\\|");
|
||||
for(String name: names) {
|
||||
String[] names = resourceClassNames.split("\\|");
|
||||
for(String name: names) {
|
||||
Class<?> impl;
|
||||
try {
|
||||
impl = Class.forName(name);
|
||||
|
|
@ -368,41 +346,41 @@ public class VmmAgentShell implements IAgentShell, HandlerFactory {
|
|||
ServerResource resource = (ServerResource)constructor.newInstance();
|
||||
launchAgent(getNextAgentId(), resource);
|
||||
} catch (final ClassNotFoundException e) {
|
||||
throw new ConfigurationException("Resource class not found: " + name);
|
||||
throw new ConfigurationException("Resource class not found: " + name);
|
||||
} catch (final SecurityException e) {
|
||||
throw new ConfigurationException("Security excetion when loading resource: " + name);
|
||||
throw new ConfigurationException("Security excetion when loading resource: " + name);
|
||||
} catch (final NoSuchMethodException e) {
|
||||
throw new ConfigurationException("Method not found excetion when loading resource: " + name);
|
||||
throw new ConfigurationException("Method not found excetion when loading resource: " + name);
|
||||
} catch (final IllegalArgumentException e) {
|
||||
throw new ConfigurationException("Illegal argument excetion when loading resource: " + name);
|
||||
throw new ConfigurationException("Illegal argument excetion when loading resource: " + name);
|
||||
} catch (final InstantiationException e) {
|
||||
throw new ConfigurationException("Instantiation excetion when loading resource: " + name);
|
||||
throw new ConfigurationException("Instantiation excetion when loading resource: " + name);
|
||||
} catch (final IllegalAccessException e) {
|
||||
throw new ConfigurationException("Illegal access exception when loading resource: " + name);
|
||||
throw new ConfigurationException("Illegal access exception when loading resource: " + name);
|
||||
} catch (final InvocationTargetException e) {
|
||||
throw new ConfigurationException("Invocation target exception when loading resource: " + name);
|
||||
throw new ConfigurationException("Invocation target exception when loading resource: " + name);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void launchAgent(int localAgentId, ServerResource resource) throws ConfigurationException {
|
||||
// we don't track agent after it is launched for now
|
||||
Agent agent = new Agent(this, localAgentId, resource);
|
||||
_agents.add(agent);
|
||||
agent.start();
|
||||
// we don't track agent after it is launched for now
|
||||
Agent agent = new Agent(this, localAgentId, resource);
|
||||
_agents.add(agent);
|
||||
agent.start();
|
||||
}
|
||||
|
||||
public synchronized int getNextAgentId() {
|
||||
return _nextAgentId++;
|
||||
return _nextAgentId++;
|
||||
}
|
||||
|
||||
private void run(String[] args) {
|
||||
|
||||
try {
|
||||
|
||||
private void run(String[] args) {
|
||||
|
||||
try {
|
||||
System.setProperty("java.net.preferIPv4Stack","true");
|
||||
loadProperties();
|
||||
init(args);
|
||||
|
||||
loadProperties();
|
||||
init(args);
|
||||
|
||||
String instance = getProperty(null, "instance");
|
||||
if (instance == null) {
|
||||
instance = "";
|
||||
|
|
@ -413,22 +391,22 @@ public class VmmAgentShell implements IAgentShell, HandlerFactory {
|
|||
// TODO need to do this check. For Agentshell running on windows needs different approach
|
||||
//final String run = "agent." + instance + "pid";
|
||||
//s_logger.debug("Checking to see if " + run + "exists.");
|
||||
//ProcessUtil.pidCheck(run);
|
||||
|
||||
|
||||
//ProcessUtil.pidCheck(run);
|
||||
|
||||
|
||||
// TODO: For Hyper-V agent.properties need to be revamped to support multiple agents
|
||||
// corresponding to multiple clusters but running on a SCVMM host
|
||||
|
||||
|
||||
// read the persistent storage and launch the agents
|
||||
//launchAgent();
|
||||
//launchAgent();
|
||||
|
||||
// FIXME get rid of this approach of agent listening for boot strap commands from the management server
|
||||
|
||||
// now listen for bootstrap request from the management server and launch agents
|
||||
_connection = new NioServer("VmmAgentShell", _listenerPort, 1, this);
|
||||
_connection.start();
|
||||
s_logger.info("SCVMM agent is listening on port " +_listenerPort + " for bootstrap command from management server");
|
||||
while(_connection.isRunning());
|
||||
// now listen for bootstrap request from the management server and launch agents
|
||||
_connection = new NioServer("VmmAgentShell", _listenerPort, 1, this);
|
||||
_connection.start();
|
||||
s_logger.info("SCVMM agent is listening on port " +_listenerPort + " for bootstrap command from management server");
|
||||
while(_connection.isRunning());
|
||||
} catch(final ConfigurationException e) {
|
||||
s_logger.error("Unable to start agent: " + e.getMessage());
|
||||
System.out.println("Unable to start agent: " + e.getMessage());
|
||||
|
|
@ -438,89 +416,89 @@ public class VmmAgentShell implements IAgentShell, HandlerFactory {
|
|||
System.out.println("Unable to start agent: " + e.getMessage());
|
||||
System.exit(ExitStatus.Error.value());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Task create(com.cloud.utils.nio.Task.Type type, Link link,
|
||||
byte[] data) {
|
||||
return new AgentBootStrapHandler(type, link, data);
|
||||
}
|
||||
@Override
|
||||
public Task create(com.cloud.utils.nio.Task.Type type, Link link,
|
||||
byte[] data) {
|
||||
return new AgentBootStrapHandler(type, link, data);
|
||||
}
|
||||
|
||||
public void stop() {
|
||||
_exit = true;
|
||||
if(_consoleProxyMain != null) {
|
||||
_consoleProxyMain.interrupt();
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
VmmAgentShell shell = new VmmAgentShell();
|
||||
Runtime.getRuntime().addShutdownHook(new ShutdownThread(shell));
|
||||
shell.run(args);
|
||||
}
|
||||
public void stop() {
|
||||
_exit = true;
|
||||
if(_consoleProxyMain != null) {
|
||||
_consoleProxyMain.interrupt();
|
||||
}
|
||||
}
|
||||
|
||||
// class to handle the bootstrap command from the management server
|
||||
private class AgentBootStrapHandler extends Task {
|
||||
public static void main(String[] args) {
|
||||
|
||||
public AgentBootStrapHandler(Task.Type type, Link link, byte[] data) {
|
||||
super(type, link, data);
|
||||
}
|
||||
VmmAgentShell shell = new VmmAgentShell();
|
||||
Runtime.getRuntime().addShutdownHook(new ShutdownThread(shell));
|
||||
shell.run(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doTask(Task task) throws Exception {
|
||||
final Type type = task.getType();
|
||||
s_logger.info("recieved task of type "+ type.toString() +" to handle in BootStrapTakHandler");
|
||||
if (type == Task.Type.DATA)
|
||||
{
|
||||
final byte[] data = task.getData();
|
||||
final Request request = Request.parse(data);
|
||||
final Command cmd = request.getCommand();
|
||||
|
||||
if (cmd instanceof StartupVMMAgentCommand) {
|
||||
// class to handle the bootstrap command from the management server
|
||||
private class AgentBootStrapHandler extends Task {
|
||||
|
||||
StartupVMMAgentCommand vmmCmd = (StartupVMMAgentCommand) cmd;
|
||||
public AgentBootStrapHandler(Task.Type type, Link link, byte[] data) {
|
||||
super(type, link, data);
|
||||
}
|
||||
|
||||
_zone = Long.toString(vmmCmd.getDataCenter());
|
||||
_cmdLineProperties.put("zone", _zone);
|
||||
@Override
|
||||
protected void doTask(Task task) throws Exception {
|
||||
final Type type = task.getType();
|
||||
s_logger.info("recieved task of type "+ type.toString() +" to handle in BootStrapTakHandler");
|
||||
if (type == Task.Type.DATA)
|
||||
{
|
||||
final byte[] data = task.getData();
|
||||
final Request request = Request.parse(data);
|
||||
final Command cmd = request.getCommand();
|
||||
|
||||
_pod = Long.toString(vmmCmd.getPod());
|
||||
_cmdLineProperties.put("pod", _pod);
|
||||
if (cmd instanceof StartupVMMAgentCommand) {
|
||||
|
||||
_cluster = vmmCmd.getClusterName();
|
||||
_cmdLineProperties.put("cluster", _cluster);
|
||||
StartupVMMAgentCommand vmmCmd = (StartupVMMAgentCommand) cmd;
|
||||
|
||||
_guid = vmmCmd.getGuid();
|
||||
_cmdLineProperties.put("guid", _guid);
|
||||
_zone = Long.toString(vmmCmd.getDataCenter());
|
||||
_cmdLineProperties.put("zone", _zone);
|
||||
|
||||
_host = vmmCmd.getManagementServerIP();
|
||||
_port = NumbersUtil.parseInt(vmmCmd.getport(), 8250);
|
||||
_pod = Long.toString(vmmCmd.getPod());
|
||||
_cmdLineProperties.put("pod", _pod);
|
||||
|
||||
s_logger.info("Recieved boot strap command from management server with parameters " +
|
||||
" Zone:"+ _zone + " "+
|
||||
" Cluster:"+ _cluster + " "+
|
||||
" pod:"+_pod + " "+
|
||||
" host:"+ _host +" "+
|
||||
" port:"+_port);
|
||||
_cluster = vmmCmd.getClusterName();
|
||||
_cmdLineProperties.put("cluster", _cluster);
|
||||
|
||||
launchAgentFromClassInfo("com.cloud.hypervisor.hyperv.resource.HypervResource");
|
||||
|
||||
// TODO: persist the info in agent.properties for agent restarts
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
_guid = vmmCmd.getGuid();
|
||||
_cmdLineProperties.put("guid", _guid);
|
||||
|
||||
_host = vmmCmd.getManagementServerIP();
|
||||
_port = NumbersUtil.parseInt(vmmCmd.getport(), 8250);
|
||||
|
||||
s_logger.info("Recieved boot strap command from management server with parameters " +
|
||||
" Zone:"+ _zone + " "+
|
||||
" Cluster:"+ _cluster + " "+
|
||||
" pod:"+_pod + " "+
|
||||
" host:"+ _host +" "+
|
||||
" port:"+_port);
|
||||
|
||||
launchAgentFromClassInfo("com.cloud.hypervisor.hyperv.resource.HypervResource");
|
||||
|
||||
// TODO: persist the info in agent.properties for agent restarts
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static class ShutdownThread extends Thread {
|
||||
VmmAgentShell _shell;
|
||||
VmmAgentShell _shell;
|
||||
public ShutdownThread(VmmAgentShell shell) {
|
||||
this._shell = shell;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
_shell.stop();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,76 +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.
|
||||
package com.cloud.agent.configuration;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.cloud.utils.component.Adapter;
|
||||
import com.cloud.utils.component.ComponentLibraryBase;
|
||||
import com.cloud.utils.component.ComponentLocator.ComponentInfo;
|
||||
import com.cloud.utils.component.Manager;
|
||||
import com.cloud.utils.component.PluggableService;
|
||||
import com.cloud.utils.db.GenericDao;
|
||||
|
||||
public class AgentComponentLibraryBase extends ComponentLibraryBase {
|
||||
@Override
|
||||
public Map<String, ComponentInfo<GenericDao<?, ?>>> getDaos() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, ComponentInfo<Manager>> getManagers() {
|
||||
if (_managers.size() == 0) {
|
||||
populateManagers();
|
||||
}
|
||||
return _managers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, List<ComponentInfo<Adapter>>> getAdapters() {
|
||||
if (_adapters.size() == 0) {
|
||||
populateAdapters();
|
||||
}
|
||||
return _adapters;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Class<?>, Class<?>> getFactories() {
|
||||
return null;
|
||||
}
|
||||
|
||||
protected void populateManagers() {
|
||||
// addManager("StackMaidManager", StackMaidManagerImpl.class);
|
||||
}
|
||||
|
||||
protected void populateAdapters() {
|
||||
|
||||
}
|
||||
|
||||
protected void populateServices() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, ComponentInfo<PluggableService>> getPluggableServices() {
|
||||
if (_pluggableServices.size() == 0) {
|
||||
populateServices();
|
||||
}
|
||||
return _pluggableServices;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -127,4 +127,34 @@ public class PropertiesStorage implements StorageComponent {
|
|||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setName(String name) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setConfigParams(Map<String, Object> params) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getConfigParams() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRunLevel() {
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRunLevel(int level) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -139,4 +139,34 @@ public class FakeDhcpSnooper implements DhcpSnooper {
|
|||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setName(String name) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setConfigParams(Map<String, Object> params) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getConfigParams() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRunLevel() {
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRunLevel(int level) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -224,4 +224,34 @@ public class DummyResource implements ServerResource {
|
|||
public void setAgentControl(IAgentControl agentControl) {
|
||||
_agentControl = agentControl;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setName(String name) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setConfigParams(Map<String, Object> params) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getConfigParams() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRunLevel() {
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRunLevel(int level) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ import com.google.gson.Gson;
|
|||
* server.
|
||||
*
|
||||
*/
|
||||
public class ConsoleProxyResource extends ServerResourceBase implements
|
||||
public abstract class ConsoleProxyResource extends ServerResourceBase implements
|
||||
ServerResource {
|
||||
static final Logger s_logger = Logger.getLogger(ConsoleProxyResource.class);
|
||||
|
||||
|
|
|
|||
|
|
@ -19,24 +19,23 @@ package com.cloud.agent;
|
|||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.agent.AgentShell;
|
||||
import com.cloud.utils.testcase.Log4jEnabledTestCase;
|
||||
|
||||
public class TestAgentShell extends Log4jEnabledTestCase {
|
||||
public class TestAgentShell extends TestCase {
|
||||
protected final static Logger s_logger = Logger.getLogger(TestAgentShell.class);
|
||||
|
||||
|
||||
public void testWget() {
|
||||
File file = null;
|
||||
try {
|
||||
file = File.createTempFile("wget", ".html");
|
||||
AgentShell.wget("http://www.google.com/", file);
|
||||
|
||||
AgentShell.wget("http://www.apache.org/", file);
|
||||
|
||||
if (s_logger.isDebugEnabled()) {
|
||||
s_logger.debug("file saved to " + file.getAbsolutePath());
|
||||
}
|
||||
|
||||
|
||||
} catch (final IOException e) {
|
||||
s_logger.warn("Exception while downloading agent update package, ", e);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
<parent>
|
||||
<groupId>org.apache.cloudstack</groupId>
|
||||
<artifactId>cloudstack</artifactId>
|
||||
<version>4.1.0-SNAPSHOT</version>
|
||||
<version>4.2.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,62 @@
|
|||
// 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.agent.api;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.cloud.agent.api.to.VolumeTO;
|
||||
|
||||
public class CreateVMSnapshotAnswer extends Answer {
|
||||
|
||||
private List<VolumeTO> volumeTOs;
|
||||
private VMSnapshotTO vmSnapshotTo;
|
||||
|
||||
|
||||
public List<VolumeTO> getVolumeTOs() {
|
||||
return volumeTOs;
|
||||
}
|
||||
|
||||
public void setVolumeTOs(List<VolumeTO> volumeTOs) {
|
||||
this.volumeTOs = volumeTOs;
|
||||
}
|
||||
|
||||
public VMSnapshotTO getVmSnapshotTo() {
|
||||
return vmSnapshotTo;
|
||||
}
|
||||
|
||||
public void setVmSnapshotTo(VMSnapshotTO vmSnapshotTo) {
|
||||
this.vmSnapshotTo = vmSnapshotTo;
|
||||
}
|
||||
|
||||
public CreateVMSnapshotAnswer() {
|
||||
|
||||
}
|
||||
|
||||
public CreateVMSnapshotAnswer(CreateVMSnapshotCommand cmd, boolean success,
|
||||
String result) {
|
||||
super(cmd, success, result);
|
||||
}
|
||||
|
||||
public CreateVMSnapshotAnswer(CreateVMSnapshotCommand cmd,
|
||||
VMSnapshotTO vmSnapshotTo, List<VolumeTO> volumeTOs) {
|
||||
super(cmd, true, "");
|
||||
this.vmSnapshotTo = vmSnapshotTo;
|
||||
this.volumeTOs = volumeTOs;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
// 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.agent.api;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.cloud.agent.api.to.VolumeTO;
|
||||
import com.cloud.vm.VirtualMachine;
|
||||
|
||||
public class CreateVMSnapshotCommand extends VMSnapshotBaseCommand {
|
||||
|
||||
public CreateVMSnapshotCommand(String vmName, VMSnapshotTO snapshot, List<VolumeTO> volumeTOs, String guestOSType, VirtualMachine.State vmState) {
|
||||
super(vmName, snapshot, volumeTOs, guestOSType);
|
||||
this.vmState = vmState;
|
||||
}
|
||||
|
||||
private VirtualMachine.State vmState;
|
||||
|
||||
|
||||
public VirtualMachine.State getVmState() {
|
||||
return vmState;
|
||||
}
|
||||
|
||||
public void setVmState(VirtualMachine.State vmState) {
|
||||
this.vmState = vmState;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -18,6 +18,7 @@ package com.cloud.agent.api;
|
|||
|
||||
import com.cloud.storage.StoragePool;
|
||||
|
||||
|
||||
/**
|
||||
* This currently assumes that both primary and secondary storage are mounted on the XenServer.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -0,0 +1,54 @@
|
|||
// 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.agent.api;
|
||||
|
||||
import com.cloud.agent.api.to.VolumeTO;
|
||||
|
||||
public class CreateVolumeFromVMSnapshotAnswer extends Answer {
|
||||
private String path;
|
||||
private VolumeTO volumeTo;
|
||||
|
||||
public VolumeTO getVolumeTo() {
|
||||
return volumeTo;
|
||||
}
|
||||
|
||||
public CreateVolumeFromVMSnapshotAnswer(
|
||||
CreateVolumeFromVMSnapshotCommand cmd, VolumeTO volumeTo) {
|
||||
super(cmd, true, "");
|
||||
this.volumeTo = volumeTo;
|
||||
}
|
||||
|
||||
public String getPath() {
|
||||
return path;
|
||||
}
|
||||
|
||||
protected CreateVolumeFromVMSnapshotAnswer() {
|
||||
|
||||
}
|
||||
|
||||
public CreateVolumeFromVMSnapshotAnswer(
|
||||
CreateVolumeFromVMSnapshotCommand cmd, String path) {
|
||||
super(cmd, true, "");
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
public CreateVolumeFromVMSnapshotAnswer(
|
||||
CreateVolumeFromVMSnapshotCommand cmd, boolean result, String string) {
|
||||
super(cmd, result, string);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,88 @@
|
|||
// 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.agent.api;
|
||||
|
||||
import com.cloud.agent.api.to.StorageFilerTO;
|
||||
import com.cloud.vm.DiskProfile;
|
||||
|
||||
public class CreateVolumeFromVMSnapshotCommand extends Command {
|
||||
|
||||
protected String path;
|
||||
protected String name;
|
||||
protected Boolean fullClone;
|
||||
protected String storagePoolUuid;
|
||||
private StorageFilerTO pool;
|
||||
private DiskProfile diskProfile;
|
||||
private Long volumeId;
|
||||
|
||||
public DiskProfile getDskch() {
|
||||
return diskProfile;
|
||||
}
|
||||
|
||||
public String getPath() {
|
||||
return path;
|
||||
}
|
||||
|
||||
public Long getVolumeId() {
|
||||
return volumeId;
|
||||
}
|
||||
|
||||
protected CreateVolumeFromVMSnapshotCommand() {
|
||||
|
||||
}
|
||||
|
||||
public CreateVolumeFromVMSnapshotCommand(String path, String name,
|
||||
Boolean fullClone, String storagePoolUuid) {
|
||||
this.path = path;
|
||||
this.name = name;
|
||||
this.fullClone = fullClone;
|
||||
this.storagePoolUuid = storagePoolUuid;
|
||||
}
|
||||
|
||||
public CreateVolumeFromVMSnapshotCommand(String path, String name,
|
||||
Boolean fullClone, String storagePoolUuid, StorageFilerTO pool,
|
||||
DiskProfile diskProfile, Long volumeId) {
|
||||
this.path = path;
|
||||
this.name = name;
|
||||
this.fullClone = fullClone;
|
||||
this.storagePoolUuid = storagePoolUuid;
|
||||
this.pool = pool;
|
||||
this.diskProfile = diskProfile;
|
||||
this.volumeId = volumeId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean executeInSequence() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public Boolean getFullClone() {
|
||||
return fullClone;
|
||||
}
|
||||
|
||||
public String getStoragePoolUuid() {
|
||||
return storagePoolUuid;
|
||||
}
|
||||
|
||||
public StorageFilerTO getPool() {
|
||||
return pool;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
// 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.agent.api;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.cloud.agent.api.to.VolumeTO;
|
||||
|
||||
public class DeleteVMSnapshotAnswer extends Answer {
|
||||
private List<VolumeTO> volumeTOs;
|
||||
|
||||
public DeleteVMSnapshotAnswer() {
|
||||
}
|
||||
|
||||
public DeleteVMSnapshotAnswer(DeleteVMSnapshotCommand cmd, boolean result,
|
||||
String message) {
|
||||
super(cmd, result, message);
|
||||
}
|
||||
|
||||
public DeleteVMSnapshotAnswer(DeleteVMSnapshotCommand cmd,
|
||||
List<VolumeTO> volumeTOs) {
|
||||
super(cmd, true, "");
|
||||
this.volumeTOs = volumeTOs;
|
||||
}
|
||||
|
||||
public List<VolumeTO> getVolumeTOs() {
|
||||
return volumeTOs;
|
||||
}
|
||||
|
||||
public void setVolumeTOs(List<VolumeTO> volumeTOs) {
|
||||
this.volumeTOs = volumeTOs;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
// 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.agent.api;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.cloud.agent.api.to.VolumeTO;
|
||||
|
||||
|
||||
public class DeleteVMSnapshotCommand extends VMSnapshotBaseCommand {
|
||||
public DeleteVMSnapshotCommand(String vmName, VMSnapshotTO snapshot, List<VolumeTO> volumeTOs, String guestOSType) {
|
||||
super( vmName, snapshot, volumeTOs, guestOSType);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
// 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.agent.api;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.cloud.agent.api.to.VolumeTO;
|
||||
import com.cloud.vm.VirtualMachine;
|
||||
|
||||
public class RevertToVMSnapshotAnswer extends Answer {
|
||||
|
||||
private List<VolumeTO> volumeTOs;
|
||||
private VirtualMachine.State vmState;
|
||||
|
||||
public RevertToVMSnapshotAnswer(RevertToVMSnapshotCommand cmd, boolean result,
|
||||
String message) {
|
||||
super(cmd, result, message);
|
||||
}
|
||||
|
||||
public RevertToVMSnapshotAnswer() {
|
||||
super();
|
||||
}
|
||||
|
||||
public RevertToVMSnapshotAnswer(RevertToVMSnapshotCommand cmd,
|
||||
List<VolumeTO> volumeTOs,
|
||||
VirtualMachine.State vmState) {
|
||||
super(cmd, true, "");
|
||||
this.volumeTOs = volumeTOs;
|
||||
this.vmState = vmState;
|
||||
}
|
||||
|
||||
public VirtualMachine.State getVmState() {
|
||||
return vmState;
|
||||
}
|
||||
|
||||
public List<VolumeTO> getVolumeTOs() {
|
||||
return volumeTOs;
|
||||
}
|
||||
|
||||
public void setVolumeTOs(List<VolumeTO> volumeTOs) {
|
||||
this.volumeTOs = volumeTOs;
|
||||
}
|
||||
|
||||
public void setVmState(VirtualMachine.State vmState) {
|
||||
this.vmState = vmState;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
// 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.agent.api;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.cloud.agent.api.to.VolumeTO;
|
||||
|
||||
public class RevertToVMSnapshotCommand extends VMSnapshotBaseCommand {
|
||||
|
||||
public RevertToVMSnapshotCommand(String vmName, VMSnapshotTO snapshot, List<VolumeTO> volumeTOs, String guestOSType) {
|
||||
super(vmName, snapshot, volumeTOs, guestOSType);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
// 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.agent.api;
|
||||
|
||||
/*
|
||||
* This is used to schedule an explicit host scan in MS peers. Currently used during
|
||||
* add host operation so that correct MS can take host ownership. On receiving the
|
||||
* command the scan is scheduled immediately.
|
||||
*/
|
||||
public class ScheduleHostScanTaskCommand extends Command {
|
||||
public ScheduleHostScanTaskCommand() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean executeInSequence() {
|
||||
return false; // standalone command and can be executed independent of other commands
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
// 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.agent.api;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.cloud.agent.api.to.VolumeTO;
|
||||
|
||||
public class VMSnapshotBaseCommand extends Command{
|
||||
protected List<VolumeTO> volumeTOs;
|
||||
protected VMSnapshotTO target;
|
||||
protected String vmName;
|
||||
protected String guestOSType;
|
||||
|
||||
|
||||
public VMSnapshotBaseCommand(String vmName, VMSnapshotTO snapshot, List<VolumeTO> volumeTOs, String guestOSType) {
|
||||
this.vmName = vmName;
|
||||
this.target = snapshot;
|
||||
this.volumeTOs = volumeTOs;
|
||||
this.guestOSType = guestOSType;
|
||||
}
|
||||
|
||||
public List<VolumeTO> getVolumeTOs() {
|
||||
return volumeTOs;
|
||||
}
|
||||
|
||||
public void setVolumeTOs(List<VolumeTO> volumeTOs) {
|
||||
this.volumeTOs = volumeTOs;
|
||||
}
|
||||
|
||||
public VMSnapshotTO getTarget() {
|
||||
return target;
|
||||
}
|
||||
|
||||
public void setTarget(VMSnapshotTO target) {
|
||||
this.target = target;
|
||||
}
|
||||
|
||||
public String getVmName() {
|
||||
return vmName;
|
||||
}
|
||||
|
||||
public void setVmName(String vmName) {
|
||||
this.vmName = vmName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean executeInSequence() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public String getGuestOSType() {
|
||||
return guestOSType;
|
||||
}
|
||||
|
||||
public void setGuestOSType(String guestOSType) {
|
||||
this.guestOSType = guestOSType;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,90 @@
|
|||
// 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.agent.api;
|
||||
|
||||
import com.cloud.vm.snapshot.VMSnapshot;
|
||||
|
||||
public class VMSnapshotTO {
|
||||
private Long id;
|
||||
private String snapshotName;
|
||||
private VMSnapshot.Type type;
|
||||
private Long createTime;
|
||||
private Boolean current;
|
||||
private String description;
|
||||
private VMSnapshotTO parent;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
public VMSnapshotTO(Long id, String snapshotName,
|
||||
VMSnapshot.Type type, Long createTime,
|
||||
String description, Boolean current, VMSnapshotTO parent) {
|
||||
super();
|
||||
this.id = id;
|
||||
this.snapshotName = snapshotName;
|
||||
this.type = type;
|
||||
this.createTime = createTime;
|
||||
this.current = current;
|
||||
this.description = description;
|
||||
this.parent = parent;
|
||||
}
|
||||
public VMSnapshotTO() {
|
||||
|
||||
}
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
public Boolean getCurrent() {
|
||||
return current;
|
||||
}
|
||||
public void setCurrent(Boolean current) {
|
||||
this.current = current;
|
||||
}
|
||||
public Long getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
public void setCreateTime(Long createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public VMSnapshot.Type getType() {
|
||||
return type;
|
||||
}
|
||||
public void setType(VMSnapshot.Type type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getSnapshotName() {
|
||||
return snapshotName;
|
||||
}
|
||||
public void setSnapshotName(String snapshotName) {
|
||||
this.snapshotName = snapshotName;
|
||||
}
|
||||
public VMSnapshotTO getParent() {
|
||||
return parent;
|
||||
}
|
||||
public void setParent(VMSnapshotTO parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -17,8 +17,8 @@
|
|||
package com.cloud.agent.api.proxy;
|
||||
|
||||
import com.cloud.agent.api.Command;
|
||||
import com.cloud.agent.api.LogLevel.Log4jLevel;
|
||||
import com.cloud.agent.api.LogLevel;
|
||||
import com.cloud.agent.api.LogLevel.Log4jLevel;
|
||||
|
||||
public class StartConsoleProxyAgentHttpHandlerCommand extends Command {
|
||||
@LogLevel(Log4jLevel.Off)
|
||||
|
|
|
|||
|
|
@ -28,7 +28,9 @@ public class DhcpEntryCommand extends NetworkElementCommand {
|
|||
String defaultRouter;
|
||||
String staticRoutes;
|
||||
String defaultDns;
|
||||
|
||||
String vmIp6Address;
|
||||
String ip6Gateway;
|
||||
String duid;
|
||||
|
||||
protected DhcpEntryCommand() {
|
||||
|
||||
|
|
@ -39,14 +41,15 @@ public class DhcpEntryCommand extends NetworkElementCommand {
|
|||
return true;
|
||||
}
|
||||
|
||||
public DhcpEntryCommand(String vmMac, String vmIpAddress, String vmName) {
|
||||
public DhcpEntryCommand(String vmMac, String vmIpAddress, String vmName, String vmIp6Address) {
|
||||
this.vmMac = vmMac;
|
||||
this.vmIpAddress = vmIpAddress;
|
||||
this.vmName = vmName;
|
||||
this.vmIp6Address = vmIp6Address;
|
||||
}
|
||||
|
||||
public DhcpEntryCommand(String vmMac, String vmIpAddress, String vmName, String dns, String gateway) {
|
||||
this(vmMac, vmIpAddress, vmName);
|
||||
public DhcpEntryCommand(String vmMac, String vmIpAddress, String vmName, String vmIp6Address, String dns, String gateway, String ip6Gateway) {
|
||||
this(vmMac, vmIpAddress, vmName, vmIp6Address);
|
||||
this.dns = dns;
|
||||
this.gateway = gateway;
|
||||
}
|
||||
|
|
@ -102,4 +105,28 @@ public class DhcpEntryCommand extends NetworkElementCommand {
|
|||
public void setDefaultDns(String defaultDns) {
|
||||
this.defaultDns = defaultDns;
|
||||
}
|
||||
|
||||
public String getIp6Gateway() {
|
||||
return ip6Gateway;
|
||||
}
|
||||
|
||||
public void setIp6Gateway(String ip6Gateway) {
|
||||
this.ip6Gateway = ip6Gateway;
|
||||
}
|
||||
|
||||
public String getDuid() {
|
||||
return duid;
|
||||
}
|
||||
|
||||
public void setDuid(String duid) {
|
||||
this.duid = duid;
|
||||
}
|
||||
|
||||
public String getVmIp6Address() {
|
||||
return vmIp6Address;
|
||||
}
|
||||
|
||||
public void setVmIp6Address(String ip6Address) {
|
||||
this.vmIp6Address = ip6Address;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@
|
|||
// under the License.
|
||||
package com.cloud.agent.api.storage;
|
||||
|
||||
import com.cloud.agent.api.Command;
|
||||
|
||||
public class CreateEntityDownloadURLCommand extends AbstractDownloadCommand {
|
||||
|
||||
|
|
|
|||
|
|
@ -18,11 +18,12 @@ package com.cloud.agent.api.storage;
|
|||
|
||||
import java.net.URI;
|
||||
|
||||
import com.cloud.storage.Volume;
|
||||
import com.cloud.storage.Storage.ImageFormat;
|
||||
import com.cloud.template.VirtualMachineTemplate;
|
||||
import org.apache.cloudstack.api.InternalIdentity;
|
||||
|
||||
import com.cloud.storage.Storage.ImageFormat;
|
||||
import com.cloud.storage.Volume;
|
||||
import com.cloud.template.VirtualMachineTemplate;
|
||||
|
||||
|
||||
public class DownloadCommand extends AbstractDownloadCommand implements InternalIdentity {
|
||||
public static class PasswordAuth {
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@ package com.cloud.agent.api.storage;
|
|||
import java.util.Map;
|
||||
|
||||
import com.cloud.agent.api.Answer;
|
||||
|
||||
import com.cloud.storage.template.TemplateInfo;
|
||||
|
||||
public class ListTemplateAnswer extends Answer {
|
||||
|
|
|
|||
|
|
@ -16,9 +16,6 @@
|
|||
// under the License.
|
||||
package com.cloud.agent.api.storage;
|
||||
|
||||
import com.cloud.agent.api.LogLevel;
|
||||
import com.cloud.agent.api.LogLevel.Log4jLevel;
|
||||
import com.cloud.agent.api.to.SwiftTO;
|
||||
|
||||
public class ListVolumeCommand extends StorageCommand {
|
||||
|
||||
|
|
|
|||
|
|
@ -16,8 +16,8 @@
|
|||
// under the License.
|
||||
package com.cloud.agent.api.storage;
|
||||
|
||||
import com.cloud.storage.Storage.ImageFormat;
|
||||
import com.cloud.agent.api.to.StorageFilerTO;
|
||||
import com.cloud.storage.Storage.ImageFormat;
|
||||
import com.cloud.storage.StoragePool;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -14,29 +14,27 @@
|
|||
// KIND, either express or implied. See the License for the
|
||||
// specific language governing permissions and limitations
|
||||
// under the License.
|
||||
package com.cloud.resource;
|
||||
package com.cloud.agent.api.storage;
|
||||
|
||||
import com.cloud.storage.VolumeVO;
|
||||
import com.cloud.template.VirtualMachineTemplate.BootloaderType;
|
||||
import com.cloud.utils.component.Adapter;
|
||||
import com.cloud.agent.api.Answer;
|
||||
|
||||
/**
|
||||
* DiskMounter mounts and unmounts disk for VMs
|
||||
* to consume.
|
||||
*
|
||||
*/
|
||||
public interface DiskPreparer extends Adapter {
|
||||
/**
|
||||
* Mounts a volumeVO and returns a path.
|
||||
*
|
||||
* @param vol
|
||||
* @return
|
||||
*/
|
||||
public String mount(String vmName, VolumeVO vol, BootloaderType type);
|
||||
|
||||
/**
|
||||
* Unmounts
|
||||
*/
|
||||
public boolean unmount(String path);
|
||||
public class ResizeVolumeAnswer extends Answer {
|
||||
private long newSize;
|
||||
|
||||
protected ResizeVolumeAnswer() {
|
||||
|
||||
}
|
||||
|
||||
public ResizeVolumeAnswer(ResizeVolumeCommand cmd, boolean result, String details, long newSize) {
|
||||
super(cmd, result, details);
|
||||
this.newSize = newSize;
|
||||
}
|
||||
|
||||
public ResizeVolumeAnswer(ResizeVolumeCommand cmd, boolean result, String details) {
|
||||
super(cmd, result, details);
|
||||
}
|
||||
|
||||
public long getNewSize() {
|
||||
return newSize;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,85 @@
|
|||
// 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.agent.api.storage;
|
||||
|
||||
import com.cloud.agent.api.Command;
|
||||
import com.cloud.agent.api.to.StorageFilerTO;
|
||||
|
||||
public class ResizeVolumeCommand extends Command {
|
||||
private String path;
|
||||
private StorageFilerTO pool;
|
||||
private String vmInstance;
|
||||
private Long newSize;
|
||||
private Long currentSize;
|
||||
private boolean shrinkOk;
|
||||
|
||||
protected ResizeVolumeCommand() {
|
||||
|
||||
}
|
||||
|
||||
public ResizeVolumeCommand(String path,
|
||||
StorageFilerTO pool,
|
||||
Long currentSize,
|
||||
Long newSize,
|
||||
boolean shrinkOk,
|
||||
String vmInstance)
|
||||
{
|
||||
this.path = path;
|
||||
this.pool = pool;
|
||||
this.vmInstance = vmInstance;
|
||||
this.currentSize = currentSize;
|
||||
this.newSize = newSize;
|
||||
this.shrinkOk = shrinkOk;
|
||||
}
|
||||
|
||||
public String getPath() {
|
||||
return path;
|
||||
}
|
||||
|
||||
public String getPoolUuid() {
|
||||
return pool.getUuid();
|
||||
}
|
||||
|
||||
public StorageFilerTO getPool() {
|
||||
return pool;
|
||||
}
|
||||
|
||||
public long getNewSize() {
|
||||
return newSize;
|
||||
}
|
||||
|
||||
public long getCurrentSize() {
|
||||
return currentSize;
|
||||
}
|
||||
|
||||
public boolean getShrinkOk() {
|
||||
return shrinkOk;
|
||||
}
|
||||
|
||||
public String getInstanceName() {
|
||||
return vmInstance;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public boolean executeInSequence() {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -16,11 +16,12 @@
|
|||
// under the License.
|
||||
package com.cloud.agent.api.storage;
|
||||
|
||||
import org.apache.cloudstack.api.InternalIdentity;
|
||||
|
||||
import com.cloud.agent.api.storage.DownloadCommand.PasswordAuth;
|
||||
import com.cloud.agent.api.to.TemplateTO;
|
||||
import com.cloud.storage.Upload.Type;
|
||||
import com.cloud.template.VirtualMachineTemplate;
|
||||
import org.apache.cloudstack.api.InternalIdentity;
|
||||
|
||||
|
||||
public class UploadCommand extends AbstractUploadCommand implements InternalIdentity {
|
||||
|
|
|
|||
|
|
@ -19,10 +19,11 @@ package com.cloud.agent.api.to;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.cloudstack.api.InternalIdentity;
|
||||
|
||||
import com.cloud.network.rules.FirewallRule;
|
||||
import com.cloud.network.rules.FirewallRule.State;
|
||||
import com.cloud.utils.net.NetUtils;
|
||||
import org.apache.cloudstack.api.InternalIdentity;
|
||||
|
||||
/**
|
||||
* FirewallRuleTO transfers a port range for an ip to be opened.
|
||||
|
|
@ -50,7 +51,7 @@ public class FirewallRuleTO implements InternalIdentity {
|
|||
FirewallRule.Purpose purpose;
|
||||
private Integer icmpType;
|
||||
private Integer icmpCode;
|
||||
|
||||
private FirewallRule.TrafficType trafficType;
|
||||
|
||||
protected FirewallRuleTO() {
|
||||
}
|
||||
|
|
@ -85,6 +86,7 @@ public class FirewallRuleTO implements InternalIdentity {
|
|||
this.sourceCidrList = sourceCidr;
|
||||
this.icmpType = icmpType;
|
||||
this.icmpCode = icmpCode;
|
||||
this.trafficType = null;
|
||||
}
|
||||
public FirewallRuleTO(FirewallRule rule, String srcVlanTag, String srcIp) {
|
||||
this(rule.getId(),srcVlanTag, srcIp, rule.getProtocol(), rule.getSourcePortStart(), rule.getSourcePortEnd(), rule.getState()==State.Revoke, rule.getState()==State.Active, rule.getPurpose(),rule.getSourceCidrList(),rule.getIcmpType(),rule.getIcmpCode());
|
||||
|
|
@ -94,6 +96,23 @@ public class FirewallRuleTO implements InternalIdentity {
|
|||
this(rule.getId(),null, srcIp, rule.getProtocol(), rule.getSourcePortStart(), rule.getSourcePortEnd(), rule.getState()==State.Revoke, rule.getState()==State.Active, rule.getPurpose(),rule.getSourceCidrList(),rule.getIcmpType(),rule.getIcmpCode());
|
||||
}
|
||||
|
||||
public FirewallRuleTO(FirewallRule rule, String srcVlanTag, String srcIp, FirewallRule.Purpose purpose) {
|
||||
this(rule.getId(),srcVlanTag, srcIp, rule.getProtocol(), rule.getSourcePortStart(), rule.getSourcePortEnd(), rule.getState()==State.Revoke, rule.getState()==State.Active, purpose,rule.getSourceCidrList(),rule.getIcmpType(),rule.getIcmpCode());
|
||||
}
|
||||
|
||||
public FirewallRuleTO(FirewallRule rule, String srcVlanTag, String srcIp, FirewallRule.Purpose purpose, FirewallRule.TrafficType trafficType) {
|
||||
this(rule.getId(),srcVlanTag, srcIp, rule.getProtocol(), rule.getSourcePortStart(), rule.getSourcePortEnd(), rule.getState()==State.Revoke, rule.getState()==State.Active, purpose,rule.getSourceCidrList(),rule.getIcmpType(),rule.getIcmpCode());
|
||||
this.trafficType = trafficType;
|
||||
}
|
||||
|
||||
public FirewallRuleTO(FirewallRule rule, String srcVlanTag, String srcIp, FirewallRule.Purpose purpose, boolean revokeState, boolean alreadyAdded) {
|
||||
this(rule.getId(),srcVlanTag, srcIp, rule.getProtocol(), rule.getSourcePortStart(), rule.getSourcePortEnd(), revokeState, alreadyAdded, purpose,rule.getSourceCidrList(),rule.getIcmpType(),rule.getIcmpCode());
|
||||
}
|
||||
|
||||
public FirewallRule.TrafficType getTrafficType(){
|
||||
return trafficType;
|
||||
}
|
||||
|
||||
public long getId() {
|
||||
return id;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,10 +20,11 @@ package com.cloud.agent.api.to;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.cloudstack.api.InternalIdentity;
|
||||
|
||||
import com.cloud.network.rules.FirewallRule;
|
||||
import com.cloud.network.rules.FirewallRule.TrafficType;
|
||||
import com.cloud.utils.net.NetUtils;
|
||||
import org.apache.cloudstack.api.InternalIdentity;
|
||||
|
||||
|
||||
public class NetworkACLTO implements InternalIdentity {
|
||||
|
|
|
|||
|
|
@ -16,10 +16,10 @@
|
|||
// under the License.
|
||||
package com.cloud.agent.api.to;
|
||||
|
||||
import com.cloud.utils.S3Utils;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.cloud.utils.S3Utils;
|
||||
|
||||
public final class S3TO implements S3Utils.ClientOptions {
|
||||
|
||||
private Long id;
|
||||
|
|
|
|||
|
|
@ -16,9 +16,10 @@
|
|||
// under the License.
|
||||
package com.cloud.agent.api.to;
|
||||
|
||||
import org.apache.cloudstack.api.InternalIdentity;
|
||||
|
||||
import com.cloud.storage.Storage.ImageFormat;
|
||||
import com.cloud.template.VirtualMachineTemplate;
|
||||
import org.apache.cloudstack.api.InternalIdentity;
|
||||
|
||||
public class TemplateTO implements InternalIdentity {
|
||||
private long id;
|
||||
|
|
|
|||
|
|
@ -28,7 +28,8 @@ public class VirtualMachineTO {
|
|||
private BootloaderType bootloader;
|
||||
Type type;
|
||||
int cpus;
|
||||
Integer speed;
|
||||
Integer minSpeed;
|
||||
Integer maxSpeed;
|
||||
long minRam;
|
||||
long maxRam;
|
||||
String hostName;
|
||||
|
|
@ -47,12 +48,13 @@ public class VirtualMachineTO {
|
|||
VolumeTO[] disks;
|
||||
NicTO[] nics;
|
||||
|
||||
public VirtualMachineTO(long id, String instanceName, VirtualMachine.Type type, int cpus, Integer speed, long minRam, long maxRam, BootloaderType bootloader, String os, boolean enableHA, boolean limitCpuUse, String vncPassword) {
|
||||
public VirtualMachineTO(long id, String instanceName, VirtualMachine.Type type, int cpus, Integer minSpeed, Integer maxSpeed, long minRam, long maxRam, BootloaderType bootloader, String os, boolean enableHA, boolean limitCpuUse, String vncPassword) {
|
||||
this.id = id;
|
||||
this.name = instanceName;
|
||||
this.type = type;
|
||||
this.cpus = cpus;
|
||||
this.speed = speed;
|
||||
this.minSpeed = minSpeed;
|
||||
this.maxSpeed = maxSpeed;
|
||||
this.minRam = minRam;
|
||||
this.maxRam = maxRam;
|
||||
this.bootloader = bootloader;
|
||||
|
|
@ -101,10 +103,13 @@ public class VirtualMachineTO {
|
|||
this.cpus = cpus;
|
||||
}
|
||||
|
||||
public Integer getSpeed() {
|
||||
return speed;
|
||||
public Integer getMinSpeed() {
|
||||
return minSpeed;
|
||||
}
|
||||
|
||||
public Integer getMaxSpeed() {
|
||||
return maxSpeed;
|
||||
}
|
||||
public boolean getLimitCpuUse() {
|
||||
return limitCpuUse;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,10 +16,11 @@
|
|||
// under the License.
|
||||
package com.cloud.agent.api.to;
|
||||
|
||||
import org.apache.cloudstack.api.InternalIdentity;
|
||||
|
||||
import com.cloud.storage.Storage.StoragePoolType;
|
||||
import com.cloud.storage.StoragePool;
|
||||
import com.cloud.storage.Volume;
|
||||
import org.apache.cloudstack.api.InternalIdentity;
|
||||
|
||||
public class VolumeTO implements InternalIdentity {
|
||||
protected VolumeTO() {
|
||||
|
|
@ -123,6 +124,10 @@ public class VolumeTO implements InternalIdentity {
|
|||
public String getOsType() {
|
||||
return guestOsType;
|
||||
}
|
||||
|
||||
public void setPath(String path){
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
|
|
|
|||
|
|
@ -16,11 +16,11 @@
|
|||
// under the License.
|
||||
package com.cloud.alert;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import org.apache.cloudstack.api.Identity;
|
||||
import org.apache.cloudstack.api.InternalIdentity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public interface Alert extends Identity, InternalIdentity {
|
||||
short getType();
|
||||
String getSubject();
|
||||
|
|
|
|||
|
|
@ -16,14 +16,17 @@
|
|||
// under the License.
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import org.apache.cloudstack.api.*;
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
import org.apache.cloudstack.api.ApiErrorCode;
|
||||
import org.apache.cloudstack.api.BaseAsyncCreateCmd;
|
||||
import org.apache.cloudstack.api.Parameter;
|
||||
import org.apache.cloudstack.api.ServerApiException;
|
||||
import org.apache.cloudstack.api.response.DomainResponse;
|
||||
import org.apache.cloudstack.api.response.NetworkResponse;
|
||||
import org.apache.cloudstack.api.response.PhysicalNetworkResponse;
|
||||
import org.apache.cloudstack.api.response.ProjectResponse;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import org.apache.cloudstack.api.APICommand;
|
||||
import org.apache.cloudstack.api.response.NetworkResponse;
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.exception.ConcurrentOperationException;
|
||||
import com.cloud.exception.InsufficientCapacityException;
|
||||
|
|
@ -145,17 +148,17 @@ public class CreatePrivateNetworkCmd extends BaseAsyncCreateCmd {
|
|||
} catch (InsufficientCapacityException ex){
|
||||
s_logger.info(ex);
|
||||
s_logger.trace(ex);
|
||||
throw new ServerApiException(BaseCmd.INSUFFICIENT_CAPACITY_ERROR, ex.getMessage());
|
||||
throw new ServerApiException(ApiErrorCode.INSUFFICIENT_CAPACITY_ERROR, ex.getMessage());
|
||||
} catch (ConcurrentOperationException ex) {
|
||||
s_logger.warn("Exception: ", ex);
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, ex.getMessage());
|
||||
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, ex.getMessage());
|
||||
}
|
||||
|
||||
if (result != null) {
|
||||
this.setEntityId(result.getId());
|
||||
this.setEntityUuid(result.getUuid());
|
||||
} else {
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create a Private network");
|
||||
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to create a Private network");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -167,7 +170,7 @@ public class CreatePrivateNetworkCmd extends BaseAsyncCreateCmd {
|
|||
response.setResponseName(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
} else {
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create private network");
|
||||
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to create private network");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,11 +16,14 @@
|
|||
// under the License.
|
||||
package com.cloud.api.commands;
|
||||
|
||||
import org.apache.cloudstack.api.*;
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
import org.apache.cloudstack.api.ApiErrorCode;
|
||||
import org.apache.cloudstack.api.BaseAsyncCmd;
|
||||
import org.apache.cloudstack.api.Parameter;
|
||||
import org.apache.cloudstack.api.ServerApiException;
|
||||
import org.apache.cloudstack.api.response.SuccessResponse;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import org.apache.cloudstack.api.APICommand;
|
||||
import org.apache.cloudstack.api.response.SuccessResponse;
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.UserContext;
|
||||
|
|
@ -84,7 +87,7 @@ public class DestroyConsoleProxyCmd extends BaseAsyncCmd {
|
|||
SuccessResponse response = new SuccessResponse(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
} else {
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to destroy console proxy");
|
||||
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to destroy console proxy");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,12 +19,12 @@ package com.cloud.api.commands;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.cloudstack.api.APICommand;
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
import org.apache.cloudstack.api.BaseListCmd;
|
||||
import org.apache.cloudstack.api.Parameter;
|
||||
import org.apache.cloudstack.api.response.ListResponse;
|
||||
import org.apache.cloudstack.api.response.SnapshotScheduleResponse;
|
||||
|
||||
import com.cloud.storage.snapshot.SnapshotSchedule;
|
||||
|
||||
//@APICommand(description="Lists recurring snapshot schedule", responseObject=SnapshotScheduleResponse.class)
|
||||
|
|
|
|||
|
|
@ -20,24 +20,27 @@ import java.util.List;
|
|||
|
||||
import javax.naming.NamingException;
|
||||
|
||||
import org.apache.cloudstack.api.command.admin.config.UpdateCfgCmd;
|
||||
import org.apache.cloudstack.api.command.admin.ldap.LDAPConfigCmd;
|
||||
import org.apache.cloudstack.api.command.admin.ldap.LDAPRemoveCmd;
|
||||
import org.apache.cloudstack.api.command.admin.network.CreateNetworkOfferingCmd;
|
||||
import org.apache.cloudstack.api.command.admin.network.DeleteNetworkOfferingCmd;
|
||||
import org.apache.cloudstack.api.command.admin.network.UpdateNetworkOfferingCmd;
|
||||
import org.apache.cloudstack.api.command.admin.offering.CreateDiskOfferingCmd;
|
||||
import org.apache.cloudstack.api.command.admin.offering.CreateServiceOfferingCmd;
|
||||
import org.apache.cloudstack.api.command.admin.vlan.CreateVlanIpRangeCmd;
|
||||
import org.apache.cloudstack.api.command.admin.offering.*;
|
||||
import org.apache.cloudstack.api.command.admin.offering.DeleteDiskOfferingCmd;
|
||||
import org.apache.cloudstack.api.command.admin.offering.DeleteServiceOfferingCmd;
|
||||
import org.apache.cloudstack.api.command.admin.offering.UpdateDiskOfferingCmd;
|
||||
import org.apache.cloudstack.api.command.admin.offering.UpdateServiceOfferingCmd;
|
||||
import org.apache.cloudstack.api.command.admin.pod.DeletePodCmd;
|
||||
import org.apache.cloudstack.api.command.admin.pod.UpdatePodCmd;
|
||||
import org.apache.cloudstack.api.command.admin.vlan.CreateVlanIpRangeCmd;
|
||||
import org.apache.cloudstack.api.command.admin.vlan.DeleteVlanIpRangeCmd;
|
||||
import org.apache.cloudstack.api.command.admin.zone.CreateZoneCmd;
|
||||
import org.apache.cloudstack.api.command.admin.offering.DeleteDiskOfferingCmd;
|
||||
import org.apache.cloudstack.api.command.admin.network.DeleteNetworkOfferingCmd;
|
||||
import org.apache.cloudstack.api.command.admin.zone.DeleteZoneCmd;
|
||||
import org.apache.cloudstack.api.command.admin.ldap.LDAPConfigCmd;
|
||||
import org.apache.cloudstack.api.command.admin.config.UpdateCfgCmd;
|
||||
import org.apache.cloudstack.api.command.admin.network.UpdateNetworkOfferingCmd;
|
||||
import org.apache.cloudstack.api.command.admin.pod.UpdatePodCmd;
|
||||
import org.apache.cloudstack.api.command.user.network.ListNetworkOfferingsCmd;
|
||||
import org.apache.cloudstack.api.command.admin.offering.UpdateDiskOfferingCmd;
|
||||
import org.apache.cloudstack.api.command.admin.zone.UpdateZoneCmd;
|
||||
import org.apache.cloudstack.api.command.user.network.ListNetworkOfferingsCmd;
|
||||
|
||||
import com.cloud.dc.DataCenter;
|
||||
import com.cloud.dc.Pod;
|
||||
import com.cloud.dc.Vlan;
|
||||
|
|
@ -261,6 +264,8 @@ public interface ConfigurationService {
|
|||
|
||||
boolean removeLDAP(LDAPRemoveCmd cmd);
|
||||
|
||||
LDAPConfigCmd listLDAPConfig(LDAPConfigCmd cmd);
|
||||
|
||||
/**
|
||||
* @param offering
|
||||
* @return
|
||||
|
|
|
|||
|
|
@ -28,7 +28,9 @@ public interface Resource {
|
|||
template("template", 4, ResourceOwnerType.Account, ResourceOwnerType.Domain),
|
||||
project("project", 5, ResourceOwnerType.Account, ResourceOwnerType.Domain),
|
||||
network("network", 6, ResourceOwnerType.Account, ResourceOwnerType.Domain),
|
||||
vpc("vpc", 7, ResourceOwnerType.Account, ResourceOwnerType.Domain);
|
||||
vpc("vpc", 7, ResourceOwnerType.Account, ResourceOwnerType.Domain),
|
||||
cpu("cpu", 8, ResourceOwnerType.Account, ResourceOwnerType.Domain),
|
||||
memory("memory", 9, ResourceOwnerType.Account, ResourceOwnerType.Domain);
|
||||
|
||||
private String name;
|
||||
private ResourceOwnerType[] supportedOwners;
|
||||
|
|
|
|||
|
|
@ -38,6 +38,16 @@ public interface EntityManager {
|
|||
*/
|
||||
public <T, K extends Serializable> T findById(Class<T> entityType, K id);
|
||||
|
||||
/**
|
||||
* Finds an entity by its id including removed.
|
||||
* @param <T> class of the entity you're trying to find.
|
||||
* @param <K> class of the id that the entity uses.
|
||||
* @param entityType Type of the entity.
|
||||
* @param id id value
|
||||
* @return T if found; null if not.
|
||||
*/
|
||||
public <T, K extends Serializable> T findByIdIncludingRemoved(Class<T> entityType, K id);
|
||||
|
||||
/**
|
||||
* Finds a unique entity by uuid string
|
||||
* @param <T> entity class
|
||||
|
|
@ -47,6 +57,15 @@ public interface EntityManager {
|
|||
*/
|
||||
public <T> T findByUuid(Class<T> entityType, String uuid);
|
||||
|
||||
/**
|
||||
* Finds a unique entity by uuid string
|
||||
* @param <T> entity class
|
||||
* @param entityType type of entity you're looking for.
|
||||
* @param uuid the unique id
|
||||
* @return T if found, null if not.
|
||||
*/
|
||||
public <T> T findByUuidIncludingRemoved(Class<T> entityType, String uuid);
|
||||
|
||||
/**
|
||||
* Finds an entity by external id which is always String
|
||||
* @param <T> entity class
|
||||
|
|
|
|||
|
|
@ -18,11 +18,12 @@ package com.cloud.dc;
|
|||
|
||||
import java.util.Map;
|
||||
|
||||
import com.cloud.org.Grouping;
|
||||
import org.apache.cloudstack.acl.InfrastructureEntity;
|
||||
import org.apache.cloudstack.api.Identity;
|
||||
import org.apache.cloudstack.api.InternalIdentity;
|
||||
|
||||
import com.cloud.org.Grouping;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
|
@ -36,6 +37,10 @@ public interface DataCenter extends InfrastructureEntity, Grouping, Identity, In
|
|||
|
||||
String getDns2();
|
||||
|
||||
String getIp6Dns1();
|
||||
|
||||
String getIp6Dns2();
|
||||
|
||||
String getGuestNetworkCidr();
|
||||
|
||||
String getName();
|
||||
|
|
|
|||
|
|
@ -16,11 +16,12 @@
|
|||
// under the License.
|
||||
package com.cloud.dc;
|
||||
|
||||
import com.cloud.org.Grouping;
|
||||
import org.apache.cloudstack.acl.InfrastructureEntity;
|
||||
import org.apache.cloudstack.api.Identity;
|
||||
import org.apache.cloudstack.api.InternalIdentity;
|
||||
|
||||
import com.cloud.org.Grouping;
|
||||
|
||||
/**
|
||||
* Represents one pod in the cloud stack.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -44,4 +44,9 @@ public interface Vlan extends InfrastructureEntity, InternalIdentity, Identity {
|
|||
|
||||
public Long getPhysicalNetworkId();
|
||||
|
||||
public String getIp6Gateway();
|
||||
|
||||
public String getIp6Cidr();
|
||||
|
||||
public String getIp6Range();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,10 +18,11 @@ package com.cloud.domain;
|
|||
|
||||
import java.util.Date;
|
||||
|
||||
import com.cloud.user.OwnedBy;
|
||||
import org.apache.cloudstack.api.Identity;
|
||||
import org.apache.cloudstack.api.InternalIdentity;
|
||||
|
||||
import com.cloud.user.OwnedBy;
|
||||
|
||||
/**
|
||||
* Domain defines the Domain object.
|
||||
*/
|
||||
|
|
@ -58,4 +59,8 @@ public interface Domain extends OwnedBy, Identity, InternalIdentity {
|
|||
void setState(State state);
|
||||
|
||||
String getNetworkDomain();
|
||||
|
||||
public String getUuid();
|
||||
|
||||
int getRegionId();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,55 @@
|
|||
/*
|
||||
* 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.event;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class EventCategory {
|
||||
private static List<EventCategory> eventCategories = new ArrayList<EventCategory>();
|
||||
private String eventCategoryName;
|
||||
|
||||
public EventCategory(String categoryName) {
|
||||
this.eventCategoryName = categoryName;
|
||||
eventCategories.add(this);
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return eventCategoryName;
|
||||
}
|
||||
|
||||
public static List<EventCategory> listAllEventCategories() {
|
||||
return eventCategories;
|
||||
}
|
||||
|
||||
public static EventCategory getEventCategory(String categoryName) {
|
||||
for (EventCategory category : eventCategories) {
|
||||
if (category.getName().equalsIgnoreCase(categoryName)) {
|
||||
return category;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static final EventCategory ACTION_EVENT = new EventCategory("ActionEvent");
|
||||
public static final EventCategory ALERT_EVENT = new EventCategory("AlertEvent");
|
||||
public static final EventCategory USAGE_EVENT = new EventCategory("UsageEvent");
|
||||
public static final EventCategory RESOURCE_STATE_CHANGE_EVENT = new EventCategory("ResourceStateEvent");
|
||||
}
|
||||
|
|
@ -16,7 +16,41 @@
|
|||
// under the License.
|
||||
package com.cloud.event;
|
||||
|
||||
import com.cloud.configuration.Configuration;
|
||||
import com.cloud.dc.DataCenter;
|
||||
import com.cloud.dc.Pod;
|
||||
import com.cloud.dc.StorageNetworkIpRange;
|
||||
import com.cloud.dc.Vlan;
|
||||
import com.cloud.domain.Domain;
|
||||
import com.cloud.host.Host;
|
||||
import com.cloud.network.*;
|
||||
import com.cloud.network.as.*;
|
||||
import com.cloud.network.router.VirtualRouter;
|
||||
import com.cloud.network.rules.LoadBalancer;
|
||||
import com.cloud.network.rules.StaticNat;
|
||||
import com.cloud.network.security.SecurityGroup;
|
||||
import com.cloud.network.vpc.PrivateGateway;
|
||||
import com.cloud.network.vpc.StaticRoute;
|
||||
import com.cloud.network.vpc.Vpc;
|
||||
import com.cloud.offering.DiskOffering;
|
||||
import com.cloud.offering.NetworkOffering;
|
||||
import com.cloud.offering.ServiceOffering;
|
||||
import com.cloud.projects.Project;
|
||||
import com.cloud.storage.Snapshot;
|
||||
import com.cloud.storage.Volume;
|
||||
import com.cloud.template.VirtualMachineTemplate;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.User;
|
||||
import com.cloud.vm.VirtualMachine;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class EventTypes {
|
||||
|
||||
//map of Event and corresponding entity for which Event is applicable
|
||||
private static Map<String, String> entityEventDetails = null;
|
||||
|
||||
// VM Events
|
||||
public static final String EVENT_VM_CREATE = "VM.CREATE";
|
||||
public static final String EVENT_VM_DESTROY = "VM.DESTROY";
|
||||
|
|
@ -26,6 +60,7 @@ public class EventTypes {
|
|||
public static final String EVENT_VM_UPDATE = "VM.UPDATE";
|
||||
public static final String EVENT_VM_UPGRADE = "VM.UPGRADE";
|
||||
public static final String EVENT_VM_RESETPASSWORD = "VM.RESETPASSWORD";
|
||||
public static final String EVENT_VM_RESETSSHKEY = "VM.RESETSSHKEY";
|
||||
public static final String EVENT_VM_MIGRATE = "VM.MIGRATE";
|
||||
public static final String EVENT_VM_MOVE = "VM.MOVE";
|
||||
public static final String EVENT_VM_RESTORE = "VM.RESTORE";
|
||||
|
|
@ -63,6 +98,11 @@ public class EventTypes {
|
|||
public static final String EVENT_FIREWALL_OPEN = "FIREWALL.OPEN";
|
||||
public static final String EVENT_FIREWALL_CLOSE = "FIREWALL.CLOSE";
|
||||
|
||||
//NIC Events
|
||||
public static final String EVENT_NIC_CREATE = "NIC.CREATE";
|
||||
public static final String EVENT_NIC_DELETE = "NIC.DELETE";
|
||||
public static final String EVENT_NIC_UPDATE = "NIC.UPDATE";
|
||||
|
||||
// Load Balancers
|
||||
public static final String EVENT_ASSIGN_TO_LOAD_BALANCER_RULE = "LB.ASSIGN.TO.RULE";
|
||||
public static final String EVENT_REMOVE_FROM_LOAD_BALANCER_RULE = "LB.REMOVE.FROM.RULE";
|
||||
|
|
@ -108,6 +148,7 @@ public class EventTypes {
|
|||
public static final String EVENT_VOLUME_EXTRACT = "VOLUME.EXTRACT";
|
||||
public static final String EVENT_VOLUME_UPLOAD = "VOLUME.UPLOAD";
|
||||
public static final String EVENT_VOLUME_MIGRATE = "VOLUME.MIGRATE";
|
||||
public static final String EVENT_VOLUME_RESIZE = "VOLUME.RESIZE";
|
||||
|
||||
// Domains
|
||||
public static final String EVENT_DOMAIN_CREATE = "DOMAIN.CREATE";
|
||||
|
|
@ -290,6 +331,11 @@ public class EventTypes {
|
|||
// tag related events
|
||||
public static final String EVENT_TAGS_CREATE = "CREATE_TAGS";
|
||||
public static final String EVENT_TAGS_DELETE = "DELETE_TAGS";
|
||||
|
||||
// vm snapshot events
|
||||
public static final String EVENT_VM_SNAPSHOT_CREATE = "VMSNAPSHOT.CREATE";
|
||||
public static final String EVENT_VM_SNAPSHOT_DELETE = "VMSNAPSHOT.DELETE";
|
||||
public static final String EVENT_VM_SNAPSHOT_REVERT = "VMSNAPSHOT.REVERTTO";
|
||||
|
||||
// external network device events
|
||||
public static final String EVENT_EXTERNAL_NVP_CONTROLLER_ADD = "PHYSICAL.NVPCONTROLLER.ADD";
|
||||
|
|
@ -312,4 +358,323 @@ public class EventTypes {
|
|||
public static final String EVENT_AUTOSCALEVMGROUP_UPDATE = "AUTOSCALEVMGROUP.UPDATE";
|
||||
public static final String EVENT_AUTOSCALEVMGROUP_ENABLE = "AUTOSCALEVMGROUP.ENABLE";
|
||||
public static final String EVENT_AUTOSCALEVMGROUP_DISABLE = "AUTOSCALEVMGROUP.DISABLE";
|
||||
|
||||
|
||||
public static final String EVENT_BAREMETAL_DHCP_SERVER_ADD = "PHYSICAL.DHCP.ADD";
|
||||
public static final String EVENT_BAREMETAL_DHCP_SERVER_DELETE = "PHYSICAL.DHCP.DELETE";
|
||||
public static final String EVENT_BAREMETAL_PXE_SERVER_ADD = "PHYSICAL.PXE.ADD";
|
||||
public static final String EVENT_BAREMETAL_PXE_SERVER_DELETE = "PHYSICAL.PXE.DELETE";
|
||||
|
||||
static {
|
||||
|
||||
// TODO: need a way to force author adding event types to declare the entity details as well, with out braking
|
||||
// current ActionEvent annotation semantics
|
||||
|
||||
entityEventDetails = new HashMap<String, String>();
|
||||
|
||||
entityEventDetails.put(EVENT_VM_CREATE, VirtualMachine.class.getName());
|
||||
entityEventDetails.put(EVENT_VM_DESTROY, VirtualMachine.class.getName());
|
||||
entityEventDetails.put(EVENT_VM_START, VirtualMachine.class.getName());
|
||||
entityEventDetails.put(EVENT_VM_STOP, VirtualMachine.class.getName());
|
||||
entityEventDetails.put(EVENT_VM_REBOOT, VirtualMachine.class.getName());
|
||||
entityEventDetails.put(EVENT_VM_UPDATE, VirtualMachine.class.getName());
|
||||
entityEventDetails.put(EVENT_VM_UPGRADE, VirtualMachine.class.getName());
|
||||
entityEventDetails.put(EVENT_VM_RESETPASSWORD, VirtualMachine.class.getName());
|
||||
entityEventDetails.put(EVENT_VM_MIGRATE, VirtualMachine.class.getName());
|
||||
entityEventDetails.put(EVENT_VM_MOVE, VirtualMachine.class.getName());
|
||||
entityEventDetails.put(EVENT_VM_RESTORE, VirtualMachine.class.getName());
|
||||
|
||||
entityEventDetails.put(EVENT_ROUTER_CREATE, VirtualRouter.class.getName());
|
||||
entityEventDetails.put(EVENT_ROUTER_DESTROY, VirtualRouter.class.getName());
|
||||
entityEventDetails.put(EVENT_ROUTER_START, VirtualRouter.class.getName());
|
||||
entityEventDetails.put(EVENT_ROUTER_STOP, VirtualRouter.class.getName());
|
||||
entityEventDetails.put(EVENT_ROUTER_REBOOT, VirtualRouter.class.getName());
|
||||
entityEventDetails.put(EVENT_ROUTER_HA, VirtualRouter.class.getName());
|
||||
entityEventDetails.put(EVENT_ROUTER_UPGRADE, VirtualRouter.class.getName());
|
||||
|
||||
entityEventDetails.put(EVENT_PROXY_CREATE, "ConsoleProxy");
|
||||
entityEventDetails.put(EVENT_PROXY_DESTROY, "ConsoleProxy");
|
||||
entityEventDetails.put(EVENT_PROXY_START, "ConsoleProxy");
|
||||
entityEventDetails.put(EVENT_PROXY_STOP, "ConsoleProxy");
|
||||
entityEventDetails.put(EVENT_PROXY_REBOOT, "ConsoleProxy");
|
||||
entityEventDetails.put(EVENT_ROUTER_HA, "ConsoleProxy");
|
||||
entityEventDetails.put(EVENT_PROXY_HA, "ConsoleProxy");
|
||||
|
||||
entityEventDetails.put(EVENT_VNC_CONNECT, "VNC");
|
||||
entityEventDetails.put(EVENT_VNC_DISCONNECT, "VNC");
|
||||
|
||||
// Network Events
|
||||
entityEventDetails.put(EVENT_NETWORK_CREATE, Network.class.getName());
|
||||
entityEventDetails.put(EVENT_NETWORK_DELETE, Network.class.getName());
|
||||
entityEventDetails.put(EVENT_NETWORK_UPDATE, Network.class.getName());
|
||||
entityEventDetails.put(EVENT_NETWORK_RESTART, Network.class.getName());
|
||||
entityEventDetails.put(EVENT_NET_IP_ASSIGN, PublicIpAddress.class.getName());
|
||||
entityEventDetails.put(EVENT_NET_IP_RELEASE, PublicIpAddress.class.getName());
|
||||
entityEventDetails.put(EVENT_NET_RULE_ADD, Network.class.getName());
|
||||
entityEventDetails.put(EVENT_NET_RULE_DELETE, Network.class.getName());
|
||||
entityEventDetails.put(EVENT_NET_RULE_MODIFY, Network.class.getName());
|
||||
entityEventDetails.put(EVENT_FIREWALL_OPEN, Network.class.getName());
|
||||
entityEventDetails.put(EVENT_FIREWALL_CLOSE, Network.class.getName());
|
||||
|
||||
// Load Balancers
|
||||
entityEventDetails.put(EVENT_ASSIGN_TO_LOAD_BALANCER_RULE, LoadBalancer.class.getName());
|
||||
entityEventDetails.put(EVENT_REMOVE_FROM_LOAD_BALANCER_RULE, LoadBalancer.class.getName());
|
||||
entityEventDetails.put(EVENT_LOAD_BALANCER_CREATE, LoadBalancer.class.getName());
|
||||
entityEventDetails.put(EVENT_LOAD_BALANCER_DELETE, LoadBalancer.class.getName());
|
||||
entityEventDetails.put(EVENT_LB_STICKINESSPOLICY_CREATE, LoadBalancer.class.getName());
|
||||
entityEventDetails.put(EVENT_LB_STICKINESSPOLICY_DELETE, LoadBalancer.class.getName());
|
||||
entityEventDetails.put(EVENT_LOAD_BALANCER_UPDATE, LoadBalancer.class.getName());
|
||||
|
||||
// Account events
|
||||
entityEventDetails.put(EVENT_ACCOUNT_DISABLE, Account.class.getName());
|
||||
entityEventDetails.put(EVENT_ACCOUNT_CREATE, Account.class.getName());
|
||||
entityEventDetails.put(EVENT_ACCOUNT_DELETE, Account.class.getName());
|
||||
entityEventDetails.put(EVENT_ACCOUNT_MARK_DEFAULT_ZONE, Account.class.getName());
|
||||
|
||||
// UserVO Events
|
||||
entityEventDetails.put(EVENT_USER_LOGIN, User.class.getName());
|
||||
entityEventDetails.put(EVENT_USER_LOGOUT, User.class.getName());
|
||||
entityEventDetails.put(EVENT_USER_CREATE, User.class.getName());
|
||||
entityEventDetails.put(EVENT_USER_DELETE, User.class.getName());
|
||||
entityEventDetails.put(EVENT_USER_DISABLE, User.class.getName());
|
||||
entityEventDetails.put(EVENT_USER_UPDATE, User.class.getName());
|
||||
entityEventDetails.put(EVENT_USER_ENABLE, User.class.getName());
|
||||
entityEventDetails.put(EVENT_USER_LOCK, User.class.getName());
|
||||
|
||||
// Template Events
|
||||
entityEventDetails.put(EVENT_TEMPLATE_CREATE, VirtualMachineTemplate.class.getName());
|
||||
entityEventDetails.put(EVENT_TEMPLATE_DELETE, VirtualMachineTemplate.class.getName());
|
||||
entityEventDetails.put(EVENT_TEMPLATE_UPDATE, VirtualMachineTemplate.class.getName());
|
||||
entityEventDetails.put(EVENT_TEMPLATE_DOWNLOAD_START, VirtualMachineTemplate.class.getName());
|
||||
entityEventDetails.put(EVENT_TEMPLATE_DOWNLOAD_SUCCESS, VirtualMachineTemplate.class.getName());
|
||||
entityEventDetails.put(EVENT_TEMPLATE_DOWNLOAD_FAILED, VirtualMachineTemplate.class.getName());
|
||||
entityEventDetails.put(EVENT_TEMPLATE_COPY, VirtualMachineTemplate.class.getName());
|
||||
entityEventDetails.put(EVENT_TEMPLATE_EXTRACT, VirtualMachineTemplate.class.getName());
|
||||
entityEventDetails.put(EVENT_TEMPLATE_UPLOAD, VirtualMachineTemplate.class.getName());
|
||||
entityEventDetails.put(EVENT_TEMPLATE_CLEANUP, VirtualMachineTemplate.class.getName());
|
||||
|
||||
// Volume Events
|
||||
entityEventDetails.put(EVENT_VOLUME_CREATE, Volume.class.getName());
|
||||
entityEventDetails.put(EVENT_VOLUME_DELETE, Volume.class.getName());
|
||||
entityEventDetails.put(EVENT_VOLUME_ATTACH, Volume.class.getName());
|
||||
entityEventDetails.put(EVENT_VOLUME_DETACH, Volume.class.getName());
|
||||
entityEventDetails.put(EVENT_VOLUME_EXTRACT, Volume.class.getName());
|
||||
entityEventDetails.put(EVENT_VOLUME_UPLOAD, Volume.class.getName());
|
||||
entityEventDetails.put(EVENT_VOLUME_MIGRATE, Volume.class.getName());
|
||||
entityEventDetails.put(EVENT_VOLUME_RESIZE, Volume.class.getName());
|
||||
|
||||
// Domains
|
||||
entityEventDetails.put(EVENT_DOMAIN_CREATE, Domain.class.getName());
|
||||
entityEventDetails.put(EVENT_DOMAIN_DELETE, Domain.class.getName());
|
||||
entityEventDetails.put(EVENT_DOMAIN_UPDATE, Domain.class.getName());
|
||||
|
||||
// Snapshots
|
||||
entityEventDetails.put(EVENT_SNAPSHOT_CREATE, Snapshot.class.getName());
|
||||
entityEventDetails.put(EVENT_SNAPSHOT_DELETE, Snapshot.class.getName());
|
||||
entityEventDetails.put(EVENT_SNAPSHOT_POLICY_CREATE, Snapshot.class.getName());
|
||||
entityEventDetails.put(EVENT_SNAPSHOT_POLICY_UPDATE, Snapshot.class.getName());
|
||||
entityEventDetails.put(EVENT_SNAPSHOT_POLICY_DELETE, Snapshot.class.getName());
|
||||
|
||||
// ISO
|
||||
entityEventDetails.put(EVENT_ISO_CREATE, "Iso");
|
||||
entityEventDetails.put(EVENT_ISO_DELETE, "Iso");
|
||||
entityEventDetails.put(EVENT_ISO_COPY, "Iso");
|
||||
entityEventDetails.put(EVENT_ISO_ATTACH, "Iso");
|
||||
entityEventDetails.put(EVENT_ISO_DETACH, "Iso");
|
||||
entityEventDetails.put(EVENT_ISO_EXTRACT, "Iso");
|
||||
entityEventDetails.put(EVENT_ISO_UPLOAD, "Iso");
|
||||
|
||||
// SSVM
|
||||
entityEventDetails.put(EVENT_SSVM_CREATE, "SecondaryStorageVm");
|
||||
entityEventDetails.put(EVENT_SSVM_DESTROY, "SecondaryStorageVm");
|
||||
entityEventDetails.put(EVENT_SSVM_START, "SecondaryStorageVm");
|
||||
entityEventDetails.put(EVENT_SSVM_STOP, "SecondaryStorageVm");
|
||||
entityEventDetails.put(EVENT_SSVM_REBOOT, "SecondaryStorageVm");
|
||||
entityEventDetails.put(EVENT_SSVM_HA, "SecondaryStorageVm");
|
||||
|
||||
// Service Offerings
|
||||
entityEventDetails.put(EVENT_SERVICE_OFFERING_CREATE, ServiceOffering.class.getName());
|
||||
entityEventDetails.put(EVENT_SERVICE_OFFERING_EDIT, ServiceOffering.class.getName());
|
||||
entityEventDetails.put(EVENT_SERVICE_OFFERING_DELETE, ServiceOffering.class.getName());
|
||||
|
||||
// Disk Offerings
|
||||
entityEventDetails.put(EVENT_DISK_OFFERING_CREATE, DiskOffering.class.getName());
|
||||
entityEventDetails.put(EVENT_DISK_OFFERING_EDIT, DiskOffering.class.getName());
|
||||
entityEventDetails.put(EVENT_DISK_OFFERING_DELETE, DiskOffering.class.getName());
|
||||
|
||||
// Network offerings
|
||||
entityEventDetails.put(EVENT_NETWORK_OFFERING_CREATE, NetworkOffering.class.getName());
|
||||
entityEventDetails.put(EVENT_NETWORK_OFFERING_ASSIGN, NetworkOffering.class.getName());
|
||||
entityEventDetails.put(EVENT_NETWORK_OFFERING_EDIT, NetworkOffering.class.getName());
|
||||
entityEventDetails.put(EVENT_NETWORK_OFFERING_REMOVE, NetworkOffering.class.getName());
|
||||
entityEventDetails.put(EVENT_NETWORK_OFFERING_DELETE, NetworkOffering.class.getName());
|
||||
|
||||
// Pods
|
||||
entityEventDetails.put(EVENT_POD_CREATE, Pod.class.getName());
|
||||
entityEventDetails.put(EVENT_POD_EDIT, Pod.class.getName());
|
||||
entityEventDetails.put(EVENT_POD_DELETE, Pod.class.getName());
|
||||
|
||||
// Zones
|
||||
entityEventDetails.put(EVENT_ZONE_CREATE, DataCenter.class.getName());
|
||||
entityEventDetails.put(EVENT_ZONE_EDIT, DataCenter.class.getName());
|
||||
entityEventDetails.put(EVENT_ZONE_DELETE, DataCenter.class.getName());
|
||||
|
||||
// VLANs/IP ranges
|
||||
entityEventDetails.put(EVENT_VLAN_IP_RANGE_CREATE, Vlan.class.getName());
|
||||
entityEventDetails.put(EVENT_VLAN_IP_RANGE_DELETE,Vlan.class.getName());
|
||||
|
||||
entityEventDetails.put(EVENT_STORAGE_IP_RANGE_CREATE, StorageNetworkIpRange.class.getName());
|
||||
entityEventDetails.put(EVENT_STORAGE_IP_RANGE_DELETE, StorageNetworkIpRange.class.getName());
|
||||
entityEventDetails.put(EVENT_STORAGE_IP_RANGE_UPDATE, StorageNetworkIpRange.class.getName());
|
||||
|
||||
// Configuration Table
|
||||
entityEventDetails.put(EVENT_CONFIGURATION_VALUE_EDIT, Configuration.class.getName());
|
||||
|
||||
// Security Groups
|
||||
entityEventDetails.put(EVENT_SECURITY_GROUP_AUTHORIZE_INGRESS, SecurityGroup.class.getName());
|
||||
entityEventDetails.put(EVENT_SECURITY_GROUP_REVOKE_INGRESS, SecurityGroup.class.getName());
|
||||
entityEventDetails.put(EVENT_SECURITY_GROUP_AUTHORIZE_EGRESS, SecurityGroup.class.getName());
|
||||
entityEventDetails.put(EVENT_SECURITY_GROUP_REVOKE_EGRESS, SecurityGroup.class.getName());
|
||||
entityEventDetails.put(EVENT_SECURITY_GROUP_CREATE, SecurityGroup.class.getName());
|
||||
entityEventDetails.put(EVENT_SECURITY_GROUP_DELETE, SecurityGroup.class.getName());
|
||||
entityEventDetails.put(EVENT_SECURITY_GROUP_ASSIGN, SecurityGroup.class.getName());
|
||||
entityEventDetails.put(EVENT_SECURITY_GROUP_REMOVE, SecurityGroup.class.getName());
|
||||
|
||||
// Host
|
||||
entityEventDetails.put(EVENT_HOST_RECONNECT, Host.class.getName());
|
||||
|
||||
// Maintenance
|
||||
entityEventDetails.put(EVENT_MAINTENANCE_CANCEL, Host.class.getName());
|
||||
entityEventDetails.put(EVENT_MAINTENANCE_CANCEL_PRIMARY_STORAGE, Host.class.getName());
|
||||
entityEventDetails.put(EVENT_MAINTENANCE_PREPARE, Host.class.getName());
|
||||
entityEventDetails.put(EVENT_MAINTENANCE_PREPARE_PRIMARY_STORAGE, Host.class.getName());
|
||||
|
||||
// VPN
|
||||
entityEventDetails.put(EVENT_REMOTE_ACCESS_VPN_CREATE, RemoteAccessVpn.class.getName());
|
||||
entityEventDetails.put(EVENT_REMOTE_ACCESS_VPN_DESTROY, RemoteAccessVpn.class.getName());
|
||||
entityEventDetails.put(EVENT_VPN_USER_ADD, RemoteAccessVpn.class.getName());
|
||||
entityEventDetails.put(EVENT_VPN_USER_REMOVE, RemoteAccessVpn.class.getName());
|
||||
entityEventDetails.put(EVENT_S2S_VPN_GATEWAY_CREATE, RemoteAccessVpn.class.getName());
|
||||
entityEventDetails.put(EVENT_S2S_VPN_GATEWAY_DELETE, RemoteAccessVpn.class.getName());
|
||||
entityEventDetails.put(EVENT_S2S_VPN_CUSTOMER_GATEWAY_CREATE, RemoteAccessVpn.class.getName());
|
||||
entityEventDetails.put(EVENT_S2S_VPN_CUSTOMER_GATEWAY_DELETE, RemoteAccessVpn.class.getName());
|
||||
entityEventDetails.put(EVENT_S2S_VPN_CUSTOMER_GATEWAY_UPDATE, RemoteAccessVpn.class.getName());
|
||||
entityEventDetails.put(EVENT_S2S_VPN_CONNECTION_CREATE, RemoteAccessVpn.class.getName());
|
||||
entityEventDetails.put(EVENT_S2S_VPN_CONNECTION_DELETE, RemoteAccessVpn.class.getName());
|
||||
entityEventDetails.put(EVENT_S2S_VPN_CONNECTION_RESET, RemoteAccessVpn.class.getName());
|
||||
|
||||
// Custom certificates
|
||||
entityEventDetails.put(EVENT_UPLOAD_CUSTOM_CERTIFICATE, "Certificate");
|
||||
|
||||
// OneToOnenat
|
||||
entityEventDetails.put(EVENT_ENABLE_STATIC_NAT, StaticNat.class.getName());
|
||||
entityEventDetails.put(EVENT_DISABLE_STATIC_NAT, StaticNat.class.getName());
|
||||
|
||||
entityEventDetails.put(EVENT_ZONE_VLAN_ASSIGN,Vlan.class.getName());
|
||||
entityEventDetails.put(EVENT_ZONE_VLAN_RELEASE,Vlan.class.getName());
|
||||
|
||||
// Projects
|
||||
entityEventDetails.put(EVENT_PROJECT_CREATE, Project.class.getName());
|
||||
entityEventDetails.put(EVENT_PROJECT_UPDATE, Project.class.getName());
|
||||
entityEventDetails.put(EVENT_PROJECT_DELETE, Project.class.getName());
|
||||
entityEventDetails.put(EVENT_PROJECT_ACTIVATE, Project.class.getName());
|
||||
entityEventDetails.put(EVENT_PROJECT_SUSPEND, Project.class.getName());
|
||||
entityEventDetails.put(EVENT_PROJECT_ACCOUNT_ADD, Project.class.getName());
|
||||
entityEventDetails.put(EVENT_PROJECT_INVITATION_UPDATE, Project.class.getName());
|
||||
entityEventDetails.put(EVENT_PROJECT_INVITATION_REMOVE, Project.class.getName());
|
||||
entityEventDetails.put(EVENT_PROJECT_ACCOUNT_REMOVE, Project.class.getName());
|
||||
|
||||
// Network as a Service
|
||||
entityEventDetails.put(EVENT_NETWORK_ELEMENT_CONFIGURE,Network.class.getName());
|
||||
|
||||
// Physical Network Events
|
||||
entityEventDetails.put(EVENT_PHYSICAL_NETWORK_CREATE, PhysicalNetwork.class.getName());
|
||||
entityEventDetails.put(EVENT_PHYSICAL_NETWORK_DELETE, PhysicalNetwork.class.getName());
|
||||
entityEventDetails.put(EVENT_PHYSICAL_NETWORK_UPDATE, PhysicalNetwork.class.getName());
|
||||
|
||||
// Physical Network Service Provider Events
|
||||
entityEventDetails.put(EVENT_SERVICE_PROVIDER_CREATE, PhysicalNetworkServiceProvider.class.getName());
|
||||
entityEventDetails.put(EVENT_SERVICE_PROVIDER_DELETE, PhysicalNetworkServiceProvider.class.getName());
|
||||
entityEventDetails.put(EVENT_SERVICE_PROVIDER_UPDATE, PhysicalNetworkServiceProvider.class.getName());
|
||||
|
||||
// Physical Network TrafficType Events
|
||||
entityEventDetails.put(EVENT_TRAFFIC_TYPE_CREATE, PhysicalNetworkTrafficType.class.getName());
|
||||
entityEventDetails.put(EVENT_TRAFFIC_TYPE_DELETE, PhysicalNetworkTrafficType.class.getName());
|
||||
entityEventDetails.put(EVENT_TRAFFIC_TYPE_UPDATE, PhysicalNetworkTrafficType.class.getName());
|
||||
|
||||
// external network device events
|
||||
entityEventDetails.put(EVENT_EXTERNAL_LB_DEVICE_ADD, PhysicalNetwork.class.getName());
|
||||
entityEventDetails.put(EVENT_EXTERNAL_LB_DEVICE_DELETE, PhysicalNetwork.class.getName());
|
||||
entityEventDetails.put(EVENT_EXTERNAL_LB_DEVICE_CONFIGURE, PhysicalNetwork.class.getName());
|
||||
|
||||
// external switch management device events (E.g.: Cisco Nexus 1000v Virtual Supervisor Module.
|
||||
entityEventDetails.put(EVENT_EXTERNAL_SWITCH_MGMT_DEVICE_ADD, "Nexus1000v");
|
||||
entityEventDetails.put(EVENT_EXTERNAL_SWITCH_MGMT_DEVICE_DELETE, "Nexus1000v");
|
||||
entityEventDetails.put(EVENT_EXTERNAL_SWITCH_MGMT_DEVICE_CONFIGURE, "Nexus1000v");
|
||||
entityEventDetails.put(EVENT_EXTERNAL_SWITCH_MGMT_DEVICE_ENABLE, "Nexus1000v");
|
||||
entityEventDetails.put(EVENT_EXTERNAL_SWITCH_MGMT_DEVICE_DISABLE, "Nexus1000v");
|
||||
|
||||
|
||||
entityEventDetails.put(EVENT_EXTERNAL_FIREWALL_DEVICE_ADD, PhysicalNetwork.class.getName());
|
||||
entityEventDetails.put(EVENT_EXTERNAL_FIREWALL_DEVICE_DELETE, PhysicalNetwork.class.getName());
|
||||
entityEventDetails.put(EVENT_EXTERNAL_FIREWALL_DEVICE_CONFIGURE, PhysicalNetwork.class.getName());
|
||||
|
||||
// VPC
|
||||
entityEventDetails.put(EVENT_VPC_CREATE, Vpc.class.getName());
|
||||
entityEventDetails.put(EVENT_VPC_UPDATE, Vpc.class.getName());
|
||||
entityEventDetails.put(EVENT_VPC_DELETE, Vpc.class.getName());
|
||||
entityEventDetails.put(EVENT_VPC_RESTART, Vpc.class.getName());
|
||||
|
||||
// VPC offerings
|
||||
entityEventDetails.put(EVENT_VPC_OFFERING_CREATE, Vpc.class.getName());
|
||||
entityEventDetails.put(EVENT_VPC_OFFERING_UPDATE, Vpc.class.getName());
|
||||
entityEventDetails.put(EVENT_VPC_OFFERING_DELETE, Vpc.class.getName());
|
||||
|
||||
// Private gateway
|
||||
entityEventDetails.put(EVENT_PRIVATE_GATEWAY_CREATE, PrivateGateway.class.getName());
|
||||
entityEventDetails.put(EVENT_PRIVATE_GATEWAY_DELETE, PrivateGateway.class.getName());
|
||||
|
||||
// Static routes
|
||||
entityEventDetails.put(EVENT_STATIC_ROUTE_CREATE, StaticRoute.class.getName());
|
||||
entityEventDetails.put(EVENT_STATIC_ROUTE_DELETE, StaticRoute.class.getName());
|
||||
|
||||
// tag related events
|
||||
entityEventDetails.put(EVENT_TAGS_CREATE, "Tag");
|
||||
entityEventDetails.put(EVENT_TAGS_DELETE, "tag");
|
||||
|
||||
// external network device events
|
||||
entityEventDetails.put(EVENT_EXTERNAL_NVP_CONTROLLER_ADD, "NvpController");
|
||||
entityEventDetails.put(EVENT_EXTERNAL_NVP_CONTROLLER_DELETE, "NvpController");
|
||||
entityEventDetails.put(EVENT_EXTERNAL_NVP_CONTROLLER_CONFIGURE, "NvpController");
|
||||
|
||||
// AutoScale
|
||||
entityEventDetails.put(EVENT_COUNTER_CREATE, AutoScaleCounter.class.getName());
|
||||
entityEventDetails.put(EVENT_COUNTER_DELETE, AutoScaleCounter.class.getName());
|
||||
entityEventDetails.put(EVENT_CONDITION_CREATE, Condition.class.getName());
|
||||
entityEventDetails.put(EVENT_CONDITION_DELETE, Condition.class.getName());
|
||||
entityEventDetails.put(EVENT_AUTOSCALEPOLICY_CREATE, AutoScalePolicy.class.getName());
|
||||
entityEventDetails.put(EVENT_AUTOSCALEPOLICY_UPDATE, AutoScalePolicy.class.getName());
|
||||
entityEventDetails.put(EVENT_AUTOSCALEPOLICY_DELETE, AutoScalePolicy.class.getName());
|
||||
entityEventDetails.put(EVENT_AUTOSCALEVMPROFILE_CREATE, AutoScaleVmProfile.class.getName());
|
||||
entityEventDetails.put(EVENT_AUTOSCALEVMPROFILE_DELETE, AutoScaleVmProfile.class.getName());
|
||||
entityEventDetails.put(EVENT_AUTOSCALEVMPROFILE_UPDATE, AutoScaleVmProfile.class.getName());
|
||||
entityEventDetails.put(EVENT_AUTOSCALEVMGROUP_CREATE, AutoScaleVmGroup.class.getName());
|
||||
entityEventDetails.put(EVENT_AUTOSCALEVMGROUP_DELETE, AutoScaleVmGroup.class.getName());
|
||||
entityEventDetails.put(EVENT_AUTOSCALEVMGROUP_UPDATE, AutoScaleVmGroup.class.getName());
|
||||
entityEventDetails.put(EVENT_AUTOSCALEVMGROUP_ENABLE, AutoScaleVmGroup.class.getName());
|
||||
entityEventDetails.put(EVENT_AUTOSCALEVMGROUP_DISABLE, AutoScaleVmGroup.class.getName());
|
||||
}
|
||||
|
||||
public static String getEntityForEvent (String eventName) {
|
||||
String entityClassName = entityEventDetails.get(eventName);
|
||||
if (entityClassName == null || entityClassName.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
int index = entityClassName.lastIndexOf(".");
|
||||
String entityName = entityClassName;
|
||||
if (index != -1) {
|
||||
entityName = entityClassName.substring(index+1);
|
||||
}
|
||||
return entityName;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
package com.cloud.exception;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import com.cloud.utils.exception.CSExceptionErrorCode;
|
||||
|
||||
/**
|
||||
|
|
@ -54,7 +55,6 @@ public class CloudException extends Exception {
|
|||
return;
|
||||
}
|
||||
|
||||
|
||||
public ArrayList<String> getIdProxyList() {
|
||||
return idList;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ package com.cloud.exception;
|
|||
import java.util.List;
|
||||
|
||||
import org.apache.cloudstack.acl.ControlledEntity;
|
||||
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.utils.SerialVersionUID;
|
||||
import com.cloud.utils.exception.CloudRuntimeException;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,42 @@
|
|||
// 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.exception;
|
||||
|
||||
import com.cloud.utils.SerialVersionUID;
|
||||
import com.cloud.utils.exception.CloudRuntimeException;
|
||||
|
||||
/**
|
||||
* Exception thrown if number of requests is over api rate limit set.
|
||||
*
|
||||
*/
|
||||
public class RequestLimitException extends CloudRuntimeException {
|
||||
|
||||
private static final long serialVersionUID = SerialVersionUID.AccountLimitException;
|
||||
|
||||
protected RequestLimitException() {
|
||||
super();
|
||||
}
|
||||
|
||||
public RequestLimitException(String msg) {
|
||||
super(msg);
|
||||
}
|
||||
|
||||
public RequestLimitException(String msg, Throwable cause) {
|
||||
super(msg, cause);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -18,11 +18,12 @@ package com.cloud.host;
|
|||
|
||||
import java.util.Date;
|
||||
|
||||
import org.apache.cloudstack.api.Identity;
|
||||
import org.apache.cloudstack.api.InternalIdentity;
|
||||
|
||||
import com.cloud.hypervisor.Hypervisor.HypervisorType;
|
||||
import com.cloud.resource.ResourceState;
|
||||
import com.cloud.utils.fsm.StateObject;
|
||||
import org.apache.cloudstack.api.Identity;
|
||||
import org.apache.cloudstack.api.InternalIdentity;
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -39,6 +40,8 @@ public interface Host extends StateObject<Status>, Identity, InternalIdentity {
|
|||
ExternalLoadBalancer(false),
|
||||
ExternalVirtualSwitchSupervisor(false),
|
||||
PxeServer(false),
|
||||
BaremetalPxe(false),
|
||||
BaremetalDhcp(false),
|
||||
TrafficMonitor(false),
|
||||
|
||||
ExternalDhcp(false),
|
||||
|
|
|
|||
|
|
@ -16,10 +16,11 @@
|
|||
// under the License.
|
||||
package com.cloud.hypervisor;
|
||||
|
||||
import com.cloud.hypervisor.Hypervisor.HypervisorType;
|
||||
import org.apache.cloudstack.api.Identity;
|
||||
import org.apache.cloudstack.api.InternalIdentity;
|
||||
|
||||
import com.cloud.hypervisor.Hypervisor.HypervisorType;
|
||||
|
||||
|
||||
/**
|
||||
* HypervisorCapability represents one particular hypervisor version's capabilities.
|
||||
|
|
@ -45,4 +46,10 @@ public interface HypervisorCapabilities extends Identity, InternalIdentity{
|
|||
* @return the max. data volumes per VM supported by hypervisor
|
||||
*/
|
||||
Integer getMaxDataVolumesLimit();
|
||||
|
||||
/**
|
||||
* @return the max. hosts per cluster supported by hypervisor
|
||||
*/
|
||||
Integer getMaxHostsPerCluster();
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,10 +19,11 @@ package com.cloud.network;
|
|||
import java.util.Date;
|
||||
|
||||
import org.apache.cloudstack.acl.ControlledEntity;
|
||||
import com.cloud.utils.net.Ip;
|
||||
import org.apache.cloudstack.api.Identity;
|
||||
import org.apache.cloudstack.api.InternalIdentity;
|
||||
|
||||
import com.cloud.utils.net.Ip;
|
||||
|
||||
/**
|
||||
*
|
||||
* - Allocated = null
|
||||
|
|
|
|||
|
|
@ -16,24 +16,36 @@
|
|||
// under the License.
|
||||
package com.cloud.network;
|
||||
|
||||
import java.net.URI;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.cloudstack.acl.ControlledEntity;
|
||||
import org.apache.cloudstack.api.Identity;
|
||||
import org.apache.cloudstack.api.InternalIdentity;
|
||||
|
||||
import com.cloud.network.Networks.BroadcastDomainType;
|
||||
import com.cloud.network.Networks.Mode;
|
||||
import com.cloud.network.Networks.TrafficType;
|
||||
import com.cloud.utils.fsm.FiniteState;
|
||||
import com.cloud.utils.fsm.StateMachine;
|
||||
import com.cloud.network.Networks.BroadcastDomainType;
|
||||
import com.cloud.network.Networks.Mode;
|
||||
import com.cloud.network.Networks.TrafficType;
|
||||
import com.cloud.utils.fsm.StateMachine2;
|
||||
import com.cloud.utils.fsm.StateObject;
|
||||
|
||||
import org.apache.cloudstack.acl.ControlledEntity;
|
||||
import org.apache.cloudstack.api.Identity;
|
||||
import org.apache.cloudstack.api.InternalIdentity;
|
||||
|
||||
import java.net.URI;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* owned by an account.
|
||||
*/
|
||||
public interface Network extends ControlledEntity, InternalIdentity, Identity {
|
||||
public interface Network extends ControlledEntity, StateObject<Network.State>, InternalIdentity, Identity {
|
||||
|
||||
public enum GuestType {
|
||||
Shared,
|
||||
|
|
@ -48,7 +60,7 @@ public interface Network extends ControlledEntity, InternalIdentity, Identity {
|
|||
public static final Service Dns = new Service("Dns", Capability.AllowDnsSuffixModification);
|
||||
public static final Service Gateway = new Service("Gateway");
|
||||
public static final Service Firewall = new Service("Firewall", Capability.SupportedProtocols,
|
||||
Capability.MultipleIps, Capability.TrafficStatistics);
|
||||
Capability.MultipleIps, Capability.TrafficStatistics, Capability.SupportedTrafficDirection, Capability.SupportedEgressProtocols);
|
||||
public static final Service Lb = new Service("Lb", Capability.SupportedLBAlgorithms, Capability.SupportedLBIsolation,
|
||||
Capability.SupportedProtocols, Capability.TrafficStatistics, Capability.LoadBalancingSupportedIps,
|
||||
Capability.SupportedStickinessMethods, Capability.ElasticLb);
|
||||
|
|
@ -123,10 +135,12 @@ public interface Network extends ControlledEntity, InternalIdentity, Identity {
|
|||
public static final Provider SecurityGroupProvider = new Provider("SecurityGroupProvider", false);
|
||||
public static final Provider VPCVirtualRouter = new Provider("VpcVirtualRouter", false);
|
||||
public static final Provider None = new Provider("None", false);
|
||||
public static final Provider NiciraNvp = new Provider("NiciraNvp", true);
|
||||
// NiciraNvp is not an "External" provider, otherwise we get in trouble with NetworkServiceImpl.providersConfiguredForExternalNetworking
|
||||
public static final Provider NiciraNvp = new Provider("NiciraNvp", false);
|
||||
public static final Provider MidokuraMidonet = new Provider("MidokuraMidonet", true);
|
||||
public static final Provider VPCNetscaler = new Provider("VPCNetscaler", true);
|
||||
public static final Provider CiscoVnmc = new Provider("CiscoVnmc", true);
|
||||
|
||||
|
||||
private String name;
|
||||
private boolean isExternal;
|
||||
|
||||
|
|
@ -174,6 +188,8 @@ public interface Network extends ControlledEntity, InternalIdentity, Identity {
|
|||
public static final Capability ElasticLb = new Capability("ElasticLb");
|
||||
public static final Capability AutoScaleCounters = new Capability("AutoScaleCounters");
|
||||
public static final Capability InlineMode = new Capability("InlineMode");
|
||||
public static final Capability SupportedTrafficDirection = new Capability("SupportedTrafficDirection");
|
||||
public static final Capability SupportedEgressProtocols = new Capability("SupportedEgressProtocols");
|
||||
|
||||
private String name;
|
||||
|
||||
|
|
@ -203,7 +219,8 @@ public interface Network extends ControlledEntity, InternalIdentity, Identity {
|
|||
OperationFailed;
|
||||
}
|
||||
|
||||
enum State implements FiniteState<State, Event> {
|
||||
public enum State {
|
||||
|
||||
Allocated("Indicates the network configuration is in allocated but not setup"),
|
||||
Setup("Indicates the network configuration is setup"),
|
||||
Implementing("Indicates the network configuration is being implemented"),
|
||||
|
|
@ -211,39 +228,8 @@ public interface Network extends ControlledEntity, InternalIdentity, Identity {
|
|||
Shutdown("Indicates the network configuration is being destroyed"),
|
||||
Destroy("Indicates that the network is destroyed");
|
||||
|
||||
protected static final StateMachine2<State, Network.Event, Network> s_fsm = new StateMachine2<State, Network.Event, Network>();
|
||||
|
||||
@Override
|
||||
public StateMachine<State, Event> getStateMachine() {
|
||||
return s_fsm;
|
||||
}
|
||||
|
||||
@Override
|
||||
public State getNextState(Event event) {
|
||||
return s_fsm.getNextState(this, event);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<State> getFromStates(Event event) {
|
||||
return s_fsm.getFromStates(this, event);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<Event> getPossibleEvents() {
|
||||
return s_fsm.getPossibleEvents(this);
|
||||
}
|
||||
|
||||
String _description;
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return _description;
|
||||
}
|
||||
|
||||
private State(String description) {
|
||||
_description = description;
|
||||
}
|
||||
|
||||
private static StateMachine<State, Event> s_fsm = new StateMachine<State, Event>();
|
||||
static {
|
||||
s_fsm.addTransition(State.Allocated, Event.ImplementNetwork, State.Implementing);
|
||||
s_fsm.addTransition(State.Implementing, Event.OperationSucceeded, State.Implemented);
|
||||
|
|
@ -252,8 +238,43 @@ public interface Network extends ControlledEntity, InternalIdentity, Identity {
|
|||
s_fsm.addTransition(State.Shutdown, Event.OperationSucceeded, State.Allocated);
|
||||
s_fsm.addTransition(State.Shutdown, Event.OperationFailed, State.Implemented);
|
||||
}
|
||||
|
||||
public static StateMachine2<State, Network.Event, Network> getStateMachine() {
|
||||
return s_fsm;
|
||||
}
|
||||
|
||||
String _description;
|
||||
private State(String description) {
|
||||
_description = description;
|
||||
}
|
||||
}
|
||||
|
||||
public class IpAddresses {
|
||||
private String ip4Address;
|
||||
private String ip6Address;
|
||||
|
||||
public IpAddresses(String ip4Address, String ip6Address) {
|
||||
this.setIp4Address(ip4Address);
|
||||
this.setIp6Address(ip6Address);
|
||||
}
|
||||
|
||||
public String getIp4Address() {
|
||||
return ip4Address;
|
||||
}
|
||||
|
||||
public void setIp4Address(String ip4Address) {
|
||||
this.ip4Address = ip4Address;
|
||||
}
|
||||
|
||||
public String getIp6Address() {
|
||||
return ip6Address;
|
||||
}
|
||||
|
||||
public void setIp6Address(String ip6Address) {
|
||||
this.ip6Address = ip6Address;
|
||||
}
|
||||
}
|
||||
|
||||
String getName();
|
||||
|
||||
Mode getMode();
|
||||
|
|
@ -264,8 +285,21 @@ public interface Network extends ControlledEntity, InternalIdentity, Identity {
|
|||
|
||||
String getGateway();
|
||||
|
||||
// "cidr" is the Cloudstack managed address space, all CloudStack managed vms get IP address from "cidr",
|
||||
// In general "cidr" also serves as the network CIDR
|
||||
// But in case IP reservation is configured for a Guest network, "networkcidr" is the Effective network CIDR for that network,
|
||||
// "cidr" will still continue to be the effective address space for CloudStack managed vms in that Guest network
|
||||
String getCidr();
|
||||
|
||||
// "networkcidr" is the network CIDR of the guest network which uses IP reservation.
|
||||
// It is the summation of "cidr" and the reservedIPrange(the address space used for non CloudStack purposes).
|
||||
// For networks not configured with IP reservation, "networkcidr" is always null
|
||||
String getNetworkCidr();
|
||||
|
||||
String getIp6Gateway();
|
||||
|
||||
String getIp6Cidr();
|
||||
|
||||
long getDataCenterId();
|
||||
|
||||
long getNetworkOfferingId();
|
||||
|
|
@ -288,6 +322,8 @@ public interface Network extends ControlledEntity, InternalIdentity, Identity {
|
|||
|
||||
void setPhysicalNetworkId(Long physicalNetworkId);
|
||||
|
||||
public void setTrafficType(TrafficType type);
|
||||
|
||||
ACLType getAclType();
|
||||
|
||||
boolean isRestartRequired();
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
||||
package com.cloud.network;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import com.cloud.dc.Vlan;
|
||||
import com.cloud.exception.InsufficientAddressCapacityException;
|
||||
import com.cloud.exception.InvalidParameterValueException;
|
||||
import com.cloud.hypervisor.Hypervisor.HypervisorType;
|
||||
import com.cloud.network.Network.Capability;
|
||||
import com.cloud.network.Network.Provider;
|
||||
import com.cloud.network.Network.Service;
|
||||
import com.cloud.network.Networks.TrafficType;
|
||||
import com.cloud.network.element.NetworkElement;
|
||||
import com.cloud.network.element.UserDataServiceProvider;
|
||||
import com.cloud.offering.NetworkOffering;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.vm.Nic;
|
||||
import com.cloud.vm.NicProfile;
|
||||
import com.cloud.vm.VirtualMachine;
|
||||
|
||||
|
||||
/**
|
||||
* The NetworkModel presents a read-only view into the Network data such as L2 networks,
|
||||
* Nics, PublicIps, NetworkOfferings, traffic labels, physical networks and the like
|
||||
* The idea is that only the orchestration core should be able to modify the data, while other
|
||||
* participants in the orchestration can use this interface to query the data.
|
||||
*/
|
||||
public interface NetworkModel {
|
||||
|
||||
/**
|
||||
* Lists IP addresses that belong to VirtualNetwork VLANs
|
||||
*
|
||||
* @param accountId
|
||||
* - account that the IP address should belong to
|
||||
* @param associatedNetworkId
|
||||
* TODO
|
||||
* @param sourceNat
|
||||
* - (optional) true if the IP address should be a source NAT address
|
||||
* @return - list of IP addresses
|
||||
*/
|
||||
List<? extends IpAddress> listPublicIpsAssignedToGuestNtwk(long accountId, long associatedNetworkId, Boolean sourceNat);
|
||||
|
||||
List<? extends NetworkOffering> getSystemAccountNetworkOfferings(String... offeringNames);
|
||||
|
||||
List<? extends Nic> getNics(long vmId);
|
||||
|
||||
String getNextAvailableMacAddressInNetwork(long networkConfigurationId) throws InsufficientAddressCapacityException;
|
||||
|
||||
PublicIpAddress getPublicIpAddress(long ipAddressId);
|
||||
|
||||
List<? extends Vlan> listPodVlans(long podId);
|
||||
|
||||
List<? extends Network> listNetworksUsedByVm(long vmId, boolean isSystem);
|
||||
|
||||
Nic getNicInNetwork(long vmId, long networkId);
|
||||
|
||||
List<? extends Nic> getNicsForTraffic(long vmId, TrafficType type);
|
||||
|
||||
Network getDefaultNetworkForVm(long vmId);
|
||||
|
||||
Nic getDefaultNic(long vmId);
|
||||
|
||||
UserDataServiceProvider getUserDataUpdateProvider(Network network);
|
||||
|
||||
boolean networkIsConfiguredForExternalNetworking(long zoneId, long networkId);
|
||||
|
||||
Map<Capability, String> getNetworkServiceCapabilities(long networkId, Service service);
|
||||
|
||||
boolean areServicesSupportedByNetworkOffering(long networkOfferingId, Service... services);
|
||||
|
||||
Network getNetworkWithSecurityGroupEnabled(Long zoneId);
|
||||
|
||||
String getIpOfNetworkElementInVirtualNetwork(long accountId, long dataCenterId);
|
||||
|
||||
List<? extends Network> listNetworksForAccount(long accountId, long zoneId, Network.GuestType type);
|
||||
|
||||
List<? extends Network> listAllNetworksInAllZonesByType(Network.GuestType type);
|
||||
|
||||
String getGlobalGuestDomainSuffix();
|
||||
|
||||
String getStartIpAddress(long networkId);
|
||||
|
||||
String getIpInNetwork(long vmId, long networkId);
|
||||
|
||||
String getIpInNetworkIncludingRemoved(long vmId, long networkId);
|
||||
|
||||
Long getPodIdForVlan(long vlanDbId);
|
||||
|
||||
List<Long> listNetworkOfferingsForUpgrade(long networkId);
|
||||
|
||||
boolean isSecurityGroupSupportedInNetwork(Network network);
|
||||
|
||||
boolean isProviderSupportServiceInNetwork(long networkId, Service service, Provider provider);
|
||||
|
||||
boolean isProviderEnabledInPhysicalNetwork(long physicalNetowrkId, String providerName);
|
||||
|
||||
String getNetworkTag(HypervisorType hType, Network network);
|
||||
|
||||
List<Service> getElementServices(Provider provider);
|
||||
|
||||
boolean canElementEnableIndividualServices(Provider provider);
|
||||
|
||||
boolean areServicesSupportedInNetwork(long networkId, Service... services);
|
||||
|
||||
boolean isNetworkSystem(Network network);
|
||||
|
||||
Map<Capability, String> getNetworkOfferingServiceCapabilities(NetworkOffering offering, Service service);
|
||||
|
||||
Long getPhysicalNetworkId(Network network);
|
||||
|
||||
boolean getAllowSubdomainAccessGlobal();
|
||||
|
||||
boolean isProviderForNetwork(Provider provider, long networkId);
|
||||
|
||||
boolean isProviderForNetworkOffering(Provider provider, long networkOfferingId);
|
||||
|
||||
void canProviderSupportServices(Map<Provider, Set<Service>> providersMap);
|
||||
|
||||
List<PhysicalNetworkSetupInfo> getPhysicalNetworkInfo(long dcId, HypervisorType hypervisorType);
|
||||
|
||||
boolean canAddDefaultSecurityGroup();
|
||||
|
||||
List<Service> listNetworkOfferingServices(long networkOfferingId);
|
||||
|
||||
boolean areServicesEnabledInZone(long zoneId, NetworkOffering offering, List<Service> services);
|
||||
|
||||
Map<PublicIpAddress, Set<Service>> getIpToServices(List<? extends PublicIpAddress> publicIps, boolean rulesRevoked,
|
||||
boolean includingFirewall);
|
||||
|
||||
Map<Provider, ArrayList<PublicIpAddress>> getProviderToIpList(Network network, Map<PublicIpAddress, Set<Service>> ipToServices);
|
||||
|
||||
boolean checkIpForService(IpAddress ip, Service service, Long networkId);
|
||||
|
||||
void checkCapabilityForProvider(Set<Provider> providers, Service service, Capability cap, String capValue);
|
||||
|
||||
Provider getDefaultUniqueProviderForService(String serviceName);
|
||||
|
||||
void checkNetworkPermissions(Account owner, Network network);
|
||||
|
||||
String getDefaultManagementTrafficLabel(long zoneId, HypervisorType hypervisorType);
|
||||
|
||||
String getDefaultStorageTrafficLabel(long zoneId, HypervisorType hypervisorType);
|
||||
|
||||
String getDefaultPublicTrafficLabel(long dcId, HypervisorType vmware);
|
||||
|
||||
String getDefaultGuestTrafficLabel(long dcId, HypervisorType vmware);
|
||||
|
||||
/**
|
||||
* @param providerName
|
||||
* @return
|
||||
*/
|
||||
NetworkElement getElementImplementingProvider(String providerName);
|
||||
|
||||
/**
|
||||
* @param accountId
|
||||
* @param zoneId
|
||||
* @return
|
||||
*/
|
||||
String getAccountNetworkDomain(long accountId, long zoneId);
|
||||
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
String getDefaultNetworkDomain();
|
||||
|
||||
/**
|
||||
* @param ntwkOffId
|
||||
* @return
|
||||
*/
|
||||
List<Provider> getNtwkOffDistinctProviders(long ntwkOffId);
|
||||
|
||||
/**
|
||||
* @param accountId
|
||||
* @param dcId
|
||||
* @param sourceNat
|
||||
* @return
|
||||
*/
|
||||
List<? extends IpAddress> listPublicIpsAssignedToAccount(long accountId, long dcId, Boolean sourceNat);
|
||||
|
||||
/**
|
||||
* @param zoneId
|
||||
* @param trafficType
|
||||
* @return
|
||||
*/
|
||||
List<? extends PhysicalNetwork> getPhysicalNtwksSupportingTrafficType(long zoneId, TrafficType trafficType);
|
||||
|
||||
/**
|
||||
* @param guestNic
|
||||
* @return
|
||||
*/
|
||||
boolean isPrivateGateway(Nic guestNic);
|
||||
|
||||
Map<Service, Map<Capability, String>> getNetworkCapabilities(long networkId);
|
||||
|
||||
Network getSystemNetworkByZoneAndTrafficType(long zoneId, TrafficType trafficType);
|
||||
|
||||
Long getDedicatedNetworkDomain(long networkId);
|
||||
|
||||
Map<Service, Set<Provider>> getNetworkOfferingServiceProvidersMap(long networkOfferingId);
|
||||
|
||||
List<? extends Provider> listSupportedNetworkServiceProviders(String serviceName);
|
||||
|
||||
List<? extends Network> listNetworksByVpc(long vpcId);
|
||||
|
||||
boolean canUseForDeploy(Network network);
|
||||
|
||||
Network getExclusiveGuestNetwork(long zoneId);
|
||||
|
||||
long findPhysicalNetworkId(long zoneId, String tag, TrafficType trafficType);
|
||||
|
||||
Integer getNetworkRate(long networkId, Long vmId);
|
||||
|
||||
boolean isVmPartOfNetwork(long vmId, long ntwkId);
|
||||
|
||||
PhysicalNetwork getDefaultPhysicalNetworkByZoneAndTrafficType(long zoneId, TrafficType trafficType);
|
||||
|
||||
Network getNetwork(long networkId);
|
||||
|
||||
IpAddress getIp(long sourceIpAddressId);
|
||||
|
||||
boolean isNetworkAvailableInDomain(long networkId, long domainId);
|
||||
|
||||
NicProfile getNicProfile(VirtualMachine vm, long networkId, String broadcastUri);
|
||||
|
||||
Set<Long> getAvailableIps(Network network, String requestedIp);
|
||||
|
||||
String getDomainNetworkDomain(long domainId, long zoneId);
|
||||
|
||||
PublicIpAddress getSourceNatIpAddressForGuestNetwork(Account owner, Network guestNetwork);
|
||||
|
||||
boolean isNetworkInlineMode(Network network);
|
||||
|
||||
boolean isIP6AddressAvailableInNetwork(long networkId);
|
||||
|
||||
boolean isIP6AddressAvailableInVlan(long vlanId);
|
||||
|
||||
void checkIp6Parameters(String startIPv6, String endIPv6, String ip6Gateway, String ip6Cidr) throws InvalidParameterValueException;
|
||||
|
||||
void checkRequestedIpAddresses(long networkId, String ip4, String ip6) throws InvalidParameterValueException;
|
||||
}
|
||||
|
|
@ -21,7 +21,6 @@ import java.net.URI;
|
|||
import com.cloud.network.Networks.BroadcastDomainType;
|
||||
import com.cloud.network.Networks.Mode;
|
||||
import com.cloud.network.Networks.TrafficType;
|
||||
import org.apache.cloudstack.api.InternalIdentity;
|
||||
|
||||
public class NetworkProfile implements Network {
|
||||
private long id;
|
||||
|
|
@ -39,6 +38,9 @@ public class NetworkProfile implements Network {
|
|||
private TrafficType trafficType;
|
||||
private String gateway;
|
||||
private String cidr;
|
||||
private String networkCidr;
|
||||
private String ip6Gateway;
|
||||
private String ip6Cidr;
|
||||
private long networkOfferingId;
|
||||
private long related;
|
||||
private String displayText;
|
||||
|
|
@ -64,6 +66,9 @@ public class NetworkProfile implements Network {
|
|||
this.trafficType = network.getTrafficType();
|
||||
this.gateway = network.getGateway();
|
||||
this.cidr = network.getCidr();
|
||||
this.networkCidr = network.getNetworkCidr();
|
||||
this.ip6Gateway = network.getIp6Gateway();
|
||||
this.ip6Cidr = network.getIp6Cidr();
|
||||
this.networkOfferingId = network.getNetworkOfferingId();
|
||||
this.related = network.getRelated();
|
||||
this.displayText = network.getDisplayText();
|
||||
|
|
@ -159,6 +164,11 @@ public class NetworkProfile implements Network {
|
|||
return cidr;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNetworkCidr() {
|
||||
return networkCidr;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getNetworkOfferingId() {
|
||||
return networkOfferingId;
|
||||
|
|
@ -226,4 +236,18 @@ public class NetworkProfile implements Network {
|
|||
return vpcId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTrafficType(TrafficType type) {
|
||||
this.trafficType = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getIp6Gateway() {
|
||||
return ip6Gateway;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getIp6Cidr() {
|
||||
return ip6Cidr;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,26 +17,28 @@
|
|||
package com.cloud.network;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.cloudstack.api.command.admin.usage.ListTrafficTypeImplementorsCmd;
|
||||
import org.apache.cloudstack.api.command.user.network.RestartNetworkCmd;
|
||||
import org.apache.cloudstack.api.command.user.network.CreateNetworkCmd;
|
||||
import org.apache.cloudstack.api.command.user.network.ListNetworksCmd;
|
||||
import org.apache.cloudstack.api.command.user.network.RestartNetworkCmd;
|
||||
|
||||
import com.cloud.exception.ConcurrentOperationException;
|
||||
import com.cloud.exception.InsufficientAddressCapacityException;
|
||||
import com.cloud.exception.InsufficientCapacityException;
|
||||
import com.cloud.exception.ResourceAllocationException;
|
||||
import com.cloud.exception.ResourceUnavailableException;
|
||||
import com.cloud.network.Network.Capability;
|
||||
import com.cloud.network.Network.Provider;
|
||||
import com.cloud.network.Network.Service;
|
||||
import com.cloud.network.Networks.TrafficType;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.User;
|
||||
import com.cloud.utils.Pair;
|
||||
|
||||
/**
|
||||
* The NetworkService interface is the "public" api to entities that make requests to the orchestration engine
|
||||
* Such entities are usually the admin and end-user API.
|
||||
*
|
||||
*/
|
||||
public interface NetworkService {
|
||||
|
||||
List<? extends Network> getIsolatedNetworksOwnedByAccountInZone(long zoneId, Account owner);
|
||||
|
|
@ -64,24 +66,10 @@ public interface NetworkService {
|
|||
|
||||
IpAddress getIp(long id);
|
||||
|
||||
NetworkProfile convertNetworkToNetworkProfile(long networkId);
|
||||
|
||||
Map<Service, Map<Capability, String>> getNetworkCapabilities(long networkId);
|
||||
|
||||
boolean isNetworkAvailableInDomain(long networkId, long domainId);
|
||||
|
||||
Long getDedicatedNetworkDomain(long networkId);
|
||||
|
||||
Network updateGuestNetwork(long networkId, String name, String displayText, Account callerAccount, User callerUser,
|
||||
String domainSuffix, Long networkOfferingId, Boolean changeCidr);
|
||||
String domainSuffix, Long networkOfferingId, Boolean changeCidr, String guestVmCidr);
|
||||
|
||||
Integer getNetworkRate(long networkId, Long vmId);
|
||||
|
||||
Network getSystemNetworkByZoneAndTrafficType(long zoneId, TrafficType trafficType);
|
||||
|
||||
Map<Service, Set<Provider>> getNetworkOfferingServiceProvidersMap(long networkOfferingId);
|
||||
|
||||
PhysicalNetwork createPhysicalNetwork(Long zoneId, String vnetRange, String networkSpeed,
|
||||
PhysicalNetwork createPhysicalNetwork(Long zoneId, String vnetRange, String networkSpeed,
|
||||
List<String> isolationMethods, String broadcastDomainRange, Long domainId, List<String> tags, String name);
|
||||
|
||||
Pair<List<? extends PhysicalNetwork>, Integer> searchPhysicalNetworks(Long id, Long zoneId, String keyword,
|
||||
|
|
@ -94,8 +82,6 @@ public interface NetworkService {
|
|||
|
||||
List<? extends Service> listNetworkServices(String providerName);
|
||||
|
||||
List<? extends Provider> listSupportedNetworkServiceProviders(String serviceName);
|
||||
|
||||
PhysicalNetworkServiceProvider addProviderToPhysicalNetwork(Long physicalNetworkId, String providerName,
|
||||
Long destinationPhysicalNetworkId, List<String> enabledServices);
|
||||
|
||||
|
|
@ -127,17 +113,14 @@ public interface NetworkService {
|
|||
|
||||
Pair<List<? extends PhysicalNetworkTrafficType>, Integer> listTrafficTypes(Long physicalNetworkId);
|
||||
|
||||
PhysicalNetwork getDefaultPhysicalNetworkByZoneAndTrafficType(long zoneId, TrafficType trafficType);
|
||||
|
||||
Network getExclusiveGuestNetwork(long zoneId);
|
||||
|
||||
List<Pair<TrafficType, String>> listTrafficTypeImplementor(ListTrafficTypeImplementorsCmd cmd);
|
||||
|
||||
List<? extends Network> getIsolatedNetworksWithSourceNATOwnedByAccountInZone(long zoneId, Account owner);
|
||||
|
||||
List<? extends Network> listNetworksByVpc(long vpcId);
|
||||
|
||||
boolean isVmPartOfNetwork(long vmId, long ntwkId);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @param networkId
|
||||
|
|
@ -170,9 +153,5 @@ public interface NetworkService {
|
|||
Network createPrivateNetwork(String networkName, String displayText, long physicalNetworkId, String vlan,
|
||||
String startIp, String endIP, String gateway, String netmask, long networkOwnerId, Long vpcId)
|
||||
throws ResourceAllocationException, ConcurrentOperationException, InsufficientCapacityException;
|
||||
/**
|
||||
* @param network
|
||||
* @return
|
||||
*/
|
||||
boolean canUseForDeploy(Network network);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,37 @@
|
|||
// 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.network;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.cloud.host.Host;
|
||||
|
||||
import org.apache.cloudstack.api.command.admin.usage.AddTrafficMonitorCmd;
|
||||
import org.apache.cloudstack.api.command.admin.usage.DeleteTrafficMonitorCmd;
|
||||
import org.apache.cloudstack.api.command.admin.usage.ListTrafficMonitorsCmd;
|
||||
import org.apache.cloudstack.api.response.TrafficMonitorResponse;
|
||||
import com.cloud.utils.component.Manager;
|
||||
|
||||
public interface NetworkUsageService extends Manager {
|
||||
|
||||
Host addTrafficMonitor(AddTrafficMonitorCmd cmd);
|
||||
|
||||
boolean deleteTrafficMonitor(DeleteTrafficMonitorCmd cmd);
|
||||
|
||||
List<? extends Host> listTrafficMonitors(ListTrafficMonitorsCmd cmd);
|
||||
|
||||
}
|
||||
|
|
@ -48,7 +48,7 @@ public class Networks {
|
|||
public enum AddressFormat {
|
||||
Ip4,
|
||||
Ip6,
|
||||
Mixed
|
||||
DualStack
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -16,11 +16,11 @@
|
|||
// under the License.
|
||||
package com.cloud.network;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.cloudstack.api.Identity;
|
||||
import org.apache.cloudstack.api.InternalIdentity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
|
@ -35,7 +35,8 @@ public interface PhysicalNetwork extends Identity, InternalIdentity {
|
|||
VLAN,
|
||||
L3,
|
||||
GRE,
|
||||
STT;
|
||||
STT,
|
||||
VNS;
|
||||
}
|
||||
|
||||
public enum BroadcastDomainRange {
|
||||
|
|
|
|||
|
|
@ -18,9 +18,10 @@ package com.cloud.network;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import com.cloud.network.Network.Service;
|
||||
import org.apache.cloudstack.api.InternalIdentity;
|
||||
|
||||
import com.cloud.network.Network.Service;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -16,10 +16,11 @@
|
|||
// under the License.
|
||||
package com.cloud.network;
|
||||
|
||||
import com.cloud.network.Networks.TrafficType;
|
||||
import org.apache.cloudstack.api.Identity;
|
||||
import org.apache.cloudstack.api.InternalIdentity;
|
||||
|
||||
import com.cloud.network.Networks.TrafficType;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -17,9 +17,10 @@
|
|||
package com.cloud.network;
|
||||
|
||||
import org.apache.cloudstack.acl.ControlledEntity;
|
||||
import com.cloud.dc.Vlan;
|
||||
import org.apache.cloudstack.api.InternalIdentity;
|
||||
|
||||
import com.cloud.dc.Vlan;
|
||||
|
||||
/**
|
||||
*/
|
||||
public interface PublicIpAddress extends ControlledEntity, IpAddress, Vlan, InternalIdentity {
|
||||
|
|
|
|||
|
|
@ -19,11 +19,12 @@ package com.cloud.network;
|
|||
import java.sql.SQLException;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.cloudstack.api.command.admin.network.*;
|
||||
import org.apache.cloudstack.api.command.admin.network.UpdateStorageNetworkIpRangeCmd;
|
||||
import org.apache.cloudstack.api.command.admin.network.DeleteStorageNetworkIpRangeCmd;
|
||||
import com.cloud.dc.StorageNetworkIpRange;
|
||||
import org.apache.cloudstack.api.command.admin.network.CreateStorageNetworkIpRangeCmd;
|
||||
import org.apache.cloudstack.api.command.admin.network.DeleteStorageNetworkIpRangeCmd;
|
||||
import org.apache.cloudstack.api.command.admin.network.ListStorageNetworkIpRangeCmd;
|
||||
import org.apache.cloudstack.api.command.admin.network.UpdateStorageNetworkIpRangeCmd;
|
||||
|
||||
import com.cloud.dc.StorageNetworkIpRange;
|
||||
|
||||
public interface StorageNetworkService {
|
||||
StorageNetworkIpRange createIpRange(CreateStorageNetworkIpRangeCmd cmd) throws SQLException;
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
package com.cloud.network;
|
||||
|
||||
import org.apache.cloudstack.api.command.admin.router.UpgradeRouterCmd;
|
||||
|
||||
import com.cloud.exception.ConcurrentOperationException;
|
||||
import com.cloud.exception.InsufficientCapacityException;
|
||||
import com.cloud.exception.ResourceUnavailableException;
|
||||
|
|
|
|||
|
|
@ -19,11 +19,19 @@ package com.cloud.network.as;
|
|||
import java.util.List;
|
||||
|
||||
import org.apache.cloudstack.api.command.admin.autoscale.CreateCounterCmd;
|
||||
import org.apache.cloudstack.api.command.user.autoscale.*;
|
||||
import org.apache.cloudstack.api.command.user.autoscale.CreateAutoScalePolicyCmd;
|
||||
import org.apache.cloudstack.api.command.user.autoscale.CreateAutoScaleVmGroupCmd;
|
||||
import org.apache.cloudstack.api.command.user.autoscale.CreateAutoScaleVmProfileCmd;
|
||||
import org.apache.cloudstack.api.command.user.autoscale.CreateConditionCmd;
|
||||
import org.apache.cloudstack.api.command.user.autoscale.ListAutoScalePoliciesCmd;
|
||||
import org.apache.cloudstack.api.command.user.autoscale.ListAutoScaleVmGroupsCmd;
|
||||
import org.apache.cloudstack.api.command.user.autoscale.ListAutoScaleVmProfilesCmd;
|
||||
import org.apache.cloudstack.api.command.user.autoscale.ListConditionsCmd;
|
||||
import org.apache.cloudstack.api.command.user.autoscale.ListCountersCmd;
|
||||
import org.apache.cloudstack.api.command.user.autoscale.UpdateAutoScalePolicyCmd;
|
||||
import org.apache.cloudstack.api.command.user.autoscale.UpdateAutoScaleVmGroupCmd;
|
||||
import org.apache.cloudstack.api.command.user.autoscale.UpdateAutoScaleVmProfileCmd;
|
||||
|
||||
import com.cloud.exception.ResourceInUseException;
|
||||
import com.cloud.exception.ResourceUnavailableException;
|
||||
|
||||
|
|
|
|||
|
|
@ -20,9 +20,10 @@ package com.cloud.network.as;
|
|||
import java.util.List;
|
||||
|
||||
import org.apache.cloudstack.acl.ControlledEntity;
|
||||
import com.cloud.utils.Pair;
|
||||
import org.apache.cloudstack.api.InternalIdentity;
|
||||
|
||||
import com.cloud.utils.Pair;
|
||||
|
||||
/**
|
||||
* AutoScaleVmProfile
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -24,8 +24,9 @@ import com.cloud.network.Network;
|
|||
import com.cloud.network.Network.Provider;
|
||||
import com.cloud.network.Network.Service;
|
||||
import com.cloud.network.PublicIpAddress;
|
||||
import com.cloud.utils.component.Adapter;
|
||||
|
||||
public interface IpDeployer {
|
||||
public interface IpDeployer extends Adapter{
|
||||
/**
|
||||
* Apply ip addresses to this network
|
||||
* @param network
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@
|
|||
// under the License.
|
||||
package com.cloud.network.element;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
|
|
@ -45,19 +44,19 @@ public interface NetworkElement extends Adapter {
|
|||
Map<Service, Map<Capability, String>> getCapabilities();
|
||||
|
||||
/**
|
||||
* NOTE:
|
||||
* NOTE:
|
||||
* NetworkElement -> Network.Provider is a one-to-one mapping. While adding a new NetworkElement, one must add a new Provider name to Network.Provider.
|
||||
*/
|
||||
Provider getProvider();
|
||||
|
||||
/**
|
||||
* Implement the network configuration as specified.
|
||||
* Implement the network configuration as specified.
|
||||
* @param config fully specified network configuration.
|
||||
* @param offering network offering that originated the network configuration.
|
||||
* @return true if network configuration is now usable; false if not; null if not handled by this element.
|
||||
* @throws InsufficientNetworkCapacityException TODO
|
||||
*/
|
||||
boolean implement(Network network, NetworkOffering offering, DeployDestination dest, ReservationContext context)
|
||||
boolean implement(Network network, NetworkOffering offering, DeployDestination dest, ReservationContext context)
|
||||
throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException;
|
||||
|
||||
/**
|
||||
|
|
@ -72,8 +71,8 @@ public interface NetworkElement extends Adapter {
|
|||
* @throws ResourceUnavailableException
|
||||
* @throws InsufficientNetworkCapacityException
|
||||
*/
|
||||
boolean prepare(Network network, NicProfile nic, VirtualMachineProfile<? extends VirtualMachine> vm,
|
||||
DeployDestination dest, ReservationContext context) throws ConcurrentOperationException,
|
||||
boolean prepare(Network network, NicProfile nic, VirtualMachineProfile<? extends VirtualMachine> vm,
|
||||
DeployDestination dest, ReservationContext context) throws ConcurrentOperationException,
|
||||
ResourceUnavailableException, InsufficientCapacityException;
|
||||
|
||||
/**
|
||||
|
|
@ -86,7 +85,7 @@ public interface NetworkElement extends Adapter {
|
|||
* @throws ConcurrentOperationException
|
||||
* @throws ResourceUnavailableException
|
||||
*/
|
||||
boolean release(Network network, NicProfile nic, VirtualMachineProfile<? extends VirtualMachine> vm,
|
||||
boolean release(Network network, NicProfile nic, VirtualMachineProfile<? extends VirtualMachine> vm,
|
||||
ReservationContext context) throws ConcurrentOperationException, ResourceUnavailableException;
|
||||
|
||||
/**
|
||||
|
|
@ -98,7 +97,7 @@ public interface NetworkElement extends Adapter {
|
|||
* @throws ConcurrentOperationException
|
||||
* @throws ResourceUnavailableException
|
||||
*/
|
||||
boolean shutdown(Network network, ReservationContext context, boolean cleanup)
|
||||
boolean shutdown(Network network, ReservationContext context, boolean cleanup)
|
||||
throws ConcurrentOperationException, ResourceUnavailableException;
|
||||
|
||||
/**
|
||||
|
|
@ -125,11 +124,11 @@ public interface NetworkElement extends Adapter {
|
|||
* @throws ConcurrentOperationException
|
||||
* @throws ResourceUnavailableException
|
||||
*/
|
||||
boolean shutdownProviderInstances(PhysicalNetworkServiceProvider provider, ReservationContext context)
|
||||
boolean shutdownProviderInstances(PhysicalNetworkServiceProvider provider, ReservationContext context)
|
||||
throws ConcurrentOperationException, ResourceUnavailableException;
|
||||
|
||||
/**
|
||||
* This should return true if out of multiple services provided by this element, only some can be enabled. If all the services MUST be provided, this should return false.
|
||||
* This should return true if out of multiple services provided by this element, only some can be enabled. If all the services MUST be provided, this should return false.
|
||||
* @return true/false
|
||||
*/
|
||||
boolean canEnableIndividualServices();
|
||||
|
|
|
|||
|
|
@ -22,8 +22,9 @@ import com.cloud.exception.ResourceUnavailableException;
|
|||
import com.cloud.network.Network;
|
||||
import com.cloud.network.RemoteAccessVpn;
|
||||
import com.cloud.network.VpnUser;
|
||||
import com.cloud.utils.component.Adapter;
|
||||
|
||||
public interface RemoteAccessVPNServiceProvider extends NetworkElement, IpDeployingRequester {
|
||||
public interface RemoteAccessVPNServiceProvider extends Adapter {
|
||||
String[] applyVpnUsers(RemoteAccessVpn vpn, List<? extends VpnUser> users) throws ResourceUnavailableException;
|
||||
|
||||
boolean startVpn(Network network, RemoteAccessVpn vpn) throws ResourceUnavailableException;
|
||||
|
|
|
|||
|
|
@ -17,10 +17,10 @@
|
|||
package com.cloud.network.element;
|
||||
|
||||
import com.cloud.exception.ResourceUnavailableException;
|
||||
import com.cloud.network.Network;
|
||||
import com.cloud.network.Site2SiteVpnConnection;
|
||||
import com.cloud.utils.component.Adapter;
|
||||
|
||||
public interface Site2SiteVpnServiceProvider extends NetworkElement {
|
||||
public interface Site2SiteVpnServiceProvider extends Adapter {
|
||||
boolean startSite2SiteVpn(Site2SiteVpnConnection conn) throws ResourceUnavailableException;
|
||||
|
||||
boolean stopSite2SiteVpn(Site2SiteVpnConnection conn) throws ResourceUnavailableException;
|
||||
|
|
|
|||
|
|
@ -30,4 +30,5 @@ public interface UserDataServiceProvider extends NetworkElement {
|
|||
public boolean addPasswordAndUserdata(Network network, NicProfile nic, VirtualMachineProfile<? extends VirtualMachine> vm, DeployDestination dest, ReservationContext context) throws ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException;
|
||||
boolean savePassword(Network network, NicProfile nic, VirtualMachineProfile<? extends VirtualMachine> vm) throws ResourceUnavailableException;
|
||||
boolean saveUserData(Network network, NicProfile nic, VirtualMachineProfile<? extends VirtualMachine> vm) throws ResourceUnavailableException;
|
||||
boolean saveSSHKey(Network network, NicProfile nic, VirtualMachineProfile<? extends VirtualMachine> vm, String SSHPublicKey) throws ResourceUnavailableException;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ import java.util.List;
|
|||
|
||||
import org.apache.cloudstack.api.command.admin.router.ConfigureVirtualRouterElementCmd;
|
||||
import org.apache.cloudstack.api.command.admin.router.ListVirtualRouterElementsCmd;
|
||||
|
||||
import com.cloud.network.VirtualRouterProvider;
|
||||
import com.cloud.network.VirtualRouterProvider.VirtualRouterProviderType;
|
||||
import com.cloud.utils.component.PluggableService;
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@ import com.cloud.exception.ResourceUnavailableException;
|
|||
import com.cloud.network.vpc.PrivateGateway;
|
||||
import com.cloud.network.vpc.StaticRouteProfile;
|
||||
import com.cloud.network.vpc.Vpc;
|
||||
import com.cloud.network.vpc.VpcGateway;
|
||||
import com.cloud.vm.ReservationContext;
|
||||
|
||||
public interface VpcProvider extends NetworkElement{
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ package com.cloud.network.firewall;
|
|||
import java.util.List;
|
||||
|
||||
import org.apache.cloudstack.api.command.user.firewall.ListFirewallRulesCmd;
|
||||
|
||||
import com.cloud.exception.NetworkRuleConflictException;
|
||||
import com.cloud.exception.ResourceUnavailableException;
|
||||
import com.cloud.network.rules.FirewallRule;
|
||||
|
|
@ -27,7 +28,8 @@ import com.cloud.user.Account;
|
|||
import com.cloud.utils.Pair;
|
||||
|
||||
public interface FirewallService {
|
||||
FirewallRule createFirewallRule(FirewallRule rule) throws NetworkRuleConflictException;
|
||||
FirewallRule createIngressFirewallRule(FirewallRule rule) throws NetworkRuleConflictException;
|
||||
FirewallRule createEgressFirewallRule(FirewallRule rule) throws NetworkRuleConflictException;
|
||||
|
||||
Pair<List<? extends FirewallRule>, Integer> listFirewallRules(ListFirewallRulesCmd cmd);
|
||||
|
||||
|
|
@ -40,7 +42,8 @@ public interface FirewallService {
|
|||
*/
|
||||
boolean revokeFirewallRule(long ruleId, boolean apply);
|
||||
|
||||
boolean applyFirewallRules(long ipId, Account caller) throws ResourceUnavailableException;
|
||||
boolean applyEgressFirewallRules (FirewallRule rule, Account caller) throws ResourceUnavailableException;
|
||||
boolean applyIngressFirewallRules(long Ipid , Account caller) throws ResourceUnavailableException;
|
||||
|
||||
FirewallRule getFirewallRule(long ruleId);
|
||||
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ package com.cloud.network.firewall;
|
|||
import java.util.List;
|
||||
|
||||
import org.apache.cloudstack.api.command.user.network.ListNetworkACLsCmd;
|
||||
|
||||
import com.cloud.exception.NetworkRuleConflictException;
|
||||
import com.cloud.exception.ResourceUnavailableException;
|
||||
import com.cloud.network.rules.FirewallRule;
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@ import com.cloud.network.as.Counter;
|
|||
import com.cloud.network.rules.FirewallRule;
|
||||
import com.cloud.network.rules.LoadBalancer;
|
||||
import com.cloud.utils.Pair;
|
||||
import org.apache.cloudstack.api.InternalIdentity;
|
||||
|
||||
public class LoadBalancingRule implements FirewallRule, LoadBalancer {
|
||||
private LoadBalancer lb;
|
||||
|
|
|
|||
|
|
@ -18,9 +18,13 @@ package com.cloud.network.lb;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.cloudstack.api.command.user.loadbalancer.*;
|
||||
import org.apache.cloudstack.api.command.user.loadbalancer.CreateLBStickinessPolicyCmd;
|
||||
import org.apache.cloudstack.api.command.user.loadbalancer.CreateLoadBalancerRuleCmd;
|
||||
import org.apache.cloudstack.api.command.user.loadbalancer.ListLBStickinessPoliciesCmd;
|
||||
import org.apache.cloudstack.api.command.user.loadbalancer.ListLoadBalancerRuleInstancesCmd;
|
||||
import org.apache.cloudstack.api.command.user.loadbalancer.ListLoadBalancerRulesCmd;
|
||||
import org.apache.cloudstack.api.command.user.loadbalancer.UpdateLoadBalancerRuleCmd;
|
||||
|
||||
import com.cloud.exception.InsufficientAddressCapacityException;
|
||||
import com.cloud.exception.NetworkRuleConflictException;
|
||||
import com.cloud.exception.ResourceUnavailableException;
|
||||
|
|
|
|||
|
|
@ -16,8 +16,9 @@
|
|||
// under the License.
|
||||
package com.cloud.network.rules;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ package com.cloud.network.rules;
|
|||
import java.util.List;
|
||||
|
||||
import org.apache.cloudstack.api.command.user.firewall.ListPortForwardingRulesCmd;
|
||||
|
||||
import com.cloud.exception.InsufficientAddressCapacityException;
|
||||
import com.cloud.exception.NetworkRuleConflictException;
|
||||
import com.cloud.exception.ResourceUnavailableException;
|
||||
|
|
|
|||
|
|
@ -18,10 +18,11 @@ package com.cloud.network.rules;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import com.cloud.utils.Pair;
|
||||
import org.apache.cloudstack.api.Identity;
|
||||
import org.apache.cloudstack.api.InternalIdentity;
|
||||
|
||||
import com.cloud.utils.Pair;
|
||||
|
||||
/**
|
||||
*/
|
||||
public interface StickinessPolicy extends InternalIdentity, Identity {
|
||||
|
|
|
|||
|
|
@ -15,9 +15,10 @@
|
|||
// specific language governing permissions and limitations
|
||||
// under the License.
|
||||
package com.cloud.network.security;
|
||||
import com.cloud.network.security.SecurityRule.SecurityRuleType;
|
||||
import org.apache.cloudstack.api.InternalIdentity;
|
||||
|
||||
import com.cloud.network.security.SecurityRule.SecurityRuleType;
|
||||
|
||||
public interface SecurityGroupRules extends InternalIdentity {
|
||||
|
||||
String getName();
|
||||
|
|
|
|||
|
|
@ -18,7 +18,12 @@ package com.cloud.network.security;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.cloudstack.api.command.user.securitygroup.*;
|
||||
import org.apache.cloudstack.api.command.user.securitygroup.AuthorizeSecurityGroupEgressCmd;
|
||||
import org.apache.cloudstack.api.command.user.securitygroup.AuthorizeSecurityGroupIngressCmd;
|
||||
import org.apache.cloudstack.api.command.user.securitygroup.CreateSecurityGroupCmd;
|
||||
import org.apache.cloudstack.api.command.user.securitygroup.DeleteSecurityGroupCmd;
|
||||
import org.apache.cloudstack.api.command.user.securitygroup.RevokeSecurityGroupEgressCmd;
|
||||
import org.apache.cloudstack.api.command.user.securitygroup.RevokeSecurityGroupIngressCmd;
|
||||
|
||||
import com.cloud.exception.InvalidParameterValueException;
|
||||
import com.cloud.exception.PermissionDeniedException;
|
||||
|
|
|
|||
|
|
@ -16,10 +16,11 @@
|
|||
// under the License.
|
||||
package com.cloud.network.security;
|
||||
|
||||
import com.cloud.async.AsyncInstanceCreateStatus;
|
||||
import org.apache.cloudstack.api.Identity;
|
||||
import org.apache.cloudstack.api.InternalIdentity;
|
||||
|
||||
import com.cloud.async.AsyncInstanceCreateStatus;
|
||||
|
||||
public interface SecurityRule extends Identity, InternalIdentity {
|
||||
|
||||
public static class SecurityRuleType {
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@
|
|||
// under the License.
|
||||
package com.cloud.network.vpc;
|
||||
|
||||
import org.apache.cloudstack.api.InternalIdentity;
|
||||
|
||||
public class StaticRouteProfile implements StaticRoute {
|
||||
private long id;
|
||||
|
|
|
|||
|
|
@ -17,10 +17,11 @@
|
|||
package com.cloud.network.vpc;
|
||||
|
||||
import org.apache.cloudstack.acl.ControlledEntity;
|
||||
import com.cloud.network.Network;
|
||||
import org.apache.cloudstack.api.Identity;
|
||||
import org.apache.cloudstack.api.InternalIdentity;
|
||||
|
||||
import com.cloud.network.Network;
|
||||
|
||||
public interface Vpc extends ControlledEntity, Identity, InternalIdentity {
|
||||
public enum State {
|
||||
Enabled,
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ import java.util.Set;
|
|||
|
||||
import org.apache.cloudstack.api.command.user.vpc.ListPrivateGatewaysCmd;
|
||||
import org.apache.cloudstack.api.command.user.vpc.ListStaticRoutesCmd;
|
||||
|
||||
import com.cloud.exception.ConcurrentOperationException;
|
||||
import com.cloud.exception.InsufficientAddressCapacityException;
|
||||
import com.cloud.exception.InsufficientCapacityException;
|
||||
|
|
@ -40,7 +41,7 @@ public interface VpcService {
|
|||
|
||||
public VpcOffering getVpcOffering(long vpcOfferingId);
|
||||
|
||||
public VpcOffering createVpcOffering(String name, String displayText, List<String> supportedServices);
|
||||
public VpcOffering createVpcOffering(String name, String displayText, List<String> supportedServices, Map<String, List<String>> serviceProviders);
|
||||
|
||||
public Vpc getVpc(long vpcId);
|
||||
|
||||
|
|
@ -245,5 +246,5 @@ public interface VpcService {
|
|||
InsufficientAddressCapacityException, ConcurrentOperationException;
|
||||
|
||||
public Network updateVpcGuestNetwork(long networkId, String name, String displayText, Account callerAccount,
|
||||
User callerUser, String domainSuffix, Long ntwkOffId, Boolean changeCidr);
|
||||
User callerUser, String domainSuffix, Long ntwkOffId, Boolean changeCidr, String guestVmCidr);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,8 +18,9 @@ package com.cloud.network.vpn;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.cloudstack.api.command.user.vpn.ListVpnUsersCmd;
|
||||
import org.apache.cloudstack.api.command.user.vpn.ListRemoteAccessVpnsCmd;
|
||||
import org.apache.cloudstack.api.command.user.vpn.ListVpnUsersCmd;
|
||||
|
||||
import com.cloud.exception.NetworkRuleConflictException;
|
||||
import com.cloud.exception.ResourceUnavailableException;
|
||||
import com.cloud.network.RemoteAccessVpn;
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ package com.cloud.network.vpn;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.cloudstack.api.command.user.vpn.*;
|
||||
import org.apache.cloudstack.api.command.user.vpn.CreateVpnConnectionCmd;
|
||||
import org.apache.cloudstack.api.command.user.vpn.CreateVpnCustomerGatewayCmd;
|
||||
import org.apache.cloudstack.api.command.user.vpn.CreateVpnGatewayCmd;
|
||||
|
|
@ -26,9 +25,11 @@ import org.apache.cloudstack.api.command.user.vpn.DeleteVpnConnectionCmd;
|
|||
import org.apache.cloudstack.api.command.user.vpn.DeleteVpnCustomerGatewayCmd;
|
||||
import org.apache.cloudstack.api.command.user.vpn.DeleteVpnGatewayCmd;
|
||||
import org.apache.cloudstack.api.command.user.vpn.ListVpnConnectionsCmd;
|
||||
import org.apache.cloudstack.api.command.user.vpn.ListVpnCustomerGatewaysCmd;
|
||||
import org.apache.cloudstack.api.command.user.vpn.ListVpnGatewaysCmd;
|
||||
import org.apache.cloudstack.api.command.user.vpn.ResetVpnConnectionCmd;
|
||||
import org.apache.cloudstack.api.command.user.vpn.UpdateVpnCustomerGatewayCmd;
|
||||
|
||||
import com.cloud.exception.NetworkRuleConflictException;
|
||||
import com.cloud.exception.ResourceUnavailableException;
|
||||
import com.cloud.network.Site2SiteCustomerGateway;
|
||||
|
|
|
|||
|
|
@ -16,12 +16,12 @@
|
|||
// under the License.
|
||||
package com.cloud.offering;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import org.apache.cloudstack.acl.InfrastructureEntity;
|
||||
import org.apache.cloudstack.api.Identity;
|
||||
import org.apache.cloudstack.api.InternalIdentity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* Represents a disk offering that specifies what the end user needs in
|
||||
* the disk offering.
|
||||
|
|
|
|||
|
|
@ -16,12 +16,13 @@
|
|||
// under the License.
|
||||
package com.cloud.offering;
|
||||
|
||||
import com.cloud.network.Network.GuestType;
|
||||
import com.cloud.network.Networks.TrafficType;
|
||||
import org.apache.cloudstack.acl.InfrastructureEntity;
|
||||
import org.apache.cloudstack.api.Identity;
|
||||
import org.apache.cloudstack.api.InternalIdentity;
|
||||
|
||||
import com.cloud.network.Network.GuestType;
|
||||
import com.cloud.network.Networks.TrafficType;
|
||||
|
||||
/**
|
||||
* Describes network offering
|
||||
*
|
||||
|
|
@ -110,4 +111,7 @@ public interface NetworkOffering extends InfrastructureEntity, InternalIdentity,
|
|||
boolean getSpecifyIpRanges();
|
||||
|
||||
boolean isInline();
|
||||
|
||||
boolean getIsPersistent();
|
||||
|
||||
}
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue