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>
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>
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>
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>
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>
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>
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>
Factories are reqd. for entities that come into existense through the
process of a CLoudStack API create command. Some entities are added from
external sources for which factories are not reqd.
Signed-off-by: Prasanna Santhanam <tsp@apache.org>
Some entities do not conform to the CRUD format and define extra verbs -
eg: markDefaultNicForVirtualMachine, ldapConfig, ldapRemove etc.
These are refactored and combined into their respective entities.
Signed-off-by: Prasanna Santhanam <tsp@apache.org>
For eg:
1. nf = NetworkOffering.create(apiClient, NetworkOfferingFactory())
2. nf.update(apiClient, state='Enabled')
Operation #2 requires that nf's id be supplied to enable the network
offering
Signed-off-by: Prasanna Santhanam <tsp@apache.org>
- Let all entities inherit from CloudStackEntity
- create and list are classmethods since they work without need for an
entity to exist
- create takes only factories by default. no need for long param list.
Entitiy.create(apiclient) will give entity out of default factory
- Use entityFactory.attributes() to init entities
Signed-off-by: Prasanna Santhanam <tsp@apache.org>
factories will help define default test data for each entity. So a
Account.create(apiclient) returns a default account
VirtualMachine.deploy(apiclient) returns a virtualmachine etc
WIP: only skeletons, no flesh
Signed-off-by: Prasanna Santhanam <tsp@apache.org>
- don't do package import of cloudstackentity
- create() and list() method will return obj(s) of type(Entity)
Signed-off-by: Prasanna Santhanam <tsp@apache.org>
- Let all entities inherit from CloudStackEntity
- create and list are classmethods since they work without need for an
entity to exist
- create takes only factories by default. no need for long param list.
Entitiy.create(apiclient) will give entity out of default factory
- Use entityFactory.attributes() to init entities
Signed-off-by: Prasanna Santhanam <tsp@apache.org>