Exemplo n.º 1
0
        private void WriteMetaFilesToDisk()
        {
            var path = Path.Combine(ManagementInformationPath, s_OverviewFile);

            Directory.CreateDirectory(ManagementInformationPath);
            using var stream = File.OpenWrite(path);
            using var sw     = new StreamWriter(stream);
            try
            {
                m_Logger.Info($"Writing Index Overview to file: {path}");
                var json = JsonConvert.SerializeObject(m_Indexes, GetSerializationSettings());
                sw.Write(json);
                sw.Flush();
            }
            catch (Exception e)
            {
                m_Logger.Error($"Exception {e.Message} with callstack {e.StackTrace}");
                throw;
            }
        }
        public ActionResult <DeleteIndexResponse> DeleteExistingIndex(DeleteIndexRequest model)
        {
            m_Logger.Info($"[DELETE] {APIRoutes.CreateIndexRoute}");

            bool success = true;

            try
            {
                m_Manager.DeleteIndex(model.IndexID);
            }
            catch (NotSupportedException e)
            {
                m_Logger.Error(e.Message);
                success = false;
            }

            return(new DeleteIndexResponse
            {
                Succeeded = success
            });
        }