115 Commits

Author SHA1 Message Date
Rohit Yadav
d235859168 Fix PluggableService to provide interface for ACL adapters etc. to get configs
- Fix interface to return array of strings, or filenames
- Fix StaticRoleBased ACL adapter to process config files by going through all pluggable services
- Refactor interface names

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-02 16:29:39 -08:00
Rohit Yadav
774cb29b0c api: Annotate all remaining cmd classes with APICommand name field
Automates name field filling using following python program which reads from
various *commands.properties.in files and populates name fields based on the
name cmd class mapping defined in them.

import os
search_pattern = "@APICommand("
pattern_len = len(search_pattern)
prop_files = [
"client/tomcatconf/cisconexusvsm_commands.properties.in",
"client/tomcatconf/f5bigip_commands.properties.in",
"client/tomcatconf/junipersrx_commands.properties.in",
"client/tomcatconf/netapp_commands.properties.in",
"client/tomcatconf/netscalerloadbalancer_commands.properties.in",
"client/tomcatconf/nicira-nvp_commands.properties.in",
"client/tomcatconf/simulator_commands.properties.in",]
file_prefixes = [
"plugins/hypervisors/vmware/src/",
"plugins/network-elements/f5/src/",
"plugins/network-elements/juniper-srx/src/",
"plugins/file-systems/netapp/src/",
"plugins/network-elements/netscaler/src/",
"plugins/network-elements/nicira-nvp/src/",
"plugins/hypervisors/simulator/src/",]
counter = 0
for prop_file in prop_files:
    f = open(prop_file, 'r')
    data = f.read()
    f.close()
    file_prefix = file_prefixes[counter]
    apis = filter(lambda x: x.strip()!='' and (not x.startswith('#')), data.split('\n'))
    for api in apis:
        api_name = api.split('=')[0].strip()
        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()
    counter += 1

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-28 01:28:47 -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
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
Rohit Yadav
018b5215e0 api: Annotate apis in various plugins
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-23 18:03:23 -08:00
Rohit Yadav
1bd47d48ab api: Annotate some nicira apis
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-23 17:43:42 -08:00
Rohit Yadav
e849d70af1 api: Annotate some juniper-src apis
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-23 17:41:10 -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
98b022a430 Remove IdentityProxy from plugin response classes.
Signed-off-by: Min Chen <min.chen@citrix.com>
2012-12-19 13:09:02 -08:00
Alex Huang
392feacd27 missed license 2012-12-18 13:04:34 -08:00
Alex Huang
591fb34795 Added dns-notifier as example plugin 2012-12-18 12:01:26 -08:00
Hugo Trippaers
859412c1ce Fix headers
again....
2012-12-14 11:58:25 +01:00
Hugo Trippaers
2235776aed Unittests for NiciraNvpGuestNetworkGuru
These unittests do not depend on the componentlocator but instead are
completely dependent on mock objects. This ensures that they can be run
standalone without any requirements on the environment.

Includes some fixes to NiciraNvpGuestNetworkGuru and GuestNetworkGuru
2012-12-14 10:41:36 +01: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
Hugo Trippaers
9c8eba1da3 Fix the tests
Note to self, surefire actually runs with assertions enabled where junit
inside eclipse doesn't. Sure surefire will mark tests as failed when an
assertion is triggered. Take care when mocking stuff.
2012-12-07 17:34:14 +01:00
Hugo Trippaers
2b74b6e827 Start removing the old ant build files
Removed all build.xml files from the plugins
2012-12-07 15:58:56 +01:00
Hugo Trippaers
fa207d2b4d Add unittests for NiciraNvpApi
Added some unittests for the NiciraNvpApi. These tests mainly validate
the logic of the execute methods, which are the main thing in this
class. Other methods are basically wrappers around these functions.

Changed NiciraNvpApi to have a factory method for obtaining the
HttpMethod. This makes it easier to mock it.

Changed the executeMethods in NiciraNvpApi to protected so the unittests
have access.

Fixed a bug in NiciraNvpApi where releaseconnection was not called in
some cases.
2012-12-07 15:55:26 +01:00
Hugo Trippaers
1fbf2a2864 Fix bug in Port Forwarding
Nicira NVP can't handle a range of port when implementing port
forwarding, so return an error message when a rule is being implemented
that uses port ranges.

Include unittest to verify this behaviour
2012-12-06 16:50:56 +01:00
Hugo Trippaers
cfd2a0bdf8 Fixes for some bug discovered while writing unittests
Rewritten handling for static nat and port forwarding, should make some
more sense now and the complex functions are split in smaller units.

Fix a small bug in Match

Add equals function to NatRule that ignores the uuid field.
2012-12-06 14:45:58 +01:00
Hugo Trippaers
22ef646b23 Add more unittests for NiciraNvpResource 2012-12-06 14:45:58 +01:00
Hugo Trippaers
48308ec070 Redoing NatRule usage and some fixes based on issues found while writing
unittests
2012-12-06 14:45:37 +01:00
Hugo Trippaers
700050a713 More unittests for NiciraNvpResource
Add some basic unittest for NatRule
2012-12-06 14:45:09 +01:00
Hugo Trippaers
b0955e43ff Put the mockito version in the central version list 2012-12-06 14:42:59 +01:00
Murali Reddy
6657246cd4 Summary: partical check-in for L4-L7 network services in the shared
network in the advanced zone

Changing the F5, NetScaler, SRX network elemetns to handle both 'isolated networks'
and 'shared networks' in the advanced zone

Bug ID:CLOUDSTACK-312 enable L4-L7 network services in the shared network in the advanced zone
2012-12-06 11:55:19 +05:30
Rohit Yadav
ba8e61bfb5 api_refactoring: for network api refactoring move interfaces so it works
Move ExternalNetworkDeviceManager to cloud-api, as server depends on cloud-api
The api refactoring of one of the api required this interface

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-05 14:53:16 -08:00
Rohit Yadav
456b852c0c api_refactor: refactor loadbalancer apis
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-04 11:25:20 -08:00
Rohit Yadav
658cf56120 api_refactor: move diskoffering to offering
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-04 10:38:53 -08:00
Rohit Yadav
28df57ec75 api_refactor: refactor serviceoffering apis
- Fix refactored apis, mappings in commands*.in
- Fix comments etc.

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-04 00:27:19 -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
Hugo Trippaers
0902f60c61 Quickly add the license header before Chip finds out. 2012-12-02 11:19:32 -08:00
Hugo Trippaers
751e74708e Setup unittests for the nicira nvp plugin
Changed the creation of the NiciraNvpApi to a factory method that can be
overridden by a mock object.

Setup two tests to test the configure function of the NiciraNvpResource
to test this factory method.
2012-12-02 10:50:14 -08:00
Hiroaki Kawai
a28f4cac3c HttpClient needs releaseConnection method call
reviewboard: https://reviews.apache.org/r/8186/

Signed-off-by: Hugo Trippaers <trippie@gmail.com>
2012-11-29 20:23:30 +01:00
Hiroaki Kawai
c8832cd4b6 Commit https://reviews.apache.org/r/8075/
Signed-off-by: Hugo Trippaers <htrippaers@schubergphilis.com>
2012-11-19 12:02:26 +01:00
Vijay Venkatachalam
affc162556 AutoScale: Fixing issues that occurred during rebase with master 2012-11-16 11:04:37 +05:30
Vijay Venkatachalam
527b5c8ee2 Autoscale: Supporting network element independent counter parameters Reviewed-By:Devdeep 2012-11-16 10:57:00 +05:30
Vijay Vekatachalam
4836aba56f Create Autoscale config in Netscaler with unique Identifier based on Vmgroup 2012-11-16 10:56:59 +05:30
Vijay Vekatachalam
35b0e086d4 enable Autoscale VMs to be named as Autoscale-LB-<lbname> 2012-11-16 10:56:59 +05:30
Vijay Vekatachalam
57416188a2 Enabling aUtoscale VMs to be provisioned in a loadbalancer's network 2012-11-16 10:56:59 +05:30
Deepak Garg
bf1e6ed991 CS-15644-Autoscale: Implemented UUIDs for templateId-serviceOff Reviewed-By:Vijay 2012-11-16 10:56:58 +05:30
Vijay venkatachalam
3e32a29048 Autoscale:Changes for addressing AutoScale bugs CS-15930, CS-15931, CS-15934, CS-15935 2012-11-16 10:56:58 +05:30
Vijay venkatachalam
c7f84cae77 Autoscale:7078-NetScaler's API changes for autoscale 2012-11-16 10:56:58 +05:30
Vijay venkatachalam
3ceebc140a AutoScale. Re-organized NetScalerResource. Bringing autoscale functions in a logical order. 2012-11-16 10:56:57 +05:30
Vijay venkatachalam
eec892dfbc Handling of errors during AutoScaleConfig in NetScaler. 2012-11-16 10:56:57 +05:30
Vijay
dda4d39b55 AutoScale changes in Apache master 2012-11-16 10:56:44 +05:30
Hugo Trippaers
53cea844bc The interface change introduced by commit
214bbf3ebd957f571901869f319da61ebad7ed23 broke the nonoss build.
2012-10-18 09:40:13 +02:00
Alena Prokharchyk
214bbf3ebd CLOUDSTACK-279: fixed deleteProject when executed by the regular user. Always pass System account as a caller when do account cleanup
Conflicts:

	api/src/com/cloud/api/commands/DeleteRemoteAccessVpnCmd.java
	server/src/com/cloud/network/element/CiscoNexusVSMElement.java
	server/src/com/cloud/network/element/ElasticLoadBalancerElement.java
	server/src/com/cloud/network/element/F5ExternalLoadBalancerElement.java
	server/src/com/cloud/network/element/JuniperSRXExternalFirewallElement.java
	server/src/com/cloud/network/element/NetscalerElement.java
	server/src/com/cloud/network/element/OvsElement.java
	server/src/com/cloud/network/element/VpcJuniperSRXExternalFirewallElement.java
	server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
	server/src/com/cloud/network/vpc/VpcManagerImpl.java
	server/src/com/cloud/network/vpn/RemoteAccessVpnManagerImpl.java
	server/src/com/cloud/storage/StorageManager.java
2012-10-17 17:26:19 -07:00
Hugo Trippaers
28c31e3707 truncate names that are longer than 40 characters, this is the max
length nicira api accepts for display_name.
2012-10-17 13:29:03 +02:00
Hugo Trippaers
a4a3194899 Fix license headers 2012-10-15 10:22:12 +02:00