Class ConfigurationApi
Namespace: Casewhere.Runtime.DSL.Api
Assembly: Casewhere.Runtime.dll
public class ConfigurationApi : IConfigurationApi, IDslApi
Inheritance
Implements
Inherited Members
object.ToString(), object.Equals(object), object.Equals(object, object), object.ReferenceEquals(object, object), object.GetHashCode(), object.GetType(), object.MemberwiseClone()
Extension Methods
ObjectExtension.ConvertToBsonValue(object), EnumExtensions.DeepClone<ConfigurationApi>(ConfigurationApi)
Constructors
ConfigurationApi(IProductRepository, IDocumentRepository, IDataSourceService, IDataClassService, IWorkerSiteService, IAccessRuleService, IPluginService, IWorkflowDefinitionService, IDataTriggerService, IEventTriggerService, IWebTriggerService, IPageService, IWidgetService, IWidgetActionService)
public ConfigurationApi(IProductRepository productRepository, IDocumentRepository documentRepository, IDataSourceService dataSourceService, IDataClassService dataClassService, IWorkerSiteService workerSiteService, IAccessRuleService accessRuleService, IPluginService pluginService, IWorkflowDefinitionService workflowDefinitionService, IDataTriggerService dataTriggerService, IEventTriggerService eventTriggerService, IWebTriggerService webTriggerService, IPageService pageService, IWidgetService widgetService, IWidgetActionService widgetActionService)
Parameters
productRepository
IProductRepository
documentRepository
IDocumentRepository
dataSourceService
IDataSourceService
dataClassService
IDataClassService
workerSiteService
IWorkerSiteService
accessRuleService
IAccessRuleService
pluginService
IPluginService
workflowDefinitionService
IWorkflowDefinitionService
dataTriggerService
IDataTriggerService
eventTriggerService
IEventTriggerService
webTriggerService
IWebTriggerService
pageService
IPageService
widgetService
IWidgetService
widgetActionService
IWidgetActionService
Methods
GetApiEndpoint()
Get the worker API endpoint.
public string GetApiEndpoint()
Returns
The API endpoint.
Examples
var configurationApi = ctx.Use<IConfigurationApi>();
var apiEndpoint = configurationApi.GetApiEndpoint();
Log.Info("GetApiEndpoint: {apiEndpoint}", apiEndpoint);
// Log show: GetApiEndpoint: "https://api-local.casewhere.com/api/v0.1/"
GetDataClassByName(string)
Get data class by name.
public DslDataClass GetDataClassByName(string name)
Parameters
name
string
The name of the data class.
Returns
The data class with the specified name.
GetDataClassNameById(Guid)
Get data class name by ID.
public string GetDataClassNameById(Guid id)
Parameters
id
Guid
The ID of the data class.
Returns
The name of the data class with the specified ID.
GetDataClasses()
Get all data classes
public IList<DslDataClass> GetDataClasses()
Returns
A set of data classes
GetDataClassesByProduct(string)
Get data classes by product
public IList<DslDataClass> GetDataClassesByProduct(string productName)
Parameters
productName
string
Product name
Returns
A set of data classes
GetDataClassesByTag(string)
Get data classes by tag
public IList<DslDataClass> GetDataClassesByTag(string tag)
Parameters
tag
string
Tag
Returns
A set of data classes
GetDataSources()
Get all existing data sources in our system.
public IList<DslDataSource> GetDataSources()
Returns
A set of data sources
GetDataSourcesByProduct(string)
Get data sources by a product
public IList<DslDataSource> GetDataSourcesByProduct(string productName)
Parameters
productName
string
Product Name
Returns
A set of data sources
GetDataSourcesByTag(string)
Get data sources by a tag
public IList<DslDataSource> GetDataSourcesByTag(string tag)
Parameters
tag
string
Tag argument specifies tag name is based on filtering
Returns
A set of data sources
GetDataTriggers()
Get all Data triggers
public IList<DslDataTrigger> GetDataTriggers()
Returns
A list of Data triggers
GetDataTriggersByProduct(string)
Get all Data triggers assigned with a specified product name.
public IList<DslDataTrigger> GetDataTriggersByProduct(string productName)
Parameters
productName
string
Product Name
Returns
A list of Data triggers
GetDataTriggersByTag(string)
Get all Data triggers assigned with a specified Tag.
public IList<DslDataTrigger> GetDataTriggersByTag(string tag)
Parameters
tag
string
Tag
Returns
A list of Data triggers
GetEventTriggers()
Get all Event triggers
public IList<DslEventTrigger> GetEventTriggers()
Returns
A list of Event triggers
GetEventTriggersByProduct(string)
Get all Event triggers assigned with a specified product name.
public IList<DslEventTrigger> GetEventTriggersByProduct(string productName)
Parameters
productName
string
Product Name
Returns
A list of Event triggers
GetEventTriggersByTag(string)
Get all Event triggers assigned with a specified Tag.
public IList<DslEventTrigger> GetEventTriggersByTag(string tag)
Parameters
tag
string
Tag
Returns
A list of Event triggers
GetFiles()
Get all system files with informations.
public IList<DslFile> GetFiles()
Returns
List of DslFile
GetFilesByProduct(string)
Get system files with informations in provided product. If exist product, return suitable system files. Otherwise, return empty list.
public IList<DslFile> GetFilesByProduct(string productName)
Parameters
productName
string
Name of exist product.
Returns
List of DslFile
GetFilesByTag(string)
Get system files with informations in provided tag. If exist product, return suitable system files. Otherwise, return empty list.
public IList<DslFile> GetFilesByTag(string tag)
Parameters
tag
string
Tag of file.
Returns
List of DslFile
GetPages(Guid)
Get all pages with workerSiteId.
public IList<DslWorkerSitePage> GetPages(Guid workerSiteId)
Parameters
workerSiteId
Guid
Id of WorkerSite
Returns
A list of pages
GetPages(string)
Get all pages with worker uri.
public IList<DslWorkerSitePage> GetPages(string workerUri)
Parameters
workerUri
string
Worker uri
Returns
A list of pages
GetPlugins()
Get all system plugins with informations.
public IList<DslPlugin> GetPlugins()
Returns
List of DslPlugin.
GetPluginsByProduct(string)
Get plugins with informations in provided product. If exist product, return suitable plugins. Otherwise, return empty list.
public IList<DslPlugin> GetPluginsByProduct(string productName)
Parameters
productName
string
Name of exist product.
Returns
List of DslPlugin.
GetProducts()
Get all products with informations
public IList<DslProduct> GetProducts()
Returns
List of DslProduct
GetRules()
Get all rules
public IList<DslRule> GetRules()
Returns
set of rules
GetRulesByProduct(string)
Get rules by productName
public IList<DslRule> GetRulesByProduct(string productName)
Parameters
productName
string
product Name
Returns
set of rules
GetRulesByProduct(string, string)
Get rules by product Name and Rule type
public IList<DslRule> GetRulesByProduct(string productName, string type)
Parameters
productName
string
product Name
type
string
rule Type
Returns
set of rules, throws exception if Rule Type is invalid
GetRulesByType(string)
Get rules by type of rule
public IList<DslRule> GetRulesByType(string type)
Parameters
type
string
type of rules
Returns
set of rules, throws exception if Rule Type is invalid
GetRuntimeApiEndPoint()
Get the worker runtime API endpoint.
public string GetRuntimeApiEndPoint()
Returns
The runtime API endpoint.
Examples
var configurationApi = ctx.Use<IConfigurationApi>();
var runtimeApiEndPoint = configurationApi.GetRuntimeApiEndPoint();
Log.Info("GetRuntimeApiEndPoint: {runtimeApiEndPoint}", runtimeApiEndPoint);
// Log show: GetRuntimeApiEndPoint: "https://api-local.casewhere.com/external/v0.1/"
GetWebTriggers()
Get all Web triggers
public IList<DslWebTrigger> GetWebTriggers()
Returns
A list of Web triggers
GetWebTriggersByProduct(string)
Get all Web triggers assigned with a specified product name.
public IList<DslWebTrigger> GetWebTriggersByProduct(string productName)
Parameters
productName
string
Product Name
Returns
A list of Web trigger
GetWebTriggersByTag(string)
Get all Web triggers assigned with a specified Tag.
public IList<DslWebTrigger> GetWebTriggersByTag(string tag)
Parameters
tag
string
Tag
Returns
A list of Web trigger
GetWidgetActions(string)
Get all widget actions with widgetId
public IList<DslWidgetAction> GetWidgetActions(string widgetId)
Parameters
widgetId
string
Id of widget
Returns
A list of widget actions
GetWidgets(string)
Get all widgets with page name.
public IList<DslWidget> GetWidgets(string pageName)
Parameters
pageName
string
Name of page
Returns
A list of widgets
GetWorkerSites()
Get all worker sites with informations.
public IList<DslWorkerSite> GetWorkerSites()
Returns
set of worker sites.
GetWorkerSitesByProduct(string)
Get worker sites with informations in provided product.
public IList<DslWorkerSite> GetWorkerSitesByProduct(string productName)
Parameters
productName
string
Name of product.
Returns
Set of worker sites.
GetWorkflowDefinitions()
Get all workflow definition
public IList<DslWorkflowDefinition> GetWorkflowDefinitions()
Returns
a set of workflow definition
GetWorkflowDefinitionsByProduct(string)
Get workflow definitions by product Name
public IList<DslWorkflowDefinition> GetWorkflowDefinitionsByProduct(string productName)
Parameters
productName
string
product Name
Returns
a set of workflow definition
GetWorkflowDefinitionsByTag(string)
Get workflow definitions by tag
public IList<DslWorkflowDefinition> GetWorkflowDefinitionsByTag(string tag)
Parameters
tag
string
Tag
Returns
a set of workflow definition