Skip to content

Commit

Permalink
Update and delete green grass deployment (#2113)
Browse files Browse the repository at this point in the history
* retrieve json attribute from Recipe

* Update creation Deployment method + Get Deployment method

* FIX Existing Failed Tests

* Update method done (But not tested)

* Fix Failed Tests + All tests for the update and the Get Deployment Done

* retrieve json attribute from Recipe

* Update creation Deployment method + Get Deployment method

* retrieve json attribute from Recipe

* Update creation Deployment method + Get Deployment method

* Change IdProvider to ExternalIdentifier + Delete Deployment (DONE)
  • Loading branch information
ssgueye2 authored and kbeaugrand committed Jun 22, 2023
1 parent b95edc2 commit 1422550
Show file tree
Hide file tree
Showing 22 changed files with 2,257 additions and 506 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -198,17 +198,17 @@
</MudExpansionPanel>
</MudItem>
</MudGrid>
<MudGrid>
<MudItem xs="12">
<MudExpansionPanel Text="Labels">
<TitleContent><MudText Typo="Typo.h6">Labels</MudText></TitleContent>
<ChildContent>
<LabelsEditor Labels="Model.Labels" />
</ChildContent>
</MudExpansionPanel>
</MudItem>
</MudGrid>
}
<MudGrid>
<MudItem xs="12">
<MudExpansionPanel Text="Labels">
<TitleContent><MudText Typo="Typo.h6">Labels</MudText></TitleContent>
<ChildContent>
<LabelsEditor Labels="Model.Labels" />
</ChildContent>
</MudExpansionPanel>
</MudItem>
</MudGrid>

</MudExpansionPanels>
</MudTabPanel>
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,21 @@
<MudAlert Severity="Severity.Info"><MudLink Href="https://learn.microsoft.com/en-us/azure/iot-edge/how-to-use-create-options" Target="_blank ">How to configure container create options for IoT Edge modules</MudLink></MudAlert>
</MudItem>
}

else
{
<MudItem xs="5">
<MudTextField @bind-Value="@currentNumVersion"
id=@nameof(IoTEdgeModule.Version)
Label="Version Number"
Variant="Variant.Outlined"
For="@(() => Module.Version)"
Required="true"/>
</MudItem>
<MudItem xs="12">
<MudAlert Severity="Severity.Warning">The Version Number should be incremented when updating the component</MudAlert>
</MudItem>
}

</MudGrid>

<MudTabs Elevation="1" Class="mt-10" Rounded="true" PanelClass="mt-6">
Expand Down Expand Up @@ -77,6 +91,7 @@
private string currentModuleName = default!;
private string currentImageUri = default!;
private string currentContainerCreateOptions = default!;
private string currentNumVersion = "1.0.0";

private List<IoTEdgeModuleEnvironmentVariable> currentEnvironmentVariables = new();
private List<IoTEdgeModuleTwinSetting> currentModuleIdentityTwinSettings = new();
Expand All @@ -92,6 +107,7 @@
currentModuleName = Module.ModuleName;
currentImageUri = Module.ImageURI;
currentContainerCreateOptions = Module.ContainerCreateOptions;
currentNumVersion = Module.Version;
currentEnvironmentVariables = new List<IoTEdgeModuleEnvironmentVariable>(Module.EnvironmentVariables.ToArray());
currentModuleIdentityTwinSettings = new List<IoTEdgeModuleTwinSetting>(Module.ModuleIdentityTwinSettings.ToArray());
currentCommands = new List<IoTEdgeModuleCommand>(Module.Commands.ToArray());
Expand All @@ -104,6 +120,10 @@
Module.ModuleName = currentModuleName;
Module.ImageURI = currentImageUri;
Module.ContainerCreateOptions = currentContainerCreateOptions;

if (Portal.CloudProvider.Equals(CloudProviders.Azure)) { Module.Version = " "; }
else { Module.Version = currentNumVersion; }

Module.EnvironmentVariables = new List<IoTEdgeModuleEnvironmentVariable>(currentEnvironmentVariables.ToArray());
Module.ModuleIdentityTwinSettings = new List<IoTEdgeModuleTwinSetting>(currentModuleIdentityTwinSettings.ToArray());
Module.Commands = new List<IoTEdgeModuleCommand>(currentCommands.ToArray());
Expand Down
1 change: 1 addition & 0 deletions src/AzureIoTHub.Portal.Domain/ConfigHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,6 @@ public abstract class ConfigHandler
public abstract string AWSRegion { get; }
public abstract string AWSS3StorageConnectionString { get; }
public abstract string AWSBucketName { get; }
public abstract string AWSAccountId { get; }
}
}
1 change: 1 addition & 0 deletions src/AzureIoTHub.Portal.Domain/Entities/EdgeDeviceModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public class EdgeDeviceModel : EntityBase
public string Name { get; set; } = default!;

public string? Description { get; set; }
public string? ExternalIdentifier { get; set; }

/// <summary>
/// Labels
Expand Down
1 change: 1 addition & 0 deletions src/AzureIoTHub.Portal.Infrastructure/ConfigHandlerBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ internal abstract class ConfigHandlerBase : ConfigHandler
internal const string AWSRegionKey = "AWS:Region";
internal const string AWSS3StorageConnectionStringKey = "AWS:S3Storage:ConnectionString";
internal const string AWSBucketNameKey = "AWS:BucketName";
internal const string AWSAccountIdKey = "AWS:AccountId";

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,6 @@ internal DevelopmentConfigHandler(IConfiguration config)
public override string AWSRegion => this.config[AWSRegionKey]!;
public override string AWSS3StorageConnectionString => this.config[AWSS3StorageConnectionStringKey]!;
public override string AWSBucketName => this.config[AWSBucketNameKey]!;
public override string AWSAccountId => this.config[AWSAccountIdKey]!;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,7 @@ internal ProductionAWSConfigHandler(IConfiguration config)
public override string AWSRegion => this.config[AWSRegionKey]!;
public override string AWSS3StorageConnectionString => this.config[AWSS3StorageConnectionStringKey]!;
public override string AWSBucketName => this.config[AWSBucketNameKey]!;
public override string AWSAccountId => this.config[AWSAccountIdKey]!;

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -92,5 +92,7 @@ internal ProductionAzureConfigHandler(IConfiguration config)
public override string AWSS3StorageConnectionString => throw new NotImplementedException();

public override string AWSBucketName => throw new NotImplementedException();
public override string AWSAccountId => throw new NotImplementedException();

}
}
Loading

0 comments on commit 1422550

Please sign in to comment.