19 Commits

Author SHA1 Message Date
alena
dae39942f1 bug 7192: Added networktype parameter for the zone
status 7192: resolved fixed

1) Zone has networktype parameter now, 2 values are supported: Basic and Advanced. "networktype" field is created in data_center table. The parameter is being set at creation time; we don't allow to modify it with updateZone command.
2) Only vlan of Untagged Direct type can be created in Basic network zone; any other vlan except for Untagged Direct can be created in Advanced zone
3) Allow NULL guest vlan range for the zone. Only vlan of Direct type can be created in zone with NULL guest vlan.
4) "Default" zone is Basic by default.
5) Changed "vnet" parameter to "vlan" in updateZone command to be consistent with createZone
2010-11-16 16:54:44 -08:00
alena
c5d78a726e Modified exception handing in API. Following exceptions are supported now (location - BaseCmd.java):
* MALFORMED_PARAMETER_ERROR - when type of the request parameter is invalid (String instead of Long for id for example)
* PARAM_ERROR - when invalid parameter value is specified in api request. For example, id of non existing vm for StartVmCmd
* ACCOUNT_RESOURCE_LIMIT_ERROR - when user tries to exceed his resource limits by executing the api command.
* INSUFFICIENT_CAPACITY_ERROR - when resource fails to create/start due to insufficient capacity.
* RESOURCE_UNAVAILABLE_ERROR - when user tries to create a vm when storage is not available.
* RESOURCE_IN_USE_ERROR - when user tries to delete/modify resource while it's in use. For example, when we try to delete a network group when it contains ingress rules.
* NETWORK_RULE_CONFLICT_ERROR - when LB/PF rule to add conflicts with existing rule
* ACCOUNT_ERROR - when user is not authorized to execute operation on the resource.
* INTERNAL_ERROR
2010-11-16 11:56:34 -08:00
alena
1a8d9a92a7 Modified all api calls to throw ApiServerException if null object is returned by the manager. 2010-11-15 17:44:51 -08:00
alena
050eed742f 1) Removed account/domainId info from deleteSnapshot and deleteSnapshotPolicy commands as we get account info from the snapshot/policy object.
2) Introduced responseObject field in @Implementation for all apis. This field contains information about the response object class, so we can used it for generating API documentation.
2010-11-12 17:36:17 -08:00
alena
5fafef9970 More api refactor - build api response is execute() method instead of getResponse method. 2010-11-09 09:58:05 -08:00
alena
1c24deda34 1) Refactored current Apis not to use reflection for method invocation. In new version following has to be done:
* Implement callCreate() and execute() methods in apis extending BaseAsyncCreateCmd (example - CreateVolumeCmd)
* Implement execute() method in apis extending BaseCmd and BaseAsyncCmd (example - deleteVolumeCmd and deleteUserCmd)

We no longer need createMethod(), method(), manager() fields in @Implementation annotation, cleanup has to be done.

2) Moved Account/User related methods to AccountManagerImpl. Methods are exposed via AccountService interface.
3) Enhanced exception handing for Api calls.
4) Created ConfigurationService interface, all Api config methods are exposed via it.
2010-11-08 11:27:36 -08:00
alena
8c0e2fa7ec Fixed updatePod Api to return embedded object instead of "success" response 2010-11-03 11:18:51 -07:00
Kris McQueen
24551eea3a Add constants for API command parameter names and for API response parameter names. Update the commands with the new constants rather than custom strings. Update several of the responses with the constants. Not all the responses have been updated, this is still work in progress... 2010-10-29 17:20:40 -07:00
Kris McQueen
9056653e17 Change the API Implementation annotation to use the manager's class rather than an enum. This allows methods for new managers to be added trivially rather than having to modify the dispatcher to load a new manager class. 2010-10-27 12:23:31 -07:00
abhishek
2b9ab00cc2 bug 3386: first part of the checkin, wherein we have an optional param domainId for create and modify zones. If this domain exists in the system, then the zone is tagged with this domain id, so that subsequent calls are checked for sanity against this domain. 2010-10-21 11:43:06 -07:00
kishan
fa4a16cb68 bug 5592: Added configurable domain for hosts.
status 5592: resolved fixed
2010-10-21 11:51:09 +05:30
alena
fb50fe624c * Added descriptions for Api command's request and response parameters.
* Changed response type for DeleteDomain and DeletePreallocatedLun commands to SuccessResponse
* Implemented small tool (ApiXmlDocReader) for comparing api commands of different product versions.
2010-10-11 09:21:42 -07:00
alena
e7b478f43d Added descriptions for Api commands and corresponding requrest parameters 2010-10-07 14:46:29 -07:00
alena
136060e5cf 1) Finished XmlApiDoc writer. The program gets api classes from commands.properties.in file, and build Command objects with "name"/"description"/"request"/"response" fields. Request and response are represented by the list of arguments, each argument contains "name"/"description"/"isrequired" fields. The commands are being serialized to commands.xml using imported xstream library, and can be desiarialized later - it will help to compare commands from differemt product versions.
2) Added description() methods to Implementation and Param annotations.
2010-10-04 09:50:14 -07:00
Kris McQueen
2a4ddac41a Change getResponse() to return a ResponseObject so that the caller can choose how to serialize. This in in preparation for serializing the async commands to the database with class information and deserializing them into the ResponseObject itself when queryAsyncJobResult is called. Once the ResponseObject is deserialized, the proper string can be returned to the caller.
The previous behavior had the JSON response from the command embedded into the queryAsyncJobResult response as a string rather than a JSON object which prevented the client from being able to read the response.  With this new behavior an actual JSON object should be returned which can then be parsed on the client side.
2010-09-23 17:34:28 -07:00
Kris McQueen
e2e0e76063 More work on serializing responses. Now responses have to have the name set on them, and the name will eventually be serialized to the JSON/XML response the way it used to work for commands themselves [the result of cmd.getName() was written to the response string]. For list respones, we wrap the individual objects in a ListResponse object that has the name of the response, and the individual objects have the object name so that accounts will be something like <listaccountsresponse><account><...></account><account><...></account></listaccountsresponse>. 2010-09-17 17:13:04 -07:00
Kris McQueen
479ff26051 Refactoring createZone to new API framework. The logic was entirely delegated to configuration manager, so pushed the logic there and removed the proxy method from Management server. 2010-08-25 18:26:38 -07:00
Manuel Amador (Rudd-O)
ac730ec496 Branch 2.1.refactor committed 2010-08-11 09:13:42 -07:00
Manuel Amador (Rudd-O)
05c020e1f6 Source code committed 2010-08-11 09:13:29 -07:00