This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AzureDevOpsInviteUserToOrganisationResponseDto | |
{ | |
public string id { get; set; } | |
public string status { get; set; } | |
public bool haveResultsSucceeded { get; set; } | |
public bool completed { get; set; } | |
public Result[] results { get; set; } | |
public class Result | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var (result, respond) = await apiCall.PatchAsync<InviteUserToOrganisationResponseDto>( | |
url: url, | |
password: appSecrets.AzureDevOpsToken, | |
body: request); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var request = new AzureDevOpsInviteUserToOrganisationRequestDto[] | |
{ | |
new AzureDevOpsInviteUserToOrganisationRequestDto() | |
{ | |
op = 0, | |
path = "", | |
from = "", | |
value = new AzureDevOpsInviteUserToOrganisationRequestDto.Value() | |
{ | |
accessLevel = new AzureDevOpsInviteUserToOrganisationRequestDto.Accesslevel() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AzureDevOpsGetOrganisationProjectsResponseDto | |
{ | |
public int count { get; set; } | |
public Value[] value { get; set; } | |
public class Value | |
{ | |
public string id { get; set; } | |
public string name { get; set; } | |
public string description { get; set; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int retries = 0; | |
while (true) | |
{ | |
if (retries > 10) | |
{ | |
return (null, EngineeringOpsConstants.ErrorCodes.GenericError); | |
} | |
Thread.Sleep(2000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public async Task<IEnumerable<ProjectViewModel>> GetProjects(string organisation) | |
{ | |
var url = $"https://dev.azure.com/{organisation}/_apis/projects?api-version=6.0"; | |
var (projects, response) = await apiCall.GetAsync<AzureDevOpsGetOrganisationProjectsResponseDto>( | |
url: url, | |
password: appSecrets.AzureDevOpsToken); | |
return projects.value.Select(p => new ProjectViewModel() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var (result, response) = await apiCall.PostAsync<AzureDevOpsCreateProjectResponseDto>( | |
url: url, | |
body: request, | |
password: appSecrets.AzureDevOpsToken); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var request = new AzureDevOpsCreateProjectRequestDto() | |
{ | |
name = project.Name, | |
visibility = "private" / "public", | |
description = "description", | |
capabilities = new AzureDevOpsCreateProjectRequestDto.CapabilitiesSettings() | |
{ | |
processTemplate = new AzureDevOpsCreateProjectRequestDto.Processtemplate() | |
{ | |
templateTypeId = "6b724908-ef14-45cf-84f8-768b5384da45", //fixed value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AzureDevOpsCreateProjectRequestDto | |
{ | |
public string name { get; set; } | |
public string description { get; set; } | |
public string visibility { get; set; } | |
public CapabilitiesSettings capabilities { get; set; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ingress: | |
enabled: true | |
className: "" | |
annotations: | |
# This needs to be specific domains, otherwise SignalR will fail | |
nginx.ingress.kubernetes.io/configuration-snippet: | | |
if ($http_origin ~* "^https?://((?:www\.domain-a\.com)|(?:www\.domain-b\.com)|(?:www\.domain-c\.io)|(?:www\.domain-d\.com))$") { | |
set $cors "true"; | |
} | |
if ($request_method = 'OPTIONS') { |