Commit Graph

21248 Commits

Author SHA1 Message Date
Prasanna Santhanam 62edcefe98 marvin_refactor: fix marvin build and code generation
- generate code using generate/ module but triggered from basedir/marvin
- fix the pom to be the same as before, use codegenerator
- fix simulator build by removing ConfigDepot bean already injected as
  part of applicationContext.xml

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:23 +05:30
Prasanna Santhanam 412c34ed83 marvin_refactor: Fix marvin build and maven pom
- maven pom pointer codegenerator->xmltoapi
- regression in apidocxmlwriter fixed NPE
- fixed imports in generate module
2013-10-31 13:54:23 +05:30
Prasanna Santhanam bc7f9165c9 marvin_refactor: UnitTests for NetworkFactory
Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:23 +05:30
Prasanna Santhanam 0678ce7f9f marvin_refactor: remove redundant examples from sandbox
Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:23 +05:30
Prasanna Santhanam c632fadee5 marvin_refactor: network data factory
network can create isolated guest and shared guest networks. the network
object will inturn use the default networkofferings which are
auto-enabeld by their postgenerators

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:23 +05:30
Prasanna Santhanam 6dc259ea88 marvin_refactor: correcting references to random_gen
random_gen moves to marvin.legacy.utils from marvin.utils

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:23 +05:30
Prasanna Santhanam b437ae984a marvin_refactor: generation of code is in the generate module
CloudStack's API DSL is converted into marvin's modules using the
generate module.

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:22 +05:30
Prasanna Santhanam 44b3edcf75 marvin-refactor: move the deployment helpers to deployer module
deployer module will contain all the helper modules used for json
description of data center and will also feature the export module for
exporting a datacenter in to json

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:22 +05:30
Prasanna Santhanam fac014d295 marvin-refactor: moving old integration libraries to legacy 2013-10-31 13:54:22 +05:30
Prasanna Santhanam b8fc99f1c5 marvin_refactor: docs updates
- fix the xml/json compilation
- need ability to send in identifiers for cloud resources

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:22 +05:30
Prasanna Santhanam 8cb437110e marvin_refactor: getText() reveals the actual value
otherwise required is always not None and always True

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:21 +05:30
Prasanna Santhanam cdb6754323 marvin_refactor: some project cleanup. 2013-10-31 13:54:21 +05:30
Prasanna Santhanam 8b65ce9a95 marvin_refactor: include markdown docs 2013-10-31 13:54:21 +05:30
Prasanna Santhanam 526a9d6043 marvin_refactor: Some renames to organize data and entities
Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:21 +05:30
Prasanna Santhanam 6a260ce355 marvin_refactor: use percached commands.xml for api generation
Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:21 +05:30
Prasanna Santhanam 02b35367a0 marvin_refactor: cloudConnection is CloudConnection
Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:21 +05:30
Prasanna Santhanam e0e29d7d37 marvin_refactor: multiple fixes to entity gen.
1. extend the namespace using execfile for getting cmdlets. Don't expect
existing marvin installations
2. additional entity adjustments for registerUserkeys and template
related APIs
3. optional **kwargs are explained in docstring

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:21 +05:30
Prasanna Santhanam 4ae4f0df4c marvin_refactor: move OptionParser to ArgumentParser
Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:21 +05:30
Prasanna Santhanam 4d3865808d marvin_refactor: skip jobStatus and jobId when determining mirror objects
When comparing json response against the response object disregard the
jobstatus and jobid returned as part of object response. These are some
quirks in the API response added previously that we are unable to
remove.

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:20 +05:30
Prasanna Santhanam 5fab4fd3a2 marvin_refactor: additional packages for marvin
should-dsl and inflect for cleaner assertions and for entity code
generation.

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:20 +05:30
Prasanna Santhanam e6ed427426 marvin_refactor: move apidoc artifact to marvin dir for precache api list
Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:20 +05:30
Prasanna Santhanam 9888bb2561 marvin_refactor: remove all the code that is auto-generated
All factories and base modules are auto-generated by the
entity_generator
2013-10-31 13:54:20 +05:30
Prasanna Santhanam 2f3e0ef828 marvin_refactor: tests for factories 2013-10-31 13:54:20 +05:30
Prasanna Santhanam 8d16f03058 marvin_refactor: base classes for entity and factory
CloudStackEntity : represents the base entity. This is a placeholder for
future use. Right now it only implements version info

CloudStackBaseFactory: overloads AbstractFactory to provide custom hooks
for CloudStackEntity creation. The current creators for cloudstack
entities are any api actions that begin as create, deploy or register

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:20 +05:30
Prasanna Santhanam 03bb70904c marvin_refactor: new package structure for marvin
legacy: all old integration libraries go here
generate: all the code used to autogenerate marvin libraries
docs: documentation
data: data objects representing what were earlier service dictionaries
2013-10-31 13:54:20 +05:30
Prasanna Santhanam 5f25f1f996 marvin_refactor: Fixing conflicts from fresh rebase with master
Conflicts:
    client/tomcatconf/componentContext.xml.in

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:20 +05:30
Prasanna Santhanam 959c6035c8 marvin_refactor: id is attribute only when it is in required args
cmd.id = self.id expression should be included only when id is in the
required arguments of the entity.

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:19 +05:30
Prasanna Santhanam db2b4f68a3 marvin_refactor: Remove duplicate section for simulator
Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:19 +05:30
Prasanna Santhanam 6857e99c31 marvin_refactor: ApplicationLoadBalancer are for n-tier apps
Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:19 +05:30
Prasanna Santhanam 2b23699a4f marvin_refactor: more entity adjustments
DomainRouter -> VirtualRouter

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:19 +05:30
Prasanna Santhanam 8d713b5af4 marvin_refactor: squash 2013-10-31 13:54:19 +05:30
Prasanna Santhanam ba34756387 marvin_refactor: Fixing typos
Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:19 +05:30
Prasanna Santhanam da0e3c6721 marvin_refactor: The prefix_transformer
Some entities are unrelated to the API. Include the complete API as the
verb to make the relationship to the entitiy clearer

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:19 +05:30
Prasanna Santhanam 32542ecf6c marvin_refactor: The deleteXxx APIs should have their entity in the id field
All delete APIs have an id field and the entityType the delete is
removing from the system is found here. Include the entity Type for
these in the API discovery service.

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:19 +05:30
Prasanna Santhanam c3246f4309 marvin_refactor: Additional entities in post-transform
- UserVm -> VirtualMachine
- ApplicationLoadBalancer -> LoadBalancer

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:19 +05:30
Prasanna Santhanam 1731a961ac marvin_refactor: changes to pom for sync facility
Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:18 +05:30
Prasanna Santhanam 8b62f1bb15 marvin_refactor: provide entity in the api command objects
Also include the entity generation in to the codegenerator so single
module can generate both api command objects and the derived entities.

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:18 +05:30
Prasanna Santhanam a789d43ded marvin_refactor: Derive the entity from the responseObject
The API discovery service is enhanced to include the entity that an API
will act upon. Also included are the changes for API doc generation.

For APIs that don't provide a direct relationship to their entities we
use the related parameter to derive the entity.

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:18 +05:30
Prasanna Santhanam ccf23b829b marvin_refactor: separate write from generation
Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:18 +05:30
Prasanna Santhanam 97ed47b4d6 marvin_refactor: Fixes from conflicts during rebase
Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:18 +05:30
Prasanna Santhanam 65118c8f02 marvin_refactor: If there are no required arguments
the else block isn't required.

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:18 +05:30
Prasanna Santhanam 42c30f59a7 marvin_refactor: Exposing the entity that an API acts upon from API discovery
eg: dedicatePublicIpRange acts on VlanIpRange entities. So does listVlanIpRanges,

listapisresponse: {
    count: 1,
    api: [
    {
        name: "dedicatePublicIpRange",
        description: "Dedicates a Public IP range to an account",
        isasync: false,
        related: "listVlanIpRanges",
        params: [],
        response: [],
        entity: "VlanIpRange"
     }
    ]
  }
}

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:18 +05:30
Prasanna Santhanam 5ecdcd9ec1 marvin_refactor: ldapConfig - > config, Ldap
And the With preposition transformer

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:18 +05:30
Prasanna Santhanam 940e9f1d7c marvin_refactor: workaround inflect bug
inflect makes IpAddress -> IpAddres when singularizing.

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:17 +05:30
Prasanna Santhanam 901af0080e marvin_refactor: transform based on prepositions to auto-generate
Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:17 +05:30
Prasanna Santhanam db16fd7854 marvin_refactor: improve the entity auto-generator with error checks
Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:17 +05:30
Prasanna Santhanam b3112fd45a marvin_refactor: Chain subFactory calls
SubFactories now can call in a nested fashion to populate attributes in
dependant entities.
2013-10-31 13:54:17 +05:30
Prasanna Santhanam ba6b1119f3 marvin_refactor: changes to the entity_generator
adding support for capturing plurals
adding filtering for non-conforming entities
adding more error checking in entity.action {return}

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:17 +05:30
Prasanna Santhanam 90381913c5 marvin_refactor: adding doc strings to jsonHelper 2013-10-31 13:54:17 +05:30
Prasanna Santhanam 6815d03037 marvin_refactor: The SubFactory with SelfAttribute carrying the apiclient 2013-10-31 13:54:17 +05:30