229 Commits

Author SHA1 Message Date
Chip Childers
82a17a413b CLOUDSTACK-505: Removed logging of deployVirtualMachine and resetPasswordForVirtualMachine commands.
Signed-off-by: Chip Childers <chip.childers@gmail.com>
2012-12-13 16:00:30 -05:00
Rohit Yadav
7dbdf786cc api: FIXME for api access checker adapter
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-12 14:21:38 -08:00
Rohit Yadav
c455cf9271 api: refactor common code to get classname for an api in ApiServer
- Refactor common code to get classname from apiname
- Fix search mechanism within api access checker adapter to:
  * check permissions
  * get class name for an apiname

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-11 14:17:47 -08:00
Rohit Yadav
79b54e6ac1 api: Fix obj injections in ApiServer
- Inject classes using Inject annotation
- Don't misuse component locator

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-11 14:16:25 -08:00
Rohit Yadav
8c4096dc59 api: Have apiserver injected by component locator
- Instantiate apiserver by injection, so all its entities are also created and injected
- Make the constructor protected

Thanks to Alex for helping out on this one.

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-10 17:38:44 -08:00
Rohit Yadav
151a7643ce api: Don't silently fail apiserver instance initialization
- ApiServer instance assumes cloudstartup servlet will initialize it
- Check and log if initialization fails

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-10 16:27:33 -08:00
Min Chen
bba96254f5 Refactoring ListVMGroupsCmd and InstanceGroupResponse. 2012-12-10 13:59:20 -08:00
Rohit Yadav
e398b1e47a api: Refactor command and response classes to org.apache.cloudstack.api.*
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-07 19:23:24 -08:00
Rohit Yadav
af28c06998 api: move and group all under command, org.apache.cloudstack.command.*
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-07 18:30:54 -08:00
Min Chen
30941c2d31 api: Refactoring ListEventsCmd and EventResponse, and create Event db view.
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-07 16:54:45 -08:00
Min Chen
8a313d7f84 api: SecurityGroupResponse and SecurityGroupRuleResponse refactoring
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-06 16:04:48 -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
Prachi Damle
a2306f4917 some more poc work 2012-11-29 16:10:09 -08:00
Prachi Damle
073863249a Some ACL POC work
Conflicts:

	server/src/com/cloud/api/ApiDispatcher.java
2012-11-29 16:09:47 -08:00
Chip Childers
e4a5173199 CLOUDSTACK-505: Do not log the command response object for the createSSHKeyPair command.
Signed-off-by: Chip Childers <chip.childers@gmail.com>
2012-11-29 12:24:42 -05:00
Kelven Yang
d79f1f6fdc Replace Adapters and PluggableServices, use Spring to load them 2012-11-07 15:03:24 -08:00
Kishan Kavala
f0f33bf4da Added Mock ApiServer, Regions API calls with api keys 2012-10-17 14:16:36 +05:30
Alena Prokharchyk
339aa41442 CLOUDSTACK-304: Synchronization support for createSnapshot command - don't sent more than "concurrent.snapshots.threshold.perhost" createSnapshots commands to the backend host.
Conflicts:

	core/src/com/cloud/async/AsyncJobVO.java
	core/src/com/cloud/async/SyncQueueVO.java
	server/src/com/cloud/api/ApiDispatcher.java
	server/src/com/cloud/api/ApiServer.java
	server/src/com/cloud/async/AsyncJobManagerImpl.java
	server/src/com/cloud/async/SyncQueueManager.java
	server/src/com/cloud/async/SyncQueueManagerImpl.java
	server/src/com/cloud/async/dao/SyncQueueDao.java
	server/src/com/cloud/storage/snapshot/SnapshotSchedulerImpl.java
	server/test/com/cloud/async/TestSyncQueueManager.java
	setup/db/create-schema.sql
2012-10-10 13:40:00 -07:00
Alena Prokharchyk
048c5e50cf Merge branch 'master' into vpc
Conflicts:
	utils/test/com/cloud/utils/component/MockComponentLocator.java
2012-08-08 11:50:39 -07:00
Alex Huang
c1c952b42b should have used non url safe 2012-08-07 16:58:16 -07:00
Alex Huang
a6a864a1a8 Removed Base64 file and use the apache version 2012-08-07 15:41:54 -07:00
Alena Prokharchyk
31f9d718fb Merge branch 'master' into vpc
Conflicts:
	server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java
2012-07-03 17:32:50 -07:00
David Nalley
e87558256c Patch from Chip Childers
https://reviews.apache.org/r/5704/
License header updates for the server folder
2012-07-02 09:51:21 -04:00
Chip Childers
8f71a2927f License header updates for the server folder. 2012-07-02 08:58:10 -04:00
Alena Prokharchyk
634cd78baa Merge branch 'master' into vpc
Conflicts:
	api/src/com/cloud/api/ApiConstants.java
	api/src/com/cloud/api/BaseCmd.java
	api/src/com/cloud/api/ResponseGenerator.java
	api/src/com/cloud/api/commands/ListNetworksCmd.java
	api/src/com/cloud/api/response/NetworkResponse.java
	api/src/com/cloud/event/EventTypes.java
	api/src/com/cloud/network/NetworkService.java
	client/tomcatconf/commands.properties.in
	scripts/network/domr/getDomRVersion.sh
	scripts/network/domr/ipassoc.sh
	scripts/network/domr/l2tp_vpn.sh
	scripts/network/domr/networkUsage.sh
	scripts/network/domr/router_proxy.sh
	server/src/com/cloud/api/ApiDBUtils.java
	server/src/com/cloud/api/ApiResponseHelper.java
	server/src/com/cloud/configuration/DefaultComponentLibrary.java
	server/src/com/cloud/network/NetworkManagerImpl.java
	server/src/com/cloud/network/dao/IPAddressDao.java
	server/src/com/cloud/network/dao/IPAddressDaoImpl.java
	setup/apidoc/gen_toc.py
	setup/db/create-schema.sql
	wscript
2012-06-28 17:41:40 -07:00
saksham
f6d16d0ab5 CS-15018: Event USER.LOGIN should contain the client IP address. Changes made in accordance with the coding convention.
Reviewed-by: Alena Prokharchyk
2012-06-18 10:18:30 -07:00
Alena Prokharchyk
60b52f90dd Initial checkin for VPC feature:
1) Added API frameworks for the feature. New commands:
* CreateVPCCmd
* ListVPCsCmd
* DeleteVPCCmd
* UpdateVPCCmd
* CreateVPCOfferingCmd
* UpdateVPCOfferingCmd
* DeleteVPCOfferingCmd
* ListVPCOfferingsCmd

2) New db tables:

* `cloud`.`vpc`
* `cloud`.`vpc_offerings`
* `cloud`.`vpc_offering_service_map`

and corresponding VO/Dao objects.

Added vpc_id field to `cloud.`networks` table - not null when network belongs to VPC

3) New Manager and Service interfaces- VpcManager/VpcService

4) Automatically create new VpcOffering (if doesn't exist) on system start

5) New Action events:

* VPC.CREATE
* VPC.UPDATE
* VPC.DELETE

* VPC.OFFERING.CREATE
* VPC.OFFERING.UPDATE
* VPC.OFFERING.DELETE

Conflicts:

	api/src/com/cloud/api/ApiConstants.java
	client/tomcatconf/commands.properties.in
	server/src/com/cloud/api/ApiDBUtils.java
	server/src/com/cloud/network/NetworkManagerImpl.java
	setup/db/create-schema.sql
2012-06-15 13:53:59 -07:00
frank
2f634c0913 Switch to Apache license 2012-04-03 04:50:05 -07:00
prachi
e43914ab58 Bug 14336 - Login API does not return UUID's
Changes done:
- Provide UUID for userid and domainid only while constructing the login response. Session will hold the DB id's as before, to ensure other parts keep working.
- This reverts commit de28aa3ddde5b601f2f234f2eccef871fbaf1a06.
2012-03-20 16:59:04 -07:00
prachi
a5d7cd3d51 Bug 14336 - Login API does not return UUID's
Changes:
- login API now returns back UUID for user and domain
2012-03-20 16:59:02 -07:00
prachi
280d533a6f Bug 14047 - login API fails when UUID is used for domain_id
Changes:
- API should accept UUID for domain and convert to id when needed
2012-03-20 16:59:00 -07:00
Alena Prokharchyk
e53cfeceb6 bug 14379: don't enable 8096 port by default (set global config variable to null by default, and don't create a listener on this port unless its set to valid integer) 2012-03-19 16:19:38 -07:00
Vijayendra Bhamidipati
57c54e23d6 Bug 14060: Include a CloudStack error code in an Exception Response
Bug 13127: API error text refer to database ids instead of uuids

Code-Reviewers: Ewan Mellor, Kelven Yang

Description:

	1. A new class CSExceptionErrorCode has been added to utils.
	   It contains a list of error codes for each type of
	   Exception class. Use fully qualified package paths for
	   Exceptions in CSExceptionErrorCode.  We log any exception
	   name not found in the list of error codes for exceptions.

	2. Whenever we throw an exception exobj anywhere in the
	   CS code, the CSErrorCode is set in the base class
	   constructor.

	3. We add a new field csErrorCode in classes CloudException,
	   RuntimeCloudException, ExecutionException and
	   ExceptionResponse.

	4. Two places in ApiServer.java were wrongly modified when
	   putting in changes for bug 13127 to not throw an exception.
	   This has been corrected in this commit.
2012-03-05 17:39:09 -08:00
Vijayendra Bhamidipati
59631452b9 Bug 13127: API error text refer to database ids instead of uuids
Description:

	Modify Exception handling to enable addition of multiple
	uuids in a single exception thrown by API functions. Both
	XML and JSON outputs will store all uuids and Fieldnames.
	This will make it easier to provide more information when
	an exception occurs - for example, a zone id, a cluster id,
	host id, and then a specific property id.
2012-02-27 17:55:03 -08:00
Vijayendra Bhamidipati
bfe1122bc6 Bug 13127: API error text refer to database ids instead of uuids
Description:

	Added a field name for the db id in the IdentityProxy class, and
	modified setProxyObject() to take an additional id name parameter.
	This will let us know the name of the uuid that we are returning.
	E.g.- domainId, zoneId, etc. The client can view this field in
	the json/xml output. Modified the JSON/XML serialization routines
	to append this new parameter to the serialized output for Exception
	Responses.
2012-02-27 17:55:01 -08:00
Vijayendra Bhamidipati
e5b4cf5cf1 Bug 13127: API error text refer to database ids instead of uuids
Description:

	1) Put in an IdentityProxy object in the ExceptionResponse class.
	   This allows us to copy over the IdentityProxy object contained
	   in the exception caught by handlerequest() when thrown by the
	   command's execute() method, into the Response object that is
	   prepared to return an exception response to the calling API
	   invocation.

	2) Modified the GSON serialization method to conver the entire
	   exception object into JSON format and not just the error text.

	3) Modify the updateDomain API to populate the exception it throws
	   upon detecting a duplicate domain to include the tablename and
	   domain db id in the exception's IdentityProxy object.

	NOTE:
	1) We can modify the base exception classes and the ExceptionResponse
	   class to contain a list of IdentityProxy objects rather than a
	   single one.
	2) We will need to modify all commands such that wherever applicable
	   (wherever a db id is involved), they populate the IdentityProxy
	   object(s) before throwing an exception.
2012-02-27 17:54:58 -08:00
Vijayendra Bhamidipati
c3fbe29cf8 Bug 13127: API error text refer to database ids instead of uuids
Description:

	1) Added a setProxyObject() method to CloudException and RuntimeCloudException
	2) Modified a bunch of throw exceptions in NetworkManagerImpl.java to call setProxyObject() before throwing an exception.
	3) Changed scope of ProxyIdentity attribute to protected.
	4) Added routines to ServerApiException to get/set IdentityProxy object, and
	   routine in RuntimeCloudException to get the Idproxy object.
	5) Modified the exception handling around the dispatcher and handlerequest()
	   to copy over the IdentityProxy information before rethrowing an exception
	   eventually back to handle().
	6) Removed duplicate IdentityProxy object in ServerApiException.
	   It was extending RuntimeCloudException which already had an
	   IdentityProxy object.
2012-02-27 17:54:56 -08:00
Alena Prokharchyk
294d3a2fda Code format fixes 2012-02-10 15:10:21 -08:00
Alena Prokharchyk
1490e45a1c Fixed format style in a bunch of files (replaced tabs with spaces as a part of it) 2012-02-03 13:49:11 -08:00
Alena Prokharchyk
c581506103 bug 12306: list* command revamp 2012-01-09 10:07:42 -08:00
Alena Prokharchyk
0731dac370 bug 12399: introduced periodic thread that expires Project invitations
status 12399: resolved fixed
2011-12-09 12:21:41 -08:00
prachi
0769a3b3f3 API Server changes needed to read a properties file present within a jar provided in classpath. 2011-11-29 18:02:19 -08:00
Alex Huang
f6fcaa49ec Merge complete except for virtualnetworkappliancemanager 2011-11-10 15:18:16 -08:00
Alena
0785b64306 bug 11923: don't expose command name in the exception response when command is not available
status 11923: resolved fixed
reviewed-by: Will Chan
2011-11-07 18:00:33 -08:00
Kelven Yang
9489d6ffeb 1) Fix a serialization problem in command inherits AsyncCreateCommand.
2) Deal with special IDs (i.e. -1) in UUID translation
2011-11-07 18:00:14 -08:00
Kelven Yang
7e9b210d5c bug 6745: Fix problems in Async create commands 2011-11-03 07:34:02 -07:00
prachi
8570b25506 NAAS: APIServer changes to introduce framework to read commands from pluggable components having separate commands.properties file
Changes:
- Added a new interface 'PluggableService'
- Any component that can be packaged separately from cloudstack, can implement this interface and provide its own property file listing the API commands the component supports
- As an example have made VirtualNetworkApplianceService pluggable and a new configureRouter command is added
- ComponentLocator reads all the pluggable service from componentLibrary or from components.xml and instantiates the services.
- As an example, DefaultComponentLibrary adds the pluggable service 'VirtualNetworkApplianceService'
- Also components.xml.in has an entry to show how a pluggable service can be added, but it is commented out.
- APIServer now reads the commands for each pluggable service and when a command for such a service is called, APIServer sets the required instance of the pluggable service in the coomand.
- To do this a new annotation '@PlugService' is added that is processed by APIServer. This eliminates the dependency on the BaseCmd to instantiate the service instances.
2011-10-11 17:34:57 -07:00
alena
a1331d1cfc Intermidiate checkin to Project feature:
1) Introduce new managers - ProjectManager and DomainManager. Moved all domain related code from AccountManager to DomainManager.
2) Moved some code from ManagementServerImpl to the correct managers.
3) New resource limit for Domain - Project
2011-09-20 18:35:28 -07:00