14924 Commits

Author SHA1 Message Date
Rohit Yadav
c0a0318f29 setup/db: Fix missing semicolon in db create view command
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-03 11:24:12 -08:00
Rohit Yadav
edb00bb613 Merge branch 'master' into api_refactoring 2013-01-03 08:32:56 -08:00
Hugo Trippaers
cc3d692ab8 Summary: Remove useless and commented code 2013-01-03 11:57:37 +01:00
Hugo Trippaers
282eb5fcf5 Summary: Unittest for nicira plugin
More unittests for the Guru

Add unittests for the Element
2013-01-03 11:57:14 +01:00
Hugo Trippaers
00847482cc Summary: Small fixes for issues found during unittests 2013-01-03 11:56:50 +01:00
Hugo Trippaers
6cf0c5683d Summary: Make canHandle protected
Change access to canHandle so it's easier to unittest. 

Make a note that answers can be null if the host is down, there should
be a way to deal with this, but for now an NPE is an adequate indication
that something is wrong.
2013-01-03 11:56:26 +01:00
Hugo Trippaers
9122809e00 Summary: nothing to see here, move along
Fix for a stupid mistake.
2013-01-03 11:56:02 +01: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
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
Rohit Yadav
c5b51b7c39 plugin: Remove memory mapping of apiname and class name in StaticRoleBasedAPIAccessChecker
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-02 18:43:59 -08:00
Rohit Yadav
65e4f00a10 Annotate api name on usage related apis
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-02 18:43:58 -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
bc8e0af0a3 plugin: ACL Static Role Based api access checker
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-02 17:06:19 -08:00
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
Edison Su
bba43f51dc vmware stuff should be compile time dependency 2013-01-02 16:25:17 -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
Wido den Hollander
3d2fefabdd db / upgrade: Add columns to sync_queue and sync_queue_item
These columns were not added by the upgrade from 4.0 to 4.1 causing SQL-errors

These columns are present in create-schema.sql, so by adding them here the upgrade also works to 4.1
2013-01-02 17:01:23 +01: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
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
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
Rohit Yadav
623e7389ef api: Make APIServer backward compatible to accept both uuid and id for pre 3.x apis
- Allow both uuid and id in param for pre 3.x apis
- Enforce uuid as param for all >= 3.x apis
- Use regex to better match uuid param

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-27 15:24:17 -08:00
Brian Federle
eff0716426 UI: Minor cosmetic fixes
-Fix missing icons on some dialog headers

-multiEdit: Fix overflow for long text strings

-Projects UI: Fix project selector margins, overflow on 'Events' box
 on project dashboard
2012-12-27 13:46:52 -08:00
Brian Federle
d3ca6a8a57 List view UI: Keep overflow row content in-line with mouse on hover 2012-12-27 12:02:38 -08:00
Brian Federle
23e75eb788 Increase max-width of list view table cells to 160px 2012-12-27 11:59:13 -08:00
Brian Federle
1b533f2354 List view UI: Add alt tag to table cells 2012-12-27 11:58:50 -08:00
Prasanna Santhanam
539fca3520 Simulator: Fixing the listTemplatesCommand
Should return the ListTemplatesAnswer and ListVolumes returns
ListVolumesAnswer

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2012-12-26 19:22:17 -08:00
Prasanna Santhanam
bab974c3bc marvin : cloudstack-version is not reqd for json load
To build back cloudstack response we don't need to load the
'cloudstack-version' string, only the response
2012-12-26 19:22:17 -08:00
Prasanna Santhanam
39db3be294 Simulator: Fixing the listTemplatesCommand
Should return the ListTemplatesAnswer and ListVolumes returns
ListVolumesAnswer

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2012-12-26 19:20:32 -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
Rohit Yadav
b75d92419e api: Enforce InternalIdentity interface on AsyncJobVO
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-26 15:09:44 -08:00
Prasanna Santhanam
7e52f2c48c marvin : cloudstack-version is not reqd for json load
To build back cloudstack response we don't need to load the
'cloudstack-version' string, only the response
2012-12-26 13:36: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
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
Pranav Saxena
5b751b2a13 CLOUDSTACK-771:Instance Table misalignment : Adding the hover view in order to display the full text 2012-12-24 17:57:46 +05:30
Pranav Saxena
7410de9cca CLOUDSTACK-771:Instance Table misalignment : when instance is created with long display name:Solved by using the concept of Ellipses in CSS 2012-12-24 16:05:57 +05:30
Prasanna Santhanam
1f1a13448f simulator: resurrect simulator hypervisor as plugin
Multiple fixes:
1. changes to the mvn configuration
    a. include simulator to client.war
    b. activate simulator by profile
2. templates for simulator
3. developer prefill for simulator
    a. Use deplydb-simulator to setup simulator db
4. Inherit components-simulator.xml from components.xml
5. ListVolumesCommand missed for MockStorageManager
6. Include simulator properties into utils/db.properties

TODO:
 Secondary storage VMs don't come up because ComponentLocator doesn't
retain a unique set of adapaters by name. Fix this in subsequent
checkin.
2012-12-23 19:28:57 -08:00
Rohit Yadav
a3c2bb7418 Merge branch 'master' into api_refactoring
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-23 19:12:04 -08:00
Devdeep Singh
8f6fdc3efc CLOUDSTACK-227: Fix NPE and throw an exception if the network is not found in Xen
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-23 19:03:03 -08:00
Rohit Yadav
beb2fccf1c api: Finally get rid of IdentityMapper annotation processing in ApiDispatcher
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-23 18:06:36 -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
9d3ab8ded7 server: Get rid of db helpers that work with IdentityMapper
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-23 18:04:32 -08:00