Commit Graph

21233 Commits

Author SHA1 Message Date
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
Prasanna Santhanam ee39b31339 marvin_refactor: ipaddress factories
ipaddress doesn't require id to associate but only when disassociate
2013-10-31 13:54:17 +05:30
Prasanna Santhanam 048352f2f6 marvin_refactor: AccountFactory doesn't need hashing
SHA encryption is applied by the server
2013-10-31 13:54:17 +05:30
Prasanna Santhanam d84535ee10 marvin_refactor: Working around CLOUDSTACK-2126
Marvin deserializes by matching attributes of the response with the
responseObject expected. In case the object's attributes don't mirror
the response Marvin assumes the response is invalid and can't return a
proper first class entity. This makes it difficult for tests to
reference the object's attributes in a sensible way.

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:16 +05:30
Prasanna Santhanam 7c60c563d1 marvin_refactor: make the module structure more relevant and simple
Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:16 +05:30
Prasanna Santhanam 580aa13e25 marvin_refactor: SubFactory or RelatedFactory
Can't make up my mind!!???
2013-10-31 13:54:16 +05:30
Prasanna Santhanam 7663f620e0 marvin_refactor: use _adjust_kwargs for cleaning
_adjust_kwargs is useful for any pre-generation cleaning of **kwargs by
factory_boy
2013-10-31 13:54:16 +05:30
Prasanna Santhanam a8f7364127 marvin_refactor: register is the real create
createTemplateCmd does a template of a VM
while
registerTemplateCmd does the actual creation of the template in CS
2013-10-31 13:54:16 +05:30
Prasanna Santhanam b862772e46 marvin_refactor: decode the response as first class python object
createAccountResponse is now an instance of createAccountResponse and
not just a plain dict.

TODO:
1. nested entities don't work yet.

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:16 +05:30
Prasanna Santhanam c6f0876fe9 marvin_refactor: one shot creation of factories
Build phase will init the bare minimum object required to make the web
request to the mgmt server

Create phase will make the actual request and fill the attributes of the
entity after recieving the response

This allows for one shot creation of the entity using:
EntityFactory.create(apiclient)

over two steps:
factory = EntityFactory()
entity = Entity.create(apiclient, factory)

TODO:
Figure out howto perform related factory creation.
eg: UserFactory.create() inits AccountFactory.create()

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:15 +05:30
Prasanna Santhanam 0af09a4843 marvin_refactor: call the EntityFactory simply factory 2013-10-31 13:54:15 +05:30
Prasanna Santhanam 414bf4f625 marvin_refactor: subfactory support for users
UserFactory will call on AccountFactory when it needs to be
instantiated.

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:15 +05:30
Prasanna Santhanam c1fd1eb0f6 marvin_refactor: adding isolation methods l3/vlan/gre
also some defaults for factories:
cluster, domain, user, vpn, zone

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:15 +05:30
Prasanna Santhanam 47807e8452 marvin_refactor: Fix merge issues with remoteAccessVPNResponse, and server
Duplicated methods creep in from bad merge

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:15 +05:30
Prasanna Santhanam a2ecc162cf marvin_refactor: fix the setup.py for marvin to include factories
Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:15 +05:30
Prasanna Santhanam ea9019abd8 marvin_refactor: remove redundant assignment
Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:15 +05:30