Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add etag property to ipam pool and verifier workspace #27103

Open
wants to merge 32 commits into
base: release-network-2024-07-01
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
46dc022
update data models
varunkosgi Feb 11, 2025
9a2cf9a
update test with etag
varunkosgi Feb 11, 2025
39a5616
update help
varunkosgi Feb 11, 2025
0cbb6ef
add etag to base resource
varunkosgi Feb 11, 2025
f601e3d
update changelog
varunkosgi Feb 11, 2025
b9d56ba
update file typo
varunkosgi Feb 12, 2025
fa76952
Merge branch 'release-network-2024-07-01' into varunkosgi/rebasefromr…
NoriZC Feb 13, 2025
0d099f0
inherit etag directly
varunkosgi Feb 13, 2025
300103c
Merge branch 'varunkosgi/rebasefromrelease' of /~https://github.com/var…
varunkosgi Feb 13, 2025
d8f44c8
revert intent
sssharma24 Feb 19, 2025
21b99ad
updating examples and base cmdlet
sssharma24 Feb 27, 2025
f2e215c
adding tests
sssharma24 Feb 27, 2025
755e246
update test
varunkosgi Feb 27, 2025
71654c6
Merge branch 'varunkosgi/rebasefromrelease' of /~https://github.com/var…
varunkosgi Feb 27, 2025
a3edb70
assert true ne
varunkosgi Feb 27, 2025
70add32
adding vnv tests
sssharma24 Feb 27, 2025
304b562
merge
sssharma24 Feb 27, 2025
4ca1778
update data models
varunkosgi Feb 11, 2025
105c149
update test with etag
varunkosgi Feb 11, 2025
bfd28b2
update help
varunkosgi Feb 11, 2025
4a86f39
add etag to base resource
varunkosgi Feb 11, 2025
7e1ec51
update changelog
varunkosgi Feb 11, 2025
8a3e5c8
update file typo
varunkosgi Feb 12, 2025
6f4dbeb
inherit etag directly
varunkosgi Feb 13, 2025
c9ecefa
revert intent
sssharma24 Feb 19, 2025
26c16a1
updating examples and base cmdlet
sssharma24 Feb 27, 2025
c3cf7be
adding tests
sssharma24 Feb 27, 2025
f8cc1a9
adding vnv tests
sssharma24 Feb 27, 2025
e6b1ebc
update test
varunkosgi Feb 27, 2025
8935548
assert true ne
varunkosgi Feb 27, 2025
f3aae70
rebase
varunkosgi Feb 28, 2025
7a93e39
updated readme
sssharma24 Feb 28, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion src/Network/Network.Management.Sdk/Generated/Models/IpamPool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,15 @@ public IpamPool()
/// <param name="properties">Properties of IpamPool resource properties which are specific to the Pool
/// resource.
/// </param>
public IpamPool(string location, IpamPoolProperties properties, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), System.Collections.Generic.IDictionary<string, string> tags = default(System.Collections.Generic.IDictionary<string, string>))

/// <param name="etag">String representing unique etag for the resource document.
/// </param>
public IpamPool(string location, IpamPoolProperties properties, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), System.Collections.Generic.IDictionary<string, string> tags = default(System.Collections.Generic.IDictionary<string, string>), string etag = default(string))

: base(location, id, name, type, systemData, tags)
{
this.Properties = properties;
this.Etag = etag;
CustomInit();
}

Expand All @@ -68,6 +72,12 @@ public IpamPool()
/// </summary>
[Newtonsoft.Json.JsonProperty(PropertyName = "properties")]
public IpamPoolProperties Properties {get; set; }

/// <summary>
/// Gets string representing unique etag for the resource document.
/// </summary>
[Newtonsoft.Json.JsonProperty(PropertyName = "etag")]
public string Etag {get; private set; }
/// <summary>
/// Validate the object.
/// </summary>
Expand All @@ -85,6 +95,7 @@ public override void Validate()
{
this.Properties.Validate();
}

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,15 @@ public VerifierWorkspace()

/// <param name="properties">Properties of Verifier Workspace resource.
/// </param>
public VerifierWorkspace(string location, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), System.Collections.Generic.IDictionary<string, string> tags = default(System.Collections.Generic.IDictionary<string, string>), VerifierWorkspaceProperties properties = default(VerifierWorkspaceProperties))

/// <param name="etag">String representing unique etag for the resource document.
/// </param>
public VerifierWorkspace(string location, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), System.Collections.Generic.IDictionary<string, string> tags = default(System.Collections.Generic.IDictionary<string, string>), VerifierWorkspaceProperties properties = default(VerifierWorkspaceProperties), string etag = default(string))

: base(location, id, name, type, systemData, tags)
{
this.Properties = properties;
this.Etag = etag;
CustomInit();
}

Expand All @@ -66,6 +70,12 @@ public VerifierWorkspace()
/// </summary>
[Newtonsoft.Json.JsonProperty(PropertyName = "properties")]
public VerifierWorkspaceProperties Properties {get; set; }

/// <summary>
/// Gets string representing unique etag for the resource document.
/// </summary>
[Newtonsoft.Json.JsonProperty(PropertyName = "etag")]
public string Etag {get; private set; }
/// <summary>
/// Validate the object.
/// </summary>
Expand All @@ -76,6 +86,7 @@ public override void Validate()
{
base.Validate();


}
}
}
2 changes: 1 addition & 1 deletion src/Network/Network.Management.Sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use-extension:

###
``` yaml
commit: 35c7a3a955361c00821b191db6e86c29f84c4e71
commit: e435018b7181624eea4c4f77648c3d8c7e245911
input-file:
- /~https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/network/resource-manager/Microsoft.Network/stable/2024-07-01/applicationGateway.json
- /~https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/network/resource-manager/Microsoft.Network/stable/2024-07-01/applicationGatewayWafDynamicManifests.json
Expand Down
23 changes: 23 additions & 0 deletions src/Network/Network.Test/ScenarioTests/NetworkManagerTests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -1460,12 +1460,25 @@ function Test-NetworkManagerIpamPoolCRUD
Assert-AreEqual $rglocation $ipamPool.Location;
Assert-AreEqual $ipamPool.Properties.AddressPrefixes[0] $addressPrefixes[0];
Assert-AreEqual $ipamPool.Tags.Count 1;
Assert-NotNull $ipamPool.Etag;

# List pools
$listPools = Get-AzNetworkManagerIpamPool -ResourceGroupName $rgname -NetworkManagerName $networkManagerName
Assert-AreEqual 1 @($listPools).Count
Assert-AreEqual $listPools[0].ResourceGroupName $ipamPool.ResourceGroupName
Assert-AreEqual $listPools[0].Name $ipamPool.Name
Assert-AreEqual $listPools[0].Location $ipamPool.Location
Assert-AreEqual $listPools[0].ProvisioningState $ipamPool.ProvisioningState
Assert-AreEqual $listPools[0].Etag $ipamPool.Etag

# Update access
$ipamPool.Properties.AddressPrefixes.Add("11.0.0.0/8");
$newIpamPool = Set-AzNetworkManagerIpamPool -InputObject $ipamPool
Assert-AreEqual $newIpamPool.Properties.AddressPrefixes[0] "10.0.0.0/8";
Assert-AreEqual $newIpamPool.Properties.AddressPrefixes[1] "11.0.0.0/8";

# Etag should change after update
Assert-True {$newIpamPool.Etag -ne $ipamPool.Etag};

# Get Pool Usage
$poolUsage = Get-AzNetworkManagerIpamPoolUsage -ResourceGroupName $rgName -NetworkManagerName $networkManagerName -IpamPoolName $ipamPoolName
Expand Down Expand Up @@ -1582,6 +1595,8 @@ function Test-NetworkManagerVerifierWorkspaceReachabilityAnalysisRunCRUD
Assert-AreEqual $verifierWorkspaceName $verifierWorkspace.Name;
Assert-AreEqual $rglocation $verifierWorkspace.Location;
Assert-AreEqual $verifierWorkspace.Tags.Count 1;
Assert-NotNull $verifierWorkspace.Etag;
$oldEtag = $verifierWorkspace.Etag;

# Get verifier workspace list
$verifierWorkspaceList = Get-AzNetworkManagerVerifierWorkspace -ResourceGroupName $rgName -NetworkManagerName $networkManagerName
Expand All @@ -1594,6 +1609,14 @@ function Test-NetworkManagerVerifierWorkspaceReachabilityAnalysisRunCRUD
Assert-NotNull $verifierWorkspace
Assert-AreEqual $resourceId $verifierWorkspace.Id

# Set by InputObject
$verifierWorkspace.Properties.Description = "A different description."
$verifierWorkspace = Set-AzNetworkManagerVerifierWorkspace -InputObject $verifierWorkspace
Assert-AreEqual "A different description." $verifierWorkspace.Properties.Description

#Etag should change after update
Assert-True {$verifierWorkspace.Etag -ne $oldEtag}

# Create analysis intent
$sourcePortList = @("100")
$destinationPortList = @("99")
Expand Down
Loading
Loading