Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
2 changes: 1 addition & 1 deletion src/EventGrid/EventGrid.Test/EventGrid.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Azure.Management.EventGrid" Version="6.0.0" />
<PackageReference Include="Microsoft.Azure.Management.EventGrid" Version="7.0.0" />
<PackageReference Include="Microsoft.Azure.Management.EventHub" Version="4.0.0" />
<PackageReference Include="Microsoft.Azure.Management.Relay" Version="2.0.2" />
<PackageReference Include="Microsoft.Azure.Management.ServiceBus" Version="3.0.0" />
Expand Down
41 changes: 41 additions & 0 deletions src/EventGrid/EventGrid.Test/ScenarioTests/SystemTopicTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// ----------------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------------------------------------------------------------

using Microsoft.Azure.Commands.EventGrid.Test.ScenarioTests;
using Microsoft.Azure.ServiceManagement.Common.Models;
using Microsoft.WindowsAzure.Commands.ScenarioTest;
using Microsoft.WindowsAzure.Commands.Test.Utilities.Common;
using Xunit;
using Xunit.Abstractions;

namespace Microsoft.Azure.Commands.EventGrid.Test.ScenarioTests
{
public class SystemTopicTests : RMTestBase
{
public XunitTracingInterceptor _logger;

public SystemTopicTests(ITestOutputHelper output)
{
_logger = new XunitTracingInterceptor(output);
XunitTracingInterceptor.AddToContext(_logger);
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void EventGrid_TopicsGetKey()
{
EventGridController.NewInstance.RunPsTest(_logger, "SystemTopicTests");
}
}
}
50 changes: 50 additions & 0 deletions src/EventGrid/EventGrid.Test/ScenarioTests/SystemTopicTests.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# ----------------------------------------------------------------------------------
#
# Copyright Microsoft Corporation
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ----------------------------------------------------------------------------------

<#
.SYNOPSIS
Tests EventGrid Topic Create, Get and List operations.
#>
function SystemTopicTests {
# Setup
$location = Get-LocationForEventGrid
$topicName = Get-TopicName
$topicName2 = Get-TopicName
$topicName3 = Get-TopicName
$topicName4 = Get-TopicName
$resourceGroupName = Get-ResourceGroupName
$secondResourceGroup = Get-ResourceGroupName
$subscriptionId = Get-SubscriptionId

#New-ResourceGroup $resourceGroupName $location

#New-ResourceGroup $secondResourceGroup $location

try
{


Write-Debug "Getting all the system topics created in the subscription"
$allCreatedTopics = Get-AzEventGridSystemTopic
Write "$allCreatedTopics"
Assert-True {$allCreatedTopics.PsTopicsList.Count -ge 0} "Topics created earlier are not found."


}
finally
{

}
}

8 changes: 6 additions & 2 deletions src/EventGrid/EventGrid.sln
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27703.2042
# Visual Studio Version 16
VisualStudioVersion = 16.0.32228.343
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventGrid", "EventGrid\EventGrid.csproj", "{07EF53EF-7CB0-4E7D-B41A-BBF96E5357D7}"
EndProject
Expand Down Expand Up @@ -48,6 +48,10 @@ Global
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.Build.0 = Release|Any CPU
{6BD6B80A-06AF-4B5B-9230-69CCFC6C8D64}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6BD6B80A-06AF-4B5B-9230-69CCFC6C8D64}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6BD6B80A-06AF-4B5B-9230-69CCFC6C8D64}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6BD6B80A-06AF-4B5B-9230-69CCFC6C8D64}.Release|Any CPU.Build.0 = Release|Any CPU
{1E60D2AC-DEA7-403C-86DC-7B8C47F54668}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1E60D2AC-DEA7-403C-86DC-7B8C47F54668}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1E60D2AC-DEA7-403C-86DC-7B8C47F54668}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down
2 changes: 1 addition & 1 deletion src/EventGrid/EventGrid/Az.EventGrid.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ CmdletsToExport = 'New-AzEventGridTopic', 'Get-AzEventGridTopic',
'Get-AzEventGridDomain', 'Get-AzEventGridDomainTopic',
'Get-AzEventGridDomainKey', 'New-AzEventGridDomainKey',
'Remove-AzEventGridDomain', 'New-AzEventGridDomainTopic',
'Remove-AzEventGridDomainTopic'
'Remove-AzEventGridDomainTopic', 'Get-AzEventGridSystemTopic'

# Variables to export from this module
# VariablesToExport = @()
Expand Down
1 change: 1 addition & 0 deletions src/EventGrid/EventGrid/AzureEventGridCmdletBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public abstract class AzureEventGridCmdletBase : AzureRMCmdlet
protected const string EventSubscriptionDomainTopicNameParameterSet = "EventSubscriptionDomainTopicNameParameterSet";

protected const string TopicNameParameterSet = "TopicNameParameterSet";
protected const string SystemTopicNameParameterSet = "SystemTopicNameParameterSet";
protected const string ResourceGroupNameParameterSet = "ResourceGroupNameParameterSet";
protected const string CustomTopicEventSubscriptionParameterSet = "CustomTopicEventSubscriptionParameterSet";
protected const string SubscriptionAndResourceGroupEventSubscriptionParameterSet = "SubscriptionAndResourceGroupEventSubscriptionParameterSet";
Expand Down
2 changes: 1 addition & 1 deletion src/EventGrid/EventGrid/EventGrid.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Azure.Management.EventGrid" Version="6.0.0" />
<PackageReference Include="Microsoft.Azure.Management.EventGrid" Version="7.0.0" />
</ItemGroup>

</Project>
35 changes: 35 additions & 0 deletions src/EventGrid/EventGrid/Models/PSSystemTopicListPagedInstance.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// ----------------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------------------------------------------------------------

using Microsoft.Azure.Management.EventGrid.Models;
using System.Collections.Generic;

namespace Microsoft.Azure.Commands.EventGrid.Models
{
public class PSSystemTopicListPagedInstance
{
public List<PSSytemTopicListInstance> PsTopicsList = new List<PSSytemTopicListInstance>();
public string NextLink;

public PSSystemTopicListPagedInstance(IEnumerable<SystemTopic> topicsList, string nextLink)
{
foreach (SystemTopic topic in topicsList)
{
this.PsTopicsList.Add(new PSSytemTopicListInstance(topic));
}

this.NextLink = nextLink;
}
}
}
67 changes: 67 additions & 0 deletions src/EventGrid/EventGrid/Models/PSSytemTopic.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
// ----------------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------------------------------------------------------------

using System.Collections.Generic;
using Microsoft.Azure.Commands.EventGrid.Utilities;
using Microsoft.Azure.Management.EventGrid.Models;

namespace Microsoft.Azure.Commands.EventGrid.Models
{
public class PSSystemTopic
{
public PSSystemTopic(SystemTopic topic)
{
this.Id = topic.Id;
this.Identity = topic.Identity;
this.Location = topic.Location;
this.MetricResourceId = topic.MetricResourceId;
this.TopicName = topic.Name;
this.ProvisioningState = topic.ProvisioningState;
this.Source = topic.Source;
this.SystemData = topic.SystemData;
this.Tags = topic.Tags;
this.TopicType = topic.TopicType;
this.Type = topic.Type;
this.ResourceGroupName = EventGridUtils.ParseResourceGroupFromId(topic.Id);

}

public string ResourceGroupName { get; set; }

public string TopicName { get; set; }

public string Id { get; set; }
public IdentityInfo Identity { get; set; }
public string Type { get; set; }

public string Location { get; set; }
public string MetricResourceId { get; set; }

public string ProvisioningState { get; set; }
public string Source { get; set; }
public SystemData SystemData { get; set; }
Comment thread
BethanyZhou marked this conversation as resolved.
Outdated

public IDictionary<string, string> Tags { get; set; }
public string TopicType { get; private set; }

/// <summary>
/// Return a string representation of this topic
/// </summary>
/// <returns>null</returns>
public override string ToString()
Comment thread
BethanyZhou marked this conversation as resolved.
Outdated
{
return null;
}
}
}
27 changes: 27 additions & 0 deletions src/EventGrid/EventGrid/Models/PSSytemTopicListInstance.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// ----------------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------------------------------------------------------------


using Microsoft.Azure.Management.EventGrid.Models;

namespace Microsoft.Azure.Commands.EventGrid.Models
{
public class PSSytemTopicListInstance : PSSystemTopic
{
public PSSytemTopicListInstance(SystemTopic topic) :
base(topic)
{
}
}
}
Loading