Package comodit_client :: Package api :: Class Client

Class Client


Represents a connection to a particular ComodIT server. An instance of this class gives access to most collections as well as helpers easing the access to ComodIT entities.

Instance Methods
 
__init__(self, endpoint, username, password, token, insecure_upload=False)
Client constructor.
FlavorCollection
flavors(self)
Provides root collection of flavors.
Flavor
get_flavor(self, name)
Fetches a particular flavor given its name.
AppStoreCollection
app_store(self)
Provides root collection of published applications.
PublishedApplication
get_published_app(self, uuid, org_name=None)
Fetches a published application given its UUID.
DistStoreCollection
dist_store(self)
Provides root collection of published distributions.
PublishedDistribution
get_published_dist(self, uuid, org_name=None)
Fetches a published distribution given its UUID.
OrganizationCollection
organizations(self)
Provides root collection of organizations.
Organization
get_organization(self, name)
Fetches an organization given its name.
ApplicationCollection
applications(self, org_name)
Instantiates the collection of applications associated to named organization.
Application
get_application(self, org_name, name)
Fetches an application given the name of owning organization and its name.
DistributionCollection
distributions(self, org_name)
Instantiates the collection of distributions associated to named organization.
Distribution
get_distribution(self, org_name, name)
Fetches a distribution given the name of owning organization and its name.
PlatformCollection
platforms(self, org_name)
Instantiates the collection of platforms associated to named organization.
Platform
get_platform(self, org_name, name)
Fetches a platform given the name of owning organization and its name.
EnvironmentCollection
environments(self, org_name)
Instantiates the collection of environments associated to named organization.
Environment
get_environment(self, org_name, name)
Fetches an environment given the name of owning organization and its name.
HostCollection
hosts(self, org_name, env_name)
Instantiates the collection of hosts associated to a particular environment.
Host
get_host(self, org_name, env_name, name)
Fetches a host given its name and owning environment.
EnvironmentCollection
application_keys(self, org_name)
Instantiates the collection of environments associated to named organization.
Environment
get_application_key(self, org_name, token)
Fetches an environment given the name of owning organization and its name.

Inherited from object: __long__, __native__, __nonzero__, __unicode__, next

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties

Inherited from object: __class__

Method Details

__init__(self, endpoint, username, password, token, insecure_upload=False)
(Constructor)

 

Client constructor. In order to create a client, the URL to a ComodIT server's REST API (e.g. http://my.comodit.com/api) must be provided, in addition to connection credentials (username and password).

Parameters:
  • endpoint (String) - The URL of a ComodIT server's REST API.
  • username (String) - A user name
  • password (String) - A password
  • token (String) - A token
Overrides: object.__init__

get_flavor(self, name)

 

Fetches a particular flavor given its name.

Parameters:
  • name (string) - Flavor's name.
Returns: Flavor

get_published_app(self, uuid, org_name=None)

 

Fetches a published application given its UUID. Note that an organization name may also be provided in order to access private published applications i.e. applications published to a limited audience.

Parameters:
  • uuid (string) - Published application's UUID.
  • org_name (string) - Organization through which you want to access published application (mandatory if the access is restricted).
Returns: PublishedApplication

get_published_dist(self, uuid, org_name=None)

 

Fetches a published distribution given its UUID. Note that an organization name may also be provided in order to access private published distributions i.e. distributions published to a limited audience.

Parameters:
  • uuid (string) - Published distribution's UUID.
  • org_name (string) - Organization through which you want to access published distribution (mandatory if the access is restricted).
Returns: PublishedDistribution

organizations(self)

 

Provides root collection of organizations. The organizations that may be accessed through this collection depend on the access rights of used principal.

Returns: OrganizationCollection

get_organization(self, name)

 

Fetches an organization given its name.

Parameters:
  • name (string) - Organization's name.
Returns: Organization

applications(self, org_name)

 

Instantiates the collection of applications associated to named organization.

Parameters:
  • org_name (string) - The name of the organization owning requested collection.
Returns: ApplicationCollection

get_application(self, org_name, name)

 

Fetches an application given the name of owning organization and its name.

Parameters:
  • org_name (string) - The name of the organization owning requested application.
  • name (string) - The name of the application.
Returns: Application

distributions(self, org_name)

 

Instantiates the collection of distributions associated to named organization.

Parameters:
  • org_name (string) - The name of the organization owning requested collection.
Returns: DistributionCollection

get_distribution(self, org_name, name)

 

Fetches a distribution given the name of owning organization and its name.

Parameters:
  • org_name (string) - The name of the organization owning requested distribution.
  • name (string) - The name of the distribution.
Returns: Distribution

platforms(self, org_name)

 

Instantiates the collection of platforms associated to named organization.

Parameters:
  • org_name (string) - The name of the organization owning requested collection.
Returns: PlatformCollection

get_platform(self, org_name, name)

 

Fetches a platform given the name of owning organization and its name.

Parameters:
  • org_name (string) - The name of the organization owning requested platform.
  • name (string) - The name of the platform.
Returns: Platform

environments(self, org_name)

 

Instantiates the collection of environments associated to named organization.

Parameters:
  • org_name (string) - The name of the organization owning requested collection.
Returns: EnvironmentCollection

get_environment(self, org_name, name)

 

Fetches an environment given the name of owning organization and its name.

Parameters:
  • org_name (string) - The name of the organization owning requested platform.
  • name (string) - The name of the environment.
Returns: Environment

hosts(self, org_name, env_name)

 

Instantiates the collection of hosts associated to a particular environment.

Parameters:
  • org_name (string) - The name of the organization owning the environment.
  • env_name (string) - The name of the environment owning requested collection.
Returns: HostCollection

get_host(self, org_name, env_name, name)

 

Fetches a host given its name and owning environment.

Parameters:
  • org_name (string) - The name of the organization owning the environment.
  • env_name (string) - The name of the environment owning the host.
  • name (string) - The name of the host.
Returns: Host

application_keys(self, org_name)

 

Instantiates the collection of environments associated to named organization.

Parameters:
  • org_name (string) - The name of the organization owning requested collection.
Returns: EnvironmentCollection

get_application_key(self, org_name, token)

 

Fetches an environment given the name of owning organization and its name.

Parameters:
  • org_name (string) - The name of the organization owning requested platform.
  • name (string) - The name of the environment.
Returns: Environment