149 Commits

Author SHA1 Message Date
Rohit Yadav
a56f355ceb ApiServer: get role type from account manager using account
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-10 15:55:01 -08:00
Rohit Yadav
62a42723f9 APIAccessChecker: Make it check based on role type and not user
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-10 11:49:15 -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
657fb6ac0b ApiServer: Don't depend on plugin for apiname:cmd class mapping
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-09 17:20:46 -08:00
Rohit Yadav
72693ea382 server: Fix ApiServer init method, we won't use cfg files and it's not used there
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-09 17:20:46 -08:00
Rohit Yadav
765504c070 ApiServer: Fix apidiscovery fail case, fix comment
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-09 04:18:35 -08:00
Rohit Yadav
2c04dad529 ApiDiscovery: New plugin to help discover apis on mgmt server
- Introduces api/discovery plugin that helps discover apis on the mgmt server
- It's a pluggable service, therefore has it's own api-discovery_commands.properties
  where the discovery api, listApi can be blacklisted (by removing it), or it's
  role mask can be changed
- By default its response has all the apis
- Changes in other parts of the code to make it work, viz. components.xml, pom.xml,
  and in ApiServer where it is used as an adapter to get apiname, cmd mappings

The ApiDiscoveryService interface is a contract that the implementing class will
provide:

1. A means to get all the apis as a list of response, plugin is free to implement
   the response class, as long as it extends on the BaseResponse:

    ListResponse<? extends BaseResponse> listApis();

2. Provides a map of apiname as the key and cmd class as the value:

    Map<String, Class<?>> getApiNameCmdClassMapping();

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-08 18:54:29 -08:00
Min Chen
74c15a22a0 Create DB view for ListStoragePools API performance optimization.
Signed-off-by: Min Chen <min.chen@citrix.com>
2013-01-08 12:33:18 -08:00
Rohit Yadav
96b9164e4b Fix ACL processor and methods in ApiDispatcher and their usages
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-06 17:18:45 -08:00
Rohit Yadav
19cf665094 ApiServer: Fix debug output for role based user access checking
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-06 16:51:14 -08:00
Rohit Yadav
ed0637b8c2 api: Refactor move acl to org.apache.cloudstack
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-06 15:30:58 -08:00
Rohit Yadav
0428b30a5a Fix reflections cmd class loading in ApiServer
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-04 14:35:05 -08:00
Rohit Yadav
580bf857ff server: ApiServer inits with processing cmd classes to fill apiname:class mapping
- Add maven dependency reflections (wtfl license, apl compliant)
- Use reflections to recurse and get apiname:class mapping

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-02 18:43:59 -08:00
Min Chen
ebfb90e217 Create DB view for Account to speed up ListAccountsCmd, and add missing async job information for some response objects.
Signed-off-by: Min Chen <min.chen@citrix.com>
2013-01-02 17:38:58 -08:00
Min Chen
21c1623a03 Create DB view for Volume to speed up ListVolumesCmd.
Signed-off-by: Min Chen <min.chen@citrix.com>
2012-12-25 17:08:50 -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
e7fa1a86fb Create DB views to improve ListHostsCmd performance.
Signed-off-by: Min Chen <min.chen@citrix.com>
2012-12-22 21:47:05 -08:00
Min Chen
b14b39a69f Remove IdentityProxy from BaseResponse, ExtractResponse. Now
IdentityProxy is only referenced in CreateCmdResponse, which involves
some async job logic change. Since it is not impacting list performance,
will leave it there for now.

Signed-off-by: Min Chen <min.chen@citrix.com>
2012-12-20 16:52:52 -08:00
Min Chen
a88ce6bb7f Remove IdentityProxy from CloudException and ExceptionResponse. 2012-12-19 23:49:44 -08:00
Rohit Yadav
d54d8cbcd7 api: Fix ApiServer's handle() which runs on integration.api.port
- Fix URI parsing using apache hc
- Remove bloated c-like parsing code
- Fix param processing
- TODO: To use Guava's multimap

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-17 20:51:51 -08: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
Rohit Yadav
59fc89abe3 api: Fix ApiServer role base acl logic and response type value
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-16 18:13:29 -08:00
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
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