Skip to content

Commit 77b2131

Browse files
Adding Relay testcases (Azure#32987)
* Adding Relay testcases * Adding publicNetworkAccess to editbrowsable never and test additions * Edit description on PublicNetworkAccess * Fixing Comments * CI fixes * update description Co-authored-by: Yao Kou <[email protected]>
1 parent 836658e commit 77b2131

31 files changed

+15453
-13
lines changed

sdk/relay/Azure.ResourceManager.Relay/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
### Features Added
66

7+
- Added support for PublicNetworkAccess in NetworkRuleSet API as PublicNetworkAccess at Namespace API is not currently available.
8+
79
### Breaking Changes
810

911
### Bugs Fixed

sdk/relay/Azure.ResourceManager.Relay/api/Azure.ResourceManager.Relay.netstandard2.0.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ public RelayNamespaceData(Azure.Core.AzureLocation location) : base (default(Azu
155155
public string MetricId { get { throw null; } }
156156
public System.Collections.Generic.IList<Azure.ResourceManager.Relay.RelayPrivateEndpointConnectionData> PrivateEndpointConnections { get { throw null; } }
157157
public string ProvisioningState { get { throw null; } }
158+
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
158159
public Azure.ResourceManager.Relay.Models.RelayPublicNetworkAccess? PublicNetworkAccess { get { throw null; } set { } }
159160
public string ServiceBusEndpoint { get { throw null; } }
160161
public Azure.ResourceManager.Relay.Models.RelaySku Sku { get { throw null; } set { } }
@@ -202,6 +203,7 @@ public partial class RelayNetworkRuleSetData : Azure.ResourceManager.Models.Reso
202203
public RelayNetworkRuleSetData() { }
203204
public Azure.ResourceManager.Relay.Models.RelayNetworkRuleSetDefaultAction? DefaultAction { get { throw null; } set { } }
204205
public System.Collections.Generic.IList<Azure.ResourceManager.Relay.Models.RelayNetworkRuleSetIPRule> IPRules { get { throw null; } }
206+
public Azure.ResourceManager.Relay.Models.RelayPublicNetworkAccess? PublicNetworkAccess { get { throw null; } set { } }
205207
}
206208
public partial class RelayNetworkRuleSetResource : Azure.ResourceManager.ArmResource
207209
{
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
#nullable disable
4+
using System;
5+
using System.Collections.Generic;
6+
using System.ComponentModel;
7+
using Azure.Core;
8+
using Azure.ResourceManager.Models;
9+
using Azure.ResourceManager.Relay.Models;
10+
namespace Azure.ResourceManager.Relay
11+
{
12+
/// <summary> A class representing the RelayNamespace data model. </summary>
13+
public partial class RelayNamespaceData : TrackedResourceData
14+
{
15+
/// <summary> This determines if traffic is allowed over public network. By default it is enabled. DO NOT USE PublicNetworkAccess on Namespace API. Please use the NetworkRuleSet API to enable or disable PublicNetworkAccess. </summary>
16+
[EditorBrowsable(EditorBrowsableState.Never)]
17+
public RelayPublicNetworkAccess? PublicNetworkAccess { get; set; }
18+
}
19+
}

sdk/relay/Azure.ResourceManager.Relay/src/Generated/Models/RelayNamespacePatch.cs

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/relay/Azure.ResourceManager.Relay/src/Generated/Models/RelayNetworkRuleSetData.Serialization.cs

Lines changed: 17 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/relay/Azure.ResourceManager.Relay/src/Generated/Models/RelayPublicNetworkAccess.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/relay/Azure.ResourceManager.Relay/src/Generated/RelayNamespaceData.cs

Lines changed: 1 addition & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/relay/Azure.ResourceManager.Relay/src/Generated/RelayNetworkRuleSetData.cs

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/relay/Azure.ResourceManager.Relay/src/autorest.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ azure-arm: true
88
csharp: true
99
library-name: Relay
1010
namespace: Azure.ResourceManager.Relay
11-
require: https://github.com/Azure/azure-rest-api-specs/tree/cc8796418bed73e7e3755d8a6a2d84abcb3ec7f4/specification/relay/resource-manager/readme.md
11+
require: https://github.com/Azure/azure-rest-api-specs/blob/df77748f7dff3fe12c13b7262e9b307c719e6918/specification/relay/resource-manager/readme.md
1212
output-folder: $(this-folder)/Generated
1313
clear-output-folder: true
1414
skip-csproj: true
@@ -78,8 +78,12 @@ rename-mapping:
7878
HybridConnection: RelayHybridConnection
7979

8080
directive:
81-
from: NetworkRuleSets.json
82-
where: $.definitions
83-
transform: >
84-
$.NWRuleSetIpRules['x-ms-client-name'] = 'RelayNetworkRuleSetIPRule';
81+
- from: NetworkRuleSets.json
82+
where: $.definitions
83+
transform: >
84+
$.NWRuleSetIpRules['x-ms-client-name'] = 'RelayNetworkRuleSetIPRule';
85+
- from: Namespaces.json
86+
where: $.definitions
87+
transform: >
88+
$.RelayNamespaceProperties.properties.publicNetworkAccess['description'] = 'This determines if traffic is allowed over public network. By default it is enabled. DO NOT USE PublicNetworkAccess on Namespace API. Please use the NetworkRuleSet API to enable or disable PublicNetworkAccess.';
8589
```

sdk/relay/Azure.ResourceManager.Relay/tests/Azure.ResourceManager.Relay.Tests.csproj

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,11 @@
22
<ItemGroup>
33
<ProjectReference Include="..\src\Azure.ResourceManager.Relay.csproj" />
44
</ItemGroup>
5+
<ItemGroup>
6+
<Folder Include="SessionRecords\" />
7+
</ItemGroup>
8+
<ItemGroup>
9+
<PackageReference Include="Azure.ResourceManager.ManagedServiceIdentities" VersionOverride="1.0.0" />
10+
<PackageReference Include="Azure.ResourceManager.Network" />
11+
</ItemGroup>
512
</Project>

0 commit comments

Comments
 (0)