Esempio n. 1
0
 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");
     }
 }
Esempio n. 2
0
 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);
     }
 }
Esempio n. 3
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;
 }
Esempio n. 4
0
 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;
 }
Esempio n. 5
0
 public OpenShift(CUIController controller) : this(controller, Ct)
 {
 }
Esempio n. 6
0
 public CUIPackage(string name, NLUEngine engine, CUIController controller, params CUIPackage[] subPackages) : this(name, engine, controller, Ct, subPackages)
 {
 }
Esempio n. 7
0
 public MedsTracker(CUIController controller) : this(controller, Ct)
 {
 }
Esempio n. 8
0
 public Bots(CUIController controller) : this(controller, Api.Ct)
 {
 }
Esempio n. 9
0
 public Vish(CUIController controller) : this(controller, Ct)
 {
 }