public OpenShift(CUIController controller, CancellationToken ct) : base("OpenShift", new SnipsNLUEngine(Path.Combine("Engines", "openshift")), controller, ct) { Intents.Add("list", List); Intents.Add("page", Page); MenuHandlers["OPENSHIFT_OBJECTS"] = GetOpenShiftMenuSelection; MenuIndexes["OPENSHIFT_OBJECTS"] = 5; ItemsDescriptionHandlers["OPENSHIFT_PODS"] = DescribePods; ItemsDescriptionHandlers["OPENSHIFT_PROJECTS"] = DescribeProjects; ItemsDescriptionHandlers["OPENSHIFT_BUILDS"] = DescribeBuilds; ApiUrl = Config("CUI_VISH_OPENSHIFT_URL"); ApiToken = Config("CUI_VISH_OPENSHIFT_TOKEN"); if (!string.IsNullOrEmpty(ApiToken) && !string.IsNullOrEmpty(ApiUrl)) { var handler = new HttpClientHandler { }; Client = new OpenShiftAPIwithKubernetes(new Uri(ApiUrl), new TokenCredentials(ApiToken), handler); Initialized = true; } else if (string.IsNullOrEmpty(ApiUrl)) { SayErrorLine("I could not determine your OpenShift API URL. Please ensure the value exists in your config.json configuration file or as the environment variable {0}.", "CUI_VISH_OPENSHIFT_URL"); } else if (string.IsNullOrEmpty(ApiToken)) { SayErrorLine("I could not determine your OpenShift service API token. Please ensure the value exists in your config.json configuration file or as the environment variable {0}.", "CUI_VISH_OPENSHIFT_TOKENs"); } }
public CUIPackage(string name, NLUEngine engine, CUIController controller, CancellationToken ct, params CUIPackage[] subPackages) : base(ct) { Name = name; NLUEngine = engine; Controller = controller; Intents.Add("help", Help); Intents.Add("menu", Menu); if (subPackages != null && subPackages.Length > 0) { SubPackages = subPackages.ToList(); } foreach (var vn in VariableNames) { Variables.Add(Prefixed(vn), null); } foreach (var i in ItemNames) { Items.Add(Prefixed(i), null); ItemsPageSize.Add(Prefixed(i), 10); ItemsCurrentPage.Add(Prefixed(i), 1); ItemsSelection.Add(Prefixed(i), -1); ItemsDescriptionHandlers.Add(Prefixed(i), null); } foreach (var m in MenuNames) { MenuHandlers.Add(Prefixed(m), null); MenuIndexes.Add(Prefixed(m), 0); } }
public MedTracker(CUIController controller, CancellationToken ct) : base("Vish", new SnipsNLUEngine(Path.Combine("Engines", "vish")), controller, ct) { Intents.Add("launch", Launch); MenuIndexes["VISH_PACKAGES"] = 3; MenuHandlers["VISH_PACKAGES"] = GetPackagesMenuItem; Initialized = NLUEngine.Initialized; }
public Bots(CUIController controller, CancellationToken ct) : base("Bots", new SnipsNLUEngine(Path.Combine("Engines", "vish")), controller, ct) { Client = new EDDIClient(Api.Config("CUI_EDDI_SERVER_URL"), HttpClient); BotDescriptors = Client.BotstoreBotsDescriptorsGetAsync(null, null, null).Result; MenuHandlers["BOTS_AVAILABLE"] = GetBotMenuItem; MenuIndexes["BOTS_AVAILABLE"] = BotDescriptors.Count; Initialized = NLUEngine.Initialized && BotDescriptors != null && BotDescriptors.Count > 0; }
public OpenShift(CUIController controller) : this(controller, Ct) { }
public CUIPackage(string name, NLUEngine engine, CUIController controller, params CUIPackage[] subPackages) : this(name, engine, controller, Ct, subPackages) { }
public MedsTracker(CUIController controller) : this(controller, Ct) { }
public Bots(CUIController controller) : this(controller, Api.Ct) { }
public Vish(CUIController controller) : this(controller, Ct) { }