initial commit
This commit is contained in:
21
Models/BaseJunctionModel.cs
Normal file
21
Models/BaseJunctionModel.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Microsoft.SelfService.Portal.Core.API.Models
|
||||
{
|
||||
public class BaseJunctionModel
|
||||
{
|
||||
[Column(Order = 50)]
|
||||
//[DatabaseGenerated(DatabaseGeneratedOption.Computed)]
|
||||
public DateTime Modified { get; set; } = DateTime.Now;
|
||||
[Column(Order = 51)]
|
||||
//[DatabaseGenerated(DatabaseGeneratedOption.Computed)]
|
||||
public string ModifiedBy { get; set; } = new HttpContextAccessor().HttpContext.User.Identity.Name;
|
||||
|
||||
[Column(Order = 52)]
|
||||
//[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public DateTime Created { get; set; } = DateTime.Now;
|
||||
[Column(Order = 53)]
|
||||
//[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public string CreatedBy { get; set; } = new HttpContextAccessor().HttpContext.User.Identity.Name;
|
||||
}
|
||||
}
|
||||
38
Models/BaseModel.cs
Normal file
38
Models/BaseModel.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using Azure;
|
||||
using Azure.Core;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.SelfService.Portal.Core.API.Extensions.Dataannotations;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Microsoft.SelfService.Portal.Core.API.Models
|
||||
{
|
||||
public class BaseModel
|
||||
{
|
||||
[Column(Order = 0)]
|
||||
[DefaultValueSql("NEWID()")]
|
||||
//[DatabaseGenerated(DatabaseGeneratedOption.None)]
|
||||
public Guid Id { get; set; }
|
||||
|
||||
[Column(Order = 50)]
|
||||
[DefaultValueSql("GETDATE()")]
|
||||
//[DatabaseGenerated(DatabaseGeneratedOption.Computed)]
|
||||
public DateTime Modified { get; set; } = DateTime.Now;
|
||||
|
||||
[Column(Order = 51)]
|
||||
[DefaultValue("System")]
|
||||
//[DatabaseGenerated(DatabaseGeneratedOption.Computed)]
|
||||
public string ModifiedBy { get; set; } = new HttpContextAccessor().HttpContext.User.Identity.Name;
|
||||
|
||||
[Column(Order = 52)]
|
||||
[DefaultValueSql("GETDATE()")]
|
||||
//[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public DateTime Created { get; set; } = DateTime.Now;
|
||||
|
||||
[Column(Order = 53)]
|
||||
[DefaultValue("System")]
|
||||
//[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
//public string CreatedBy { get; set; } = "CCIS-P01S01-CM\\ASA_SSP_Admin";
|
||||
public string CreatedBy { get; set; } = new HttpContextAccessor().HttpContext.User.Identity.Name;
|
||||
}
|
||||
}
|
||||
19
Models/DeploymentGroupModel.cs
Normal file
19
Models/DeploymentGroupModel.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using Microsoft.SelfService.Portal.Core.API.Extensions.Dataannotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Microsoft.SelfService.Portal.Core.API.Models
|
||||
{
|
||||
public class DeploymentGroupModel : BaseModel
|
||||
{
|
||||
[Column(Order = 2)]
|
||||
public Guid TemplateId { get; set; }
|
||||
|
||||
[Column(Order = 4)]
|
||||
[DefaultValueSql("'New'")]
|
||||
public string Status { get; set; }
|
||||
|
||||
public TemplateModel Template { get; set; }
|
||||
|
||||
public ICollection<DeploymentModel> Deployments { get; set; }
|
||||
}
|
||||
}
|
||||
22
Models/DeploymentModel.cs
Normal file
22
Models/DeploymentModel.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Microsoft.SelfService.Portal.Core.API.Models
|
||||
{
|
||||
public class DeploymentModel : BaseModel
|
||||
{
|
||||
[Column(Order = 2)]
|
||||
public Guid DeploymentGroupId { get; set; }
|
||||
[Column(Order = 3)]
|
||||
public Guid VirtualMachineId { get; set; }
|
||||
[Column(Order = 4)]
|
||||
public string Status { get; set; }
|
||||
[Column(Order = 5)]
|
||||
public string JSONData { get; set; }
|
||||
|
||||
public DeploymentGroupModel DeploymentGroup { get; set; }
|
||||
public VirtualMachineModel VirtualMachine { get; set; }
|
||||
|
||||
public ICollection<JobModel> Jobs { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
20
Models/DomainModel.cs
Normal file
20
Models/DomainModel.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Microsoft.SelfService.Portal.Core.API.Models
|
||||
{
|
||||
public class DomainModel : BaseModel
|
||||
{
|
||||
[Column(Order = 1)]
|
||||
public string Name { get; set; }
|
||||
[Column(Order = 2)]
|
||||
public string FQDN { get; set; }
|
||||
[Column(Order = 3)]
|
||||
public string NetBIOS { get; set; }
|
||||
|
||||
public ICollection<EnvironmentDomainsModel> EnvironmentDomains { get; set; }
|
||||
|
||||
public ICollection<VirtualMachineModel> VirtualMachines { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
15
Models/EnvironmentDomainsModel.cs
Normal file
15
Models/EnvironmentDomainsModel.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Microsoft.SelfService.Portal.Core.API.Models
|
||||
{
|
||||
public class EnvironmentDomainsModel : BaseJunctionModel
|
||||
{
|
||||
[Column(Order = 0)]
|
||||
public Guid EnvironmentId { get; set; }
|
||||
public EnvironmentModel Environment { get; set; }
|
||||
|
||||
[Column(Order = 1)]
|
||||
public Guid DomainId { get; set; }
|
||||
public DomainModel Domain { get; set; }
|
||||
}
|
||||
}
|
||||
15
Models/EnvironmentModel.cs
Normal file
15
Models/EnvironmentModel.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Microsoft.SelfService.Portal.Core.API.Models
|
||||
{
|
||||
public class EnvironmentModel : BaseModel
|
||||
{
|
||||
[Column(Order = 1)]
|
||||
public string Name { get; set; }
|
||||
|
||||
[Column(Order = 2)]
|
||||
public bool CloudEnabled { get; set; }
|
||||
|
||||
public ICollection<EnvironmentDomainsModel> EnvironmentDomains { get; set; }
|
||||
}
|
||||
}
|
||||
21
Models/EventModel.cs
Normal file
21
Models/EventModel.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Microsoft.SelfService.Portal.Core.API.Models
|
||||
{
|
||||
public class EventModel : BaseModel
|
||||
{
|
||||
[Column(Order = 1)]
|
||||
public Guid RunbookId { get; set; }
|
||||
|
||||
[Column(Order = 2)]
|
||||
public string Class { get; set; }
|
||||
[Column(Order = 3)]
|
||||
public string Method { get; set; }
|
||||
[Column(Order = 4)]
|
||||
public string RestEndpointMethod { get; set; }
|
||||
[Column(Order = 5)]
|
||||
public string RestEndpointOperation { get; set; }
|
||||
|
||||
public RunbookModel Runbook { get; set; }
|
||||
}
|
||||
}
|
||||
15
Models/JobModel.cs
Normal file
15
Models/JobModel.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Microsoft.SelfService.Portal.Core.API.Models
|
||||
{
|
||||
public class JobModel : BaseModel
|
||||
{
|
||||
[Column(Order = 1)]
|
||||
public Guid DeploymentId { get; set; }
|
||||
[Column(Order = 2)]
|
||||
public Guid RunbookId { get; set; }
|
||||
|
||||
public DeploymentModel Deployment { get; set; }
|
||||
public RunbookModel Runbook { get; set; }
|
||||
}
|
||||
}
|
||||
16
Models/OptionCategoryModel.cs
Normal file
16
Models/OptionCategoryModel.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Microsoft.SelfService.Portal.Core.API.Models
|
||||
{
|
||||
public class OptionCategoryModel : BaseModel
|
||||
{
|
||||
[Column(Order = 1)]
|
||||
public string Name { get; set; }
|
||||
[Column(Order = 2)]
|
||||
public string ParentCategoryName { get; set; }
|
||||
[Column(Order = 3)]
|
||||
public int showOrder { get; set; }
|
||||
|
||||
public ICollection<OptionModel> Options { get; set; }
|
||||
}
|
||||
}
|
||||
19
Models/OptionModel.cs
Normal file
19
Models/OptionModel.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Microsoft.SelfService.Portal.Core.API.Models
|
||||
{
|
||||
public class OptionModel : BaseModel
|
||||
{
|
||||
[Column(Order = 1)]
|
||||
public string Name { get; set; }
|
||||
[Column(Order = 2)]
|
||||
public string OptionType { get; set; }
|
||||
[Column(Order = 3)]
|
||||
public string OptionValue { get; set; }
|
||||
|
||||
public OptionCategoryModel OptionCategory { get; set; }
|
||||
|
||||
public ICollection<TemplateOptionModel> TemplateOptions { get; set; }
|
||||
}
|
||||
}
|
||||
16
Models/RunbookModel.cs
Normal file
16
Models/RunbookModel.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Microsoft.SelfService.Portal.Core.API.Models
|
||||
{
|
||||
public class RunbookModel : BaseModel
|
||||
{
|
||||
[Column(Order = 1)]
|
||||
public string Name { get; set; }
|
||||
[Column(Order = 2)]
|
||||
public string Description { get; set; }
|
||||
|
||||
public ICollection<JobModel> Jobs { get; set; }
|
||||
|
||||
public ICollection<EventModel> Events { get; set; }
|
||||
}
|
||||
}
|
||||
14
Models/ServiceModel.cs
Normal file
14
Models/ServiceModel.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Microsoft.SelfService.Portal.Core.API.Models
|
||||
{
|
||||
public class ServiceModel : BaseModel
|
||||
{
|
||||
[Column(Order = 1)]
|
||||
public string Name { get; set; }
|
||||
[Column(Order = 2)]
|
||||
public string Description { get; set; }
|
||||
|
||||
public ICollection<TemplateCategoryModel> TemplateCategories { get; set; }
|
||||
}
|
||||
}
|
||||
20
Models/TemplateCategoryModel.cs
Normal file
20
Models/TemplateCategoryModel.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Microsoft.SelfService.Portal.Core.API.Models
|
||||
{
|
||||
public class TemplateCategoryModel : BaseModel
|
||||
{
|
||||
[Column(Order = 1)]
|
||||
public Guid ServiceId { get; set; }
|
||||
[Column(Order = 2)]
|
||||
public string Name { get; set; }
|
||||
[Column(Order = 3)]
|
||||
public string ParentCategoryName { get; set; }
|
||||
[Column(Order = 4)]
|
||||
public int showOrder { get; set; }
|
||||
|
||||
public ServiceModel Service { get; set; }
|
||||
|
||||
public ICollection<TemplateModel> Templates { get; set; }
|
||||
}
|
||||
}
|
||||
28
Models/TemplateModel.cs
Normal file
28
Models/TemplateModel.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using Microsoft.Identity.Client;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Microsoft.SelfService.Portal.Core.API.Models
|
||||
{
|
||||
public class TemplateModel : BaseModel
|
||||
{
|
||||
[Column(Order = 1)]
|
||||
public string Name { get; set; }
|
||||
[Column(Order = 2)]
|
||||
[RegularExpression("On Premise|Hybrid|Cloud")]
|
||||
public bool CloudTemplate { get; set; }
|
||||
[Column(Order = 3)]
|
||||
public string Version { get; set; }
|
||||
[Column(Order = 4)]
|
||||
public string Description { get; set; }
|
||||
[Column(Order = 5)]
|
||||
public string JSONData { get; set; }
|
||||
|
||||
public TemplateCategoryModel TemplateCategory { get; set; }
|
||||
|
||||
public ICollection<DeploymentGroupModel> DeploymentGroups { get; set; }
|
||||
public ICollection<TemplateOptionModel> TemplateOptions { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
19
Models/TemplateOptionModel.cs
Normal file
19
Models/TemplateOptionModel.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Microsoft.SelfService.Portal.Core.API.Models
|
||||
{
|
||||
public class TemplateOptionModel: BaseJunctionModel
|
||||
{
|
||||
[Column(Order = 0)]
|
||||
public Guid TemplateId { get; set; }
|
||||
public TemplateModel Template { get; set; }
|
||||
|
||||
[Column(Order = 1)]
|
||||
public Guid OptionId { get; set; }
|
||||
public OptionModel Option { get; set; }
|
||||
|
||||
[Column(Order = 2)]
|
||||
public string Value { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
19
Models/VirtualMachineModel.cs
Normal file
19
Models/VirtualMachineModel.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Microsoft.SelfService.Portal.Core.API.Models
|
||||
{
|
||||
public class VirtualMachineModel : BaseModel
|
||||
{
|
||||
[Column(Order = 1)]
|
||||
public Guid DomainID { get; set; }
|
||||
|
||||
[Column(Order = 2)]
|
||||
public string Name { get; set; }
|
||||
|
||||
public DomainModel Domain { get; set; }
|
||||
|
||||
public ICollection<DeploymentModel> Deployments { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user