public ActionResponseSchemas List([FromBody] ActionGenericBase action) { var session = Program.Core.Sessions.GetSession(action.SessionId); Thread.CurrentThread.Name = $"API:{session.InstanceKey}:{Utility.GetCurrentMethod()}"; Program.Core.Log.Trace(Thread.CurrentThread.Name); ActionResponseSchemas result = new ActionResponseSchemas(); try { var persistSchemas = Program.Core.Schemas.GetList(session, action.SchemaName); foreach (var persistSchema in persistSchemas) { result.Add(persistSchema.ToPayload()); } result.Success = true; } catch (Exception ex) { result.Message = ex.Message; } return(result); }
public List <Payloads.Models.DocumentMeta> GetCatalog(string schema) { var action = new ActionGenericBase(client.Token.SessionId) { SchemaName = schema, }; return(Submit <ActionGenericBase, ActionResponseDocuments>("api/Document/List", action).List); }
/// <summary> /// Lists the doucments within a given schema. /// </summary> /// <param name="schema"></param> public async Task <List <Payloads.Models.DocumentMeta> > GetCatalogAsync(string schema) { var action = new ActionGenericBase(client.Token.SessionId) { SchemaName = schema, }; return((await SubmitAsync <ActionGenericBase, ActionResponseDocuments>("api/Document/List", action)).List); }
/// <summary> /// Lists the existing schemas within a given schema. /// </summary> /// <param name="schema"></param> public async Task <List <Payloads.Models.Schema> > ListAsync(string schema) { var action = new ActionGenericBase(client.Token.SessionId) { SchemaName = schema }; return((await SubmitAsync <ActionGenericBase, ActionResponseSchemas>("api/Schema/List", action)).List); }
public void Drop(string schema) { var action = new ActionGenericBase(client.Token.SessionId) { SchemaName = schema }; Submit <ActionGenericBase, ActionResponseBase>("api/Schema/Drop", action); }
/// <summary> /// Drops a single schema or an entire schema path. /// </summary> /// <param name="schema"></param> public async Task DropAsync(string schema) { var action = new ActionGenericBase(client.Token.SessionId) { SchemaName = schema }; await SubmitAsync <ActionGenericBase, ActionResponseBase>("api/Schema/Drop", action); }
public bool Exists(string schema) { var action = new ActionGenericBase(client.Token.SessionId) { SchemaName = schema }; return(Submit <ActionGenericBase, ActionResponseBoolean>("api/Schema/Exists", action).Value); }
/// <summary> /// Checks for the existence of a schema. /// </summary> /// <param name="schema"></param> public async Task <bool> ExistsAsync(string schema) { var action = new ActionGenericBase(client.Token.SessionId) { SchemaName = schema }; return((await SubmitAsync <ActionGenericBase, ActionResponseBoolean>("api/Schema/Exists", action)).Value); }
public List <Payloads.Models.Schema> List(string schema) { var action = new ActionGenericBase(client.Token.SessionId) { SchemaName = schema }; return(Submit <ActionGenericBase, ActionResponseSchemas>("api/Schema/List", action).List); }
public void DeleteById(string schema, Guid id) { var action = new ActionGenericBase(client.Token.SessionId) { SchemaName = schema, ObjectId = id }; Submit <ActionGenericBase, ActionResponseBase>("api/Document/DeleteById", action); }
/// <summary> /// Deletes a document in the given schema by its Id. /// </summary> /// <param name="schema"></param> /// <param name="document"></param> public async Task DeleteByIdAsync(string schema, Guid id) { var action = new ActionGenericBase(client.Token.SessionId) { SchemaName = schema, ObjectId = id }; await SubmitAsync <ActionGenericBase, ActionResponseBase>("api/Document/DeleteById", action); }
public void DeleteLoginByName(string username) { var action = new ActionGenericBase(client.Token.SessionId) { ObjectName = username }; Submit <ActionGenericBase, ActionResponseId> ("api/Security/DeleteLoginByName", action); }
public async Task DeleteLoginByNameAsync(string username) { var action = new ActionGenericBase(client.Token.SessionId) { ObjectName = username }; await SubmitAsync <ActionGenericBase, ActionResponseId> ("api/Security/DeleteLoginByName", action); }
public ActionResponseDocuments List([FromBody] ActionGenericBase action) { Session session = Program.Core.Sessions.GetSession(action.SessionId); Thread.CurrentThread.Name = $"API:{session.InstanceKey}:{Utility.GetCurrentMethod()}"; Program.Core.Log.Trace(Thread.CurrentThread.Name); var persistCatalog = Program.Core.Documents.EnumerateCatalog(session, action.SchemaName); var result = new ActionResponseDocuments(); foreach (var catalogItem in persistCatalog) { result.Add(catalogItem.ToPayload()); } return(result); }
public ActionResponseBase DeleteById([FromBody] ActionGenericBase action) { var session = Program.Core.Sessions.GetSession(action.SessionId); Thread.CurrentThread.Name = $"API:{session.InstanceKey}:{Utility.GetCurrentMethod()}"; Program.Core.Log.Trace(Thread.CurrentThread.Name); ActionResponseBase result = new ActionResponseBase(); try { Program.Core.Documents.DeleteById(session, action.SchemaName, action.ObjectId); result.Success = true; } catch (Exception ex) { result.Message = ex.Message; } return(result); }
public ActionResponseIndexes List([FromBody] ActionGenericBase action) { var session = Program.Core.Sessions.GetSession(action.SessionId); Thread.CurrentThread.Name = $"API:{session.InstanceKey}:{Utility.GetCurrentMethod()}"; Program.Core.Log.Trace(Thread.CurrentThread.Name); var result = new ActionResponseIndexes(); try { result.List = Program.Core.Indexes.List(session, action.SchemaName); result.Success = true; } catch (Exception ex) { result.Message = ex.Message; } return(result); }