Skip to content

Commit

Permalink
Merge pull request #896 from OctopusDeploy/huy/2024/4/deployment-supp…
Browse files Browse the repository at this point in the history
…ort-tenant-scope

Deployment support tenant scope
  • Loading branch information
HuyPhanNguyen authored Nov 21, 2024
2 parents b19a796 + 0d40a6a commit 29c23ec
Show file tree
Hide file tree
Showing 10 changed files with 73 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6578,6 +6578,7 @@ Octopus.Client.Model.DeploymentFreezes
String Name { get; set; }
Dictionary<String, ReferenceCollection> ProjectEnvironmentScope { get; set; }
DateTimeOffset Start { get; set; }
List<TenantProjectEnvironment> TenantProjectEnvironmentScope { get; set; }
}
class CreateDeploymentFreezeResponse
{
Expand All @@ -6587,6 +6588,7 @@ Octopus.Client.Model.DeploymentFreezes
String Name { get; set; }
Dictionary<String, ReferenceCollection> ProjectEnvironmentScope { get; set; }
DateTimeOffset Start { get; set; }
List<TenantProjectEnvironment> TenantProjectEnvironmentScope { get; set; }
}
class DeleteDeploymentFreezeCommand
{
Expand All @@ -6609,6 +6611,7 @@ Octopus.Client.Model.DeploymentFreezes
String Name { get; set; }
Dictionary<String, ReferenceCollection> ProjectEnvironmentScope { get; set; }
DateTimeOffset Start { get; set; }
List<TenantProjectEnvironment> TenantProjectEnvironmentScope { get; set; }
}
class GetDeploymentFreezeByIdRequest
{
Expand All @@ -6623,6 +6626,7 @@ Octopus.Client.Model.DeploymentFreezes
String Name { get; set; }
Dictionary<String, ReferenceCollection> ProjectEnvironmentScope { get; }
DateTimeOffset Start { get; set; }
List<TenantProjectEnvironment> TenantProjectEnvironmentScope { get; }
}
class GetDeploymentFreezesRequest
{
Expand All @@ -6633,6 +6637,7 @@ Octopus.Client.Model.DeploymentFreezes
IReadOnlyCollection<String> ProjectIds { get; set; }
Int32 Skip { get; set; }
Int32 Take { get; set; }
IReadOnlyCollection<String> TenantIds { get; set; }
}
class GetDeploymentFreezesResponse
{
Expand All @@ -6648,6 +6653,7 @@ Octopus.Client.Model.DeploymentFreezes
String Name { get; set; }
Dictionary<String, ReferenceCollection> ProjectEnvironmentScope { get; set; }
DateTimeOffset Start { get; set; }
List<TenantProjectEnvironment> TenantProjectEnvironmentScope { get; set; }
}
class ModifyDeploymentFreezeResponse
{
Expand All @@ -6657,6 +6663,14 @@ Octopus.Client.Model.DeploymentFreezes
String Name { get; set; }
Dictionary<String, ReferenceCollection> ProjectEnvironmentScope { get; set; }
DateTimeOffset Start { get; set; }
List<TenantProjectEnvironment> TenantProjectEnvironmentScope { get; set; }
}
class TenantProjectEnvironment
{
.ctor()
String EnvironmentId { get; set; }
String ProjectId { get; set; }
String TenantId { get; set; }
}
}
Octopus.Client.Model.DeploymentProcess
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6602,6 +6602,7 @@ Octopus.Client.Model.DeploymentFreezes
String Name { get; set; }
Dictionary<String, ReferenceCollection> ProjectEnvironmentScope { get; set; }
DateTimeOffset Start { get; set; }
List<TenantProjectEnvironment> TenantProjectEnvironmentScope { get; set; }
}
class CreateDeploymentFreezeResponse
{
Expand All @@ -6611,6 +6612,7 @@ Octopus.Client.Model.DeploymentFreezes
String Name { get; set; }
Dictionary<String, ReferenceCollection> ProjectEnvironmentScope { get; set; }
DateTimeOffset Start { get; set; }
List<TenantProjectEnvironment> TenantProjectEnvironmentScope { get; set; }
}
class DeleteDeploymentFreezeCommand
{
Expand All @@ -6633,6 +6635,7 @@ Octopus.Client.Model.DeploymentFreezes
String Name { get; set; }
Dictionary<String, ReferenceCollection> ProjectEnvironmentScope { get; set; }
DateTimeOffset Start { get; set; }
List<TenantProjectEnvironment> TenantProjectEnvironmentScope { get; set; }
}
class GetDeploymentFreezeByIdRequest
{
Expand All @@ -6647,6 +6650,7 @@ Octopus.Client.Model.DeploymentFreezes
String Name { get; set; }
Dictionary<String, ReferenceCollection> ProjectEnvironmentScope { get; }
DateTimeOffset Start { get; set; }
List<TenantProjectEnvironment> TenantProjectEnvironmentScope { get; }
}
class GetDeploymentFreezesRequest
{
Expand All @@ -6657,6 +6661,7 @@ Octopus.Client.Model.DeploymentFreezes
IReadOnlyCollection<String> ProjectIds { get; set; }
Int32 Skip { get; set; }
Int32 Take { get; set; }
IReadOnlyCollection<String> TenantIds { get; set; }
}
class GetDeploymentFreezesResponse
{
Expand All @@ -6672,6 +6677,7 @@ Octopus.Client.Model.DeploymentFreezes
String Name { get; set; }
Dictionary<String, ReferenceCollection> ProjectEnvironmentScope { get; set; }
DateTimeOffset Start { get; set; }
List<TenantProjectEnvironment> TenantProjectEnvironmentScope { get; set; }
}
class ModifyDeploymentFreezeResponse
{
Expand All @@ -6681,6 +6687,14 @@ Octopus.Client.Model.DeploymentFreezes
String Name { get; set; }
Dictionary<String, ReferenceCollection> ProjectEnvironmentScope { get; set; }
DateTimeOffset Start { get; set; }
List<TenantProjectEnvironment> TenantProjectEnvironmentScope { get; set; }
}
class TenantProjectEnvironment
{
.ctor()
String EnvironmentId { get; set; }
String ProjectId { get; set; }
String TenantId { get; set; }
}
}
Octopus.Client.Model.DeploymentProcess
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Octopus.Server.MessageContracts.Base.Attributes;

namespace Octopus.Client.Model.DeploymentFreezes;

Expand All @@ -17,6 +18,9 @@ public class CreateDeploymentFreezeCommand
[Required(ErrorMessage = "Please provide an end time.")]
public DateTimeOffset End { get; set; }

[Required]
[Optional]
public Dictionary<string, ReferenceCollection> ProjectEnvironmentScope { get; set; }

[Optional]
public List<TenantProjectEnvironment> TenantProjectEnvironmentScope { get; set; }
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Octopus.Server.MessageContracts.Base.Attributes;

namespace Octopus.Client.Model.DeploymentFreezes;

Expand All @@ -18,6 +19,10 @@ public class CreateDeploymentFreezeResponse
[Required]
public DateTimeOffset End { get; set; }

[Required]
public Dictionary<string, ReferenceCollection> ProjectEnvironmentScope { get; set; }
[Optional]
public Dictionary<string, ReferenceCollection> ProjectEnvironmentScope { get; set; }

[Optional]
public List<TenantProjectEnvironment> TenantProjectEnvironmentScope { get; set; }

}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Octopus.Server.MessageContracts.Base.Attributes;

namespace Octopus.Client.Model.DeploymentFreezes;

Expand All @@ -17,7 +18,11 @@ public class GetDeploymentFreezeByIdResponse

[Required]
public DateTimeOffset End { get; set; }

[Required]
[Optional]
public Dictionary<string, ReferenceCollection> ProjectEnvironmentScope { get; protected set; }

[Optional]
public List<TenantProjectEnvironment> TenantProjectEnvironmentScope { get; protected set; }

}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ public class GetDeploymentFreezesRequest
/// </summary>
[Optional]
public IReadOnlyCollection<string> ProjectIds { get; set; } = Array.Empty<string>();

/// <summary>
/// List of Tenant IDs which if specified, filters the result to only include DeploymentFreeze with matching Project IDs.
/// </summary>
[Optional]
public IReadOnlyCollection<string> TenantIds { get; set; } = Array.Empty<string>();

/// <summary>
/// List of Environment IDs which if specified, filters the result to only include DeploymentFreeze with matching Environment IDs.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Octopus.Server.MessageContracts.Base.Attributes;

namespace Octopus.Client.Model.DeploymentFreezes;

Expand All @@ -21,5 +22,7 @@ public class DeploymentFreezeResource

[Required] public DateTimeOffset End { get; set; }

[Required] public Dictionary<string, ReferenceCollection> ProjectEnvironmentScope { get; set; }
[Optional] public Dictionary<string, ReferenceCollection> ProjectEnvironmentScope { get; set; }

[Optional] public List<TenantProjectEnvironment> TenantProjectEnvironmentScope { get; set; }
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Octopus.Server.MessageContracts.Base.Attributes;

namespace Octopus.Client.Model.DeploymentFreezes;

Expand All @@ -19,5 +20,7 @@ public class ModifyDeploymentFreezeCommand
[Required(ErrorMessage = "Please provide an end time.")]
public DateTimeOffset End { get; set; }

[Required] public Dictionary<string, ReferenceCollection> ProjectEnvironmentScope { get; set; }
[Optional] public Dictionary<string, ReferenceCollection> ProjectEnvironmentScope { get; set; }

[Optional] public List<TenantProjectEnvironment> TenantProjectEnvironmentScope { get; set; }
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Octopus.Server.MessageContracts.Base.Attributes;

namespace Octopus.Client.Model.DeploymentFreezes;

Expand All @@ -14,5 +15,7 @@ public class ModifyDeploymentFreezeResponse

[Required] public DateTimeOffset End { get; set; }

[Required] public Dictionary<string, ReferenceCollection> ProjectEnvironmentScope { get; set; }
[Optional] public Dictionary<string, ReferenceCollection> ProjectEnvironmentScope { get; set; }

[Optional] public List<TenantProjectEnvironment> TenantProjectEnvironmentScope { get; set; }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace Octopus.Client.Model.DeploymentFreezes;

public class TenantProjectEnvironment
{
public string TenantId { get; set; }
public string ProjectId { get; set; }
public string EnvironmentId { get; set; }
}

0 comments on commit 29c23ec

Please sign in to comment.