251 Commits

Author SHA1 Message Date
Daan Hoogland
e431538b0a findbugs possible nullpointer mitigated 2014-02-26 11:56:49 +01:00
Mandar Barve
b0c6d47347 - Updated APICommand annotation to add new flags that indicate if API request or response carry sensitive info - Updated all API classes with the new annotation flag values as per the API's sensitivity - Updated server code to check response annotation before audit logging
Signed-off-by: Daan Hoogland <daan@onecht.net>
(cherry picked from commit df270d6387c362b960064ee5123c14782e767a19)
Signed-off-by: Daan Hoogland <daan@onecht.net>
2014-02-25 22:59:10 +01:00
Alena Prokharchyk
782c530685 Revert "CLOUDSTACK-6003 fixing plus refactoring dispatcher" as it breaks API dispatching for commands having Map<String,String> as a parameter type
This reverts commit 447430c3df38c36d947c44c4aebd961d8cbb14c4.

Conflicts:
	api/src/org/apache/cloudstack/api/BaseCmd.java
	server/src/com/cloud/api/ApiDispatcher.java
	server/src/com/cloud/network/as/AutoScaleManagerImpl.java
	server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
2014-02-06 14:46:58 -08:00
Antonio Fornie
447430c3df CLOUDSTACK-6003 fixing plus refactoring dispatcher
Signed-off-by: Daan Hoogland <daan@onecht.net>
(cherry picked from commit a9bcc1ea3b7dfd3fcc5c795b0095c77851ebe618)
Signed-off-by: Daan Hoogland <daan@onecht.net>
2014-02-04 13:37:08 +01:00
Daan Hoogland
a71871d11c findbugs: fixes for ApiServer, ApiSerializerHelper and
ApiXmlDocWriter(cherry picked from commit
9aced41d708acd22b43ef0e512fa2cc657a6c0a2)
2014-01-28 14:47:06 +01:00
Min Chen
3689f72f27 CLOUDSTACK-5913:API rate limiting throws a different error than expected
when Throttle limit hit in the API.
2014-01-20 15:49:19 -08:00
Likitha Shetty
16d36dd75f Fix checkstyle 2014-01-14 14:04:57 +05:30
Likitha Shetty
e5512960af CLOUDSTACK-5865. Unable to use login API if domainId parameter is id and not uuid 2014-01-14 13:47:27 +05:30
Alex Huang
be5e5cc641 All Checkstyle problems corrected 2013-12-12 12:26:07 -08:00
Alex Huang
433a631916 Reformat of source code to set a stable base for the future. I couldn't get checkstyle enabled. There's still about a thousand errors from checkstyle. Most of it from length errors from comments and strings. Will attempt to remove those tonight. This change is so large I just want to get it in before any merge nightmares. The changes are fairly minor though and I did a full compile and start a server with the reformat code. 2013-11-21 07:56:47 -08:00
Alex Huang
d620df2bdd Reformatted all of the code. 2013-11-21 06:15:26 -08:00
Likitha Shetty
6aafb9c50d CLOUDSTACK-5227. Cannot pass Japanese characters as parameter values to an API.
During API check for control characters use pattern matching to avoid identifying all non-printable characters as control characters.
2013-11-21 13:40:06 +05:30
Alex Huang
8d62744681 Reformat all source code. Added checkstyle to check the source code 2013-11-20 07:26:53 -08:00
Darren Shepherd
e3280bdba2 Merge remote-tracking branch 'origin/spring-modularization'
Conflicts:
	client/tomcatconf/applicationContext.xml.in
	client/tomcatconf/nonossComponentContext.xml.in
	client/tomcatconf/simulatorComponentContext.xml.in
	framework/db/src/com/cloud/utils/db/Transaction.java
	plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockAgentManagerImpl.java
	server/src/com/cloud/api/ApiServer.java
	server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java
2013-10-23 11:14:42 -07:00
Darren Shepherd
711ad386d1 Random cleanup 2013-10-16 16:18:49 -07:00
Darren Shepherd
f62e28c1ec New Transaction API
Introduction of a new Transaction API that is more consistent with the style
of Spring's transaction managment.  The existing Transaction class was renamed
to TransactionLegacy.  All of the non-DAO code in the management server has been
updated to use the new Transaction API.
2013-10-16 09:21:00 -07:00
Darren Shepherd
67186429e1 Spring Modularization
ACS is now comprised of a hierarchy of spring application contexts.
Each plugin can contribute configuration files to add to an existing
module or create it's own module.

Additionally, for the mgmt server, ACS custom AOP is no longer used
and instead we use Spring AOP to manage interceptors.
2013-10-02 15:41:04 -07:00
Darren Shepherd
aed5e9dc2a Add Manage Context framework
The managed context framework provides a simple way to add logic
to ACS at the various entry points of the system.  As threads are
launched and ran listeners can be registered for onEntry or onLeave
of the managed context.  This framework will be used specifically
to handle DB transaction checking and setting up the CallContext.
This framework is need to transition away from ACS custom AOP to
Spring AOP.
2013-10-02 13:09:52 -07:00
Darren Shepherd
efbfae723e Switch to setter injection for extensibility
Various classes are using member injection to inject extensible objects.
Really those object should come from an AdapterList that is injected in.
This patch switches the code to use setter injection that will later allow
spring to inject an AdapterList or something similar to allow
extensibility.
2013-09-30 09:45:07 -07:00
Alex Huang
b8e79c30a8 Compile complete 2013-09-06 15:40:37 -07:00
Min Chen
97ff4981c5 CLOUDSTACK-3274: Remove duplicate cleanString calls in logging api for
performance improvement.
2013-08-16 11:10:25 -07:00
Alex Huang
5495f10bce Revert "Reverting the range of commits that broke the build"
This reverts commit b59e3aaefced03d40d5b4b63c421c69743bcd387.
2013-08-08 15:02:40 -07:00
Prasanna Santhanam
b59e3aaefc Reverting the range of commits that broke the build
This reverts commits 30c33415..f6a2c817bc

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-08-08 14:46:56 +05:30
Alex Huang
942f282a6e Moved config into it's own package 2013-08-07 16:41:02 -07:00
Alex Huang
8930cfa983 Switched over to use the new jobs framework 2013-08-02 11:07:55 -07:00
Chiradeep Vittal
1744ed7ad5 CLOUDSTACK-3626 register the correct user and account for api calls made with api keys and secret keys 2013-07-25 14:45:59 +05:30
Alena Prokharchyk
d0422904d7 CLOUDSTACK-3711: return descriptive error message to the regular user when his resource limit has exceed. No harm in returning this info as the user aware of the resource limits/number of resources available for allocation, for his account
Conflicts:
	server/src/com/cloud/api/ApiServer.java
2013-07-22 10:28:42 -07:00
Min Chen
d423a755f5 CLOUDSTACK-3274: API Refactoring: secretkey and accesskey of the backing
store is found in plaintext in the logs.

Conflicts:
	server/src/com/cloud/api/ApiServer.java
	server/src/com/cloud/api/ApiServlet.java
2013-07-20 18:01:49 -07:00
ahuang
11971b5a58 Bring over from vmsync changes in utils package. Simple changes. New files are not being used yet in master 2013-07-17 18:29:42 -07:00
ahuang
11e1e585b1 UserContext switched to CallContext. Added generic storage mechanism for other code to carry information throughout a call. Made the calling User and Account a must have. Added an interface to carry entities in error. Fixed up the code. Part of the vmsync branch 2013-07-16 11:24:21 -07:00
Ryan Dietrich
70f33efa72 CLOUDSTACK-3190: Async jobs actions now trigger event bus messages to be
published

-AsyncJobManagerImpl to publish async job events when async jobs are
created, updated and completed
2013-07-05 17:48:25 +05:30
Prasanna Santhanam
767ed065c5 CLOUDSTACK-2815: Include dedication in simulator context
SimulatoComponentContext need sto include the dedicated resource manager
to see the commands/apis exposed by it.

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-06-03 21:51:18 +05:30
Alena Prokharchyk
da53ef1aed ApiServer: fixed non primitive Long "snapshotLimit" comparsion 2013-05-30 15:21:31 -07:00
Alena Prokharchyk
62ad6c4519 ApiServer: replaced hardcoded value of the integration.api.port paramter with the reference to the actual paramter name 2013-05-30 15:21:31 -07:00
Alena Prokharchyk
1300fc8128 AccountManager/Service: reduced visibility for methods that are called only from AccountManagerImpl itself 2013-05-30 11:18:32 -07:00
Alena Prokharchyk
0ea409546e RulesManager interface: changed visibility for methods that are being called only from RulesManagerImpl class, from public and defined in the interface, to private/protected 2013-05-30 11:18:31 -07:00
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