1920 Commits

Author SHA1 Message Date
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
39b829bffe api: ACL annotation and checkAccess removal refactor for StopVMCmd
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-06 17:19:49 -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
a9ab42d962 api: Extend to infra. interface entities that are not associated with any account
Includes, datacenter, pod, sotragenetworkiprange,vlan,diskoffering,networkoffering,
serviceoffering.

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-06 15:36:59 -08:00
Rohit Yadav
e51bc8b161 InfrastructureEntity: New interface contract for classes not associated with any account
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-06 15:32:40 -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
b246ed7be7 api: Fix name fields for autoscale @APICommand annotation
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-06 14:56:30 -08:00
Rohit Yadav
8b085d3308 api: Move base template*cmd class to org.apache.cloudstack.api, fix names and annotations 2013-01-06 14:46:02 -08:00
Rohit Yadav
6a112bd64c api: Rename Validator to Validate, cosmetic fixes
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-05 16:52:53 -08:00
Rohit Yadav
63481ecb34 CLOUDSTACK-212: Move api response classes to cloud-api under org.apache.cloudstack
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-05 16:27:36 -08:00
Rohit Yadav
c5abc180ab CLOUDSTACK-212: Move api/test pkg to org.apache.cloudstack
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-05 15:53:59 -08:00
Rohit Yadav
73a0c3e07f api: Refactor move storagepool apis to storage pkg
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-05 15:32:58 -08:00
Rohit Yadav
f07a98a740 api: Refactor and move s3 to api.command.admin.storage
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-05 15:30:38 -08:00
Rohit Yadav
5119785cf7 Get latest changes, merge branch 'master' into api_refactoring
Conflicts:
	api/src/com/cloud/network/element/RemoteAccessVPNServiceProvider.java
	server/src/com/cloud/network/ExternalFirewallDeviceManagerImpl.java
	server/src/com/cloud/network/ExternalLoadBalancerDeviceManagerImpl.java
	setup/db/db/schema-40to410.sql

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-04 22:21:20 -08:00
Sheng Yang
42c8c73ab6 CLOUDSTACK-306: Introducing IpDeployingRequester and implement inline mode
For LB device in inline mode, the ip deployer(the owner of public ip) is the
firewall in front of it, not itself. So check if it's inline or not, if it's
inline, return the firewall as ip deployer
2013-01-04 19:18:03 -08:00
Sheng Yang
177e157cbf CLOUDSTACK-306: Move inline mode parameter from device to network offering
One F5 device can be used as inline and side-by-side at the same time(for
different networks). So we can define inline or not on network base.
2013-01-04 19:17:58 -08:00
Sheng Yang
717f9dcd4d CLOUDSTACK-306: Implement SRX firewall
Use SRX firewall filter as SRX firewall. The old security policy mechanism
cannot be used as IP based. This would enable SRX's ability to control traffic
for F5 behind it.
2013-01-04 19:17:50 -08:00
Rohit Yadav
95e605ed25 api: Fix failing unit test, regression due to recent merge
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-04 18:16:29 -08:00
Rohit Yadav
364116074e api: Remove IdentityMapper finally
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-04 17:12:14 -08:00
Rohit Yadav
6fa8c708ee api: Fix service and disk offering annotations
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-03 22:32:46 -08:00
Rohit Yadav
223bfc07c3 api: Fix Parameter annotation in DeleteServiceOfferingCmd.java
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-03 22:32:46 -08:00
Rohit Yadav
65b274d09b api: Fix incorrect annotation for list template cmd
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-03 22:32:46 -08:00
Min Chen
daeb4abcca Create DB views for AsyncJobResponse to speed up listAsyncJobsCmd.
Signed-off-by: Min Chen <min.chen@citrix.com>
2013-01-03 15:35:26 -08:00
Rohit Yadav
072c6f1988 acl: Remove getApiCommands() method on APIAccessChecker interface
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
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
d928014a75 api: Add CopyIsoCmd, boilerplate cmd class for api copyIso
Two apis, copyIso and copyTemplate point to the same Cmd class, the commit adds
the child class CopyIsoCmd that extends on CopyTemplateCmd. This just serves as
the boilerplate class. Every api cmd name maps 1:1 to a cmd class.

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-28 01:49:43 -08:00
Rohit Yadav
983fe9712f api: Fix name field in @APICommand for CopyTemplateCmd.java
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-28 01:47:22 -08:00
Rohit Yadav
76ea0e7c45 api: Annotate and fill name field of @APICommand from commands.properties.in
- Reads and fills name field of all cmd class and api name mapping from
  commands.properties.in
- Automation using following python script ensures correctness of the change

import os
file_prefix = "api/src/"
search_pattern = "@APICommand("
pattern_len = len(search_pattern)
prop_file = "client/tomcatconf/commands.properties.in"
f = open(prop_file, 'r')
data = f.read()
f.close()
apis = filter(lambda x: x.strip()!='' and (not x.startswith('#')), data.split('\n'))
for api in apis:
    api_name = api.split('=')[0]
    cmd_name = file_prefix + api.split('=')[1].split(';')[0].replace('.', '/').strip() + ".java"
    if not os.path.exists(cmd_name):
        print cmd_name, api_name
    f = open(cmd_name, 'r')
    d = f.read()
    f.close()
    idx = d.find(search_pattern) + pattern_len
    new_str = d[:idx] + "name = \"%s\", " % api_name + d[idx:]
    f = open(cmd_name, 'w')
    f.write(new_str)
    f.close()

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-28 01:09:28 -08:00
Prasanna Santhanam
617a0507e1 api: EntityReference for serviceOfferingResponse
ServiceOfferingResponse's entityReference was missed

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2012-12-26 19:11:19 -08:00
Prasanna Santhanam
840da55520 api: Entities will extend InternalIdentity and Identity
Entities correlated to the Identity and carry a uuid and those
correlated to InternalIdentity carry an id. Those entities that carry
both will correlated to Identity and InternalIdentity.

This refactors entities wherever possible to ensure the VO only
implements the first class entity.

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2012-12-26 19:11:15 -08:00
Prasanna Santhanam
b80dccee3f api: ListTemplateCmd returns TemplateInfo not UserVmResponse
Correcting the incorrecty response entity when LIstTemplatesCmd was
caled
2012-12-26 18:32:57 -08:00
Rohit Yadav
b8369b808e api: Introduce name field which would hold the OTW api command name
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-26 15:56:14 -08:00
Rohit Yadav
7a7fe583e0 Rename Implementation annotation to APICommand
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-26 15:55:34 -08:00
Rohit Yadav
a18464dbe5 Rename @Entity to @EntityReference used in Response classes
- Renames to @EntityReference as @Entity is too general and used in javax's pkg
- Remove redundant imports

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-26 15:34:35 -08:00
Rohit Yadav
057ac12d23 Enforce InternalIdentity interface on all VO classes that impls long getId()
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-26 15:09:44 -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
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
Isaac Chiang
5aefd77f77 Fix for CloudStack-648
Signed-off-by: Gavin Lee <gavin.lxh@gmail.com>
2012-12-26 00:00:58 +08:00
Rohit Yadav
042a8e7681 api: Get rid of method definition in interface, that uses IdentityMapper for getting entity
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-23 18:05:53 -08:00
Rohit Yadav
fd784bd2d3 api: Annotate CreatePrivateNetworkCmd
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-23 17:28:53 -08:00
Rohit Yadav
f4a407e197 api: Remove IdentityMapper imports on vpn
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-23 17:26:16 -08:00
Rohit Yadav
02efffa93e api: Annotate VPC apis
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-23 17:24:58 -08:00
Rohit Yadav
1931667243 api: Annotate volume api
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-23 17:21:43 -08:00
Rohit Yadav
edb42d2cbb api: Annotate templates apis
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-23 17:17:59 -08:00
Rohit Yadav
a5dddb4a83 api: Extend or Implement InternalIdentity's getId method on a lot of VOs and Interfaces
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-23 16:52:35 -08:00
Rohit Yadav
a157a4c1eb api: InternalIdentity interface that provides contract to have getId
Adds new interface that would maintain contract that extending Interface
or implementing class will have the getId() method to get Internal Id

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-23 16:51:11 -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