Package comodit_client ::
Package api
|
|
Package api
The modules in this package provide classes that describe entities
handled by a ComodIT server (hosts, applications, etc.) as well as tools
easing the handling of these entities.
All ComodIT entity representations inherit from Entity class which defines generic operations, in
particular creation, update and deletion of remote entities. Note that a
Entity
instance is only the local (i.e. in RAM)
representation of a remote instance. Therefore, altering the state of a
local instance does not automatically update remote object (see Entity class for more details).
Entities are accessed through collections. Each collection is
represented by a class that inherits from Collection. Collections may be associated to a
particular entity. In this case, the entity owns the collection
and all the entities in the collection. Collections that are not
associated to an entity are called root collections. These are
accessible through an instance of Client which
represents a connection to a ComodIT server. This object is mandatory to
any interaction with a server using this library.
Any entity is reachable starting from one of root collections' entity.
Indeed, ComodIT's data model defines the following structure (each item
represents an entity type or collection, entity representation is given;
when an item has a sub-list, it means each entity of the collection has a
collection associated to it):
Below script illustrates the usage of defined classes. org is
an instance of Organization, host is an instance of Host.
>>> from comodit_client.api import Client
...
...
... client = Client('https://my.comodit.com/api', 'UUU', 'PPP')
...
...
... org = client.get_organization('OOO')
... host = org.get_environment('Default').hosts().create('my-new-host', '', 'Demo Platform', 'Demo Distribution')
...
...
... host.provision()
... host.wait_for_state('READY')
...
...
... host.install('Wordpress', {'wp_admin_password': 'XXX', 'wp_admin_email': 'YYY@ZZZ'})
... host.wait_for_pending_changes()
...
...
... hostname = host.get_instance().get_property('publicDnsName')
... print "Wordpress available at http://" + hostname + "/"
...
...
... host.get_instance().delete()
... host.delete()
- comodit_client.api.application: Provides all classes related to application entity, in particular
Application and ApplicationCollection.
- comodit_client.api.application_key: Provides the classes related to application key entity: ApplicationKey and ApplicationKeyCollection.
- comodit_client.api.audit: Provides classes related to audit logs.
- comodit_client.api.collection: Provides collections base class (Collection) and related exceptions.
- comodit_client.api.compliance: Provides classes related to compliance errors on provisioned hosts,
in particular ComplianceError and ComplianceCollection.
- comodit_client.api.contexts: Provides all classes related to the configuration of a distribution
(DistributionContext), a platform (PlatformContext) or an application (ApplicationContext) when associated to a host.
- comodit_client.api.distribution: Provides the classes related to distribution entity: Distribution and DistributionCollection.
- comodit_client.api.entity: Provides entities base class (Entity).
- comodit_client.api.environment: Provides the classes related to environment entity: Environment and EnvironmentCollection.
- comodit_client.api.exceptions: Provides common API exceptions.
- comodit_client.api.exporter: Provides the exporter tool.
- comodit_client.api.files: Provides classes related to file entities, in particular HasFiles.
- comodit_client.api.flavors: Provides flavor entity (Flavor) and collection (FlavorCollection) classes.
- comodit_client.api.host: Provides the classes related to host entity, in particular Host and HostCollection.
- comodit_client.api.importer: Provides the importer tool.
- comodit_client.api.organization: Provides the classes related to organization entity, in particular
Organization and OrganizationCollection.
- comodit_client.api.parameters: Provides classes related to parameter entities, in particular HasParameters.
- comodit_client.api.platform: Provides classes related to platform entity, in particular Platform and PlatformCollection.
- comodit_client.api.purchased: Provides classes related to purchased entities: PurchasedEntity and PurchasedCollection.
- comodit_client.api.settings: Provides classes related to setting entities, in particular HasSettings.
- comodit_client.api.store: Provides classes related to stores, in particular PublishedEntity.
- comodit_client.api.sync: Provides synchronization tool (SyncEngine).
|
|
Client
Represents a connection to a particular ComodIT server.
|
|
__package__ = ' comodit_client.api '
|