Insight API
Public Member Functions | List of all members
InsightApi Class Reference

Insight API More...

Inherits IInsightApi.

Public Member Functions

bool IsMultiTenantMode ()
 Determines that Insight is installed in multi-tenant mode. More...
 
Guid Login (string login, string password, string tenantId=null, EApplicationType applicationType=EApplicationType.Admin)
 Checks user credentials and creates a new session if the credentials are valid. More...
 
Guid LoginEx (Dictionary< string, List< string >> parameters, string tenantId=null, EApplicationType applicationType=EApplicationType.Admin)
 Checks login parameters and creates a new session if the parameters are valid. More...
 
TenantInfo [] GetTenants (Guid sessionId)
 Returns a list of tenants. More...
 
TenantInfo CreateUpdateTenant (Guid sessionId, string tenantId, bool update=false, string customerName=null, string dataFolder=null, string password=null, string databaseTypeName=null, string connectionString=null, string additionalString=null, string databaseServerName="Default")
 Creates a new tenant or updates the existing one. More...
 
void ActivateTenant (Guid sessionId, string tenantId)
 Activates tenant. More...
 
void DeactivateTenant (Guid sessionId, string tenantId)
 Deactivates tenant. More...
 
string CreateUpdateProject (Guid sessionId, string projectName, string tenantId=null, bool updateExisting=false, string metaDatabaseTypeName=null, string metaConnectionString=null, string metaAdditionalString=null, string dataDatabaseTypeName=null, string dataConnectionString=null, string dataAdditionalString=null, string databaseServerName="Default")
 Creates a new project or updates the existing one. More...
 
TenantUpdateResult [] UpdateTenantsAndProjects (Guid sessionId, string[] tenantIds, string[] projectNames=null)
 Updates the selected tenant's administrator databases and projects to the latest Insight version. More...
 
TenantUpdateResult [] ImportAdminSettingsAndProject (Guid sessionId, string[] tenantIds=null, string[] projectNames=null, byte[] data=null, bool updateVersion=false, bool importData=true, bool overwrite=true, string metaDatabaseTypeName=null, string metaConnectionString=null, string metaAdditionalString=null, string dataDatabaseTypeName=null, string dataConnectionString=null, string dataAdditionalString=null, string databaseServerName="Default", bool runPublishAfterImport=true)
 Imports administration settings, or a project, or both of them (bundle). More...
 
ProjectDescription [] GetProjectsDescriptions (Guid sessionId, string tenantId=null)
 Returns a list of projects. More...
 
ProjectDef GetProjectDefinition (Guid sessionId, Guid projectId, string tenantId=null)
 Returns a project definition for the specified project ID. More...
 
string GetProjectsTreeXml (Guid sessionId, Guid projectId, string viewerUri, bool includeCharts, string tenantId=null)
 Returns an XML with a project tree. More...
 
void RunDataLoad (Guid sessionId, Guid projectId, string planName, DateTime from, DateTime to, bool saveHistoryDate, bool useHistoryDate, string tenantId=null)
 Runs data load for the specified execution plan. More...
 

Detailed Description

Insight API

Member Function Documentation

◆ ActivateTenant()

void ActivateTenant ( Guid  sessionId,
string  tenantId 
)

Activates tenant.

Only multi-tenant administrator has the right to execute this method.

Parameters
sessionIdSession ID.
tenantIdTenant ID (required). If the tenant with the same ID does not exist, an exception occurs.

◆ CreateUpdateProject()

string CreateUpdateProject ( Guid  sessionId,
string  projectName,
string  tenantId = null,
bool  updateExisting = false,
string  metaDatabaseTypeName = null,
string  metaConnectionString = null,
string  metaAdditionalString = null,
string  dataDatabaseTypeName = null,
string  dataConnectionString = null,
string  dataAdditionalString = null,
string  databaseServerName = "Default" 
)
inline

Creates a new project or updates the existing one.

This method can be executed by the following users: Multi-tenant administrator, tenant user logged in to the Admin Console, or the user logged in to the Admin Console in single-tenant mode.

Parameters
sessionIdSession ID.
projectNameProject name (required).
tenantIdTenant ID. Required for Multi-tenant mode. Ignored in single-tenant mode.
updateExistingUpdate the existing project (optional, the value is set to false by default). If the value is false and a project with the same name already exists, an error occurs.
metaDatabaseTypeNameMeta Database Type Name ("MS SQL Server", "MySql 5", "Oracle").
metaConnectionStringMeta Database connection string (optional). If the value is not defined, the database server is used in multi-tenant mode. In single-tenant mode, an error occurs.
metaAdditionalStringAdditional string for Meta database connection (optional).
dataDatabaseTypeNameData Database Type Name ("MS SQL Server", "MySql 5", "Oracle").
dataConnectionStringData database connection string (optional). If the value is not defined, the database server is used in multi-tenant mode. In single-tenant mode, an error occurs.
dataAdditionalStringAdditional string for Data database connection (optional).
databaseServerNameDatabase server name (optional). If Meta and/or Data connection is not defined and the project with the selected name does not exist, this database server is used in multi-tenant mode to create new project databases (if possible).
Returns

◆ CreateUpdateTenant()

TenantInfo CreateUpdateTenant ( Guid  sessionId,
string  tenantId,
bool  update = false,
string  customerName = null,
string  dataFolder = null,
string  password = null,
string  databaseTypeName = null,
string  connectionString = null,
string  additionalString = null,
string  databaseServerName = "Default" 
)
inline

Creates a new tenant or updates the existing one.

Only multi-tenant administrator can execute this method.

Parameters
sessionIdSession ID.
tenantIdTenant ID (required).
updateUpdate the existing tenant (optional, the value is set to false by default). If the value is false and a tenant with the same name already exists, an error occurs. If the value is true and a tenant with the same ID already exists, it is updated.
customerNameCustomer name (optional).
dataFolderData folder (optional). If the value is empty or not defined, a subfolder with <tenant id> from the Insight root folder is used.
passwordTenant administrator password (optional). Cannot be empty. Password is required for a new tenant. If a tenant is updated and a new password is not defined, then current password is used.
databaseTypeNameDatabase type ("MS SQL Server", "MySql 5", "Oracle").
connectionStringInsight administrator connection (connection string) (optional). If the value is not defined, database server parameters can be used. If the value is not defined and a tenant with the same ID already exists, then current connection is used.
additionalStringAdditional string for Insight administrator connection (optional).
databaseServerNameDatabase server name (optional). Use the selected database server to create a new tenant administrator database (if possible) for a new tenant. If an administrator connection is not defined and a tenant with the selected tenant ID does not exist, the selected database server is used in multi-tenant mode to create new tenant databases (if possible).
Returns

Type: TenantInfo[]

Tenant information, including the administrator database connection string with the password as plain text.

◆ DeactivateTenant()

void DeactivateTenant ( Guid  sessionId,
string  tenantId 
)

Deactivates tenant.

Parameters
sessionIdSession ID.
tenantIdTenant ID (required). If the tenant with the same ID does not exist, an exception occurs.

◆ GetProjectDefinition()

ProjectDef GetProjectDefinition ( Guid  sessionId,
Guid  projectId,
string  tenantId = null 
)
inline

Returns a project definition for the specified project ID.

Parameters
sessionIdSession ID.
projectIdProject ID.
tenantIdTenant ID.
Returns
Type: ProjectDef

◆ GetProjectsDescriptions()

ProjectDescription [] GetProjectsDescriptions ( Guid  sessionId,
string  tenantId = null 
)
inline

Returns a list of projects.

Parameters
sessionIdSession ID.
tenantIdTenant ID.
Returns

Type: ProjectDescription[]

An array containing project descriptions.

◆ GetProjectsTreeXml()

string GetProjectsTreeXml ( Guid  sessionId,
Guid  projectId,
string  viewerUri,
bool  includeCharts,
string  tenantId = null 
)
inline

Returns an XML with a project tree.

Parameters
sessionIdSession ID.
projectIdProject ID.
viewerUriBase Viewer URl.
includeChartsA value that indicates whether the charts should be included in the project tree.
tenantIdTenant ID.
Returns

◆ GetTenants()

TenantInfo [] GetTenants ( Guid  sessionId)
inline

Returns a list of tenants.

Parameters
sessionIdSession ID.
Returns

Type: TenantInfo[]

An array containing a list of tenants.

◆ ImportAdminSettingsAndProject()

TenantUpdateResult [] ImportAdminSettingsAndProject ( Guid  sessionId,
string []  tenantIds = null,
string []  projectNames = null,
byte []  data = null,
bool  updateVersion = false,
bool  importData = true,
bool  overwrite = true,
string  metaDatabaseTypeName = null,
string  metaConnectionString = null,
string  metaAdditionalString = null,
string  dataDatabaseTypeName = null,
string  dataConnectionString = null,
string  dataAdditionalString = null,
string  databaseServerName = "Default",
bool  runPublishAfterImport = true 
)
inline

Imports administration settings, or a project, or both of them (bundle).

This method can be executed by the following users. 1) Multi-tenant Administrator, 2) Tenant user, who logged in to the Admin Console, can execute this method only for the assigned tenants, 3) User, who logged in to the Admin Console, in single-tenant mode.

Parameters
sessionIdSession ID.
tenantIdsAn array of tenants (administrator database) IDs.
projectNamesDefines a list of projects to be updated for each tenant, The list can be empty.
dataImport data (binary). Administration settings (xml), a project or a bundle (zip). Can be null.
updateVersionUpdates project version (optional, false by default). If the value is true and Administrator and/or project databases use an old Insight version, it is updated automatically. If the value is false and the version is incorrect, the update is skipped.
importDataImport data for a project. The value can be set to True or False.
overwriteOverwrites the existing documents. The value can be set to True or False.
metaDatabaseTypeNameMeta Database Type Name ("MS SQL Server", "MySql 5", "Oracle").
metaConnectionStringMeta Database connection string (optional). If import data is null, then the method only applies these settings.
metaAdditionalStringAdditional string for Meta Database connection (optional).
dataDatabaseTypeNameData Database Type Name ("MS SQL Server", "MySql 5", "Oracle").
dataConnectionStringData Database connection string (optional). If import data is null, then the method only applies these settings.
dataAdditionalStringAdditional string for Data DB connection (optional).
databaseServerNameDatabase server name (optional). If Meta and/or Data connection is not defined and a project with the selected name does not exist, this database server is used in multi-tenant mode to create new project databases (if possible).
runPublishAfterImportRuns the publish operation after import.
Returns

Type: TenantUpdateResult[]

An array containing results of update and import for each project and each tenant administration settings (including all errors and warnings that occurred during updates).

◆ IsMultiTenantMode()

bool IsMultiTenantMode ( )

Determines that Insight is installed in multi-tenant mode.

Returns

◆ Login()

Guid Login ( string  login,
string  password,
string  tenantId = null,
EApplicationType  applicationType = EApplicationType.Admin 
)
inline

Checks user credentials and creates a new session if the credentials are valid.

Parameters
loginThe login to be validated.
passwordThe password for the specified user.
tenantIdTenant ID.
applicationTypeApplication Type.
Returns
Session ID if user credentials are valid; otherwise, an exception occurs.

◆ LoginEx()

Guid LoginEx ( Dictionary< string, List< string >>  parameters,
string  tenantId = null,
EApplicationType  applicationType = EApplicationType.Admin 
)
inline

Checks login parameters and creates a new session if the parameters are valid.

Parameters
parametersLogin Parameters.
tenantIdTenant ID.
applicationTypeApplication Type.
Returns
Session ID if user credentials are valid; otherwise, an exception occurs.

◆ RunDataLoad()

void RunDataLoad ( Guid  sessionId,
Guid  projectId,
string  planName,
DateTime  from,
DateTime  to,
bool  saveHistoryDate,
bool  useHistoryDate,
string  tenantId = null 
)
inline

Runs data load for the specified execution plan.

Parameters
sessionIdSession ID.
projectIdProject ID.
planNameName of an execution plan.
fromStart date.
toEnd date.
saveHistoryDateSaves "To" date as history date.
useHistoryDateUses history date as "From" date.
tenantIdTenant ID.
Returns

◆ UpdateTenantsAndProjects()

TenantUpdateResult [] UpdateTenantsAndProjects ( Guid  sessionId,
string []  tenantIds,
string []  projectNames = null 
)
inline

Updates the selected tenant's administrator databases and projects to the latest Insight version.

This method can be executed by the following users: Multi-tenant administrator, tenant logged in to the Admin Console, or the user logged in to the Admin Console in single-tenant mode.

Parameters
sessionIdSession ID.
tenantIdsAn array of tenants (administrator database) should be updated.
projectNamesDefines a list of projects to be updated for each tenant. The list can be empty.
Returns

Type: TenantUpdateResult[]

An array containing results of updates for each project and for each tenant (including errors and warnings that occurred during updates).


The documentation for this class was generated from the following file: