514 Commits

Author SHA1 Message Date
Rohit Yadav
03d2c015ae GenericDao: Add method to find by uuid string including removed entities
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-23 14:57:41 -08:00
Rohit Yadav
7a927e36f0 ReflectUtil: Use collections to grow list and not manual array memory management
Fix usage in ApiDispatcher. Add two kinds of helpers:
- One that gets list of exclude cmd whose fields are not be included
- One that loops till a base class is asssignable from superclass

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-23 14:57:41 -08:00
Rohit Yadav
cbdeeebc6c IteratorUtil: Add generic method to return sorted list out of a collection
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-23 14:57:41 -08:00
Hugo Trippaers
04f82623f6 Merge branch 'master' into cloud-agent-with-openvswitch
Conflicts:
	plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
2013-01-21 12:18:21 +01:00
Min Chen
bdcfa1919b Clean up ApiServer, ApiServlet and ApiDispatcher in handling various
exceptions, and Introduced ApiErrorCode to handle CloudStack API error
code to standard Http code mapping.
2013-01-16 21:52:48 -08:00
Min Chen
97cb16944f Merge branch 'master' into api_limit 2013-01-15 18:18:34 -08:00
Min Chen
8608925216 Consolidate RuntimeCloudException and CloudRuntimeException into one
class CloudRuntimeException, and removed RuntimeCloudException to avoid
confusion.
2013-01-15 18:07:08 -08:00
Min Chen
4355d06a86 Reuse APIChecker adapter interface for APi Rate limit checking and optimize ApiRateLimitService interface.
Signed-off-by: Min Chen <min.chen@citrix.com>
2013-01-15 15:53:19 -08:00
Hugo Trippaers
2d69a1855d Summary: Begone pesky tabs 2013-01-15 10:00:58 +01:00
Hugo Trippaers
a0ade283b7 Summary: Add initial support for OpenVswitch to the KVM hypervisor
Create OvsVifDriver to deal with openvswitch specifics for plugging
intefaces

Create a parameter to set the bridge type to use in
LibvirtComputingResource. 
Create several functions to get bridge information from openvswitch

Add a check to detect the libvirt version and throw an exception when
the version is to low ( < 0.9.11 )

Fix classpath loading in Script.findScript to deal with missing path
separators at the end.

Add notification to the BridgeVifDriver that lswitch broadcast type is
not supported.
2013-01-15 09:09:14 +01:00
Rohit Yadav
0a31945ee5 PluggableService: Fix interface to return list of cmd classes
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-14 19:01:26 -08:00
Rohit Yadav
7960dd429b utils: Fix getByUuid to accept string arg, it's not gonna be anything else
Due to generic programming, most classes declare Daos with ID as Long, so they
get the getUuid(Long) definition, it has to be getUuid(String), uuid is not
gonna be anything else. Fix GenericDaoBase and GenericDao.

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-11 18:44:19 -08:00
Noa Resare
1033200b0b CLOUDSTACK-933: CglibThrowableRendererTest writing stack traces...
Improve CglibThrowableRenderer test case

Log to a separate Logger instead of the default one to avoid spurious
stack traces in test run output.

Actually verify that registering CglibThrowableRenderer with the
alternative log hierarchy actually removes call trace lines that
contains the string <generated>
2013-01-11 17:09:44 -05:00
Rohit Yadav
c4e890c55d PluggableService: Refactor method to return map of key value pairs
- Makes plugins self contained so they decide their properties file format
- PluggableService creates the contract that implementing entity will return a
  properties map which is apiname:rolemask (both are strings)

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-10 15:55:02 -08:00
Rohit Yadav
f2ae0ae5ae PropertiesUtil: Refactor process config file method in utils, return map of key=value
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-10 15:55:01 -08:00
Min Chen
7f8262d45e Remove IdentityProxy and IdentityTypeAdapter class.
Signed-off-by: Min Chen <min.chen@citrix.com>
2013-01-09 17:40:58 -08:00
Rohit Yadav
db297a338f utils: Reflection utilities to get cmd, annotation and fields
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-08 18:54:29 -08:00
Rohit Yadav
0a25884215 Merge branch 'master' into api_refactoring 2013-01-07 17:28:57 -08:00
Hugo Trippaers
d616dcdd40 Summary: small fix for the classpath loader
Add the file separator if the path does not end with one
2013-01-07 22:17:55 +01:00
Rohit Yadav
0659c21f2d Get latest changes, Merge branch 'master' into api_refactoring 2013-01-04 17:22:57 -08:00
Noa Resare
0055d80211 CLOUDSTACK-771: maven: add mysql version reference to enable non-snapshot builds
If you update your build to build a version with a name not ending in -SNAPSHOT,
you are required to declare versions on all your depdendencies. There is already
a cs.mysql.version property, this patch makes sure it is used where appropriate.

Signed-off-by: Chip Childers <chip.childers@gmail.com>
2013-01-04 12:20:06 -05:00
Rohit Yadav
d235859168 Fix PluggableService to provide interface for ACL adapters etc. to get configs
- Fix interface to return array of strings, or filenames
- Fix StaticRoleBased ACL adapter to process config files by going through all pluggable services
- Refactor interface names

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-02 16:29:39 -08:00
Rohit Yadav
d8d87adc22 Merge branch 'master' into api_refactoring
Conflicts:
	api/src/com/cloud/api/commands/ListS3sCmd.java
	server/src/com/cloud/configuration/ConfigurationManagerImpl.java
	setup/db/db/schema-40to410.sql

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-02 13:57:55 -08:00
John Burwell
e4583ced2e S3-backed Secondary Storage 2013-01-02 10:28:47 -08:00
Rohit Yadav
78d70d349b Merge branch 'master' into api_refactoring
- Applies Isaac Chian'gs fix (CLOUDSTACK-648) to allow user change their password
- TODO: Fix response, only partially applied

Conflicts:
	api/src/org/apache/cloudstack/api/response/UserResponse.java
	client/tomcatconf/commands.properties.in
	server/src/com/cloud/api/ApiResponseHelper.java

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-25 09:51:17 -08:00
Prasanna Santhanam
1f1a13448f simulator: resurrect simulator hypervisor as plugin
Multiple fixes:
1. changes to the mvn configuration
    a. include simulator to client.war
    b. activate simulator by profile
2. templates for simulator
3. developer prefill for simulator
    a. Use deplydb-simulator to setup simulator db
4. Inherit components-simulator.xml from components.xml
5. ListVolumesCommand missed for MockStorageManager
6. Include simulator properties into utils/db.properties

TODO:
 Secondary storage VMs don't come up because ComponentLocator doesn't
retain a unique set of adapaters by name. Fix this in subsequent
checkin.
2012-12-23 19:28:57 -08:00
Rohit Yadav
296b49c2f8 Merge branch 'master' into test-merge-api
Conflicts:
	api/src/com/cloud/agent/api/BackupSnapshotCommand.java
	api/src/com/cloud/agent/api/storage/PrimaryStorageDownloadCommand.java
	api/src/com/cloud/agent/api/to/PortForwardingRuleTO.java
	api/src/com/cloud/network/NetworkService.java
	api/src/com/cloud/resource/ResourceService.java
	api/src/org/apache/cloudstack/api/ApiConstants.java
	api/src/org/apache/cloudstack/api/ResponseGenerator.java
	api/src/org/apache/cloudstack/api/response/SSHKeyPairResponse.java
	client/tomcatconf/commands.properties.in
	core/src/com/cloud/storage/SnapshotVO.java
	pom.xml
	server/src/com/cloud/api/ApiDispatcher.java
	server/src/com/cloud/api/ApiResponseHelper.java
	server/src/com/cloud/api/ApiServer.java
	server/src/com/cloud/configuration/ConfigurationManagerImpl.java
	server/src/com/cloud/network/NetworkManagerImpl.java
	server/src/com/cloud/network/rules/RulesManagerImpl.java
	server/src/com/cloud/offerings/NetworkOfferingVO.java
	server/src/com/cloud/resource/ResourceManagerImpl.java
	server/src/com/cloud/upgrade/dao/Upgrade40to41.java
	server/src/com/cloud/vm/UserVmManagerImpl.java
	server/test/com/cloud/vpc/MockNetworkManagerImpl.java
	setup/db/create-schema.sql
	setup/db/db/schema-40to410.sql

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-23 13:54:46 -08:00
Min Chen
a88ce6bb7f Remove IdentityProxy from CloudException and ExceptionResponse. 2012-12-19 23:49:44 -08:00
Rohit Yadav
ba5fba939c api: Fix method name findByXId to findByUuid
- findByXId is read as find using some external Id (used by external network devices for ex.)
- what we really need is findByUuid that finds a unique VO using a uuid string

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-18 17:44:17 -08:00
Rohit Yadav
837d21bb2d api: Implement findByXId in GenericDaoBase and EntityManagerImpl
Declare and define findByXId() in GenericDao and EntityManager.
This method would return a VO by UUID and EntityManager's interface would
take in the VO Interface.

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-18 04:10:36 -08:00
Rohit Yadav
5572707ec6 maven: Bump httpcore version, add guava and httpclient dependency
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-17 20:44:48 -08:00
Chip Childers
bec00cce46 CLOUDSTACK-505: Converted regex expressions to pre-compiled Pattern objects
This was done for performance reasons.

I also refined the regex strings and added more test cases for different
string scenarios.

Signed-off-by: Chip Childers <chip.childers@gmail.com>
2012-12-17 23:01:19 -05:00
Chip Childers
44da7b1841 CLOUDSTACK-505: Reworked approach to cleaning request / response strings
As noted in the bug, several of the API command in question
are async calls.  I've added a simple regex-based string cleaning
function, and have the request and response strings running through
it prior to being appended to the audit log.

Unit tests added for the new cleaning function as well.

The call to skip logging the createSSHKeyPair response remains intact
for now, although it should probably be scrubbed similarly to the
password fields.

Signed-off-by: Chip Childers <chip.childers@gmail.com>
2012-12-17 14:11:09 -05:00
Edison Su
b70c1a5a84 Backs NFS-based secondary storage with an S3-compatible object store. Periodically, a reaper thread synchronizes templates and ISOs stored on a NFS secondary storage mount with a configured S3 object store. It also pushes snapshots to the object store when they are created and downloads them in other zones on-demand. In addition to permitting the use of commodity or IaaS storage solutions for static assets, it provides a means of automatically synchronizing template and ISO assets across multiple zones. 2012-12-13 23:18:37 -08:00
Laszlo Hornyak
988ccfc45d removed some unused database connection properties
Signed-off-by: Laszlo Hornyak <lhornyak@redhat.com>
Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2012-12-13 22:46:29 -08:00
Likitha Shetty
2a8b9e5130 CLOUDSTACK-292: AWSAPI calls fail with 'com.cloud.utils.exception.CloudRuntimeException: DB Exception on: null' 2012-12-13 22:06:16 -08:00
Min Chen
b0ce8fd4ff api: Optimize and improve api, db call perfomance
This is part 1 of list API refactoring. Commands covered:
listVmsCmd, listRoutersCmd Response covered:
UserVmResponse, DomainRouterResponse. DB views created:
user_vm_view, domain_router_view.

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-05 20:06:20 -08:00
Rohit Yadav
6fc3bc3760 api_refactor: refactor vpn and vm apis
- Refactor VPN and VM APIs to admin and user pkgs
- Names space, org.apache.cloudstack
- Fix refactored apis in commands*.in
- Fix comments etc.
- Expand tabs, remove trailing whitespace

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-03 21:27:02 -08:00
Rohit Yadav
5edfc2760a refactor: remove redundant imports, fix trailing chars 2012-12-03 13:54:37 -08:00
adefanti
2a0d0104bd maven : declare mysql-connector-java dependency into dependencyManagement section of cloudstack pom and use the version 5.1.21 only
Signed-off-by: Hugo Trippaers <trippie@gmail.com>
2012-11-20 09:27:07 +01:00
Vijay Venkatachalam
527b5c8ee2 Autoscale: Supporting network element independent counter parameters Reviewed-By:Devdeep 2012-11-16 10:57:00 +05:30
Vijay
dda4d39b55 AutoScale changes in Apache master 2012-11-16 10:56:44 +05:30
Laszlo Hornyak
1a67e3f5c6 Summary: Extract redundant datasource code into method for Transaction.java
Reviewed-by: Prasanna Santhanam <tsp@apache.org>
Reported-by: Laszlo Hornyak <lhornyak@redhat.com>
Signed-off-by: Prasanna Santhanam <tsp@apache.org> 1352745925 +0530
2012-11-13 00:15:24 +05:30
Hugo Trippaers
f65b268a2e Active the testrun by default in maven
Exclude the tests that need a database, these should move to the
integration test phase or use an in memory database maybe.
2012-10-30 14:15:07 +01:00
Hugo Trippaers
6a9c588d33 Fix loading of external script so they will be loaded from the webapp classloader.
This change will allow the Script class to look for resources in the classpath of the webapp. This makes it possible to distribute the management server as a single prepackaged war. An added benefit is easier integration with IDE's that have the option to start webapps internally.

Also fixes a bug/feature in the URL handling were some components of the script path were translated to urlencoding. This  change means that files are more often found in the first two steps of the findScript method which saves some filesystem calls.
2012-10-26 15:32:00 +02:00
Alex Huang
525f96b7ae fixed tab problems 2012-10-25 13:13:47 -07:00
Min Chen
7b7f4cd1fd CLOUDSTACK-409: ThreadLocal Transaction and its db connection got reset for user managed db connnection, causing ClusterHeartBeat thread frequently trying to get db connection. Add unit test to test user managed transaction. 2012-10-25 13:06:50 -07:00
Edison Su
6a7215cedc fix default templateadaptor is not injected 2012-10-24 16:00:57 -07:00
Hugo Trippaers
5b2e1f42b7 The adapterlist needs to be merged instead of overwritten in
ComponentLocator.

When using the extend option in the components-nonoss.xml the adapter
lsit was overwritten (putAll on the map), but it should be merged
instead. This prevented adapters from the parent to be loaded.
2012-10-22 11:13:34 +02:00
Alena Prokharchyk
8f2d9a09e5 CLOUDSTACK-332: intermediate checkin fixing count parameter in listCommands
Fixes the count in commands:

listVolumes
listVirtualMachines
listSnapshots
listRouters
listFirewallRules
listPortForwardingRules
listLoadBalancerRules
listIpForwardingRules
listAccounts
listUsers
listDomains
listDomainChildren
listPublicIpAddresses
listAlerts
listAsyncJobs
listRemoteAccessVpns
listVpnUsers
listTags
listPrivateGateways
listNetworkACLs
listStaticRoutes

Conflicts:

	api/src/com/cloud/api/commands/ListVMsCmd.java
	api/src/com/cloud/api/commands/ListVolumesCmd.java
	api/src/com/cloud/network/lb/LoadBalancingRulesService.java
	server/src/com/cloud/network/firewall/FirewallManagerImpl.java
	server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java
	server/src/com/cloud/network/rules/RulesManagerImpl.java
	server/src/com/cloud/network/vpc/NetworkACLManagerImpl.java
	server/src/com/cloud/network/vpc/VpcManagerImpl.java
	server/src/com/cloud/network/vpn/RemoteAccessVpnManagerImpl.java
	server/src/com/cloud/tags/TaggedResourceManagerImpl.java
2012-10-12 13:58:59 -07:00