315 Commits

Author SHA1 Message Date
Min Chen
6e55776795 CLOUDSTACK-2331: Failed to display exception object information in case of CloudRuntimeException. 2013-05-28 16:01:33 -07:00
Nitin Mehta
c11dbad9c9 merge master 2013-05-11 15:28:43 +05:30
Vijayendra Bhamidipati
b0caae6b33 CLOUDSTACK-1086: DeployVirtualMachine userdata enhancements
Description:

	Currently, userdata sent over to the DeployVMCmd and
	updateVMCmd commands can be upto 2K in length, whether
	sent over GET or POST. We remove this limitation for
	POST to change this limit to 32K. Also enabling lazy
	load on userdata to improve performance during reads
	of large sized userdata from user VM records.

Signed-off-by: Min Chen <min.chen@citrix.com>
2013-04-24 13:42:38 +05:30
Kelven Yang
3ab744d100 CLOUDSTACK-1795: implement custom AOP to fully support legacy CloudStack AOP semantcis
Signed-off-by: Chip Childers <chip.childers@gmail.com>
2013-03-29 11:12:36 -07:00
Murali Reddy
c5fb8349bf CLOUDSTACK-653 : High Availability: implement GSLB (Global Server Load
Balancing) capability for ELB service

merging GSLB feature
2013-03-27 17:54:07 +05:30
Likitha Shetty
da89946ca9 CLOUDSTACK-1625. NPE with updateResourceCount when && is passed thru API.
If any API contains '&' i.e. no key value pair or '&<paramter-name>' i.e. a parameter without a value, then we get an NPE as owasp.esapi.StringUtilities.stripControls deosn't handle NPE.
2013-03-12 12:00:46 +05:30
Kelven Yang
333dd810d2 CLOUDSTACK-1339: Using Sping interface injection pattern to avoid using CGLIB proxying mode. Spring with CGLIB proxying will concflict with CGLIB usage in CloudStack DB code, CloudStack CGLIB usage can cause Spring to lose tack of its proxied object and therefore creates a massive amount of objects in memory 2013-03-05 19:03:30 -05:00
Min Chen
5750fd9631 CLOUDSTACK-1190: make APIChecker throw one sensible exception. 2013-03-05 09:44:08 -08:00
frank
1f15c1e9e7 CloudStack CLOUDSTACK-774
Supporting kickstart in CloudStack baremetal

fixing bugs to align to new code base

Conflicts:

	client/tomcatconf/componentContext.xml.in
2013-02-21 15:42:38 -08:00
Rohit Yadav
8094e933b0 ApiServer: Get rid of finding system account and user at init() time
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-02-16 17:09:37 +05:30
Likitha Shetty
87b668b71b CLOUDSTACK-863: Fix Non-printable characters in api call
Non-printable characters results in empty pages for all users loading the
corrupted object in the web interface. It also results in the API call results
getting truncated with an error when it encounters the non-printable characters.
Every decoded parameter value is checked for control character using OWASP's
ESAPI library.

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-02-16 11:54:12 +05:30
Rohit Yadav
b59a18d1a1 CLOUDSTACK-1210: Fix pluggable service, apiserver, mgmt server impl, api-discovery
- Mgmt server impl is a pluggable service, fix it's method
- Fix getCommands() to return all cmd api classes supported by this mgmt server
- For api-discovery, get commands from pluggable services only, don't use reflections
- Don't use reflections in ApiServer, iterate pluggableservices
- Fix api discovery unit test
- The fix was done automatically using following python program along with
  following step:

1. Get all apis provided by default mgmt server, all of them are in cloud-api now
   cd api/src/org/apache/cloudstack/api/command
   find . >> apis
2. For all apis, generate java code that adds the class to the cmdList arraylist:
   f = open('apis', 'r')
   data = f.read()
   f.close()
   output = ""
   for a in data.split('\n'):
     output += "cmdList.add(%s);" % a.split('/')[-1].replace('.java', '.class')
   # wrote output to a file, copied content to mgmt server impl's getCommands()
   # similarly, fixed import statements using same code, splitting on /

Testing:
Ran apiserver, put breakpoints in ApiServer's init() where classes are processed
Total cmd classes found by reflections (ReflectUtil) = 354
Total cmd classes found by getCommands for all pluggable services = 354

Next, copied the comma separated values for each set to a string in ipython, a & b
set(a).difference(set(b)) returned null.

The above test implies both set of cmd classes found by both methods, i.e. using
reflections and using getCommands() had same set of apis and all were unique.

Conclusion:
The changes are idempotent and don't break api server's cmd class api discovery
processing.

BUG-ID: CLOUDSTACK-1210

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-02-08 16:48:13 +05:30
Rohit Yadav
dfcd9b05a0 ApiServer: Ask pluggable services to return list of apis to ApiServer
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-02-06 16:54:46 +05:30
Rohit Yadav
2b267c1ceb CLOUDSTACK-1142: Refactor handleRequest definition, clean redundant code
- Get rid of boolean decode arg
- Method assumes that OTW params have been already decoded
- Remove redundant code that tries to decode again based on boolean arg

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-02-05 10:37:09 +05:30
Mice Xia
d8062e5633 CLOUDSTACK-1142 Testing LDAP Auth Failed - due to % being illegal character in queryfilter 2013-02-05 11:26:42 +08:00
Kelven Yang
7b75f0d990 Sync master to javelin one more time 2013-02-01 11:37:33 -08:00
Kishan Kavala
9ea90c3359 Merge branch 'master' into regions
Conflicts:
	client/tomcatconf/components.xml.in
	server/src/com/cloud/api/ApiResponseHelper.java
2013-02-01 11:38:16 +05:30
Murali Reddy
e7a554fc6a Merging events framework branch into master. This commit will bring
following changes

   - introduced notion of event bus with publish, subscribe, unsubscribe
     semantics

   - a plug-in can implement the EventBus abstraction to provide event
     bug to CloudStack

   - A rabbitMQ based plug-in that can interact with AMQP servers to
     provide message broker based event-bug

   - stream lines, action events, usage events, alerts publishing in to
     convineance classed which are also used to publish corresponding
     event on to event bus

   - introduced notion of state change event. On a state change, in the
     state machine corrsponding to the resource, a state change event is
     published on the event bug

   - associated a state machined with Snapshot and Network objects

   - Virtual Machine, Volume, Snaphost, Network object state changes wil
     result in a state change event
2013-02-01 01:37:24 +05:30
Kishan Kavala
8b1a5b1de2 - Separated RegionServiceImpl and RegionManagerImpl
- Added comments
- Changed package name to org.apache.cloudstack.region
2013-01-31 18:08:20 +05:30
Kishan Kavala
def9fd1f2e remove finduser, findaccount, finddomain APIs 2013-01-28 17:04:25 +05:30
Kishan Kavala
c6ae19d12f Merge branch 'master' into regions 2013-01-25 18:49:47 +05:30
Kishan Kavala
de20cb6c1a Apply API refactoring changes. Make changes to Regions API to work with new code 2013-01-25 18:45:01 +05:30
Kishan Kavala
1f57d925eb Apply API refactoring changes. Make changes to Regions API to work with new code 2013-01-25 18:41:59 +05:30
Rohit Yadav
356866c72b Merge branch 'master' into javelin
- Fixed new join dao impls as spring components
- Fixed component context xml to load api rate limit checker
- Fixed root pom.xml for duplicate plugin
- Fixed list data centers method
- Fixed following conflicts:
	api/src/org/apache/cloudstack/api/command/admin/network/CreateNetworkOfferingCmd.java
	api/src/org/apache/cloudstack/api/command/user/offering/ListServiceOfferingsCmd.java
	api/src/org/apache/cloudstack/api/command/user/template/DeleteTemplateCmd.java
	api/src/org/apache/cloudstack/api/command/user/template/ExtractTemplateCmd.java
	plugins/api/discovery/src/org/apache/cloudstack/discovery/ApiDiscoveryServiceImpl.java
	server/src/com/cloud/api/ApiDBUtils.java
	server/src/com/cloud/api/ApiServer.java
	server/src/com/cloud/api/query/QueryManagerImpl.java
	server/src/com/cloud/configuration/DefaultComponentLibrary.java
	server/src/com/cloud/server/ManagementServerImpl.java
	server/src/com/cloud/storage/swift/SwiftManagerImpl.java

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-24 19:18:53 -08:00
Min Chen
26be5ce2df CLOUDSTACK-355: create DB view for ZoneResponse to fix count for
listZonesByCmd.
2013-01-22 16:39:45 -08:00
Min Chen
6e40c33628 CLOUDSTACK-355: create DB view for ServiceOfferingResponse to fix count
for ListServiceOfferingsCmd.
2013-01-21 15:25:49 -08:00
Min Chen
6db719d58b CLOUDSTACK-355: Create DB view to fix count issue for
listDiskOfferingsCmd.
2013-01-21 10:50:10 -08:00
Alex Huang
10d9c019a9 All merge conflicts resolved 2013-01-18 12:14:57 -08:00
Min Chen
2fd1d476b4 Merge branch 'master' into api_limit 2013-01-17 21:23:50 -08:00
Kelven Yang
17a94b20ec Always use premium setting in ConsoleProxyManager 2013-01-17 18:23:06 -08:00
Rohit Yadav
f264571e92 ApiServer: Fix default reponse type for apiserver on intergration port to xml
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-17 17:03:27 -08:00
Min Chen
c1a540c6bb Merge branch 'master' into api_limit
Conflicts:
	api/src/org/apache/cloudstack/api/BaseCmd.java
	server/src/com/cloud/api/ApiServer.java
	server/src/com/cloud/api/ApiServlet.java

Signed-off-by: Min Chen <min.chen@citrix.com>
2013-01-16 22:48:22 -08:00
Min Chen
3dabd5fbf3 Clean up ApiServer, ApiServlet and ApiDispatcher flow to handle various CloudRuntimeException
and CloudException in one place, and Introduced ApiErrorCode to handle CloudStack API error
code to standard Http code mapping.

Signed-off-by: Min Chen <min.chen@citrix.com>
2013-01-16 22:36:34 -08: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
Kelven Yang
4c1257bf18 Handle proxy object situation in dispatching API command 2013-01-16 11:28:09 -08:00
Kelven Yang
df684261cf Put command classes under Spring injection framework 2013-01-15 18:07:19 -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
Min Chen
7f1486e2dc We need to catch PermissionDeniedException in checking if command is
available to an user.
2013-01-15 11:43:59 -08:00
Rohit Yadav
8f27c711e5 ApiServer: Process through chain of api access checker, on failure it will throw exception
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-14 19:01:26 -08:00
Min Chen
4d0c850dc8 Fix plugin component configuration. 2013-01-14 17:13:18 -08:00
Rohit Yadav
896e505da6 APIChecker: Make interface generic, pass user and not just role
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-14 15:08:45 -08:00
Kelven Yang
6dfbcee63d Fix singleton initialization in ApiServer/ApiDispatcher to make it work under Spring bootstraped environment 2013-01-14 13:57:30 -08:00
Rohit Yadav
38eaa04b98 Pull changes from master into javelin
- Disables simulator plugin, breaks build, available via simulator profile
- Fixes spring injections
- Fix api,acl plugins, ApiServer, ApiDispatcher
- Fix other merge conflicts

Conflicts:
	docs/en-US/external-firewalls-and-load-balancers.xml
	plugins/acl/static-role-based/src/org/apache/cloudstack/acl/StaticRoleBasedAPIAccessChecker.java
	server/src/com/cloud/api/ApiDispatcher.java
	server/src/com/cloud/api/ApiServer.java
	server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java
	utils/test/com/cloud/utils/log/CglibThrowableRendererTest.java

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-12 06:02:54 -08:00
Rohit Yadav
ad063ed610 StaticRoleBasedAPIAccessChecker: Throw exception on failed check
Plugin should not be responsible for existence of checking an API, this was wrong.
Throw exception boldly when checkAccess fails.

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-11 19:24:11 -08:00
Rohit Yadav
0dca44efe8 ApiServer: Debug messages, don't spam with info, remove identity helper in ResponseGenerator
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-11 18:44:20 -08:00
Rohit Yadav
24687973a8 ApiServer: Get rid of IdentityDao, reuse domain manager to get domain id
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-11 18:44:19 -08:00
Min Chen
57e67c57d7 Merge branch 'master' into api_limit
Conflicts:
	server/src/com/cloud/api/ApiServer.java

Signed-off-by: Min Chen <min.chen@citrix.com>
2013-01-11 15:50:21 -08:00
Kelven Yang
f57dcaa820 Loadable components to be in separted Spring component bundling 2013-01-11 15:33:15 -08:00
Kelven Yang
53da542001 Another round of fixes after merge 2013-01-11 15:21:04 -08:00
Rohit Yadav
74bb043c37 APIChecker: Rename refactor and add interface checkExistence
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-10 18:51:30 -08:00