Package comodit_client :: Package api :: Module importer :: Class Import

Class Import


The importer is a tool that enables to import entities from local directories. Imported entities have generally been exported (see Export).

Instance Methods
 
__init__(self, skip_conflict=False, queue_actions=False, with_instances=False, update_existing=False)
Creates an importer instance.
 
import_application(self, org, root_folder, skip_conflict_detection=False)
Imports an application from a local folder into a given organization.
 
import_distribution(self, org, root_folder, skip_conflict_detection=False)
Imports a distribution from a local folder into a given organization.
 
import_platform(self, org, root_folder, skip_conflict_detection=False)
Imports a platform from a local folder into a given organization.
 
import_environment(self, org, env_folder, skip_conflict_detection=False)
Imports an environment from a local folder into a given organization.
 
import_host(self, env, host_folder, skip_conflict_detection=False)
Imports a host from a local folder into a given environment.
 
import_organization(self, client, org_folder)
Imports an organization from a local folder.
 
display_queue(self, show_only_conflicts=True)
If queuing was enabled, displays the queued actions to standard output.
 
execute_queue(self)
If queuing was enabled, executes the queued actions to standard output.
bool
no_conflict(self)
If queuing was enabled, tells if a conflict was detected.

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, skip_conflict=False, queue_actions=False, with_instances=False, update_existing=False)
(Constructor)

 

Creates an importer instance. When importing entities, there might be conflicts with existing remote entities. In this case, import fails unless 'skip conflicts' flag is set (conflicting entities are not imported). This is not a synchronization tool, see sync tool for this feature.

The importer can queue actions before executing them on import. This allows to audit the actions before actually applying them. It also enabled to detect conflicts.

Parameters:
  • skip_conflict (bool) - If true, sets 'skip conflicts' flag.
  • queue_actions (bool) - If true, enabled queuing mode.
Overrides: object.__init__

import_application(self, org, root_folder, skip_conflict_detection=False)

 

Imports an application from a local folder into a given organization.

Parameters:
  • org (Organization) - The target organization.
  • root_folder (string) - Path to directory containing application's definition.

import_distribution(self, org, root_folder, skip_conflict_detection=False)

 

Imports a distribution from a local folder into a given organization.

Parameters:
  • org (Organization) - The target organization.
  • root_folder (string) - Path to directory containing distribution's definition.

import_platform(self, org, root_folder, skip_conflict_detection=False)

 

Imports a platform from a local folder into a given organization.

Parameters:
  • org (Organization) - The target organization.
  • root_folder (string) - Path to directory containing platform's definition.

import_environment(self, org, env_folder, skip_conflict_detection=False)

 

Imports an environment from a local folder into a given organization.

Parameters:
  • org (Organization) - The target organization.
  • env_folder (string) - Path to directory containing environment's definition.

import_host(self, env, host_folder, skip_conflict_detection=False)

 

Imports a host from a local folder into a given environment.

Parameters:
  • env (Environment) - The target environment.
  • host_folder (string) - Path to directory containing host's definition.

import_organization(self, client, org_folder)

 

Imports an organization from a local folder.

Parameters:
  • client (Client) - The client.
  • org_folder (string) - Path to directory containing organization's definition.

display_queue(self, show_only_conflicts=True)

 

If queuing was enabled, displays the queued actions to standard output. This method must be called after a call to one of the import_* methods.

execute_queue(self)

 

If queuing was enabled, executes the queued actions to standard output. This method must be called after a call to one of the import_* methods.

no_conflict(self)

 

If queuing was enabled, tells if a conflict was detected. This method must be called after a call to one of the import_* methods.

Returns: bool
True if a conflict was detected, false otherwise.