Package comodit_client :: Package api :: Module environment :: Class Environment

Class Environment


Environment entity representation. An environment defines a group of hosts sharing a common property, for example geographical location. An environment may have settings, these settings being available to all hosts in this environment.

An environment entity owns 3 collections:

Instance Methods
HostCollection
hosts(self)
Instantiates the collection of hosts associated to this environment.
Host
get_host(self, name)
Fetches a host of this environment given its name.
Environment
clone(self, clone_name)
Requests the cloning of remote entity.
AuditLogCollection
audit_logs(self)
Instantiates the collection of audit logs associated to this environment.

Inherited from settings.HasSettings: add_link_setting, add_property_setting, add_setting, add_simple_setting, get_setting, settings

Inherited from entity.Entity: __init__, create, delete, dump, load, refresh, rename, show, update

Inherited from util.json_wrapper.JsonWrapper: dump_json, get_json, get_real_json, load_json, print_json, set_json

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
string organization
The name of the organization owning this environment.
list of string hosts_f
The names of the hosts in this environment.

Inherited from settings.HasSettings: settings_f

Inherited from entity.Entity: client, description, identifier, label, name, url, uuid

Inherited from object: __class__

Method Details

hosts(self)

 

Instantiates the collection of hosts associated to this environment.

Returns: HostCollection
The collection of hosts associated to this environment.

get_host(self, name)

 

Fetches a host of this environment given its name.

Parameters:
  • name (string) - The name of the host.
Returns: Host

clone(self, clone_name)

 

Requests the cloning of remote entity. Clone will have given name. This name should not already be in use. Note that the hosts in cloned environment will have a clone with same name in cloned environment. Cloned hosts will all be in DEFINED state (see Host).

Parameters:
  • clone_name (string) - The name of the clone.
Returns: Environment
The representation of environment's clone.

audit_logs(self)

 

Instantiates the collection of audit logs associated to this environment. The audit log refer to the environment itself as well as to all hosts and their contexts.

Returns: AuditLogCollection
The collection of audit logs associated to this environment.

Property Details

organization

The name of the organization owning this environment.

Get Method:
unreachable.organization(self) - The name of the organization owning this environment.
Type:
string

hosts_f

The names of the hosts in this environment.

Get Method:
unreachable.hosts_f(self) - The names of the hosts in this environment.
Type:
list of string