Package comodit_client :: Package api :: Module contexts :: Class DistributionContextCollection

Class DistributionContextCollection


Distribution context collection. Update is not supported. This collection will always contain at most one element. If the collection already contains a context, a newly created context will replace the old one.

Instance Methods
 
__init__(self, client, url)
Creates an instance of collection.
 
new(self, dist_name, settings={})
Instantiates a new distribution context associated to a particular distribution (that must be owned by the organization this host is owned by).
 
create(self, dist_name, settings={})
Creates remotely a new distribution context associated to a particular distribution (that must be owned by the organization this host is owned by).

Inherited from collection.Collection: __iter__, clear, delete, get, list, refresh

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, client, url)
(Constructor)

 

Creates an instance of collection. Note that Collection class should never be instantiated directly.

Parameters:
  • client - ComodIT client.
  • url - URL of remote collection on ComodIT server. This URL must be relative to ComodIT server's API URL and should not start with a slash.
Overrides: object.__init__
(inherited documentation)

new(self, dist_name, settings={})

 

Instantiates a new distribution context associated to a particular distribution (that must be owned by the organization this host is owned by).

Parameters:
  • dist_name (string) - The name of the distribution.
  • settings (dict) - A dictionary describing the settings to add to this context (see this function's specification for expected data model).

create(self, dist_name, settings={})

 

Creates remotely a new distribution context associated to a particular distribution (that must be owned by the organization this host is owned by). If a distribution was already associated to the host, the association is lost and replaced by this one.